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
GetItemsFromCalendarAsmx = function (webUrl, calendarGuid) { | |
wsURL = webUrl + "_vti_bin/Lists.asmx"; | |
var xmlCall = | |
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body>" + | |
"<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>" + | |
"<listName>" + calendarGuid + "</listName>" + | |
"<query>" + | |
"<Query>" + |
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
GetFieldsFromCollectionREST = function (restUrl, properties) { | |
var values = []; | |
select = "$select=" | |
if (properties.length > 1) | |
select += _(properties.slice(1)).reduce(function (memo, item) { return memo + "," + item }, properties[0]); | |
else | |
select += properties[0]; | |
if (restUrl.indexOf('?') > -1) | |
restUrl = restUrl + "&" + select; | |
else |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>fs</string> | |
<string>fsi</string> | |
<string>fsx</string> | |
</array> |
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
let snacks = ("Soda", "Cookies", "Candy") | |
let x, y, z = snacks | |
let tens = [0 .. 10 ..50] | |
let countDown = [5L .. -1L .. -5L] | |
let x2 = | |
[ let negate x = -x | |
for i in 1 .. 10 do | |
if i % 2 = 0 then |
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
//Mutable record types | |
open System | |
type MutableCar = | |
{ | |
Make : string | |
Model : string | |
mutable Miles : int | |
} | |
let driveForAReason (car : MutableCar) : unit = |
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
// Creating new threads | |
open System | |
open System.Threading | |
//What will execute on each thread | |
let threadBody() = | |
for i in 1..5 do | |
//Wait 1/10 of a second | |
Thread.Sleep(100) | |
printfn "[Thread %d] %d ..." |
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
let distance v1 v2 = | |
Array.zip v1 v2 | |
|> Array.fold (fun sum e -> sum + pown (fst e - snd e) 2) 0.0 | |
|> sqrt | |
let classify subject dataSet labels k = | |
dataSet | |
|> Array.map (fun row -> distance row subject) | |
|> Array.zip labels | |
|> Array.sortBy snd |
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
#doing data science chapter 2 | |
setwd("~/GitHub/doing_data_science/dds_datasets") | |
#read dataset to memory | |
data <- read.csv("dds_ch2_nyt/nyt1.csv") | |
#categorize | |
head(data) | |
dim(data) | |
data$agecat <- cut(data$Age, c(-Inf,0,18,24,34,44,54,64,Inf)) |
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
__author__ = 'martinbodocky' | |
from numpy import * | |
import matplotlib.pyplot as plt | |
import csv | |
def loadDataSet(filename): | |
"""Load CSV comma formatted file without header, | |
which contains features values and target value in last column |
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
__author__ = 'martinbodocky' | |
from pandas import Series, DataFrame | |
import pandas as pd | |
import numpy as np | |
obj = Series([4, -7, 5, 3]) | |
obj.values | |
obj.index |
OlderNewer