<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Judebert.com (Entries tagged as java)</title>
    <link>http://judebert.com/progress/</link>
    <description>Progress Report</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:judebert@judebert.com" />
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    <managingEditor>judebert@judebert.com</managingEditor>

    <image>
        <url>http://www.judebert.com/progress/judebert.gif</url>
        <title>RSS: Judebert.com - Progress Report</title>
        <link>http://judebert.com/progress/</link>
        <width>100</width>
        <height>100</height>
    </image>

<item>
    <title>Interview Day 6: Unflattening a Bush</title>
    <link>http://judebert.com/progress/archives/448-Interview-Day-6-Unflattening-a-Bush.html</link>
            <category>Activities</category>
            <category>Programming</category>
            <category>The Attic</category>
            <category>Web Activities</category>
    
    <comments>http://judebert.com/progress/archives/448-Interview-Day-6-Unflattening-a-Bush.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=448</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=448</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;
Oh, great.  Yesterday I flattened a bush; today you want me to &lt;b&gt;un-&lt;/b&gt;flatten it?
&lt;/p&gt;&lt;p&gt;
This is going to require a bit of recursion, I can just tell.  That&#039;s fine, I love recursion.
&lt;/p&gt;&lt;p&gt;
I kept all the child pointers when I flattened the bush, so that will tell me where the children start.  I&#039;ll just traverse the list, and anytime I find a child pointer, I&#039;ll disconnect the child and all its siblings, reconnecting them as the child of the parent.
&lt;/p&gt;&lt;p&gt;
Hmmm.  Only one small problem: how will I know when to stop disconnecting the child?  The first parent that I encounter will get the child, and the remainder of the list afterwards, as its children.  
&lt;/p&gt;&lt;p&gt;
Maybe I&#039;d better rewrite Flatten to use a different algorithm.  Certainly the interviewer would have steered me toward a solution with recognizable ends.  Wouldn&#039;t he?
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/448-Interview-Day-6-Unflattening-a-Bush.html#extended&quot;&gt;Continue reading &quot;Interview Day 6: Unflattening a Bush&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Sun, 20 Jan 2013 16:41:00 -0500</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/448-guid.html</guid>
    <category>alpha geek</category>
<category>interview</category>
<category>java</category>
<category>programming</category>

</item>
<item>
    <title>Interview Day 5: Flattening a Bush</title>
    <link>http://judebert.com/progress/archives/447-Interview-Day-5-Flattening-a-Bush.html</link>
            <category>Programming</category>
            <category>The Attic</category>
            <category>Web Activities</category>
    
    <comments>http://judebert.com/progress/archives/447-Interview-Day-5-Flattening-a-Bush.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=447</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=447</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;
Yesterday I made a linked list, in Java.  Yeah, that&#039;s right.  
&lt;/p&gt;&lt;p&gt;
Today I&#039;m taking on a programming problem: given a doubly-linked list (with head and tail), where any element may have a child doubly-linked list (without head and tail), flatten the structure into a doubly-linked list.
&lt;/p&gt;&lt;p&gt;
That sounds vaguely tree-like, but trees don&#039;t usually have linked siblings.  It&#039;s all just parents and children. I&#039;m calling this a bush.
&lt;/p&gt;&lt;p&gt;
Let&#039;s look at the structure.
&lt;/p&gt;&lt;pre&gt;
head-&gt;A&lt;=&gt;D&lt;=&gt;E&lt;=&gt;F&lt;-tail
      |           |
      B&lt;=&gt;C       G
                  |
                  H

&lt;/pre&gt;&lt;p&gt;
Without being told where to put stuff, I could just tack it all on the tail.  But I think tacking it on after its parent is more elegant, if it can be implemented in similar complexity and space.  In the bush I drew, I&#039;d like the nodes to end up in alphabetical order.
&lt;/p&gt;&lt;p&gt;
I might even be able to do this without recursion.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/447-Interview-Day-5-Flattening-a-Bush.html#extended&quot;&gt;Continue reading &quot;Interview Day 5: Flattening a Bush&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 18 Jan 2013 21:42:26 -0500</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/447-guid.html</guid>
    <category>alpha geek</category>
