<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://wiki.carl.fun/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://wiki.carl.fun/feed.php">
        <title>Carl&#039;s Hacking Notes</title>
        <description></description>
        <link>http://wiki.carl.fun/</link>
        <image rdf:resource="http://wiki.carl.fun/_media/wiki:dokuwiki.svg" />
       <dc:date>2026-04-19T10:01:17+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://wiki.carl.fun/python?rev=1775075470&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/numeric?rev=1773522118&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/java:futuretask?rev=1763737262&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/programming?rev=1759517650&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/random?rev=1759340863&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/python:isnt_java?rev=1755034492&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/python:mocks?rev=1747098220&amp;do=diff"/>
                <rdf:li rdf:resource="http://wiki.carl.fun/start?rev=1746726749&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://wiki.carl.fun/_media/wiki:dokuwiki.svg">
        <title>Carl's Hacking Notes</title>
        <link>http://wiki.carl.fun/</link>
        <url>http://wiki.carl.fun/_media/wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://wiki.carl.fun/python?rev=1775075470&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-04-01T20:31:10+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>python</title>
        <link>http://wiki.carl.fun/python?rev=1775075470&amp;do=diff</link>
        <description>Python

Python is a programming language common in the data science space.  Here is a list of gotchas that I have encountered while using it, coming from a Java world.

Wishlist

Typesafety is complex.

Static checkers are okay, but the runtime type system is pretty weak.  There is no equivalent of type capture in Java (e.g.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/numeric?rev=1773522118&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2026-03-14T21:01:58+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>numeric</title>
        <link>http://wiki.carl.fun/numeric?rev=1773522118&amp;do=diff</link>
        <description>Numeric Types

Numeric types represent Real numbers in a computer.  Because computers have limited space, most numeric values are approximations of a real value.  

Math in a computer is a combination of a storage of data, and a collection of operators.   Interpretation of the bits is up to the operators.  When we talk about a type of a number, we are usually referring to the operations we can do on them, rather than the storage.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/java:futuretask?rev=1763737262&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-21T15:01:02+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>futuretask - created</title>
        <link>http://wiki.carl.fun/java:futuretask?rev=1763737262&amp;do=diff</link>
        <description>FutureTask

This class is both a Runnable and a Future.   It correctly propagates thread interruption, unlike CompletableFuture.

However, the run() method does not throw.  If two FutureTasks are chained together the inner will not ever throw an exception.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/programming?rev=1759517650&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-03T18:54:10+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>programming</title>
        <link>http://wiki.carl.fun/programming?rev=1759517650&amp;do=diff</link>
        <description>General Programming

Ternary Operators

Are there any non-conditional ternary operators?  As asked here, The answer there suggests that no, there are no ternary operators, and you might as well call a function. 

However, upon thinking more, unary and binary operators make sense because they naturally split a linear progression of text.  A binary operator conjoins the</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/random?rev=1759340863&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-10-01T17:47:43+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>random - created</title>
        <link>http://wiki.carl.fun/random?rev=1759340863&amp;do=diff</link>
        <description>These are some random notes I have thought of.

When buying luggage, some bags come with two wheels on each corner, and some come with one big wheel.  What&#039;s the difference?   The main difference is spreading the load over more surface area.  When bags roll over carpet, the lesser surface area causes it to sink lower in, making it harder to pull.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/python:isnt_java?rev=1755034492&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-08-12T21:34:52+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>isnt_java - created</title>
        <link>http://wiki.carl.fun/python:isnt_java?rev=1755034492&amp;do=diff</link>
        <description>Python Isn&#039;t Java

Some things in Python are infeasible to implement as they existed in Java.  This page lists some things.

Threading

Python has threads, but there are several limitations.

	*  When a Future is cancelled, the task is not aware of the cancellation.  This is because there is no `mayInterruptIfRunning`.  This means cancelling a future just marks the future as cancelled, but doesn&#039;t actually notify they threads they should stop.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/python:mocks?rev=1747098220&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-13T01:03:40+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>mocks</title>
        <link>http://wiki.carl.fun/python:mocks?rev=1747098220&amp;do=diff</link>
        <description>Python Testing

Mocks

Don&#039;t use Python mocks.   They don&#039;t work how you want. 

	*  Mocks only kind of work.   Code like `mock.patch()` Do not work at the module layer.  If your code imports the patched symbol before the patch comes in, any code that already references gets the unpatched version.  This means you have to chase down any existing references for it to work.  That in turn means Tests will work in isolation but not when part of a suite.</description>
    </item>
    <item rdf:about="http://wiki.carl.fun/start?rev=1746726749&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-05-08T17:52:29+00:00</dc:date>
        <dc:creator>carl (carl@undisclosed.example.com)</dc:creator>
        <title>start</title>
        <link>http://wiki.carl.fun/start?rev=1746726749&amp;do=diff</link>
        <description>Hi, I&#039;m Carl.  This site is a list of my notes.

	*  Java Notes, particularly around concurrency.
	*  Python Notes, particularly around type-safety and runtime stuff
	*  Numeric Numerical properties in computers.</description>
    </item>
</rdf:RDF>
