Skip to content

Instantly share code, notes, and snippets.

@thaenor
thaenor / Eliza.pl
Created December 15, 2014 18:20
ELIZA in Prolog
/*****************************************************************************/
/* ELIZA in Prolog */
/* */
/* Viren Patel */
/* Artificial Intelligence Programs */
/* University of Georgia, Athens, Georgia */
/* Email: vpatel@aisun1.ai.uga.edu */
/* */
/* minor changes by Frank Schilder (FS) */
/* Email: schilder@informatik.uni-hamburg.de */
@thaenor
thaenor / convert_from_char.cpp
Created December 16, 2014 09:36
Some stuff about converting strings to wide chars
// convert_from_char.cpp
// compile with: /clr /link comsuppw.lib
#include <iostream>
#include <stdlib.h>
#include <string>
#include "atlbase.h"
#include "atlstr.h"
#include "comutil.h"
@thaenor
thaenor / rain.cpp
Created January 10, 2015 14:14
openGL particle rain snow and hail effects
// May Ang
// mang@ucsc.edu
// CS 161 - Animation & Visualization
// Final Project - Rain/Hail/Snow Simulation
//source: https://classes.soe.ucsc.edu/cmps161/Winter09/projects/mang/finalproject.html
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
@thaenor
thaenor / angular.html
Created January 22, 2015 13:46
Angular with simple controller
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<p>Try to change the names.</p>
@thaenor
thaenor / angularbinding.html
Created January 22, 2015 13:49
Angular binding, calculates stuff
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div data-ng-app="" data-ng-init="quantity=1;price=5">
@thaenor
thaenor / AngularAjax.html
Created January 22, 2015 13:51
Angular Ajax Request
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<div ng-app="" ng-controller="customersController">
@thaenor
thaenor / validation.html
Created January 22, 2015 13:52
Validation example with angular
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<h2>Validation Example</h2>
@thaenor
thaenor / simple-prolog-examples.pro
Created January 31, 2015 15:33
Some simple Prolog Examples
%originally from http://www.cs.toronto.edu/~sheila/384/w11/simple-prolog-examples.html%
This is obviously not expected to work with a raw copy and paste... obviously
---------------------------
1. Here are some simple clauses.
likes(mary,food).
likes(mary,wine).
likes(john,wine).
likes(john,mary).
@thaenor
thaenor / ex1.pl
Created January 31, 2015 15:34
Grupo 1 - ex1 - Exame ALGAV 3-Fev-2014
dstPosto(pt1,pt2,21).
dstPosto(pt3,pt4,55).
dstPosto(pt5,pt3,30).
dstPosto(pt2,pt5,19).
dstPosto(pt4,pt2,13).
dstPosto(pt1,pt6,28).
abstrobot(r1, [pt4, pt5, pt2, pt6, pt5]).
abstrobot(r2, [pt1, pt3, pt6]).
abstrobot(r3, [pt2, pt5, pt3, pt2, pt6, pt1, pt5]).
@thaenor
thaenor / application.js
Created February 25, 2015 15:43
jQuery example to update a form on focus
/*Content originally from CodeSchool's "try jQuery" lesson. http://try.jquery.com/levels/4/challenges/16 */
$(document).ready(function() {
/*
* this first part fetches the price and multiplies for the number input in the form
*/
$("#nights").on("keyup", function() {
var nights = +$(this).val();
var dailyPrice = +$(this).closest(".tour").data("daily-price");
$("#total").text(nights * dailyPrice);
$("#nights-count").text($(this).val());