Source : BouncyCastle
Code
RsaKeyPairGenerator g = new RsaKeyPairGenerator();
import java.util.*; | |
public class BreadthFirstIterator<T> implements Iterator<T> { | |
private Set<T> visited = new HashSet<>(); | |
private Queue<T> queue = new LinkedList<>(); | |
private Graph<T> graph; | |
public BreadthFirstIterator(Graph<T> g, T startingVertex) { | |
if(g.isVertexExist(startingVertex)) { | |
this.graph = g; |
/** | |
* Calculate angle between 3 points in 3D space. | |
* Note: assumes we want 1 vector to run from coord1 -> coord2, and the other | |
* from coord3 -> coord2. | |
* | |
* @param {x: number; y: number; z: number} coord1 1st (3D) coordinate | |
* @param {x: number; y: number; z: number} coord2 2nd (3D) coordinate | |
* @param {x: number; y: number; z: number} coord3 3rd (3D) coordinate | |
* | |
* @return {number} Angle between the 3 points |
Source : BouncyCastle
Code
RsaKeyPairGenerator g = new RsaKeyPairGenerator();
// Given a directed graph, find out if a vertex v is reachable from another vertex u for all vertex pairs (u, v) in the given graph. | |
import java.util.LinkedList; | |
class Graph | |
{ | |
int V; // No. of vertices | |
boolean [][]tc; // To store transitive closure | |
LinkedList<Integer> adj[]; // array of adjacency lists | |
public Graph(int V) |
Originally posted at http://pastebin.com/BjD84BQ3
Trigger warning: mention of suicidal ideation
tl;dr: I burned out as a developer at Amazon at the end of my second year. I’ve since found a healthy and sustainable work-life balance and enjoy work again. I write this to A) raise awareness, especially for new-hires and their families, and B) help give hope and advice to people going through the same at Amazon or other companies.
There’s been no shortage of anecdotes, opinions, and rebuttals regarding Amazon’s corporate culture as of late. I write this not to capitalize on the latest news-feed fad, but to share what I had already written and promptly deleted. I didn’t think anyone would want to hear my story, but it’s apparent people are going through a similar experience and don’t have a voice.
I’m a Software Development Engineer II at Amazon; SDE II basically means a software developer with at least 2–3 years of industry experience. I started at Amazon as an SDE I.
public void CreateExpression() | |
{ | |
Type argType = typeof (MyClass); | |
string propertyName = "Name"; | |
ParameterExpression paramExpression = Expression.Parameter(argType, "item"); | |
//Create "item.Name" and "item.GetType()" expressions | |
var propertyAccessExpression = Expression.Property(paramExpression, propertyName); | |
var getTypeExpression = Expression.Call(paramExpression, "GetType", Type.EmptyTypes); |
object test { | |
case class L[A, B]() { | |
def ToLub[AA >: A <: L, BB >: B <: L, L] = new { type LUB = L } | |
} | |
val intBoolLub = L[Int, Boolean].ToLub | |
(1: AnyVal) : intBoolLub.LUB | |
1: intBoolLub.LUB |