<category>interview</category>
<category>java</category>
<category>programming</category>

</item>
<item>
    <title>Interview Prep Day 2: Studying and Champagne </title>
    <link>http://judebert.com/progress/archives/444-Interview-Prep-Day-2-Studying-and-Champagne.html</link>
            <category>Activities</category>
            <category>Java</category>
            <category>Programming</category>
            <category>Programs</category>
            <category>The Attic</category>
            <category>Web Activities</category>
    
    <comments>http://judebert.com/progress/archives/444-Interview-Prep-Day-2-Studying-and-Champagne.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=444</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=444</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;
Today I only studied a little bit.  I had too much other stuff to do.  But I did manage to find a &lt;a href=&quot;http://www.geeksforgeeks.org/find-water-in-a-glass/&quot;&gt;nice brain teaser from GeeksForGeeks.org&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
Imagine a champagne pyramid, but in only two dimensions.  Like this:
&lt;/p&gt;&lt;pre&gt;
Level 1:    1
Level 2:   1 2
Level 3:  1 2 3
&lt;/pre&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;
Of course, we could have as many levels of this &quot;pyramid&quot; as we liked.
&lt;/p&gt;&lt;p&gt;
All the glasses are the same.  When you overfill Level 1 glass 1, the overflow goes half to the left (Level 2 glass 1) and half to the right (Level 2 glass 2).  Every time a glass is overfilled, half the overflow goes to the left and half to the right.
&lt;/p&gt;&lt;p&gt;
Find a method to tell me how much champagne is in any glass, when I tell you how much I poured into the top glass.
&lt;/p&gt;&lt;p&gt;
For instance, if I say I poured 4 glassfuls, and I want to know about  Level 3 glass 3, you&#039;d tell me it had 0.25 glassfuls.
&lt;/p&gt;
 &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/444-Interview-Prep-Day-2-Studying-and-Champagne.html#extended&quot;&gt;Continue reading &quot;Interview Prep Day 2: Studying and Champagne &quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 16 Jan 2013 06:50:00 -0500</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/444-guid.html</guid>
    <category>alpha geek</category>
<category>interview</category>
<category>java</category>
<category>programming</category>

</item>
<item>
    <title>Unsigned Subtraction in Old C++ Code</title>
    <link>http://judebert.com/progress/archives/426-Unsigned-Subtraction-in-Old-C++-Code.html</link>
            <category>Programming</category>
    
    <comments>http://judebert.com/progress/archives/426-Unsigned-Subtraction-in-Old-C++-Code.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=426</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=426</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;
