Skip to content

Instantly share code, notes, and snippets.

View khaosans's full-sized avatar
:octocat:

SourC khaosans

:octocat:
View GitHub Profile
def main(args):
# parse arguments using optparse or argparse or what have you
print(args)
if __name__ == '__main__':
import sys
main(sys.argv[1:])
Copyright © 2013 Bart Massey
Revision 0: 1 October 2013
This specification describes the "universal sequence" command sequ. The sequ command is a backward-compatible set of extensions to the UNIX [seq](http://www.gnu.org/software/coreutils/manual/html_node/seq-invocation.html) command. There are many implementations of seq out there: this specification is built on the seq supplied with GNU Coreutils version 8.21.
The seq command emits a monotonically increasing sequence of numbers. It is most commonly used in shell scripting:
TOTAL=0
for i in `seq 1 10`
package rationals
import java.math.BigInteger
val ZERO = Rational(0.toBigInteger(), 1.toBigInteger())
fun main(args: Array<String>) {
-(1 divBy 2)
#include <iostream>
using namespace std;
class Square;
class Rectangle {
int width, height;
public:
2018-09-04 17:05:37,134 [dw-190 - POST /seed/lender/6fa3bda2-3736-4c00-901d-b37cf5d78c4f/loan] ERROR (ReportMiradorErrorFilterFactory.java:60) - Error handling a request to [POST:http://localhost:8888/seed/lender/6fa3bda2-3736-4c00-901d-b37cf5d78c4f/loan]: 0c9e086ac0f24b8f
java.lang.IllegalArgumentException: Unknown validator SSN
at com.miradorfin.lass.common.entity.checklist.RandomLibraryQuestionAnswerHandler.handle(RandomLibraryQuestionAnswerHandler.java:101)
at com.miradorfin.lass.common.entity.checklist.RandomLibraryQuestionAnswerHandler.handle(RandomLibraryQuestionAnswerHandler.java:24)
at com.miradorfin.lass.common.entity.checklist.question.LibraryQuestion$Handler.apply(LibraryQuestion.java:34)
at com.miradorfin.lass.common.entity.checklist.RandomChecklistUtil.fillInQuestionAnswer(RandomChecklistUtil.java:211)
at com.miradorfin.lass.client.helper.ChecklistFlowEmulatorImpl.answerQuestion(ChecklistFlowEmulatorImpl.java:71)
at com.miradorfin.lass.client.helper.ChecklistFlowEmulatorImpl.lambda$oneTime
@Override
public boolean updateIncome(VerifiedIncomeAttributes attributes) {
try {
queryRunner.update("UPDATE verifiedincome " +
"SET uuid= ? , loanid = ?, income = ?, schedulec = ?, schedulee = ?, schedulek1 = ? " +
"WHERE ownerid = ? and year = ?", UUID.randomUUID(), attributes.getLoanId(), attributes.getIncome(),
attributes.getScheduleC(), attributes.getScheduleE(), attributes.getScheduleK1(),
attributes.getOwnerId(), attributes.getYear());
} catch (SQLException e) {
@khaosans
khaosans / gist:4d26240ff3a6d127b56956e0217d0acc
Created March 10, 2017 09:06
Huffman Tree Coursera Scala
package patmat
import common._
/**
* Assignment 4: Huffman coding
*
*/
object Huffman {
@khaosans
khaosans / gist:26af02f5de71b062faf5fa379ab1661c
Created December 21, 2016 00:29
Transaction Map for hazelcast put test
public static void main(String[] args) throws InterruptedException {
ClientConfig clientConfig = new ClientConfig();
List addressList = new ArrayList();
addressList.add("localhost:5701");
clientConfig.getNetworkConfig().setAddresses(addressList).setConnectionAttemptLimit(1000).setRedoOperation(true);
HazelcastInstance hazelcasetInstance = HazelcastClient.newHazelcastClient(clientConfig);
for (int i = 0; i < 10000; i++) {
@khaosans
khaosans / gist:0de924ddaf2a0fed9e9d456017c59f4c
Created December 21, 2016 00:17
Put into the hazelcast cache
public static void main(String[] args) throws InterruptedException {
ClientConfig clientConfig = new ClientConfig();
List<String> addressList = new ArrayList<String>();
addressList.add("localhost:5701");
clientConfig.getNetworkConfig().setAddresses(addressList).setConnectionAttemptLimit(1000);
HazelcastInstance hazelcasetInstance = HazelcastClient.newHazelcastClient(clientConfig);
for (int i = 0; i < 10000; i++) {
IMap<String, String> map = hazelcasetInstance.getMap("map");
package com.jamasoftware.contour.report.service.impl.helper;
import com.jamasoftware.contour.api.exception.ContourRuntimeException;
import com.jamasoftware.contour.view.birt.BirtViewConstants;
import org.apache.log4j.Logger;
import org.hibernate.jdbc.Work;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.OutputStream;
import java.sql.Connection;