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
from machine import Pin | |
import utime | |
class MAX6675(): | |
def __init__(self, so_pin=21, cs_pin=22, sck_pin=23): | |
self.cs = Pin(cs_pin, Pin.OUT) | |
self.so = Pin(so_pin, Pin.IN) | |
self.sck = Pin(sck_pin, Pin.OUT) | |
self.cs.on() |
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
Language | Repositories | Stars | WTFs | WTF/kStar | |
---|---|---|---|---|---|
Java | 410 | 3761 | 349 | 93 | |
Scala | 129 | 3405 | 119 | 35 | |
Kotlin | 6 | 21284 | 1422 | 67 |
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
object DataFrameHelpers { | |
import org.apache.spark.sql.types._ | |
implicit class NullableDataFrame(df: DataFrame) { | |
def setNullableStateOfColumns( nullable: Boolean, containsNull: Boolean, cn: String*) : DataFrame = { | |
// get schema | |
val names = cn.toSet | |
val schema = df.schema | |
// modify [[StructField] with name `cn` | |
val newSchema = schemaWithNullableStates(schema, nullable, containsNull, names) |
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
> SELECT CURRENT_USER(); | |
+----------------+ | |
| CURRENT_USER() | | |
+----------------+ | |
| @localhost | | |
+----------------+ | |
1 row in set (0.00 sec) | |
> SELECT USER(); | |
+-------------------+ |
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
java.sql.SQLTransientConnectionException: database - Connection is not available, request timed out after 2043ms. | |
at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:548) | |
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:186) | |
at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:145) | |
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:83) | |
... | |
Caused by: java.sql.SQLException: Could not connect: Access denied for user ''@'localhost' to database 'samebug_components' | |
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authentication(AbstractConnectProtocol.java:767) |
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
# Loads dependencies | |
@depends = (dependency, onload) -> | |
# Loads an array of dependencies. Async iteration, invoke callback after the last one. | |
loadarray = (array, i, callback) -> if i >= array.length - 1 then loadtree(array[i], callback) else loadtree(array[i], -> loadarray(array, i+1, callback)) | |
# Loads a dependency tree | |
loadtree = (tree, callback) -> | |
# Loads the url if it is a leaf | |
if typeof tree == 'string' | |
id = tree.replace(/.+\/|\.min\.js|\.js|\?.+|\W/gi, '') |