Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

May 17 2016


Logic Gates!


Not - “0 in, 1 out; 1 in, 0 out.  Whatever you put in, you don’t get out.”

Buffer - “If you take the not of not, you get what you put in - 0 in, 0 out, 1 in, 1 out.”

NAND - “Both inputs must be brought up to 1 to lower the output to 0.”

AND - “If you negate the result of Nand, you get And.  Both inputs must be brought up to 1 to raise the output up to 1.”

OR - “If you not both inputs, and then Nand them together, you get Or.  If either input is raised to 1, the output raises to 1.”

NOR - “Negate both inputs, nand them together, and negate the output.”

XOR - “Xor is complicated - The large weight ands the inputs together.  The medium weights negate the inputs, but are pulled up by the large one when both are 1.  When you nor those together, you get Xor “

XNOR - “This is comparatively simple - just negate the output of Xor, and you’re there!”

Video Source

Images and Text Stolen from Imgur!

March 29 2016


changes to npm’s unpublish policy


One of Node.js’ core strengths is the community’s trust in npm’s registry. As it’s grown, the registry has filled with packages that are more and more interconnected.

A byproduct of being so interdependent is that a single actor can wreak significant havoc across the ecosystem. If a publisher unpublishes a package that others depend upon, this breaks every downstream project that depends upon it, possibly thousands of projects.

Last Tuesday’s events revealed that this danger isn’t just hypothetical, and it’s one for which we already should have been prepared. It’s our mission to help the community succeed, and by failing to protect the community, we didn’t uphold that mission.

We’re sorry.

This week, we’ve seen a lot of discussion about why unpublish exists at all. Similar discussions happen within npm, Inc. There are important and legitmate reasons for the feature, so we have no intention of removing it, but now we’re significantly changing how unpublish behaves and the policies that surround it.

These changes, which incorporate helpful feedback from a lot of community members, are intended to ensure that events like Tuesday’s don’t happen again.

Our new policy

Going forward, if you try to unpublish a given package@version:

  • If the version is less than 24 hours old, you can unpublish it. The package will be completely removed from the registry. No new packages can be published using the same name and version.

  • If the version is older than 24 hours, then the unpublish will fail, with a message to contact .

  • If you contact support, they will check to see if removing that version of your package would break any other installs. If so, we will not remove it. You’ll either have to transfer ownership of the package or reach out to the owners of dependent packages to change their dependency.

  • If every version of a package is removed, it will be replaced with a security placeholder package, so that the formerly used name will not be susceptible to malicious squatting.

  • If another member of the community wishes to publish a package with the same name as a security placeholder, they’ll need to contact  npm will determine whether to grant this request. (Generally, we will.)


This can be a bit difficult to understand in the abstract. Let’s walk through some examples.

  1. Brenna is a maintainer of a popular package named “supertools”. Supertools has 3 published versions: 0.0.1, 0.3.0, and 0.3.1. Many packages depend on all the versions of supertools, and, across all versions, supertools gets around 2 million downloads a month.

    Brenna does a huge refactor and publishes 1.0.0. An hour later, she realizes that there is a huge vulnerability in the project and needs to unpublish. Version 1.0.0 is less than 24 hours old. Brenna is able to unpublish version 1.0.0.

    Embarrassed, Brenna wants to unpublish the whole package. However, because the other versions of supertools are older than 24 hours Brenna has to contact to continue to unpublish. After discussing the matter, Brenna opts instead to transfer ownership of the package to Sarah.

  2. Supreet is the maintainer of a package named “fab-framework-plugin”, which has 2 published versions: 0.0.1 and 1.0.0. fab-framework-plugin gets around 5,000 downloads monthly across both versions, but most packages depend on it via ^1.0.0.

    Supreet realizes that there are several serious bugs in 1.0.0 and would like to completely unpublish the version. He attempts to unpublish and is prompted to talk to because the 1.0.0 version of his package is older than 24 hours. Instead, Supreet publishes a new version with bug fixes, 1.0.1.

    Because all dependents are satisfied by 1.0.1, support agrees to grant Supreet’s request to delete 1.0.0.

  3. Tef works for Super Private Company, which has several private   packages it use to implement static analysis on Node.js packages.

    Working late one night, Tef accidentally publicly publishes a private package called “@super-private-company/secrets”. Immediately noting his mistake, Tef unpublishes secrets. Because secrets was only up for a few minutes — well within the 24 window for unrestricted unpublishes — Tef is able to successfully unpublish.

    Because Tef is a responsible developer aware of security best-practices, Tef realizes that the contents of secrets have been effectively disclosed, and spends the rest of the evening resetting passwords and apologizing to his coworkers.

  4. Charlotte is the maintainer of a package called “superfoo”. superfoo is a framework on which no packages depend. However, the consultancy Cool Kids Club has been using it to develop their applications for years. These applications are private, and not published to the registry, so they don’t count as packages that depend on superfoo.

    Charlotte burns out on open source and decides to unpublish all of their packages, including superfoo. Even though there are no published dependents on superfoo, superfoo is older than 24 hours, and therefore Charlotte must contact to unpublish it.

    After Charlotte contacts support, insisting on the removal of superfoo, npm deprecates superfoo with a message that it is no longer supported. Whenever it is installed, a notice is displayed to the installer.

    Cool Kids Club sees this notice and republishes superfoo as “coolfoo”. Cool Kids Club software now depends on “coolfoo” and therefore does not break.

