If you use atom... download & install the following packages:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sumOperator = nemathode.evaluate([1, '+', 1]); // 2 | |
const mulOperator = nemathode.evaluate([1, '*', 1]); // 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const res1 = nemathode.evaluate([0, '+', 1]); // 1 | |
const res2 = nemathode.evaluate([0, '+', 1, '*', [2, '/', 1, '-', 3]); // -1 |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Finds smallest element of an array | |
* | |
* @param {Array} arr array for searching | |
* | |
* @return {number} index of smallest element in array | |
*/ | |
const findSmallest = array => { | |
let currentValue = array[0]; | |
let currentIndex = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bubble sorting function | |
* | |
* @param {array} array with numbers | |
* | |
* @return {array} sorted array | |
*/ | |
const sort = array => { | |
let arr = Array.prototype.slice.call(array); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="16dp"> | |
<TextView | |
android:text="I’m in this corner" | |
android:layout_height="wrap_content" | |
android:layout_width="wrap_content" |
NewerOlder