I&#039;m porting some old C++ code to Java.  How old?  So old that it doesn&#039;t just assume a &lt;code&gt;long&lt;/code&gt; is 32 bits, it actually &lt;i&gt;checks to make sure&lt;/i&gt; and bails if not.  That&#039;s 1997 or so, by my guess.
&lt;/p&gt;&lt;p&gt;
I can already hear the programmers in the audience asking, &quot;Why not just interface with the library using JNI?&quot;  We decided to port the code because we must support Unix and 64-bit environments, and the library specifically fails on all our Unix machines.  We do have the source, so we could modify it... but then we&#039;d be forced to deliver and maintain it, which carries its own set of headaches.  So I&#039;m working on 20,000 &lt;acronym title=&quot;Source Lines Of Code&quot;&gt;SLOC&lt;/acronym&gt;.
&lt;/p&gt;&lt;p&gt;
(Anybody wondered why the site has been so quiet for so long?  It&#039;s because &lt;i&gt;I&#039;m porting 20,000 SLOC of &lt;b&gt;OLD&lt;/b&gt; C++ to Java&lt;/i&gt;.)
&lt;/p&gt;&lt;p&gt;
Most of the code has been pretty straightforward.  There have been the usual problems with C++ unsigned types, which don&#039;t have any corresponding Java type, as well as a bit of pointer arithmetic confusion.  When I get confused, I just write a quick test program and make sure the C++ does what I expect.
&lt;/p&gt;&lt;p&gt;
The thing that blew my mind today was the weird use of the &lt;a href=&quot;http://www.codeproject.com/Articles/18855/20-issues-of-porting-C-code-on-the-64-bit-platform#IDA1YK0D&quot;&gt;&quot;magic number&quot;&lt;/a&gt; 0x80000000.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/426-Unsigned-Subtraction-in-Old-C++-Code.html#extended&quot;&gt;Continue reading &quot;Unsigned Subtraction in Old C++ Code&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 18 Apr 2012 11:05:42 -0400</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/426-guid.html</guid>
    <category>java</category>
<category>programming</category>

</item>
<item>
    <title>Using SSL in Java, Part 2</title>
    <link>http://judebert.com/progress/archives/425-Using-SSL-in-Java,-Part-2.html</link>
            <category>Tutorials</category>
    
    <comments>http://judebert.com/progress/archives/425-Using-SSL-in-Java,-Part-2.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=425</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=425</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;&lt;a href=&quot;http://judebert.com/progress/permalink/SSL1.html&quot;&gt;In part 1, I explained how key-based SSL authentication works.&lt;/a&gt;  In part 2, I intend to explain how to implement a certificate authorized SSL connection in Java.
&lt;/p&gt;&lt;p&gt;
If you haven&#039;t read part 1 yet, you might want to check it out.  I&#039;ll still be here when you get back.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/425-Using-SSL-in-Java,-Part-2.html#extended&quot;&gt;Continue reading &quot;Using SSL in Java, Part 2&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 09 Mar 2012 09:15:39 -0500</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/425-guid.html</guid>
    <category>java</category>
<category>programming</category>
<category>ssl</category>

</item>
<item>
    <title>Using SSL in Java, Part 1</title>
    <link>http://judebert.com/progress/archives/424-Using-SSL-in-Java,-Part-1.html</link>
            <category>Tutorials</category>
    
    <comments>http://judebert.com/progress/archives/424-Using-SSL-in-Java,-Part-1.html#comments</comments>
    <wfw:comment>http://judebert.com/progress/wfwcomment.php?cid=424</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://judebert.com/progress/rss.php?version=2.0&amp;type=comments&amp;cid=424</wfw:commentRss>
    

    <author>judebert@judebert.com (Judebert)</author>
    <content:encoded>
    &lt;p&gt;
Working (as I do) with secure equipment, it was inevitable that I&#039;d eventually have to connect to a server using SSL.  I didn&#039;t even get to write my own code; I had to use a Java client library that was provided to me.
&lt;/p&gt;&lt;p&gt;
The programmers of my client library weren&#039;t exactly forthcoming on where I could change its configuration, but at least they had provided me with the certificates I needed.  I had to do a lot of research to find out how to use them, and I&#039;m recording that information here.
&lt;/p&gt;&lt;p&gt;
After all, isn&#039;t learning supposed to be cooperative?  Read on, and I&#039;ll show you how to work with SSL sockets in Java.
&lt;/p&gt; &lt;br /&gt;&lt;a href=&quot;http://judebert.com/progress/archives/424-Using-SSL-in-Java,-Part-1.html#extended&quot;&gt;Continue reading &quot;Using SSL in Java, Part 1&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 10 Feb 2012 13:40:43 -0500</pubDate>
    <guid isPermaLink="false">http://judebert.com/progress/archives/424-guid.html</guid>
    <category>java</category>
<category>programming</category>
<category>ssl</category>

</item>

</channel>
</rss>