Changes to come

This policy is a first step towards balancing the rights of individual publishers with npm’s responsibility to maintain the social cohesion of the open source community.

The policy still relies on human beings making human decisions with their human brains. It’s a fairly clear policy, but there is “meat in the machine”, and that means it will eventually reach scaling problems as our community continues to grow.

In the future, we may extend this policy (including both the human and automated portions) to take into account such metrics as download activity, dependency checking, and other measures of how essential a package is to the community.

Moving forward

In balancing individual and community needs, we’re extremely cognizant that developers feel a sense of ownership over their code. Being able to remove it is a part of that ownership.

However, npm exists to facilitate a productive community. That means we must balance individual ownership with collective benefit.

That tension is at the very core of open source. No package ecosystem can survive without the ability to share and distribute code. That’s why, when you publish a package to the registry, you agree to our Terms of Service. The key lines are:

Your Content belongs to you. You decide whether and how to license it. But at a minimum, you license npm to provide Your Content to users of npm Services when you share Your Content. That special license allows npm to copy, publish, and analyze Your Content, and to share its analyses with others. npm may run computer code in Your Content to analyze it, but npm’s special license alone does not give npm the right to run code for its functionality in npm products or services.

When Your Content is removed from the Website or the Public Registry, whether by you or npm, npm’s special license ends when the last copy disappears from npm’s backups, caches, and other systems. Other licenses, such as open source licenses, may continue after Your Content is removed. Those licenses may give others, or npm itself, the right to share Your Content with npm Services again.

These lines are the result of a clarification that we asked our lawyer to make for the purposes of making this policy as understandable as possible. You can see that in this PR.

We don’t try to hide our policies; in fact, we encourage you to review their full list of changes and updates, linked from every policy page.

We acknowledge that there are cases where you are justified in wanting to remove your code, and also that removing packages can cause harm to other users. That’s exactly why we are working so hard on this issue.

This new policy is just the first of many steps we’ll be taking. We’ll be depending on you to help us consider edge cases, make tough choices, and continue building a robust ecosystem where we can all build amazing things.

You probably have questions about this policy change, and maybe you have a perspective you’d like to share, too.

We appreciate your feedback, even when we can’t respond to all of it. Your participation in this ecosystem is the core of its greatness. Please keep commenting and contributing: you are an important part of this community!

Please post comments and questions here. We’ve moved to a Github issue for improved moderation.

March 26 2016


March 25 2016


Good bye, Tumblr. Hello,

Tumblr has made it harder and harder for me to post uisng Markdown, so I decided to give it up and run a self-hosted blog under a new name:

50 Lines of Code is built upon a bunch of Markdown files that are transformed into HTML using SuSi.

For now, I’ll continue cross-posting the blog posts here, but at some point, you’ll find new content exclusively on

– Thanks for all the fish

February 06 2016

7308 5ee5

Most people right before commenting in the internet

December 21 2015


Wrapping up ‘15

Now that I am winding down a bit, I get to take a look back at what’s been a wonderful, crazy year. I would like to take this opportunity to share with you, chronologically, the many people I got to meet or meet again, the things that happened and left their impression on me and take a glimpse into 2016. So if you wonder what’s been on my mind: read on.

