A markdown file outlining BASECS articles as at task list to track progress.
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
# This is a sample build configuration for Ruby. | |
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: ruby:2.3.0 | |
pipelines: | |
default: | |
- step: |
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
In markdown page: | |
{% assign titleScrubbed = page[1] | scrubPageTitle %} | |
Jekyll plugin: | |
module Jekyll | |
module ScrubPageTitle | |
def scrubPageTitle(input) | |
map = {"Java -" => "", "| Level Up Lunch" => ""} | |
re = Regexp.new(map.keys.map { |x| Regexp.escape(x) }.join('|')) | |
input = input.gsub(re, map) |
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
sudo gem install jekyll --pre | |
Password: | |
Building native extensions. This could take a while... | |
ERROR: Error installing jekyll: | |
ERROR: Failed to build gem native extension. | |
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb | |
checking for rb_thread_blocking_region()... yes | |
checking for sys/select.h... yes | |
checking for poll.h... yes |
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
IntStream stream1 = IntStream.of(1, 2, 3); | |
IntStream stream2 = IntStream.of(1, 2, 3); | |
int val = IntStream.concat(stream1, stream2).distinct().sum(); | |
System.out.println(val); |
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
@Test | |
public void test () { | |
Set<Integer> test = Sets.newHashSet(1, 2, 3, 4); | |
Set<Set<Integer>> elements = Sets.powerSet(test); | |
List<Integer> test2 = elements.stream().filter(p -> p.size() == 3).collect(Collectors.toList()); | |
System.out.println(test2); |
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
[ | |
{ | |
"context":"org.springframework.web.context.WebApplicationContext:/post-configure-actuator-non-boot-app", | |
"parent":null, | |
"beans":[ | |
{ | |
"bean":"componentConfig", | |
"scope":"singleton", | |
"type":"com.levelup.spring.config.ComponentConfig$$EnhancerByCGLIB$$13013792", | |
"resource":"file [/Users/justinm/Documents/springsource/vfabric-tc-server-developer-2.9.3.RELEASE/base-instance/wtpwebapps/post-configure-actuator-non-boot-app/WEB-INF/classes/com/levelup/spring/config/ComponentConfig.class]", |
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
static String bmiDescription (double bmi) { | |
if (bmi < 18.5) { | |
return "You are underweight."; | |
} else { | |
if (bmi > 25) { | |
return "You are overweight."; | |
} else { | |
return "Your weight is optimal."; | |
} | |
} |
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
@Test | |
public void test_convertListToMap () { | |
// create a list | |
List<Movie> movies = Lists.newArrayList(); | |
movies.add(new Movie(1, "The Shawshank Redemption")); | |
movies.add(new Movie(2, "The Godfather")); | |
// convert list to map | |
Map<Integer,Movie> mappedMovies = Maps.uniqueIndex(movies, new Function <Movie,Integer> () { |
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
List<String> strings = new ArrayList<String>(); | |
strings.add("one"); | |
strings.add("two"); | |
strings.add("three"); | |
String firstElement = null; | |
if (!strings.isEmpty() && strings.size() == 1) { | |
firstElement = strings.get(0); | |
} |