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
library(tm) | |
library(wordcloud) | |
library(RColorBrewer) | |
my.corpus = Corpus(DirSource("directory_containing_files_to_be_processed")) | |
my.corpus <- tm_map(my.corpus, tolower) | |
my.corpus <- tm_map(my.corpus, stripWhitespace) | |
my.corpus <- tm_map(my.corpus, removePunctuation) |
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
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |
SELECT | |
?v1NoCast ?v1OuterFloat ?v1InnerFloat ?v1OuterdDecimal ?v1InnerDecimal | |
?v10NoCast ?v10OuterFloat ?v10InnerFloat ?v10OuterdDecimal ?v10InnerDecimal | |
?v100NoCast ?v100OuterFloat ?v100InnerFloat ?v100OuterdDecimal ?v100InnerDecimal | |
WHERE | |
{ | |
BIND ( 1 / 3 as ?v1NoCast) | |
BIND ( xsd:float(1 / 3) as ?v1OuterFloat) |
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
from imdb import IMDb | |
imdb = IMDb() | |
the_killing = imdb.get_movie('1637727') | |
continuum = imdb.get_movie('1954347') | |
imdb.update(the_killing, 'full credits') | |
imdb.update(continuum, 'episodes') | |
continuum_episode = continuum['episodes'][1][5] |
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
PREFIX dbpedia2: <http://dbpedia.org/property/> | |
SELECT ?artist | |
FROM NAMED <http://live.dbpedia.org> | |
WHERE { | |
<http://dbpedia.org/resource/The_Killing_%28U.S._TV_series%29> dbpedia2:starring ?artist . | |
<http://dbpedia.org/resource/Continuum_%28TV_series%29> dbpedia-owl:starring ?artist . | |
} | |
LIMIT 10 |
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
PREFIX dbpedia2: <http://dbpedia.org/property/> | |
SELECT ?artist | |
FROM NAMED <http://live.dbpedia.org> | |
WHERE { | |
<http://dbpedia.org/resource/The_Shining_%28film%29> dbpedia2:starring ?artist . | |
<http://dbpedia.org/resource/Hoffa> dbpedia-owl:starring ?artist . | |
} | |
LIMIT 10 |
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
(defun number-of-days-between-dates (date1 date2) | |
"Returns the number of days between two dates. | |
Usage: | |
(number-of-days-between-dates \"yyyy-mm-dd\" \"yyyy-mm-dd\") | |
Or | |
M-x number-of-days-between-dates" |
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
Public Sub CreateBubbleChart() | |
''' Reference : Tom Hollander, http://blogs.msdn.com/b/tomholl/archive/2011/03/28/creating-multi-series-bubble-charts-in-excel.aspx | |
If (Selection.Columns.Count <> 4 Or Selection.Rows.Count < 3) Then | |
MsgBox "Selection must have 4 columns and at least 2 rows" | |
Exit Sub | |
End If | |
Dim bubbleChart As ChartObject | |
Set bubbleChart = ActiveSheet.ChartObjects.Add(Left:=Selection.Left, Width:=600, Top:=Selection.Top, Height:=400) | |
bubbleChart.Chart.ChartType = xlBubble |
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
(defun subtract-number-from-current-word (number) | |
"Substract a number from the current word and replace it with the result. | |
Beware: No error checking." | |
(interactive "p") | |
(let ((curr-word (current-word))) | |
(kill-word 1) | |
(insert (int-to-string | |
(- (string-to-int curr-word) number))))) |
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
(echo `cat some_de.txt EN | gzip | wc -c` EN; \ | |
echo `cat some_de.txt DE | gzip | wc -c` DE) \ | |
| sort -n | head -1 |
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
wget http://www.gutenberg.org/ebooks/46.txt.utf8 && mv 46.txt.utf8 EN && wget http://www.gutenberg.org/cache/epub/2229/pg2229.txt && mv pg2229.txt DE |