2016 week 47 in programming

Programmers are having a huge discussion about the unethical and illegal things they’ve been asked to do

Dozens of people have already been killed by faulty software in cars, while hundreds of people have been killed from faulty software during air travel. “Uncle” Bob MartinYouTube/Expert Talks MobileBut Martin pointed out, “The weird thing is, it was software developers who wrote that code. It was us. Some programmers wrote cheating code. Do you think they knew? I think they probably knew.” Sourour’s “Ashamed” post went viral on Hacker News and Reddit and it unleashed a long list of confessions from programmers about the unethical and, sometimes, illegal things they’ve been asked to do. Programmers then wrote scripts to help the company’s salespeople target these people. Now, he says, these same programmers are “Working on startups that scoop up massive amounts of people’s location data.” YouTube/“Uncle” Bob Martin - “The Future of Programming”Another programmer was hired to write software for a radio device and was asked to make it use channels reserved for emergency services because this would make the device operate faster. He warned, if programmers don’t start to govern themselves, after that apocalypse event that kills thousands of people occurs, legislators will do it for them, dictating everything about their jobs, down to the languages they are allowed to use.

Let’s Encrypt Everything

The performance penalty of HTTPS is gone HTTPS arguably performs better than HTTP on modern devices. Historically these certificates have been issued by certificate authorities, and they were at least $30 per year per website, sometimes hundreds of dollars per year. Let’s Encrypt is a 501.3©(3) non-profit organization supported by the Linux Foundation. As a company, we’ve donated a Discourse hosted support community, and a cash amount that represents how much we would have paid in a year to one of the existing for-profit certificate authorities to set up HTTPS for all the Discourse websites we host. Estimate how much you would have paid for any free SSL certificates you obtained from Let’s Encrypt, and please donate that amount to Let’s Encrypt. If you work for a large company, urge them to sponsor Let’s Encrypt as a fundamental cornerstone of a safe web. If you believe in an unalienable right to privacy on the Internet for every citizen in every nation, please support Let’s Encrypt.

Powershell to replace CMD as windows default shell (Inside 14971)

Today we are excited to be releasing Windows 10 Insider Preview Build 14971 for PC to Windows Insiders in the Fast ring. Read EPUB books in Microsoft Edge: The reading experience will get even better with the Windows 10 Creators Update! In addition to providing a great reading experience for PDF files - you can now read any unprotected e-book in the EPUB file format with Microsoft Edge. Bringing 3D to Everyone via the Paint 3D Preview app: Starting with this build and going forward, the Paint 3D Preview app is now included as part of Windows 10. Remix 3D Preview, the community counterpart to Paint 3D Preview, is expanding to Austria, Belgium, Denmark, Germany, Ireland, Netherlands, Norway, Sweden, and Switzerland for Windows Insiders today! Remix 3D Preview is currently only available in English but we will continue to expand our region and language support. For those who prefer to use Command Prompt, you can opt out of the WIN + X change by opening Settings > Personalization > Taskbar, and turning “Replace Command Prompt with Windows PowerShell in the menu when I right-click the Start button or press Windows key+X” to “Off”. As we have previously announced we are working on the Windows Holographic Shell that is going to be included in the upcoming Windows 10 Creators Update. We love seeing our Windows Insiders organize #WINsiders4Good events on their own! This is exactly why we created the DIY kit and we love seeing you all use it to build relationships and solve problems in your communities.

The Unfixable Bug

Before modeling a pretty car I started with something simpler: a box. I coded up a simple red box and dropped it into the terrain. At one point I changed the color of the box to white, relaunched the game and - there it was! A nice little box sitting in the landscape. Why would the box only be visible when it has a certain color? I checked the pixel shader. Everything seemed OK - but why was my box invisible when it was red? And only when it was red? I could find it when it was blue, white, black and purple. I tried resetting the color to red again and - WTH!? - there it was! I was back where I started code-wise, but now the box was visible again. As it turned out, the reason I couldn’t see the red box in the green landscape was simple: I am red-green color blind.

A list of Computer Science courses with video lectures

None

Information wants to be free, so we’re giving away our 400+ intro Java lectures / assignments

None

Computer Science Legend, Rear Adm. Grace Hopper, Posthumously Receives Presidential Medal of Freedom

