<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-584619127557205820</id><updated>2025-07-22T03:09:54.093+02:00</updated><category term="iphone"/><category term="wcf"/><category term="asp.net"/><category term="iOS"/><category term="silverlight"/><category term="oracle"/><category term="logging"/><category term="vs"/><category term="asp.net ajax"/><category term="debug"/><category term="xcode"/><category term="android"/><category term="reflection"/><category term="testing"/><category term="tfs"/><category term="wix"/><category term="introspection"/><category term="json"/><category term="patterns"/><category term="spring.net"/><category term="sqlite"/><category term="google engine"/><category term="sql server"/><category term="elixir"/><category term="mscrm"/><category term="performance"/><category term="powershell"/><category term="bla-bla"/><category term="msbuild"/><category term="process"/><category term="tibco"/><category term="ubuntu"/><category term="api design"/><category term="biztalk"/><category term="c#"/><category term="cocoa"/><category term="eclipse"/><category term="enterprise library"/><category term="proxmox"/><category term="python"/><category term="serialization"/><category term="taxican"/><category term="ux"/><category term="wpf"/><category term="AsRockRack"/><category term="REST"/><category term="TIL"/><category term="ansible"/><category term="bcl"/><category term="concurrency"/><category term="debian"/><category term="elastic"/><category term="elk"/><category term="entity framework"/><category term="erlang"/><category term="esp/cep"/><category term="filebeat"/><category term="foglight"/><category term="general"/><category term="hardware"/><category term="http"/><category term="intelnuc"/><category term="ironpython"/><category term="java"/><category term="javascript"/><category term="jinja"/><category term="kubernetes"/><category term="linux"/><category term="mac"/><category term="maps"/><category term="mef"/><category term="ml310e"/><category term="phoenix"/><category term="postgresql"/><category term="react"/><category term="redux"/><category term="security"/><category term="server"/><category term="traefik"/><category term="versioning"/><category term="vista"/><category term="vscode"/><category term="w3c"/><category term="webpack"/><category term="wetware"/><category term="wf"/><category term="windbg"/><category term="windows 2008"/><category term="xml"/><category term="xsl-fo"/><title type='text'>Plain Old Stan</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>233</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-7546828235368691179</id><published>2024-11-23T13:46:00.001+01:00</published><updated>2024-11-23T13:48:02.506+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ansible"/><category scheme="http://www.blogger.com/atom/ns#" term="jinja"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="traefik"/><category scheme="http://www.blogger.com/atom/ns#" term="vscode"/><title type='text'>Testing Traefik&#39;s dyn.toml jinja template generation with python.</title><content type='html'>&lt;p&gt;Thought I&#39;d share the simple python code to dry run the jinja template with variables. I needed to do it for the Traefik proxy dyn.toml. Especially with their change of using multiple Host and PathPrefix conditions, instead of having multiple parameters inside these.&lt;/p&gt;&lt;p&gt;Here is the code:&lt;/p&gt;
&lt;pre&gt;from jinja2 import Environment, select_autoescape, FileSystemLoader

