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
| # a slightly more realistic version of the 'Healthy' vs. 'Fever' model is outlined and then generated | |
| import random | |
| states = ('Healthy', 'Fever') | |
| observations = ('normal', 'cold', 'dizzy') | |
| start_probability = {'Healthy': 0.6, 'Fever': 0.4} | |
| transition_probability = { | |
| 'Healthy' : {'Healthy': 0.8, 'Fever': 0.2}, | |
| 'Fever' : {'Healthy': 0.4, 'Fever': 0.6} |
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
| \begin{code} | |
| {-# LANGUAGE BangPatterns #-} | |
| {-| | |
| Module : Data.Digest.VowpalHash | |
| Copyright : (c) Carter Tazio Schonwald | |
| License : BSD-style | |
| Maintainer : first dot last @gmail.com |
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 argparse | |
| import sqlite3 | |
| conn = sqlite3.connect('saved_words.db') | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("-a", "--add", help="add word") | |
| parser.add_argument("-c", help="compiling table", action='store_true') | |
| parser.add_argument("-l", help="list words", action="store_true") | |
| parser.add_argument("-v", "--verbosity", type=int, choices=[0, 1, 2], help="increase output verbosity") |
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
| MySQL 5.6 | |
| 1. Download officla one, since it create lib folder for you | |
| 2. After installation | |
| - Lib directory: | |
| /usr/local/mysql/lib | |
| - Bin, Data dir: | |
| /usr/local/mysql-5.6.27-osx10.8-x86_64/bin/mysql | |
| /usr/local/mysql-5.6.27-osx10.8-x86_64/data/mysql |
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
| CREATE SEQUENCE "temp1_id_seq" OWNED BY "Temp1". ID; | |
| ALTER TABLE "Temp1" ALTER COLUMN ID | |
| SET DEFAULT nextval('temp1_id_seq'); | |
| COMMIT; | |
| --Temp1 is table name, however, sequence name must be low-cased. |
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
| PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below. | |
| * Install the TexLive base | |
| $ sudo apt-get install texlive-latex-base | |
| * Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts. | |
| $ sudo apt-get install texlive-fonts-recommended | |
| $ sudo apt-get install texlive-fonts-extra | |
| * Install the extra packages, |
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
| using System; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Web.Mvc; | |
| using System.Web.WebPages; | |
| namespace RegistrationSample.UI.Web.mvcHelper | |
| { | |
| /// <summary> | |
| /// Mandatory Field Extension |
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
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
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
| <!DOCTYPE html> | |
| <html> | |
| <head lang="en"> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| </body> |
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
| # Fibonacci numbers WITH memoization. | |
| # Initialize the memoization hash. | |
| @scratchpad = {} | |
| @max_fibo_size = 1_000_000_000_000 | |
| # Calculate the nth Fibonacci number, f(n). | |
| def fibo (n) | |
| val = if n <= 1 | |
| n |