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
| fun Int.asBinaryString(): String { | |
| return String.format( | |
| "%16s", | |
| Integer.toBinaryString(this) | |
| ) | |
| .replace(' ', '0') | |
| } | |
| val number = 6 |
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
| abstract class Entity<T : Serializable> { | |
| abstract var id: T | |
| override fun equals(other: Any?): Boolean = when { | |
| this === other -> true | |
| other == null -> false | |
| Hibernate.getClass(other) != Hibernate.getClass(this) -> false | |
| else -> Objects.equals(id, (other as Entity<*>).id) | |
| } |
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.square.moshi.example; | |
| import com.squareup.moshi.RuntimeTypeJsonAdapterFactory.RuntimeType; | |
| public class Example { | |
| static class Animal { | |
| String type; | |
| String name; |
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
| CREATE OR REPLACE FUNCTION DC_ReorderIndexesNULLS(key bigint, tableName text, keyName text, orderCol text) RETURNS integer AS | |
| $PROCEDURE$ | |
| DECLARE | |
| last_index INTEGER := 0; | |
| count INTEGER := 0; | |
| r RECORD; | |
| query TEXT := 'SELECT ' || orderCol || ' as order FROM ' || tableName || ' WHERE ' || keyName || ' = ' || key | |
| || ' ORDER BY ' || orderCol; | |
| BEGIN | |
| EXECUTE 'SELECT COUNT(*) as cnt FROM ' || tableName || ' WHERE ' || keyName || ' = ' || key INTO count; |
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.lrlabs.model.activity.config; | |
| import com.cronutils.model.Cron; | |
| import com.cronutils.model.definition.CronDefinition; | |
| import com.cronutils.model.definition.CronDefinitionBuilder; | |
| import com.cronutils.model.time.ExecutionTime; | |
| import com.cronutils.parser.CronParser; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.DateTimeZone; |