Planet Sugarhttp://planet.sugarlabs.org/atom.xml2019-06-16T05:03:28+00:00http://intertwingly.net/code/venus/Concept And Thoughts Of Institutionalized State (PANCASILA)http://karmaeducation.org/?p=16502019-06-16T00:54:07+00:00<p>Educational Philosophy and Idea is a prestigious international journal, publishing articles involved with all features of academic philosophy. Although Rousseau never intended these instructional details to be taken actually as a blueprint (he noticed himself as creating and illustrating the essential rules), over the ages there have been attempts to implement them, one being the famous British free school”, A.S. Neill’s Summerhill (cf.</p>
<p>The very nature of philosophy, on the other hand, is basically contested”; what counts as a sound philosophical work within one college of thought, or socio-cultural or tutorial setting, might not be so regarded (and should even be the main focus of derision) in a distinct one.<img alt="philosophy of education" class="aligncenter" src="http://langwitches.org/blog/wp-content/uploads/2011/09/philosphy-of-education.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="1030px" /></p>
<p>No one particular person can have mastered work performed by such a range of figures, representing as they do plenty of fairly completely different frameworks or approaches; and relatedly nobody individual stands as emblematic of the whole area of philosophy …</p>jasminehttp://karmaeducation.orgContinuing Training By way of College Of Wisconsinhttp://karmaeducation.org/?p=3372019-06-13T21:03:52+00:00<p>APA gives continuing education schemes for psychologists and other psychological health professionals. Throughout the area of continuous schooling, skilled persevering with schooling is a selected studying exercise generally characterized by the issuance of a certificate or continuing training models (CEU) for the purpose of documenting attendance at a delegated seminar or course of instruction.</p>
<p>Whether or not you’re seeking to advance your career or jumpstart your online business, pursue studying as an end in itself or as a automobile that can assist you make a difference in the lives of others, Penn has a program that can allow you to achieve the knowledge it’s essential get there.<img alt="continuing education" class="aligncenter" src="http://www.sunstate.edu/wp-content/uploads/2015/03/cont_ed.jpg" style="display: block; margin-left: auto; margin-right: auto;" width="1028px" /></p>
<p>Mission: San Diego Persevering with Schooling commits to scholar success and group enrichment by offering accessible, equitable, and innovative high quality education and help companies to various grownup learners in pursuit of lifelong studying, training, profession development, and pathways to varsity.</p>
<p>CDC PREPARE: …</p>jasminehttp://karmaeducation.orgSaint-Ouen deployment of Sugarizer OShttp://blog.laptop.org/?p=66712019-05-13T06:36:31+00:00<p>OLPC France has deployed Samsung Galaxy Tab A 2018 tablets with Sugarizer OS at the Mendela school. For more details, see <a href="https://wiki.sugarlabs.org/go/Sugarizer_Saint-Ouen_deployment">https://wiki.sugarlabs.org/go/Sugarizer_Saint-Ouen_deployment</a></p>James Cameronhttp://blog.laptop.orgTurtle Blocks all the way Down Underhttp://blog.laptop.org/?p=66662019-05-03T06:32:29+00:00<p>Learners at Tooraweenah Public School in outback Australia being taught how to use OLPC XO-4 with Turtle Blocks. Their task was to use the turtle to draw shapes, like squares, and hexagons.</p>
<figure class="wp-block-image"><img alt="" class="wp-image-6667" src="http://blog.laptop.org/wp-content/uploads/2019/05/blog-tps-IMG_3585-1024x642.jpg" /></figure>
<p>Part of a weekly visit by a volunteer technology teacher and OLPC’s CTO.</p>James Cameronhttp://blog.laptop.orgComment on Fingerprint enhancement and recognition by 4http://www.reactivated.net/weblog/archives/2006/08/fingerprint-enhancement-and-recognition/#comment-271252019-04-25T08:33:00+00:00<p><strong>file</strong></p>
<p>dsd</p>4http://www.reactivated.net/weblogComment on Reverse Engineering by keyhttp://www.reactivated.net/weblog/?p=51#comment-271242019-04-23T16:08:14+00:00<p><strong>Download file</strong></p>
<p>dsd</p>keyhttp://www.reactivated.net/weblogEchoes of Darchulahttp://blog.olenepal.org/?p=27932019-04-17T12:08:15+00:00– Subash Parajuli, Teaching Resident for Darchula 2018-19 “While I decided to go to Darchula for the ‘Teaching with Technology Residency Program’, my excitement was mostly about visiting a new place in the remote far-western corner of Nepal. The only thing I knew about Darchula was that it was a district that shared its borders with both India and China. There was not much expectation, except getting to explore a new part of our country.… <p class="more-link"><a href="https://blog.olenepal.org/index.php/archives/2793">Continue reading <span class="meta-nav">→</span></a></p>adminhttps://blog.olenepal.orgPanfrost update: a new kernel drivertag:blogger.com,1999:blog-664175667937540078.post-21667617234072852292019-03-05T06:33:12+00:00<div dir="ltr" style="text-align: left;"><div class="ace-line" id="magicdomid2" style="text-align: left;"><h2><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The video</span></h2></div><div class="ace-line" id="magicdomid3"></div><div class="ace-line" id="magicdomid4"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Below you can see the same scene that I <a href="https://blog.tomeuvizoso.net/2019/01/a-panfrost-milestone.html">recorded in January</a>, which was rendered by Panfrost in Mesa but using Arm's kernel driver. This time, Panfrost is using a new kernel driver that is in a form close to be acceptable in the mainline kernel:</span></div><div class="separator" style="clear: both; text-align: center;"></div><div class="ace-line" id="magicdomid6"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14"></span></div><div class="ace-line" id="magicdomid7"></div><div class="ace-line" id="magicdomid8" style="text-align: left;"><h2><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The history behind it</span></h2></div><div class="ace-line" id="magicdomid9"></div><div class="ace-line" id="magicdomid10"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">During the past two months Rob Herring and I have been working on a new driver for Midgard and Bifrost GPUs that could be accepted mainline.</span></div><div class="ace-line" id="magicdomid11"><br /></div><div class="ace-line" id="magicdomid12"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Arm already maintains a driver out of tree with an acceptable open source license, but it doesn't implement the DRM ABI and several design considerations make it unsuitable for inclusion in mainline Linux.</span></div><div class="ace-line" id="magicdomid13"><br /></div><div class="ace-line" id="magicdomid14"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The absence of a driver in mainline prevents users from keeping their kernels up-to-date and hurts integration with other parts of the free software stack. It also discourages SoC and BSP vendors from submitting their code to mainline, and hurts their ability to track mainline closely.</span></div><div class="ace-line" id="magicdomid15"><br /></div><div class="ace-line" id="magicdomid16"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Besides the code of the driver itself, there's one more condition for mainline inclusion: an open source implementation of the userspace library needs to exist, so other kernel contributors can help verifying, debugging and maintaining the kernel driver. It's an enormous pile of difficult work to reverse engineer the</span><span class="author-a-oz84zz90zz83zz79zz68zn5z69zz84znz87zz65zz73z0x"> inner</span><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14"> working</span><span class="author-a-oz84zz90zz83zz79zz68zn5z69zz84znz87zz65zz73z0x">s</span><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14"> of a GPU and </span><span class="author-a-oz84zz90zz83zz79zz68zn5z69zz84znz87zz65zz73z0x">then </span><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">implement a compiler and command submission infrastructure, so big thanks to <a href="https://rosenzweig.io/blog/">Alyssa Rosenzweig</a> for leading that effort.</span></div><div class="ace-line" id="magicdomid17"></div><div class="ace-line" id="magicdomid18"><h2 style="text-align: left;"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Upstream status</span></h2></div><div class="ace-line" id="magicdomid19"></div><div class="ace-line" id="magicdomid20"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Most of the Panfrost code is already part of mainline Mesa, with the code that directly interacts with the new DRM driver being in the review stage. Currently targeted GPUs are T760 and T860, with the RK3399 being the SoC more often used for testing.</span></div><div class="ace-line" id="magicdomid21"><br /></div><div class="ace-line" id="magicdomid22"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The kernel driver is being developed in the open and though we are trying to follow the best practices as displayed by other DRM drivers, there's a number of tasks that need to be done before we consider it ready for submission.</span></div><div class="ace-line" id="magicdomid23"></div><div class="ace-line" id="magicdomid24"><h2 style="text-align: left;"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The work ahead</span></h2></div><div class="ace-line" id="magicdomid25"></div><div class="ace-line" id="magicdomid26"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">In the kernel:</span></div><div class="ace-line" id="magicdomid26"></div><div class="ace-line" id="magicdomid27"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Make MMU code more complete for correctness and better performance</span></div><div class="ace-line" id="magicdomid28"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Handle errors and hangs and correctly reset the GPU</span></div><div class="ace-line" id="magicdomid29"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Improve fence handling</span></div><div class="ace-line" id="magicdomid30"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Test with compute shaders (to check completeness of the ABI)</span></div><div class="ace-line" id="magicdomid31"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Lots of cleanups and bug fixing!</span></div><div class="ace-line" id="magicdomid32"><br /></div><div class="ace-line" id="magicdomid33"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">In Mesa:</span></div><div class="ace-line" id="magicdomid34"></div><div class="ace-line" id="magicdomid34"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Get GNOME Shell working</span></div><div class="ace-line" id="magicdomid35"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Get Chromium working with accelerated WebGL</span></div><div class="ace-line" id="magicdomid36"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Get all of glmark2 working</span></div><div class="ace-line" id="magicdomid37"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Get a decent subset of dEQP passing and use it in CI</span></div><div class="ace-line" id="magicdomid38"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Keep refactoring the code</span></div><div class="ace-line" id="magicdomid39"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- Support more hardware</span></div><div class="ace-line" id="magicdomid40"></div><div class="ace-line" id="magicdomid41"><h2 style="text-align: left;"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">Get the code</span></h2></div><div class="ace-line" id="magicdomid42"></div><div class="ace-line" id="magicdomid43"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">The exact bits used for the demo recorded above are in various stages of getting upstreamed to the various upstreams, but here are in branches for easier reproduction:</span></div><div class="ace-line" id="magicdomid44"><br /></div><div class="ace-line" id="magicdomid45"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- </span><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14 url"><a href="https://gitlab.freedesktop.org/tomeu/linux/tree/panfrost-5.0-rc4">https://gitlab.freedesktop.org/panfrost/linux/tree/panfrost-5.0-rc4</a></span></div><div class="ace-line" id="magicdomid46"><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14">- </span><span class="author-a-z75zz67zz75zbkgz76zz68zz69zmz77zivz85z14 url"><a href="https://gitlab.freedesktop.org/tomeu/mesa/tree/mainline-driver">https://gitlab.freedesktop.org/tomeu/mesa/tree/mainline-driver</a></span></div><div class="ace-line" id="magicdomid47"><br /></div></div>Unknownnoreply@blogger.comhttps://blog.tomeuvizoso.net/A Panfrost milestonetag:blogger.com,1999:blog-664175667937540078.post-65687435665617886142019-01-07T12:33:06+00:00<div dir="ltr" style="text-align: left;"><h3 style="text-align: left;">The video</h3><div style="text-align: left;">Below you can see glmark2 running as a Wayland client in Weston, on a <a href="http://wiki.friendlyarm.com/wiki/index.php/NanoPC-T4">NanoPC -T4</a> (so a RK3399 SoC with a Mali T-864 GPU)). It's much smoother than on the video, which is limited to 5FPS by the webcam.</div><div style="text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"></div><br />Weston is running with the DRM backend and the GL renderer.<br /><br /><h3 style="text-align: left;">The history behind it </h3><br />For more than 10 years, at <a href="https://www.collabora.com/">Collabora</a> we have been happily helping our customers to make the most of their hardware by running free software.<br /><br />One area some of us have specially enjoyed working on has been open drivers for GPUs, which for a long time have been considered the next frontier in the quest to have a full software platform that companies and individuals can understand, improve and fix without having to ask for permission first.<br /><br />Something that has saddened me a bit has been our reduced ability to help those customers that for one reason or another had chosen a hardware platform with ARM Mali GPUs, as no open driver was available for those.<br /><br />While our biggest customers were able to get a high level of support from the vendors in order to have the Mali graphics stack well integrated with the rest of their product, the smaller ones had a much harder time in achieving that level of integration, which manifested in reduced performance, increased power consumption and slipped milestones.<br /><br />That's why we have been following with great interest the several efforts that aimed to come up with an open driver for GPUs in the Mali family, one similar to those already existing for Qualcomm, NVIDIA and Vivante.<br /><br />At XDC last year we had the chance of meeting the people involved in the latest effort to develop such a driver: Panfrost. And in the months that followed I made some room in my backlog to come up with a plan to give the effort a boost.<br /><br />At that point, Panfrost was only able to get its bits in the screen by an elaborate hack that involved copying each frame into a X11 SHM buffer, which besides making the setup of the development environment much more cumbersome, invalidated any performance analysis. It also limited testing to demos such as glmark2.<br /><br />Due to my previous work on Etnaviv I was already familiar with the abstractions in Mesa for setups in which the display of buffers is performed by a device different from the GPU so it was just a matter of seeing how we could get the kernel driver for the Mali GPU to play well with the rest of the stack.<br /><br />So during the past month or so I have come up with a proper implementation of the winsys abstraction that makes use of ARM's kernel driver. The result is that now developers have a better base on which to work on the rendering side of things.<br /><br />By properly creating, exporting and importing buffers, we can now run applications on GBM, from demos such as kmscube and glmark2 to compositors such as Weston, but also big applications such as Kodi. We are also supporting zero-copy display of GPU-rendered clients in Weston.<br /><br />This should make it much easier to work on the rendering side of things, and work on a proper DRM driver in the mainline kernel can proceed in parallel.<br /><br />For those interested in joining to the effort, Alyssa has graciously taken the time to update the <a href="https://panfrost.freedesktop.org/building-panfrost-mesa.html">instructions to build and test Panfrost</a>. You can join us at #panfrost in Freenode and can start sending merge requests to <a href="https://gitlab.freedesktop.org/panfrost/">Gitlab</a>.<br /><br />Thanks to <a href="https://www.collabora.com/">Collabora</a> for sponsoring this work and to Alyssa Rosenzweig and Lyude Paul for their previous work and for answering my questions.</div>Unknownnoreply@blogger.comhttps://blog.tomeuvizoso.net/Meet our Darchula Teaching Residents for 2018-19http://blog.olenepal.org/?p=27642018-11-21T05:09:02+00:00OLE Nepal’s Teaching in Technology Residency program has been receiving rave reviews from school teachers, local communities and children. Each year, OLE Nepal trains young graduates to support the newly launched laptop program schools in the far western districts of Nepal. Ever since it was introduced 5 years ago, many young graduates have travelled to remote communities in these districts where they live for months working with schools and communities so that they can use… <p class="more-link"><a href="https://blog.olenepal.org/index.php/archives/2764">Continue reading <span class="meta-nav">→</span></a></p>adminhttps://blog.olenepal.orgDerivations 102 - Learning Nix pt 4https://sam.today/blog/derivations-102-learning-nix-pt-42018-09-07T12:38:45+00:00<p>This guide will build on the <a href="https://www.sam.today/blog/environments-with-nix-shell-learning-nix-pt-1/" title="Environments with Nix Shell - Learning Nix pt 1">previous</a> <a href="https://www.sam.today/blog/so-variables-are-a-thing-learning-nix-pt-2/">three</a> <a href="https://www.sam.today/blog/creating-a-super-simple-derivation-learning-nix-pt-3/" title="Creating a super simple derivation - Learning Nix pt 3">guides</a>, and look at creating a wider variety of useful nix packages.</p>
<p>Nix is built around the concept of derivations. A derivation is simply defined as <a href="https://nixos.org/nix/manual/#ssec-derivation">"a build action"</a>. It produces 1 (or maybe more) output paths in the nix store.</p>
<p>Basically, a derivation is a pure function that takes some inputs (dependencies, source code, etc.) and makes some output (binaries, assets, etc.). These outputs are referenceable by their unique nix-store path.</p>
<h2>Derivation Examples</h2>
<p>It's important to note that literally everything in NixOS is built around derivations:</p>
<ul>
<li>Applications? Of course they are derivations.</li>
<li>Configuration files? In NixOS, they are a derivation that takes the nix configuration and outputs an appropriate config file for the application.</li>
<li>The system configuration as a whole (<code>/run/current-system</code>)?</li>
</ul>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>sam@vcs ~> ls -lsah /run/current-system
<span style="color: #666666;">0</span> lrwxrwxrwx <span style="color: #666666;">1</span> root root <span style="color: #666666;">83</span> Jan <span style="color: #666666;">25</span> <span style="color: #666666;">13</span>:22 /run/current-system -> /nix/store/wb9fj59cgnjmkndkkngbwxwzj3msqk9c-nixos-system-vcs-17.09.2683.360089b3521
</pre></div>
</div>
<blockquote>
<p>It's a symbolic link to a derivation!</p>
</blockquote>
<p>It's derivations all the way down.</p>
<p>If you've followed this series <a href="https://www.sam.today/blog/environments-with-nix-shell-learning-nix-pt-1/" title="Environments with Nix Shell - Learning Nix pt 1">from the beginning</a>, you would have noticed that we've already made some derivations. Our <a href="https://www.sam.today/blog/environments-with-nix-shell-learning-nix-pt-1/" title="Environments with Nix Shell - Learning Nix pt 1"><code>nix-shell</code> scripts</a> are based off having a derivation. When <a href="https://www.sam.today/blog/creating-a-super-simple-derivation-learning-nix-pt-3/" title="Creating a super simple derivation - Learning Nix pt 3">packaging a shell script</a>, we also made a derivation.</p>
<p>I think it is easiest to learn how to make a derivation through examples. Most packaging tasks are vaguely similar to packaging tasks done in the past by other people. So this will be going through example of using <code>mkDerivation</code>.</p>
<h2>mkDerivation</h2>
<p>Making a derivation manually <a href="https://nixos.org/nix/manual/#ssec-derivation">requires fussing with things like processor architecture and having zero standard build-inputs</a>. This is often not necessary. So instead, NixPkgs provides a function function <code>stdenv.mkDerivation</code>; which handles the common patterns.</p>
<p>The only real requirement to use <code>mkDerivation</code> is that you have some folder of source material. This can be a reference to a local folder, or something fetched from the internet by another nix function. If you have no source, or just 1 file; consider the "trivial builders" covered in <a href="https://www.sam.today/blog/creating-a-super-simple-derivation-learning-nix-pt-3/" title="Creating a super simple derivation - Learning Nix pt 3">part three of this series</a></p>
<p><code>mkDerivation</code> does most a lot of work automatically. It divides the build up into "phases", all of which include a little bit of default behaviour - although it is usually unintrusive or can be can be overridden. The most important phases are:</p>
<ol>
<li><strong>unpack</strong>: unzips, untarz, or copies your source folder to the nix store</li>
<li><strong>patch</strong>: applies any patches provided in the <code>patches</code> variable</li>
<li><strong>configure</strong>: runs <code>./configure</code> if it exists</li>
<li><strong>build</strong>: runs <code>make</code> if it exists</li>
<li><strong>check</strong>: skipped by default</li>
<li><strong>install</strong>: runs <code>make install</code></li>
<li><strong>fixup</strong>: automagically fixes up things that don't jell with the nix store; such as using incorrect interpreter paths</li>
<li><strong>installCheck</strong>: runs <code>make installcheck</code> if it exists and is enabled</li>
</ol>
<p>You can <a href="https://nixos.org/nixpkgs/manual/#sec-stdenv-phases">see all the phases in the docs</a>. But with a bit of practice from the examples below you'll likely get the feel for how this works quickly.</p>
<h1>Example #1: A static site</h1>
<p>Nix makes writing packages really easy; and with NixOps (which we'll learn later) Nix derivations are automagiaclly built and deployed.</p>
<p>First we need to answer the question of how we would build the static site ourself. This is a jekyll site, so you'd run the jekyll command</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"example-website-content"</span>;
<span style="color: #408080; font-style: italic;"># fetchFromGitHub is a build support function that fetches a GitHub</span>
<span style="color: #408080; font-style: italic;"># repository and extracts into a directory; so we can use it</span>
<span style="color: #408080; font-style: italic;"># fetchFromGithub is actually a derivation itself :)</span>
<span style="color: #19177C;">src =</span> fetchFromGitHub {
<span style="color: #19177C;">owner =</span> <span style="color: #BA2121;">"jekyll"</span>;
<span style="color: #19177C;">repo =</span> <span style="color: #BA2121;">"example"</span>;
<span style="color: #19177C;">rev =</span> <span style="color: #BA2121;">"5eb1b902ca3bda6f4b50d4cfcdc7bc0097bac4b7"</span>;
<span style="color: #19177C;">sha256 =</span> <span style="color: #BA2121;">"1jw35hmgx2gsaj2ad5f9d9ks4yh601wsxwnb17pmb9j02hl3vgdm"</span>;
};
<span style="color: #408080; font-style: italic;"># the src can also be a local folder, like:</span>
<span style="color: #408080; font-style: italic;"># src = /home/sam/my-site;</span>
<span style="color: #408080; font-style: italic;"># This overrides the shell code that is run during the installPhase.</span>
<span style="color: #408080; font-style: italic;"># By default; this runs `make install`.</span>
<span style="color: #408080; font-style: italic;"># The install phase will fail if there is no makefile; so it is the</span>
<span style="color: #408080; font-style: italic;"># best choice to replace with our custom code.</span>
<span style="color: #19177C;">installPhase =</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> # Build the site to the $out directory</span>
<span style="color: #BA2121;"> export JEKYLL_ENV=production</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>pkgs<span style="color: #666666;">.</span>jekyll<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/jekyll build --destination $out</span>
<span style="color: #BA2121;"> ''</span>;
}
</pre></div>
</div>
<p>Now we can see that this derivation builds the site. If you save it to <code>test.nix</code>, you can trigger a build by running:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>> nix-build test.nix
/nix/store/b8wxbwrvxk8dfpyk8mqg8iqhp7j2c9bs-example-website-content
</pre></div>
</div>
<p>The path printed by <code>nix-build</code> is where <code>$out</code> was in the Nix store. Your path might be a little different; if you are running a different version of NixPkgs, then the build inputs are different.</p>
<p>We can see the site has built successfully by entering that directory:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>> ls /nix/store/b8wxbwrvxk8dfpyk8mqg8iqhp7j2c9bs-example-website-content
<span style="color: #666666;">2014</span> about css feed.xml index.html LICENSE README.md
</pre></div>
</div>
<h3>Using the content</h3>
<p>We can then use that derivation as a webroot in a nginx virtualHost. If you have a server, you could add the following to your NixOS configuration:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #19177C;">content =</span> stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"example-website-content"</span>;
<span style="color: #666666;">...</span> <span style="color: #408080; font-style: italic;"># code from above snipped</span>
}
<span style="color: #008000; font-weight: bold;">in</span>
services<span style="color: #666666;">.</span>nginx<span style="color: #666666;">.</span>virtualHosts<span style="color: #666666;">.</span><span style="color: #BA2121;">"example.com"</span> <span style="color: #666666;">=</span> {
<span style="color: #19177C;">locations =</span> {
<span style="color: #BA2121;">"/"</span> <span style="color: #666666;">=</span> {
<span style="color: #19177C;">root =</span> <span style="color: #BA2121;">"</span><span style="color: #BB6688; font-weight: bold;">${</span>content<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">"</span>;
}
}
};
</pre></div>
</div>
<p>So how does this work? Ultimately, the "root" attribute needs to be set to the output directory of the content derivation.</p>
<p>Using the <code>"${content}"</code> expression, we force the derivation to be converted to a string (remembering <code>${...}</code> is string interpolation syntax). When a derivation is converted to a string in Nix, it becomes the output path in the Nix store.</p>
<p>If you don't have a server handy, we can use the content in this a simple http server script:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #408080; font-style: italic;"># server.nix</span>
<span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #19177C;">content =</span> stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"example-website-content"</span>;
<span style="color: #19177C;">src =</span> fetchFromGitHub {
<span style="color: #19177C;">owner =</span> <span style="color: #BA2121;">"jekyll"</span>;
<span style="color: #19177C;">repo =</span> <span style="color: #BA2121;">"example"</span>;
<span style="color: #19177C;">rev =</span> <span style="color: #BA2121;">"5eb1b902ca3bda6f4b50d4cfcdc7bc0097bac4b7"</span>;
<span style="color: #19177C;">sha256 =</span> <span style="color: #BA2121;">"1jw35hmgx2gsaj2ad5f9d9ks4yh601wsxwnb17pmb9j02hl3vgdm"</span>;
};
<span style="color: #19177C;">installPhase =</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> export JEKYLL_ENV=production</span>
<span style="color: #BA2121;"> # The site expects to be served as http://hostname/example/...</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>pkgs<span style="color: #666666;">.</span>jekyll<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/jekyll build --destination $out/example</span>
<span style="color: #BA2121;"> ''</span>;
};
<span style="color: #008000; font-weight: bold;">in</span>
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #19177C;">serveSite =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"serveSite"</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> # -F = do not fork</span>
<span style="color: #BA2121;"> # -p = port</span>
<span style="color: #BA2121;"> # -r = content root</span>
<span style="color: #BA2121;"> echo "Running server: visit http://localhost:8000/example/index.html"</span>
<span style="color: #BA2121;"> # See how we reference the content derivation by `</span><span style="color: #BB6688; font-weight: bold;">${</span>content<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">`</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>webfs<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/webfsd -F -p 8000 -r </span><span style="color: #BB6688; font-weight: bold;">${</span>content<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;"></span>
<span style="color: #BA2121;"> ''</span>;
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"server-environment"</span>;
<span style="color: #408080; font-style: italic;"># Kind of evil shellHook - you don't get a shell you just get my site</span>
<span style="color: #19177C;">shellHook =</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>serveSite<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/serveSite</span>
<span style="color: #BA2121;"> ''</span>;
}
</pre></div>
</div>
<p>Then run <code>nix-shell server.nix</code>, you'll then start the server and can view the site!</p>
<h1>Example #2: A more complex shell app</h1>
<p>We've already talked a lot about shell scripts. But sometimes whole apps get
built in shell scripts. One such example is <a href="https://github.com/mrowa44/emojify">emojify</a>,
a CLI tool for replacing words with emojis.</p>
<p>We can make a derivation for that. All we need to do is copy the shell script into the PATH, and mark it as executable.</p>
<p>If we were writing the script ourself, we'd need to pay special attention to fixing up dependencies (such as changing <code>/bin/bash</code> to a Nix store path). But <code>mkDerivation</code> has the <em>fixup phase</em>, which does this automatically. The defaults are smart, and in this case it works perfectly.</p>
<p>It is quite simple to write a derivation for a shell script.</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #19177C;">emojify =</span> <span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #19177C;">version =</span> <span style="color: #BA2121;">"2.0.0"</span>;
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"emojify-</span><span style="color: #BB6688; font-weight: bold;">${</span>version<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">"</span>;
<span style="color: #408080; font-style: italic;"># Using this build support function to fetch it from github</span>
<span style="color: #19177C;">src =</span> fetchFromGitHub {
<span style="color: #19177C;">owner =</span> <span style="color: #BA2121;">"mrowa44"</span>;
<span style="color: #19177C;">repo =</span> <span style="color: #BA2121;">"emojify"</span>;
<span style="color: #408080; font-style: italic;"># The git tag to fetch</span>
<span style="color: #19177C;">rev =</span> <span style="color: #BA2121;">"</span><span style="color: #BB6688; font-weight: bold;">${</span>version<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">"</span>;
<span style="color: #408080; font-style: italic;"># Hashes must be specified so that the build is purely functional</span>
<span style="color: #19177C;">sha256 =</span> <span style="color: #BA2121;">"0zhbfxabgllpq3sy0pj5mm79l24vj1z10kyajc4n39yq8ibhq66j"</span>;
};
<span style="color: #408080; font-style: italic;"># We override the install phase, as the emojify project doesn't use make</span>
<span style="color: #19177C;">installPhase =</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> # Make the output directory</span>
<span style="color: #BA2121;"> mkdir -p $out/bin</span>
<span style="color: #BA2121;"> # Copy the script there and make it executable</span>
<span style="color: #BA2121;"> cp emojify $out/bin/</span>
<span style="color: #BA2121;"> chmod +x $out/bin/emojify</span>
<span style="color: #BA2121;"> ''</span>;
};
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"emojify-environment"</span>;
<span style="color: #19177C;">buildInputs =</span> [ emojify ];
}
</pre></div>
</div>
<p>And see it in action:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>> nix-shell test.nix
<span style="color: #666666;">[</span>nix-shell:~<span style="color: #666666;">]</span>$ emojify <span style="color: #BA2121;">"Hello world :smile:"</span>
Hello world 😄
</pre></div>
</div>
<h1>Example #3: The infamous GNU Hello example</h1>
<p>If you've ever read anything about Nix, you might have seen an example of making a derivation for GNU Hello. Something like this:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #408080; font-style: italic;"># Let's separate the version number so we can update it easily in the future</span>
<span style="color: #19177C;">version =</span> <span style="color: #BA2121;">"2.10"</span>;
<span style="color: #408080; font-style: italic;"># Now define the derivation for the app</span>
<span style="color: #19177C;">helloApp =</span> stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #408080; font-style: italic;"># String interpolation to include the version number in the name</span>
<span style="color: #408080; font-style: italic;"># Including a version in the name is idiomatic</span>
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"hello-</span><span style="color: #BB6688; font-weight: bold;">${</span>version<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">"</span>;
<span style="color: #408080; font-style: italic;"># fetchurl is a build support again; and does some funky stuff to support</span>
<span style="color: #408080; font-style: italic;"># selecting from a predefined set of mirrors</span>
<span style="color: #19177C;">src =</span> fetchurl {
<span style="color: #19177C;">url =</span> <span style="color: #BA2121;">"mirror://gnu/hello/hello-</span><span style="color: #BB6688; font-weight: bold;">${</span>version<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">.tar"</span>;
<span style="color: #19177C;">sha256 =</span> <span style="color: #BA2121;">"0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i"</span>;
};
<span style="color: #408080; font-style: italic;"># Will run `make check`</span>
<span style="color: #19177C;">doCheck =</span> <span style="color: #880000;">true</span>;
};
<span style="color: #008000; font-weight: bold;">in</span>
<span style="color: #408080; font-style: italic;"># Make an environment for nix-shell</span>
stdenv<span style="color: #666666;">.</span>mkDerivation {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"hello-environment"</span>;
<span style="color: #19177C;">buildInputs =</span> [ helloApp ];
}
</pre></div>
</div>
<p>You can build and run this:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>> nix-shell test.nix
<span style="color: #666666;">[</span>nix-shell:~<span style="color: #666666;">]</span>$ hello
Hello, world!
</pre></div>
</div>
<p>Ultimately this is a terrible and indirect example. This doesn't explicitly specify anything that the builder will actually run! It really confused me when I was learning Nix.</p>
<p>To understand it, we need to remember the default build phases from <code>stdenv.mkDerivtion</code>. From above, we had a list of the most important phases. If we annotate the defaults with what happens in the case of GNU Hello, things start to make sense:</p>
<table>
<thead>
<tr>
<th></th>
<th>Phase</th>
<th>Default Behaviour</th>
<th>Behaviour with GNU Hello</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><strong>unpack</strong></td>
<td>unzips, untarz, or copies your source folder to the nix store</td>
<td>the source is a tarball, so it is automatically extracted</td>
</tr>
<tr>
<td>2</td>
<td><strong>patch</strong></td>
<td>applies any patches provided in the <code>patches</code> variable</td>
<td>nothing happens</td>
</tr>
<tr>
<td>3</td>
<td><strong>configure</strong></td>
<td>runs <code>./configure</code> if it exists</td>
<td>runs <code>./configure</code></td>
</tr>
<tr>
<td>4</td>
<td><strong>build</strong></td>
<td>runs <code>make</code> if it exists</td>
<td>runs <code>make</code>, the app is built</td>
</tr>
<tr>
<td>5</td>
<td><strong>check</strong></td>
<td>skipped by default</td>
<td>we turn it on, so it runs <code>make check</code></td>
</tr>
<tr>
<td>6</td>
<td><strong>install</strong></td>
<td>runs <code>make install</code></td>
<td>runs <code>make install</code></td>
</tr>
</tbody>
</table>
<p>Since GNU Hello uses Make & <code>./configure</code>, the defaults work perfectly for us in this case. That is why this GNU Hello example is so short!</p>
<h2>Your Packing Future</h2>
<p>While it's amazing to use <code>mkDerivation</code> (so much easier than an RPM spec), there are many cases when you should <em>not</em> use <code>mkDerivation</code>. NixPkgs contains many useful <em>build support</em> functions. These are functions that return derivations, but do a bit of the hard work and boilerplate for you. These make it easy to build packages that meet specified criteria.</p>
<p>We've seen a few <em>build support</em> today; such as <code>fetchFromGitHub</code> or <code>fetchurl</code>. These just functions that return derivations. In these cases, they return derivations to download and extract the source files.</p>
<p>For example, there is <code>pkgs.python36Packages.buildPythonPackage</code>, which is a super easy way to build a python package.</p>
<p>When making packages, there are helpful resources to check:</p>
<ul>
<li><a href="https://nixos.org/nixpkgs/manual/#chap-language-support">Chapter 9. Support for specific programming languages and frameworks</a> of the NixPkgs manual. This documents language specific <em>build support</em> functions.</li>
<li>The <a href="https://github.com/nixOs/nixpkgs">NixPkgs repository</a>. Many packages you make could be similar to packages that already exist. (Note that packages inside of NixPkgs are written in a bit of a different way to ours; since they can't reference NixPkgs directly. Instead, they are structured as functions. If a package depends on another, it takes the other packages as an argument. For more on this subject; see <a href="https://nixos.org/nixos/nix-pills/callpackage-design-pattern.html">Nix Pill 13: Callpackage Design Patten</a>)</li>
</ul>
<h2>Up Next</h2>
<p>In part 5, we'll learn about functions in the Nix programming language. With the knowledge of functions, we can write go on and write our own <em>build support</em> function!</p>
<p>Follow the series <a href="https://github.com/samdroid-apps/nix-articles">on GitHub</a></p>
<p><em>Hero image from <a href="https://github.com/NixOS/nixos-artwork/blob/master/gnome/Gnome_Dark.png">nix-artwork by Luca Bruno</a></em></p>Sam Parkinsonhttps://sam.today/Kryptowährungen für Zahlungenhttp://www.olpclearningclub.org/?p=212018-08-15T09:11:03+00:00Verschlüsselter E-Mail-Service Tutonata testet Kryptowährung für Zahlungen Tutanota akzeptiert nun Bitmünze und einige Altmünzen. Anzeige Tutanota, ein Anbieter eines verschlüsselten E-Mail-Dienstes, hat damit begonnen, Spenden in bitcoin, ether, bitcoin cash und monero entgegenzunehmen, um die Zahlungsabwicklung mit Krypto-Währungen zu testen, … <a href="http://www.olpclearningclub.org/kryptowaehrungen-fuer-zahlungen/">Continue reading <span class="meta-nav">→</span></a>adminhttp://www.olpclearningclub.orgWas ist der wahre Wert von Krypto-Währungen?http://www.olpclearningclub.org/?p=182018-08-11T09:06:19+00:00Dies ist der erste in einer Reihe von Beiträgen, die die Quellen von Werten in Krypto-Währungen identifizieren. Der jüngste Trend bei den Münzangeboten, einschließlich des massiven Anstiegs von Tezos, hat die Krypto-Währungen ins Rampenlicht gerückt. Die Bewertung der weltweit führenden … <a href="http://www.olpclearningclub.org/was-ist-der-wahre-wert-von-krypto-waehrungen/">Continue reading <span class="meta-nav">→</span></a>adminhttp://www.olpclearningclub.orgFour years later…http://mihaelasabin.net/?p=5192018-07-19T15:46:39+00:00In a courageous attempt to restart blogging, I’m cautiously writing my first blog in four years. Minimally. It’s mid-July, when academics contemplate the growing pile of projects that only summer time could bring hopes for completion. Personal deadlines compete with hard deadlines for conference and journal submissions. Fabulous ideas for new teaching strategies planned for […]Mihaela Sabinhttps://mihaelasabin.netEthiopia project: An updatehttps://www.olpcsf.org/266 at https://www.olpcsf.org2018-07-12T05:00:41+00:00<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><p>Andreas Gros, who had presented about his <a href="https://www.olpcsf.org/node/262" target="_blank">upcoming Ethiopia project</a> has now made a trip to Addis Ababa and back. This project has several OLPC NL3 laptops and multiple School Servers. He will be sharing his updates and experiences with us about this project. Please join us!</p>
<p><a href="https://www.eventbrite.com/e/olpc-sf-ethiopia-update-tickets-662403266" target="_blank">RSVP on Eventbrite</a></p>
<p><em>Update: Andi's slides are posted <a href="https://docs.google.com/presentation/d/1tfGIkVo5su5fV_gIZxVp7v4Ynm5FKiubmyWAVhcIKIc/edit?usp=sharing" target="_blank">here</a>. The recoding is also up on YouTube <a href="http://youtu.be/f5DHtPu8X50" target="_blank">here</a>.</em></p>
</div></div></div><ul class="links inline"><li class="addtoany first last"><span><span class="a2a_kit a2a_target addtoany_list" id="da2a_1">
<a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.olpcsf.org%2Fnode%2F266&title=Ethiopia%20project%3A%20An%20update"><img alt="Share/Save" height="16" src="https://www.olpcsf.org/sites/all/modules/addtoany/images/share_save_171_16.png" width="171" /></a>
</span>
<<</span></li>
</ul>svermahttps://www.olpcsf.org/blogCommunity Summit = Open Hack 2018https://www.olpcsf.org/265 at https://www.olpcsf.org2018-04-18T01:59:32+00:00<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><div dir="auto">
<h2 class="rtecenter" dir="auto">
Registration is open. <a href="https://www.eventbrite.com/e/open-hack-sf-2018-san-francisco-state-university-hackathon-tickets-45329250007" target="_blank">Register here</a>.</h2>
<p> </p>
<p>This year's event is a little different. We are joining forces with some of the other projects in the <a href="http://commons.sfsu.edu" target="_blank">Commons</a> space at <a href="http://www.sfsu.edu" target="_blank">San Francisco State University</a>. This year's event is called <a href="http://hackathon.sfsu.edu" target="_blank">Open Hack 2018</a>.</p>
<div dir="auto">
</div>
<div dir="auto">
<img alt="openhack 2018" src="http://hackathon.sfsu.edu/sites/default/files/banner_images/hack_5.png" style="width: 640px; height: 312px;" /></div>
<div dir="auto">
</div>
<div dir="auto">
The event is largely scheduled to run on Saturday (April 28) and Sunday (April 29). Will have a meet-and-greet event on Friday evening (April 27), but the main event will begin on Saturday (April 28).</div>
<div dir="auto">
</div>
<div dir="auto">
The format is as follows:</div>
<div dir="auto">
</div>
<ul dir="ltr"><li>
What we typically refer to as "projects" are called "Challenges" in this format. Anybody can <a href="http://hackathon.sfsu.edu/challenges" target="_blank">Submit a Challenge</a>. When submitting the Challenge, you have to provide us with information about the Challenge itself, existing resources, people involved, and the kinds of skills that you may find helpful in completing this challenge. The goal is that we would want to complete some degree of the Challenge by the time we get to Sunday afternoon.</li>
<li>
The Challenges will be printed and posted up on the wall starting Friday (April 27). On Saturday morning (April 28), people who come in will assign themselves to different challenges. It's quite common for some of the challenges to not have any interested people. That's okay.</li>
<li>
As we start to see a cluster of people collecting on a given Challenge, we will allocate a room for them and then that room becomes their space for the next day and a half. Unlike in the past, where we had timed sessions (typically 75 minutes), these groups get to work on their problem for the entire day Saturday and half day Sunday.</li>
<li>
On Sunday afternoon, they present their progress and future direction. The work (code, content, etc) will have to be made available some place (a repo such as github) via a FOSS, or CreativeCommons, or OpenData license.</li>
<li>
After the presentations, a panel of judges will determine some form of ranking. There may also be some token prizes.</li>
</ul><div dir="auto">
This is somewhat different from what we've done in the past, but given the level of maturity in our projects, and the amount of focus that is needed to work on fixing bugs and building upon what we already have, the hackathon approach seems to be more apt than simple presentations. If you have somebody in mind who cannot be there physically, you can always bring them in online. The rooms are fairly well equipped, with whiteboards, projectors and Internet access. We are also in the process of arranging for other operational logistics.</div>
<div dir="auto">
</div>
<div dir="auto">
In the time being, take a look at the information <a href="http://hackathon.sfsu.edu/" target="_blank">here</a>, the code of conduct <a href="http://hackathon.sfsu.edu/content/code-conduct" target="_blank">here</a> and <a href="http://hackathon.sfsu.edu/challenges" target="_blank">submit a challenge</a>.</div>
<div dir="auto">
</div>
<h2 class="rtecenter" dir="auto">
Registration is open. <a href="https://www.eventbrite.com/e/open-hack-sf-2018-san-francisco-state-university-hackathon-tickets-45329250007" target="_blank">Register here</a>.</h2>
<div dir="auto">
</div>
<div dir="auto">
Also, let us know if you plan to attend, so we can look out for other arrangements as well, as necessary.</div>
<div dir="auto">
</div>
<div dir="auto">
Sameer Verma: <a href="mailto:sverma@sfsu.edu">sverma@sfsu.edu</a></div>
<div dir="auto">
Aaron Borden: <a href="mailto:adborden@live.com">adborden@live.com</a></div>
</div>
<p> </p>
</div></div></div><ul class="links inline"><li class="addtoany first last"><span><span class="a2a_kit a2a_target addtoany_list" id="da2a_2">
<a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.olpcsf.org%2Fnode%2F265&title=Community%20Summit%20%3D%20Open%20Hack%202018"><img alt="Share/Save" height="16" src="https://www.olpcsf.org/sites/all/modules/addtoany/images/share_save_171_16.png" width="171" /></a>
</span>
</span></li>
</ul>svermahttps://www.olpcsf.org/blogGetting the radical realtime transparency ball rollinghttp://blog.melchua.com/?p=34082018-02-09T23:42:05+00:00<p>Getting radical realtime transparency in a project can be slow and frustrating, especially in the beginning. Most folks don’t know this, but in order to <em>have</em> public conversations, leaders need to send out a ridiculous number of private messages to get things rolling. In fact, looking at my own inbox history for the past half-decade, I’ve sent anywhere between 2-20 private messages – <em>on average</em> (not maximum, <em>average</em>) – to get a single public message during the early stages of a project’s “open” life.</p>
<p>You really need to keep poking people in private asking them to put their messages public. It’s thankless and invisible work. It takes a while to build a new cultural habit, and for a while it’s going to seem like you’ll be doing this forever… but trust me, it will come. It’s going to take longer than you want it to, it’s going to take an unexpected route, but keep the faith – it will come.</p>
<p>There are three strategies it’s useful to have up your sleeve for times like this.</p>
<p><strong>Start the conversation in private</strong>, then say something like “hey, this is really good, could you resend it to the public list and I’ll reply there?” This is good for starters if folks are new to the “default to open” concept and are reacting with great nervousness. This nervousness stems from wariness that they may not want to go public with some hypothetical future thing – in effect, worrying about a problem that hasn’t happened yet. Going this route allows beginners in radical transparency to look at something they’ve already written and assess the risk for <em>only</em> that specific situation – no unknowns here, no future commitments. After a few times of going “oh, I guess that retroactive transparency was okay!” it’s much easier to ask people to give “open by default” a chance.</p>
<p><strong>Publicly announce that you’ll only respond to things sent to the public list.</strong> Reply to private emails with a reminder of this. This only works only if the people you’re trying to persuade are unable to route around you. It’s also a bit of a strongarm tactic, not appropriate for all situations and best used in moderation if at all. But if you’re a project manager, or an instructor, or a senior engineer, or something of the sort, you might be able to get away with it – and boy, folks learn fast this way.</p>
<p><strong>Get others to help you with the nudges-to-public.</strong> Those 20 private emails to get a single public email? No reason why you’ve got to be the only one doing it. Train others to become Agents of Transparency as soon as you can, especially if they were once on the other side of the conversation. To begin with, ask them to work specific mailing lists, specific people, or specific conversation threads into the public eye – coach them from behind if needed. After a little while, they’ll be able to do it on their own – then just ask them to keep an eye out in general, and hey presto!</p>
<p>The key thing to keep in mind is that this is an investment. You’re putting resources into something that may not see returns for a little while. But the returns will come, and they’ll be worth it – when a project tips over into living, breathing, and practicing true realtime transparency, the results of the culture shift can be stunningly refreshing.</p>
<p>Keep going.</p>Melhttp://blog.melchua.comCreating a super simple derivation - Learning Nix pt 3https://sam.today/blog/creating-a-super-simple-derivation-learning-nix-pt-32018-02-01T11:50:41+00:00<p>This guide will build on the previous <a href="https://www.sam.today/blog/so-variables-are-a-thing-learning-nix-pt-2/">two</a> <a href="https://www.sam.today/blog/environments-with-nix-shell-learning-nix-pt-1/" title="Environments with Nix Shell - Learning Nix pt 1">guides</a>, and look at creating your first useful <em>derivation</em> (or "package").</p>
<p>This will teach you how to package a shell script.</p>
<h2>Packaging a shell script (with no dependencies)</h2>
<p>We can use the function <code>pkgs.writeShellScriptBin</code> from NixPkgs, which
handles generating a <em>derivation</em> for us.</p>
<p>This function takes 2 arguments; what name you want the script to have in your PATH, and a string being the contents of the script.</p>
<p>So we could have:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"helloWorld"</span> <span style="color: #BA2121;">"echo Hello World"</span>
</pre></div>
</div>
<p>That would create a shell script named "helloWorld", that printed "Hello World".</p>
<p>Let's put that in an environment; so we can use it in <code>nix-shell</code>. Write this to
<code>test.nix</code>:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #408080; font-style: italic;"># Use the let-in clause to assign the derivation to a variable</span>
<span style="color: #19177C;">myScript =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"helloWorld"</span> <span style="color: #BA2121;">"echo Hello World"</span>;
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation <span style="color: #008000; font-weight: bold;">rec</span> {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"test-environment"</span>;
<span style="color: #408080; font-style: italic;"># Add the derivation to the PATH</span>
<span style="color: #19177C;">buildInputs =</span> [ myScript ];
}
</pre></div>
</div>
<p>We can then enter the <code>nix-shell</code> and run it:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>sam@vcs ~> nix-shell test.nix
<span style="color: #666666;">[</span>nix-shell:~<span style="color: #666666;">]</span>$ helloWorld
Hello World
</pre></div>
</div>
<p>Great! You've successfully made your first package. If you use NixOS, you can modify your system configuration and include it in your <code>environment.systemPackages</code> list. Or you can use it in a <code>nix-shell</code> (like we just did). Or whatever you want! Despite being one line of code, this is a real Nix <em>derivation</em> that we can use.</p>
<h2>Referencing other commands in your script</h2>
<p>For this example/section; we are going to look at something more complex. Say you want to write a script to find your public IP address. We're basically going to run this command:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>curl http://httpbin.org/get | jq --raw-output .origin
</pre></div>
</div>
<p>But running this requires dependencies; you need <code>curl</code> and <code>jq</code> installed. How do we specify dependencies in Nix?</p>
<p>Well, we could just add them to the build input for the shell:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #408080; font-style: italic;"># DO NOT USE THIS; this is a BAD example</span>
<span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #408080; font-style: italic;"># This is the WORST way to do dependencies</span>
<span style="color: #408080; font-style: italic;"># We just specify the derivation the same way as before</span>
<span style="color: #19177C;">simplePackage =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"whatIsMyIp"</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> curl http://httpbin.org/get | jq --raw-output .origin</span>
<span style="color: #BA2121;"> ''</span>;
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation <span style="color: #008000; font-weight: bold;">rec</span> {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"test-environment"</span>;
<span style="color: #408080; font-style: italic;"># Then we add curl & jq to the list of buildInputs for the shell</span>
<span style="color: #408080; font-style: italic;"># So curl and jq will be added to the PATH inside the shell</span>
<span style="color: #19177C;">buildInputs =</span> [ simplePackage pkgs<span style="color: #666666;">.</span>jq pkgs<span style="color: #666666;">.</span>curl ];
}
</pre></div>
</div>
<p>This would work OK; you could go <code>nix-shell</code> then run <code>whatIsMyIp</code> and get your IP.</p>
<p>But it has a problem. The script would work unpredictably. If you took this package, and used it outside of the nix-shell, it wouldn't work - because you didn't have the dependencies. It also pollutes the environment of the end user; as they need to have a compatible version jq and curl in their path.</p>
<p>The more eloquent way to do this is to reference the exact packages in the shell script:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold;">with</span> <span style="color: #008000;">import</span> <nixpkgs> {};
<span style="color: #008000; font-weight: bold;">let</span>
<span style="color: #408080; font-style: italic;"># The ${...} is for string interpolation</span>
<span style="color: #408080; font-style: italic;"># The '' quotes are used for multi-line strings</span>
<span style="color: #19177C;">simplePackage =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"whatIsMyIp"</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>pkgs<span style="color: #666666;">.</span>curl<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/curl http://httpbin.org/get \</span>
<span style="color: #BA2121;"> | </span><span style="color: #BB6688; font-weight: bold;">${</span>pkgs<span style="color: #666666;">.</span>jq<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/jq --raw-output .origin</span>
<span style="color: #BA2121;"> ''</span>;
<span style="color: #008000; font-weight: bold;">in</span>
stdenv<span style="color: #666666;">.</span>mkDerivation <span style="color: #008000; font-weight: bold;">rec</span> {
<span style="color: #19177C;">name =</span> <span style="color: #BA2121;">"test-environment"</span>;
<span style="color: #19177C;">buildInputs =</span> [ simplePackage ];
}
</pre></div>
</div>
<p>Here we reference the dependency package inside the derivation. To understand what this is doing, we need to see what the script is written to disk as. You can do that by running:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span>sam@vcs ~> nix-shell test.nix
[nix-shell:~]$ cat $(which whatIsMyIp)
</pre></div>
</div>
<p>Which gives us:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #408080; font-style: italic;">#!/nix/store/hqi64wjn83nw4mnf9a5z9r4vmpl72j3r-bash-4.4-p12/bin/bash</span>
/nix/store/pkc7g36m95jymw3ga2i7pwrykcfs78il-curl-7.57.0-bin/bin/curl http://httpbin.org/get <span style="color: #BB6622; font-weight: bold;">\</span>
| /nix/store/znqn0z505i0bm1aiz2jaj1ki7z4ck1sv-jq-1.5/bin/jq --raw-output .origin
</pre></div>
</div>
<p>As we can see, all the binaries referenced in this script are absolute paths, something like <code>/nix/store/...../bin/name</code>. The <code>/nix/store/...</code> is the path of the derivation's (package's) build output.</p>
<p>Due to the pure and functional of Nix, that path will be the same on every machine that ever runs Nix. Replacing fuzzy references (eg. <code>jq</code>) with definitive and unambiguous ones (<code>/nix/store/...</code>) is a core tenant of Nix; as it means packages come will all their dependencies and don't pollute your environment.</p>
<p>Since it is an absolute path, that script doesn't rely on the PATH environment variable; so the script can be used anywhere.</p>
<p>When you reference the path (like <code>${pkgs.curl}</code> from above), Nix automatically knows to download the package into the machine whenever your package is downloaded.</p>
<blockquote>
<p><strong>Why do we do it like this?</strong> Ultimately, the goal of package management is to make consuming software easier. Creating less dependencies on the environment that runs the package makes it easier to use the script.</p>
</blockquote>
<p>So the TL;DR is:</p>
<div class="code"><div class="highlight" style="background: #f8f8f8;"><pre style="line-height: 125%;"><span></span><span style="color: #408080; font-style: italic;"># BAD; not very explicit</span>
<span style="color: #408080; font-style: italic;"># - we need to remember to add curl to the environment again later</span>
<span style="color: #19177C;">badPackage =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"something"</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> curl ...</span>
<span style="color: #BA2121;">''</span>;
<span style="color: #408080; font-style: italic;"># GOOD: Nix will do the magic for us</span>
<span style="color: #19177C;">goodPackage =</span> pkgs<span style="color: #666666;">.</span>writeShellScriptBin <span style="color: #BA2121;">"something"</span> <span style="color: #BA2121;">''</span>
<span style="color: #BA2121;"> </span><span style="color: #BB6688; font-weight: bold;">${</span>pkgs<span style="color: #666666;">.</span>curl<span style="color: #BB6688; font-weight: bold;">}</span><span style="color: #BA2121;">/bin/curl ...</span>
<span style="color: #BA2121;">''</span>;
</pre></div>
</div>
<h1>Functions make creating packages easier</h1>
<p>One of the main lessons from this process is that when you use functions (like <code>pkgs.writeShellScriptBin</code>) to create packages, it is pretty simple. Compare this to a traditional RPM or DEB workflow; where you would have needed to write a long spec file, put the script in a separate file, and fight your way through too much boilerplate.</p>
<p>Luckily; NixPkgs (the standard library of packages) includes a whole raft of functions that make packaging easier for specific needs. Most of these are in the <a href="https://github.com/NixOS/nixpkgs/tree/master/pkgs/build-support">build support</a> folder of the NixPkgs repository. These are defined in the Nix expression language; the same language you are learning to write. For example, <a href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L61">the pkgs.writeShellScriptBin function</a> is defined as a ~10 line function.</p>
<p>Some of the more complex build support functions are documented in <a href="https://nixos.org/nixpkgs/manual/#chap-language-support">the NixPkgs manual</a>. There is currently documentation for packaging Python, Go, Haskell, Qt, Rust, Perl, Node and many other types of applications.</p>
<p>Some of the more simple build support functions (like <code>pkgs.writeShellScriptBin</code>) are not documented (when I write this). Most of them are self explanatory, and can be found by reading their names in the <a href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix">so called <em>trivial builders</em> file</a>.</p>
<h2>Up Next</h2>
<p><a href="https://www.sam.today/blog/derivations-102-learning-nix-pt-4">Derivations 102 - Learning Nix pt
4</a></p>
<p>Follow the series <a href="https://github.com/samdroid-apps/nix-articles">on GitHub</a></p>
<p><em>Hero image from <a href="https://github.com/NixOS/nixos-artwork/blob/master/wallpapers/nix-wallpaper-mosaic-blue.png">nix-artwork by Eric Sagnes</a></em></p>Sam Parkinsonhttps://sam.today/Welcome Page UX Concepthttp://sugarlabs.github.io/edit-fonts-activity/welcome-page-ux-concept2016-07-30T18:30:00+00:00<p>This is just an idea I had last night for improving the welcome screen UX, if it’s too much work or Dave and Yash don’t like it I understand. However, I may try to code it myself for fun if Yash doesn’t have time. :-)</p>
<p>My fear is that when users start the Edit Fonts activity for the first time they will be be lost and not understand what to do. Some users might not even have a basic understand of what vector drawing is or how a font is made. This welcome screen will at least give the users a basic idea about how to use the activity. Most importantly, this makes the first screen visualy interesting, interactive and fun. Many users may not continue with the activity if the first page is dull and boring.</p>
<p>I’m proposing that the welcome screen have 4 options, represented by icons and text, plus an editable .glyph that reads “Edit Fonts” in the Geo typeface. The Edit-Fonts logotype will be one .glyph file that is only loaded and never saved. see below:</p>
<p><img alt="UX concept 01" src="http://sugarlabs.github.io/edit-fonts-activity/files/img/wireframe_concept_01_welcome_page.svg" /></p>
<p><img alt="UX concept 02" src="http://sugarlabs.github.io/edit-fonts-activity/files/img/wireframe_concept_02_welcome_page.svg" /></p>
<p>I have added a Geo-Regular.ufo file to the gh-pages repo with a special “editfonts.glyph” logotype:</p>
<p><a href="https://github.com/sugarlabs/edit-fonts-activity/tree/gh-pages/files/fonts/Geo-Regular.ufo">https://github.com/sugarlabs/edit-fonts-activity/tree/gh-pages/files/fonts/Geo-Regular.ufo</a></p>
<p><img alt="editfonts.glyph" src="http://sugarlabs.github.io/edit-fonts-activity/files/img/wireframe_concept_welcome_page_03.png" /></p>
<p>There are two neat things about this approach. First, it uses components we already have, the only work will be laying out the page, which Dave or I can attempt if Yash is too busy. Second, if the user never realizes that the edit fonts logotype is editable, it still functions as a logotype. A similar UX design pattern was used for the start screen of the game Super Mario 64, see below:</p>
<p><a href="https://youtu.be/eBotFor1Xlw">Mario 64 easter-egg</a></p>Eli Heuerhttp://sugarlabs.github.io/edit-fonts-activity/Continuous Integration With Travis and flake8http://sugarlabs.github.io/edit-fonts-activity/flake82016-07-12T18:30:00+00:00<p>Last Saturday (July 9th) Eli and I met up to review the codebase, and the main issue I identified was that Travis was not set up with flake8 to test the codebase was conforming to the <a href="https://www.python.org/dev/peps/pep-0008/">pep8 guidelines</a>.</p>
<p>I’d filed <a href="https://github.com/sugarlabs/edit-fonts-activity/issues/17">Issue #17</a> for this, back at the start of the project on May 19.
Yash had started to develop the <code class="highlighter-rouge">[.travis.yml](https://github.com/sugarlabs/edit-fonts-activity/blob/gh-pages/.travis.yml)</code> file to build a .xo bundle but hadn’t complete this just yet, so I commended out most of the code and what remained is very simple:</p>
<div class="language-yml highlighter-rouge"><pre class="highlight"><code><span class="c1"># this makes travis run a fast Docker container system</span>
<span class="s">sudo</span><span class="pi">:</span> <span class="s">false</span>
<span class="c1"># we use python 2.7</span>
<span class="s">language</span><span class="pi">:</span> <span class="s">python</span>
<span class="s">python</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s2">"</span><span class="s">2.7"</span>
<span class="c1"># we need to install flake8 to use it</span>
<span class="s">before_install</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s2">"</span><span class="s">pip</span><span class="nv"> </span><span class="s">install</span><span class="nv"> </span><span class="s">flake8"</span>
<span class="c1"># we check the codebase</span>
<span class="s">script</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s2">"</span><span class="s">flake8</span><span class="nv"> </span><span class="s">--statistics</span><span class="nv"> </span><span class="s">--ignore=E402</span><span class="nv"> </span><span class="s">--exclude=defcon,extractor,fontTools,fontmake,robofab,ufo2ft,ufoLib,snippets</span><span class="nv"> </span><span class="s">."</span>
</code></pre>
</div>
<p>You can see there’s a few arguments passed that are pretty simple.</p>
<p>Stastics prints the number of occurences of each error, so you can fix the most common issues across the codebase first.</p>
<p>E402 is about the order of imports, but since we need to import gi to version later imports, we can’t adhere to that rule, so we ignore it.</p>
<p>We also exclude all the third party libraries, and our snippets.</p>
<p>Eli and I worked together on this and I finished it up on Sunday in <a href="https://github.com/sugarlabs/edit-fonts-activity/pull/65">Pull Request #65</a></p>
<p>Yash had already set up Travis configuration, at <a href="https://travis-ci.org/sugarlabs/edit-fonts-activity">https://travis-ci.org/sugarlabs/edit-fonts-activity</a>, so once this was merged, our button went green:</p>
<p><img alt="travis button is green" src="http://sugarlabs.github.io/edit-fonts-activity/files/img/2016-07-13-travis-button.png" /></p>
<p>Finally I added a <a href="https://github.com/sugarlabs/edit-fonts-activity/blob/master/CONTRIBUTING.md">CONTRIBUTING.md</a> file that explains how to use it.</p>
<p>I’ll get a similar travis set up for the gh-pages branch too.</p>
<p>Perhaps we could also set up a git hook that runs the flake8 command on each commit…</p>Dave Crosslandhttp://sugarlabs.github.io/edit-fonts-activity/