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
import settings, sys | |
import time | |
from amcat.tasks import do_scrape, FakeScraper | |
from celery.result import AsyncResult | |
res = do_scrape.delay(FakeScraper, 3) | |
while True: | |
if not res.ready(): | |
time.sleep(.2) |
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
from amcat.models import Article | |
import csv, sys | |
for line in csv.DictReader(sys.stdin, delimiter=';'): | |
aid = int(line["Article ID"]) | |
mid = int(line["New Medium ID"]) | |
print aid, "->", mid | |
a = Article.objects.get(pk=aid) | |
a.medium_id = mid |
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
class Article(AmcatModel): | |
[...] | |
def save_and_index(self, articleset=None): | |
""" | |
Save this article to the database and index, adding it to the given articleset | |
""" | |
if self.pk: | |
raise Exception("Cannot only call save_and_index on unstored articles!") |
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
# ElasticSearch Service | |
description "ElasticSearch" | |
start on (net-device-up | |
and local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] |
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
{ | |
"frames": [ | |
{ | |
"target": { | |
"name": "Attack", | |
"spans": [ | |
{ | |
"start": 2, | |
"end": 3, | |
"text": "attacked" |
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
jong#(jongeren OR minderjarig OR jongen OR meisje* OR tiener* OR reljeugd OR jeugdig* OR jeugdbende* OR minderjarig* OR kopschopper*) W/10 (misdrij* OR misdaden OR delict* geweldpleging* OR geweldsmisdrij* OR geweldmisdrij* OR mishandel* racis* OR seksis* OR haatzaai* OR grafschen* OR lijkschennis OR verniel* OR vandal* OR brandschtiging* pyroma* vrijheidsberoving* OR gijzel* OR ontvoer* terreur* OR terror* OR aanslag* moord* OR doodslag OR doodgeslagen OR doodslaan OR omgebracht* OR gedood OR vermoord* OR bloedbad OR doodgeschoten OR liquidatie* OR liquidee* OR liquideren OR geliquideerd* vermoord OR vermoordt OR vermoordde OR vermoorden OR vermoordden OR doodt OR doodde OR doden OR doodden OR gedood OR gedode OR vermoorde vechtpartij* OR vechtersba* OR hooligan* OR wapenbezit Or schietpartij* OR schietincident OR steekpartij OR messentrekker* OR stalking overval* OR berov* OR beroof* OR roofoverval* OR straatrov* OR straatroof* diefstal OR stelen OR steelt OR gestolen OR dief OR dieven OR ontvreemd* OR |
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
((("(jongeren OR minderjarig OR jongen OR meisje* OR tiener* OR reljeugd OR jeugdig* OR jeugdbende* OR minderjarig* OR kopschopper*) (misdrij* OR misdaden OR delict* geweldpleging* OR geweldsmisdrij* OR geweldmisdrij* OR mishandel* racis* OR seksis* OR haatzaai* OR grafschen* OR lijkschennis OR verniel* OR vandal* OR brandschtiging* pyroma* vrijheidsberoving* OR gijzel* OR ontvoer* terreur* OR terror* OR aanslag* moord* OR doodslag OR doodgeslagen OR doodslaan OR omgebracht* OR gedood OR vermoord* OR bloedbad OR doodgeschoten OR liquidatie* OR liquidee* OR liquideren OR geliquideerd* vermoord OR vermoordt OR vermoordde OR vermoorden OR vermoordden OR doodt OR doodde OR doden OR doodden OR gedood OR gedode OR vermoorde vechtpartij* OR vechtersba* OR hooligan* OR wapenbezit Or schietpartij* OR schietincident OR steekpartij OR messentrekker* OR stalking overval* OR berov* OR beroof* OR roofoverval* OR straatrov* OR straatroof* diefstal OR stelen OR steelt OR gestolen OR dief OR dieven OR ontvreemd* OR koper |
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
> d = data.frame(mediumid=c(4,4,4,5,5,6,7,5)) | |
> d | |
mediumid | |
1 4 | |
2 4 | |
3 4 | |
4 5 | |
5 5 | |
6 6 | |
7 7 |
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
_jong#"(jongeren OR minderjarig OR jongen OR meisje* OR tiener* OR reljeugd OR jeugdig* OR jeugdbende* OR minderjarig* OR kopschopper*) (misdrij* OR misdaden OR delict* geweldpleging* OR geweldsmisdrij* OR geweldmisdrij* OR mishandel* racis* OR seksis* OR haatzaai* OR grafschen* OR lijkschennis OR verniel* OR vandal* OR brandschtiging* pyroma* vrijheidsberoving* OR gijzel* OR ontvoer* terreur* OR terror* OR aanslag* moord* OR doodslag OR doodgeslagen OR doodslaan OR omgebracht* OR gedood OR vermoord* OR bloedbad OR doodgeschoten OR liquidatie* OR liquidee* OR liquideren OR geliquideerd* vermoord OR vermoordt OR vermoordde OR vermoorden OR vermoordden OR doodt OR doodde OR doden OR doodden OR gedood OR gedode OR vermoorde vechtpartij* OR vechtersba* OR hooligan* OR wapenbezit Or schietpartij* OR schietincident OR steekpartij OR messentrekker* OR stalking overval* OR berov* OR beroof* OR roofoverval* OR straatrov* OR straatroof* diefstal OR stelen OR steelt OR gestolen OR dief OR dieven OR ontvreemd* OR ko |
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
wva@amcatsql2:~/xtas/xtas$ cat /tmp/marines.conll | |
1 The _ DT DT _ 2 det _ _ | |
2 marines _ NNS NNS _ 3 nsubj _ _ | |
3 attacked _ VBN VBN _ 0 root _ _ | |
4 the _ DT DT _ 5 det _ _ | |
5 compound _ NN NN _ 3 dobj _ _ | |
6 . _ . . _ 3 punct _ _ | |
wva@amcatsql2:~/xtas/xtas$ cat /tmp/marines.conll | nc localhost 9888 | python -m json.tool | |
{ |
OlderNewer