Grace Murray Hopper, best known for her advancements in computer programming and data processing, was awarded the Presidential Medal of Freedom posthumously by President Barack Obama during a White House ceremony Nov. 22. “While the women who pioneered software were often overlooked the most prestigious award for young computer scientists now bear her name,” he said, referring to the annual Grace Murray Hopper Award for Outstanding Young Computer Professionals, established in 1971 by the Association for Computing Machinery. To accept the award on Hopper’s behalf was her grand-niece Deborah Murray, who stood alongside the president as the citation was read, “As a child who loved disassembling alarm clocks Rear Adm. Grace Murray Hopper found her calling early. Known today as the”queen of code” Grace Hopper’s work helped make the coding language more practical and accessible…Amazing Grace was committed to making the language of computer programming more universal. Today we honor her contributions to computer science and the sense of possibility she inspired for the generations of young people. There, she completed groundbreaking work in computer technology, including producing a model of the electronic computer, the Mark I, and introducing the word “Bug” to describe a computer malfunction. Often referred to as the “Mother of computing,” Hopper was instrumental in the creation of UNIVAC, the first all-electronic digital computer. Tighe, who has described Hopper as a role model, added, “Quite simply, and on many levels, Rear Adm. Grace Murray Hopper is an inspiration for us all. As a pioneer in computing, as a woman leading the way in the STEM field at a time when that was almost completely unheard of, and as a dedicated naval officer, she paved the way so that all of us who followed could succeed. All of us in the Information Warfare Community owe her our gratitude. The award of the Presidential Medal of Freedom is both well-earned and well deserved!”.

Super Mario Bros. 3 - Wrong Warp

How does the wrong warp actually work in Super Mario Bros. PATRONSThank you everyone for your help! It means so much to me.

Margaret Hamilton, Apollo Software Engineer, Awarded Presidential Medal of Freedom

None

A 4-bit Calculator made in cardboard and marble

LOGIC. LOGIC is a fully functional 4-bit calculator made entirely out of cardboard, hot glue and marbles. You place your input numbers as binary in the inputs, a marble is a one, no marble is a zero. If there is no marble in: no marble outIf there is one marble in: no marble outIf there is two marble in: one marble out. If you have one marble than it passIf you have two marbles then they should cancel out. If there is one marble: make it fall in the first outputIf there is two marbles: make one of them fall in the second output. The first marble flip a little piece of cardboard, so if there is a second marble it fills fall in a hole. If there is one marble: make it fall in the first outputIf there is two marbles: make one of them fall in the second outputIf there is three marbles: make one the fall in the first output and another in the second.

Humble Book Bundle: O’Reilly Unix books

We called up our friends at O’Reilly to put together this bundle of Unix resources for all! Find your nutshell reference, your pocket guide, and your power tools here. O’Reilly has a bonus for us, too: Enter your email address to immediately receive an excerpt from “Ten Steps to Linux Survival” by Jim Lehmer. Learn Linux diagnostic and recovery tasks so you can jump in and fix a system problem when your site goes down! Together, these books would cost over $500. Here at Humble Bundle you name your price of $1 or more! These books are available in PDF, ePUB, and MOBI formats, meaning you can read them anywhere at any time. Instructions and a list of recommended reading programs can be found here. If you like what we do, you can leave us a Humble Tip too!

“Rust’s standard hash table types could go quadratic.” [x-post /r/rust]

To understand the bug, we’re going to need to understand the hash table strategy used by Rust’s standard hash tables. A major challenge in any general-purpose hash table implementation is how to handle hash collisions; If you have a table with N buckets, eventually you’ll get two elements with the same value of hashcode%N, and what do you do? In hash tables, “Open addressing” refers to the technique of, upon encountering a collision, somehow selecting an alternate location in the hash table. The problem occurs because iteration over a hash table procedes by walking the backing array of the hash table directly. They’re also speculating about a more fundamental fix to the hash table implementation, so that users who drop in a different hash algorithm are not again vulnerable. One proposal is that hash tables ought to retain their insertion order, since this bug is much less likely to happen if tables do not leak their hash order. Rust’s hash tables were very carefully thought by experienced developers well-versed in the literature and practice of deliberate quadratic attacks on hash tables.

The Balanced Ternary Machines of Soviet Russia

“Perhaps the prettiest number system of all is the balanced ternary notation” - Donald E. Knuth, The Art of Computer Programming, Vol. Enter Setun, a balanced ternary computer developed in 1958 by a small team led by Nikolay Brusentsov at the Moscow State University. In its balanced form, we can think of the ternary values as being “Balanced” around the mid-point of 0. In balanced ternary, as we’re about to discover, to represent the inverse of a number we simply have to swap all +’s with -’s and vice versa. The development of balanced ternary machines has all but faded into a small footnote in the annals of computer history. For the moment at least, I don’t think that you’ll be hearing much more about balanced ternary computers in the near future. Although Setun was the first electronic device to operate on balanced ternary, it’s worth mentioning that the idea of using balanced ternary in computing devices was first popularized over 100 years before.

