HTML:
This file contains hidden or 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
| <div class="col-12"> | |
| <h1>Header</h1> | |
| </div> | |
| <div class="col-3"> | |
| <ul> | |
| <li>Menu 1</li> | |
| <li>Menu 2</li> | |
| <li>Menu 3</li> | |
| <li>Menu 4</li> |
This file contains hidden or 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
| /** | |
| * Sample class file for above unit tests | |
| */ | |
| public class QueryBoard { | |
| int[] nums; | |
| QueryBoard() { | |
| nums = new int[10]; | |
| } | |
Table of Contents
Script:
# Read table data from csv file
data <- read.table("data.csv", header=T, sep=",")
# Start PDF device driver to save output to skills.pdf
pdf(file="skills.pdf", height=3.5, width=5)
# Draw bar chartThis 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. Originally forked from Tristan Siegel's Gist.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or 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
| public static void ConvertSec2DaysHoursMinsSecs(int timeDiff) { | |
| int days = (int) Math.floor(timeDiff / 86400); | |
| int hour = (int) Math.floor((timeDiff % 86400) / 3600); | |
| int min = (int) Math.floor((timeDiff % 3600) / 60); | |
| int sec = (int) (timeDiff % 60); | |
| System.out.println("(" + days + " " + hour + " " + min + " " + sec + ")"); | |
| } |
- A testcase is created by subclassing unittest.TestCase.
- Individual tests are defined with methods whose names start with the letters "test". This naming convention informs the test runner about which methods represent tests.
- Following is a typical example of unit test:
# PythonUnitTest.py
import unittest
class Sort(unittest.TestCase):
def setUp(self):
This file contains hidden or 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
| /* Find if given array has duplicate elements (more than 1 occurence) | |
| Time Constraint: O(N) | |
| Author: Jayesh CP | |
| */ | |
| import java.util.*; | |
| import java.lang.*; | |
| import java.io.*; | |
| public class FindDuplicates |
This file contains hidden or 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
| import java.util.regex.*; | |
| public class RegexDemo { | |
| public static final String SAMPLE_STRING = "Perfection is not attainable, but if we chase perfection we can catch excellence"; | |
| public static void main(String[] args) { | |
| //pattern to compare \\b matches word boundaries, so | |
| //the below pattern only matches we | |
| String searchStr = "we"; | |
| Pattern pattern = Pattern.compile("\\b" + searchStr + "\\b"); |
