Skip to content

Instantly share code, notes, and snippets.

View vjames19's full-sized avatar

Victor J Reventos vjames19

View GitHub Profile

Drag from an existing node to add a new node or link. Click to select/deselect nodes/links. Hit the DELETE key to remove the selected node or link. Drag to pan. Scroll to zoom.

Built with D3.js.

@vjames19
vjames19 / EclipseWorkspaceCreatorKeepingPreferences.py
Last active December 17, 2015 03:29
Copies the preferences from the src workspace to the dest workspace. If the dest workspace doesn't exist it will be created. Enjoy!
'''
Created on May 8, 2013
@author: Victor J. Reventos
Copies the preferences from the src workspace to the dest workspace.
If the dest workspace doesn't exist it will be created.
Enjoy!
'''
@vjames19
vjames19 / numberOfOnes.py
Created May 6, 2013 03:53
Number of Ones code eval
import sys
import math
def numberOfOnes(n):
mask = 1
bits = n.bit_length()
if n < 0:
bits +=1
count = 0
for i in range(0, bits):
count += n & mask
@vjames19
vjames19 / Pair.java
Last active December 14, 2015 10:59
Pairs HackerrankGiven N numbers [N<=10^5], count the total pairs of numbers that have a difference of K. [K>0 and K<1e9]Input Format:1st line contains N & K (integers).2nd line contains N numbers of the set. All the N numbers are assured to be distinct.Output Format:One integer saying the no of pairs of numbers that have a diff K.Sample Input #0…
package search.pairs;
/* Head ends here */
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Solution {