env = Environment(loader=FileSystemLoader(
searchpath=&#39;./&#39;))

context = {
    &#39;fqdn&#39;: &#39;xx1.blocoware.com&#39;,
    &#39;http_services&#39;: [
{
    &#39;name&#39;: &#39;adiona&#39;,
    &#39;priority&#39;: &#39;2&#39;,
    &#39;path_prefix&#39;: &#39;`/prefix1/`, `/prefix2/`&#39;,
    &#39;all_fqdn_aliases&#39;: &#39;zz1.blocoware.com,xx1.blocoware.com,yy1.blocoware.com&#39;,
    &#39;ip_port&#39;: &#39;127.0.0.1:111&#39;
},
{
    &#39;name&#39;: &#39;beacon&#39;,
    &#39;priority&#39;: &#39;4&#39;,
    &#39;path_prefix&#39;: &#39;`/prefix2/`&#39;,
    &#39;all_fqdn_aliases&#39;: &#39;zz1.blocoware.com,xx1.blocoware.com,yy1.blocoware.com&#39;,
    &#39;ip_port&#39;: &#39;127.0.0.1:333&#39;
}
]}

template = env.get_template(&#39;dyn.toml.j2&#39;)

body = template.render(context)

print(body)
&lt;/pre&gt;

&lt;p&gt;
  And fragment of the dyn.toml.j2 to show the usage of the context:
&lt;/p&gt;
  
 &lt;pre&gt; [http.routers]
{% for service in http_services %}
  {% set domains = all_fqdn_aliases.split(&#39;,&#39;) %}
  {% set prefixes = service.path_prefix.split(&#39;,&#39;) %}
  [http.routers.{{ service.name }}]
    rule = &quot;({% for domain in domains %}Host(`{{ domain }}`){% if not loop.last %} || {% endif %}{% endfor %}) &amp;amp;&amp;amp; ({% for prefix in prefixes %}PathPrefix({{ prefix }}){% if not loop.last %} || {% endif %}{% endfor %})&quot;
    entrypoints = [&quot;main&quot;, &quot;main-secure&quot;]
    ...
&lt;/pre&gt;
&lt;p&gt;
Rendered fragment:
&lt;/p&gt;

&lt;pre&gt;  [http.routers.adiona]
    rule = &quot;(Host(`zz1.blocoware.com`) || Host(`xx1.blocoware.com`) || Host(`yy1.blocoware.com`)) &amp;amp;&amp;amp; (PathPrefix(`/prefix1/`) || PathPrefix( `/prefix2/`))&quot;
    entrypoints = [&quot;main&quot;, &quot;main-secure&quot;]
    ...
&lt;/pre&gt;

These are my first lines of python code ever, so I&#39;m letting you to cope with the python environment setup.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;div&gt;Somehow I confirmed to vscode to create this environment in some folder and I had to copy dyn.toml.j2 there, otherwise it could not find it, regardless the searchpath. Run button is fortunately just above the python window :). You&#39;ll need to install python extension, but vscode offers that once you create your first python file, cool.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope it might help someone.&amp;nbsp;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My regards to all jinjas!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/span&gt;&lt;div&gt;Resources:&lt;/div&gt;&lt;div&gt;Jinja:&amp;nbsp;&lt;a href=&quot;https://jinja.palletsprojects.com/en/stable/&quot;&gt;https://jinja.palletsprojects.com/en/stable/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Traefik Host and PathPrefix:&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://doc.traefik.io/traefik/routing/routers/#host-and-hostregexp&quot;&gt;https://doc.traefik.io/traefik/routing/routers/#host-and-hostregexp&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://doc.traefik.io/traefik/routing/routers/#path-pathprefix-and-pathregexp&quot;&gt;https://doc.traefik.io/traefik/routing/routers/#path-pathprefix-and-pathregexp&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/7546828235368691179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/7546828235368691179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/7546828235368691179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/7546828235368691179'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2024/11/testing-traefiks-dyntoml-jinja-template.html' title='Testing Traefik&#39;s dyn.toml jinja template generation with python.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-6283302850780714042</id><published>2024-11-16T20:08:00.005+01:00</published><updated>2024-11-16T20:09:09.412+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elastic"/><category scheme="http://www.blogger.com/atom/ns#" term="elk"/><category scheme="http://www.blogger.com/atom/ns#" term="filebeat"/><title type='text'>Elastic 7.1 &gt; 8.16. Journalbeat &gt; Filebeat. Migration notes.</title><content type='html'>&lt;p class=&quot;code-line&quot; data-line=&quot;2&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;Journalbeat is removed in 7.16&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;4&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;&lt;a data-href=&quot;https://github.com/elastic/observability-docs/issues/1173&quot; href=&quot;https://github.com/elastic/observability-docs/issues/1173&quot; style=&quot;text-decoration: var(--text-link-decoration);&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;https://github.com/elastic/observability-docs/issues/1173&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;6&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;Use filebeat&#39;s new input type of&amp;nbsp;&lt;code style=&quot;border-radius: 4px; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 1px 3px;&quot;&gt;journald&lt;/code&gt;:&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;8&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;&lt;a data-href=&quot;https://www.elastic.co/guide/en/beats/filebeat/master/filebeat-input-journald.html&quot; href=&quot;https://www.elastic.co/guide/en/beats/filebeat/master/filebeat-input-journald.html&quot; style=&quot;text-decoration: var(--text-link-decoration);&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;https://www.elastic.co/guide/en/beats/filebeat/master/filebeat-input-journald.html&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;10&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;Add input:&lt;/p&gt;&lt;pre style=&quot;border-radius: 3px; border: 1px solid var(--vscode-widget-border); font-size: 14px; font-variant-ligatures: normal; margin-top: 0px; orphans: 2; overflow: auto; padding: 16px; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-wrap-mode: wrap; widows: 2;&quot;&gt;&lt;code class=&quot;code-line code-active-line&quot; data-line=&quot;12&quot; dir=&quot;auto&quot; style=&quot;background: repeat; border-radius: 4px; display: inline-block; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 0px; position: relative; tab-size: 4;&quot;&gt;filebeat.inputs:
...
- type: journald
  id: everything
&lt;/code&gt;&lt;/pre&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;19&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;To avoid indices like:&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;21&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;&lt;code style=&quot;border-radius: 4px; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 1px 3px;&quot;&gt;filebeat-%{[fields][source]}-2024.11.16&lt;/code&gt;&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;23&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;Set fields, source in journald input type, e.g.:&lt;/p&gt;&lt;pre style=&quot;border-radius: 3px; border: 1px solid var(--vscode-widget-border); font-size: 14px; font-variant-ligatures: normal; margin-top: 0px; orphans: 2; overflow: auto; padding: 16px; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-wrap-mode: wrap; widows: 2;&quot;&gt;&lt;code class=&quot;code-line&quot; data-line=&quot;25&quot; dir=&quot;auto&quot; style=&quot;background: repeat; border-radius: 4px; display: inline-block; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 0px; position: relative; tab-size: 4;&quot;&gt;filebeat.inputs:
...
- type: journald
  id: everything
  fields:
    source: journal

&lt;/code&gt;&lt;/pre&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;35&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;That will lead to index names as:&lt;/p&gt;&lt;pre style=&quot;border-radius: 3px; border: 1px solid var(--vscode-widget-border); font-size: 14px; font-variant-ligatures: normal; margin-top: 0px; orphans: 2; overflow: auto; padding: 16px; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-wrap-mode: wrap; widows: 2;&quot;&gt;&lt;code class=&quot;code-line&quot; data-line=&quot;37&quot; dir=&quot;auto&quot; style=&quot;background: repeat; border-radius: 4px; display: inline-block; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 0px; position: relative; tab-size: 4;&quot;&gt;filebeat-journal-2024.11.16
&lt;/code&gt;&lt;/pre&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;41&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;I was trying with the index name configuration as described in docs:&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;43&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;&lt;a data-href=&quot;https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-journald.html#_index_13&quot; href=&quot;https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-journald.html#_index_13&quot; style=&quot;text-decoration: var(--text-link-decoration);&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-journald.html#_index_13&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class=&quot;code-line&quot; data-line=&quot;45&quot; dir=&quot;auto&quot; style=&quot;font-family: -apple-system, system-ui, &amp;quot;Segoe WPC&amp;quot;, &amp;quot;Segoe UI&amp;quot;, system-ui, Ubuntu, &amp;quot;Droid Sans&amp;quot;, sans-serif; font-size: 14px; font-variant-ligatures: normal; margin-bottom: 16px; margin-top: 0px; orphans: 2; position: relative; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; widows: 2;&quot;&gt;But I should have been doing something wrong, as I was only getting indices like&amp;nbsp;&lt;code style=&quot;border-radius: 4px; font-family: var(--vscode-editor-font-family, &amp;quot;SF Mono&amp;quot;, Monaco, Menlo, Consolas, &amp;quot;Ubuntu Mono&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace); font-size: 1em; line-height: 1.357em; padding: 1px 3px;&quot;&gt;filebeat-%{[fields][source]}-2024.11.16&lt;/code&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/6283302850780714042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/6283302850780714042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6283302850780714042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6283302850780714042'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2024/11/short-notes-on-migrating-from.html' title='Elastic 7.1 &gt; 8.16. Journalbeat &gt; Filebeat. Migration notes.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-8927663095408620466</id><published>2024-11-13T15:48:00.002+01:00</published><updated>2024-11-13T15:48:40.019+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="proxmox"/><title type='text'>Failed Proxmox 7 -&gt; 8 upgrade. I forgot to substitute bullseye with bookworm in one of the repository lists!</title><content type='html'>&lt;div&gt;&lt;span style=&quot;caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;They literally say in Proxmox wiki for 7 to 8 upgrade:&lt;/span&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;blockquote style=&quot;border-left: 0.25em solid var(--borderColor-default, var(--color-border-default)); box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px 1em;&quot;&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px;&quot;&gt;Ensure that there are no remaining Debian Bullseye specific repositories left, if you can use the # symbol at the start of the respective line to comment these repositories out. Check all files in the&amp;nbsp;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;&lt;b&gt;/etc/apt/sources.list.d/pve-enterprise.list&lt;/b&gt;&lt;/span&gt;&amp;nbsp;and /etc/apt/sources.list and see Package_Repositories for the correct Proxmox VE 8 / Debian Bookworm repositories.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style=&quot;caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px;&quot;&gt;And I managed to forget the one in the /etc/apt/sources.list.d/pve-enterprise.list. I should not have had it there in the first place, at that time I didn&#39;t know Proxmox at all.&lt;/span&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;So after following the upgrade steps and having&amp;nbsp;&lt;span style=&quot;box-sizing: border-box;&quot;&gt;no errors&lt;/span&gt;&amp;nbsp;after&amp;nbsp;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space: break-spaces;&quot;&gt;apt dist-upgrade&lt;/code&gt;&amp;nbsp;I faced no Web interface being available as the first sign of my failure.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space: break-spaces;&quot;&gt;journalctl -u pveproxy&lt;/code&gt;&amp;nbsp;showed:&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;Nov 13 14:24:08 pve62 pveproxy[314931]: ipcc_send_rec[3] failed: Connection refused
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;Nov 13 14:24:08 pve62 pveproxy[314931]: ipcc_send_rec[3] failed: Connection refused&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space: break-spaces;&quot;&gt;systemctl status pve-cluster&lt;/code&gt;&amp;nbsp;showed:&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;○ pve-cluster.service
     Loaded: masked (Reason: Unit pve-cluster.service is masked.)
     Active: inactive (dead)
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;○ pve-cluster.service
     Loaded: masked (Reason: Unit pve-cluster.service is masked.)
     Active: inactive (dead)&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space: break-spaces;&quot;&gt;pveversion&lt;/code&gt;:&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;-bash: pveversion: command not found
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;-bash: pveversion: command not found&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Running&amp;nbsp;&lt;code style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; margin: 0px; padding: 0.2em 0.4em; white-space: break-spaces;&quot;&gt;apt update&lt;/code&gt;&amp;nbsp;showed me that I have bullseye still somewhere in the sources.&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Where?&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;List the repositories:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;grep &quot;^[^#]&quot; /etc/apt/sources.list /etc/apt/sources.list.d/*
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;grep &amp;quot;^[^#]&amp;quot; /etc/apt/sources.list /etc/apt/sources.list.d/*&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;/etc/apt/sources.list:deb http://ftp.cz.debian.org/debian bookworm main contrib
/etc/apt/sources.list:deb http://ftp.cz.debian.org/debian bookworm-updates main contrib
/etc/apt/sources.list:deb http://security.debian.org bookworm-security main contrib
/etc/apt/sources.list.d/pve-enterprise.list:deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;/etc/apt/sources.list:deb http://ftp.cz.debian.org/debian bookworm main contrib
/etc/apt/sources.list:deb http://ftp.cz.debian.org/debian bookworm-updates main contrib
/etc/apt/sources.list:deb http://security.debian.org bookworm-security main contrib
/etc/apt/sources.list.d/pve-enterprise.list:deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Fix:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;vim /etc/apt/sources.list.d/pve-enterprise.list

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;vim /etc/apt/sources.list.d/pve-enterprise.list
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;What now? Let see how to put broken proxmox installation back on top of debian:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;a href=&quot;https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm&quot; rel=&quot;nofollow&quot; style=&quot;box-sizing: border-box; color: #1f2328; text-underline-offset: 0.2rem;&quot;&gt;https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm&lt;/a&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Running:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg 

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg 
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Now:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;apt install proxmox-ve

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;apt install proxmox-ve
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Fails with error:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;E: Failure running script /usr/share/proxmox-ve/pve-apt-hook&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Here:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;a href=&quot;https://forum.proxmox.com/threads/upgrade-failed-pve-apt-hook-not-found.107950/post-464053&quot; rel=&quot;nofollow&quot; style=&quot;box-sizing: border-box; color: #1f2328; text-underline-offset: 0.2rem;&quot;&gt;https://forum.proxmox.com/threads/upgrade-failed-pve-apt-hook-not-found.107950/post-464053&lt;/a&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;Quoting:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;I did the following and that seems to have solved the problem.

mkdir -p /usr/share/proxmox-ve
touch /usr/share/proxmox-ve/pve-apt-hook
chmod +x /usr/share/proxmox-ve/pve-apt-hook

&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;I did the following and that seems to have solved the problem.

mkdir -p /usr/share/proxmox-ve
touch /usr/share/proxmox-ve/pve-apt-hook
chmod +x /usr/share/proxmox-ve/pve-apt-hook
&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;After that:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;apt update &amp;amp;&amp;amp; apt full-upgrade

apt dist-upgrade
&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;apt update &amp;amp;&amp;amp; apt full-upgrade

apt dist-upgrade&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;And the last one:&lt;/p&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: var(--base-size-16); margin-top: 0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;snippet-clipboard-content notranslate position-relative overflow-auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; display: flex; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; justify-content: space-between; margin-bottom: var(--base-size-16); overflow: auto !important; position: relative !important;&quot;&gt;&lt;pre class=&quot;notranslate&quot; style=&quot;border-radius: 6px; box-sizing: border-box; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: 1.45; margin-bottom: 0px; margin-top: 0px; overflow-wrap: normal; overflow: auto; padding: var(--base-size-16);&quot;&gt;&lt;code style=&quot;background: none; border-radius: 6px; border: 0px; box-sizing: border-box; display: inline; font-family: var(--fontStack-monospace, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace); font-size: 13.6px; line-height: inherit; margin: 0px; overflow-wrap: normal; overflow: visible; padding: 0px; word-break: normal;&quot;&gt;apt install proxmox-ve
&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;zeroclipboard-container&quot; style=&quot;animation: 0s; box-sizing: border-box;&quot;&gt;&lt;clipboard-copy aria-label=&quot;Copy&quot; class=&quot;ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center&quot; data-copy-feedback=&quot;Copied!&quot; data-tooltip-direction=&quot;w&quot; role=&quot;button&quot; style=&quot;-webkit-user-select: none; align-items: center !important; appearance: none; border-radius: 6px; border: 0px; box-shadow: none; box-sizing: border-box; cursor: pointer; display: flex !important; font-size: 14px; height: var(--control-small-size, 28px); justify-content: center !important; line-height: 20px; margin: var(--base-size-8, 8px) !important; padding: 0px !important; position: relative; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1) 0s, background-color 0s ease 0s, box-shadow 0s ease 0s, border-color 0s ease 0s; vertical-align: middle; white-space: nowrap; width: var(--control-small-size, 28px);&quot; tabindex=&quot;0&quot; value=&quot;apt install proxmox-ve&quot;&gt;&lt;svg aria-hidden=&quot;true&quot; class=&quot;octicon octicon-copy js-clipboard-copy-icon&quot; data-view-component=&quot;true&quot; height=&quot;16&quot; version=&quot;1.1&quot; viewbox=&quot;0 0 16 16&quot; width=&quot;16&quot;&gt;&lt;/svg&gt;&lt;/clipboard-copy&gt;&lt;/div&gt;&lt;/div&gt;&lt;p dir=&quot;auto&quot; style=&quot;box-sizing: border-box; caret-color: rgb(31, 35, 40); color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, &amp;quot;Noto Sans&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px;&quot;&gt;Web inteface is back, no errors so far. All containers are running as they should.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/8927663095408620466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/8927663095408620466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/8927663095408620466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/8927663095408620466'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2024/11/failed-proxmox-7-8-upgrade-i-forgot-to.html' title='Failed Proxmox 7 -&gt; 8 upgrade. I forgot to substitute bullseye with bookworm in one of the repository lists!'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-2309719760152037434</id><published>2024-09-21T18:29:00.005+02:00</published><updated>2024-09-21T18:46:55.463+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AsRockRack"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="ml310e"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><title type='text'>ML310e Gen 8 v2 - Front IO  pinout. Using ML310e case as a MicroATX housing.</title><content type='html'>&lt;p&gt;Recycling now my very old ML310e and want to reuse it for the &lt;a href=&quot;https://www.asrockrack.com/general/productdetail.asp?Model=X570D4U#Specifications&quot;&gt;X570D4U from AsRock&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here is a hole I had to cut in ML310 the case, lol:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh4N7v2PhAui4ZfXKRS79ZzzQq_KCaX2OFCqTw_zxqoEUcvR5CeKG_i0juzG5msn5PDjIrgHs4x-lJGEaAWhXB0aSMRg8tf6i04VtE7MHA66XJO0ELO0go61YWKB1Zistcd1RxXiYfbOQcn8qjEz6RgkXwolu4l7S5bCSfPcgYN-Bsev0A6VxiFn_0oVFs&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;5712&quot; data-original-width=&quot;4284&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEh4N7v2PhAui4ZfXKRS79ZzzQq_KCaX2OFCqTw_zxqoEUcvR5CeKG_i0juzG5msn5PDjIrgHs4x-lJGEaAWhXB0aSMRg8tf6i04VtE7MHA66XJO0ELO0go61YWKB1Zistcd1RxXiYfbOQcn8qjEz6RgkXwolu4l7S5bCSfPcgYN-Bsev0A6VxiFn_0oVFs=w480-h640&quot; width=&quot;480&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And as I was not able to find any pinout diagram for the front-io panel:&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiKkp7CRG1wIhDRg00kg1k4xfs1JVOWulJJ8b1UzOJzSxzmV5cVtybaQHeFSA3xx26vT4u0NGVyZxozFpSjDJPktaqgel7HKCrwtd1k4Wj76ZvsMqe7t1_4aHewdNwuJ8sCpURldtyrpXwpe1JfglHo-TFMpDw24hq4t9-WeMiwFyuX4hool7MzgQqa8AY&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;2622&quot; data-original-width=&quot;2865&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiKkp7CRG1wIhDRg00kg1k4xfs1JVOWulJJ8b1UzOJzSxzmV5cVtybaQHeFSA3xx26vT4u0NGVyZxozFpSjDJPktaqgel7HKCrwtd1k4Wj76ZvsMqe7t1_4aHewdNwuJ8sCpURldtyrpXwpe1JfglHo-TFMpDw24hq4t9-WeMiwFyuX4hool7MzgQqa8AY=w400-h366&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;Here is mine (don&#39;t trust me though and always re-check by yourself!):&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgmUyecK7-cNvMiaSbQCk8ixnUb62lWmQkp6dmfxLzakNkvsFUDMYkRMLt40vkk2X2GrrTJZZ0-o3V476TFUFicOzidvyOItvrE7rsvg4AAuamYeHoEg2crYVd8cmawM-03EAlHIJxWyxrQtAd3L7u9YJQZaKlUJzarcLcsEo3a9vx2qsyu76orPR0DlnU&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;986&quot; data-original-width=&quot;1000&quot; height=&quot;632&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgmUyecK7-cNvMiaSbQCk8ixnUb62lWmQkp6dmfxLzakNkvsFUDMYkRMLt40vkk2X2GrrTJZZ0-o3V476TFUFicOzidvyOItvrE7rsvg4AAuamYeHoEg2crYVd8cmawM-03EAlHIJxWyxrQtAd3L7u9YJQZaKlUJzarcLcsEo3a9vx2qsyu76orPR0DlnU=w640-h632&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;Sending my worldwide regards to all server recyclers :)!&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/2309719760152037434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/2309719760152037434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2309719760152037434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2309719760152037434'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2024/09/ml310e-gen-8-v2-front-io-pinout-using.html' title='ML310e Gen 8 v2 - Front IO  pinout. Using ML310e case as a MicroATX housing.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEh4N7v2PhAui4ZfXKRS79ZzzQq_KCaX2OFCqTw_zxqoEUcvR5CeKG_i0juzG5msn5PDjIrgHs4x-lJGEaAWhXB0aSMRg8tf6i04VtE7MHA66XJO0ELO0go61YWKB1Zistcd1RxXiYfbOQcn8qjEz6RgkXwolu4l7S5bCSfPcgYN-Bsev0A6VxiFn_0oVFs=s72-w480-h640-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-9016366120560594247</id><published>2021-12-11T21:51:00.001+01:00</published><updated>2021-12-11T21:51:27.801+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="postgresql"/><title type='text'>Example of a PostgreSQL function to convert json string literal to a table.</title><content type='html'>&lt;p&gt;Was not able to google one up readily, so created this sample:&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/staninprague/bd246a1343d1c4d4802206758a854958.js&quot;&gt;&lt;/script&gt;

Hope it might help someone!</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/9016366120560594247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/9016366120560594247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/9016366120560594247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/9016366120560594247'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2021/12/example-of-postgresql-function-to.html' title='Example of a PostgreSQL function to convert json string literal to a table.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-885754747850319045</id><published>2021-10-22T14:10:00.001+02:00</published><updated>2021-10-22T14:11:13.931+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="proxmox"/><title type='text'>TIL: Proxmox &quot;pct create&quot; -rootfs parameter and disk size.</title><content type='html'>&lt;p&gt;&amp;nbsp;Got confused by that -rootfs parameter of proxmox when creating a new container with &quot;pct create&quot;, so documenting it here.&lt;/p&gt;&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;&lt;blockquote&gt;-rootfs local:2&lt;/blockquote&gt;&lt;/span&gt;&lt;/div&gt;translates into (when creating container with id 1062, /etc/pve/lxc/1062.conf):&lt;div&gt;&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;&lt;blockquote&gt;rootfs: local:1062/vm-1062-disk-0.raw,&lt;b&gt;size=2G&lt;/b&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;so local:2 then stands for the &quot;local&quot; volume and 2GB as a disk size.&lt;br /&gt;&lt;br /&gt;Using size=2G sub-parameter led to the size of 1062G, interestingly. Not sure if this is a bug in proxmox (v7.0) or what.</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/885754747850319045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/885754747850319045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/885754747850319045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/885754747850319045'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2021/10/til-proxmox-pct-create-rootfs-parameter.html' title='TIL: Proxmox &quot;pct create&quot; -rootfs parameter and disk size.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-2964445429236324310</id><published>2019-12-07T22:58:00.001+01:00</published><updated>2019-12-07T23:03:48.096+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="intelnuc"/><category scheme="http://www.blogger.com/atom/ns#" term="kubernetes"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Ubuntu 18.04 server and ESXI on Intel NUC Hades Canyon.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This post is just to confirm that dual boot&amp;nbsp;Ubuntu 18.04.3 server and ESXI 6.7 U3 on Intel NUC Hades Canyon is possible and to describe some pitfalls/obstacles I had to jump through.&lt;br /&gt;
&lt;br /&gt;
My configuration for the Intel NUC Hades Canyon is Kingston dual ranked 2x16GB + 2xSamsung EVO 670 500GB.&lt;br /&gt;
&lt;br /&gt;
I first thought I&#39;d do it with RAID in BIOS, but both ESXI and Ubuntu server just ignored this option anyway and second, I read that actually it is a good idea to avoid this BIOS RAID option in order to be able to read/use disks after the CPU/board failure.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;#1 Installing ubuntu 18.04.3 server on Intel NUC Hades Canyon&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
I should tell I was a long time user of Digital Ocean, Host Europe and so on - preinstalled Ubuntu server was it for me. Somehow this time I bumped into &quot;live&quot; version of Ubuntu server and started to install it with the outcome of installation not seeing the disks to install Ubuntu, &quot;Unfortunately Probing for devices to install to failed.&quot;:&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;a href=&quot;https://bugs.launchpad.net/subiquity/+bug/1841333&quot;&gt;https://bugs.launchpad.net/subiquity/+bug/1841333&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
This &quot;problem&quot; was the reason for the part #2 of this post - installing ESXI. I only got to the article above and understanding that I picked the wrong Ubuntu version after I have ESXI successfully installed as a boot option for disk 1.&lt;br /&gt;&lt;br /&gt;Here is the image for Ubuntu 18.04.3 &quot;not live&quot; server, just for a reference:&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;a href=&quot;http://cdimage.ubuntu.com/releases/18.04.3/release/ubuntu-18.04.3-server-amd64.iso&quot;&gt;http://cdimage.ubuntu.com/releases/18.04.3/release/ubuntu-18.04.3-server-amd64.iso&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;I also ran into Ubuntu 18.04 server installation getting stuck at 66% while running&#39;update-grub&#39;:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;
&lt;a href=&quot;https://unix.stackexchange.com/questions/511289/ubuntu-18-04-server-installation-gets-stuck-at-66-while-runningupdate-grub&quot;&gt;https://unix.stackexchange.com/questions/511289/ubuntu-18-04-server-installation-gets-stuck-at-66-while-runningupdate-grub&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
After killing the offending process, to exit busybox I used:&lt;br /&gt;&lt;br /&gt;```&lt;br /&gt;exit&lt;br /&gt;```&lt;br /&gt;&lt;br /&gt;and then probably Ctrl+F1&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: maroon; font-weight: bold;&quot;&gt;#2 Installing VMWare ESXI Hypervisor&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
My main problem with ESXI installation was creating a bootable ESXI image on my mac. After a bit of research I was lucky enough to find Unetbootin:&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: menlo, monaco, &amp;quot;courier new&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;a href=&quot;https://unetbootin.github.io/&quot;&gt;https://unetbootin.github.io&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;Other than that, ESXI was a breeze to install and use. Btw, I used the &quot;live&quot; version of Ubuntu 18.04.3 server as ESXI ubuntu iso image and it worked just alright, I really liked the ssh from github option when installing.&lt;br /&gt;--------&lt;br /&gt;&lt;br /&gt;This concludes my notes on dual boot Ubuntu 18.04.3 and ESXI on Intel NUC Hades Canyon. Machine performance is outstanding, no heat, no noise. Performance of AWS large instance to paid for itself within 45 days from what I read.&lt;br /&gt;&lt;br /&gt;Next steps are to study on MAAS, LXD, Juju for the Kubernetes deployment as a target.&lt;br /&gt;&lt;br /&gt;Also looking forward the next generation of Intel NUC Canyon, the Ghost one!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/2964445429236324310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/2964445429236324310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2964445429236324310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2964445429236324310'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2019/12/ubuntu-1804-server-and-esxi-on-intel.html' title='Ubuntu 18.04 server and ESXI on Intel NUC Hades Canyon.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-8842193680342550875</id><published>2019-02-20T14:47:00.001+01:00</published><updated>2019-02-20T14:48:59.120+01:00</updated><title type='text'>xCode 10 Swift 4.2 slow autocomplete and compile times. BAD.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
At some point I started to have dismal swift autocomplete delays in xCode 10 and slower compile times. Having googled this and that and optimizing what I could I also found into these type of warnings:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixSS05MKe83Gn3V7ucvE0bzur8lkUpdmwiPCKUqJUpZz-YGncLItfZTUcZdQga_bKzio3HUMz6eAC6Cyi4MAQC_gyl69K7a6WVbcT3SrPAnDAI0Xmnr90b6Iw4azVYhyKTwa49zQBi59k/s1600/Pasted+Graphic.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixSS05MKe83Gn3V7ucvE0bzur8lkUpdmwiPCKUqJUpZz-YGncLItfZTUcZdQga_bKzio3HUMz6eAC6Cyi4MAQC_gyl69K7a6WVbcT3SrPAnDAI0Xmnr90b6Iw4azVYhyKTwa49zQBi59k/s320/Pasted+Graphic.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
My first guess was that longer tuples are causing the problem. I changed this part to use structs, no joy.&lt;br /&gt;
&lt;br /&gt;
One more part in the code gave me another hint:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWfo0TuTsmYU4O94eEORVgC6TehU6Vi6qqDEAaLh7rda6lMTBSpxykvRXXyyXtuvCMMZl3Bhuqc_vFcQZQWOIyJy085vwv1m5QJePkDg0NhEruKrx5ioDV4W8V_tpUlZMamA9vkjHJDLg/s1600/Pasted+Graphic+1.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWfo0TuTsmYU4O94eEORVgC6TehU6Vi6qqDEAaLh7rda6lMTBSpxykvRXXyyXtuvCMMZl3Bhuqc_vFcQZQWOIyJy085vwv1m5QJePkDg0NhEruKrx5ioDV4W8V_tpUlZMamA9vkjHJDLg/s320/Pasted+Graphic+1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Looked to me as if just adding up literals via &quot;+&quot; would be tricky for swift compiler&#39;s type checking.&lt;br /&gt;
&lt;br /&gt;
Changing everything above to String(format:) resolved the type checking speed.&lt;br /&gt;
&lt;br /&gt;
If you ask on using string interpolation with \() - it didn&#39;t solve the problem. Plus I don&#39;t like these messy strings when they get longer.&lt;br /&gt;
&lt;br /&gt;
I have no good words for the guys that work on Swift programming language and its design/tools. I don&#39;t think this part and types of optimization should really ever bother us, regular devs.&lt;br /&gt;
&lt;br /&gt;
Bad, bad, bad.... I wish I could have loved Swift more. I love the language even if I don&#39;t think it is superior that much to Objective-C. Moving to it from Objective C with all new and updated stuff, but this is simply bad.&lt;br /&gt;
&lt;br /&gt;
P.S. You can find a really good digest of Swift compile time optimizations here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/fastred/Optimizing-Swift-Build-Times&quot;&gt;https://github.com/fastred/Optimizing-Swift-Build-Times&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/8842193680342550875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/8842193680342550875' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/8842193680342550875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/8842193680342550875'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2019/02/xcode-10-swift-42-slow-autocomplete-and.html' title='xCode 10 Swift 4.2 slow autocomplete and compile times. BAD.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixSS05MKe83Gn3V7ucvE0bzur8lkUpdmwiPCKUqJUpZz-YGncLItfZTUcZdQga_bKzio3HUMz6eAC6Cyi4MAQC_gyl69K7a6WVbcT3SrPAnDAI0Xmnr90b6Iw4azVYhyKTwa49zQBi59k/s72-c/Pasted+Graphic.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-6650246638707464305</id><published>2019-01-01T14:23:00.001+01:00</published><updated>2019-01-01T14:53:17.568+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elixir"/><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="TIL"/><title type='text'>TIL - Elixir Jason.Encoder - handling optional fields</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
At some point along my learning road I had a location struct with the following fields:&lt;br /&gt;
&lt;br /&gt;
@derive Jason.Encoder&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;defstruct&lt;/span&gt; latitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;999&lt;/span&gt;, longitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;999&lt;/span&gt;, speed: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;, altitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;, bearing: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
I added one more field:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;defstruct&lt;/span&gt; latitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;999&lt;/span&gt;, longitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;999&lt;/span&gt;, speed: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;, altitude: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;, bearing: -&lt;span style=&quot;color: #09885a;&quot;&gt;1.0&lt;/span&gt;, &lt;b&gt;timestamp: &lt;span style=&quot;color: #09885a;&quot;&gt;0.0&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; line-height: 18px; white-space: pre;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #09885a;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
And my tests for encoding the struct values after reading these older location records from a file started to fail.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Turns out this @derive part is generating the code similar to this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;defimpl&lt;/span&gt; Jason.Encoder, for: [Location] &lt;span style=&quot;color: blue;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;def&lt;/span&gt; encode(%{altitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, bearing: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, latitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, longitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, speed: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, timestamp: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;} = value, opts)&lt;/b&gt; &lt;span style=&quot;color: blue;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
Jason.Encode.map(Map.take(value, [:altitude, :bearing, :latitude, :longitude, :speed, :timestamp]), opts)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;i&gt;ref:&amp;nbsp;&lt;a href=&quot;https://hexdocs.pm/jason/Jason.Encoder.html#content&quot;&gt;https://hexdocs.pm/jason/Jason.Encoder.html#content&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
So older records can&#39;t be matched by this automatically generated definition.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
Considering that as a part of &quot;support older data with a fallback value for the new field&quot; exercise and based on Jason.Encoder documentation:&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;b&gt;1. &lt;/b&gt;I removed the @derive Jason.Encoder line to avoid the automatic protocol implementation generation.&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;b&gt;2. &lt;/b&gt;Provided own implementation that supports the old data stored:&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;require&lt;/span&gt; Jason&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;defimpl&lt;/span&gt; Jason.Encoder, for: [Location] &lt;span style=&quot;color: blue;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: green;&quot;&gt;# Matches the default implementation of @derive Jason.Encoder&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;def&lt;/span&gt; encode(%{altitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, bearing: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, latitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, longitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, speed: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, &lt;b&gt;timestamp: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;&lt;/b&gt;} = value, opts) &lt;span style=&quot;color: blue;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Jason.Encode.map(Map.take(value, [:altitude, :bearing, :latitude, :longitude, :speed, :timestamp]), opts)&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: green;&quot;&gt;# Support for older data&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;def&lt;/span&gt; encode(%{altitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, bearing: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, latitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, longitude: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;, speed: &lt;span style=&quot;color: green;&quot;&gt;_&lt;/span&gt;} = value, opts)&lt;/b&gt; &lt;span style=&quot;color: blue;&quot;&gt;do&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Jason.Encode.map(Map.take(value, [:altitude, :bearing, :latitude, :longitude, :speed]), opts)&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Menlo, Monaco, &amp;quot;Courier New&amp;quot;, monospace; font-size: 12px; white-space: pre;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
This it for my Today I Learnt.&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
References:&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;i&gt;&lt;a href=&quot;https://hexdocs.pm/jason/Jason.Encoder.html#content&quot;&gt;https://hexdocs.pm/jason/Jason.Encoder.html#content&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;i&gt;&lt;a href=&quot;https://github.com/michalmuskala/jason&quot;&gt;https://github.com/michalmuskala/jason&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
And as this post started with adding a timestamp field, here you can read on timestamps in Elixir. From the Jason.Encoder author:&lt;br /&gt;
&lt;a href=&quot;https://michal.muskala.eu/2017/02/02/unix-timestamps-in-elixir-1-4.html&quot;&gt;&lt;i&gt;https://michal.muskala.eu/2017/02/02/unix-timestamps-in-elixir-1-4.html&lt;/i&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/6650246638707464305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/6650246638707464305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6650246638707464305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6650246638707464305'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2019/01/til-elixir-jasonencoder-handling.html' title='TIL - Elixir Jason.Encoder - handling optional fields'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-1688897503060423169</id><published>2017-08-14T14:16:00.002+02:00</published><updated>2017-08-14T14:16:53.699+02:00</updated><title type='text'>Copying comments in Google spreadsheet into a column</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Will copy every comment on a cell in a column into a cell next to the source column (the one with the comments):&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
function commentsToColumn() {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; // find selection (the source comments)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; var workbook = SpreadsheetApp.getActiveSpreadsheet();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; var sheet = workbook.getActiveSheet();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; var source = sheet.getActiveSelection();&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; // determine target (the column to the left of the selection)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; var target = source.offset(0, +1);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; // copy comments&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; comments = source.getComments();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; target.setValues(comments);&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you need more info for usage, please ask in comments :).&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/1688897503060423169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/1688897503060423169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1688897503060423169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1688897503060423169'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/08/copying-comments-in-google-spreadsheet.html' title='Copying comments in Google spreadsheet into a column'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-4301100080570260414</id><published>2017-07-02T10:41:00.000+02:00</published><updated>2017-07-02T10:41:58.649+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cocoa"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>iOS 11 beta 1,2 - NSString sizeWithAttributes - breaking change and potential bug</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Edge behavior of [NSString sizeWithAttributes] seems to be changed in iOS 11 beta 1 and 2. When asked for the&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #3e1e81}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #703daa}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; size &lt;b&gt;around&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;0.0&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *testString = &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;@&quot;Some test string&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;span class=&quot;s6&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt; *fontName = &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;@&quot;.SFUIText-Semibold&quot;&lt;/span&gt;&lt;span class=&quot;s6&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;UIFont&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; *targetFont = [&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;UIFont&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;fontWithName&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:fontName &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:size];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;CGSize&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; stringUISize = [testString &lt;/span&gt;&lt;span class=&quot;s7&quot;&gt;sizeWithAttributes&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;:@&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;NSFontAttributeName&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: targetFont&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; min-height: 13.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12f1b}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #ba2da2}
span.s2 {font-variant-ligatures: no-common-ligatures}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #272ad8}
span.s4 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #d12f1b}
span.s6 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s7 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}
&lt;/style&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}];&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
You may get very different from iOS 7- 10 values. Here is the test:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/staninprague/2ffff0038bea5cdf41ede27255297dac.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
While running it on iOS 7-10, everything converges to zero string UI width:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 10:11:45.996 speedometer[23301:7084973] attempted font size: 1, calculated string width: 12.157471, delta: -12&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 10:11:45.997 speedometer[23301:7084973] attempted font size: 0, calculated string width: 4.052490, delta: -4&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;




&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 10:11:46.005 speedometer[23301:7084973] attempted font size: 0, calculated string width: 0.000000, delta: 0&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;while on iOS 11 beta 1 and 2 the same test case is &quot;stuck&quot; on value 97 something on iPhone 6 Plus:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 08:29:07.157511+0200 speedometer[36517:257340] attempted font size: 4, calculated string size: 36.437256, delta: -36&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 08:29:07.158646+0200 speedometer[36517:257340] attempted font size: 3, calculated string size: 28.340088, delta: -28&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 08:29:07.159723+0200 speedometer[36517:257340] attempted font size: 2, calculated string size: 20.242920, delta: -20&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;2017-07-02 08:29:07.160738+0200 speedometer[36517:257340] attempted font size: 1, calculated string size: 12.145752, delta: -12&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;2017-07-02 08:29:07.161953+0200 speedometer[36517:257340] &lt;span style=&quot;font-size: x-small;&quot;&gt;attempted font size: 0, calculated string size: 4.048584&lt;/span&gt;, delta: -4&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;2017-07-02 08:29:07.166740+0200 speedometer[36517:257340] &lt;span style=&quot;font-size: x-small;&quot;&gt;attempted font size: 0, calculated string size: 97.166016&lt;/span&gt;, delta: -97&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;2017-07-02 08:29:07.167756+0200 speedometer[36517:257340] &lt;span style=&quot;font-size: x-small;&quot;&gt;attempted font size: -1, calculated string size: 97.166016&lt;/span&gt;, delta: -97&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;









&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;2017-07-02 08:29:07.168736+0200 speedometer[36517:257340] attempted font size: -2, calculated string size: 97.166016, delta: -97&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
Looks to me as a broken &quot;contract&quot; and invariant. One would really expect the consistent behavior as it was since iOS7 and having the width of the string calculated as zero for zero font size and zero it should be downwards? Also string width jumping from about approaching zero values to&amp;nbsp;&lt;b style=&quot;font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;97.166016&lt;/span&gt;&lt;/b&gt;&amp;nbsp;when value got a bit on below zero looks inconsistent. Probably a missing unit test :)!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For me it looks like a bug and I&#39;m reporting it to Apple now. Hopefully it will be fixed to the same consistent behavior as it used to be on iOS 7 - 10.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Defensive coding is like an alloc/release for me, I try to make it right and upfront, but doing static analysis later I found myself being &quot;mentally away&quot; way too often.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Yours and wishing you happy coding!&lt;/div&gt;
&lt;div&gt;
Stan.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/4301100080570260414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/4301100080570260414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4301100080570260414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4301100080570260414'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/07/ios-11-beta-12-nsstring.html' title='iOS 11 beta 1,2 - NSString sizeWithAttributes - breaking change and potential bug'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-4043513610109080634</id><published>2017-04-11T17:01:00.000+02:00</published><updated>2019-02-26T20:17:01.917+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cocoa"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><title type='text'>UINavigationController - ask for confirmation on Back</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Didn&#39;t expect this to be such a problem, but once you tap into the UINavigationController things become hairy.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Requirement:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
When user leaves a screen by tapping on a &quot;back&quot; in navigation bar and there are changed data in the screen I should ask for a confirmation and keep user at the current UIViewController if she decided to continue editing the data.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You may run into this:&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/1214965/setting-action-for-back-button-in-navigation-controller/19132881#19132881&quot;&gt;http://stackoverflow.com/questions/1214965/setting-action-for-back-button-in-navigation-controller/19132881#19132881&lt;/a&gt; (particularly this:&amp;nbsp;&lt;a href=&quot;https://github.com/onegray/UIViewController-BackButtonHandler&quot;&gt;https://github.com/onegray/UIViewController-BackButtonHandler&lt;/a&gt;).&lt;br /&gt;
&lt;br /&gt;
Once, I was trying to solve the keyboard accessory to be shown each time for each UITextField on shouldBeginEditing by writing a category for a UITextField. And here is something I learned in a hard way:&lt;br /&gt;
&lt;br /&gt;
When you plan or see any category re-writing the existing framework method, &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;STOP! &lt;/span&gt;Simple as this and &lt;a href=&quot;http://stackoverflow.com/questions/5272451/overriding-methods-using-categories-in-objective-c&quot;&gt;go read on what can turn wrong with this&lt;/a&gt;.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
The solution mentioned above use this:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;1
2
3
4
5&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;@implementation&lt;/span&gt; &lt;span style=&quot;color: #bb0066; font-weight: bold;&quot;&gt;UINavigationController&lt;/span&gt; &lt;span style=&quot;color: #997700; font-weight: bold;&quot;&gt;(ShouldPopOnBackButton)&lt;/span&gt;

&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;-&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;BOOL&lt;/span&gt;)&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;navigationBar:&lt;/span&gt;(UINavigationBar &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;)&lt;span style=&quot;color: #996633;&quot;&gt;navigationBar&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;shouldPopItem:&lt;/span&gt;(UINavigationItem &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;)&lt;span style=&quot;color: #996633;&quot;&gt;item&lt;/span&gt; {

 &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt;([self.viewControllers count] &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; [navigationBar.items count]) {
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
No go for me, no need to study, excuse for being abrupt :). But one part of code from this solution turned actually to be useful.&lt;br /&gt;
&lt;br /&gt;
One of the comments on another post: &lt;a href=&quot;http://stackoverflow.com/questions/20327165/popviewcontroller-strange-behaviour&quot;&gt;http://stackoverflow.com/questions/20327165/popviewcontroller-strange-behaviour&lt;/a&gt;&amp;nbsp;got me here:&amp;nbsp;&lt;a data-saferedirecturl=&quot;https://www.google.com/url?q=http://blog.macca.tech/2013/11/ios-prevent-back-button-navigating-to.html&amp;amp;source=gmail&amp;amp;ust=1551289221105000&amp;amp;usg=AFQjCNE9vrCuz09Sz-c42BznIMqfjD6ghA&quot; href=&quot;http://blog.macca.tech/2013/11/ios-prevent-back-button-navigating-to.html&quot; rel=&quot;nofollow&quot; style=&quot;color: #1155cc; font-family: Arial, Helvetica, sans-serif;&quot; target=&quot;_blank&quot;&gt;http://blog.macca.tech/2013/&lt;wbr&gt;&lt;/wbr&gt;11/ios-prevent-back-button-&lt;wbr&gt;&lt;/wbr&gt;navigating-to.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And was not I lucky? It really makes sense, no private APIs, framework&#39;s UIViewController gets the chance to do its stuff always. What I wanted to improve though was that &quot;safeDelegate&quot; property and the way it is established. So I added a new method (into UISafeNavigationController.m):&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;-&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;UISafeNavigationDelegate&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt;) &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;popDelegate&lt;/span&gt;
{
    UIViewController &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;topController &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; [self topViewController];
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; ([topController conformsToProtocol&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #ffaaaa; color: red;&quot;&gt;@&lt;/span&gt;protocol(UISafeNavigationDelegate)]) {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt;UISafeNavigationDelegate&lt;span style=&quot;color: #333333;&quot;&gt;&amp;gt;&lt;/span&gt;)topController;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;nil&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
And then you can just substitute safeDelegate with popDelegate:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;-&lt;/span&gt; (UIViewController &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;)&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;popViewControllerAnimated:&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;BOOL&lt;/span&gt;)&lt;span style=&quot;color: #996633;&quot;&gt;animated&lt;/span&gt;
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: red;&quot;&gt;self.popDelegate&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;!&lt;/span&gt;[&lt;span style=&quot;color: red;&quot;&gt;self.popDelegate&lt;/span&gt; navigationController&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;self
                                             &lt;span style=&quot;color: #997700; font-weight: bold;&quot;&gt;shouldPopViewController:&lt;/span&gt;[self.viewControllers lastObject]
                                                                 &lt;span style=&quot;color: #997700; font-weight: bold;&quot;&gt;pop:&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;^&lt;/span&gt;{ [super popViewControllerAnimated&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;animated]; }])
    {
        &lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; (self.navigationBar) {
            [self restoreViewsForNavigationBar&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;self.navigationBar];
        }&lt;/span&gt;
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;nil&lt;/span&gt;;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; [super popViewControllerAnimated&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;animated];
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Also note lines 7-9 where I call a new method (borrowed from the first stackoverflow solution that I actually criticize :)):&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;-&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt;) &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;restoreViewsForNavigationBar:&lt;/span&gt; (UINavigationBar &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;) navigationBar
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;for&lt;/span&gt;(UIView &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;subview &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;in&lt;/span&gt; [navigationBar subviews]) {
        &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #6600ee; font-weight: bold;&quot;&gt;0.&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; subview.alpha &lt;span style=&quot;color: #333333;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; subview.alpha &lt;span style=&quot;color: #333333;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #6600ee; font-weight: bold;&quot;&gt;1.&lt;/span&gt;) {
            [UIView animateWithDuration&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #6600ee; font-weight: bold;&quot;&gt;.25&lt;/span&gt; animations&lt;span style=&quot;color: #333333;&quot;&gt;:^&lt;/span&gt;{
                subview.alpha &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #6600ee; font-weight: bold;&quot;&gt;1.&lt;/span&gt;;
            }];
        }
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
This is to avoid the back arrow in the navigation bar looking as disabled when answer from our controller to the shouldPop is NO.&lt;br /&gt;
&lt;br /&gt;
Then protocol method in the related view controller may look like:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;-&lt;/span&gt; (&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;BOOL&lt;/span&gt;)&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;navigationController:&lt;/span&gt;(UINavigationController &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;)&lt;span style=&quot;color: #996633;&quot;&gt;navigationController&lt;/span&gt;
     &lt;span style=&quot;color: #997700; font-weight: bold;&quot;&gt;shouldPopViewController:&lt;/span&gt;(UIViewController &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;)&lt;span style=&quot;color: #996633;&quot;&gt;controller&lt;/span&gt; &lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;pop:&lt;/span&gt;(&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;void&lt;/span&gt;(&lt;span style=&quot;color: #333333;&quot;&gt;^&lt;/span&gt;)())&lt;span style=&quot;color: #996633;&quot;&gt;pop&lt;/span&gt;
{
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #333333;&quot;&gt;!&lt;/span&gt;_item.&lt;span style=&quot;color: #333399; font-weight: bold;&quot;&gt;id&lt;/span&gt;) {
        UIAlertController &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;alert &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; [UIAlertController alertControllerWithTitle&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;LSSTRING(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;@&quot;Save the item?&quot;&lt;/span&gt;) message&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;LSSTRING(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;@&quot;You are closing this screen by using Back button and have not saved the item.&quot;&lt;/span&gt;) preferredStyle&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;UIAlertControllerStyleAlert];
        
        [alert addAction&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;[UIAlertAction actionWithTitle&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;LSSTRING(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;@&quot;Save and close&quot;&lt;/span&gt;) style&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;UIAlertActionStyleDefault handler&lt;span style=&quot;color: #333333;&quot;&gt;:^&lt;/span&gt;(UIAlertAction &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;action) {
            [self done&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #007020;&quot;&gt;nil&lt;/span&gt;];
        }]];
        
        [alert addAction&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;[UIAlertAction actionWithTitle&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;LSSTRING(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;@&quot;Don&#39;t save and close&quot;&lt;/span&gt;) style&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;UIAlertActionStyleDestructive handler&lt;span style=&quot;color: #333333;&quot;&gt;:^&lt;/span&gt;(UIAlertAction &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;action) {
            [self doCancellationCleanup];
            &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;if&lt;/span&gt; (pop) {
                pop();
            }
            
        }]];
        
        [alert addAction&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;[UIAlertAction actionWithTitle&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;LSSTRING(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;@&quot;Cancel&quot;&lt;/span&gt;) style&lt;span style=&quot;color: #333333;&quot;&gt;:&lt;/span&gt;UIAlertActionStyleCancel handler&lt;span style=&quot;color: #333333;&quot;&gt;:^&lt;/span&gt;(UIAlertAction &lt;span style=&quot;color: #333333;&quot;&gt;*&lt;/span&gt;action) {
            
            
        }]];
        
        [alert show];
        &lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;false&lt;/span&gt;;&lt;/span&gt;
    }
    
    &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;true&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
Hope this can help someone! All the credit goes to Hong Kong Web Entrepreneur guy! Once again, here:&amp;nbsp;&lt;a data-saferedirecturl=&quot;https://www.google.com/url?q=http://blog.macca.tech/2013/11/ios-prevent-back-button-navigating-to.html&amp;amp;source=gmail&amp;amp;ust=1551289221105000&amp;amp;usg=AFQjCNE9vrCuz09Sz-c42BznIMqfjD6ghA&quot; href=&quot;http://blog.macca.tech/2013/11/ios-prevent-back-button-navigating-to.html&quot; rel=&quot;nofollow&quot; style=&quot;color: #1155cc; font-family: Arial, Helvetica, sans-serif;&quot; target=&quot;_blank&quot;&gt;http://blog.macca.tech/2013/&lt;wbr&gt;&lt;/wbr&gt;11/ios-prevent-back-button-&lt;wbr&gt;&lt;/wbr&gt;navigating-to.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
[UPDATE] In the end I had to rework the final part presented here - showing the confirmation as the way it is presented was not releasing the controller correctly and was not cleaning up the views as well. Quite bigger effort is required to get it right and it is not that generic in the end. But this is a good start! :).&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/4043513610109080634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/4043513610109080634' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4043513610109080634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4043513610109080634'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/04/uinavigationcontroller-ask-for.html' title='UINavigationController - ask for confirmation on Back'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-6399269091128722770</id><published>2017-04-09T13:24:00.000+02:00</published><updated>2017-04-09T13:24:14.053+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elixir"/><title type='text'>Debugging in elixir. Old erlang version got into my way.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today, some dialyzer stuff, but mainly debugging with Elixir was my study subject and so first I ran into iex telling me &quot;&lt;span class=&quot;typ&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;Could&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #303336; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt; not find &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;background-color: #eff0f1; border: 0px; color: #7d2727; font-family: Consolas, Menlo, Monaco, &amp;quot;Lucida Console&amp;quot;, &amp;quot;Liberation Mono&amp;quot;, &amp;quot;DejaVu Sans Mono&amp;quot;, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, monospace, sans-serif; font-size: 13px; margin: 0px; padding: 0px; white-space: inherit;&quot;&gt;&#39;wxe_driver.so&#39;&lt;/span&gt;&quot; on running :debugger.start(). Then I read that debugger starts anyway, so I tried simple :int.ni(Module), but was greeted with &quot;no beam found for Elixir.Module&quot;. Read more and it pointed to Erlang version being lower than 19. Really iex and elixir --version were telling its 18 that is being started. Using brew upgrade erlang or elixir, brew reinstall - same thing. A year ago I installed erlang from the official installer here (&lt;a href=&quot;https://www.erlang-solutions.com/resources/download.html&quot;&gt;https://www.erlang-solutions.com/resources/download.html&lt;/a&gt;). Looked there and there is an even version manager for the Erlang on OSX now?! Cool:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-nqVd3lwjWREPD21DtY0Baxy8Gq-WYW7wToVSiaGArDMVlmNC2B2NKcd0zFLaDsvUEDvbePwayDmwgIBPhM8omXE4bBw9QT1LNWWprjM4b4raBF9nTLPi_X7n_ZHtl2JItxH5MW13esU/s1600/erlang-manager.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-nqVd3lwjWREPD21DtY0Baxy8Gq-WYW7wToVSiaGArDMVlmNC2B2NKcd0zFLaDsvUEDvbePwayDmwgIBPhM8omXE4bBw9QT1LNWWprjM4b4raBF9nTLPi_X7n_ZHtl2JItxH5MW13esU/s320/erlang-manager.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This surely helped to have version of erlang as 19.3 for elixir now and all the debugger stuff worked as expected.&lt;br /&gt;
&lt;br /&gt;
I&#39;m looking more and more into the &lt;a href=&quot;http://theerlangelist.com/article/spawn_or_not&quot;&gt;Sasa Juric blackjack example&lt;/a&gt; as I&#39;m kind of getting a bit sad about the book I wanted to read as a practical guide to building elixir/OTP apps:&amp;nbsp;&lt;a href=&quot;https://pragprog.com/book/lhelph/functional-web-development-with-elixir-otp-and-phoenix&quot;&gt;https://pragprog.com/book/lhelph/functional-web-development-with-elixir-otp-and-phoenix&lt;/a&gt;&lt;br /&gt;
I&#39;m kinda on Sasa&#39;s side of analysis how the functional apps should be built and the book mentioned is not leading in the right way I believe. I&#39;m still at its start though, author may still refactor his approach later... :).&lt;br /&gt;
&lt;br /&gt;
Sasa uses dialyzer in his example and I read before that it is a good idea to use it, so studied today on this and typespecs in Elixir as well: &lt;a href=&quot;http://elixir-lang.org/getting-started/typespecs-and-behaviours.html&quot;&gt;http://elixir-lang.org/getting-started/typespecs-and-behaviours.html&lt;/a&gt;. I also loved a TDD example on building roman numbers converter here:&amp;nbsp;&lt;a href=&quot;https://medium.com/@barruumrex/seeking-simple-satisfaction-2a098902ddff&quot;&gt;https://medium.com/@barruumrex/seeking-simple-satisfaction-2a098902ddff&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/6399269091128722770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/6399269091128722770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6399269091128722770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6399269091128722770'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/04/debugging-in-elixir-old-erlang-version.html' title='Debugging in elixir. Old erlang version got into my way.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-nqVd3lwjWREPD21DtY0Baxy8Gq-WYW7wToVSiaGArDMVlmNC2B2NKcd0zFLaDsvUEDvbePwayDmwgIBPhM8omXE4bBw9QT1LNWWprjM4b4raBF9nTLPi_X7n_ZHtl2JItxH5MW13esU/s72-c/erlang-manager.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-2231758188891921995</id><published>2017-04-05T13:05:00.001+02:00</published><updated>2017-04-05T13:17:34.937+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elixir"/><title type='text'>Elixir - bind the match subject in case statement</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Before I forget again on how to bind the whole match subject in case statement in Elixir:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXwHgohM4jHb92l4EXfNrOsfnGIiLOoc_JIUjxxzE6KivU7M6DC16U8geAp3wLK7Ob4_lmMMbQQfP30xeSzwTuZjhMSx0lRKJHFd_L2C9a2wVVU6ejz9RBjjIrRioO5tPtmnTJZ-7h-iA/s1600/elixir-case-push-to-variable.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;74&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXwHgohM4jHb92l4EXfNrOsfnGIiLOoc_JIUjxxzE6KivU7M6DC16U8geAp3wLK7Ob4_lmMMbQQfP30xeSzwTuZjhMSx0lRKJHFd_L2C9a2wVVU6ejz9RBjjIrRioO5tPtmnTJZ-7h-iA/s320/elixir-case-push-to-variable.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&quot;state&quot; as fn argument name and &quot;state&quot; in case surely are having the different scope, that&#39;s just I wanted to have the same name saying &quot;state&quot; :).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Reading now &lt;a href=&quot;https://pragprog.com/book/lhelph/functional-web-development-with-elixir-otp-and-phoenix&quot;&gt;&quot;Functional Web Development with Elixir, OTP, and Phoenix&quot;&lt;/a&gt;, so this is my version of authors to_string:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
def​ to_string(coordinate) ​do​&lt;/div&gt;
&lt;div&gt;
​ &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;​&quot;​​(in_island:​​#{​island(coordinate)​}​​, guessed:​​#{​guessed?(coordinate)​}​​)&quot;​&lt;/div&gt;
&lt;div&gt;
​ &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;​end​&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I thought I&#39;d write it in a way that I would not call the wrapping functions on Agent for each interpolated field, plus would avoid changing to_string implementation with every struct change.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
By the way, new cool link for learning Elixir:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://elixirschool.com/&quot;&gt;https://elixirschool.com&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Also, just in time for reading the book mentioned above comes an article from&amp;nbsp;Saša Jurić: &lt;br /&gt;
&lt;a href=&quot;http://theerlangelist.com//article/spawn_or_not&quot;&gt;To spawn, or not to spawn?&lt;/a&gt;&amp;nbsp;Definitely going to validate the book suggested solution/architecture with what Saša Jurić is writing.&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px &#39;Helvetica Neue&#39;; color: #e4af0a}
&lt;/style&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Done with learning for today, back to creating some added value to my customers!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/2231758188891921995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/2231758188891921995' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2231758188891921995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2231758188891921995'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/04/elixir-bind-match-subject-in-case.html' title='Elixir - bind the match subject in case statement'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXwHgohM4jHb92l4EXfNrOsfnGIiLOoc_JIUjxxzE6KivU7M6DC16U8geAp3wLK7Ob4_lmMMbQQfP30xeSzwTuZjhMSx0lRKJHFd_L2C9a2wVVU6ejz9RBjjIrRioO5tPtmnTJZ-7h-iA/s72-c/elixir-case-push-to-variable.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-3166403801273384672</id><published>2017-03-30T18:12:00.002+02:00</published><updated>2017-03-30T18:12:58.110+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>xcode 8.3 CompileStoryboard Internal error. UICGColor encodeWithCoder. Please file a bug at bugreport.apple.com and attach ... </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Was dancing with my voodoo drum for a few minutes after upgrading to xcode 8.3 today. One of my storyboards that have existed for last 3 years suddenly started to cause the compile error:&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo}
&lt;/style&gt;


&lt;div&gt;
&lt;span style=&quot;font-family: Menlo; font-size: 11px; text-indent: -12px;&quot;&gt;CompileStoryboard bLocNote/taxi/EditTariffStoryboard.storyboard&lt;/span&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 12.0px; text-indent: -12.0px; font: 11.0px Menlo}
&lt;/style&gt;


&lt;div class=&quot;p1&quot;&gt;
2017-03-30 17:48:00.332 Interface Builder Cocoa Touch Tool[29650:5173036] *** Assertion failure in -[UICGColor encodeWithCoder:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.7.47/UIColor.m:1549&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
2017-03-30 17:48:08.466 ibtoold[29647:5172916] [MT] IBPlatformTool: Wrote failed marshalling request diagnostics to path: /var/folders/8j/x30frbx948l8djrb6ff7mljc0000gn/T/IB-agent-diagnostics_2017-03-30_17-48-08_415000&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
/* com.apple.ibtool.errors */&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Menlo; font-size: 11px; text-indent: -12px;&quot;&gt;/Users/stanislavdvoychenko/Documents/code/speedo/bLocNote/taxi/EditTariffStoryboard.storyboard: error: Internal error. Please file a bug at bugreport.apple.com and attach &quot;/var/folders/8j/x30frbx948l8djrb6ff7mljc0000gn/T/IB-agent-diagnostics_2017-03-30_17-48-08_415000&quot;.&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Was compiling fine just an hour ago on xcode 8.2.1! Ok, it tells something on not liking the UIColor, and log it mentions further says colors should be RGB or White space. I went by &quot;binary search&quot; removed everything from the storyboard except the table view -&amp;gt; build still fails. Only value catching the eye was &quot;Tracking&quot; color for the section view saying showing a black stripe with no color name, I have many of these assigned in other places though, guess it is still somehow different in this storyboard, so I reselected a &quot;black&quot; color for it:&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP_sqWiAAkWzi3m5uM_PhXskFMbatv7WB-O-kIppXbyQry0yWCsaEQ2BqKC2IldnlFGmwp2-xFsXtujmDCvl1TPQFlvrps0z7xpW3KdlX4X68q_IVrrGhYHFSudJwsLlEOXvht7-3zrxQ/s1600/xcode83-storyboard-error.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP_sqWiAAkWzi3m5uM_PhXskFMbatv7WB-O-kIppXbyQry0yWCsaEQ2BqKC2IldnlFGmwp2-xFsXtujmDCvl1TPQFlvrps0z7xpW3KdlX4X68q_IVrrGhYHFSudJwsLlEOXvht7-3zrxQ/s320/xcode83-storyboard-error.png&quot; width=&quot;242&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And it compiled! Huraaay and back to programming!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/3166403801273384672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/3166403801273384672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/3166403801273384672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/3166403801273384672'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/03/xcode-83-compilestoryboard-internal.html' title='xcode 8.3 CompileStoryboard Internal error. UICGColor encodeWithCoder. Please file a bug at bugreport.apple.com and attach ... '/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP_sqWiAAkWzi3m5uM_PhXskFMbatv7WB-O-kIppXbyQry0yWCsaEQ2BqKC2IldnlFGmwp2-xFsXtujmDCvl1TPQFlvrps0z7xpW3KdlX4X68q_IVrrGhYHFSudJwsLlEOXvht7-3zrxQ/s72-c/xcode83-storyboard-error.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-2815450454936621497</id><published>2017-03-16T19:05:00.000+01:00</published><updated>2017-03-16T19:26:49.822+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>Inherited uiviewcontrollers references in one storyboard. This class is not key value coding-compliant for the key ...</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I often inherit my UIViewControllers to add functionality on top of already existing. All works fine, but today I ran into the weird problem. Setup like this:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-DakWP0z3mGwxrm8VDdbi1ZV1dgTzZ5Kzk2lEcnfKqyR5rbxOmRf4aCvGWyQHC-4t0U2RkkaY6GWW78kTRSaY2YkLLr41UuT_BW7xSF2fqS3jzBlx31qonTIx83gmvzb233Q50gp-0Vg/s1600/inherited-referenced-viewcontrollers.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-DakWP0z3mGwxrm8VDdbi1ZV1dgTzZ5Kzk2lEcnfKqyR5rbxOmRf4aCvGWyQHC-4t0U2RkkaY6GWW78kTRSaY2YkLLr41UuT_BW7xSF2fqS3jzBlx31qonTIx83gmvzb233Q50gp-0Vg/s320/inherited-referenced-viewcontrollers.png&quot; width=&quot;236&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Where rangeItemEditor view controller inherits from itemEditor view controller. All outlets connected in the parent view controller. On row tap I do performSegue and then this:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;This class is not key value coding-compliant for the key ...&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Complaining about one of the outlets. After standard troubleshooting, checking that .destinationViewController is right, bunging my head a bit against the wall and trying [navigationController push] which worked I looked more carefully at the Storyboard ID values for these references. Here is obviously a good one:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNggS6oaF527vURqg6jBtZAPj4ODO9dxJ9hbIzzoldSC4qpjw5iNafKsIxPb550nYkIZT_jpGUZMnGK1SCHd0mx13bQbDSraZ0ojhhUU5e7IcMckexphIjnd-5RwlflR-zBuM6mYOAYy8/s1600/storyboardId-good.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;120&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNggS6oaF527vURqg6jBtZAPj4ODO9dxJ9hbIzzoldSC4qpjw5iNafKsIxPb550nYkIZT_jpGUZMnGK1SCHd0mx13bQbDSraZ0ojhhUU5e7IcMckexphIjnd-5RwlflR-zBuM6mYOAYy8/s320/storyboardId-good.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And the other one, inherited rangeItemEditor had it empty. Filling it in and running again proved the idea that missing Storyboard ID in Identity tab for a references storyboard is a bad thing. I was not clearing this out though, not sure how it happened to be empty.&lt;br /&gt;
&lt;br /&gt;
Thought I&#39;d share to make your troubleshooting of similar cases faster!&lt;br /&gt;
&lt;br /&gt;
In the end I got rid of these references in the storyboard and used [navigationController push]. Why? I just really don&#39;t want these crashes when xcode UI Editor decides to remove something behind the scenes. I&#39;ve witnessed this &quot;open the file -&amp;gt; get the mess&quot; already in xcode storyboards and I really better stay safer here with using old gold manual push. Staying away from the magic until it has predictable results :).&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/2815450454936621497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/2815450454936621497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2815450454936621497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2815450454936621497'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/03/inherited-uiviewcontrollers-references.html' title='Inherited uiviewcontrollers references in one storyboard. This class is not key value coding-compliant for the key ...'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-DakWP0z3mGwxrm8VDdbi1ZV1dgTzZ5Kzk2lEcnfKqyR5rbxOmRf4aCvGWyQHC-4t0U2RkkaY6GWW78kTRSaY2YkLLr41UuT_BW7xSF2fqS3jzBlx31qonTIx83gmvzb233Q50gp-0Vg/s72-c/inherited-referenced-viewcontrollers.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-4416424654518320429</id><published>2017-02-20T17:45:00.001+01:00</published><updated>2017-02-20T17:45:25.037+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="sqlite"/><title type='text'>Working around WITH not being available in older versions of sqlite.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For one of my iPhone apps I need to rename route points to match their order as they are inserted or deleted, I started with an easy WITH version:&lt;br /&gt;
&lt;br /&gt;





&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008400}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;[NSString stringWithFormat:@&quot;WITH wcte (id, wname) AS (SELECT w.id, &#39;%@ &#39; ||&amp;nbsp; (SELECT COUNT(*) + 1 FROM waypoint WHERE vY1 &amp;lt; w.vY1) as wname FROM waypoint w)&amp;nbsp; UPDATE waypoint SET \&quot;name\&quot; = (SELECT wname FROM wcte WHERE id = waypoint.id) WHERE \&quot;name\&quot; LIKE &#39;%@ %%&#39; OR \&quot;name\&quot; is null OR \&quot;name\&quot; = &#39;&#39;&quot;, LSSTRING(@&quot;Point&quot;), LSSTRING(@&quot;Point&quot;)]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
And ran into the problem when testing on iOS8.1, obviously its version of sqlite didn&#39;t support WITH at that time.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So here is the workaround solution for older sqlite versions:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;




&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #d12f1b}
span.s1 {font-variant-ligatures: no-common-ligatures; color: #000000}
span.s2 {font-variant-ligatures: no-common-ligatures; color: #703daa}
span.s3 {font-variant-ligatures: no-common-ligatures; color: #3d1d81}
span.s4 {font-variant-ligatures: no-common-ligatures}
span.s5 {font-variant-ligatures: no-common-ligatures; color: #78492a}
&lt;/style&gt;


&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;NSString&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s3&quot;&gt;stringWithFormat&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;UPDATE waypoint SET \&quot;name\&quot; = (SELECT&amp;nbsp;&#39;%@ &#39; ||&amp;nbsp;(SELECT COUNT(*) + 1 FROM waypoint w WHERE w.vY1 &amp;lt; w1.vY1) FROM waypoint w1 WHERE w1.id = waypoint.id) WHERE \&quot;name\&quot; LIKE &#39;%@ %%&#39; OR \&quot;name\&quot; is null OR \&quot;name\&quot; = &#39;&#39;&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;LSSTRING&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;Point&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;), &lt;/span&gt;&lt;span class=&quot;s5&quot;&gt;LSSTRING&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;@&quot;Point&quot;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;)]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
Not that nicely looking, but I&#39;m still committed to support iOS8 for a few more months. If you are puzzled by that LSSTRING part - that&#39;s just my macro for the LocalizableString as I only want to rename these points that are named automatically and surely I want to name them in the localized manner. Punto it is in Spanish (I hope) :). vY1 is a cryptic name for the order column :).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Would not be publishing at all, but sqlite syntax sometime is surprising in what it can or can&#39;t do, so I thought I might save time to someone.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you are into hiking, fishing, cycling or classic skiing here is the app link, it&#39;s free:&amp;nbsp;&lt;a href=&quot;https://itunes.apple.com/us/app/id1120906807&quot;&gt;https://itunes.apple.com/us/app/id1120906807&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/4416424654518320429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/4416424654518320429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4416424654518320429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/4416424654518320429'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2017/02/working-around-with-not-being-available.html' title='Working around WITH not being available in older versions of sqlite.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-6355369146816676837</id><published>2016-12-09T15:02:00.002+01:00</published><updated>2016-12-21T17:34:32.721+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="elixir"/><category scheme="http://www.blogger.com/atom/ns#" term="phoenix"/><category scheme="http://www.blogger.com/atom/ns#" term="react"/><category scheme="http://www.blogger.com/atom/ns#" term="redux"/><category scheme="http://www.blogger.com/atom/ns#" term="webpack"/><title type='text'>Elixir, Phoenix, React, Redux and ES6 - I&#39;m a complete beginner again.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I started with Erlang and now progressing with Elixir, Phoenix, React, Redux and ES6 stack. Was feeling a bit lost when seeing stuff like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt; &amp;nbsp;var createStoreWithMiddleware = (0, _redux.applyMiddleware)(reduxRouterMiddleware, _reduxThunk2.default, loggerMiddleware)(_redux.createStore);&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;const store = autoRehydrate()(createF8Store)(reducers);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Had to remind myself on a simple function chaining, like:&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;const p = (store)=&amp;gt;{console.log(&quot;I&#39;m an almighty container, you passed me the store: &quot; + store);};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;const f = (a,b)=&amp;gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp; console.log(&quot;Thanks for a and b: &quot; + a + &quot;, &quot; + b + &quot; it helped me to build a container with I return to you. Pass a store into it!&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;return p;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;f(3,4)(&quot;Store is just a name &#39;John&#39;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
With the output of:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
li.li1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Helvetica; color: #008800; -webkit-text-stroke: #008800}
span.s1 {-webkit-text-stroke: 0px #000000}
span.s2 {font-kerning: none}
span.s3 {color: #000000; -webkit-text-stroke: 0px #000000}
span.s4 {font-kerning: none; color: #000000; -webkit-text-stroke: 0px #000000}
ul.ul1 {list-style-type: none}
&lt;/style&gt;


&lt;br /&gt;
&lt;ul class=&quot;ul1&quot;&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Thanks for a and b: 3, 4 it helped me to build a container with I return to you. Pass a store into it!&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;span class=&quot;s3&quot;&gt;&lt;/span&gt;&lt;span class=&quot;s4&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;I&#39;m an almighty container, you passed me the state: Store is just a name &#39;John&#39;&quot;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
Beginner mind work play games with me, tendency to get lost on trivial subjects is quite high :):):).&lt;br /&gt;
&lt;br /&gt;
A list of resources I really appreciated so far:&lt;br /&gt;
&lt;br /&gt;
React:&lt;br /&gt;
&lt;a href=&quot;https://facebook.github.io/react/docs&quot;&gt;https://facebook.github.io/react/docs&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://egghead.io/courses/react-fundamentals&quot;&gt;https://egghead.io/courses/react-fundamentals&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://egghead.io/courses/react-flux-architecture-es6&quot;&gt;https://egghead.io/courses/react-flux-architecture-es6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Redux:&lt;br /&gt;
&lt;a href=&quot;http://redux.js.org/&quot;&gt;http://redux.js.org&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://egghead.io/lessons/javascript-redux-reducer-composition-with-combinereducers&quot;&gt;https://egghead.io/lessons/javascript-redux-reducer-composition-with-combinereducers&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ES6:&lt;br /&gt;
&lt;a href=&quot;https://ponyfoo.com/articles/es6&quot;&gt;https://ponyfoo.com/articles/es6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ES6 and modules (oh, how could have I got so much behind?):&lt;br /&gt;
&lt;a href=&quot;https://24ways.org/2014/javascript-modules-the-es6-way/&quot;&gt;https://24ways.org/2014/javascript-modules-the-es6-way/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://babeljs.io/learn-es2015/&quot;&gt;https://babeljs.io/learn-es2015/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
ES6 Promises:&amp;nbsp;&lt;a href=&quot;http://www.datchley.name/es6-promises/&quot;&gt;http://www.datchley.name/es6-promises/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I also found this article being an awesome walkthrough on getting React/Redux/ES6 and more together in Facebook&#39;s makeitopen app:&lt;br /&gt;
&lt;a href=&quot;http://makeitopen.com/tutorials/building-the-f8-app&quot;&gt;http://makeitopen.com/tutorials/building-the-f8-app&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Webpack:&lt;br /&gt;
&lt;a href=&quot;http://ryanchristiani.com/introduction-to-webpack/&quot;&gt;http://ryanchristiani.com/introduction-to-webpack/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Elixir and Phoenix:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Pragmatic programmers - Elixir programming, Phoenix programming.&lt;br /&gt;
Phoenix and Trello clone: &lt;a href=&quot;http://codeloveandboards.com/blog/2016/01/14/trello-tribute-with-phoenix-and-react-pt-1/&quot;&gt;http://codeloveandboards.com/blog/2016/01/14/trello-tribute-with-phoenix-and-react-pt-1/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #93a1a1; -webkit-text-stroke: #93a1a1; background-color: #002b36}
span.s1 {font-kerning: none; color: #278bd2; -webkit-text-stroke: 0px #278bd2}
span.s2 {font-kerning: none}
span.s3 {font-kerning: none; color: #859900; -webkit-text-stroke: 0px #859900}
&lt;/style&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/6355369146816676837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/6355369146816676837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6355369146816676837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/6355369146816676837'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/12/elixir-phoenix-react-redux-and-es6-im.html' title='Elixir, Phoenix, React, Redux and ES6 - I&#39;m a complete beginner again.'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-5561802895721582267</id><published>2016-06-15T11:19:00.002+02:00</published><updated>2016-06-16T13:17:50.926+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ux"/><title type='text'>Me, a troll! My recent MS experience :)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
If I had to show one example for all for my recent Microsoft experience as a developer and user, here it is. The welcome page in VS 2015 opening the xml feed when you click on &quot;More news&quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI0rXPGWtljXKZBK_mmT9we-cTw7xYA4C6uKliMcfXG0km3Fgi3RyzawvvtlPoWpatvt3BPT4BF58MHy5bCgcHj8DwnMqRfRhB_ZVXmq_rsMsmSk9kdwe4FI84zviYtGQWYaxE5pJg9bg/s1600/Capture.PNG&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI0rXPGWtljXKZBK_mmT9we-cTw7xYA4C6uKliMcfXG0km3Fgi3RyzawvvtlPoWpatvt3BPT4BF58MHy5bCgcHj8DwnMqRfRhB_ZVXmq_rsMsmSk9kdwe4FI84zviYtGQWYaxE5pJg9bg/s400/Capture.PNG&quot; width=&quot;258&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
I will not be telling here how I&#39;m trying to keep my ASUS tablet in sync with time after upgrading to Windows 10. The above is enough declaration of &quot;we are not for humans&quot; and &quot;we don&#39;t really care&quot; :).&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This is me, a troll in the MS land. I used to be a regular guy here. Sorry. I&#39;m working hard on my escape plan now.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Stan.&lt;br /&gt;
&lt;br /&gt;
P.S. To my problem with Windows 10 time. Given how different apps in windows fail differently based on that time sync problem and learning Erlang at the moment, it was quite up to point to read about Erlang time here:&amp;nbsp;&lt;a href=&quot;http://learnyousomeerlang.com/time&quot;&gt;http://learnyousomeerlang.com/time&lt;/a&gt;, wishing you a good read! :).&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/5561802895721582267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/5561802895721582267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5561802895721582267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5561802895721582267'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/06/me-troll-my-recent-ms-experience.html' title='Me, a troll! My recent MS experience :)'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI0rXPGWtljXKZBK_mmT9we-cTw7xYA4C6uKliMcfXG0km3Fgi3RyzawvvtlPoWpatvt3BPT4BF58MHy5bCgcHj8DwnMqRfRhB_ZVXmq_rsMsmSk9kdwe4FI84zviYtGQWYaxE5pJg9bg/s72-c/Capture.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-2815794975400212189</id><published>2016-05-26T16:11:00.002+02:00</published><updated>2016-05-26T16:43:48.211+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>Symbolicating bitcode crash logs in XCode</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As of Xcode version 7.3 there is still a problem with symbolicating the bitcode crash logs. I&#39;ve attempted several solutions, &lt;a href=&quot;https://gist.github.com/anonymous/cdb5ba3791cfd7d312c2&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.charmcitygavin.com/2016/02/15/how-i-symbolicated-a-apple-tv-crash-report-from-a-bitcode-build/&quot;&gt;here&lt;/a&gt;, &lt;b&gt;but&lt;/b&gt; here is what I came to:&lt;br /&gt;
&lt;br /&gt;
1. Crash logs provided are for the dSYMs that Apple also provides. Just go to the iTunes connect and download them:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp7ZsnEtHNM8_pmT2IFc1eFss4K_s2omPG-SWP9Pca0j7KeReC6lFwCjgw13TgD3s4BjhzJXrcLXCn4gRt0kfKbavrnVfFt_7Vc9SbndX8yCnvGwM67tbDWq60mPI56U6SfRNS5sA4y_U/s1600/downloadDSYM.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp7ZsnEtHNM8_pmT2IFc1eFss4K_s2omPG-SWP9Pca0j7KeReC6lFwCjgw13TgD3s4BjhzJXrcLXCn4gRt0kfKbavrnVfFt_7Vc9SbndX8yCnvGwM67tbDWq60mPI56U6SfRNS5sA4y_U/s640/downloadDSYM.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Once you have them right click on the crash in xcode -&amp;gt; &quot;Show in finder&quot; and copy to some target directory - that&#39;s actually a crashpoint file you are going to get.&lt;br /&gt;
&lt;br /&gt;
My target directory is now ~\Desktop\crashes and here is how it looks:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhda3iusB17WkCeJ9915JhPa9EBBv3ivJLFi3eFu1VdzrfpBSrg6cbcTNzTiPh_PKSv2r4vjivrrNQYpMx50AwQSYt8kY2hD-EXJWKtANVvwTxgsQQD1h94G8O_IPCUlunHmeFN1SS6_6E/s1600/resym-dir.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;353&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhda3iusB17WkCeJ9915JhPa9EBBv3ivJLFi3eFu1VdzrfpBSrg6cbcTNzTiPh_PKSv2r4vjivrrNQYpMx50AwQSYt8kY2hD-EXJWKtANVvwTxgsQQD1h94G8O_IPCUlunHmeFN1SS6_6E/s640/resym-dir.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Where #1 are dSYMs as copied from the iTunes connect. #2 is the crashpoint saved from the crash organizer window in xCode. #4 is a crash log extracted from the crashpoint file (right click and &quot;show package contents&quot;)&lt;br /&gt;
&lt;br /&gt;
To get #3 - a symbolicatecrash app, execute this in the target directory (xcode 7.3):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cp /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash symbolicatecrash&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
For different versions of xcode the location of symbolicatecrash will be different.&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
To get symbolicatecrash ready to operate execute:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;export DEVELOPER_DIR=&#39;/Applications/Xcode.app/Contents/Developer&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
Only one step is left! That&#39;s to get your crash log symbolicated:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;./symbolicatecrash a.crash dSYMs/ &amp;gt; a.log&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
And the output file a.log is looking like:&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUNPXAuFplHyb2pb93JnblPL0eCgKcO-i52skEOnDAZeI7lYp8n54e3m6L703YJEVGI-GlotV2aoaM-T6Ur2c5Mqtd2Ycj5g75-tvNL3hd-zxMLDkZJfrFwP4Gaqg5L86Ej6XlnKwbZc/s1600/symbolicated.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpUNPXAuFplHyb2pb93JnblPL0eCgKcO-i52skEOnDAZeI7lYp8n54e3m6L703YJEVGI-GlotV2aoaM-T6Ur2c5Mqtd2Ycj5g75-tvNL3hd-zxMLDkZJfrFwP4Gaqg5L86Ej6XlnKwbZc/s640/symbolicated.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Way better, is not it?&lt;br /&gt;
&lt;br /&gt;
There are nuances that I would not touch here, like these dSYM files you downloaded are for different architectures and it would be the best to match your specific crash log to a corresponding dSYM. I&#39;ll leave this detail to you, my experience is that function names do match quite well, then it is just about the line of code information you&#39;ll be getting. In above picture, given crash and dSYM are matched well, you can see the line of code where the crash exactly happened. Otherwise you&#39;d see&amp;nbsp;+xyz there and that&#39;s not that helpful.&lt;br /&gt;
&lt;br /&gt;
This is it. Please don&#39;t judge me strictly, I&#39;m not an expert in any field, as I learnt over time :)! Knowing more than I do? Share your knowledge in the comments!&lt;br /&gt;
&lt;br /&gt;
Yours,&lt;br /&gt;
Stan.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/2815794975400212189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/2815794975400212189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2815794975400212189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/2815794975400212189'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/05/symbolicating-bitcode-crash-logs-in.html' title='Symbolicating bitcode crash logs in XCode'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp7ZsnEtHNM8_pmT2IFc1eFss4K_s2omPG-SWP9Pca0j7KeReC6lFwCjgw13TgD3s4BjhzJXrcLXCn4gRt0kfKbavrnVfFt_7Vc9SbndX8yCnvGwM67tbDWq60mPI56U6SfRNS5sA4y_U/s72-c/downloadDSYM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-1395984905787912079</id><published>2016-04-27T13:59:00.002+02:00</published><updated>2016-04-27T17:42:51.194+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="erlang"/><category scheme="http://www.blogger.com/atom/ns#" term="http"/><category scheme="http://www.blogger.com/atom/ns#" term="tibco"/><category scheme="http://www.blogger.com/atom/ns#" term="wcf"/><title type='text'>Erlang http response emulator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Recently I had to implement a &quot;transparent&quot; proxy between Tibco and Blackberry. I thought I&#39;d share the erlang module I wrote to emulate responses from BB as you can&#39;t really expect from BB server to give you error responses or timeouts so you can test your proxy part. Here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96&lt;/pre&gt;
&lt;/td&gt;&lt;td&gt;&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;-&lt;span style=&quot;color: #880000; font-weight: bold;&quot;&gt;module&lt;/span&gt;(httpemulator).
-&lt;span style=&quot;color: #880000; font-weight: bold;&quot;&gt;author&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;stanislavdvoychenko&quot;&lt;/span&gt;).

-&lt;span style=&quot;color: #880000; font-weight: bold;&quot;&gt;export&lt;/span&gt;([client&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;, server&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;,start&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;,accept&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;,enter_loop&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;,loop&lt;span style=&quot;color: #333333;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;]).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;client&lt;/span&gt;() &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  {ok, &lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;connect&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;localhost&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;4001&lt;/span&gt;,[list, {packet, &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;}]),
  ok &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #007020;&quot;&gt;send&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;, &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;packet&quot;&lt;/span&gt;),
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;receive&lt;/span&gt;
    {tcp,&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;,&lt;span style=&quot;color: #996633;&quot;&gt;String&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Client received = &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,[&lt;span style=&quot;color: #996633;&quot;&gt;String&lt;/span&gt;]),
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Client result = &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,[&lt;span style=&quot;color: #996633;&quot;&gt;String&lt;/span&gt;]),
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;close&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;)
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;after&lt;/span&gt; &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1000&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #007020;&quot;&gt;exit&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;.

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;server&lt;/span&gt;() &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;spawn&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;fun&lt;/span&gt;()&lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; start() &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;),
  &lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt;.

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;start&lt;/span&gt;() &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Started Server:&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;),
  {ok, &lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;listen&lt;/span&gt;(&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;4001&lt;/span&gt;, [binary, {packet, &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;},{reuseaddr, true},{active, false}]),
  accept(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;accept&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;ListenSocket&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Accept Server:&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;),
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;accept&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;ListenSocket&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;of&lt;/span&gt;
    {ok, &lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;spawn&lt;/span&gt;(&lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;fun&lt;/span&gt;() &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Connection accepted &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;, []),
        enter_loop(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;)
                  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;),
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Pid &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,[&lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt;]),
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;controlling_process&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;, &lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt;),
      &lt;span style=&quot;color: #996633;&quot;&gt;Pid&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;!&lt;/span&gt; ack,
      accept(&lt;span style=&quot;color: #996633;&quot;&gt;ListenSocket&lt;/span&gt;);
    &lt;span style=&quot;color: #996633;&quot;&gt;Error&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: #007020;&quot;&gt;exit&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Error&lt;/span&gt;)
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;.

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;enter_loop&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #888888;&quot;&gt;%% make sure to acknowledge owner rights transmission finished&lt;/span&gt;
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;receive&lt;/span&gt; ack &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; ok &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;,
  loop(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;loop&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Loop Server:&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;),
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;recv&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;, &lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;0&lt;/span&gt;) &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;of&lt;/span&gt;
    {ok, &lt;span style=&quot;color: #996633;&quot;&gt;Data&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
          &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Server got data = &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;, [&lt;span style=&quot;color: #996633;&quot;&gt;Data&lt;/span&gt;]),
          &lt;span style=&quot;color: #996633;&quot;&gt;Match&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;re&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;run&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Data&lt;/span&gt;, &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;.*Emulator-Command:&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;(.+)&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;, [{capture, [&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1&lt;/span&gt;],list}]),
      &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;Match&lt;/span&gt; &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;of&lt;/span&gt;
        {match, [&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;timeout&quot;&lt;/span&gt;]} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;Response&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; timeout(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;timeout&quot;&lt;/span&gt;);
        {match, [&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;protocolviolation&quot;&lt;/span&gt;]} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;Response&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; protocol_violation(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Omitting carriage return, this should cause the protocol violation&quot;&lt;/span&gt;);
        {match, [&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;httperror&quot;&lt;/span&gt;]} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;Response&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; http_error(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;500&quot;&lt;/span&gt;, &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Internal Server Error&quot;&lt;/span&gt;);
        _ &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #996633;&quot;&gt;Response&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; response(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;testing&quot;&lt;/span&gt;)
      &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;,

&lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Match: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;, [&lt;span style=&quot;color: #996633;&quot;&gt;Match&lt;/span&gt;]),
          &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #007020;&quot;&gt;send&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;, &lt;span style=&quot;color: #996633;&quot;&gt;Response&lt;/span&gt;);
          &lt;span style=&quot;color: #888888;&quot;&gt;%%loop(Socket);&lt;/span&gt;
    {error, &lt;span style=&quot;color: #996633;&quot;&gt;Reason&lt;/span&gt;} &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;format&lt;/span&gt;(&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;Error on socket &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt; reason: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p~n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;, [&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;, &lt;span style=&quot;color: #996633;&quot;&gt;Reason&lt;/span&gt;]),
      &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;gen_tcp&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;close&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Socket&lt;/span&gt;)
  &lt;span style=&quot;color: #008800; font-weight: bold;&quot;&gt;end&lt;/span&gt;.

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;response&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;),
  &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(
    &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io_lib&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;fwrite&lt;/span&gt;(
      &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HTTP/1.0 200 OK&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Type: text/html&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Length: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,
      [&lt;span style=&quot;color: #007020;&quot;&gt;size&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;), &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;])).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;timeout&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;timer&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;sleep&lt;/span&gt;(&lt;span style=&quot;color: #0000dd; font-weight: bold;&quot;&gt;1000000000&lt;/span&gt;),
  &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;),
  &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(
    &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io_lib&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;fwrite&lt;/span&gt;(
      &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HTTP/1.0 200 OK&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Type: text/html&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Length: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,
      [&lt;span style=&quot;color: #007020;&quot;&gt;size&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;), &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;])).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;protocol_violation&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;),
  &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(
    &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io_lib&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;fwrite&lt;/span&gt;(
      &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HTTP/1.0 200 OK&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Type: text/html&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Length: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\n\n&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,
      [&lt;span style=&quot;color: #007020;&quot;&gt;size&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;), &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;])).

&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;http_error&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Code&lt;/span&gt;, &lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;) &lt;span style=&quot;color: #333333;&quot;&gt;-&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt; &lt;span style=&quot;color: #333333;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;Str&lt;/span&gt;),
  &lt;span style=&quot;color: #007020;&quot;&gt;iolist_to_binary&lt;/span&gt;(
    &lt;span style=&quot;color: #0e84b5; font-weight: bold;&quot;&gt;io_lib&lt;/span&gt;:&lt;span style=&quot;color: #0066bb; font-weight: bold;&quot;&gt;fwrite&lt;/span&gt;(
      &lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;HTTP/1.0 &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Type: text/html&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;Content-Length: &lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~p&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\r\n\r\n&lt;/span&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;~s&lt;/span&gt;&lt;span style=&quot;background-color: #fff0f0;&quot;&gt;&quot;&lt;/span&gt;,
      [&lt;span style=&quot;color: #996633;&quot;&gt;Code&lt;/span&gt;, &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;, &lt;span style=&quot;color: #007020;&quot;&gt;size&lt;/span&gt;(&lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;), &lt;span style=&quot;color: #996633;&quot;&gt;B&lt;/span&gt;])).
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;br /&gt;
This Erlang module expects you to sent an extra http header&amp;nbsp;Emulator-Command: * where * can be:&lt;br /&gt;
&lt;br /&gt;
httperror -&amp;gt; returns 500 and Internal Server Error&lt;br /&gt;
timeout -&amp;gt; runs a long sleep on Erlang side, causes timeout on a proxy side&lt;br /&gt;
protocolviolation -&amp;gt; As I built the proxy in ,net WCF it was funny to see that MS takes only \n in the http headers as a protocol violation, so \r\n is required to keep MS happy.&lt;br /&gt;
&lt;br /&gt;
anything else there or omitting this header will just return proper http response with &quot;testing&quot; body.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Disclaimer. I&#39;m only starting to learn Erlang so please take the code with caution of course!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To compile in the erlang shell:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: cyan;&quot;&gt;c(httpemulator).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To start emulator server:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: cyan;&quot;&gt;httpemulator:server().&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To end the emulator process:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: cyan;&quot;&gt;exit(pid(0,96,0), old).&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Pid is returned at the server start.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hope it can be useful :).&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/1395984905787912079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/1395984905787912079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1395984905787912079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1395984905787912079'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/04/erlang-http-response-emulator.html' title='Erlang http response emulator'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-5620087551890571591</id><published>2016-04-14T13:59:00.000+02:00</published><updated>2016-04-28T18:31:33.975+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="xcode"/><title type='text'>xcode - Configure for analyzing. The scheme is not configured for analyzing. </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I&#39;m used to run analyzing cycle on my apps when moving closer to their public release. This time xcode (7.3 (7D175)) greeted me with:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXZ7kA6fQVQOC2Ri7W6c8GnWqFkJJPs_4zx84H_Wrs0Ca4NhTtw2tOO2FdwwseCILacPaT_Vj7Wmv7Ss6vIQpiZGbiKKYUwuGgr5H4guiAV2cxc6H0PbOeJCA4vmH20Oa2AJSXnzX0FyU/s1600/xcode-configure-anlyzing-message.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;127&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXZ7kA6fQVQOC2Ri7W6c8GnWqFkJJPs_4zx84H_Wrs0Ca4NhTtw2tOO2FdwwseCILacPaT_Vj7Wmv7Ss6vIQpiZGbiKKYUwuGgr5H4guiAV2cxc6H0PbOeJCA4vmH20Oa2AJSXnzX0FyU/s320/xcode-configure-anlyzing-message.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&quot;Edit the scheme to enable analyzing, or cancel the action.&quot; with that &quot;Edit Scheme ...&quot; was not opening anything and I didn&#39;t notice anything extra in the schema editor to enable analyzing.&lt;br /&gt;
&lt;br /&gt;
I even created a clean new project to see if error would be present there as well, and it was.&lt;br /&gt;
&lt;br /&gt;
So after scratching my head a bit I just set a RUN_CLANG_STATIC_ANALYZER as true for the target/build where I needed it:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHelxPpoDn-8ECMjWzOpStx2hitDw1hyKgB7LoKKo_z37008Z7xbgk4LmmZ1sVs6zVkhCVxDbEs8erXntBx639bxQbMvhj8ZqfVs4Et4BL6DVlxzlokt9MHnPzr5I7wt-4Ihr86I73bg/s1600/xcode-analyze-during-build.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;106&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNHelxPpoDn-8ECMjWzOpStx2hitDw1hyKgB7LoKKo_z37008Z7xbgk4LmmZ1sVs6zVkhCVxDbEs8erXntBx639bxQbMvhj8ZqfVs4Et4BL6DVlxzlokt9MHnPzr5I7wt-4Ihr86I73bg/s320/xcode-analyze-during-build.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This way I got the static analysis messages back.&lt;br /&gt;
&lt;br /&gt;
Hope this can help someone!&lt;br /&gt;
&lt;br /&gt;
Update. Or as Jaime Santana commented, just &quot;&lt;span style=&quot;background-color: white; color: #262626; font-family: Roboto, arial, sans-serif; font-size: 13px; line-height: 18.2px;&quot;&gt;launch Analysis from the menu option Menu -&amp;gt; Product -&amp;gt; Analyze&quot;. Thank you Jamie, that worked!&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/5620087551890571591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/5620087551890571591' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5620087551890571591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5620087551890571591'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/04/xcode-configure-for-analyzing-scheme-is.html' title='xcode - Configure for analyzing. The scheme is not configured for analyzing. '/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXZ7kA6fQVQOC2Ri7W6c8GnWqFkJJPs_4zx84H_Wrs0Ca4NhTtw2tOO2FdwwseCILacPaT_Vj7Wmv7Ss6vIQpiZGbiKKYUwuGgr5H4guiAV2cxc6H0PbOeJCA4vmH20Oa2AJSXnzX0FyU/s72-c/xcode-configure-anlyzing-message.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-909910388319689913</id><published>2016-02-18T14:56:00.000+01:00</published><updated>2016-02-18T14:56:16.276+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>Note to self - concatenating rows into string with MSSQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here is a sample code:&lt;br /&gt;
&lt;br /&gt;
select count(a.v2_icid), a.v2_icid,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;(select distinct(fullname) + &#39;,&#39; AS [text()] from systemuser u&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;join account acc on acc.ownerid = u.systemuserid&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;where acc.v2_icid = a.v2_icid For XML PATH (&#39;&#39;)) [Users]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; from account a&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;where statecode = 0 and a.v2_icid is not null&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;group by a.v2_icid&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;having count(a.v2_icid) &amp;gt; 1&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;order by a.v2_icid&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/909910388319689913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/909910388319689913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/909910388319689913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/909910388319689913'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2016/02/note-to-self-concatenating-rows-into.html' title='Note to self - concatenating rows into string with MSSQL'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-5129599596660530634</id><published>2015-12-07T15:11:00.002+01:00</published><updated>2015-12-07T15:21:11.526+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="debug"/><category scheme="http://www.blogger.com/atom/ns#" term="windbg"/><title type='text'>So, here is my string dump for x64 in windbg</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Based on &lt;a href=&quot;http://stackoverflow.com/questions/5349945/windbg-and-sos-how-do-i-print-dump-a-large-string&quot;&gt;this&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://stackoverflow.com/questions/20343045/how-to-dump-string-using-windbg-poi-function&quot;&gt;that&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
$$&amp;gt;a&amp;lt;&quot;c:\_install\dumpstringtofolder.txt&quot; 000007feed816500 1000 c:\temp\stringtest&lt;br /&gt;
&lt;br /&gt;
and the script:&lt;br /&gt;
&lt;br /&gt;
$$ Dumps the managed strings to a file&lt;br /&gt;
$$ Platform x64&lt;br /&gt;
$$ First argument is the string method table pointer&lt;br /&gt;
$$ Second argument is the Min size of the string that needs to be used filter&lt;br /&gt;
$$ the strings&lt;br /&gt;
$$ Third is the path of the file&lt;br /&gt;
.foreach ($string {!dumpheap -short -mt ${$arg1} &amp;nbsp;-min ${$arg2}})&lt;br /&gt;
{&lt;br /&gt;
r@$t0= &amp;nbsp;poi(${$string}+8)*2&lt;br /&gt;
.writemem ${$arg3}${$string}.txt ${$string}+c L? @$t0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The only other thing I needed this time is this on one of the strings:&lt;br /&gt;
&lt;br /&gt;
!gcroot 0000000100e769f0&lt;br /&gt;
&lt;br /&gt;
To see:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;-&amp;gt; &amp;nbsp;0000000180006d08 System.Web.Caching.CacheMultiple&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;00000001800069c8 System.Web.Caching.CacheCommon&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;00000001800034a8 System.Web.RequestTimeoutManager&lt;br /&gt;
....&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;00000004021b5740 System.Web.SessionState.InProcSessionState&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;00000004021b5288 System.Web.SessionState.SessionStateItemCollection&lt;br /&gt;
....&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;0000000289779a58 ASP.ordercomposer_orderedit_aspx&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; &amp;nbsp;000000018c14fe38 XYZ.Ordering.Modules.OrderingViewStatePresister&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
So this time the root of the problem was in keeping viewstate in the session and not really purging not needed view state away. This was one of the legacy apps and reminded everyone the old none-tasty view state solution from MS :). Viva MVC and looking forward the day with no legacy ASP.NET apps we need to support :)!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/5129599596660530634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/5129599596660530634' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5129599596660530634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/5129599596660530634'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2015/12/so-here-is-my-string-dump-for-x64-in.html' title='So, here is my string dump for x64 in windbg'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-584619127557205820.post-1537841532532038302</id><published>2014-05-20T23:13:00.001+02:00</published><updated>2014-05-20T23:15:31.532+02:00</updated><title type='text'>NGINX + PostgreSQL + PostGIS - performance baseline/diff</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Just wanted to share some of the initial benchmark from http_load on the project I&#39;m working right now. Why the excitement? I&#39;ve been an MS oriented guy for the last 20 years and moving away from IIS and MSSQL (where you can be waiting 20-30 seconds for the initial IIS/.NET/SQL app startup) to &lt;a href=&quot;http://nginx.org/&quot;&gt;NGINX&lt;/a&gt; with PostgreSQL stack is life changing - no exaggeration!&lt;br /&gt;
&lt;br /&gt;
So here is what I got on &lt;a href=&quot;https://www.digitalocean.com/&quot;&gt;Digital Ocean&lt;/a&gt; lowest spec machine (1 core, 20GB SSD, 512 MB RAM, Ubuntu 12) with a bare NGINX:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; max-width: 70em; overflow: auto; padding: 0.5em;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;34178&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fetches&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; max parallel&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;683560&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; seconds
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mean bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;connection
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;6835.6&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fetches&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sec&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;136712&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sec
msecs&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.0445469&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mean&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.937&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; max&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.021&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; min
&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;msecs&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; white-space: normal;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; white-space: normal;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; white-space: normal;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; white-space: normal;&quot;&gt;1.41242&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;mean&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; white-space: normal;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; white-space: normal;&quot;&gt;101.975&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;max&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; white-space: normal;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; white-space: normal;&quot;&gt;0.257&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;min&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
And with the full nginx-&amp;gt;postgresql with postgis searching for speed limits around submitted location (but only a few limits present in db for a moment):&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; max-width: 70em; overflow: auto; padding: 0.5em;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5574&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fetches&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; max parallel&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;6.22058e+06&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; seconds
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1116&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mean bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;connection
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1114.8&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; fetches&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sec&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;1.24412e+06&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; bytes&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sec
msecs&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.0561055&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mean&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.37&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; max&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.023&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; min
msecs&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;first&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;8.68285&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; mean&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;187.733&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; max&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0.812&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; min&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
So it got from almost 7k to 1k per second, still that&#39;s from the different universe compared to what IIS/.NET would do for me, and look at the machine spec! Plus, $0.0 for nginx&amp;nbsp;+ $0.0 for posgre/postgis - pure win!&lt;br /&gt;
&lt;br /&gt;
-- Stan.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://plainoldstan.blogspot.com/feeds/1537841532532038302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/584619127557205820/1537841532532038302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1537841532532038302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/584619127557205820/posts/default/1537841532532038302'/><link rel='alternate' type='text/html' href='http://plainoldstan.blogspot.com/2014/05/nginx-postgresql-postgis-performance.html' title='NGINX + PostgreSQL + PostGIS - performance baseline/diff'/><author><name>stan</name><uri>http://www.blogger.com/profile/17953164778965672435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>