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
private int fold(List<Integer> input) { | |
Integer res; | |
if (input.size() == 1) { | |
return input.get(0); | |
}else { | |
try { | |
res = input.get(0); | |
for (int i = 1; i < input.size(); i++) { | |
input.set(i, input.get(i) + res); | |
} |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
string box1 = "good"; | |
string box2 = "bad"; | |
cout<< "Sakib " + box1 + box2+"\n"; |
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 MyFragment: Fragment(){ | |
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
return UI { | |
linearLayout{ | |
editText() | |
button("OK") | |
} | |
}.view | |
} | |
} |
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
## Hibernate second level cache | |
Dependency | |
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-ehcache</artifactId> | |
<version>5.1.0.Final</version> | |
</dependency> |
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
<dependencies> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-webmvc</artifactId> | |
<version>4.2.4.RELEASE</version> | |
</dependency> | |
<dependency> | |
<groupId>javax</groupId> | |
<artifactId>javaee-web-api</artifactId> | |
<version>7.0</version> |
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
Jackson Kotlin Module | |
If you are using Jackson you are likely to want to add com.fasterxml.jackson.module:jackson-module-kotlin dependency in order to allow it to deal with data classes with no default constructor or with Kotlin collections. | |
In addition to the dependency, you need to register it in Jackson ObjectMapper: | |
@SpringBootApplication | |
open class Application { | |
@Bean |
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
# Running maven command in docker maven container | |
FROM maven:3.2-jdk-7-onbuild | |
CMD mvn package exec:java |
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
// this is the layout. Lets asume file name is given layoutRoot.html | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:th="http://www.thymeleaf.org" | |
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"> | |
<head> | |
</head> | |
<body> | |
<header> |
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
# Original theme https://github.com/agnoster zsh theme | |
# modified by lborg019 | |
ZSH_THEME_GIT_PROMPT_DIRTY='±' | |
function _git_prompt_info() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" | |
echo "${ref/refs\/heads\// }$(parse_git_dirty)" | |
} |
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.lynas.config | |
import com.github.mxab.thymeleaf.extras.dataattribute.dialect.DataAttributeDialect | |
import nz.net.ultraq.thymeleaf.LayoutDialect | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.ComponentScan | |
import org.springframework.context.annotation.Configuration | |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer |
OlderNewer