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 asyncio | |
from typing import Optional | |
import aiohttp | |
from aiohttp import ClientSession | |
class KittensQueue(asyncio.Queue): | |
def __init__(self, config, loop: asyncio.AbstractEventLoop, maxsize=15, mime_types: Optional[str] = "jpg"): | |
self.config = config |
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
10:43:50,844 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] | |
10:43:50,845 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] | |
10:43:50,845 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/home/waffle/projects/repos/kotlogram/out/production/resources/logback.xml] | |
10:43:50,974 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 5 minutes | |
10:43:50,975 |-INFO in ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter@c2e1f26 - Will scan for changes in file [/home/waffle/projects/repos/kotlogram/out/production/resources/logback.xml] every 300 seconds. | |
10:43:50,975 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter | |
10:43:50,990 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [org.example] to TRACE | |
1 |
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 test | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import com.fasterxml.jackson.module.kotlin.readValue | |
data class Data<T>(val data: T, val smt: String) | |
fun main(args: Array<String>) { | |
val str = "{\"data\":\"some string\", \"smt\":\"some name\"}" |
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
data class Handler<T: ITEvent>( | |
val filters: Array<out Filter<T>>, | |
val func: suspend (T) -> Unit, | |
val name: String? = null | |
) { | |
/** | |
* Test all [filters] of this handler | |
* | |
* @return true, if all filters passed, else false | |
*/ |
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
abstract class Filter<T /*: ITEvent */> { | |
abstract suspend fun test(value: T): Boolean | |
} | |
class TrueFilter<T: ITEvent>(val sleep: Int, val num: Int, val throwable: Throwable? = null): Filter<T>() { | |
override suspend fun test(value: T): Boolean { | |
println("Enter $num filter, sleeping for $sleep seconds") | |
delay(sleep.seconds.inMilliseconds.longValue) | |
println("Success $num filter, returning `true`") | |
throw throwable ?: return true |
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
private val aMutex = Mutex() | |
private var job: Job? = null | |
private fun getJob(from: Int) = launch { | |
try { | |
var counter = from | |
while (isActive) withContext(NonCancellable) { | |
println(counter++) | |
delay(100) | |
} |
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
//! Basic hello world example. | |
extern crate cgmath; | |
extern crate ggez; | |
use ggez::event; | |
use ggez::graphics; | |
use ggez::{Context, GameResult}; | |
use std::env; | |
use std::path; |
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
(gdb) run | |
Starting program: /home/waffle/projects/ggez_optimus/target/debug/ggez_optimus | |
[Thread debugging using libthread_db enabled] | |
Using host libthread_db library "/usr/lib/libthread_db.so.1". | |
before build | |
Program received signal SIGSEGV, Segmentation fault. | |
0x00007ffff7092800 in xcb_glx_query_server_string_string_length () from /usr/lib/libxcb-glx.so.0 | |
(gdb) backtrace | |
#0 0x00007ffff7092800 in xcb_glx_query_server_string_string_length () from /usr/lib/libxcb-glx.so.0 |
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
[39632.654570] [INFO]Response: Yes. X is active. | |
[39632.654596] [INFO]Running application using virtualgl. | |
name of display: :0 | |
display: :0 screen: 0 | |
direct rendering: Yes | |
server glx vendor string: VirtualGL | |
server glx version string: 1.4 | |
server glx extensions: | |
GLX_ARB_create_context, GLX_ARB_create_context_profile, |
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
% ionice -c 2 -n 7 nice -19 ./build -bk "$(pwd)/backups/first" | |
+./build:6> sudo -v | |
+./build:13> local SHOULD_RESUME=false | |
+./build:7> true | |
+./build:14> local RESUME_PKG='' | |
+./build:15> local PACKAGES=( ) | |
+./build:16> local EXCLUDED_PACKAGES=( ) | |
+./build:17> local FIRST_PARAMS=( ) | |
+./build:18> local EVERY_PARAMS=( ) | |
+./build:19> local ONE_ONLY=false |
OlderNewer