131 private links
Calculating the mean of a list of numbers Consider the following problem:
You have a list of floating point numbers. No nasty tricks - these
aren’t NaN or Infinity, just normal “simple” floating point numbers.
Now: Calculate the mean (average). Can you do it?
It turns out this is a hard problem. It’s hard to get it even close to right. Lets see why.
Data structure and algorithms are core part of any Programming job interview. It doesn't matter whether you are a C++ developer, a Java developer or a Web developer working in JavaScript, Angular, React, or Query. As a computer science graduate, its expected from a programmer to have strong knowledge of both basic data structures e.g. array, linked list, binary tree, hash table, stack, queue and advanced data structures like the binary heap, trie, self-balanced tree, circular buffer etc. I have taken a lot of Java interviews for both junior and senior positions in the past, and I have been also involved in interviewing C++ developer. One difference which I have clearly noticed between a C++ and a Java developer is their understanding and command of Data structure and algorithms.
On average, a C or C++ developer showed a better understanding and application of data structure and their coding skill was also better than Java developers. This is not a coincidence though. As per my experience, there is a direct correlation between a programmer having a good command of the algorithm also happens to be a good developer and coder.
I firmly believe that interview teaches you a lot in very short time and that's why I am sharing some frequently asked Data structure and algorithm questions from various Java interviews.
If you are familiar with them than try to solve them by hand and if you do not then learn about them first, and then solve them. If you need to refresh your knowledge of data structure and algorithms then you can also take help from a good book our course like Data Structures and Algorithms: Deep Dive Using Java for quick reference.
For coding interview preparation, LeetCode is one of the best online resource providing a rich library of more than 300 real coding interview questions for you to practice from using one of the 7 supported languages - C, C++, Java, Python, C#, JavaScript, Ruby.
A curated list of awesome Competitive Programming, Algorithm and Data Structure resources.
Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It’s the “Command Line Interface Creation Kit”. It’s highly configurable but comes with sensible defaults out of the box.
It aims to make the process of writing command line tools quick and fun while also preventing any frustration caused by the inability to implement an intended CLI API.
Click in three points:
- arbitrary nesting of commands
- automatic help page generation
- supports lazy loading of subcommands at runtime
Error handling is an integral part of programming, but in many popular languages, it comes as an afterthought.
The godfather of numerous programming dialects, C, never had a dedicated error or exception mechanism in the first place. It is up to the programmer to accurately report whether the function did what it was intended to do, or threw a tantrum—usually by relying on integers. In case of a segmentation fault—well, all bets are off.
This post goes through the experience of the author in the adaptation to the Golang error management workflow.
Contains clickable links to The Book, Rust by Example, Std Docs, Nomicon, Reference. Furthermore, entries are marked as largely deprecated, have a minimum edition, or are bad.
It summarizes concept including: Data Structures, References & Pointers, Functions & Behaviors, Control Flow, Organizing code, Type Aliases and Cast, Code Generation, Pattern Matching, Generics & Constraints, Strings & Chars, Comments, Common Operators, Idiomatic Rust.
From Josh Mcguigan.
This is a tutorial on building your own shell using Rust, in the spirit of the build-your-own-x list. Creating a shell is a great way to understand how the shell, terminal emulator, and OS work together.
Inspired by Ollie Charles and his excellent 24 days of Hackage series, I'm going to try and introduce you to a number of Rust language features, useful libraries and cool projects built with Rust.
In fact this is a learning opportunity for me too - as much as I love Rust, I'm just diving in. If you think I'm wrong or know an interesting library you want me to write about, feel free to comment!
There’s a fairly common argument that pops up on programming forums, and it’s about the nature of what “garbage collection” means. In the research world, this is what GC means: Garbage collection (GC), also known as automatic memory management, is... | Steve Klabnik | “The most violent element in society is ignorance.” - Emma Goldman
I’ve almost never been able to write correct Python import statements on the first go. Behavior is inconsistent between Python 2.7 and Python 3.6 (the two versions that I test here), and there is no single method for guaranteeing that imports will always work.
This post is my dive into how to resolve common importing problems. Unless otherwise stated, all examples here work with both Python 2.7 and 3.6.
Examples of Python and Rust code to illustrate the concept of ownership.
Very good tutorial.
It’s hard for me to teach an in-depth Python class without discussing lambda expressions. I almost always get questions about them. My students tend to see them in code on StackOverflow or they see them in a coworker’s code (which, realistically, may have also come from StackOverflow).
I get a lot of questions about lambda, I’m hesitant to recommend my students embrace Python’s lambda expressions. I have had an aversion to lambda expressions for many years, and since I started teaching Python more regularly a few years ago, my aversion to lambda expressions has only grown stronger.
I’m going to explain how I see lambda expressions and why I tend to recommend my students avoid using them.
Experienced programmers often need to use online resources to pick up new programming languages. However, we lack a comprehensive understanding of which resources programmers find most valuable and utilize most often. In this paper, we study how experienced programmers learn Rust, a systems programming language with comprehensive documentation, extensive example code, an active online community, and descriptive compiler errors. We develop a task that requires understanding the Rust-specific language concepts of mutability and ownership, in addition to learning Rust syntax.
Our results show that users spend 42% of online time viewing example code and that programmers appreciate the Rust Enhanced package’s in-line compiler errors, choosing to refresh every 30.6 seconds after first discovering this feature. We did not find any significant correlations between the resources used and the total task time or the learning outcomes. We discuss these results in light of design implications for language developers seeking to create resources to encourage usage and adoption by experienced programmers.
molten is a minimal, extensible, fast and productive framework for building HTTP APIs with Python.
See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
where <scope>
is optional.
Example
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
More Examples:
feat
: new feature for the user, not a new feature for build scriptfix
: bug fix for the user, not a fix to a build scriptdocs
: changes to the documentationstyle
: formatting, missing semi colons, etc; no production code changerefactor
: refactoring production code, eg. renaming a variabletest
: adding missing tests, refactoring tests; no production code changechore
: updating grunt tasks etc; no production code change
Adapted from http://www.possibility.com/Cpp/CppCodingStandard.html and NetBSD's style guidelines.
Line-breaking algorithms take a paragraph's-worth of words, and split the words into line-lengthed chunks. The two algorithms many programmer's know of are:
- The greedy algorithm; and,
- The Knuth-Plass algorithm (the 'latex one').
Most programmers "know" the following three facts:
- Knuth-Plass produces the 'best' line breaks;
- Knuth-Plass is a quadratic algorithm; and,
- Knuth-Plass uses dynamic programming and is impossible for mere mortals to code.
While we happen to agree with (1), we will demonstrate that (2) and (3) are, respectively, not true, and unnecessarily obscure. In fact, the Knuth-Plass algorithm---even in its most naive implementation---is strongly dominated by a light-weight linear run-time, and the implementation of the core algorithm is remarkably straightforward.
How many times have you repeatedly typed out a long command on the command line and wished there was a way to save it for later? This is where Bash aliases come in handy. They allow you to condense long, cryptic commands down to something easy to remember and use. Need some examples to get you started? No problem!