At Archilogic we’ve made a range of big leaps forward. * We’ve rolled out Virtual Reality support for Google Cardboard and Oculus Rift * We improved our realistic lighting pipeline, which is now faster, easily scalable and much more flexible. * We have and still constantly do improve on our user experience, giving it faster loading times, more intuitive controls and better visual quality * Besides OBJ we can now also export to DXF * We have improved our image recognition to create 3D models from 2D floorplans * We are about to launch a few amazing features that I can’t talk about yet ;-) * We contributed back to open source, for instance to jQuery and Three.js

I got to play with the LEAP Motion, the Myo, the Oculus Rift and Google Tango as well.

I also had the humbling experience of visiting the LHC at CERN and go inside this impossible structure.

Also, we’ve grown our amazing team with great new members - it’s a pleasure working with each and every one of our team members for me!

As a bonus, I got to play around with Open Data from Zurich:

I am also so absolutely blown away and grateful to have a chance to meet so many bright, kind and amazing people and talk to so many different communities all over the world.

It’s been a dazzling 21 events in 17 different countries I got to visit this year! I am out of words for how humbled I am by this - I really hope that I could provide something insightful, useful and fun for each of these. I also met a lot of old and new friends and have been inspired in many surprising and different ways.

I’d like to highlight a few events that stand out for me personally, but that doesn’t mean the others aren’t extraordinary and great, just a few stood out a bit more: RSConf in Minsk, DaFED, JSConf UY, MediterraneaJS and JSConf US (Last Call).

  • RSConf was well-done, full of great talks and workshops and speakers, organisers and attendees where great, bright folks and it was a pleasure being among them
  • DaFED is an exceptional regular meetup run by amazing and lovely folks that gave me an incredibly warm welcome and I am proud to have been part of this incredible event where great minds and enthusiasm come together to create a better future for their local community
  • JSConf Uruguay had been so supportive to me and managed to balance feeding our brains with inspiring content and making everybody mingle and chat - it has been a blast!
  • Mediterranea JS was a well-crafted meeting of a lovely bunch of people in Barcelona to discuss tech and community matters that took the best of many other events and combined it in a fruitful gathering that felt like a family meeting, despite the broad range of topics covered
  • JSConf US, the last call, had all the feels. The brilliant content that pushed things to the edge combined with what matters most in all our lives: Lovely people. It’s been a very special event in that it discussed a lot of issues that are bigger than tech. It was focused on enabling people to unfold their full potential, together, as a community. And last but not least: It was a farewell to Laura and Chris, who made all this happen and inspired so many other events and communities to come up and prosper.

So all in all, it’s been a blast!

I wish you all a calm and joyful time and a good start to a great 2016! Martin

September 18 2015


Look ma, no canvas! Server-side 3D rendering with node.js and Three.js

Sweet surprise: SoftwareRenderer

If you wonder if and how you can render a Three.js 3D scene using node.js on the server, you may have been thinking about using a canvas module, such as Automattic/Canvas or run a headless browser such as Phantom or even a full-blown Firefox or Chrome on xvfb.

But you don’t need to, thanks to a modified SoftwareRenderer.

The following Gif has been rendered on a server in 1.5 seconds:

Using the new SoftwareRenderer

You find the modified SoftwareRenderer on npm and Github and it’s working in the browser as well as on the server with node.js.

Here’s an example that renders a spinning cube (or a single frame of the cube, if you’re not in a browser) and counts the coloured pixels. This is a simple demonstration of how the renderer is used:

The difference to other renderers is that render() returns an object similar (but not exactly) ImageData:

  data: Uint8ClampedArray(...), // pixels as RGBARGBARGBA... array
  width: Number, // width in pixels
  height: Number // height in pixels

The data coming from render can be generated and used both in browser as well as on the server. So it’s “isomorphic” in current lingo (I’d prefer “universal”).

Adventure Time!

With the possibility to render off-GPU and on the server, we get a bunch of interesting possibilities like render in a web worker or…. render an animated GIF from a THREE.Scene on the server:


The original THREE.SoftwareRenderer is part of the Three.js examples but still uses a canvas element.

When going through the sources I found that it actually uses array operations on the pixel array from the canvas context, so I decided to modify it a bit to not create (or use) a canvas and a 2D context from it, but just create and use a ray Uint8ClampedArray which, to my delight, worked just fine.

The original source can be found here.

So, yeah, check it out on Github and NPM!

July 08 2015


July 07 2015


July 04 2015

Reposted bynewtallicattykitewalk

July 02 2015

9105 87ed 350
Reposted frompudelkozniczym pudelkozniczym viarainbows rainbows
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.
Get rid of the ads (sfw)

Don't be the product, buy the product!