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 webbrowser | |
import time | |
times = 5 | |
print "Start working on: " + time.ctime() | |
while times > 0: | |
print "It's time for work!" | |
time.sleep(25 * 60) | |
print "Now, It's time to take a break!" | |
webbrowser.open("https://www.youtube.com/watch?v=1g5wM-YSNHo") |
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 os | |
def rename_files(): | |
working_dir = os.getcwd() | |
print "Current Working Directory: " + working_dir | |
secret_msg_dir = working_dir + "/secret" | |
# list file_list in dir | |
file_list = os.listdir(secret_msg_dir) | |
# rename each file |
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 turtle | |
def draw_square(): | |
t = turtle.Turtle(shape="turtle") | |
t.color("dodger blue") | |
t.pensize(2) | |
for i in range(4): | |
t.forward(200) | |
t.right(90) |
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
Exception in thread "main" java.lang.NoSuchMethodError: io.kotlintest.runner.jvm.TestEngine.<init>(Ljava/util/List;Ljava/util/List;ILio/kotlintest/runner/jvm/TestEngineListener;)V | |
at io.kotlintest.runner.console.KotlinTestConsoleRunner.execute(KotlinTestConsoleRunner.kt:27) | |
at io.kotlintest.runner.console.LauncherKt.main(launcher.kt:19) |
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 so | |
import org.neo4j.ogm.annotation.GeneratedValue | |
import org.neo4j.ogm.annotation.Id | |
import org.neo4j.ogm.annotation.NodeEntity | |
import org.neo4j.ogm.annotation.Relationship | |
import org.neo4j.ogm.config.Configuration | |
import org.neo4j.ogm.session.SessionFactory | |
@NodeEntity |
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
final class Aborted extends Failure { | |
public Result<T> ✅(Consumer<T> f) { | |
return this; | |
} | |
public Result<T> ❌(Consumer<ExceptionStack> f) { | |
return this; | |
} | |
} |
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
class MyModel : ItemViewModel<DomainType>() { | |
// this will not be needed if the above solution is integrated to tornadofx.ViewModel | |
// as the notifyCommitListeners() could be called by ViewModel.commit() method. | |
override fun onCommit() { | |
// TODO: notify listeners only when something really changed | |
notifyCommitListeners() | |
} | |
} |
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
// Types: | |
type Just<T> = { Just: T } | |
type Nothing = {} | |
type Maybe<T> = Just<T> | Nothing | |
type Left<L> = { Left: L } | |
type Right<R> = { Right: R } | |
type Either<L, R> = Left<L> | Right<R> | |
// For convenience: |
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.example.demo.app | |
import javafx.collections.ObservableList | |
import javafx.event.EventHandler | |
import javafx.scene.control.ComboBox | |
import javafx.scene.input.KeyCode | |
import javafx.scene.input.KeyEvent | |
fun <T> ComboBox<T>.makeAutocompletable() = AutoCompleteComboBoxExtension<T>(this) |
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 javafx.application.*; | |
import javafx.geometry.Pos; | |
import javafx.scene.*; | |
import javafx.scene.control.Label; | |
import javafx.scene.layout.*; | |
import javafx.scene.paint.Color; | |
import javafx.stage.*; | |
import javax.imageio.ImageIO; | |
import java.io.IOException; |
OlderNewer