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] | |
fn iter_demo() { | |
let v1 = vec![1, 2, 3]; | |
let mut v1_iter = v1.iter(); | |
// iter() returns an iterator of slices. | |
assert_eq!(v1_iter.next(), Some(&1)); | |
assert_eq!(v1_iter.next(), Some(&2)); | |
assert_eq!(v1_iter.next(), Some(&3)); | |
assert_eq!(v1_iter.next(), None); |
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
package com.github.philipjkim.demo.hexagonal | |
import ch.qos.logback.classic.Level | |
import ch.qos.logback.classic.Logger | |
import com.tngtech.archunit.core.importer.ClassFileImporter | |
import com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses | |
import org.junit.jupiter.api.Assertions.* | |
import org.junit.jupiter.api.BeforeAll | |
import org.junit.jupiter.api.DisplayName | |
import org.junit.jupiter.api.Nested |
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
import static org.junit.jupiter.api.Assertions.*; | |
class FunctionalVsIemerativeTransformationTest { | |
@Test | |
void functionalVersusImperative() { | |
// Imperative | |
var parameterNames = new String[]{"aaa", "bbb"}; | |
var args = new Object[]{"arg1", "arg2"}; | |
Map<String, Object> params1 = new HashMap<>(); |
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
package com.foo; | |
import java.util.Stack; | |
/* | |
Find sum of n elements after kth smallest element in BST. | |
Tree is very large, you are not allowed to traverse the tree. | |
*/ | |
public class BST { |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"encoding/json" | |
elastic "gopkg.in/olivere/elastic.v3" | |
) |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
// DemoTimeout . | |
func DemoTimeout(ctxTimeout time.Duration, workDuration time.Duration) error { |
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
{ | |
"editor.fontSize": 14, | |
"[go]": {}, | |
"[python]": { | |
"editor.formatOnSave": true | |
}, | |
"eslint.autoFixOnSave": true, | |
"eslint.validate": [ | |
"javascript", | |
"javascriptreact", |
NewerOlder