<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Will Jones on Medium]]></title>
        <description><![CDATA[Stories by Will Jones on Medium]]></description>
        <link>https://medium.com/@willgdjones?source=rss-76a7c2c51c91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-n36ekdjb93BEkOC.jpg</url>
            <title>Stories by Will Jones on Medium</title>
            <link>https://medium.com/@willgdjones?source=rss-76a7c2c51c91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 05:15:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@willgdjones/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Installing JupyterLab]]></title>
            <link>https://medium.com/@willgdjones/installing-jupyterlab-1017fa6c1615?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/1017fa6c1615</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 27 Feb 2018 21:05:24 GMT</pubDate>
            <atom:updated>2018-02-27T21:05:24.546Z</atom:updated>
            <content:encoded><![CDATA[<p>I encountered JupyterLab recently on one of my Twitter journeys by seeing this tweet:</p><h3>Jake VanderPlas on Twitter</h3><p>I&#39;m really liking the attention to detail in JupyterLab. One small thing that&#39;s huge for usability: tab completion is color-coded by whether the completion is a function, a class, an attribute, etc.</p><p>Why is this such an interesting feature? Well, typing . followed by TAB completion normally lists all methods and attributes that are associated with that object. If we were to perform a . followed by TAB on a common object like an integer, we would see a number of methods that can be called on that integer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*QYF8sfeehkZuuFhHGObSNQ.png" /></figure><p>This is an extremely useful feature that is part of most IDEs (Interactive Development Environments).</p><p>This becomes more difficult when you have a situation where the object you are interested in is enclosed inside a set of brackets, for example: (3+1). What would happen if we attempt to perform the . TAB completion on this object?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*wEdehbcIf85VYok3KlwPsA.png" /></figure><p>Oops. This has now been autocompleted with .ipynb_checkpoints/, which is not a useful outcome at all. The reason why this occurs is that the . TAB completely ignores the object in brackets, and autocompletes as if it wasn’t there. (To be convinced of this, notice that this is exactly what happens if we . TAB in an empty cell)</p><p>If this feature were to work, then <em>somehow </em>the application would have to <em>know</em> that the result of (3+1) is an integer, and that it should treat the brackets in exactly the same way that it treats the integer. This has really bugged me in the past, but I could not think of a clear and robust way to frame the problem in order to contribute a solution.</p><p>I have been a long time user of Jupyter Notebooks for my work, and I regularly encourage others to use it who would like to work on Data Science projects. These recent updates to JupyterLab looked <em>really</em> cool.</p><p>Having already installed Jupyter Notebook within my Anaconda environment, I proceeded to install JupyterLab.</p><p>conda install -c conda-forge jupyterlab</p><p>This results in a successful installation without any pain at all. I launch the notebook with:</p><p>jupyter lab, and navigate tohttp://localhost/8888 in my browser.</p><p>So far, so good. Now to replicate this great Tab completion feature that attracted me to download this project in the first place:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*26RYFtyEK-1jgsInqU0neQ.png" /><figcaption>Experimenting with TAB completion.</figcaption></figure><p>Huh? This is not the moment of satisfaction that I was expecting <strong>at all</strong>. Now, I have been working with data science software for two years now, I am sure that new users of Jupyter and JupyterLab would probably just give up when something like this happens. This is why I want to document my entire thought process in how I debugged this issue.</p><h4>What software versions am I using?</h4><p>This is a very common way to identify the source of a problem. After navigating to the JupyterLab website, I opened up the <em>Binder </em>link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*EwW5XT5MMwt3mNpiO0pe_A.png" /></figure><p>This opens up a version of JupyterLab on a webserver in the cloud, where you can immediately start hacking. (In another post, I would like to explain why I think Binder is such an awesome service to people working in data science.)</p><p>After opening up a new notebook, and investigate the . TAB completion as before, we can see that it works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*i_zArUAeBwm0IevLVMQGmA.png" /></figure><p>So what is going on here?</p><p>Well, clearly there is something different between my installation of JupyterLab and the version on JupyterLab that is launched through Binder.</p><p>Another benefit of JupyterLab is that it has a terminal console that is available within the environment. Using this, I can find out that the version of JupyterLab on the Binder instance is 0.31.8 — the same as I have on my machine!</p><p>Hmm — so if it is not a problem with the version of JupyterLab, what could it be a problem with? Within the JupyterLab documentation, I start to the get the impression that JupyterLab and Jupyter Notebook are actually two seperate projects. Therefore even if I have the state of the art version of JupyterLab on my system, the notebook need not be.</p><p>This turned out to be the cause of the issue. On the Binder version, jupyter notebook was version 5.4.0, and on my own computer the version was 5.0.0.</p><p>Sometimes, you just need to check your versions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1017fa6c1615" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Things Just Don’t Change]]></title>
            <link>https://medium.com/critical-masses/some-things-just-dont-change-ba5a8c01e1fa?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba5a8c01e1fa</guid>
            <category><![CDATA[issue-2]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[theory]]></category>
            <category><![CDATA[information]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Thu, 26 Oct 2017 04:41:12 GMT</pubDate>
            <atom:updated>2017-10-26T04:41:12.002Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bc-48S2jiBwrVh-lJ_z57Q.jpeg" /><figcaption>taken from “Voyage Dans La Lune” (1902)</figcaption></figure><h4>Conflicts of Ideologies in the Connected World</h4><p>The prompt for this issue of Critical Masses, I believe, touches upon some of the most important societal questions we face today. Ideals we inherited from pivotal historical movements — such as the freedom to express one’s mind while being free from persecution, and equal rights for both historically and currently oppressed minorities — seem to be at odds with one another. Movements advocating progressive and liberal ideals are facing a staggering backlash from counter-revolutions. “Black Lives Matter” rallies campaigning for the basic rights of black Americans in cities across the United States are met with seeming equal force by white supremacists bearing the confederate flag or Nazi symbols shouting “All Lives Matter”.</p><p>In June 2016, Economists and politicians in Britain sat horrified as the public distrust of “experts” fuelled the Leave campaign during Brexit. In Syria, civil war has resulted in a humanitarian crisis with 4 million people emigrating the country towards Europe. Many of these refugees had their hopes dashed of finding a safe home with last minute border closures and, in the case of the Hungarian border, were even attacked with tear gas by the national army. Almost all of the very few who were able to obtain forged documents to fly into German airports were caught on arrival and immediately sent home. Even those evading all of these obstacles were met with xenophobia from local inhabitants. I will respond to this prompt by arguing that these events are symptoms of the core nature of humanity which have existed for centuries and show no signs of changing, and are just amplified with platforms and tools given to us by technological advances.</p><p>As a technologist, mathematician and computer scientist, I have pondered questions like this in my time away from my core area of study. It is neither my job nor expertise to be responsible to understand the causes and motivations that give rise to such events in history. To many in the scientific community, these questions are within the remit of philosophy or social science. Nonetheless, in recent times, the use of technology has brought into existence platforms that amplify people’s voices. It is now not uncommon to see people with opinions that originate from completely different backgrounds argue violently on internet threads attempting to rally the undecided to their cause. Idealistic technologists thought they were creating a perfect democracy with the development of social media. Twitter is strongly based on the core ideals of the First Amendment in the US constitution: everybody is freely able to express their opinions, denounce the opinions of others, and have a megaphone by which to do it. Little did these early technologists know that their utopian dream would be used as the ideological battleground that we see today.</p><h4>At the Heart of Conflict: The Fight for Scarce Resources</h4><p>History has proved again and again that technologies are powerful tools that are exploited to serve the interests of a few, at the expense of the many. Advances in military technology have fuelled expansionist empires that, at their peak, spanned entire continents in Europe and Asia, rising and falling within time-spans of just a few hundred years. In early antiquity circa 600 AD, <a href="https://en.wikipedia.org/wiki/Greek_fire">Greek Fire</a> was used by the Byzantines to defend Constantinople from Arab invasions. Later, the Ottomans, Safavid shahs and Mughals (known collectively as the <a href="https://en.wikipedia.org/wiki/Gunpowder_Empires">Gunpowder Empires</a>) enjoyed considerable success in warfare using newly developed cannons and small arms. <a href="https://en.wikipedia.org/wiki/Age_of_Discovery">The Age of Discovery</a> (circa 1500–1700 AD) saw the development of long voyage marine navigation leading to European superpowers competing to exploit natural resources of newfoundlands all over the world, very often enslaving their inhabitants to the profit of the incumbents. In the last century, the world experienced the bloodiest war ever recorded with 40–85 million people killed in World War II. The Allies forced Japan to surrender in a deadly show of might with the nuclear bombing of Hiroshima and three days later Nagasaki. These are, as of yet, the only two uses of such warheads that respectively killed between 90,000–146,000 and 39,000–80,000 people. Roughly half of the deaths in each city occurred on the first day (Rhodes, 1986).</p><p>It would be naive to think that the core nature of humanity has changed much in the last 2000 years. Easy access to recent knowledge and information on global levels of poverty and inequality can give us the illusion that our generation is more educated than previous generations were. The reality of global events, however, reminds us that violence and oppression can take many forms, including within democracies and in line with ideals of individual freedoms. In his time, Socrates warned about the dangers of democracy by birthright, and its path to what he feared the most — demagoguery. He himself was dealt the harshest of penalties because of these flaws — executed by the decision of a narrow majority of 500 Athenians voting to charge him of corrupting the youth of the nation. Plato wrote that if 30 people had voted the opposite, then he would have been acquitted (Plato, 2015). We might think we are the first generation to experience political problems that exploit the flaws of democracy, but we are wrong to do so. Our human nature has not changed.</p><p>Looking at historical events and putting current conflicts into perspective, there are strong parallels between the underlying fears that motivate them. The fight for survival and the strong human need for social belonging lead people to privilege themselves and their own group at the expense of the “out group”. Movements fail because those within these movements, rightly or wrongly, put themselves first. They are opposed by other groups who, out of feeling threatened, put <em>them</em>selves first.</p><p>Neo-Nazis march against Black Lives Matter demonstrations because, regardless of any measurable evidence of support, they feel like their security and resources are threatened by the success of others. They too feel neglected, persecuted and marginalised and do not take kindly to different minorities claiming the moral high-ground and, in their view, passing them in the hierarchy of society. They give their opposition even if this different group has indeed, by the best objective measure, suffered more in the past. Southern European countries reject giving aid to Syrian refugees because they themselves can barely provide for their own families, whom they would put above any suffering refugee, no matter how far they have travelled and how dire their situation is.</p><h4>The Cycle of Neglect</h4><p>Why is it that there is such a distinct lack of empathy amongst swathes of people within distinct societal groups towards others? Why is nationalism on the rise all across Europe at the time of the largest refugee crisis in at least the last two decades? Extending Maslow’s ideas on the hierarchy of needs (Maslow, 1943), we can understand that people are only concerned about the needs of others when they themselves are looked after — or if they are empowered to look after themselves. Being concerned with the needs of others requires your own basic needs for food, shelter and safety to be fulfilled. It is a luxury to not have to wonder where to find one’s next meal, whether one will have a home next month, or whether one’s children are safe. Given that it is easier for those at the top of the ladder of privilege, who possess both the education and the peace of mind, to care about others — it is their moral imperative to.</p><p>Unfortunately, it is also easier for those in these privileged positions to judge and scorn at groups that are acting against progressive paradigms. It is easy to discount their opinions and to neglect the real reasons as to why these groups act the way they do. For example, it is too easy to discount those who outright reject expert opinion, or those who believe in conspiracy theories, as nonsensical and irrational. But, in doing so we completely neglect how it is that they have arrived to their opinion. Those who reject expert opinion do so because they do not understand the explanations given by experts, and do not trust the integrity of the advice they receive. Can we blame this mentality when across standard metrics the readability of scientific journals (in 700,000 abstracts from 123 journals) <a href="https://elifesciences.org/articles/27725">is decreasing over time</a>? People believe in conspiracy theories because they do not trust the system, and do not feel represented by it. Can we blame them when <a href="https://www.theguardian.com/tv-and-radio/2017/mar/01/kalief-browder-spike-tv-series-criminal-justice-bronx">Kalief Browder spent three years in Riker’s prison</a> without trial, most of which in solitary confinement, for allegedly stealing a backpack? These groups are the symptoms of larger problems in society, and are not the problems themselves. As a species, we keep making the mistake of neglecting the less privileged in society — the cycle of neglect.</p><p>Those people lucky enough to be born into privileged positions, and finding themselves making decisions on the welfare for others, cannot afford to neglect the opinion of those born with less — even if they do more often make the more informed decisions. It is the job of these leaders to win the trust of the people that those decisions were the correct ones. If decision makers do not do this, voters will feel that their priorities are not being represented. Steadily, entire generations become disenfranchised with the political system, causing widespread distrust for those who actually are best placed to make the best decisions.</p><p>Brexit was <a href="http://www.telegraph.co.uk/news/2016/12/07/brexit-middle-class-liberals-social-group-emphatically-back/">born out of the political disenfranchisement</a> after years of Conservative government neglecting the underprivileged. In doing so, the government has left more and more people vulnerable to demagogues who, seeking to obtain power for themselves, prey on fear and dissatisfaction. They give easy answers to systemic problems, just as Socrates predicted. <a href="https://www.theguardian.com/politics/2016/jun/16/nigel-farage-defends-ukip-breaking-point-poster-queue-of-migrants">They blame migrants and refugees</a>, <a href="https://www.theguardian.com/us-news/2017/jan/27/donald-trump-executive-order-immigration-full-text">they blame religion</a>, and in the resulting chaos they rise to power. These attacks on democracy have existed since the inception of democracy itself. In Churchill’s words, <em>“Democracy is the worst form of government — except from all the others”</em>. So long as we maintain the freedom to express and voice one’s opinion, we will have to live with its flaws. The only defence is an educated, satisfied, and happy society, that — in addition to thinking about the welfare of their own families — has the headspace to think about the welfare of others. Ironically, in this act of neglect, the UK government has acted against its self interest, and, will now suffer years of bureaucracy and negotiations in dealing with the transition, only to arrive at likely a very similar situation to what they had to start with. Meanwhile, economic and global competition from developing countries such as China and India threatens to weaken the position of the UK as a world power, a mere century after the peak of the British Empire. With the rise and fall of yet another superpower, the cycle of history continues.</p><p>The revolutions that rise and fall are symptoms of the human condition. The progressive times give us this tantalising illusion of advancement, only to be sabotaged by other groups out of neglect. We tip-toe steadily towards what we think is a fairer, better, more “just” world, only to topple over and be pushed right back to the dark ages by our own kind. In these moments we just need to get up and keep tip-toeing forward, trying to get just a bit further than last time.</p><h4>Are We Making Any Progress at All?</h4><p>Despite the constant media coverage of ideological warfare, there is reason to not despair — we have indeed made some impressive progress. We do not <a href="https://en.wikipedia.org/wiki/Slavery_Abolition_Act_1833">conquer and enslave entire civilisations anymore</a>, nor do we see <a href="https://en.wikipedia.org/wiki/Bubonic_plague">plagues cut the population of our species by almost a third</a>, as we saw in the 14th century. By our best measures: worldwide <a href="https://ourworldindata.org/life-expectancy/">life expectancy</a> has improved and levels of extreme <a href="https://ourworldindata.org/extreme-poverty/">poverty</a> have decreased drastically in the last two centuries. Furthermore, despite the headlines, the <a href="https://ourworldindata.org/global-economic-inequality">global income distribution is flattening</a>. Although technology has certainly advertised just how divided we really are, it is easy to forget from where we came (Pinker, 2011).</p><p>To many technologists, focused on the future and with a blind-eye for the past, the potential to use technology to have a direct impact on millions, even billions of people is uniquely empowering. The opportunity to be heard, to allow others to be heard and to make a difference by offering a platform for action provides a means for engagement and advocacy. In that sense, it now seems to be the best time to be alive in the history of humanity. We are now engineering disease resistant GMOs like Golden Rice that have <a href="http://www.goldenrice.org/">already saved millions of lives in India</a>. <a href="https://www.tesla.com/en_GB/">With electric vehicles</a>, we are moving away from a petroleum transport economy which has already been <a href="http://www.merip.org/mer/mer171/oil-gulf-war">the source of many wars</a>. <a href="https://bitcoin.org/en/">Bitcoin</a> aims to rewrite the global payment system and is achieving widespread adoption, while blockchain based projects like <a href="https://ethereum.org/">Ethereum</a> are enabling digitally encoded contracts. Both of these projects obviate the need for trusted third parties who are fallible to corruption.</p><p>However, the <a href="https://ourworldindata.org/war-and-peace/">past was not peaceful</a> — so we must be vigilant to the rise of new demagogues and potential large scale wars. Indeed the well known British author, John Le Carre, who was alive in the 1930s during the rise of Fascism in Germany wrote recently that he believes that <a href="https://www.theguardian.com/books/2017/sep/07/john-le-carre-on-trump-something-truly-seriously-bad-is-happening">something seriously bad is happening in the United States</a> with the election of Donald Trump. Furthermore, <a href="https://twitter.com/SonmiChina/status/911422249688735744">advances in Computer Vision and Artificial Intelligence</a> convinced China in 2014 to pursue the ambitions <a href="http://www.independent.co.uk/news/world/asia/china-surveillance-big-data-score-censorship-a7375221.html">Social Credits system</a>, capable of automatically tracking the contributions of individual citizens with a distributed network of security cameras.</p><p>The rise of extremism is not exactly the result of failed revolutions but rather symptoms of tensions between oppression and resistance fighting on the grounds of perceived resource limitation. As a species we flip between periods of seeming progress, followed by regression, and it is unlikely that this will change. What can at least be said is that life for a much greater number of people is better than it was in the last century, and the same can be said for the century preceding that. Let’s hope that the human race is not about to enter another large regression following the peaceful period we have experienced since the Second World War. After all, we now have the technology to cause suffering at a much larger scale.</p><p>(copyedited by: Veronica Glab)</p><h4>References</h4><p>Maslow, A. (1943). A Theory of Human Motivation. <em>Psychological Review</em>,</p><p>Rhodes, R.(1986). The making of the atomic bomb. <em>New York: Simon &amp; Schuster.</em></p><p>Plato. (2015). Socrates’ Defence. <em>Penguin Classics.</em></p><p>Pinker, S. (2011). The Better Angels of our Nature . <em>New York, NY: Viking.</em></p><h4>Acknowledgements</h4><p>A great deal of thanks goes to Charlotte Guzzo, Liran Morav, Veronica Glab and Baruchi Malewich.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba5a8c01e1fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/critical-masses/some-things-just-dont-change-ba5a8c01e1fa">Some Things Just Don’t Change</a> was originally published in <a href="https://medium.com/critical-masses">Critical Masses</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Back to the Bitcoin white-paper]]></title>
            <link>https://medium.com/@willgdjones/back-to-the-bitcoin-whitepaper-ba983e12f05a?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba983e12f05a</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Sun, 04 Jun 2017 22:31:06 GMT</pubDate>
            <atom:updated>2017-06-06T08:34:22.092Z</atom:updated>
            <content:encoded><![CDATA[<p>On my reading list is the Bitcoin white-paper — available <a href="https://bitcoin.org/bitcoin.pdf">here</a>.</p><p>Financial institutions hold much of the power in handling electronic payments. However, as the scale of internet commerce expands there is a greater need for trusted third parties to facilitate non-reversible transactions. Even if a party is dissatisfied with a financial trade — non-reversible transaction cannot be revoked.</p><p>Unfortunately, financial institutions do not deliver this requirement. The bitcoin protocol provides are cryptographic scheme to ensure that reversing a transaction is computationally impractical. This protects the sellers from fraud, and routine escrow mechanisms protect buyers (Escrow mechanisms are a financial arrangements whereby a third-party holds the assets during a transaction). The bitcoin protocol also solves the double spending problem. Implements a peer-to-peer distributed timestamp server to generate computational proof of the chronological order of transactions. This system is cryptographically secure as long as cooperating attacker nodes do not control more CPU power in the network than honest nodes.</p><p>A ‘coin’ or unit of wealth in this system is defined by a chain of digital signatures. User A can give a coin to user B, by digitally signing the hash of the previous transaction has with the public key of the recipient. This information is then added to the end of the coin. The payee can then verify these signatures, and be satisfied that they do indeed own the coin.</p><p>As currently presented, the new owner has no way of knowing if the coin was double spent. That is, whether the previous owners signed two different transactions with two users, using their two different public keys. One solution to this would be to use a third-party to verify the uniqueness of each coin transaction — but this is no different to the solution we already employ, a bank. To accomplish this without a trusted body, each transactions needs to be public. Furthermore, each party in the network needs to agree on a single version of history. If a coin is double spent, then the owner who becomes the owner earlier in time is the ‘true’ owner. For the payee to be satisfied that they are the true owner, more than half the nodes in the system need to agree on this event.</p><p>The bitcoin protocol begins with what is known as a timestamp server. In this timestamp server, the hashes of a set of documents, called blocks, are shared publicly. These hashes are timestamped. Therefore, anyone can verify the existence of a particular set of documents at a particular point in time, because it’s hash existed at a particular point in time.</p><p>The challenge is to implement this in a distributed fashion, amongst multiple untrusted parties. In bitcoin, this is achieved via proof-of-work. Proof-of-work in this context means finding the solution to a difficult cryptographic problem. This chosen problem is finding a pre-image of a cryptograph hash function that satisfied certain constraints. Specifically, the problem is to find an alphanumeric string, known as a ‘nonce’, which when appended to the beginning of the block hash, results in a hash that begins with a desired number of zeros. This is a computational challenging problem, as there does not exist a known inverse to the SHA-128 hash. The only solution is to repeatedly try different nonces until the correct nonce is found.</p><p>New transactions are broadcast to nodes across a network. On each node, new transactions are added into blocks. Each node then tries to mine it’s block of transactions. The is a currently a block-size limit of 1MB (although this is currently <a href="https://en.bitcoin.it/wiki/Block_size_limit_controversy">causing controversy</a>), which means that it is possible to mine any block up to a size of 1MB. ‘Mine a block’ in this sense means to successfully find the nonce which when appended to a block of documents gives a hash that begins with a given number of zeros, as described before. At present, is seems that <a href="https://blockchain.info/block/0000000000000000057fcc708cf0130d95e27c5819203e9f967ac56e4df598ee">17 zeros are required</a> to mine a block. The difficulty of mining a block increasing exponentially with the number of zeros that are required to be zero. The difficulty of mining a block increasing steadily over time such that a block in mined approximately every 10 minutes.</p><p>EDIT (6.06.17): A more recent way of thinking about mining a block is acheiving a <em>target</em>. If the block hash is thought of as a very large 256 bit number, then the aim is to find a nonce which when appended to the beginning of a block gives a hash that has a value less than or equal to this target.</p><p>This is important since difficulty is a adjusted so that the time taken to mine 2016 blocks is approximately 10 minutes. Therefore, we would like a way to make small changes to the difficulty of mining a block — if we could only stipulate that one extra or one fewer zero was required, then we could only double or halve the mining difficulty.</p><p>Concretely, we compute the <a href="https://en.bitcoin.it/wiki/Difficulty">difficulty</a> as:</p><p>difficulty = difficulty_1_target / current_target</p><p>current_target is fluid — it’s current value can be looked up by <a href="https://blockexplorer.com/api/status?q=getDifficulty">an API</a></p><p>difficult_1_target represents a hash where the leading 32 bits are zero and the rest are one. This number is known as ‘pdiff’. Clients represent this number as a custom floating point type with limited precision, and so only approximate this number. This approximate is known as ‘bdiff’.</p><p>This approximation is slightly less than the true value, which makes the target slightly lower, and consequently means the problem is slightly harder. Confusingly, lower values of difficulty make the problem harder.</p><p>Once a node successfully mines a block, the node digitally signs the block along with the previous head of the chain. It then broadcasts the result to neighbouring nodes. Other nodes then verify that this block does not contain double-spent transactions, and accepts this block by working on top of this block. This means that future blocks mined by this other node will use the new block as the chain head.</p><p>Nodes always prefer to work on the longest chain. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In this case, they work on the first one they receive, but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer — the nodes that were working on the other branch will then switch to the longer one. (This paragraph is largely copied from the paper, as it is very well explained).</p><p>The first transaction in a block starts a new coin owned by the creator of the block, providing an incentive for participants in the network. Another method to incentivise nodes is to use transaction fees. A transaction fee is a cost to make a transaction in the network — i.e. that the output value of a transaction is less that the input value. The difference is added to the block which contains the transactions, and the transaction fees of all the transactions in this block are received by the miner who successfully mines it.</p><p>This also provides an incentive to be honest. It means that those with more CPU power are incentivised to contribute to the system and receive more bitcoin rather than to attempt to undermine the system.</p><p>We started with the definition of a coin being a chain of hashes. To define such a coin in a compact way, which does not break the coin’s hash, we use a Merkle-Tree (sometimes known as a hash tree).</p><p>This forms a verification system, that can be done without running a full network node. The users needs only to keep a copy of the block headers of the longest proof-of-work chain, which he can get by querying network nodes until he is convinced he has the longest chain, and obtain the Merkle branch linking the transaction to the block it is timestamped in.</p><p>Transactions can be combined, and there can be multiple inputs. Since the network broadcast is entirely public, a new public key is generated for each new transaction to preserve network participant anonymity. Therefore it is known when and how large transactions are on the network, but not by whom. This is similar to the setup implemented in stock exchanges.</p><p>Calculations show that it is theoretically impossible to an attacker to break the network.</p><h4>Acknowledgements</h4><p>06.06.17 Thanks for Patrick Short for pointing out the more recent interpretation of mining difficulty.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba983e12f05a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Relational Models (ORM)]]></title>
            <link>https://medium.com/@willgdjones/object-relational-models-orm-ad0580924337?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad0580924337</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 30 May 2017 20:01:07 GMT</pubDate>
            <atom:updated>2017-05-30T20:19:04.507Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of building Heterogeneous as was described in <a href="https://medium.com/@willgdjones/mark-zuckebergs-harvard-address-36d5e671af10">my previous post</a>, I am building the backend of the website. This has proven a steep learning curve, and while we have a functioning demo it is not imperative to improve the quality and robustness of the platform.</p><p>One of the ways to do that, is to use what is known as an Object Relational Model or (ORM) for sure in order to store data. We are storing user login information but also genotypes with MongoDB — a extremely flexible noSQL database. A MongoDB database consists of <em>collections </em>which comprise <em>key-value pairs.</em> This is a fantastically flexible database design because it essentially translates to ‘there are no rules’.</p><p>A concrete example, suppose we wanted to store information pertaining to users on our platform. We can store data in the following format:</p><pre>{“_id”: ID, ”email”: email, “password”: password, “email_confirmed”: boolean}</pre><p>This is is a perfectly reasonable, if simple, set of data to store user information. (Obviously we use salted hashes of the user password...)</p><p>However, there is nothing preventing us from adding something else when we save this user. For example.</p><pre>{“_id”: ID, ”email”: email, “password”: password, “email_confirmed”: boolean, &quot;random_field&quot;: &quot;something stupid&quot;}</pre><p>Without a proper ORM, there is nothing to prevent me from storing this as a valid user. This example actually would not cause a problem, but what if I accidentally stored a user without an email? This would cause a problem when the application tries to send a welcome email. It is best to ensure that when something is saved to a database, it takes the form you expect.</p><p><a href="http://flask.pocoo.org/docs/0.12/patterns/mongokit/">MongoKit</a> is such an engine, that we have decided to use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad0580924337" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mark Zuckerberg’s Harvard address]]></title>
            <link>https://medium.com/@willgdjones/mark-zuckebergs-harvard-address-36d5e671af10?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/36d5e671af10</guid>
            <category><![CDATA[heterogeneous]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[purpose]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 30 May 2017 09:29:32 GMT</pubDate>
            <atom:updated>2017-05-30T17:27:21.431Z</atom:updated>
            <content:encoded><![CDATA[<p>I watched <a href="https://www.youtube.com/watch?v=BmYv8XGl-YU">Mark Zuckerberg’s Harvard address</a> this morning. It was an amazing speech for someone so young, and he captures an underlying problem of today’s generation. <strong>How to live with purpose.</strong></p><p>Purpose is something intangible that we know exactly when we feel it. It’s a sense that what you are working towards matters in order to achieve a higher goal. I interpret this as closely linked to the <a href="https://en.wikipedia.org/wiki/Flow_(psychology)">concept of flow</a> in psychology. I am happiest when I am locked in the moment of building something, or solving a problem — <em>in the zone</em> as I like to describe.</p><p>Many people find their purpose from their jobs. Indeed, this is the backbone of the <a href="http://www.loc.gov/teachers/classroommaterials/lessons/american-dream/students/thedream.html">American dream</a>. But what happens when people lose their jobs through automation? What happens when people find it harder and harder to feel needed? There are times where I feel like this, and I have been fortunate enough to have been given the very best education — it should be easier for me.</p><p>What happens is when people cannot find a way to feel useful, when they become and feel useless and worthless, is that they fall into depression. It becomes harder and harder to find reasons to live. Mark highlighted this as the most important thing for today’s generation, and I think he is totally on point.</p><p>The most important thing to do is to <strong>create purpose, </strong>not just for yourself but for as many people as possible around you. Work on big exciting projects, that draw people towards you have give them as sense that they are working on something important. <em>It isn’t just about what you are building, it is also in the process of giving you, and the people working with you, purpose.</em></p><p>In fact, Mark mentions exactly a problem that I am working to solve — storing and sharing patient data to better facilitate medical research. <a href="http://www.heterogeneous.co.uk/">We are building Heterogeneous</a>, a platform where you can share your health data and genetics in order to facilitate a better research process, and to ulimately help cure diseases faster. If this is a message that speaks to you, then please join the platform and feel free to give us feedback. We are also looking for a great designer to help us bring the project to the next level. Get in touch with me <a href="https://twitter.com/willgdjones">on Twitter</a> if you feel like this gives you purpose.</p><p>Thanks for reading.</p><p>Will</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36d5e671af10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Threads v Processes]]></title>
            <link>https://medium.com/@willgdjones/python-threads-v-processes-4e4c7c5099b?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e4c7c5099b</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 30 May 2017 09:06:59 GMT</pubDate>
            <atom:updated>2017-05-30T09:06:59.960Z</atom:updated>
            <content:encoded><![CDATA[<p>Threading is another concept that was covering in Chapter 1 of the Violent Python book. Threading is a form of parallelism that mean that code execution can run concurrently. A ‘process’ is also used to describe concurrent program execution, how a ‘thread’ and a ‘process’ are different. <a href="https://stackoverflow.com/questions/200469/what-is-the-difference-between-a-process-and-a-thread">According to SO</a>, processes are used for more heavyweight pieces of code execution. Threads run in a shared memory space, whereas processes run in a seperate memory space.</p><p>Furthermore, Python operates the Global Interpreter Lock (GIL). This is a controversial feature of Python that means it cannot take full advantage of the multiprocessing capabilites of the system it is running on. <a href="https://docs.python.org/3/c-api/init.html#thread-state-and-the-global-interpreter-lock">The article</a> explains that each thread must have access to the GIL when interacting with Python objects.</p><p>Since threads are operating in the same memory space, this can mean that the state of a program can be incorrectly modified. For example, if two threads are incrementing the same memory location simultaneously, then the value might only increment by one instead of the correct amount, two.</p><p>This is a problem because it means that even in a multi-threaded application, only one thread is able to be executed at one time. If a thread is undergoing some blocking operation (i.e. an operation that is awaiting the completion of seperate operation), like file IO, the thread gives up the GIL so that another thread can use it. When the blocking operation has finished, the thread tries to reaquire the GIL so that it can continue.</p><p>To achieve true parallel programming, it is better to use the multiproccess module directly, in which each process it using it’s own memory space. However, this is limited by the number of processor / cores on your machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e4c7c5099b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trust what you can show yourself.]]></title>
            <link>https://medium.com/@willgdjones/trust-what-you-can-show-yourself-6169178cfbe3?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/6169178cfbe3</guid>
            <category><![CDATA[academia]]></category>
            <category><![CDATA[thoughts]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Mon, 29 May 2017 09:07:59 GMT</pubDate>
            <atom:updated>2017-05-30T13:28:58.703Z</atom:updated>
            <content:encoded><![CDATA[<p>I read this story today, on Twitter. My main attempt to keep up with a world that seems to move phenomenally fast.</p><p>It was <a href="http://www.ladbible.com/technology/technology-someone-has-filmed-inside-a-click-farm-and-its-weird-af-20170513">a story</a> of a Chinese so called ‘click-farm’ company. The purpose of this company is to generate artifical social media activity. In the video it (seemingly) shows rows of mobile phones stacked together for employees to click in an extremely high-throughput fashion.</p><p>It made me think of the world we live in online, and the rewards by which we value content. When I read articles on Reddit or Twitter, I am influenced by the number of upvotes, retweets and likes a piece of content has recieved. Whether I like it or not, I am sure that I am extremely influenced by such activity. I am starting to believe that it influences very many people, and can even influence the results of elections. How can I really trust these figures?</p><p>Working in the academic research field, trust is established by the peer-review process. Independent researchers read and critique pieces of work to ensure the steps in logic matches the conclusions. Despite this, groups of scientists still make errors.</p><p>There is no such peer review process in the real world, and yet that’s what we spend most of our time reading. If we think of what we read and consume as content in the same way we are careful to eat, this is quite unhealthy.</p><p>It’s hard to know who to trust. In the computational sciences, and in a data-driven world, there is more opportunity for anyone to have their say. But there is also an <em>opportunity for anyone to verify it too.</em></p><p>Trust what you can show yourself.</p><p>Examples:</p><ul><li>Whether that deep learning algorithm really works as well as in the abstract.</li><li>Whether economic figures really support the view this economist is trying to argue for.</li></ul><p>What this needs is extremely easy access to data. For the economic example, what if there was a way to write in a python shell:</p><p>from economicdata import lastest-figures</p><p>And have an array of the latest economic figures, ready to analyse. I think this would empower more independent thinkers — and we as many of those people as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6169178cfbe3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AutoEncoding Drug Assays]]></title>
            <link>https://medium.com/@willgdjones/autoencoding-astrazeneca-drug-assays-40bba8fd8430?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/40bba8fd8430</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[drugs]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 25 Oct 2016 10:24:47 GMT</pubDate>
            <atom:updated>2016-10-26T14:21:18.732Z</atom:updated>
            <content:encoded><![CDATA[<p>I have also been working on a project as part of my PhD with AstraZeneca. In this project, I am working with assay images from microscopy images of a high-throughput screen. The goal is to extract features from the images which would indicate which drug should be taken forward for further testing. My progress is documented in <a href="https://github.com/willgdjones/progress-25-10-16">this repository</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40bba8fd8430" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tensorflow tutorials 2]]></title>
            <link>https://medium.com/@willgdjones/tensorflow-tutorials-2-e515616a3368?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/e515616a3368</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Tue, 25 Oct 2016 10:23:32 GMT</pubDate>
            <atom:updated>2016-10-25T10:23:55.864Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve recently been building more things with Tensorflow as such have created some more tutorials. These use the CIFAR-10 dataset which contains 60000 32x32 colour images in 10 classes, with 6000 images per class. I’ve experimented with using both my own manual implementation of the layers and compared them with using the community-contributed Tensorflow implementations. I find that the community-contributed implementations comprehensively outperform my own, So much for trying to implement everything myself! Not only that, the APIs are intuitively designed and easy to use. There are some implementations that I wish existed. For example, an inverse pooling operation for an autoencoder. Perhaps they will appear in the future or I will implement them myself. Here are the <a href="https://github.com/willgdjones/notebooks/blob/master/CIFAR10ConvolutionalNetwork-Manual.ipynb">manual</a> and <a href="https://github.com/willgdjones/notebooks/blob/master/CIFAR10ConvolutionalNetwork-Library.ipynb">library</a> notebooks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e515616a3368" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tensorflow tutorials]]></title>
            <link>https://medium.com/@willgdjones/tensorflow-tutorials-94de9f3e97c8?source=rss-76a7c2c51c91------2</link>
            <guid isPermaLink="false">https://medium.com/p/94de9f3e97c8</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Will Jones]]></dc:creator>
            <pubDate>Fri, 07 Oct 2016 10:41:42 GMT</pubDate>
            <atom:updated>2016-10-07T10:41:42.175Z</atom:updated>
            <content:encoded><![CDATA[<p>Instead of reading through tutorials, I know that the best way to learn is to write tutorials yourself. As such, here are my own version of the common beginner deep learning tutorials which use the <a href="http://yann.lecun.com/exdb/mnist/">MNIST dataset</a>, a data-set of handwritten digits from <a href="https://en.wikipedia.org/wiki/Yann_LeCun">Yann LeCunn</a>. They are written as self-explanatory Jupyter Notebooks and assume TensorFlow is installed. I’m using an <a href="https://blogs.nvidia.com/blog/2015/04/09/quadro-m6000/">NVIDIA Quadro M6000</a> GPU. The tutorials implement <a href="https://github.com/willgdjones/notebooks/blob/master/LogisticRegression.ipynb">logistic regression</a>, a <a href="https://github.com/willgdjones/notebooks/blob/master/SingleLayerPerceptron.ipynb">single-later perceptron</a>, and a <a href="https://github.com/willgdjones/notebooks/blob/master/MultiLayerPerceptron.ipynb">multi-layer perception</a>.</p><p><a href="https://github.com/aymericdamien/TensorFlow-Examples">Source</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94de9f3e97c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>