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
| #A simple Gremlin query that finds restaurants based on a type of cuisine is shown below: | |
| gremlin> g.V.has('genreId', 'Pizzeria').in.restaurant_name | |
| ==>La Fontana Pizza Restaurante and Cafe | |
| ==>Dominos Pizza | |
| ==>Little Cesarz | |
| ==>pizza clasica | |
| ==>Restaurante Tiberius |
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
| package com.demo.pc; | |
| import java.util.concurrent.BlockingQueue; | |
| import java.util.logging.Level; | |
| import java.util.logging.Logger; | |
| public class Consumer implements Runnable { | |
| private final BlockingQueue<Integer> sharedQueue; |
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
| 1. Write a function that accepts an array of non-negative integers and returns the second largest integer in the array. Return -1 if there is no second largest. | |
| The signature of the function is | |
| int f(int[ ] a) | |
| Examples: | |
| if the input array is return | |
| {1, 2, 3, 4} 3 | |
| {{4, 1, 2, 3}} 3 | |
| {1, 1, 2, 2} 1 | |
| {1, 1} -1 |
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
| class Car { | |
| String model | |
| List<Integer> p = new ArrayList<>() | |
| } | |
| List<Car> cars = new ArrayList<Car>() | |
| Car car1 = new Car() | |
| car1.model = "BMW" | |
| car1.p[0] = 1 |
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
| git branch -r --merged | | |
| grep origin | | |
| grep -v '>' | | |
| grep -v master | | |
| xargs -L1 | | |
| cut -d"/" -f2- | | |
| xargs git push origin --delete | |
| #Source: https://gist.github.com/schacon/942899 |
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
| dataSource { | |
| pooled = true | |
| jmxExport = true | |
| driverClassName = "com.mysql.jdbc.Driver" | |
| dialect = "org.hibernate.dialect.MySQL5InnoDBDialect" | |
| } | |
| hibernate { | |
| cache.use_second_level_cache = true | |
| cache.use_query_cache = false | |
| // cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // Hibernate 3 |
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
| @GrabConfig(systemClassLoader=true) | |
| @Grab('mysql:mysql-connector-java:5.1.25') | |
| @Grab('log4j:log4j:1.2.17') | |
| import groovy.sql.Sql | |
| import groovy.sql.GroovyRowResult | |
| import groovy.time.TimeCategory | |
| def start = new Date() |
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
| @GrabConfig(systemClassLoader=true) | |
| @Grab('mysql:mysql-connector-java:5.1.25') | |
| @Grab('log4j:log4j:1.2.17') | |
| @Grab('com.github.davidmoten:rxjava-jdbc:0.7') | |
| import groovy.sql.Sql | |
| import groovy.sql.GroovyRowResult | |
| import groovy.time.TimeCategory | |
| import com.github.davidmoten.rx.jdbc.Database |
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
| @GrabConfig(systemClassLoader=true) | |
| @Grab('mysql:mysql-connector-java:5.1.25') | |
| @Grab('log4j:log4j:1.2.17') | |
| import groovy.sql.Sql | |
| import groovy.sql.GroovyRowResult | |
| import groovy.time.TimeCategory | |
| def start = new Date() |
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
| /** | |
| * Grails Mail Plugin Configurations | |
| */ | |
| grails { | |
| mail { | |
| host = "smtp.gmail.com" | |
| port = 465 | |
| username = "email@gmail.com" | |
| password = "password123" | |
| props = ["mail.smtp.auth":"true", |