<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Black Eternal</title>
	<atom:link href="https://blacketernal.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blacketernal.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 15 Jun 2015 20:54:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">2998125</site><cloud domain='blacketernal.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s2.wp.com/i/webclip.png</url>
		<title>Black Eternal</title>
		<link>https://blacketernal.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://blacketernal.wordpress.com/osd.xml" title="Black Eternal" />
	<atom:link rel='hub' href='https://blacketernal.wordpress.com/?pushpress=hub'/>
	<item>
		<title>C# custom Equatable, StructuralEquatable, Comparable, StructuralComparable range object</title>
		<link>https://blacketernal.wordpress.com/2014/04/01/c-custom-equatable-structuralequatable-comparable-structuralcomparable-range-object/</link>
					<comments>https://blacketernal.wordpress.com/2014/04/01/c-custom-equatable-structuralequatable-comparable-structuralcomparable-range-object/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Tue, 01 Apr 2014 15:08:29 +0000</pubDate>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[IComparable]]></category>
		<category><![CDATA[IEquatable]]></category>
		<category><![CDATA[IStructuralComparable]]></category>
		<category><![CDATA[IStructuralEquatable]]></category>
		<category><![CDATA[Range]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=1330</guid>

					<description><![CDATA[Recently I needed to use some kind of range representation, which could also work as a dictionary key. For this purpose, the object (derived from IEquatable at the very least), has to implement the Equals method and the GetHashCode method. My range implementation is inspired by the Tuple from the .NET framework. Here&#8217;s the code:]]></description>
										<content:encoded><![CDATA[<p>Recently I needed to use some kind of range representation, which could also work as a dictionary key. For this purpose, the object (derived from <code>IEquatable</code> at the very least), has to implement the <code>Equals</code> method and the <code>GetHashCode</code> method. My range implementation is inspired by the <a href="http://msdn.microsoft.com/en-us/library/dd268536(v=vs.110).aspx">Tuple</a> from the .NET framework. Here&#8217;s the code:</p>
<pre class="brush: csharp; title: ; notranslate">
public class Range : IStructuralEquatable, IStructuralComparable, IComparable {
    public int Start { get; set; }
    public int End { get; private set; }
 
    public int Size {
      get { return End - Start; }
    }
 
    public Range(int start, int end) {
      if (Start &gt; End) throw new ArgumentException(&quot;Start cannot be greater than End.&quot;);
      Start = start;
      End = end;
    }
 
    public int CompareTo(object obj) {
      return ((IComparable)this).CompareTo(obj);
    }
 
    public int CompareTo(object other, IComparer comparer) {
      return ((IStructuralComparable)this).CompareTo(other, comparer);
    }
 
    public override bool Equals(object obj) {
      return ((IStructuralEquatable)this).Equals(obj, EqualityComparer&lt;object&gt;.Default);
    }
 
    public bool Equals(object other, IEqualityComparer comparer) {
      if (other == null) return false;
      var otherRange = other as SlidingWindowRange;
      if (otherRange == null) return false;
      return comparer.Equals(Start, otherRange.Start) &amp;&amp; comparer.Equals(End, otherRange.End);
    }
 
    int IComparable.CompareTo(Object obj) {
      return ((IStructuralComparable)this).CompareTo(obj, Comparer&lt;object&gt;.Default);
    }
 
    int IStructuralComparable.CompareTo(Object other, IComparer comparer) {
      if (other == null) return 1;
 
      var otherRange = other as SlidingWindowRange;
 
      if (otherRange == null) {
        throw new ArgumentException(&quot;Incorrect type of other object.&quot;);
      }
 
      int c = comparer.Compare(Start, otherRange.Start);
      return c == 0 ? comparer.Compare(End, otherRange.End) : c;
    }
 
    public override int GetHashCode() {
      return ((IStructuralEquatable)this).GetHashCode(EqualityComparer&lt;object&gt;.Default);
    }
 
    int IStructuralEquatable.GetHashCode(IEqualityComparer comparer) {
      return Range.CombineHashCodes(comparer.GetHashCode(Start), comparer.GetHashCode(End));
    }
 
    public int GetHashCode(IEqualityComparer comparer) {
      return ((IStructuralEquatable)this).GetHashCode(comparer);
    }
 
    internal static int CombineHashCodes(int h1, int h2) {
      return (((h1 &lt;&lt; 5) + h1) ^ h2);
    }
 
    public override string ToString() {
      StringBuilder sb = new StringBuilder();
      return (this).ToString(sb);
    }
 
    string ToString(StringBuilder sb) {
      sb.Append(&quot;(&quot;);
      sb.Append(Start);
      sb.Append(&quot; - &quot;);
      sb.Append(End);
      sb.Append(&quot;)&quot;);
      return sb.ToString();
    }
  }
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2014/04/01/c-custom-equatable-structuralequatable-comparable-structuralcomparable-range-object/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1330</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>A C# implementation of the Reingold-Tilford tree layout algorithm for HeuristicLab</title>
		<link>https://blacketernal.wordpress.com/2013/06/20/a-c-implementation-of-the-reingold-tilford-tree-layout-algorithm-for-heuristiclab/</link>
					<comments>https://blacketernal.wordpress.com/2013/06/20/a-c-implementation-of-the-reingold-tilford-tree-layout-algorithm-for-heuristiclab/#comments</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Thu, 20 Jun 2013 12:12:14 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[heuristiclab]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[layout algorithm]]></category>
		<category><![CDATA[reingold-tilford]]></category>
		<category><![CDATA[tree layout]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=1144</guid>

					<description><![CDATA[Trees are fundamental data structures used everywhere in Computer Science. We use symbolic expression trees in HeuristicLab in our genetic programming implementation. I implemented the layout algorithm described in the paper of Buchheim, Jünger and Leipert, Drawing rooted trees in linear time. The implementation is very straightforward, with the only difference that I used a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTree_(data_structure)">Trees</a> are fundamental data structures used everywhere in Computer Science. </p>
<p>We use symbolic expression trees in <a href="http://dev.heuristiclab.com">HeuristicLab</a> in our <a href="http://en.wikipedia.org/wiki/Genetic_programming">genetic programming</a> implementation.</p>
<p>I implemented the layout algorithm described in the paper of Buchheim, Jünger and Leipert, <a href="http://dl.acm.org/citation.cfm?id=1133017">Drawing rooted trees in linear time</a>.</p>
<p>The implementation is very straightforward, with the only difference that I used a dictionary to map the symbolic expression trees nodes to the node structures used by the layout algorithm. </p>
<p>The resulting layout:<br />
<img src="https://i0.wp.com/i.imgur.com/htGwxGS.png" alt="" /></p>
<p>The code:</p>
<pre class="brush: csharp; collapse: true; light: false; title: ; toolbar: true; notranslate">
#region License Information
/* HeuristicLab
 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
 *
 * This file is part of HeuristicLab.
 *
 * HeuristicLab is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * HeuristicLab is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HeuristicLab. If not, see &lt;http://www.gnu.org/licenses/&gt;.
 */
#endregion

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;

namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
  public class Node {
    public Node Thread;
    public Node Ancestor;

    public float Mod; // position modifier
    public float Prelim;
    public float Change;
    public float Shift;
    public int Number;

    public float X;
    public float Y;

    public ISymbolicExpressionTreeNode SymbolicExpressionTreeNode;

    public bool IsLeaf {
      get { return SymbolicExpressionTreeNode.SubtreeCount == 0; }
    }
  }

  public class TreeLayout {
    private float distance = 5;
    public float Distance {
      get { return distance; }
      set { distance = value; }
    }

    private ISymbolicExpressionTree symbolicExpressionTree;
    public ISymbolicExpressionTree SymbolicExpressionTree {
      get { return symbolicExpressionTree; }
      set {
        symbolicExpressionTree = value;
        nodes.Clear();
        var treeNodes = SymbolicExpressionTree.IterateNodesBreadth().ToList();
        foreach (var treeNode in treeNodes) {
          var node = new Node { SymbolicExpressionTreeNode = treeNode };
          node.Ancestor = node;
          nodes.Add(treeNode, node);
        }
        // assign a number to each node, representing its position among its siblings (parent.IndexOfSubtree)
        foreach (var treeNode in treeNodes.Where(x =&gt; x.SubtreeCount &gt; 0)) {
          for (int i = 0; i != treeNode.SubtreeCount; ++i) {
            nodes[treeNode.GetSubtree(i)].Number = i;
          }
        }
        var r = nodes[symbolicExpressionTree.Root];
        FirstWalk(r);
        SecondWalk(r, -r.Prelim);
        NormalizeCoordinates();
      }
    }

    /// &lt;summary&gt;
    /// Returns a map of coordinates for each node in the symbolic expression tree.
    /// &lt;/summary&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public Dictionary&lt;ISymbolicExpressionTreeNode, PointF&gt; GetNodeCoordinates() {
      var dict = new Dictionary&lt;ISymbolicExpressionTreeNode, PointF&gt;();
      if (nodes == null || nodes.Count == 0) return dict;
      foreach (var node in nodes.Values) {
        dict.Add(node.SymbolicExpressionTreeNode, new PointF { X = node.X, Y = node.Y });
      }
      return dict;
    }

    /// &lt;summary&gt;
    /// Returns the bounding box for this layout. When the layout is normalized, the rectangle should be [0,0,xmin,xmax].
    /// &lt;/summary&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public RectangleF Bounds() {
      float xmin, xmax, ymin, ymax; xmin = xmax = ymin = ymax = 0;
      var list = nodes.Values.ToList();
      for (int i = 0; i != list.Count; ++i) {
        float x = list[i].X, y = list[i].Y;
        if (xmin &gt; x) xmin = x;
        if (xmax &lt; x) xmax = x;
        if (ymin &gt; y) ymin = y;
        if (ymax &lt; y) ymax = y;
      }
      return new RectangleF(xmin, ymin, xmax + distance, ymax + distance);
    }

    /// &lt;summary&gt;
    /// Returns a string containing all the coordinates (useful for debugging).
    /// &lt;/summary&gt;
    /// &lt;returns&gt;&lt;/returns&gt;
    public string DumpCoordinates() {
      if (nodes == null || nodes.Count == 0) return string.Empty;
      return nodes.Values.Aggregate(&quot;&quot;, (current, node) =&gt; current + (node.X + &quot; &quot; + node.Y + Environment.NewLine));
    }

    private readonly Dictionary&lt;ISymbolicExpressionTreeNode, Node&gt; nodes;

    public TreeLayout() {
      nodes = new Dictionary&lt;ISymbolicExpressionTreeNode, Node&gt;();
    }

    /// &lt;summary&gt;
    /// Transform node coordinates so that all coordinates are positive and start from 0.
    /// &lt;/summary&gt;
    private void NormalizeCoordinates() {
      var list = nodes.Values.ToList();
      float xmin = 0, ymin = 0;
      for (int i = 0; i != list.Count; ++i) {
        if (xmin &gt; list[i].X) xmin = list[i].X;
        if (ymin &gt; list[i].Y) ymin = list[i].Y;
      }
      for (int i = 0; i != list.Count; ++i) {
        list[i].X -= xmin;
        list[i].Y -= ymin;
      }
    }

    private void FirstWalk(Node v) {
      Node w;
      if (v.IsLeaf) {
        w = LeftSibling(v);
        if (w != null) {
          v.Prelim = w.Prelim + distance;
        }
      } else {
        var symbExprNode = v.SymbolicExpressionTreeNode;
        var defaultAncestor = nodes[symbExprNode.GetSubtree(0)]; // let defaultAncestor be the leftmost child of v
        for (int i = 0; i != symbExprNode.SubtreeCount; ++i) {
          var s = symbExprNode.GetSubtree(i);
          w = nodes[s];
          FirstWalk(w);
          Apportion(w, ref defaultAncestor);
        }
        ExecuteShifts(v);
        int c = symbExprNode.SubtreeCount;
        var leftmost = nodes[symbExprNode.GetSubtree(0)];
        var rightmost = nodes[symbExprNode.GetSubtree(c - 1)];
        float midPoint = (leftmost.Prelim + rightmost.Prelim) / 2;
        w = LeftSibling(v);
        if (w != null) {
          v.Prelim = w.Prelim + distance;
          v.Mod = v.Prelim - midPoint;
        } else {
          v.Prelim = midPoint;
        }
      }
    }

    private void SecondWalk(Node v, float m) {
      v.X = v.Prelim + m;
      v.Y = symbolicExpressionTree.Root.GetBranchLevel(v.SymbolicExpressionTreeNode) * distance;
      var symbExprNode = v.SymbolicExpressionTreeNode;
      foreach (var s in symbExprNode.Subtrees) {
        SecondWalk(nodes[s], m + v.Mod);
      }
    }

    private void Apportion(Node v, ref Node defaultAncestor) {
      var w = LeftSibling(v);
      if (w == null) return;
      Node vip = v;
      Node vop = v;
      Node vim = w;
      Node vom = LeftmostSibling(vip);

      float sip = vip.Mod;
      float sop = vop.Mod;
      float sim = vim.Mod;
      float som = vom.Mod;

      while (NextRight(vim) != null &amp;&amp; NextLeft(vip) != null) {
        vim = NextRight(vim);
        vip = NextLeft(vip);
        vom = NextLeft(vom);
        vop = NextRight(vop);
        vop.Ancestor = v;
        float shift = (vim.Prelim + sim) - (vip.Prelim + sip) + distance;
        if (shift &gt; 0) {
          var ancestor = Ancestor(vim, v) ?? defaultAncestor;
          MoveSubtree(ancestor, v, shift);
          sip += shift;
          sop += shift;
        }
        sim += vim.Mod;
        sip += vip.Mod;
        som += vom.Mod;
        sop += vop.Mod;
      }
      if (NextRight(vim) != null &amp;&amp; NextRight(vop) == null) {
        vop.Thread = NextRight(vim);
        vop.Mod += (sim - sop);
      }
      if (NextLeft(vip) != null &amp;&amp; NextLeft(vom) == null) {
        vom.Thread = NextLeft(vip);
        vom.Mod += (sip - som);
        defaultAncestor = v;
      }
    }

    private void MoveSubtree(Node wm, Node wp, float shift) {
      int subtrees = wp.Number - wm.Number;
      wp.Change -= shift / subtrees;
      wp.Shift += shift;
      wm.Change += shift / subtrees;
      wp.Prelim += shift;
      wp.Mod += shift;
    }

    private void ExecuteShifts(Node v) {
      if (v.IsLeaf) return;
      float shift = 0;
      float change = 0;
      for (int i = v.SymbolicExpressionTreeNode.SubtreeCount - 1; i &gt;= 0; --i) {
        var subtree = v.SymbolicExpressionTreeNode.GetSubtree(i);
        var w = nodes[subtree];
        w.Prelim += shift;
        w.Mod += shift;
        change += w.Change;
        shift += (w.Shift + change);
      }
    }

    #region Helper functions
    private Node Ancestor(Node vi, Node v) {
      var ancestor = vi.Ancestor;
      return ancestor.SymbolicExpressionTreeNode.Parent == v.SymbolicExpressionTreeNode.Parent ? ancestor : null;
    }

    private Node NextLeft(Node v) {
      int c = v.SymbolicExpressionTreeNode.SubtreeCount;
      return c == 0 ? v.Thread : nodes[v.SymbolicExpressionTreeNode.GetSubtree(0)]; // return leftmost child
    }

    private Node NextRight(Node v) {
      int c = v.SymbolicExpressionTreeNode.SubtreeCount;
      return c == 0 ? v.Thread : nodes[v.SymbolicExpressionTreeNode.GetSubtree(c - 1)]; // return rightmost child
    }

    private Node LeftSibling(Node n) {
      var parent = n.SymbolicExpressionTreeNode.Parent;
      if (parent == null) return null;
      int i = parent.IndexOfSubtree(n.SymbolicExpressionTreeNode);
      if (i == 0) return null;
      return nodes[parent.GetSubtree(i - 1)];
    }

    private Node LeftmostSibling(Node n) {
      var parent = n.SymbolicExpressionTreeNode.Parent;
      if (parent == null) return null;
      int i = parent.IndexOfSubtree(n.SymbolicExpressionTreeNode);
      if (i == 0) return null;
      return nodes[parent.GetSubtree(0)];
    }
    #endregion
  }
}
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2013/06/20/a-c-implementation-of-the-reingold-tilford-tree-layout-algorithm-for-heuristiclab/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1144</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>

		<media:content url="http://i.imgur.com/htGwxGS.png" medium="image" />
	</item>
		<item>
		<title>Meta &#8211; a minimalistic C++11 optimization framework</title>
		<link>https://blacketernal.wordpress.com/2013/06/20/meta-a-minimalistic-c11-optimization-framework/</link>
					<comments>https://blacketernal.wordpress.com/2013/06/20/meta-a-minimalistic-c11-optimization-framework/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Thu, 20 Jun 2013 11:22:44 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[backpropagation]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[c++11]]></category>
		<category><![CDATA[genetic programming]]></category>
		<category><![CDATA[metaheuristic]]></category>
		<category><![CDATA[neural network]]></category>
		<category><![CDATA[optmimization]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=1139</guid>

					<description><![CDATA[Meta is a small and easy to understand header-only library containing: a generic templated genetic algorithm a neural network, trained with backpropagation (better training with rprop is on the way) some useful classes for calculating statistics (mean, variance, covariance, pearson&#8217;s R2), generating random numbers and dealing with datasets. This code is far from complete and [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Meta is a small and easy to understand header-only library containing:</p>
<ul>
<li>a generic templated genetic algorithm</li>
<li>a neural network, trained with backpropagation (better training with rprop is on the way)</li>
<li>some useful classes for calculating statistics (mean, variance, covariance, pearson&#8217;s R2), generating random numbers and dealing with datasets.</li>
</ul>
<p>This code is far from complete and will likely have bugs and I will keep working on it when I have time. For now, it is available at github: <a href="https://github.com/bburlacu/meta" rel="nofollow">https://github.com/bburlacu/meta</a></p>
<p><b>Usage example</b><br />
The genetic algorithm optimizer <code>ga_optimizer</code> needs to be provided with the problem-specific operators for creating, evaluating and modifying chromosomes/individuals.</p>
<div style="font-size:small;">
<pre class="brush: cpp; light: true; title: ; notranslate">
template &lt;class Evaluator, class Creator, class CrossoverOp, class MutationOp&gt;
class ga_optimizer;
</pre>
</div>
<p>Each of these operators can be defined by deriving the <code>op_base</code> base class:</p>
<div style="font-size:small;">
<pre class="brush: csharp; light: true; title: ; notranslate">
template&lt;typename ReturnType, typename... Args&gt;
class op_base {
public:
    virtual ReturnType operator()(Args... args) = 0;
    rnd *r;
};
</pre>
</div>
<p>where each derived class should take or return pointers to <code>ga_individual</code> or to the derived type:</p>
<div style="font-size:small;">
<pre class="brush: cpp; light: true; title: ; notranslate">
class ga_individual {
public:
	ga_individual() = default;
	ga_individual(const ga_individual&amp;) = default;
	ga_individual(ga_individual&amp;&amp;) = default;
	ga_individual&amp; operator=(const ga_individual&amp;) = default;
	ga_individual&amp; operator=(ga_individual&amp;&amp;) = default;

    virtual ~ga_individual() = default;
    virtual ga_individual* clone() = 0;
    double fitness = 0;
};
</pre>
</div>
<p>The usage is very easy to figure out if you have a look at the complete source code. There is an example of using the ga optimizer with real-valued vector chromosomes for optimizing the weights of a neural network.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2013/06/20/meta-a-minimalistic-c11-optimization-framework/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1139</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>Generic Image Library: Save Raw Image Data to File</title>
		<link>https://blacketernal.wordpress.com/2011/06/02/generic-image-library-save-raw-image-data-to-file/</link>
					<comments>https://blacketernal.wordpress.com/2011/06/02/generic-image-library-save-raw-image-data-to-file/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Thu, 02 Jun 2011 13:53:19 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[generic image library]]></category>
		<category><![CDATA[gil]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[write image to file]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=925</guid>

					<description><![CDATA[GIL (Generic Image Library) is &#8220;a C++ generic library which allows for writing generic imaging algorithms with performance comparable to hand-writing for a particular image type&#8221; and it&#8217;s now part of the Boost Libraries. Today I wanted to implement a save_to_image function for a project I was working on this week, and I thought about [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.boost.org/doc/libs/1_46_1/libs/gil/doc/index.html" title="Generic Image Library">GIL</a> (<b>G</b>eneric <b>I</b>mage <b>L</b>ibrary) is &#8220;<em>a C++ generic library which allows for writing generic imaging algorithms with performance comparable to hand-writing for a particular image type</em>&#8221; and it&#8217;s now part of the <a href="http://www.boost.org" title="Boost Libraries">Boost Libraries</a>.</p>
<p>Today I wanted to implement a <code>save_to_image</code> function for a project I was working on this week, and I thought about using <b>GIL</b>. So after reading the docs I figured out how it works and it&#8217;s remarkably simple.</p>
<p>If we have the raw image data (or can produce it in some way), in the form of three channel vectors:</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
unsigned char r[width*height]; // red
unsigned char g[width*height]; // green
unsigned char b[width*height]; // blue
</pre>
<p>Then we can write it to a png file, for example, like this:</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
#include &lt;boost/gil/extension/io/png_io.hpp&gt;
boost::gil::rgb8c_planar_view_t view = boost::gil::planar_rgb_view(width, height, r, g, b, width);
boost::gil::png_write_view(&quot;gil.png&quot;, view);
</pre>
<p>Also, if your image data also contains an alpha channel, then it&#8217;s just:</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
unsigned char a[width*height]; // red
</pre>
<pre class="brush: cpp; light: true; title: ; notranslate">
#include &lt;boost/gil/extension/io/png_io.hpp&gt;
boost::gil::rgba8c_planar_view_t view = boost::gil::planar_rgba_view(width, height, r, g, b, a, width);
boost::gil::png_write_view(&quot;gil.png&quot;, view);
</pre>
<p>Don&#8217;t forget to link your program with <code>-lpng</code> and, if you run into compile errors, try the following workaround:</p>
<pre class="brush: cpp; light: true; title: ; notranslate">
/* work around some libpng errors */
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
</pre>
<p style="text-align:left;" class="getsocial"><a title="Like This!" href="http://getsociallive.com/gslike.php?likeurl=http%3A%2F%2Fblacketernal.wordpress.com%2F2011%2F06%2F02%2Fgeneric-image-library-save-raw-image-data-to-file%2F&amp;liketitle=Generic%20Image%20Library%3A%20Save%20Raw%20Image%20Data%20to%20File" rel="nofollow" target="_blank"><img style="border:0;margin:0;padding:0;" src="https://getsocialserver.files.wordpress.com/2010/08/gslk4.png?w=49&#038;h=23" width="49" height="23" alt="Like This!" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2011/06/02/generic-image-library-save-raw-image-data-to-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">925</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>

		<media:content url="http://getsocialserver.files.wordpress.com/2010/08/gslk4.png" medium="image">
			<media:title type="html">Like This!</media:title>
		</media:content>
	</item>
		<item>
		<title>Project Euler Problems 39 and 75</title>
		<link>https://blacketernal.wordpress.com/2011/05/30/project-euler-problems-39-and-75-2/</link>
					<comments>https://blacketernal.wordpress.com/2011/05/30/project-euler-problems-39-and-75-2/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Mon, 30 May 2011 18:33:48 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Project Euler]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=917</guid>

					<description><![CDATA[If p is the perimeter of a right angle triangle, {a, b, c}, which value, for p ≤ 1000, has the most solutions? The solution to this problem is using the following formulas for the iterative generation of new Pythagorean triples: where: This can be done easily using recursion:]]></description>
										<content:encoded><![CDATA[<blockquote><p>If p is the perimeter of a right angle triangle, {a, b, c}, which value, for p ≤ 1000, has the most solutions?
</p></blockquote>
<p>The solution to this problem is using the following formulas for the iterative generation of new Pythagorean triples:</p>
<div style="text-align:center;">
<img src="https://s0.wp.com/latex.php?latex=%28a_1%2Cb_1%2Cc_1%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+U&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%28a_1%2Cb_1%2Cc_1%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+U&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%28a_1%2Cb_1%2Cc_1%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+U&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="(a_1,b_1,c_1)=(a_0,b_0,c_0) &#92;cdot U" class="latex" /><br />
<img src="https://s0.wp.com/latex.php?latex=%28a_2%2Cb_2%2Cc_2%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+A&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%28a_2%2Cb_2%2Cc_2%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+A&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%28a_2%2Cb_2%2Cc_2%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+A&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="(a_2,b_2,c_2)=(a_0,b_0,c_0) &#92;cdot A" class="latex" /><br />
<img src="https://s0.wp.com/latex.php?latex=%28a_3%2Cb_3%2Cc_3%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+D&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=%28a_3%2Cb_3%2Cc_3%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+D&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=%28a_3%2Cb_3%2Cc_3%29%3D%28a_0%2Cb_0%2Cc_0%29+%5Ccdot+D&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="(a_3,b_3,c_3)=(a_0,b_0,c_0) &#92;cdot D" class="latex" />
</div>
<p>where:</p>
<div style="text-align:center;">
<img src="https://s0.wp.com/latex.php?latex=U+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++-2+%26+-1+%26+-2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++A+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++D+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++-1+%26+-2+%26+-2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D++&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002" srcset="https://s0.wp.com/latex.php?latex=U+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++-2+%26+-1+%26+-2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++A+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++D+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++-1+%26+-2+%26+-2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D++&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002 1x, https://s0.wp.com/latex.php?latex=U+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++-2+%26+-1+%26+-2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++A+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++1+%26+2+%26+2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D%2C%5C+++D+%5Cequiv+%5Cleft%5B+%5Cbegin%7Barray%7D%7Bccc%7D++-1+%26+-2+%26+-2+%5C%5C++2+%26+1+%26+2+%5C%5C++2+%26+2+%26+3+%5Cend%7Barray%7D+%5Cright%5D++&#038;bg=ffffff&#038;fg=444444&#038;s=0&#038;c=20201002&#038;zoom=4.5 4x" alt="U &#92;equiv &#92;left[ &#92;begin{array}{ccc}  1 &amp; 2 &amp; 2 &#92;&#92;  -2 &amp; -1 &amp; -2 &#92;&#92;  2 &amp; 2 &amp; 3 &#92;end{array} &#92;right],&#92;   A &#92;equiv &#92;left[ &#92;begin{array}{ccc}  1 &amp; 2 &amp; 2 &#92;&#92;  2 &amp; 1 &amp; 2 &#92;&#92;  2 &amp; 2 &amp; 3 &#92;end{array} &#92;right],&#92;   D &#92;equiv &#92;left[ &#92;begin{array}{ccc}  -1 &amp; -2 &amp; -2 &#92;&#92;  2 &amp; 1 &amp; 2 &#92;&#92;  2 &amp; 2 &amp; 3 &#92;end{array} &#92;right]  " class="latex" /></div>
<p>This can be done easily using recursion:</p>
<pre class="brush: cpp; title: ; notranslate">
/* Project Euler - Problems 39 and 75

   39. If p is the perimeter of a right angle triangle, {a, b, c},
       which value, for p ≤ 1000, has the most solutions?

   75. Find the number of different lengths of wire that can form
       a right angle triangle in only one way.

   http://mathworld.wolfram.com/PythagoreanTriple.html */

#include &lt;iostream&gt;
#include &lt;cmath&gt;
#include &lt;vector&gt;

using namespace std;

typedef unsigned long ulong;

#define N 1500000

class Problem39
{
public:
    void solve();
private:
    vector&lt;int&gt; p_;
    void r_(ulong a, ulong b, ulong c);
};

void
Problem39::r_(ulong a, ulong b, ulong c)
{
    ulong p = a + b + c;
    if (p &gt; N) return;
    for (ulong i = p-1; i &lt; N; i += p)
    {
        p_[i] += 1;
    }

    r_( a - 2*b + 2*c, 2*a - b + 2*c, 2*a - 2*b + 3*c );

    r_( a + 2*b + 2*c, 2*a + b + 2*c, 2*a + 2*b + 3*c );

    r_( -a + 2*b + 2*c, -2*a + b + 2*c, -2*a + 2*b + 3*c );
}

void
Problem39::solve()
{
    p_ = vector&lt;int&gt;(N, 0);
    r_ (3,4,5);

    ulong c = 0, max = p_[0], p;
    for (int i = 0; i &lt; N; ++i)
    {
        if (max &lt; p_[i])
        {
            max = p_[i];
            p = i+1;
        }
        if (p_[i] == 1)
            c++;
    }
    cout &lt;&lt; &quot;p = &quot; &lt;&lt; p &lt;&lt; &quot; (&quot; &lt;&lt; max &lt;&lt; &quot; solutions)&quot; &lt;&lt; endl;
    cout &lt;&lt; &quot;c = &quot; &lt;&lt; c &lt;&lt; endl;
}

int main(void)
{
    Problem39 p;
    p.solve();
    return 0;
}
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2011/05/30/project-euler-problems-39-and-75-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">917</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>Noica &#8212; jurnal filozofic (fragmente)</title>
		<link>https://blacketernal.wordpress.com/2011/04/23/noica-jurnal-filozofic-fragmente/</link>
					<comments>https://blacketernal.wordpress.com/2011/04/23/noica-jurnal-filozofic-fragmente/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Sat, 23 Apr 2011 19:10:43 +0000</pubDate>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[jurnal filozofic]]></category>
		<category><![CDATA[noica]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=865</guid>

					<description><![CDATA[Caut să văd ce va trebui încercat la Școală: a gândi &#8212; cum se spune &#8212; viu. Dar ce înseamnă a gândi viu? Cred că două lucruri: 1) A proceda prin întreguri, nu prin părți; întru câtva organic, nu de la simplu la compus; în nici un caz fals cartezian (fiindcă nici Descartes nu gândea [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="text-align:justify;">
Caut să văd ce va trebui încercat la Școală: a gândi &#8212; cum se spune &#8212; viu. Dar ce înseamnă a gândi viu?</p>
<p>Cred că două lucruri: 1) A proceda prin întreguri, nu prin părți; întru câtva organic, nu de la simplu la compus; în nici un caz fals cartezian (fiindcă nici Descartes nu gândea așa), geometric și sistematic. 2) A lăsa întregurile să reiasă din elementul infinitezimal; a gândi deci, până la un punct, intuitiv: văzând &#8212; nu făcând, construind.</p>
<p>Pentru ultimul punct, Aristotel &#8212; singura dată când mă atrage &#8212; are un exemplu sugestiv. Închipuiți-vă o oaste, spune el; o oaste pusă pe fugă în neorânduială. La un moment dat (asta e tot: ”la un moment dat”), un soldat se oprește. În jurul lui se opresc alți patru&#8211;cinci. Apoi, în jurul nucleului format de ei se strând și alții, și iată dintr-o dată oastea întreagă întorcând fața către dușman și gata să primească din nou lupta.</p>
<p>Asta înseamnă ”viu”: unul singur, elementul infinitezimal poate să coaguleze restul. Un singur individ vertebrează totul. Nu urci matematic și gradat, de la simplu la compus, ci urci, fără compoziție, de la simplu la întreg. E paradoxul vieții, dar e paradoxul oricărei vieți. </p>
<p>Și mă gândesc la o concluzie ciudată: un adevărat colectivism e mai individualist decât cel care își zice așa. Sau invers: un adevărat individualism ar trebui să fie colectivist. Căci numai acesta din urmă, cel care deține întregul, știe adevăratul preț al părții. În oastea lui Aristotel, soldatul înseamnă ceva, poate ceva. Ce poate el dincolo?</p>
<p>Încă unul din scandalurile vieții, în istorie și dincolo de istorie.</p>
<p>*</p>
<p>Tulburătoare, vorba aceasta a lui Simmel: ”viața ca totalitate de fiecare clipă”. Așa o văd acum; așa este. În fiecare ceas simți că ești un întreg. Ai goluri, firește, dar le cunoști, deci le-ai umplut într-un oarecare fel. Ești o ființă împlinită.</p>
<p>Dar citești o carte: cum puteai trăi până acum fără gândurile ei? Legi o prietenie nouă: cum te puteai crede întreg fără ea? Abia acum simți golul adevărat, golul pe care ar fi trebuit să-l simți. Dar acum ești ”întreg”. Totalitate de fiecare clipă. Trăim alături unii de alții, totalitate lângă totalitate, într-o lume care nu totalizează, dar care se totalizează, parcă, în noi.</p>
<p>*</p>
<p>Singurătatea absolută? O concep câteodată așa: în tren, pe un culoar ticsit, stând pe geamantan. Ești atunci departe nu numai de orice om, mai ales de cei care te împiedică să te miști; dar ești departe și de orice punct fix în spațiu. Ești undeva, între o stație și alta, rupt de ceva, în drup spre altceva, scos din timp, scos din rost, purtat de tren, purtând după tine un alt tren, cu oameni, situații, mărfuri, idei, una peste alta, în vagoane pe care le lași în stații, le pierzi între stații, le uiți în spații, golind lumea, gonind peste lume, singur, mai singur, nicăieri de singur.</p>
<p>Ești undeva, între o stație și alta,<br />
rupt de ceva,<br />
în drup spre altceva,<br />
scos din timp,<br />
scos din rost,<br />
purtat de tren,<br />
purtând după tine un alt tren,<br />
cu oameni, situații, mărfuri, idei,<br />
una peste alta,<br />
în vagoane pe care le lași în stații,<br />
le pierzi între stații,<br />
le uiți în spații,<br />
golind lumea,<br />
gonind peste lume,<br />
singur,<br />
mai singur,<br />
nicăieri de singur.
</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2011/04/23/noica-jurnal-filozofic-fragmente/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">865</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>Transfigurare</title>
		<link>https://blacketernal.wordpress.com/2011/03/09/transfigurare/</link>
					<comments>https://blacketernal.wordpress.com/2011/03/09/transfigurare/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Wed, 09 Mar 2011 16:27:40 +0000</pubDate>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[arghezi]]></category>
		<category><![CDATA[suflet]]></category>
		<category><![CDATA[transfigurare]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=858</guid>

					<description><![CDATA[Cu toate că i-am spus că nu vreau, Mi-a dat noaptea-n somn să beau Întuneric, și am băut urna întreagă. Ce-o fi să fie, o să se aleagă. Puteam să știu că-n zeama ei suava Albastră-alburie, era otravă ? M-am îmbătat ? Am murit ? Lasați-mă să dorm&#8230; M-am copilărit. Cine mai bate, nu sunt [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Cu toate că i-am spus că nu vreau,<br />
Mi-a dat noaptea-n somn să beau<br />
Întuneric, și am băut urna întreagă.<br />
Ce-o fi să fie, o să se aleagă.</p>
<p>Puteam să știu că-n zeama ei suava<br />
Albastră-alburie, era otravă ?<br />
M-am îmbătat ? Am murit ?<br />
Lasați-mă să dorm&#8230; M-am copilărit.</p>
<p>Cine mai bate, nu sunt acasă,<br />
Cine întreabă, lasă&#8230;<br />
Cui mai pot să-i ies în drum<br />
Cu sufletul meu de acum?&#8230;</p>
<p><strong><em>&#8212; Tudor Arghezi</em></strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2011/03/09/transfigurare/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">858</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>Dragă prietenă</title>
		<link>https://blacketernal.wordpress.com/2010/11/25/draga-prietena/</link>
					<comments>https://blacketernal.wordpress.com/2010/11/25/draga-prietena/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Thu, 25 Nov 2010 17:13:49 +0000</pubDate>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[baudelaire]]></category>
		<category><![CDATA[cer]]></category>
		<category><![CDATA[drog]]></category>
		<category><![CDATA[femeie]]></category>
		<category><![CDATA[paradisuri artificiale]]></category>
		<category><![CDATA[somn]]></category>
		<category><![CDATA[spirit]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=836</guid>

					<description><![CDATA[Dragă prietenă, &#160;&#160;&#160;&#160;Bunul-simț ne spune că lucrurile pământești nu există decât în mică măsură și că adevărata realitate e doar în vis. Pentru a digera bucuria naturală, ca și pe cea artificială, trebuie mai întâi să ai curajul s-o înghiți; și cei care poate merită bucuria sunt tocmai cei pentru care fericirea, așa cum o [&#8230;]]]></description>
										<content:encoded><![CDATA[<div style="text-align:justify;">
Dragă prietenă,</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Bunul-simț ne spune că lucrurile pământești nu există decât în mică măsură și că adevărata realitate e doar în vis. Pentru a digera bucuria naturală, ca și pe cea artificială, trebuie mai întâi să ai curajul s-o înghiți; și cei care poate merită bucuria sunt tocmai cei pentru care fericirea, așa cum o concep muritorii, a avut întotdeauna efectul unui vomitiv.<br />
&nbsp;&nbsp;&nbsp;&nbsp;Spiritelor neghioabe li se va părea neobișnuit, și chiar impertinent, ca o prezentare a voluptăților artificiale să-i fie dedicată unei femei, sursa cea mai obișnuită a voluptăților celor mai naturale. Cu toate acestea este evident că, așa cum lumea naturală pătrunde în cea spirituală, servindu-i drept hrană și concurând astfel la crearea acelui amalgam nedefinit pe care-l numim individualitatea noastră, femeia este ființa care proiectează cea mai mare umbră sau cea mai mare lumină în visele noastre. Femeia este fatalmente sugestivă; ea trăiește o altă viață decât pe a sa proprie; ea trăiește spiritual în nălucirile pe care le bântuie și le fecundează.<br />
&nbsp;&nbsp;&nbsp;&nbsp;De altfel, are prea puțină importanță dacă această dedicație este înțeleasă sau nu. Pentru mulțumirea autorului ar fi absolut necesar ca o carte, oricare ar fi ea, să fie înțeleasă, excepție făcând doar cel sau cea pentru care a fost scrisă? În sfârșit, ca să spunem totul, este indispensabil să fie scrisă pentru cineva? Cât despre mine, am atât de puțin chef pentru lumea cea vie, încât, asemenea acelor femei sensibile și lipsite de ocupație care își trimit, să zicem, prin poștă confidențele unor prieteni imaginari, aș scrie cu plăcere numai pentru morți.<br />
&nbsp;&nbsp;&nbsp;&nbsp;Dar nu unei moarte îi dedic această cărticică; ci cuiva care, deși bolnavă, este încă nespus de activă și de vie în mine și care-și întoarce acum toate privirile către Cer, acel loc al tuturor transfigurărilor. Căci ființa omenească se bucură de privilegiul de a putea extrage noi și subtile bucurii chiar și din durere, catastrofă și fatalitate, tot atât de bine ca dintr-un drog de temut.<br />
&nbsp;&nbsp;&nbsp;&nbsp;Vei vedea în această prezentare un om care se plimbă sumbru și solitar, cufundat în talazul mișcător al mulțimilor, trimițându-și inima și gândul unei Electre îndepărtate care cândva i-a șters fruntea scăldată în sudoare și i-a răcorit buzele arse de febră și vei ghici gratitudinea unui alt Oreste căruia adesea i-ai vegheat coșmarurile și i-ai risipit, cu o mână blândă, ca de mamă, somnul plin de spaime.</p>
<p><strong><em>&#8212; Charles Baudelaire, &#8220;Paradisurile Artificiale&#8221;</em></strong>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2010/11/25/draga-prietena/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">836</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>One For the Shoeshine Man</title>
		<link>https://blacketernal.wordpress.com/2010/11/21/one-for-the-shoeshine-man/</link>
					<comments>https://blacketernal.wordpress.com/2010/11/21/one-for-the-shoeshine-man/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Sun, 21 Nov 2010 09:09:18 +0000</pubDate>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[bukowski]]></category>
		<category><![CDATA[death]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[love]]></category>
		<category><![CDATA[one for the shoeshine man]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=817</guid>

					<description><![CDATA[by Charles Bukowski the balance is preserved by the snails climbing the Santa Monica cliffs; the luck is in walking down Western Avenue and having the girls in a massage parlor holler at you, &#8220;Hello Sweetie!&#8221; the miracle is having 5 women in love with you at the age of 55, and the goodness is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>by Charles Bukowski</p>
<div style="text-align:left;line-height:200%;">the balance is preserved by the snails climbing the<br />
Santa Monica cliffs;<br />
the luck is in walking down Western Avenue<br />
and having the girls in a massage<br />
parlor holler at you, &#8220;Hello Sweetie!&#8221;<br />
the miracle is having 5 women in love<br />
with you at the age of 55,<br />
and the goodness is that you are only able<br />
to love one of them.<br />
the gift is having a daughter more gentle<br />
than you are, whose laughter is finer<br />
than yours.<br />
the peace comes from driving a<br />
blue 1967 Volks through the streets like a<br />
teenager, radio tuned to The Host Who Loves You<br />
Most, feeling the sun, feeling the solid hum<br />
of the rebuilt motor<br />
as you needle through traffic.<br />
the grace is being able to like rock music,<br />
symphony music, jazz . . .<br />
anything that contains the original energy of<br />
joy.and the probability that returns<br />
is the deep blue low<br />
yourself flat upon yourself<br />
within the guillotine walls<br />
angry at the sound of the phone<br />
or anybody’s footsteps passing;<br />
but the other probability&#8212;<br />
the lilting high that always follows&#8212;<br />
makes the girl at the checkstand in the<br />
supermarket look like<br />
Marilyn<br />
like Jackie before they got her Harvard lover<br />
like the girl in high school that we<br />
all followed home.</p>
<p>there is that which helps you believe<br />
in something else besides death:<br />
somebody in a car approaching<br />
on a street too narrow,<br />
and he or she pulls aside to let you<br />
by, or the old fighter Beau Jack<br />
shining shoes<br />
after blowing the entire bankroll<br />
on parties<br />
on women<br />
on parasites,<br />
humming, breathing on the leather,<br />
working the rag<br />
looking up and saying:<br />
&#8220;what the hell, I had it for a<br />
while. that beats the<br />
other.&#8221;</p>
<p>I am bitter sometimes<br />
but the taste has often been<br />
sweet. it’s only that I’ve<br />
feared to say it. it’s like<br />
when your woman says,<br />
&#8220;tell me you love me,&#8221; and<br />
you can&#8217;t.</p>
<p>if you see me grinning from<br />
my blue Volks<br />
running a yellow light<br />
driving straight into the sun<br />
I will be locked in the<br />
arms of a<br />
crazy life<br />
thinking of trapeze artists<br />
of midgets with big cigars<br />
of a Russian winter in the early 40&#8217;s<br />
of Chopin with his bag of Polish soil<br />
of an old waitress bringing me an extra<br />
cup of coffee and laughing<br />
as she does so.</p>
<p>the best of you<br />
I like more than you think.<br />
the others don&#8217;t count<br />
except that they have fingers and heads<br />
and some of them eyes<br />
and most of them legs<br />
and all of them<br />
good and bad dreams<br />
and a way to go.</p>
<p>justice is everywhere and it&#8217;s working<br />
and the machine guns and frogs<br />
and the hedges will tell you<br />
so.</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2010/11/21/one-for-the-shoeshine-man/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">817</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
		<item>
		<title>Aceeași nostalgie</title>
		<link>https://blacketernal.wordpress.com/2010/11/06/aceeasi-nostalgie/</link>
					<comments>https://blacketernal.wordpress.com/2010/11/06/aceeasi-nostalgie/#respond</comments>
		
		<dc:creator><![CDATA[blacketernal]]></dc:creator>
		<pubDate>Sat, 06 Nov 2010 10:40:45 +0000</pubDate>
				<category><![CDATA[Poetry]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[nostalgie]]></category>
		<category><![CDATA[poezie]]></category>
		<category><![CDATA[sorescu]]></category>
		<guid isPermaLink="false">http://blacketernal.wordpress.com/?p=810</guid>

					<description><![CDATA[Pachetul de țigări gol are o nostalgie pe care numai vidul cosmic o-nțelege se simte absolut părăsit ca o rampă de lansare după ce toate rachetele trimise în stele n-au făcut decât fum flori frumoase nu întâlnești decât toamna foarte târziu după ce vânturile răsucite ca otgonul și-au făcut toate mendrele, au bătut furnicile și [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Pachetul de țigări gol<br />
are o nostalgie<br />
pe care numai vidul cosmic o-nțelege<br />
se simte absolut părăsit<br />
ca o rampă de lansare<br />
după ce toate rachetele trimise în stele<br />
n-au făcut decât fum</p>
<p>flori frumoase<br />
nu întâlnești decât toamna foarte târziu<br />
după ce vânturile răsucite ca otgonul<br />
și-au făcut toate mendrele, au bătut furnicile<br />
și doar albăstrelele de câmp<br />
au rezistat în vaza lor de loess<br />
deschizându-și multiplele lor pleoape<br />
cască niște priviri<br />
pline de uimire<br />
și aceeași nostalgie le unește<br />
pe masa mea<br />
cu pachetul de țigări gol<br />
și cu mine care nu știu de ce<br />
mă tot uit pe fereastră.</p>
<p>&#8212; <em>Marin Sorescu</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blacketernal.wordpress.com/2010/11/06/aceeasi-nostalgie/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">810</post-id>
		<media:content url="https://1.gravatar.com/avatar/4fbf1d67df9376ab3c98f43e1dc3808f5cd5779a729566000b4697027ad871fb?s=96&#38;d=monsterid&#38;r=X" medium="image">
			<media:title type="html">blacketernal</media:title>
		</media:content>
	</item>
	</channel>
</rss>
