Skip to content

Instantly share code, notes, and snippets.

View yeison's full-sized avatar

Yeison Rodriguez yeison

  • San Francisco, CA
View GitHub Profile
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class ConvertTree {
public static void main(String[] args){
Node root = new Node();
List<List<Node>> lists = convert(root);
}
@yeison
yeison / SimpleInputProvider.java
Last active August 29, 2015 14:01
DBN 53% error
package classifier.vasilev;
import com.github.neuralnetworks.architecture.Matrix;
import com.github.neuralnetworks.training.TrainingInputData;
import com.github.neuralnetworks.training.TrainingInputProvider;
/**
* Simple input provider for testing purposes.
* Training and target data are two dimensional float arrays
*/
@yeison
yeison / RadixSort.java
Last active January 27, 2019 20:53
Implementation of Radix Sort in Java.
/*
RadixSort.java : Sorts 32-bit integers with O(n*k) runtime performance.
Where k is the max number of digits of the numbers being
sorted.
(i.e. k=10 digits for 32-bit integers.)
Copyright (C) 2013 Yeison Rodriguez ( github.com/yeison )
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@yeison
yeison / gist:5596728
Last active December 17, 2015 10:39
4-11. Design an O(n) algorithm that, given a list of n elements, finds all the elements that appear more than n / 2 times in the list. Then, design an O(n) algorithm that, given a list of n elements, finds all the elements that appear more than n / 4 times.
/**
* @param in - input dataset containing elements we'd like to search through
* @param k - denominator to indicate desired occurrence of elements (e.g. with n/2, k = 2)
* @return We will return all elements whose frequency is greater than n/k.
*/
public static ArrayList<Integer> getFrequentElements(int[] in, int k){
Map<Integer, Integer> freqMap = new HashMap<Integer, Integer>();
ArrayList<Integer> out = new ArrayList<Integer>();
@yeison
yeison / tf2_ros issue
Created March 26, 2013 11:50
Having trouble building tf2_ros on osx
==> Processing catkin package: 'tf2_ros'
==> Building with env: '/Users/Yeison/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
==> make -j4 -l4 in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
Linking CXX shared library /Users/Yeison/ros_catkin_ws/devel_isolated/tf2_ros/lib/libtf2_ros.dylib
Undefined symbols for architecture x86_64:
"ros::NodeHandle::advertiseService(ros::AdvertiseServiceOptions&)", referenced from:
ros::ServiceServer ros::NodeHandle::advertiseService<tf2::Buffer, tf2_msgs::FrameGraphRequest_<std::allocator<void> >, tf2_msgs::FrameGraphResponse_<std::allocator<void> > >(std::string const&, bool (tf2::Buffer::*)(tf2_msgs::FrameGraphRequest_<std::allocator<void> >&, tf2_msgs::FrameGraphResponse_<std::allocator<void> >&), tf2::Buffer*) in buffer.cpp.o
"ros::NodeHandle::advertise(ros::AdvertiseOptions&)", referenced from:
@yeison
yeison / catkin package console_bridge
Last active December 15, 2015 10:19
catkin package console_bridge
==> Processing catkin package: 'console_bridge'
==> Building with env: '/Users/Yeison/ros_catkin_ws/install_isolated/env.sh'
==> cmake /Users/Yeison/ros_catkin_ws/src/console_bridge -DCATKIN_DEVEL_PREFIX=/Users/Yeison/ros_catkin_ws/devel_isolated/console_bridge -DCMAKE_INSTALL_PREFIX=/Users/Yeison/ros_catkin_ws/install_isolated
-- Boost version: 1.53.0
-- Found the following Boost libraries:
-- system
-- thread
-- Configuring done
-- Generating done
CMake Warning: