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
#!/usr/bin/env python | |
class HtmlDocument( object ): | |
TAGS = ['html', 'head', 'body', 'div', 'link', 'script', | |
'title', 'meta', 'p', 'a', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', | |
'ul', 'li', 'ol', 'pre', 'code', 'footer', 'article', 'canvas', 'img', 'text' ] | |
def __init__( self ): |
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
import java.io.*; | |
import java.util.HashMap; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
// Linkki kahden noden välillä | |
class Edge { | |
private String fromNode, toNode; | |
private double weight; // weight == etäisyys noiden kahden noden välillä |
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
import java.io.*; | |
import java.util.Iterator; | |
import java.util.HashMap; | |
import java.util.SortedMap; | |
import java.util.TreeMap; | |
import java.util.ArrayList; | |
import java.util.Collections; |
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
import java.io.*; | |
public class stdinReader1 { | |
public static void main( String args[] ){ | |
System.out.println( "Moi kaikki!" ); | |
try { | |
BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) ); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <termios.h> | |
int main(){ | |
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
#!/usr/bin/env python | |
class Node( object ): | |
def __init__( self, end_node = False ): | |
self.end_node = end_node | |
self.prefix_count = 0 | |
self.children = {} | |
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
## Taa ensin tonne HTTP tai HTTPS blockin sisalle (esim. virtual.conf tai sitten sites-enables/default tms filuun) | |
fastcgi_cache_path /var/cache/nginx | |
levels=1:2 keys_zone=ZONE_KEY_TAHAN:10m | |
inactive=5m; | |
fastcgi_cache_key "$scheme$request_method$host$request_uri"; | |
# ja taa sitten locationiin |
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
/* | |
Commands in the virtual machine | |
+ - * / :Pop two numbers from the stack, [add|sub|mul|div] them and push the result back | |
pop :Pops a value from the stack | |
print :Pops a value from the stack and prints it to stdout |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main( int argc, char **argv ){ | |
int i; | |
srand( 22315606 ); rand(); | |
for( i = 0 ; i < 5 ; ++i ){ printf( "%c", 'A' + rand() % 32 ); } | |
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
<?php | |
function append_log_write( $filename, $parametres ){ | |
// Return FALSE if no parametres given | |
if( count( $parametres ) < 1 ){ | |
return FALSE; | |
} | |
// Timestamp in Zebra Time |
OlderNewer