Skip to content

Instantly share code, notes, and snippets.

View saevarb's full-sized avatar

Sævar Berg saevarb

  • NTT Data BS Nordics
  • Odense, Denmark
View GitHub Profile
import Data.List (isSuffixOf)
main :: IO ()
main = do
mapM_ putStrLn . filter (\w -> any (`isSuffixOf` w) extensions) . lines =<< readFile "enable1.txt"
where
extensions =
words "hs py asp do go js rb"
def longest(input_string):
# no need for the type check.
# str is built-in. use another name(and use the right variable)
longest_len = 0
words = input_string.split()
longest = ''
for word in words:
if len(word) > len(longest):
longest = word
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "pprint.h"
void ppDeclList(const DeclList *);
#!/usr/bin/python
import sys
import os
import cv2
import numpy as np
from binascii import b2a_hex
from matplotlib import pyplot as plt
void prettyDeclList(DeclList* declList) {
return;
}
void prettyStaList(DeclList* staListj) {
Decl* ptr = staList->head;
while(ptr != NULL) {
void prettyDeclList(DeclList* declList) {
return;
}
void prettyStaList(DeclList* staListj) {
Decl* ptr = staList->head;
while(ptr != NULL) {
(ns theland.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]
[cljs.core.async :refer [put! chan <!]]
))
(enable-console-print!)
;; define your app data so that it doesn't get over-written on reload
#include<stdio.h>
#include<ctype.h> // isspace
#include<stdlib.h> // malloc, realloc
#define SIZE 100
// Hvis man tæller mellemrum, så giver man forskellige resultater
// afhængigt af om strengen slutter med et mellemrum eller ej
// "hej med dig" -> 2 ord pga 2 mellemrum
// "hej med dig " -> 3 ord pga 3 mellerum
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
srand(time (0));
int array[20]; // erklærer et integer array med 20 pladser
int i, n = 20, count = 0;
build-depends: MonadRandom
, array
, base
, megaparsec
, mtl
, random
, shelly
, text >= 1.2.2.1
, hsc