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
;; Simple example of MQTT message publish using Clojure | |
;; | |
;; Uses the Websphere Eclipse Paho client | |
;; | |
;; Author: Frederico Munoz <[email protected]> | |
;; Date: 18-Jun-2013 | |
;; Keywords: mqtt, messaging, m2m, telemetry, clojure, iot, paho | |
;; | |
;; Copying and distribution of this file, with or without modification, | |
;; are permitted in any medium without royalty provided the copyright |
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
Show hidden characters
// installed Clojure packages: | |
// | |
// * BracketHighlighter | |
// * lispindent | |
// * SublimeREPL | |
// * sublime-paredit | |
{ | |
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?", | |
"paredit_enabled": true, |
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
(ns clj-gunzip.core | |
(:require [clojure.java.io :as io]) | |
(:require [clojure.string :as str]) | |
(:import java.util.zip.GZIPInputStream | |
java.util.zip.GZIPOutputStream)) | |
(defn gunzip | |
"Writes the contents of input to output, decompressed. | |
input: something which can be opened by io/input-stream. |
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
openssl pkcs12 -in myfile.p12 -out newfile.pem -nodes |
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
is.prime <- function(num) { | |
if (num == 2) { | |
TRUE | |
} else if (any(num %% 2:(num-1) == 0)) { | |
FALSE | |
} else { | |
TRUE | |
} | |
} |
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
# | |
# Quiz 2a | |
# | |
# | |
# Q1 | |
# The edit distance is the minimum number of character insertions and character deletions required to turn one string into another. Compute the edit distance between each pair of the strings he, she, his, and hers. Then, identify which of the following is a true statement about the number of pairs at a certain edit distance. | |
# | |
packages <- c('combinat', 'stringdist') |
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
# Q1 | |
# | |
# Suppose we compute PageRank with a β of 0.7, and we introduce the additional constraint that the sum of the PageRanks of the three pages must be 3, to handle the problem that otherwise any multiple of a solution will also be a solution. Compute the PageRanks a, b, and c of the three pages A, B, and C, respectively. Then, identify from the list below, the true statement. | |
# | |
# Matrix | |
# | |
# A B C | |
# A 0 0 0 | |
# B 0.5 0 0 | |
# C 0.5 1 1 |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading | |
# slashes. | |
# If your page resides at | |
# http://www.example.com/mypage/test1 | |
# then use | |
# RewriteBase /mypage/test1/ | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f |
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
/* sans-serif */ | |
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; | |
font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; | |
font-family: Verdana, Geneva, Tahoma, sans-serif; | |
font-family: Trebuchet, Tahoma, Arial, sans-serif; | |
font-family: GillSans, Calibri, Trebuchet, sans-serif; | |
font-family: "DejaVu Sans", "Bitstream Vera Sans", "Segoe UI", "Lucida Grande", Verdana, Tahoma, Arial, sans-serif; | |
font-family: Geneva, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; | |
font-family: Geneva, Verdana, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", sans-serif; | |
font-family: "HelveticaNeue-Roman", "Helvetica 55 Roman", Helvetica, Arial, sans-serif; |