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
#include <stdio.h> | |
//In a word or not | |
#define IN 1 | |
#define OUT 0 | |
#define MAXLENGTH 100 | |
// Write a program to print a histogram of the lengths of words in its input. It is easy to draw the historgram with the bars horizontal; a vertical orientation is more challenging. | |
main(){ | |
//Maximum word length is 100, far more than neccesary |
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
#include <stdio.h> | |
/* | |
Write a program to fold long input lines into two or more shorter lines after the last non-blank character that occurs before the n-th column of input. Make sure your program does something intelligent with very long lines, and if there are no blanks or tabs before the specified column. | |
*/ | |
#define COLUMN_WIDTH 80 | |
#define MAX_LINE 1000 | |
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
#------------------------------------------------------------------------------- | |
# Name: get_image_size | |
# Purpose: extract image dimensions given a file path using just | |
# core modules | |
# | |
# Author: Paulo Scardine (based on code from Emmanuel VAÏSSE), Ethan Eldridge (ICO) | |
# | |
# Created: 26/09/2013 | |
# Copyright: (c) Paulo Scardine 2013 | |
# Licence: MIT |
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 actors | |
import org.scalatest._ | |
import org.scalatest.concurrent._ | |
import org.scalatest.time.{ Millis, Seconds, Span } | |
import akka.actor.ActorSystem | |
import akka.util.Timeout | |
import java.util.concurrent.TimeUnit.MILLISECONDS |
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 java.io.File; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
//Seriously why do I have to import 3 things so get the date. Java = superflous objects everywhere | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
public final class SimpleLog{ |
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 com.google.inject.{AbstractModule, Provides, Guice} | |
import com.google.inject.throwingproviders.{ CheckedProvides, CheckedProvider, ThrowingProviderBinder } | |
import com.typesafe.config.{ ConfigException, ConfigFactory } | |
import java.net.{URL, MalformedURLException} | |
import javax.inject.Inject | |
import scala.collection.JavaConversions._ | |
import scala.util.{Try, Success, Failure} |
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
#include <stdio.h> | |
main(){ | |
int c; | |
while((c = getchar()) != EOF){ | |
putchar(c); | |
if(c == ' '){ | |
while((c = getchar()) == ' ') | |
; | |
putchar(c); |
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 module | |
/* Don't import ._ because there's naming conflicts between sttp and ws for request bodies and whatnot */ | |
import play.api.libs.ws | |
import ws.{ WSClient, WSClientConfig, WSRequest, WSResponse } | |
import play.api.libs.iteratee.Enumerator | |
import com.softwaremill.sttp._ | |
import com.softwaremill.sttp.internal.SttpFile | |
import com.softwaremill.sttp.monadSyntax._ |
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
#include <stdio.h> | |
#define MAXLENGTH 1000 | |
//Write a function reverse(s) that reverses the character string s. Use it to write a program that reverses its input line by line | |
void reverse(char s[], int lim){ | |
int i,j; | |
j=lim-1; | |
i=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
import java.io.FileOutputStream | |
import java.nio.file.{Files, Paths, Path, FileVisitResult} | |
import java.nio.file.attribute.BasicFileAttributes | |
import java.nio.file.SimpleFileVisitor | |
def autoClosing[C <: Closeable, T](closeable: C)(c: C => T) = { | |
try { | |
c(closeable) | |
} finally { | |
closeable.close() |
NewerOlder