Skip to content

Instantly share code, notes, and snippets.

@Roemerb
Roemerb / day5.go
Last active December 5, 2022 21:55
package day5
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"strings"
)
package day4
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"strings"
)
package day3
import (
"bufio"
"errors"
"fmt"
"log"
"os"
)
class Ding
{
public static int[][] splitInBuckets(int min, int max, int nBuckets, int[] arr) throws Exception
{
if (min < 0)
{
throw new Exception("min cannot be smaller than 0");
}
int[][] output = new int[nBuckets][]; // the output array
int[] distribution = new int[nBuckets]; // stores the distribution of elements in the array
class Ding
{
public static int[][] splitInBuckets(int min, int max, int nBuckets, int[] arr) throws Exception
{
if (min < 0)
{
throw new Exception("min cannot be smaller than 0");
}
int[][] output = new int[nBuckets][];
int[] distribution = new int[nBuckets];
@Roemerb
Roemerb / make_csv.go
Last active December 25, 2017 14:54
Convert ACL movie review files to csv
package main
import (
"bufio"
"encoding/csv"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"
"strconv"
"strings"
<?php
require_once 'smppclient.class.php';
require_once 'gsmencoder.class.php';
require_once 'sockettransport.class.php';
// Construct transport and client
$transport = new SocketTransport(array('smpp.provider.com'),2775);
$transport->setRecvTimeout(10000);
$smpp = new SmppClient($transport);
require 'octokit'
module Gissues
class Github::User < Gissues::Github
def initialize
@client = nil
@token = nil
end
public static function calculate_days($from,$to) {
$aryRange=array();
$iDateFrom=mktime(1,0,0,substr($from,5,2), substr($from,8,2),substr($from,0,4));
$iDateTo=mktime(1,0,0,substr($to,5,2), substr($to,8,2),substr($to,0,4));
if ($iDateTo>=$iDateFrom)
{
array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry
while ($iDateFrom<$iDateTo)