A Rebuttal For Python 3

You only “Cannot” run Python 2 inside the Python 3 VM because no one has written a Python 2 interpreter in Python 3. Python 3 comes with a tool called 2to3 which is supposed to take Python 2 code and translate it to Python 3 code. So my Python 3 code, written and intended purely for Python 3, now has to deal with Python 2 integers as well. What about the standard library, which has had a number of improvements in Python 3 that don’t or can’t exist in Python 2? Should Python ship two entire separate copies of its standard library? What about modules like logging, which rely on global state? Does Python 2 and Python 3 code need to set up logging separately within the same process? Python 3 has been purposefully crippled to prevent Python 2’s execution alongside Python 3 for someone’s professional or ideological gain. By the way, did you know that several error messages are much improved in Python 3? Python 2 is somewhat notorious for the confusing errors it produces when an argument is missing from a method call, but Python 3 is specific about the problem, which is much friendlier to beginners. Now we’re finally, finally at the point where virtually all libraries support Python 3, a few new ones only support Python 3, and Python 3 adoption is starting to take hold among application developers.

What is “:-!!” in C code?

Another common mechanism is to call a function that isn’t defined and rely on the optimizer to compile-out the function call if your assertion is correct. In sympathy for the need for compile-time assertions, GCC 4.3 introduced the the error function attribute that allows you to extend upon this older concept, but generate a compile-time error with a message of your choosing - no more cryptic “Negative sized array” error messages! This macro will evaluate its parameter exactly once and create a compile-time error that says “I told you not to give me a five!” if the expression evaluates to five or is not a compile-time constant. So why aren’t we using this instead of negative-sized bit-fields? Alas, there are currently many restrictions of the use of statement expressions, including their use as constant initializers even if the statement expression is completely constant its self test). Hopefully, GCC will amend these shortcomings soon and allow constant statement expressions to be used as constant initializers. The challenge here is the language specification defining what is a legal constant expression. So I hope that gcc can make a constexpr functionality available as an extension via -std=gnuc99 & -std=gnuc11 or some such and allow its use on statement expressions et.

Rider, a crossplatform C# IDE by Jetbrains now in public EAP

While we’re not quite feature complete, and there are still a couple of rough edges, we know of many people, inside and outside of JetBrains, who are already using Rider for day-to-day development. TL;DR:. Download the first public Rider EAP build. While the plugin SDK is still under development, Rider already supports both IntelliJ and ReSharper plugins, so Rider can take advantage of existing IntelliJ plugins such as VIM editing mode. Check out Hadi’s Rider Tips and Tricks video from NDC Sydney for more examples of how the IntelliJ platform will help you using Rider. Remember, Rider is built from the ReSharper codebase - Rider IS ReSharper. So that’s what it’s going to be - welcome to JetBrains Rider. Download the first public Rider EAP build from the web site, or fire up Toolbox: Rider’s going to be there as well.

Do not change Linux files using Windows apps and tools

DO NOT, under ANY circumstances, create and/or modify Linux files using Windows apps, tools, scripts, consoles, etc. Creating/changing Linux files from Windows will likely result in data corruption and/or damage your Linux environment requiring you to uninstall & reinstall your distro! If WSL can’t find Linux file metadata for a given file, it assumes the file is corrupted/damaged, and will likely fail to open/read the file correctly, causing apps, tools, etc. Several Windows tools implement different strategies to handle file updating and don’t actually edit files in-place. To work on files using both Windows and Linux tools, store & work on those files in your Windows filesystem, and access them from both Windows and from Bash via /mnt//path. So you can easily access the same files using both Windows tools and Bash tools without having to copy files back and forth between filesystems. DO store files in your Windows filesystem that you want to create/modify using Windows tools AND Linux tools DO NOT create / modify Linux files from Windows apps, tools, scripts or consoles.

Steven Skiena’s lectures on Algorithms and Data Structures (last updated 2012)

Below are audio, video and lecture sides for 1997 and 2007. Since the lectures are 10 years apart some of the topics covered by the course have changed. The 1997 lectures have a better quality video and audio than the 2007, although the 2007 covers the newer material and has better lecture notes. If you found this useful also check out the video lectures of my Discrete Mathematics, Computational Biology, and Computational Finance courses. To download audio, right click and choose `Save Page As’. Topic.

OpenGL Renderer Design (how I write OpenGL these days)

In a typical renderer, you might have a table of all the materials, a table of all the meshes, a table of all the instances of meshes, a table of all the cameras, and etc. The specifics of these tables depends on your project, so if you’re doing a skeletal animation project you would also have a table of the skeletons, instances of skeletons, and so on. Table usually have a “Primary key”, which can be used to identify each object in the table uniquely, and can also be used to efficiently lookup the object. Each mesh instance would then have a foreign key to the mesh table, and a foreign key to the transform table. I should point out that since my Scene class is implemented only in terms of plain OpenGL objects, that makes it easy for anybody to write an OpenGL renderer that reads the contents of the tables and renders them in whatever way they see fit. You might have a table for all the transforms, a table for mesh instances, and a table for meshes. To support relative transformations, I suggest creating a new table that stores the edges of the transformation tree, meaning each object in the table stores the foreign keys of two transforms: The parent and the child.

git also - for a file in your git repository prints other files that are most often committed together

For a file in your git repository, prints other files that are most often committed together. > src/core/Object3D.js most often committed with: # together Similarity Name 51 0.22 src/core/Geometry. This means that file Object3D.js is most often committed with Geometry. The Similarity column shows Jaccard index of two files. Usage: git-also [options] For a in your git repository prints other files that are most often committed together Options: -h, -help output usage information -V, -version output the version number -c, -count Print top N other files. Files are often committed together when developers improve code or add new features. What are related file to this file? Where else should I look when I fix bugs in this file?

Composition over Inheritance

This is a weekly show where we try to become more confident and excited about programming by learning intriguing things that we didn’t know before. Today, we are are going to talk about composition over inheritance. Inheritance is when you design your types after what they are, while composition is when you design your types after what they cando. We are going to learn about the limitations of inheritance, and how to solve them using composition.

Open Source .NET – 2 years later

A little over 2 years ago Microsoft announced that they were open sourcing large parts of the. First we are going to see an overview of the level of activity in each repo, by looking at the total number of ‘Issues’ or ‘Pull Requests’ per month. The main trend I see across all repos is there’s a sustained level of activity for the entire 2 years, things didn’t start with a bang and then tailed off. This data represents the total participation from the last 2 years, i.e. November 2014 to October 2016. Finally we can see the ‘per-month’ data from the last 2 years, i.e. November 2014 to October 2016. Whilst not every repo is growing month-by-month, the majority are and those that aren’t at least show sustained contributions across 2 years. I think that it’s clear to see that the Community has got on-board with the new Open-Source Microsoft, producing a sustained level of contributions over the last 2 years, lets hope it continues!

Great tutorial on learning to think abstractly and analyze algorithms (old article, one of the best)

When creating abstractions, stepping down is as important as stepping up. Here, we take the abstraction from the previous section, and overlay a concrete representation on top of it. Every point on a visual abstraction typically corresponds to a particular concrete state. Pointing at the abstraction to step down to a concrete representation lets us quickly explore regions of interest. In the concrete representation it jumps out at us, because it violates our common sense. That is, it’s possible to step down from the abstraction just in our heads. We’re not far off the ground yet! As we climb higher on the ladder of abstraction, it will become harder to imagine the concrete steps beneath, and more critical that our abstractions provide a way to interactively step down to a more concrete representation.

Sophie Wilson - The Future of Microprocessors

None

Her Code Got Humans on the Moon—And Invented Software Itself

Margaret Hamilton wasn’t supposed to invent the modern concept of software and land men on the moon. Hamilton, a 24-year-old with an undergrad degree in mathematics, had gotten a job as a programmer at MIT, and the plan was for her to support her husband through his three-year stint at Harvard Law. As a working mother in the 1960s, Hamilton was unusual; but as a spaceship programmer, Hamilton was positively radical. Hamilton would bring her daughter Lauren by the lab on weekends and evenings. Like female coders in today’s diversity-challenged tech industry, Hamilton was an outlier. As Hamilton’s career got under way, the software world was on the verge of a giant leap, thanks to the Apollo program launched by John F. Kennedy in 1961. At the MIT Instrumentation Lab where Hamilton worked, she and her colleagues were inventing core ideas in computer programming as they wrote the code for the world’s first portable computer.

comments powered by Disqus