final 2024_Remote_Sensing

This commit is contained in:
huaqo-games
2025-02-12 19:27:51 +01:00
parent 373d194038
commit 682eef1c3e
132 changed files with 964360 additions and 20192 deletions
@@ -0,0 +1,126 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct person
{
struct person *parents[2];
char alleles[2];
} person;
const int GENERATIONS = 3;
const int INDENT_LENGTH = 4;
person *create_family(int generations);
void print_family(person *p, int generation);
void free_family(person *p);
char random_allele();
int main(void)
{
srand(time(0));
person *p = create_family(GENERATIONS);
print_family(p, 0);
free_family(p);
}
person *create_family(int generations)
{
person *p = malloc(sizeof(person));
if (generations > 1)
{
person *parent0 = create_family(generations - 1);
person *parent1 = create_family(generations - 1);
p->parents[0] = parent0;
p->parents[1] = parent1;
if (rand() % 2)
{
p->alleles[0] = parent0->alleles[rand() % 2];
p->alleles[1] = parent1->alleles[rand() % 2];
}
else
{
p->alleles[1] = parent0->alleles[rand() % 2];
p->alleles[0] = parent1->alleles[rand() % 2];
}
}
else
{
p->parents[0] = NULL;
p->parents[1] = NULL;
p->alleles[0] = random_allele();
p->alleles[1] = random_allele();
}
return p;
}
void free_family(person *p)
{
if (p == NULL)
{
return;
}
free_family(p->parents[0]);
free_family(p->parents[1]);
free(p);
}
void print_family(person *p, int generation)
{
if (p == NULL)
{
return;
}
for (int i = 0; i < generation * INDENT_LENGTH; i++)
{
printf(" ");
}
if (generation == 0)
{
printf("Child (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]);
}
else if (generation == 1)
{
printf("Parent (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]);
}
else
{
for (int i = 0; i < generation - 2; i++)
{
printf("Great-");
}
printf("Grandparent (Generation %i): blood type %c%c\n", generation, p->alleles[0], p->alleles[1]);
}
print_family(p->parents[0], generation + 1);
print_family(p->parents[1], generation + 1);
}
char random_allele()
{
int r = rand() % 3;
if (r == 0)
{
return 'A';
}
else if (r == 1)
{
return 'B';
}
else
{
return 'O';
}
}
@@ -0,0 +1,4 @@
speller:
clang -ggdb3 -gdwarf-4 -O0 -Qunused-arguments -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -c -o speller.o speller.c
clang -ggdb3 -gdwarf-4 -O0 -Qunused-arguments -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -c -o dictionary.o dictionary.c
clang -ggdb3 -gdwarf-4 -O0 -Qunused-arguments -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -o speller speller.o dictionary.o -lm
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
cat
caterpillar
@@ -0,0 +1,62 @@
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include "dictionary.h"
// Represents a node in a hash table
typedef struct node
{
char word[LENGTH + 1];
struct node *next;
} node;
// TODO: Choose number of buckets in hash table
const unsigned int N = 26;
// Hash table
node *table[N];
// Returns true if word is in dictionary, else false
bool check(const char *word)
{
// TODO
return false;
}
// Hashes word to a number
unsigned int hash(const char *word)
{
// TODO: Improve this hash function
return toupper(word[0]) - 'A';
}
// Loads dictionary into memory, returning true if successful, else false
bool load(const char *dictionary)
{
// TODO
// Open the dictionary file
// Read each word in the file
// Add each word to the hash table
// Close the dictionary file
return false;
}
// Returns number of words in dictionary if loaded, else 0 if not yet loaded
unsigned int size(void)
{
// TODO
return 0;
}
// Unloads dictionary from memory, returning true if successful, else false
bool unload(void)
{
// TODO
return false;
}
@@ -0,0 +1,19 @@
// Declares a dictionary's functionality
#ifndef DICTIONARY_H
#define DICTIONARY_H
#include <stdbool.h>
// Maximum length for a word
// (e.g., pneumonoultramicroscopicsilicovolcanoconiosis)
#define LENGTH 45
// Prototypes
bool check(const char *word);
unsigned int hash(const char *word);
bool load(const char *dictionary);
unsigned int size(void);
bool unload(void);
#endif // DICTIONARY_H
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,302 @@
MISSPELLED WORDS
Gutenberg's
Alice's
eBook
eBook
org
Alice's
EBook
EBOOK
ALICE'S
ALICE'S
MARMALADE'
Antipathies
Dinah'll
Alice's
ME'
not'
ME'
ALICE'S
ESQ
HEARTHRUG
ALICE'S
skurried
O
O
O
Ou
chatte
better'
Morcar
Morcar
Stigand
Atheling
William's
Normans
thimble'
C
D
Mouse's
Dinah's
naturedly
W
RABBIT'
Dinah'll
pleasanter
Alice's
won't'
yer
yer
arrum
yer
yer
Bill's
Bill's
Bill's
Bill's
barrowful
barrowful
V
sir'
yawned
Footman's
nose'
Hatter's
Alice's
Lacie
Sh
sh
were'
M
M
M
everything's
beheaded
King's
processions
rosetree
beheaded
croqueted
croqueting
executioner's
King's
beheaded
Alice's
Everything's
Alice's
Alice's
game's
Tis
tis
tis
Alice's
m
Alice's
ordered'
Hjckrrh
mayn't
uglifying
Seaography
X
never'
dinn
Dinn
yawned
TIS
Tis
Hm
ootiful
oop
ootiful
oop
oop
e
e
ootiful
oop
ootiful
oop
oop
e
e
beauti
FUL
oop
e
e
men'
slates'll
T
Alice's
jurymen
jurymen
jurymen
jurymen
teacups
teacups
Gutenberg's
Alice's
EBOOK
ALICE'S
txt
http
org
tm
tm
eBooks
eBook
eBook
eBooks
tm
tm
http
org
tm
tm
tm
tm
E
B
tm
C
tm
tm
E
C
PGLAF
tm
tm
tm
tm
tm
D
tm
E
E
tm
tm
eBook
eBook
org
E
tm
E
E
tm
E
E
E
tm
E
E
tm
E
tm
tm
E
E
tm
E
nonproprietary
tm
tm
org
tm
E
E
tm
E
E
E
tm
tm
tm
e
s
tm
tm
F
tm
E
tm
tm
F
F
tm
tm
F
F
tm
tm
F
F
F
IS'
MERCHANTIBILITY
F
unenforceability
F
tm
tm
tm
b
tm
c
tm
tm
tm's
tm
tm
http
pglaf
org
c
c
http
pglaf
org
U
S
Melan
S
pglaf
org
http
pglaf
org
B
Newby
gbnewby
pglaf
org
tm
http
pglaf
org
U
S
http
pglaf
org
tm
S
tm
tm
eBooks
tm
eBooks
U
S
eBooks
PG
http
org
tm
eBooks
eBooks
WORDS MISSPELLED: 295
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 29758
@@ -0,0 +1,7 @@
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 6
@@ -0,0 +1,37 @@
MISSPELLED WORDS
USConstitution
http
usconstitution
const
html
tempore
Impeachments
Nays
Nays
repassed
Piracies
Felonies
attainted
Langdon
Gilman
Brearley
Mifflin
Clymer
Fitzsimons
Jared
Gouvernour
McHenry
Jenifer
Blount
Spaight
Cotesworth
tempore
tempore
tempore
tempore
WORDS MISSPELLED: 30
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 7573
@@ -0,0 +1,942 @@
MISSPELLED WORDS
Etext
txt
Etext
etexts
txt
txt
etext
hr
Etext
x
IBC
IBC
IBC
SASLE's
RiceMail
ATTMAIL
MCImail
vmd
cso
uiuc
edu
uiucvmd
uiucvmd
vmd
cso
uiuc
edu
Attmail
vmd
cso
uiuc
edu
MCImail
MCI
MBX
vmd
cso
uiuc
edu
mrcnext
cso
uiuc
edu
cd
etext
cd
cd
etext
cd
etext
dir
mget
AAINDEX
MGET
ETEXTS
etext
etext
ETEXT
tm
etext
etext
etext
hysical
TM
ETEXTS
tm
etext
tm
etexts
S
etext
etexts
etexts
etext
etext
etext
tm
etext
dis
NEGLI
GENCE
etext
etext
inaccu
ETEXT
ETEXT
ETEXT
etext
pense
etext
ation
etext
distribu
tion
etext
tm
etext
ically
quires
etext
etext
etext
etext
etext
etext
etext
etext
OCR
etexts
B
ETEXTS
Ver
unperplexed
confederacies
proselytes
Heresies
invectives
confederacies
votaries
PUBLIUS
confederacies
uncontradicted
confederacies
sovereignties
widespreading
sovereignties
wellbalanced
pursuaded
pursuade
confederacies
confederacies
PUBLIUS
wellinformed
confederacies
confederacies
violences
borderers
PUBLIUS
confederacies
uneasinesses
confederacies
embarrassments
confederacies
confederacies
PUBLIUS
animosities
affection''
confederacies
confederacies
confederacies
confederacies
confederacies
borderers
confederacies
confederacies
confederacies
sovereignties
PUBLIUS
confederacies
sovereignties
rivalships
SAMNIANS
MEGARENSIANS
V
V
descanted
rivalships
wellregulated
antipathies
PUBLIUS
Plutarch's
P
Cambray
Principes
des
Negociations''
l'Abbe
Mably
ungranted
cessions
preponderated
unpropitious
SOVEREIGNTIES
confederacies
procrastinations
resentments
incumbrances
delinquencies
Delinquencies
confederacies
PUBLIUS
retaken
confederacies
expedients
confederacies
confederacies
oppressions
encroachments
menacings
usurpations
T
disproportioned
confederacies
distempered
PUBLIUS
sophisms
corruptions
PUBLIUS
Lawa
wellconstructed
mischiefs
animosities
mischiefs
suffrages
suffrages
PUBLIUS
rivalships
intermeddlings
concentred
confederated
fluctations
unsalable
PUBLIUS
philosophiques
Americains
rivalship
inperceptible
confederacies
confederacies
embarrassments
PUBLIUS
confederacies
sovereignties
confederacies
confederacies
confederacies
confederacies
PUBLIUS
concentred
fellowcitizens
PUBLIUS
encroachments
imperio
contradistinguished
mischiefs
rivalships
superintending
improprieties
sovereignties
orbs
intrusted
delinquencies
PUBLIUS
confederacies
suffrages
delinquencies
aggressing
delinquencies
instigations
confederacies
intrusted
illhumors
dismemberments
PUBLIUS
intrusted
allurements
transcendant
unfrequently
confederacies
feudatories
demesnes
feudatories
oppressions
fiefs
clanship
encroachments
rivalship
PUBLIUS
confederacies
Amphictyonic
aggressing
Amphictyons
Delphos
Amphictyons
Lacedaemonians
Thebans
Lacedaemonians
Lacedaemonians
orbs
Milot
hatreds
dissentions
Phocians
Amphictyonic
Phocians
Thebans
Amphictyons
Amphictyonic
praetors
Philopoemen
Achaeans
Amphictyonic
Aratus
Mably
Amphictyonic
Achaeans
Achaeans
usurpers
Peloponnesus
Achaeans
Cleomenes
unprovoked
Achaeans
Achaeans
Cleomenes
intermeddling
Cleomenes
Achaeans
tyrannies
Achaeans
AEtolians
Achaeans
Achaia
PUBLIUS
confederacies
Gauls
fiefs
Suabian
disturbers
electorates
inbecility
defaulters
Thuanus
Donawerth
Suabia
Abb
reannexed
heriditary
accomodating
bailages
Luzerne
PUBLIUS
Pfeffel
Nouvel
Abreg
Chronol
l'Hist
d'Allemagne
aristocracies
superintends
admiralties
florins
Belgic
confedracy
Mably
contradistinguished
PUBLIUS
mulcts
encroachments
distempers
usurpations
King's
PUBLIUS
Jenkinson
expedients
reget
Deleware
confederated
nonattendance
mischiefs
suffrages
prevalency
major's
judicatories
prepossessions
infirmities
PUBLIUS
intrusted
intrusted
cavils
confederacies
indispensible
PUBLIUS
proprietory
overflowings
superadded
expedients
countenanced
disconcertion
encroachments
PUBLIUS
bils
LEGISLATURE''
rivalship
perserverance
Lacedaemonians
PUBLIUS
prevalency
expedients
wellinformed
encroachments
calamaties
PUBLIUS
inexplicitness
expedients
delinquencies
PUBLIUS
seditions
scourges
Confederacies
Confederacies
expedients
usurpations
intrusted
usurpers
usurpers
usurpers
usurpations
PUBLIUS
superintending
COMITATUS
COMITATUS
intrusted
COMITATUS
Gorgons
hydras
chimeras
dire''
d'ors
ducats
intrenchments
usurpers
usurpations
distempered
superadded
selfpreservation
PUBLIUS
bashaws
fatuus
embarrassments
expedients
usurers
deficiences
sightedness
PUBLIUS
DISQUISITIONS
geometricians
untractableness
disingenuity
superintending
usurpations
encroachments
PUBLIUS
resentments
LEGISLATION''
EXCISES''
forbearances
PUBLIUS
ingrafted
thereof''
railings
culumniated
landtax
reasoners
intrusted
PUBLIUS
CENTURIATA
TRIBUTA
intrusted
fifteenths
twentieths
PUBLIUS
overstocked
expedients
acquirements
rivalships
suffrages
expedients
PUBLIUS
rivalships
bypaths
monly
taxations
tyrannies
expedients
PUBLIUS
rejudging
confederacies
rectifying
intrusted
naturalists
infirmities
animosities
Zaleucus
Locrians
Numa
Tullius
Hostilius
Tullius
Hostilius
Achaeus
Aratus
intrusted
expedients
selfpreservation
protracting
unpardonable
impeachments
impeachments
overleaping
PUBLIUS
disquisitions
oppressions
PUBLIUS
expositors
ungranted
pretermitting
sixtieths
PUBLIUS
misthinking
usurpations
Confederacies
animosities
intrusted
unvaried
Confederacies
PUBLIUS
piracies
felonies
disembarrassed
usurpations
piracies
felonies
piracies
felonies
piracies
felonies
felonies
upbraided
oppressions
emigrations
secureties
animosities
superintending
confederated
mischiefs
paupers
superadding
inhabitants''
embarrassments
interdicts
PUBLIUS
dockyards
suffrages
treasons
wreaked
superintending
Amphictyons
antirepublican
confederacies
superintending
infirmities
reciprocality
PUBLIUS
animosities
mischiefs
proper''
EXPRESSLY''
usurpers
unredressed
PUBLIUS
Fournal
unsacrificed
confederacies
encroachments
rivalship
encroachments
countenancing
PUBLIUS
superintending
prepossessions
prepossessions
prepossessions
preorgatives
defalcations
encroachments
embarrassments
encroachments
PUBLIUS
selfappointed
emphatical
impeachments
appointable
impeachments
impeachments
appointable
appointable
PUBLIUS
usurpations
usurpations
encroachments
unfrequently
encroachments
p
encroachments
PUBLIUS
Encroachments
subjoined
encroachments
encroachments
grantors
bestows
prepossessions
numberous
usurpations
prepossessions
PUBLIUS
expedients
PUBLIUS
magistracies
encroachments
encroachments
usurpations
Confederacies
oppressions
PUBLIUS
antiquaries
usurpations
PUBLIUS
votaries
t
e
regulatious
acquirements
reelections
PUBLIUS
confederacies
PUBLIUS
sixtyfive
fellowcitizens
allbe
extravagancies
PUBLIUS
constitutents
constitutents
PUBLIUS
Burgh's
Disquisitions
unpropitious
suffrages
PUBLIUS
rivalship
reapportionments
reapportionments
infirmities
secessions
PUBLIUS
distempered
intrusting
rivalship
confederacies
PUBLIUS
Ist
Ist
votaries
primative
importuned
expedients
PUBLIUS
opposers
suffrages
suffrages
unpardonable
PUBLIUS
V
prepossessions
mischiefs
embarrassments
impeachments
indiscretions
PUBLIUS
unenlightened
confederated
Archons
suffrages
Ephori
Cosmi
usurpations
encroachments
Ephori
usurpations
PUBLIUS
impeachments
PUBLIUS
impeachments
impeachments
animosities
partialities
inquisitors
impeachments
unawed
impeachments
impeachments
impeachments
disposers
impeachments
overbalanced
impeachments
impeachments
reprobated
PUBLIUS
Impeachments
impeachments
wellestablished
encroachments
impeachments
encroachments
prevalency
impeachments
impeachments
disquisitions
impeachments
counterpoises
impeachments
suffrages
impeachments
impeachments
prostituted
PUBLIUS
Pennsylvanis
impeachments
inveighed
mistresses
voluptuousness
visages
janizaries
disingenuity
expedients
applauses
LAW''
officers''
session''
years''
palliated
PUBLIUS
V
preestablished
PUBLIUS
Confederated
crown's
comfort''
preferments
PUBLIUS
TAMONY
Blackstone's
p
seditions
repub
lican
intrusted
votaries
Achaeans
Praetors
mischiefs
plebeians
rivalships
caprices
jarrings
anycounterbalancing
weightiest
scrunity
mischiefs
lic
ONE''
nattainable
Decemvirs
PUBLIUS
Lolme
seditions
repub
lican
intrusted
votaries
Achaeans
Praetors
mischiefs
plebeians
rivalships
caprices
jarrings
anycounterbalancing
weightiest
scrunity
mischiefs
lic
ONE''
nattainable
Decemvirs
PUBLIUS
Lolme
comports
indued
years'
encroachments
PUBLIUS
expedients
fellowcitizens
readmission
resentments
suffrages
overbalanced
PUBLIUS
largesses
allurements
selfdefense
enaction
missteps
mischiefs
opposers
PUBLIUS
seditions
resentments
welltimed
PUBLIUS
enaction
years'
intrusted
intrusted
PUBLIUS
partialities
antipathies
animosities
suffrages
partialities
antipathies
animosities
suffrages
venalty
venalty
PUBLIUS
uncomplying
mischiefs
embarrassments
cavils
PUBLIUS
encroachments
oppressions
bulwarks
encroachments
oppressions
mischiefs
PUBLIUS
Martin's
impeachments
PUBLIUS
judicary
unredressed
bickerings
animosities
cognizances
States''
emited
judicatories
inconviences
mischiefs
wellinformed
mischiefs
PUBLIUS
is''
impeachments
judical
usurpations
encroachments
contraventions
usurpations
impeachments
usurpations
intrusted
impeachments
AUTHORUZE
prevalency
sovereignties
inconveniencies
PUBLIUS
COURT''
DICTIO
juris
dictio
judicatories
sovereignties
T
intrusted
judicatories
establish''
PUBLIUS
generals''
oppressions
impeachments
intrusted
heretofore''
wellregulated
litigations
judicatories
embarrassments
unpardonable
encroachments
encroachments
PUBLIUS
opposers
attainted
Usays
e
emphatical
abridgements
preserved''
intrusted
overbalanced
rivalship
defaulters
railings
PUBLIUS
Blackstone's
p
Blackstone's
p
asperities
disputants
concealments
intemperances
T
encroachments
Usays
PUBLIUS
Hume's
Etext
WORDS MISSPELLED: 935
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 196784
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,725 @@
MISSPELLED WORDS
Etext
Etexts
Etexts
Etexts
Grimms'
Etext
Etext
txt
etexts
txt
txt
Etext
Dudding
hotmail
jbickers
ihug
nz
Dagny
dagnyj
hotmail
Etexts
Etexts
etext
Etexts
Etexts
Etext
x
Etexts
Hart's
CMU
CMU
P
O
S
prairienet
org
org
org
prairienet
org
etexts
http
promo
pg
Etexts
etext
http
promo
pg
metalab
unc
edu
cd
docs
cd
dir
mget
GUTINDEX
e
g
GUTINDEX
GUTINDEX
ETEXTS
etext
etext
ETEXT
tm
etext
etext
etext
TM
ETEXTS
tm
etext
tm
etexts
S
etext
etexts
etexts
etext
etext
tm
etext
etext
ETEXT
ETEXT
etext
etext
tm
etext
etext
etext
cessing
etext
etext
etext
etext
etext
OCR
etexts
ETEXTS
Ver
Etext
Dudding
hotmail
jbickers
ihug
nz
Dagny
dagnyj
hotmail
PREPARER'S
Grimms'
und
Hausmarchen
Edwardes
JORINDA
JORINDEL
VIST
KORBES
FUNDEVOGEL
HOLLE
ASHPUTTEL
HUNTSMEN
KNOWALL
gardener's
gardener's
place'
cage'
king's
brothers'
king's
Jip
Jip
thirst'
Tis
JORINDA
JORINDEL
Jorinda
Jorindel
Jorindel
Jorinda
Jorindel
Jorindel
Jorinda
mourn'd
Jorindel
Jorinda
Tu
whu
Tu
whu
Tu
whu
Jorindel
Jorindel
Jorindel
Jorinda
sorrowed
Jorinda
disenchanted
Jorinda
Jorindel
Jorindel
Jorinda
Jorinda
Jorinda
jollily
in'
king's
king's
king's
king's
kings'
king's
king's
baker's
king's
king's
kings'
safe'
king's
water's
O
Ilsabill
Ilsabill
O
Ilsabill
Ilsabill
O
Ilsabill
Ilsabill
water's
O
Ilsabill
Ilsabill
O
O
Ilsabill
Ilsabill
Ilsabill
O
Ilsabill
King's
fly's
bear's
bear's
Yes'
prince's
prince's
godchildren
gone'
mouse's
bridegroom's
Falada
bridegroom's
Falada
Falada
instead'
Falada
Falada
king's
Curdken
slaughterers
road'
Falada
Falada
Falada's
Curdken
Falada
Falada
hangest
gangest
Curdken
Curdken's
whirl'd
comb'd
curl'd
Curdken's
Falada's
Falada
Falada
hangest
gangest
Curdken
Curdken's
whirl'd
comb'd
curl'd
Curdken
Curdken
Falada
Falada
hangest
gangest
Curdken
Falada
Falada
Curdken's
whirl'd
comb'd
curl'd
Curdken's
Curdken
Falada
nutshells
duck's
Partlet's
jollily
eggshells
morning'
VIST
KORBES
Korbes
Korbes
Korbes's
Korbes
ells
king's
king's
king's
king's
Gothel
does'
Gothel
king's
Rapunzel's
king's
king's
king's
FUNDEVOGEL
Lina
Fundevogel
Fundevogel
Lina
Lina
Sanna
Lina
Fundevogel
Lina
Fundevogel
Fundevogel
Lina
Sanna
Fundevogel
Lina
Fundevogel
Fundevogel
Lina
simpletons
Lina
Fundevogel
Fundevogel
Lina
Lina
Fundevogel
Fundevogel
Lina
tailor's
strength'
tailor's
huntsmen
king's
pocketsful
huntsmen
huntsmen
huntsmen
king's
O
sluggards
B
Hansel's
witch's
witch's
HOLLE
baker's
Holle
Holle
Holle
Holle
Holle
Holle
doo
Holle's
Holle
Holle
Holle
doo
time'
wolf'
wolf's
wolf's
morning'
strewed
murderers'
murderers'
murderers'
murderers'
murderers'
murderers'
shewed
well'
cow's
cow's
disheartened
myself'
again'
cow's
wolf's
miller's
miller's
miller's
miller's
miller's
miller's
days'
ICHABOD
SHANKS
jeered
RUMPLESTILTSKIN
miller's
miller's
raven's
krr
krr
miller's
talers
raven's
talers
cow's
talers
talers
miller's
strewed
O
pedlars
pedlars
chafed
chafed
Catherine's
witch's
breadcrumbs
Roland's
Roland's
windowframe
O
Snowdrop's
O
dwarfs'
dwarfs'
king's
dwarfs'
Snowdrop's
king's
king's
king's
king's
huntsmen
huntsmen
king's
king's
sense'
Elsie's
fowler's
years'
reward'
musician's
florins
dwarf's
pity's
florins
ASHPUTTEL
Ashputtel
Ashputtel's
king's
Ashputtel
dishful
hours'
linnets
Ashputtel
Ashputtel
linnets
Ashputtel
shame'
Ashputtel
Ashputtel
king's
king's
home'
Ashputtel
Ashputtel
king's
king's
Ashputtel
king's
Ashputtel
Ashputtel
king's
king's
time'
king's
Ashputtel
king's
Ashputtel
Ashputtel
king's
king's
strewed
sacksful
king's
king's
bleated
gorged
beast's
kings'
bees'
disenchanted
king's
dwarf's
king's
shoemaker's
wights
sorrowed
winter's
cuffings
Marleen
Marleen
Marleen
Marleen
Marleen
Marleen
Marleen
Kywitt
Kywitt
Kywitt
Kywitt
shoemaker's
Kywitt
Kywitt
Kywitt
Kywitt
miller's
Kywitt
Kywitt
Kywitt
Kywitt
Marleen
Marleen
Marleen
Marleen
Kywitt
Kywitt
Marleen
Kywitt
Kywitt
Marleen
Marleen
sowed
yoked
calves'
sheep's
ecclesiastics
cunningest
chaffinch's
king's
shinest
shinest
blowest
griffin's
woes
Jip
Jip
him'
king's
soldier's
soldier's
soldier's
soldier's
king's
king's
unconsumed
king's
Dummling
Dummling
Dummling
Dummling
Dummling
Dummling
Dummling
goodness'
Dummling
Dummling
Dummling
king's
Dummling
cellarful
Dummling
Dummling
Dummling
king's
Dummling
Dummling
Dummling
ovenful
Dummling
king's
Dummling
Dummling
Dummling
king's
Dummling
it'
overhung
journey's
brothers'
right'
journey's
king's
huntsmen
prince's
king's
king's
O
thoughout
road'
frolick'd
HUNTSMEN
king's
king's
king's
king's
huntsmen's
huntsmen's
huntsmen
king's
huntsmen
huntsmen
huntsmen
king's
huntsmen
king's
huntsmen
huntsmen
king's
huntsmen
huntsmen
king's
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
Heinel
traitors'
Heinel
KNOWALL
Crabb
talers
B
C
Knowall
Knowall
Crabb
Knowall
Grete
nobleman's
Crabb
Grete
Grete
Grete
Grete
Crabb
B
C
Knowall
play'
tis
O
Kehrewit
said'
want'
heart'
asleep'
one'
stripes'
O
sexton's
talers
talers
ropemaker's
talers
talers
talers
Au
miau
farthings
gudgeons
gudgeons
Wallface
baker's
king's
king's
king's
jeered
huntsmen
huntsmen
king's
king's
gardener's
king's
king's
king's
ducats
king's
ducats
gardener's
hobblety
hobblety
Hans'
king's
hobblety
king's
king's
king's
king's
king's
gardener's
gardener's
besmeared
huntsmen
huntsmen
huntsmen
king's
king's
king's
king's
king's
king's
king's
bleated
little'
bear's
mercy's
king's
Wilhelm's
Tales'
Etext
WORDS MISSPELLED: 718
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 103614
@@ -0,0 +1,774 @@
MISSPELLED WORDS
Jonze
INT
THEODORE'S
parents'
pg
O
S
Beautifulhandwrittenletters
pg
INT
THEODORE'S
Badass
Buh
INT
THEODORE'S
pg
emails
Lewman's
mopey
pg
emails
INT
handheld
betw
INT
INT
THEODORE'S
INT
THEODORE'S
pg
INT
THEODORE'S
burrito
D
INT
THEODORE'S
INT
THEODORE'S
INT
THEODORE'S
pg
SEXYKITTEN
SexyKitten
SEXYKITTEN
BigGuy
SEXYKITTEN
studmuffin
pg
SEXYKITTEN
sexykitten
SEXYKITTEN
Mmm
Um
SEXYKITTEN
SEXYKITTEN
SEXYKITTEN
pg
SEXYKITTEN
Um
SEXYKITTEN
SEXYKITTEN
SEXYKITTEN
SEXYKITTEN
SEXYKITTEN
AHHHHHHHHHHHH
SEXYKITTEN
pg
SEXYKITTEN
INT
electronica
INT
THEODORE'S
pg
Mmm
Uh
um
pg
what'll
Samantha
SAMANTHA
pg
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
hundredths
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Theodore's
SAMANTHA
Um
pg
D
SAMANTHA
emails
emails
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
INT
THEODORE'S
SAMANTHA
Um
SAMANTHA
SAMANTHA
SAMANTHA
Theodore's
SAMANTHA
SAMANTHA
pg
SAMANTHA
Samantha
Theodore's
SAMANTHA
Theodore's
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
INT
THEODORE'S
Theo
Uh
um
pg
INT
THEODORE'S
pg
INT
THEODORE'S
Theodore's
SAMANTHA
SAMANTHA
pg
Uh
SAMANTHA
SAMANTHA
soooo
Theodore's
fuckface
fuckhead
shitface
fuckhead
SAMANTHA
pg
fuckhead
farts
SAMANTHA
Lewman
SAMANTHA
Lewman
SAMANTHA
goddaughter's
pg
SAMANTHA
SAMANTHA
laude
SAMANTHA
SAMANTHA
emails
SAMANTHA
SAMANTHA
Samantha
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Samantha
pg
SAMANTHA
SAMANTHA
Samantha
snickers
INT
pg
Theo's
INT
INT
pg
Theodore's
SAMANTHA
SAMANTHA
emails
pg
INT
HALLYWAY
SAMANTHA
SAMANTHA
SAMANTHA
pg
INT
THEODORE'S
INT
THEODORE'S
SAMANTHA
SAMANTHA
SAMANTHA
something's
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Hmmm
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Mopey
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
Gooood
Samantha
SAMANTHA
pg
Uh
SAMANTHA
Aw
Samantha
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
INT
pg
INT
Aw
pg
Umm
pg
Um
um
pg
Umm
INT
THEODORE'S
t
SAMANTHA
Samantha
SAMANTHA
pg
Uh
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
um
room's
pg
SAMANTHA
nevermind
SAMANTHA
SAMANTHA
pg
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
INT
THEODORE'S
SAMANTHA
emails
SAMANTHA
Umm
SAMANTHA
pg
SAMANTHA
SAMANTHA
uh
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
Samantha
SAMANTHA
INT
Theodore's
SAMANTHA
Mmm
SAMANTHA
INT
Samantha
pg
Samantha
SAMANTHA
Theodore's
SAMANTHA
SAMANTHA
butthole
Samantha
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Theodore's
Mmmm
SAMANTHA
pg
Theodore's
Theodore's
INT
SAMANTHA
Theodore's
SAMANTHA
D
SAMANTHA
pg
SAMANTHA
SAMANTHA
INT
THEODORE'S
pg
INT
THEODORE'S
pg
Theo
INT
THEODORE'S
Theo
Theo
pg
INT
pg
INT
THEODORE'S
Samantha
SAMANTHA
SAMANTHA
Da
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
Aww
SAMANTHA
SAMANTHA
INT
LEWMAN'S
Samantha
pg
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
Jocelyn
JOCELYN
SAMANTHA
Ohh
JOCELYN
JOCELYN
JOCELYN
Samantha
pg
JOCELYN
Mmmhmm
Theo
Jocelyn
JOCELYN
Samantha
SAMANTHA
JOCELYN
SAMANTHA
JOCELYN
SAMANTHA
JOCELYN
SAMANTHA
JOCELYN
SAMANTHA
JOCELYN
Mmmhmm
SAMANTHA
JOCELYN
Um
SAMANTHA
JOCELYN
pg
SAMANTHA
JOCELYN
SAMANTHA
INT
freaking
Onscreen
pg
Yay
pg
Ish
Samantha
pg
pg
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
soooo
T
pg
everything's
pg
excited's
everything's
L
Samantha
pg
Prozac
INT
THEODORE'S
Samantha
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Um
soooo
Samantha
pg
SAMANTHA
SAMANTHA
Um
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Byeee
pg
INT
THEODORE'S
Samantha
Tatiana
TATIANA
TATIANA
Theodore's
Samantha
pg
Tatiana
TATIANA
Tatiana
INT
THEODORE'S
Samantha
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
website
SAMANTHA
emailing
Samantha
pg
SAMANTHA
SAMANTHA
Um
SAMANTHA
SAMANTHA
INT
THEODORE'S
pg
Samantha
Samantha's
SAMANTHA
Samantha's
SAMANTHA
SAMANTHA
uh
Um
Wilsons
laude
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
INT
THEODORE'S
pg
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Samantha
SAMANTHA
pg
SAMANTHA
Samantha
compli
SAMANTHA
Samantha
pg
SAMANTHA
SAMANTHA
SAMANTHA
Theodore's
pg
SAMANTHA
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
um
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
Samantha
Samantha
Samantha
SAMANTHA
INT
pg
Theo
her's
pg
INT
Theo
Theo
pg
INT
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
Aw
SAMANTHA
Samantha's
Samantha
Tatiana
Samantha
pg
ya
Tatiana
Samantha
earpieces
SAMANTHA
TATIANA
SAMANTHA
TATIANA
Tatiana
Theodore's
SAMANTHA
Tatiana
TATIANA
pg
SAMANTHA
SAMANTHA
TATIANA
Samantha
SAMANTHA
Aw
Samantha
SAMANTHA
Yikes
pg
SAMANTHA
Samantha
SAMANTHA
INT
Theodore's
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
ea
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
Um
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
Samantha
SAMANTHA
INT
Everything's
INT
Samantha
SAMANTHA
pg
INT
SAMANTHA
SAMANTHA
SAMANTHA
Why's
SAMANTHA
s
pg
SAMANTHA
SAMANTHA
SAMANTHA
Samantha
Samantha
SAMANTHA
pg
Samantha
SAMANTHA
Samantha
SAMANTHA
SAMANTHA
pg
INT
THEODORE'S
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
pg
INT
THEODORE'S
Samantha
Samantha
Samantha
Samantha
Samantha
Samantha
Samantha
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
SAMANTHA
INT
THEODORE'S
INT
THEODORE'S
INT
THEODORE'S
INT
THEODORE'S
Theodore's
SAMANTHA
SAMANTHA
Um
pg
SAMANTHA
INT
THEODORE'S
INT
THEODORE'S
Samantha
SAMANTHA
SAMANTHA
SAMANTHA
SAMANTHA
pg
INT
THEODORE'S
SAMANTHA
SAMANTHA
SAMANTHA
Samantha
Samantha's
SAMANTHA
pg
SAMANTHA
SAMANTHA
SAMANTHA
INT
THEODORE'S
INT
THEODORE'S
INT
THEODORE'S
Samantha
pg
INT
THEODORE'S
Klausen
pg
INT
WORDS MISSPELLED: 767
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 18402
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,962 @@
MISSPELLED WORDS
Chazelle
L
TECHNO
L
Thelonious
Prius
MIA
L
MIA
Mia
MIA
Mia
AHHHHHHHHHHHHHHHT
Mia
Mia
INT
Mia
MIA
Mia
Mia
Mia
Mia
Mia
Mia's
Mia
MIA
MIA
MIA
INT
Mia's
MIA
MIA
Turner's
Mia
Yoohoo
MIA
Mia
scurries
Mia
Mia
Mia
INT
Mia
INT
MIA'S
Mia
Ingrid
Uta
Mia
Mia
Mia
MIA
Cheetos
Mia
How'd
MIA
Jen
MIA
Jen
MIA
Mia
CAITLIN
Mia
Mia
MIA
O
S
Mia
Mia's
MIA
inbox
beelines
Mia's
MIA
MIA
Mia's
Mia
clich
Mia
clich
s
Caitlin
Mia
Mia
Mia
Caitlin
Mia
Mia
Caitlin
Mia
INT
Mia
D
J
clich
Mia
Mia
Mia
carousers
clich
s
Mia
MIA
O
S
Mia
MIA
Mia
AHHHHHHHHHHHHHHHHHHHHHHT
Mia's
RAYO'S
s
Deco
BEEK
TAPAS
INT
SEBASTIAN'S
Steinway
Sebastian's
tapas
Seb
tapas
Uh
long's
Shanghai'ed
Shanghai'ed
INT
SEBASTIAN'S
Thelonious
LP
INT
beelining
Seb
INT
Mia
Mia
Sebastian's
Mia
MIA
SEBASTIAN'S
Mia
Mia
Mia
Mia
MIA
Mia's
Mia
INT
Mia
MIA
GT
achromatopsia
MIA
D
O
perp
P
D
MIA
O
S
trippin'
MIA
Jamal
trippin'
Mia
s
Mia
Mia
Carlo's
Mia
MIA
y'all
MIA
Mia
Mia
INT
Mia
Mia
MIA
MIA
MIA
MIA
MIA
MIA
Uh
barista
Mia
smirks
MIA
MIA
Mia
Mia
lookin'
Mia
Warners
Mia
Charlize
MIA
MIA
MIA
MIA
Prius
Prius
MIA
Mia
Mia
MIA
MIA
n't
MIA
MIA
MIA
Mia
MIA
MIA
Uh
MIA
MIA
MIA
Mia
Mia
Mia
Mia
Mia
blossoming
Mia
Mia
MIA
K
Prius
MIA
MIA
MIA
Mia
INT
Mia's
MIA
Mia
MIA
MIA
Mia
MIA
MIA
Uh
How'd
Mia
Mia
MIA
Mia
fa
ade
MIA
Ingrid
Bogart's
Mia
MIA
MIA
MIA
MIA
Beek
tapas
MIA
tapas
joke's
Mia
L
P
P
MIA
C
Mia
D
O
S
Mia
How'd
MIA
O
S
Mia
MIA
MIA
soundstage
MIA
MIA
O
C
Should've
soundstages
MIA
MIA
MIA
MIA
mic
MIA
MIA
MIA
MIA
MIA
Mia
INT
Mia
MIA
G
Mia
MIA
facials
MIA
Mia
Mia
Pantages
Mia
MIA
Beek
music's
sizzles
Mia
Mia
INT
MIA
INT
Mia
Sebastian's
Mia
MIA
MIA
O
C
MIA
bulletsssss
Mia
MIA
MIA
me's
MIA
MIA
Mia
Mia
Mia
Mia
MIA
MIA'S
O
S
MIA
MIA'S
O
S
MIA
MIA'S
O
S
MIA
MIA'S
O
S
MIA
MIA'S
O
S
MIA
MIA'S
O
S
MIA
MIA'S
O
S
ABC
HBO
MIA
MIA'S
O
S
MIA
INT
Mia
Pfeiffer's
Mia
Mia
O
S
Mia
INT
Mia
Mia's
Mia
Mia
MIA
Kapish
Mia
MIA
Mia
INT
MIA'S
Mia
MIA'S
O
S
Mia
INT
MIA'S
Mia
Mia
Fritos
Mia
Mia
MIA
Mia
O
S
Mia
INT
Sebastian's
INT
Mia
Josh's
Fianc
e
Mia
Mia
Mia
INT
Mia
eco
Mia
Sebastian's
morphed
Mia
MIA
Mia's
INT
Mia
Sebastian's
Mia
INT
Mia
Sebastian's
Mia
Mia
Mia
MIA
Sebastian's
INT
Mia
Mia's
unspools
Mia
Mia
INT
MIA'S
Mia's
O
S
Mia
MIA
O
S
MIA
AHHHHHHHHHHHHHHHHHHHHHHHHHHHT
MIA
MIA'S
Mia
Sebastian's
MIA
O
S
Mia
Mia
s
Mia
BEEK
TAPAS
Mia
Mia
s
Deco
INT
Sebastian's
Mia
Mia
O
S
Mia
Mia
Sebastian's
Mia
Mia
Mia
MIA
Mia
how've
Mia
MIA
Mia
INT
SEBASTIAN'S
MIA
MIA
Mia's
MIA
MIA
MIA
MIA
Mia
MIA
MIA
Seb's
MIA
MIA
MIA
Beek
MIA
play's
Mia
MIA
MIA
MIA
MIA
MIA
MIA
MIA
Mia
INT
SEBASTIAN'S
Mia's
MIA
O
S
MIA
O
S
INT
Keith's
Sebastian's
Sebastian's
olds
INT
SEBASTIAN'S
Mia
Mia
INT
INT
Mia
INT
INT
Mia
INT
INT
Mia
INT
Sebastian's
INT
Mia
INT
YOUTUBE
Mia
INT
SEBASTIAN'S
Mia
INT
SEBASTIAN'S
Mia
INT
SEBASTIAN'S
INT
SEBASTIAN'S
Mia
INT
SEBASTIAN'S
Mia
INT
SEBASTIAN'S
INT
SEBASTIAN'S
Mia
MIA
INT
Mia
Mia
Mia
Mia
synth
Mia
bandmates
Mia
Mia
Mia
Mia's
INT
Mia
Mia
s
Mia
Mia
MIA
Mia
Seb
MIA
Mia
MIA
MIA
Seb
MIA
Mia
Seb
Mia
MIA
MIA
Mia
overthink
Mia
INT
Mia
e
MIA
INT
SEBASTIAN'S
Mia
sashaying
Mia
Mia's
Sebastian's
INT
SEBASTIAN'S
Mia
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
Mia
MIA
MIA
MIA
MIA
MIA
show's
MIA
MIA
Mia
Mia
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
MIA
Shangri
MIA
Mia
MIA
MIA
MIA
LP
Mia
Mia
MIA
Mia
MIA
Mia
INT
Mia
INT
ya
Sebastian's
Mojo
INT
INT
Mia
Mia
INT
band's
pantomiming
Photographer's
Mia's
INT
Mia
wallpapered
Mia
Mia
Mia
INT
Mia
O
S
O
S
O
S
O
S
Mia
Mia's
Mia
Mia
MIA
Unmoored
MIA
MIA
MIA
MIA
MIA
Mia
MIA'S
Mia
INT
MIA'S
Mia
INT
MIA'S
Mia
fianc
McKenzies
Sebastian's
INT
SEBASTIAN'S
O
S
Mia
O
S
Mia's
O
S
O
S
INT
MIA'S
Mia's
MIA'S
MIA
Mia
MIA'S
MIA
MIA'S
MIA
Mia's
MIA'S
Mia
MIA
MIA'S
MIA'S
MIA
MIA'S
Mia's
Mia
Mia's
MIA'S
Mia's
SEBASTIAN'S
Mia
MIA'S
SEBASTIAN'S
Mia
MIA
MIA
MIA
Mia
MIA
MIA
MIA
MIA
MIA
MIA
lookalikes
MIA
MIA
MIA
MIA
MIA
Mia
MIA
Mia
MIA
Mia
MIA'S
MIA'S
Sebastian's
Mia
Mia
Mia
Deco
soundstages
INT
Mia
Mia
Mia
INT
INT
MIA
Mia
Mia
MIA
MIA
Mia
Mia
Mia's
MIA
Mia's
Mia
Mia
Mia
Mia
MIA
MIA
MIA
MIA
MIA
MIA
MIA
Mia
Mia
MIA
Mia's
MIA
MIA
MIA
Mia
L
fa
ades
INT
MIA
MIA
BARISTA
Mia's
Mia
Mia
MIA
Mia
Barista
Mia
INT
s
Carson's
How'd
MARMONT
Mia
INT
MARMONT
Mia
Mia's
INT
SEBASTIAN'S
INT
SEBASTIAN'S
MIA
INT
Seb
Seb
Edgar's
INT
MARMONT
Mia
Mia
MIA
Mia
INT
Mia
MIA
INT
Mia
Mia
MIA
Mia
s
Deco
music's
Mia
Mia
SEB'S
Mia
Mia
INT
Mia's
Sebastian's
Sebastian's
Carmichael's
Mia
Mia
Manny
Halloran
Mia
Seb's
Mia
Mia
Mia
Sebastian's
Mia
Mia
Mia
Mia
MIA
Mia
Mia
INT
Mia
INT
INT
Mia
Mia's
INT
SOUNDSTAGE
Mia
L
L
L
Mia
figments
s
s
Mia
Mia
Mia
Mia
Mia
Sacr
Triomphe
CAVEAU
HUCHETTE
Caveau
Mia
Caveau
Mia
Mia
Mia's
Mia
L
Sebastian's
combo's
Mia
Sebastian's
Mia
Mia
Mia
MIA
Mia
Mia
Mia
Sebastian's
L
WORDS MISSPELLED: 955
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 17756
@@ -0,0 +1,871 @@
MISSPELLED WORDS
paddocks
paddocks
toi
toi
fuchsias
Aah
Baaa
palings
Stubbs'
pared
Baaa
Burnells'
Florrie
Florrie
Myriads
Gran
Splish
Splosh
Splish
Splosh
Burnell
Stanley's
unpractical
Burnell
Beryl's
O
plaited
nasturtiums
Kezia
Kezia
stick's
Linda's
Beryl's
goos
goos
Isa
Kezia
Kezia
Kezia's
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Lottie's
Isabel's
Josephs
Josephs
girls'
boys'
S
J
brogramme
bischief
help's
Josephs
pinchers
Burnell
Kezia
Josephs
Josephs
washhand
washhand
Limonadear
Josephs
Kezia
Kezia
nemeral
Pip's
nemeral
V
Kezia
wafted
lolloping
Fairfield's
o
Kember
Fairfield's
Kember
Kember
Kember's
Kember
Kember's
Kember
Kember
Kember
yawned
Kember
Kember
Beryl's
Kember
unfastening
Kember
neighing
Kember
Kember
Kember
Kember
Burnell
picotees
nasturtiums
Linny
Linda's
Linny's
Burnell
Beryl's
anybody's
laved
water's
anemones
pawa
Trouts'
Kezia
shabbiest
sprigged
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Kezia
Burnells'
perishall
canningbals
Stubbs's
STUBBS'S
sandshoes
HANSOME
GOLE
photers
dozzing
enlargemint
photers
dis'eartening
larst
Many's
ospital
judgmint
meaningly
mutting
Stubbs's
kitching
Burnells'
Kezia
bee's
ninseck
Kezia
ninseck
What'll
Kezia's
Kezia
Mooe
ooo
er
Bss
ss
Kezia
Kezia
Ke
Ss
Ss
X
Chinaman's
Linda's
dames
Beryl's
Burnells'
Beryl's
Jonathan's
brooded
warder's
inkpots
Florrie
Florrie
Burnells'
enfolded
Burnell
mightn't
trary
palings
nasturtiums
Kember's
palings
Beryl's
Kember
Kember
Kember
Kember
er
band's
H'm
karakas
karaka
karakas
Ra
ther
Sheridan's
castors
inkpot
inkpot
Sadie's
O
florist's
Jose's
ary
Chan
ges
ary
Chan
ges
ary
kening
m'm
Jose's
Godber's
Godber's
Yer
Godber's
Tuk
tuk
tuk
Hans's
Godber's
Godber's
Hawke
Godber's
Godber's
Sheridans'
Sheridans
cooed
Sheridans'
uneaten
palings
Scott's
meaningly
er
er
thenk
Em's
e
Em's
Constantia
Constantia
Constantia
porter's
Constantia
Constantia
Constantia
Constantia's
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Andrews
Josephine's
Constantia
Andrews
Constantia
Andrews
Constantia
Andrews
Andrews
mindedly
mindedly
Constantia's
Tukes
Andrews
contrayvance
buttah
silvah
bordah
tayny
buttah
gayme
Andrews
buttah
Andrews
Constantia
Andrews
Constantia
Andrews
bittah
marmalayde
Constantia
Andrews
Farolles
Farolles
Constantia
Farolles
Constantia
Farolles
Farolles
Constantia
Farolles
Constantia
Farolles
Farolles
Farolles
Constantia
Constantia
Constantia
Farolles
V
Constantia
Constantia
Constantia
bu
Constantia
thing's
Josephine's
Constantia's
Constantia
Constantia
doorhandle
Constantia
Constantia
klop
klopped
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Josephine's
Constantia
Constantia
Constantia
Constantia
brims
Constantia
Constantia
Constantia
Josephine's
Constantia's
Hilda
Constantia
Busks
Constantia
Constantia
Constantia
aunties
Buszard's
Constantia's
unmanlike
Constantia
Paddington
Constantia
What've
Cyril's
Josephine's
brooded
esstrordinary
esstrordinary
Constantia
X
Constantia
Constantia
Constantia
Constantia
Constantia
meaningly
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
Mightn't
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
thieved
Constantia
Yeep
eyeep
yeep
Yeep
eyeep
yeep
Constantia
Constantia
Constantia
Constantia
Constantia
Constantia
months'
Reggie
Chinny
Pekes
Reggie's
Alick
widow's
Reggie
Reggie
Chinny
Reggie
Reggie
Reggie
Pekes
mater's
Chinny's
gloomed
Reggie
duckings
Reggie
Reggie
knowest
Reggie
Reggie
Reggie
Reggie
Reggie
Reggie
Reginald's
Reginald's
Reggie
Reggie
Reggie
Reggie
t
Reggie
Reggie
Reggie
Reggie
Reggie
gardener's
imploringly
Reggie
Reggie
Reggie
aw
Reggie
Reggie
Reggie
Reggie
Reggie
Raddick's
Raddick's
croupiers
Hennie
Raddick
Raddick
Raddick
Hennie
Raddick
Raddick
MacEwen
Privee
Raddick
MacEwen
MacEwen
R
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
eclair
Hennie
Hennie
Enfin
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Hennie
Allie
veet
Hennie
Raddick
Hennie
crimsoned
L
parding
Gran
Gran
gran's
Gran
gi'
Gran
Gi'
what'll
gran
thing's
railings
kitching
arsking
chimley
er
anging
beedles
beedle
beedle
ospital
Maudie
emigrimated
Lennie
Lennie
Myrtil
bottils
Lennie
gran's
gran's
Lennie
arsk
Lennie's
gran's
Lennie
gran
Lennie
Lennie
gran's
Gran
Lennie
arsking
gentleman's
strangers'
toyshop
babies'
Isabel's
Isabel's
Isabel's
Hillo
imploringly
Isabel's
hearthrug
petunias
petunias
Moira
Morrison's
Moira
Moira
Bettingford
Isabel's
Hillo
William's
Moira
fishmonger's
Moira
ated
Moira
shopman
shopman
Avanti
Noah's
Sh
Moira
Moira
Isabel's
William's
mes
Moira
London's
Moira
years'
Light's
Isabel's
Moira
complacently
O
mine's
Sh
sh
sh
Moira
jeering
William's
Moira
Isa
Picton
Fenella's
Fenella's
Fenella
Fenella
Mia
oo
oo
O
O
Picton
Picton
Fenella
Fenella's
Fenella
Mia
oo
oo
O
O
Fenella
Fenella
Fenella
Fenella
Fenella
Fenella
Fenella
Picton
Fenella's
Fenella
unclasped
Fenella
Fenella
Fenella
indiarubber
Fenella
Fenella
Fenella's
certingty
Fenella
Fenella
Fenella
unstrapping
Fenella
Fenella
Fenella
Fenella
Fenella
Fenella
Fenella
Picton
Fenella
granddaughter's
Fenella
Fenella
Fenella
Fenella
Fenella
Fenella
Picton
Penreddy
Fenella
Fenella
Fenella
yestiddy
Penreddy
scones
Fenella
picotees
bluchers
Fenella
yawned
Fenella
Fenella
Fenella
Fenella
Yer
Fenella
Jardins
Publiques
bandsmen
flutey
railings
tiddle
um
tiddle
um
tiddley
um
Brill's
mightn't
Brill's
fu
ur
chere
baker's
baker's
unclasped
necklet
tuberoses
Jose's
ladies'
bodices
Leila's
girls'
Bells'
Floor's
Neaves'
o
Twinkletoes
ning
Beazley
Meadows'
Sh
sh
Meady
Beazley
Ro
o
ses
nter
u
sic's
contraltos
headmaster's
Music's
Drear'
Dre
Beazley
Music's
Ear'
mistress's
Meadows'
o'erladen
oo
o'erladen
Meadows'
Hammond's
Gaven
Gaven
Gaven
wan'
Janey
Jean'll
yer
Hammond's
Hul
Hul
Janey
Thenks
Janey
Janey
Hillo
Aun'
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey's
Janey
Janey
Janey
Janey
Janey
Cooktown
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
eau
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey
Janey's
Janey
enfolded
fiddler's
bodices
hags
muslins
larking
An'
Ticklers
Ool
Su
perior
er
Fevvers
Fevvers
an'
scrunching
ticklers
golliwogs
Neave
Neave
trams
Neave
Neave
H'm
h'm
Neave
Harold's
Neave
Neave
H'm
h'm
hydrangeas
Neave
Neave
Neave
Marion's
Neave
Neave
train's
overweights
Neave
Neave
Lucile
Teddie
Neave
Neave
H'm
h'm
Marion's
Charlotte's
Neave
Neave
Neave
Neave
dresser's
upholstress
jing
James's
thinking's
ebook
http
manybooks
WORDS MISSPELLED: 864
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 58287
@@ -0,0 +1,7 @@
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 20
@@ -0,0 +1,802 @@
MISSPELLED WORDS
L
PUNKE
S
campfires
s
s
s
Henry's
Captain's
snickers
roastin'
Fitzgerald's
ANSTADT
s
O
S
s
BRIDGER
Bridger
BRIDGER
Bridger'll
Bridger
Bridger
BRIDGER
Bridger
Bridger
Anstadt
BRIDGER
ARIKARA
MOHAWKS
Arikara
Arikara
Anstadt
Bridger
Arikara
Arikara
Bridger
Bridger
ANSTADT
Bridger's
BRIDGER
ARIKARA
O
S
LONGPOLES
MURPHY'S
Bridger
Henry's
floatin'
Henry's
Missouri's
Ree's
outta
BRIDGER
endin'
scalped
Bridger
Fitzgerald's
Arikara
lettin'
Bridger
BRIDGER
Bridger
Bridger
Anstadt
Anstadt
tension's
BRIDGER
Bridger
Bridger
BRIDGER
shoulda
Bridger's
Bridger
Bridger's
mighta
somethin'
Bridger's
savin'
uh
Glass'
Anstadt
Lemme
workin'
workin'
Glass'
Glass'
Glass'
Fitzgerald's
thing's
Niggers
Bridger
HANDRAWN
closin'
standin'
should've
tailin'
trappin'
guidin'
Arikara
outta
Glass'
GLASS'
Brazeau
makin'
BRIDGER
nigger's
runnin'
O
S
whatever's
Anstadt
GLASS'
Glass'
Anstadt
Glass's
bear's
Glass'
Glass'
Grizzly's
Bridger's
BRIDGER
Bridger
GLASS'
BRIDGER
Bridger
Bridger
Bridger's
Glass'
Grizz
he'da
BRIDGER
Bridger
Glass'
BRIDGER
Glass'
Bridger
goddammit
Bridger
Glass'
might've
bleedin'
Bridger
Glass'
BRIDGER
Glass'
BRIDGER
Glass'
Glass'
torturin'
riskin'
gettin'
grizz
Glass'll
screamin'
BRIDGER
Bridger
Glass'
GLASS'
BRIDGER
GLASS'
Frankenstein's
Bridger
BRIDGER
hisself
Glass'
Glass'
Bridger
Bridger
O
S
Bridger
grizz
BRIDGER
Bridger
Bridger
Glass'
Anstadt
Glass'
outta
Bridger's
Whatta
Bridger
BRIDGER
Whatta
Glass'
doin'
lettin'
Henry's
Bridger
Fitzgerald's
Bridger
Fever's
O
S
O
S
sittin'
watchin'
BRIDGER
burnin'
Tryin'
movin'
Glass'
Bill's
Bridger
goin'
BRIDGER
bein'
Bridger
BRIDGER
Bridger
Glass'
Bridger's
GLASS'
POV
BRIDGER
O
S
Bridger
Bridger
BRIDGER
setta
BRIDGER
fallin'
Bridger
Bridger
Glass'
Bridger
ya
Glass's
BRIDGER
BRIDGER
Bridger
Glass'
Anstadt
BRIDGER
needin'
GLASS'
POV
Anstadt
Glass'
Bridger
Glass'
GLASS'
Glass'
Henry's
accounta
havin'
ya
ya
sufferin'
Nobody'd
Glass'
Fitzgerald's
Glass'
Bridger's
Fitzgerald's
BRIDGER
O
S
goin'
Bridger
Bridger
Bridger's
Bridger
Fitzgerald's
Bridger's
Cept
killin'
givin'
changin'
Bridger
doin'
cleanin'
Glass'
Anstadt
Bridger
Bridger
ya
walkin'
Bridger
ya
Bridger
V
O
Bridger
FITZGERALD'S
BRIDGER
BRIDGER
comin'
BRIDGER
Whatta
Fitzgerald's
Bridger
Bridger
Bridger
BRIDGER
BRIDGER
talkin'
Bridger
Bridger's
Anstadt
Bridger
BRIDGER
doin'
BRIDGER
Glass'
BRIDGER
nothin'
Bridger's
Glass's
Bridger
Arikara
Arikara's
GLASS'
POV
WHISPS
Bridger
BRIDGER
BRIDGER
Bridger
BRIDGER
BRIDGER
woulda
Bridger
BRIDGER
doin'
Bridger
BRIDGER
questionin'
accounta
feelin'
leavin'
Bridger
BRIDGER
Bridger
askin'
shitless
BRIDGER
Fitzgerald's
Bridger
Fitzgerald's
Bridger's
Bridger
Bridger's
Fitzgerald's
BRIDGER
Bridger
Bridger
Bridger's
Bridger
BRIDGER
Bridger
BRIDGER
goin'
leavin'
fire's
knowin'
Bridger
Bridger
GLASS'
Cattails
cornstalks
Cattails
Glass'
powderhorn
GLASS'S
sizzles
Glass'
O
S
Glass'
GLASS'
POV
snake's
Glass'
Glass'
SNAKE'S
water's
Brazeau
Bridger
powderhorn
water's
GLASS'
Glass'
Glass'
Glass'
INT
INT
moon's
INT
GLASS'
CAVE'S
O
S
Bridger
eether
INT
GLASS'
Anstadt
deer's
ARIKARA
GLASS'
Glass'
Arikara
Arikara
Arikara
Glass'
ARIKARA
Glass'
Arikara
Glass'
wolves'
GLASS'
wolf's
wind's
gusting
ARIKARA
pees
INT
O
S
INT
ARIKARA
squaw's
ARIKARA
scurries
INT
Glass'
ARIKARA
INT
ARIKARA
ARIKARA
Arikara
s
Glass'
Glass'
Glass'
Glass'
Glass'
Griz
Glass'
Glass'
GLASS'
Glass'
Glass'
Glass'
Glass'
campfires
pees
pees
Glass'
Feather's
GLASS'
POV
V
O
GLASS'
GLASS'
GLASS'
WAKI
Glass'
Waki
Glass'
Glass'
GLASS'
Bridger
Bridger
Bridger's
Glass'
dyin'
buryin'
Bridger
leavin'
tossin'
Bridger
givin'
accounta
gettin'
Bridger
INT
whores'
INT
Bridger
BRIDGER
O
S
Bridger
mighta
ya
BRIDGER
Bridger
Bridger
knowed
BRIDGER
BRIDGER
Bridger
INT
Bridger
hostiles
Bridger
movin'
Bridger
Bridger's
Bridger
Bridger
Bridger
Bridger
Bridger
Fitzgerald's
Bridger
Bridger
hisself
wishin'
he'da
tellin'
INT
Bridger
INT
GLASS'
POV
O
S
WAKI
Glass'
Waki
INT
Waki
Waki
Waki
Waki
Waki
Waki
healin'
Waki
Waki
Waki
Tatanka
Wicasa
O
S
Glass'
havin'
tradin'
zo
Brazeau
tryin'
zo
INT
griz
Hawk's
Arikara
Arikara
Glass'
Tatanka
Wicasa
Cottonwoods
Cottonwoods
POV
V
O
POV
warriors'
POV
Tatanka
Wicasa
Tatanka
Wicasa
Fam
wom
Wakayaja
O
S
zo
Tatanka
Wicasa
Waki
Arikara
INT
Fitzgerald's
FITZGERALD'S
POV
Fitzgerald's
Glass'
BRAZEAU
pees
INT
BRAZEAU
s
BRAZEAU
Brazeau's
BRAZEAU
Brazeau
BRAZEAU
Brazeau's
Brazeau
BRAZEAU
BRAZEAU
BRAZEAU
INT
Brazeau
BRAZEAU
Glass'
Brazeau
BRAZEAU
Glass'
Brazeau
BRAZEAU
BRAZEAU
pees
Brazeau
Bridger
INT
ya
outta
workin'
headin'
Fitzgerald's
ya
outta
BRIDGER
Bridger
Bridger's
warmin'
Fitz
Louie
walkin'
Fitzgerald's
thinkin'
scurries
Bridger
INT
Henry's
INT
O
S
POV
MURPHY'S
ANSTADT
O
S
Glass'
O
S
ARIKARA
Arikara
GUNSHOTS
Tongue's
INT
niggers
niggers
musta
listenin'
Cees
oughta
ya
s
s
goddammit
GUNSHOTS
Cees
O
S
BILL'S
POV
INT
GLASS'
room's
Bridger
BRIDGER
Bridger
Bridger's
Bridger
executioner's
Bridger
BRIDGER
dyin'
Glass'
Bridger's
BRIDGER
BRIDGER
Bridger
Bridger
Bridger
Bridger's
Henry's
BRIDGER
Bridger
BRIDGER
Bridger
Bridger
Bridger
INT
Henry's
ya
Murph
ya
Glass'
ya
ya
ya
ya
mornin'
outta
stitchin'
givin'
offerin'
findin'
makin'
whisperin'
accounta
dyin'
nigger's
Glass'
goin'
mighta
missin'
Musta
Bridger's
lyin
POV
POV
Bridger's
lookin'
ya
Weather's
walkin'
makin'
nothin'
Lange's
pistola
Fitzgerald's
leavin'
nothin'
Fitzgerald's
RMFC
mittened
goin'
When'd
Fitzgerald's
travelin'
Mocassins
nothin'
Henry's
O
S
Henry's
stayin'
Whatta
ya
Henry's
Henry's
Glass'
Anstadt
savin'
O
S
Henry's
HENRY'S
SCALPED
HENRY'S
Arikara
Henry's
Henry's
POV
horses'
ANSTADT
Anstadt
HENRY'S
HENRY'S
GLASS'
Anstadt
Fitzgerald's
Henry's
Anstadt
Anstadt
Glass'
Fitzgerald's
GLASS'
GLASS'
FITZGERALD'S
Fitzgerald's
ANSTADT
Glass'
Bridger
Anstadt
ANSTADT
Anstadt
Anstadt
ARIKARA
Tatanka
Wicasa
Arikara
Arikara
WORDS MISSPELLED: 795
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 23579
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
MISSPELLED WORDS
WORDS MISSPELLED: 0
WORDS IN DICTIONARY: 143091
WORDS IN TEXT: 158
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,25 @@
// hastable
#include<ctype.h>
typedef struct node {
char *name;
char *number;
struct Node *next;
} Node ;
node *table[26];
unsigned int hash(const char *word){
return toupper(word[0]) - 'A';
}
// tries
typedef struct node{
struct node *children[26];
char *number;
} Node;
node *trie;
@@ -0,0 +1,196 @@
// Implements a spell-checker
#include <ctype.h>
#include <stdio.h>
#include <sys/resource.h>
#include <sys/time.h>
#include "dictionary.h"
// Undefine any definitions
#undef calculate
#undef getrusage
// Default dictionary
#define DICTIONARY "dictionaries/large"
// Prototype
double calculate(const struct rusage *b, const struct rusage *a);
int main(int argc, char *argv[])
{
// Check for correct number of args
if (argc != 2 && argc != 3)
{
printf("Usage: ./speller [DICTIONARY] text\n");
return 1;
}
// Structures for timing data
struct rusage before, after;
// Benchmarks
double time_load = 0.0, time_check = 0.0, time_size = 0.0, time_unload = 0.0;
// Determine dictionary to use
char *dictionary = (argc == 3) ? argv[1] : DICTIONARY;
// Load dictionary
getrusage(RUSAGE_SELF, &before);
bool loaded = load(dictionary);
getrusage(RUSAGE_SELF, &after);
// Exit if dictionary not loaded
if (!loaded)
{
printf("Could not load %s.\n", dictionary);
return 1;
}
// Calculate time to load dictionary
time_load = calculate(&before, &after);
// Try to open text
char *text = (argc == 3) ? argv[2] : argv[1];
FILE *file = fopen(text, "r");
if (file == NULL)
{
printf("Could not open %s.\n", text);
unload();
return 1;
}
// Prepare to report misspellings
printf("\nMISSPELLED WORDS\n\n");
// Prepare to spell-check
int index = 0, misspellings = 0, words = 0;
char word[LENGTH + 1];
// Spell-check each word in text
char c;
while (fread(&c, sizeof(char), 1, file))
{
// Allow only alphabetical characters and apostrophes
if (isalpha(c) || (c == '\'' && index > 0))
{
// Append character to word
word[index] = c;
index++;
// Ignore alphabetical strings too long to be words
if (index > LENGTH)
{
// Consume remainder of alphabetical string
while (fread(&c, sizeof(char), 1, file) && isalpha(c));
// Prepare for new word
index = 0;
}
}
// Ignore words with numbers (like MS Word can)
else if (isdigit(c))
{
// Consume remainder of alphanumeric string
while (fread(&c, sizeof(char), 1, file) && isalnum(c));
// Prepare for new word
index = 0;
}
// We must have found a whole word
else if (index > 0)
{
// Terminate current word
word[index] = '\0';
// Update counter
words++;
// Check word's spelling
getrusage(RUSAGE_SELF, &before);
bool misspelled = !check(word);
getrusage(RUSAGE_SELF, &after);
// Update benchmark
time_check += calculate(&before, &after);
// Print word if misspelled
if (misspelled)
{
printf("%s\n", word);
misspellings++;
}
// Prepare for next word
index = 0;
}
}
// Check whether there was an error
if (ferror(file))
{
fclose(file);
printf("Error reading %s.\n", text);
unload();
return 1;
}
// Close text
fclose(file);
// Determine dictionary's size
getrusage(RUSAGE_SELF, &before);
unsigned int n = size();
getrusage(RUSAGE_SELF, &after);
// Calculate time to determine dictionary's size
time_size = calculate(&before, &after);
// Unload dictionary
getrusage(RUSAGE_SELF, &before);
bool unloaded = unload();
getrusage(RUSAGE_SELF, &after);
// Abort if dictionary not unloaded
if (!unloaded)
{
printf("Could not unload %s.\n", dictionary);
return 1;
}
// Calculate time to unload dictionary
time_unload = calculate(&before, &after);
// Report benchmarks
printf("\nWORDS MISSPELLED: %d\n", misspellings);
printf("WORDS IN DICTIONARY: %d\n", n);
printf("WORDS IN TEXT: %d\n", words);
printf("TIME IN load: %.2f\n", time_load);
printf("TIME IN check: %.2f\n", time_check);
printf("TIME IN size: %.2f\n", time_size);
printf("TIME IN unload: %.2f\n", time_unload);
printf("TIME IN TOTAL: %.2f\n\n",
time_load + time_check + time_size + time_unload);
// Success
return 0;
}
// Returns number of seconds between b and a
double calculate(const struct rusage *b, const struct rusage *a)
{
if (b == NULL || a == NULL)
{
return 0.0;
}
else
{
return ((((a->ru_utime.tv_sec * 1000000 + a->ru_utime.tv_usec) -
(b->ru_utime.tv_sec * 1000000 + b->ru_utime.tv_usec)) +
((a->ru_stime.tv_sec * 1000000 + a->ru_stime.tv_usec) -
(b->ru_stime.tv_sec * 1000000 + b->ru_stime.tv_usec)))
/ 1000000.0);
}
}
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
A cat is not a caterpillar.
@@ -0,0 +1,872 @@
Provided by USConstitution.net
------------------------------
[Note: Repealed text is not noted in this version. Spelling errors have been
corrected in this version. For an uncorrected, annotated version of the
Constitution, visit http://www.usconstitution.net/const.html ]
We the People of the United States, in Order to form a more perfect Union,
establish Justice, insure domestic Tranquility, provide for the common
defence, promote the general Welfare, and secure the Blessings of Liberty to
ourselves and our Posterity, do ordain and establish this Constitution for the
United States of America.
Article 1.
Section 1
All legislative Powers herein granted shall be vested in a Congress of the
United States, which shall consist of a Senate and House of Representatives.
Section 2
The House of Representatives shall be composed of Members chosen every second
Year by the People of the several States, and the Electors in each State shall
have the Qualifications requisite for Electors of the most numerous Branch of
the State Legislature.
No Person shall be a Representative who shall not have attained to the Age of
twenty five Years, and been seven Years a Citizen of the United States, and who
shall not, when elected, be an Inhabitant of that State in which he shall be
chosen.
Representatives and direct Taxes shall be apportioned among the several States
which may be included within this Union, according to their respective Numbers,
which shall be determined by adding to the whole Number of free Persons,
including those bound to Service for a Term of Years, and excluding Indians not
taxed, three fifths of all other Persons.
The actual Enumeration shall be made within three Years after the first Meeting
of the Congress of the United States, and within every subsequent Term of ten
Years, in such Manner as they shall by Law direct. The Number of
Representatives shall not exceed one for every thirty Thousand, but each State
shall have at Least one Representative; and until such enumeration shall be
made, the State of New Hampshire shall be entitled to choose three,
Massachusetts eight, Rhode Island and Providence Plantations one, Connecticut
five, New York six, New Jersey four, Pennsylvania eight, Delaware one, Maryland
six, Virginia ten, North Carolina five, South Carolina five and Georgia three.
When vacancies happen in the Representation from any State, the Executive
Authority thereof shall issue Writs of Election to fill such Vacancies.
The House of Representatives shall choose their Speaker and other Officers; and
shall have the sole Power of Impeachment.
Section 3
The Senate of the United States shall be composed of two Senators from each
State, chosen by the Legislature thereof, for six Years; and each Senator shall
have one Vote.
Immediately after they shall be assembled in Consequence of the first Election,
they shall be divided as equally as may be into three Classes. The Seats of the
Senators of the first Class shall be vacated at the Expiration of the second
Year, of the second Class at the Expiration of the fourth Year, and of the
third Class at the Expiration of the sixth Year, so that one third may be
chosen every second Year; and if Vacancies happen by Resignation, or otherwise,
during the Recess of the Legislature of any State, the Executive thereof may
make temporary Appointments until the next Meeting of the Legislature, which
shall then fill such Vacancies.
No person shall be a Senator who shall not have attained to the Age of thirty
Years, and been nine Years a Citizen of the United States, and who shall not,
when elected, be an Inhabitant of that State for which he shall be chosen.
The Vice President of the United States shall be President of the Senate, but
shall have no Vote, unless they be equally divided.
The Senate shall choose their other Officers, and also a President pro tempore,
in the absence of the Vice President, or when he shall exercise the Office of
President of the United States.
The Senate shall have the sole Power to try all Impeachments. When sitting for
that Purpose, they shall be on Oath or Affirmation. When the President of the
United States is tried, the Chief Justice shall preside: And no Person shall be
convicted without the Concurrence of two thirds of the Members present.
Judgment in Cases of Impeachment shall not extend further than to removal from
Office, and disqualification to hold and enjoy any Office of honor, Trust or
Profit under the United States: but the Party convicted shall nevertheless be
liable and subject to Indictment, Trial, Judgment and Punishment, according to
Law.
Section 4
The Times, Places and Manner of holding Elections for Senators and
Representatives, shall be prescribed in each State by the Legislature thereof;
but the Congress may at any time by Law make or alter such Regulations, except
as to the Place of Choosing Senators.
The Congress shall assemble at least once in every Year, and such Meeting shall
be on the first Monday in December, unless they shall by Law appoint a
different Day.
Section 5
Each House shall be the Judge of the Elections, Returns and Qualifications of
its own Members, and a Majority of each shall constitute a Quorum to do
Business; but a smaller number may adjourn from day to day, and may be
authorized to compel the Attendance of absent Members, in such Manner, and
under such Penalties as each House may provide.
Each House may determine the Rules of its Proceedings, punish its Members for
disorderly Behavior, and, with the Concurrence of two-thirds, expel a Member.
Each House shall keep a Journal of its Proceedings, and from time to time
publish the same, excepting such Parts as may in their Judgment require
Secrecy; and the Yeas and Nays of the Members of either House on any question
shall, at the Desire of one fifth of those Present, be entered on the Journal.
Neither House, during the Session of Congress, shall, without the Consent of
the other, adjourn for more than three days, nor to any other Place than that
in which the two Houses shall be sitting.
Section 6
The Senators and Representatives shall receive a Compensation for their
Services, to be ascertained by Law, and paid out of the Treasury of the United
States. They shall in all Cases, except Treason, Felony and Breach of the
Peace, be privileged from Arrest during their Attendance at the Session of
their respective Houses, and in going to and returning from the same; and for
any Speech or Debate in either House, they shall not be questioned in any other
Place.
No Senator or Representative shall, during the Time for which he was elected,
be appointed to any civil Office under the Authority of the United States which
shall have been created, or the Emoluments whereof shall have been increased
during such time; and no Person holding any Office under the United States,
shall be a Member of either House during his Continuance in Office.
Section 7
All bills for raising Revenue shall originate in the House of Representatives;
but the Senate may propose or concur with Amendments as on other Bills.
Every Bill which shall have passed the House of Representatives and the Senate,
shall, before it become a Law, be presented to the President of the United
States; If he approve he shall sign it, but if not he shall return it, with his
Objections to that House in which it shall have originated, who shall enter the
Objections at large on their Journal, and proceed to reconsider it. If after
such Reconsideration two thirds of that House shall agree to pass the Bill, it
shall be sent, together with the Objections, to the other House, by which it
shall likewise be reconsidered, and if approved by two thirds of that House, it
shall become a Law. But in all such Cases the Votes of both Houses shall be
determined by Yeas and Nays, and the Names of the Persons voting for and
against the Bill shall be entered on the Journal of each House respectively. If
any Bill shall not be returned by the President within ten Days (Sundays
excepted) after it shall have been presented to him, the Same shall be a Law,
in like Manner as if he had signed it, unless the Congress by their Adjournment
prevent its Return, in which Case it shall not be a Law.
Every Order, Resolution, or Vote to which the Concurrence of the Senate and
House of Representatives may be necessary (except on a question of Adjournment)
shall be presented to the President of the United States; and before the Same
shall take Effect, shall be approved by him, or being disapproved by him, shall
be repassed by two thirds of the Senate and House of Representatives, according
to the Rules and Limitations prescribed in the Case of a Bill.
Section 8
The Congress shall have Power To lay and collect Taxes, Duties, Imposts and
Excises, to pay the Debts and provide for the common Defence and general
Welfare of the United States; but all Duties, Imposts and Excises shall be
uniform throughout the United States;
To borrow money on the credit of the United States;
To regulate Commerce with foreign Nations, and among the several States, and
with the Indian Tribes;
To establish an uniform Rule of Naturalization, and uniform Laws on the subject
of Bankruptcies throughout the United States;
To coin Money, regulate the Value thereof, and of foreign Coin, and fix the
Standard of Weights and Measures;
To provide for the Punishment of counterfeiting the Securities and current Coin
of the United States;
To establish Post Offices and Post Roads;
To promote the Progress of Science and useful Arts, by securing for limited
Times to Authors and Inventors the exclusive Right to their respective Writings
and Discoveries;
To constitute Tribunals inferior to the supreme Court;
To define and punish Piracies and Felonies committed on the high Seas, and
Offenses against the Law of Nations;
To declare War, grant Letters of Marque and Reprisal, and make Rules concerning
Captures on Land and Water;
To raise and support Armies, but no Appropriation of Money to that Use shall be
for a longer Term than two Years;
To provide and maintain a Navy;
To make Rules for the Government and Regulation of the land and naval Forces;
To provide for calling forth the Militia to execute the Laws of the Union,
suppress Insurrections and repel Invasions;
To provide for organizing, arming, and disciplining the Militia, and for
governing such Part of them as may be employed in the Service of the United
States, reserving to the States respectively, the Appointment of the Officers,
and the Authority of training the Militia according to the discipline
prescribed by Congress;
To exercise exclusive Legislation in all Cases whatsoever, over such District
(not exceeding ten Miles square) as may, by Cession of particular States, and
the acceptance of Congress, become the Seat of the Government of the United
States, and to exercise like Authority over all Places purchased by the Consent
of the Legislature of the State in which the Same shall be, for the Erection of
Forts, Magazines, Arsenals, dock-Yards, and other needful Buildings; And
To make all Laws which shall be necessary and proper for carrying into
Execution the foregoing Powers, and all other Powers vested by this
Constitution in the Government of the United States, or in any Department or
Officer thereof.
Section 9
The Migration or Importation of such Persons as any of the States now existing
shall think proper to admit, shall not be prohibited by the Congress prior to
the Year one thousand eight hundred and eight, but a tax or duty may be imposed
on such Importation, not exceeding ten dollars for each Person.
The privilege of the Writ of Habeas Corpus shall not be suspended, unless when
in Cases of Rebellion or Invasion the public Safety may require it.
No Bill of Attainder or ex post facto Law shall be passed.
No capitation, or other direct, Tax shall be laid, unless in Proportion to the
Census or Enumeration herein before directed to be taken.
No Tax or Duty shall be laid on Articles exported from any State.
No Preference shall be given by any Regulation of Commerce or Revenue to the
Ports of one State over those of another: nor shall Vessels bound to, or from,
one State, be obliged to enter, clear, or pay Duties in another.
No Money shall be drawn from the Treasury, but in Consequence of Appropriations
made by Law; and a regular Statement and Account of the Receipts and
Expenditures of all public Money shall be published from time to time.
No Title of Nobility shall be granted by the United States: And no Person
holding any Office of Profit or Trust under them, shall, without the Consent of
the Congress, accept of any present, Emolument, Office, or Title, of any kind
whatever, from any King, Prince or foreign State.
Section 10
No State shall enter into any Treaty, Alliance, or Confederation; grant Letters
of Marque and Reprisal; coin Money; emit Bills of Credit; make any Thing but
gold and silver Coin a Tender in Payment of Debts; pass any Bill of Attainder,
ex post facto Law, or Law impairing the Obligation of Contracts, or grant any
Title of Nobility.
No State shall, without the Consent of the Congress, lay any Imposts or Duties
on Imports or Exports, except what may be absolutely necessary for executing
its inspection Laws: and the net Produce of all Duties and Imposts, laid by
any State on Imports or Exports, shall be for the Use of the Treasury of the
United States; and all such Laws shall be subject to the Revision and Control
of the Congress.
No State shall, without the Consent of Congress, lay any duty of Tonnage, keep
Troops, or Ships of War in time of Peace, enter into any Agreement or Compact
with another State, or with a foreign Power, or engage in War, unless actually
invaded, or in such imminent Danger as will not admit of delay.
Article 2.
Section 1
The executive Power shall be vested in a President of the United States of
America. He shall hold his Office during the Term of four Years, and, together
with the Vice-President chosen for the same Term, be elected, as follows:
Each State shall appoint, in such Manner as the Legislature thereof may direct,
a Number of Electors, equal to the whole Number of Senators and Representatives
to which the State may be entitled in the Congress: but no Senator or
Representative, or Person holding an Office of Trust or Profit under the United
States, shall be appointed an Elector.
The Electors shall meet in their respective States, and vote by Ballot for two
persons, of whom one at least shall not lie an Inhabitant of the same State
with themselves. And they shall make a List of all the Persons voted for, and
of the Number of Votes for each; which List they shall sign and certify, and
transmit sealed to the Seat of the Government of the United States, directed to
the President of the Senate. The President of the Senate shall, in the Presence
of the Senate and House of Representatives, open all the Certificates, and the
Votes shall then be counted. The Person having the greatest Number of Votes
shall be the President, if such Number be a Majority of the whole Number of
Electors appointed; and if there be more than one who have such Majority, and
have an equal Number of Votes, then the House of Representatives shall
immediately choose by Ballot one of them for President; and if no Person have a
Majority, then from the five highest on the List the said House shall in like
Manner choose the President. But in choosing the President, the Votes shall be
taken by States, the Representation from each State having one Vote; a quorum
for this Purpose shall consist of a Member or Members from two-thirds of the
States, and a Majority of all the States shall be necessary to a Choice. In
every Case, after the Choice of the President, the Person having the greatest
Number of Votes of the Electors shall be the Vice President. But if there
should remain two or more who have equal Votes, the Senate shall choose from
them by Ballot the Vice-President.
The Congress may determine the Time of choosing the Electors, and the Day on
which they shall give their Votes; which Day shall be the same throughout the
United States.
No person except a natural born Citizen, or a Citizen of the United States, at
the time of the Adoption of this Constitution, shall be eligible to the Office
of President; neither shall any Person be eligible to that Office who shall not
have attained to the Age of thirty-five Years, and been fourteen Years a
Resident within the United States.
In Case of the Removal of the President from Office, or of his Death,
Resignation, or Inability to discharge the Powers and Duties of the said
Office, the same shall devolve on the Vice President, and the Congress may by
Law provide for the Case of Removal, Death, Resignation or Inability, both of
the President and Vice President, declaring what Officer shall then act as
President, and such Officer shall act accordingly, until the Disability be
removed, or a President shall be elected.
The President shall, at stated Times, receive for his Services, a Compensation,
which shall neither be increased nor diminished during the Period for which he
shall have been elected, and he shall not receive within that Period any other
Emolument from the United States, or any of them.
Before he enter on the Execution of his Office, he shall take the following
Oath or Affirmation:
"I do solemnly swear (or affirm) that I will faithfully execute the Office of
President of the United States, and will to the best of my Ability, preserve,
protect and defend the Constitution of the United States."
Section 2
The President shall be Commander in Chief of the Army and Navy of the United
States, and of the Militia of the several States, when called into the actual
Service of the United States; he may require the Opinion, in writing, of the
principal Officer in each of the executive Departments, upon any subject
relating to the Duties of their respective Offices, and he shall have Power to
Grant Reprieves and Pardons for Offenses against the United States, except in
Cases of Impeachment.
He shall have Power, by and with the Advice and Consent of the Senate, to make
Treaties, provided two thirds of the Senators present concur; and he shall
nominate, and by and with the Advice and Consent of the Senate, shall appoint
Ambassadors, other public Ministers and Consuls, Judges of the supreme Court,
and all other Officers of the United States, whose Appointments are not herein
otherwise provided for, and which shall be established by Law: but the Congress
may by Law vest the Appointment of such inferior Officers, as they think
proper, in the President alone, in the Courts of Law, or in the Heads of
Departments.
The President shall have Power to fill up all Vacancies that may happen during
the Recess of the Senate, by granting Commissions which shall expire at the End
of their next Session.
Section 3
He shall from time to time give to the Congress Information of the State of the
Union, and recommend to their Consideration such Measures as he shall judge
necessary and expedient; he may, on extraordinary Occasions, convene both
Houses, or either of them, and in Case of Disagreement between them, with
Respect to the Time of Adjournment, he may adjourn them to such Time as he
shall think proper; he shall receive Ambassadors and other public Ministers; he
shall take Care that the Laws be faithfully executed, and shall Commission all
the Officers of the United States.
Section 4
The President, Vice President and all civil Officers of the United States,
shall be removed from Office on Impeachment for, and Conviction of, Treason,
Bribery, or other high Crimes and Misdemeanors.
Article 3.
Section 1
The judicial Power of the United States, shall be vested in one supreme Court,
and in such inferior Courts as the Congress may from time to time ordain and
establish. The Judges, both of the supreme and inferior Courts, shall hold
their Offices during good Behavior, and shall, at stated Times, receive for
their Services a Compensation which shall not be diminished during their
Continuance in Office.
Section 2
The judicial Power shall extend to all Cases, in Law and Equity, arising under
this Constitution, the Laws of the United States, and Treaties made, or which
shall be made, under their Authority; to all Cases affecting Ambassadors, other
public Ministers and Consuls; to all Cases of admiralty and maritime
Jurisdiction; to Controversies to which the United States shall be a Party; to
Controversies between two or more States; between a State and Citizens of
another State; between Citizens of different States; between Citizens of the
same State claiming Lands under Grants of different States, and between a
State, or the Citizens thereof, and foreign States, Citizens or Subjects.
In all Cases affecting Ambassadors, other public Ministers and Consuls, and
those in which a State shall be Party, the supreme Court shall have original
Jurisdiction. In all the other Cases before mentioned, the supreme Court shall
have appellate Jurisdiction, both as to Law and Fact, with such Exceptions, and
under such Regulations as the Congress shall make.
The Trial of all Crimes, except in Cases of Impeachment, shall be by Jury; and
such Trial shall be held in the State where the said Crimes shall have been
committed; but when not committed within any State, the Trial shall be at such
Place or Places as the Congress may by Law have directed.
Section 3
Treason against the United States, shall consist only in levying War against
them, or in adhering to their Enemies, giving them Aid and Comfort. No Person
shall be convicted of Treason unless on the Testimony of two Witnesses to the
same overt Act, or on Confession in open Court.
The Congress shall have power to declare the Punishment of Treason, but no
Attainder of Treason shall work Corruption of Blood, or Forfeiture except
during the Life of the Person attainted.
Article 4.
Section 1
Full Faith and Credit shall be given in each State to the public Acts, Records,
and judicial Proceedings of every other State. And the Congress may by general
Laws prescribe the Manner in which such Acts, Records and Proceedings shall be
proved, and the Effect thereof.
Section 2
The Citizens of each State shall be entitled to all Privileges and Immunities
of Citizens in the several States.
A Person charged in any State with Treason, Felony, or other Crime, who shall
flee from Justice, and be found in another State, shall on demand of the
executive Authority of the State from which he fled, be delivered up, to be
removed to the State having Jurisdiction of the Crime.
No Person held to Service or Labour in one State, under the Laws thereof,
escaping into another, shall, in Consequence of any Law or Regulation therein,
be discharged from such Service or Labour, But shall be delivered up on Claim
of the Party to whom such Service or Labour may be due.
Section 3
New States may be admitted by the Congress into this Union; but no new States
shall be formed or erected within the Jurisdiction of any other State; nor any
State be formed by the Junction of two or more States, or parts of States,
without the Consent of the Legislatures of the States concerned as well as of
the Congress.
The Congress shall have Power to dispose of and make all needful Rules and
Regulations respecting the Territory or other Property belonging to the United
States; and nothing in this Constitution shall be so construed as to Prejudice
any Claims of the United States, or of any particular State.
Section 4
The United States shall guarantee to every State in this Union a Republican
Form of Government, and shall protect each of them against Invasion; and on
Application of the Legislature, or of the Executive (when the Legislature
cannot be convened) against domestic Violence.
Article 5.
The Congress, whenever two thirds of both Houses shall deem it necessary, shall
propose Amendments to this Constitution, or, on the Application of the
Legislatures of two thirds of the several States, shall call a Convention for
proposing Amendments, which, in either Case, shall be valid to all Intents and
Purposes, as part of this Constitution, when ratified by the Legislatures of
three fourths of the several States, or by Conventions in three fourths
thereof, as the one or the other Mode of Ratification may be proposed by the
Congress; Provided that no Amendment which may be made prior to the Year One
thousand eight hundred and eight shall in any Manner affect the first and
fourth Clauses in the Ninth Section of the first Article; and that no State,
without its Consent, shall be deprived of its equal Suffrage in the Senate.
Article 6.
All Debts contracted and Engagements entered into, before the Adoption of this
Constitution, shall be as valid against the United States under this
Constitution, as under the Confederation.
This Constitution, and the Laws of the United States which shall be made in
Pursuance thereof; and all Treaties made, or which shall be made, under the
Authority of the United States, shall be the supreme Law of the Land; and the
Judges in every State shall be bound thereby, any Thing in the Constitution or
Laws of any State to the Contrary notwithstanding.
The Senators and Representatives before mentioned, and the Members of the
several State Legislatures, and all executive and judicial Officers, both of
the United States and of the several States, shall be bound by Oath or
Affirmation, to support this Constitution; but no religious Test shall ever be
required as a Qualification to any Office or public Trust under the United
States.
Article 7.
The Ratification of the Conventions of nine States, shall be sufficient for the
Establishment of this Constitution between the States so ratifying the Same.
Done in Convention by the Unanimous Consent of the States present the
Seventeenth Day of September in the Year of our Lord one thousand seven hundred
and Eighty seven and of the Independence of the United States of America the
Twelfth. In Witness whereof We have hereunto subscribed our Names.
George Washington - President and deputy from Virginia
New Hampshire - John Langdon, Nicholas Gilman
Massachusetts - Nathaniel Gorham, Rufus King
Connecticut - William Samuel Johnson, Roger Sherman
New York - Alexander Hamilton
New Jersey - William Livingston, David Brearley, William Paterson, Jonathan
Dayton
Pennsylvania - Benjamin Franklin, Thomas Mifflin, Robert Morris, George Clymer,
Thomas Fitzsimons, Jared Ingersoll, James Wilson, Gouvernour Morris
Delaware - George Read, Gunning Bedford Jr., John Dickinson, Richard Bassett,
Jacob Broom
Maryland - James McHenry, Daniel of St Thomas Jenifer, Daniel Carroll
Virginia - John Blair, James Madison Jr.
North Carolina - William Blount, Richard Dobbs Spaight, Hugh Williamson
South Carolina - John Rutledge, Charles Cotesworth Pinckney, Charles Pinckney,
Pierce Butler
Georgia - William Few, Abraham Baldwin
Attest: William Jackson, Secretary
Amendment 1
Congress shall make no law respecting an establishment of religion, or
prohibiting the free exercise thereof; or abridging the freedom of speech, or
of the press; or the right of the people peaceably to assemble, and to petition
the Government for a redress of grievances.
Amendment 2
A well regulated Militia, being necessary to the security of a free State, the
right of the people to keep and bear Arms, shall not be infringed.
Amendment 3
No Soldier shall, in time of peace be quartered in any house, without the
consent of the Owner, nor in time of war, but in a manner to be prescribed by
law.
Amendment 4
The right of the people to be secure in their persons, houses, papers, and
effects, against unreasonable searches and seizures, shall not be violated, and
no Warrants shall issue, but upon probable cause, supported by Oath or
affirmation, and particularly describing the place to be searched, and the
persons or things to be seized.
Amendment 5
No person shall be held to answer for a capital, or otherwise infamous crime,
unless on a presentment or indictment of a Grand Jury, except in cases arising
in the land or naval forces, or in the Militia, when in actual service in time
of War or public danger; nor shall any person be subject for the same offense
to be twice put in jeopardy of life or limb; nor shall be compelled in any
criminal case to be a witness against himself, nor be deprived of life,
liberty, or property, without due process of law; nor shall private property be
taken for public use, without just compensation.
Amendment 6
In all criminal prosecutions, the accused shall enjoy the right to a speedy and
public trial, by an impartial jury of the State and district wherein the crime
shall have been committed, which district shall have been previously
ascertained by law, and to be informed of the nature and cause of the
accusation; to be confronted with the witnesses against him; to have compulsory
process for obtaining witnesses in his favor, and to have the Assistance of
Counsel for his defence.
Amendment 7
In Suits at common law, where the value in controversy shall exceed twenty
dollars, the right of trial by jury shall be preserved, and no fact tried by a
jury, shall be otherwise re-examined in any Court of the United States, than
according to the rules of the common law.
Amendment 8
Excessive bail shall not be required, nor excessive fines imposed, nor cruel
and unusual punishments inflicted.
Amendment 9
The enumeration in the Constitution, of certain rights, shall not be construed
to deny or disparage others retained by the people.
Amendment 10
The powers not delegated to the United States by the Constitution, nor
prohibited by it to the States, are reserved to the States respectively, or to
the people.
Amendment 11
The Judicial power of the United States shall not be construed to extend to any
suit in law or equity, commenced or prosecuted against one of the United States
by Citizens of another State, or by Citizens or Subjects of any Foreign State.
Amendment 12
The Electors shall meet in their respective states, and vote by ballot for
President and Vice-President, one of whom, at least, shall not be an inhabitant
of the same state with themselves; they shall name in their ballots the person
voted for as President, and in distinct ballots the person voted for as
Vice-President, and they shall make distinct lists of all persons voted for as
President, and of all persons voted for as Vice-President and of the number of
votes for each, which lists they shall sign and certify, and transmit sealed to
the seat of the government of the United States, directed to the President of
the Senate;
The President of the Senate shall, in the presence of the Senate and House of
Representatives, open all the certificates and the votes shall then be counted;
The person having the greatest Number of votes for President, shall be the
President, if such number be a majority of the whole number of Electors
appointed; and if no person have such majority, then from the persons having
the highest numbers not exceeding three on the list of those voted for as
President, the House of Representatives shall choose immediately, by ballot,
the President. But in choosing the President, the votes shall be taken by
states, the representation from each state having one vote; a quorum for this
purpose shall consist of a member or members from two-thirds of the states, and
a majority of all the states shall be necessary to a choice. And if the House
of Representatives shall not choose a President whenever the right of choice
shall devolve upon them, before the fourth day of March next following, then
the Vice-President shall act as President, as in the case of the death or other
constitutional disability of the President.
The person having the greatest number of votes as Vice-President, shall be the
Vice-President, if such number be a majority of the whole number of Electors
appointed, and if no person have a majority, then from the two highest numbers
on the list, the Senate shall choose the Vice-President; a quorum for the
purpose shall consist of two-thirds of the whole number of Senators, and a
majority of the whole number shall be necessary to a choice. But no person
constitutionally ineligible to the office of President shall be eligible to
that of Vice-President of the United States.
Amendment 13
1. Neither slavery nor involuntary servitude, except as a punishment for crime
whereof the party shall have been duly convicted, shall exist within the United
States, or any place subject to their jurisdiction.
2. Congress shall have power to enforce this article by appropriate
legislation.
Amendment 14
1. All persons born or naturalized in the United States, and subject to the
jurisdiction thereof, are citizens of the United States and of the State
wherein they reside. No State shall make or enforce any law which shall abridge
the privileges or immunities of citizens of the United States; nor shall any
State deprive any person of life, liberty, or property, without due process of
law; nor deny to any person within its jurisdiction the equal protection of the
laws.
2. Representatives shall be apportioned among the several States according to
their respective numbers, counting the whole number of persons in each State,
excluding Indians not taxed. But when the right to vote at any election for the
choice of electors for President and Vice-President of the United States,
Representatives in Congress, the Executive and Judicial officers of a State, or
the members of the Legislature thereof, is denied to any of the male
inhabitants of such State, being twenty-one years of age, and citizens of the
United States, or in any way abridged, except for participation in rebellion,
or other crime, the basis of representation therein shall be reduced in the
proportion which the number of such male citizens shall bear to the whole
number of male citizens twenty-one years of age in such State.
3. No person shall be a Senator or Representative in Congress, or elector of
President and Vice-President, or hold any office, civil or military, under the
United States, or under any State, who, having previously taken an oath, as a
member of Congress, or as an officer of the United States, or as a member of
any State legislature, or as an executive or judicial officer of any State, to
support the Constitution of the United States, shall have engaged in
insurrection or rebellion against the same, or given aid or comfort to the
enemies thereof. But Congress may by a vote of two-thirds of each House, remove
such disability.
4. The validity of the public debt of the United States, authorized by law,
including debts incurred for payment of pensions and bounties for services in
suppressing insurrection or rebellion, shall not be questioned. But neither the
United States nor any State shall assume or pay any debt or obligation incurred
in aid of insurrection or rebellion against the United States, or any claim for
the loss or emancipation of any slave; but all such debts, obligations and
claims shall be held illegal and void.
5. The Congress shall have power to enforce, by appropriate legislation, the
provisions of this article.
Amendment 15
1. The right of citizens of the United States to vote shall not be denied or
abridged by the United States or by any State on account of race, color, or
previous condition of servitude.
2. The Congress shall have power to enforce this article by appropriate
legislation.
Amendment 16
The Congress shall have power to lay and collect taxes on incomes, from
whatever source derived, without apportionment among the several States, and
without regard to any census or enumeration.
Amendment 17
The Senate of the United States shall be composed of two Senators from each
State, elected by the people thereof, for six years; and each Senator shall
have one vote. The electors in each State shall have the qualifications
requisite for electors of the most numerous branch of the State legislatures.
When vacancies happen in the representation of any State in the Senate, the
executive authority of such State shall issue writs of election to fill such
vacancies: Provided, That the legislature of any State may empower the
executive thereof to make temporary appointments until the people fill the
vacancies by election as the legislature may direct.
This amendment shall not be so construed as to affect the election or term of
any Senator chosen before it becomes valid as part of the Constitution.
Amendment 18
1. After one year from the ratification of this article the manufacture, sale,
or transportation of intoxicating liquors within, the importation thereof into,
or the exportation thereof from the United States and all territory subject to
the jurisdiction thereof for beverage purposes is hereby prohibited.
2. The Congress and the several States shall have concurrent power to enforce
this article by appropriate legislation.
3. This article shall be inoperative unless it shall have been ratified as an
amendment to the Constitution by the legislatures of the several States, as
provided in the Constitution, within seven years from the date of the
submission hereof to the States by the Congress.
Amendment 19
The right of citizens of the United States to vote shall not be denied or
abridged by the United States or by any State on account of sex.
Congress shall have power to enforce this article by appropriate legislation.
Amendment 20
1. The terms of the President and Vice President shall end at noon on the 20th
day of January, and the terms of Senators and Representatives at noon on the 3d
day of January, of the years in which such terms would have ended if this
article had not been ratified; and the terms of their successors shall then
begin.
2. The Congress shall assemble at least once in every year, and such meeting
shall begin at noon on the 3d day of January, unless they shall by law appoint
a different day.
3. If, at the time fixed for the beginning of the term of the President, the
President elect shall have died, the Vice President elect shall become
President. If a President shall not have been chosen before the time fixed for
the beginning of his term, or if the President elect shall have failed to
qualify, then the Vice President elect shall act as President until a President
shall have qualified; and the Congress may by law provide for the case wherein
neither a President elect nor a Vice President elect shall have qualified,
declaring who shall then act as President, or the manner in which one who is to
act shall be selected, and such person shall act accordingly until a President
or Vice President shall have qualified.
4. The Congress may by law provide for the case of the death of any of the
persons from whom the House of Representatives may choose a President whenever
the right of choice shall have devolved upon them, and for the case of the
death of any of the persons from whom the Senate may choose a Vice President
whenever the right of choice shall have devolved upon them.
5. Sections 1 and 2 shall take effect on the 15th day of October following the
ratification of this article.
6. This article shall be inoperative unless it shall have been ratified as an
amendment to the Constitution by the legislatures of three-fourths of the
several States within seven years from the date of its submission.
Amendment 21
1. The eighteenth article of amendment to the Constitution of the United States
is hereby repealed.
2. The transportation or importation into any State, Territory, or possession
of the United States for delivery or use therein of intoxicating liquors, in
violation of the laws thereof, is hereby prohibited.
3. The article shall be inoperative unless it shall have been ratified as an
amendment to the Constitution by conventions in the several States, as provided
in the Constitution, within seven years from the date of the submission hereof
to the States by the Congress.
Amendment 22
1. No person shall be elected to the office of the President more than twice,
and no person who has held the office of President, or acted as President, for
more than two years of a term to which some other person was elected President
shall be elected to the office of the President more than once. But this
Article shall not apply to any person holding the office of President, when this
Article was proposed by the Congress, and shall not prevent any person who may
be holding the office of President, or acting as President, during the term
within which this Article becomes operative from holding the office of
President or acting as President during the remainder of such term.
2. This article shall be inoperative unless it shall have been ratified as an
amendment to the Constitution by the legislatures of three-fourths of the
several States within seven years from the date of its submission to the States
by the Congress.
Amendment 23
1. The District constituting the seat of Government of the United States shall
appoint in such manner as the Congress may direct: A number of electors of
President and Vice President equal to the whole number of Senators and
Representatives in Congress to which the District would be entitled if it were
a State, but in no event more than the least populous State; they shall be in
addition to those appointed by the States, but they shall be considered, for
the purposes of the election of President and Vice President, to be electors
appointed by a State; and they shall meet in the District and perform such
duties as provided by the twelfth article of amendment.
2. The Congress shall have power to enforce this article by appropriate
legislation.
Amendment 24
1. The right of citizens of the United States to vote in any primary or other
election for President or Vice President, for electors for President or
Vice President, or for Senator or Representative in Congress, shall not be
denied or abridged by the United States or any State by reason of failure to
pay any poll tax or other tax.
2. The Congress shall have power to enforce this article by appropriate
legislation.
Amendment 25
1. In case of the removal of the President from office or of his death or
resignation, the Vice President shall become President.
2. Whenever there is a vacancy in the office of the Vice President, the
President shall nominate a Vice President who shall take office upon
confirmation by a majority vote of both Houses of Congress.
3. Whenever the President transmits to the President pro tempore of the Senate
and the Speaker of the House of Representatives his written declaration that he
is unable to discharge the powers and duties of his office, and until he
transmits to them a written declaration to the contrary, such powers and duties
shall be discharged by the Vice President as Acting President.
4. Whenever the Vice President and a majority of either the principal officers
of the executive departments or of such other body as Congress may by law
provide, transmit to the President pro tempore of the Senate and the Speaker of
the House of Representatives their written declaration that the President is
unable to discharge the powers and duties of his office, the Vice President
shall immediately assume the powers and duties of the office as Acting
President.
Thereafter, when the President transmits to the President pro tempore of the
Senate and the Speaker of the House of Representatives his written declaration
that no inability exists, he shall resume the powers and duties of his office
unless the Vice President and a majority of either the principal officers of
the executive department or of such other body as Congress may by law provide,
transmit within four days to the President pro tempore of the Senate and the
Speaker of the House of Representatives their written declaration that the
President is unable to discharge the powers and duties of his office. Thereupon
Congress shall decide the issue, assembling within forty eight hours for that
purpose if not in session. If the Congress, within twenty one days after
receipt of the latter written declaration, or, if Congress is not in session,
within twenty one days after Congress is required to assemble, determines by
two thirds vote of both Houses that the President is unable to discharge the
powers and duties of his office, the Vice President shall continue to discharge
the same as Acting President; otherwise, the President shall resume the powers
and duties of his office.
Amendment 26
1. The right of citizens of the United States, who are eighteen years of age or
older, to vote shall not be denied or abridged by the United States or by any
State on account of age.
2. The Congress shall have power to enforce this article by appropriate
legislation.
Amendment 27
No law, varying the compensation for the services of the Senators and
Representatives, shall take effect, until an election of Representatives shall
have intervened.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,4 @@
According to Merriam-Webster's Medical Dictionary,
pneumonoultramicroscopicsilicovolcanoconiosis is a
pneumoconiosis caused by inhalation of very fine
silicate or quartz dust.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,32 @@
Daffodils
I wandered lonely as a cloud
That floats on high o'er vales and hills,
When all at once I saw a crowd,
A host, of golden daffodils;
Beside the lake, beneath the trees,
Fluttering and dancing in the breeze.
Continuous as the stars that shine
And twinkle on the milky way,
They stretched in never-ending line
Along the margin of a bay:
Ten thousand saw I at a glance,
Tossing their heads in sprightly dance.
The waves beside them danced; but they
Out-did the sparkling waves in glee:
A poet could not but be gay,
In such a jocund company:
I gazed--and gazed--but little thought
What wealth the show to me had brought:
For oft, when on my couch I lie
In vacant or in pensive mood,
They flash upon that inward eye
Which is the bliss of solitude;
And then my heart with pleasure fills,
And dances with the daffodils.
-- William Wordsworth
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,19 +0,0 @@
Node* createNode(int data){
}
void insertAtBeginning(LinkedList* head, int data){
}
void insertAtEnd(LinkedList* head, int data){
}
void deleteNode(LinkedList* head, int key){
}
void printList(LinkedList head){
}
@@ -1,21 +0,0 @@
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
typedef struct node{
int data;
struct node* next;
} Node;
typedef Node* Linkedlist;
Node* createNode(int data);
void insertAtBeginning(LinkedList* head, int data);
void insertAtEnd(LinkedList* head, int data);
void deleteNode(LinkedList* head, int key);
void printList(LinkedList head);
#endif
@@ -1,30 +0,0 @@
# Compiler
CC = gcc
# Compiler flags
CFLAGS = -Wall -g
# Target executable
TARGET = prog
# Object files
OBJS = stack.o prog.o
# Default rule to build the target executable
all: $(TARGET)
# Rule to build the target executable from object files
$(TARGET): $(OBJS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS)
# Rule to compile stack.c to object file
stack.o: stack.c stack.h
$(CC) $(CFLAGS) -c stack.c
# Rule to compile prog.c to object file
prog.o: prog.c stack.h
$(CC) $(CFLAGS) -c prog.c
# Clean up object files and the executable
clean:
rm -f $(OBJS) $(TARGET)
@@ -1,12 +0,0 @@
# Übung 0 Stack
Dies ist die Vorlage für die Live Aufgabe "Stack".
Bitte forken Sie diese Vorlage über den Button Fork und wählen Sie ihre Gruppe als URL aus.
Anschließend können Sie in Ihrer Version des Projektes arbeiten :)
Forderns Sie kein Zugriff auf dieses Projekt an!
1. Implementieren Sie den Datentyp stack_t.
2. Implementieren Sie die auskommentierten Methoden in stack.c.
3. Implementieren Sie ein Programm, welches Ihren Stack nutzt in prog.c
4. Erstellen Sie ein Makefile, welches die Executable prog erstellt.
@@ -1,55 +0,0 @@
#include <stdio.h>
#include "stack.h"
int main() {
stack_t* stack = stack_create(5);
if(stack == NULL){
printf("Failed to create stack\n");
return 1;
}
if (stack_push(stack, 'A') != 0) {
printf("Error: failed to push onto stack\n");
stack_delete(stack);
return 1;
}
if (stack_push(stack, 'B') != 0) {
printf("Error: failed to push onto stack\n");
stack_delete(stack);
return 1;
}
if (stack_push(stack, 'C') != 0) {
printf("Error: failed to push onto stack\n");
stack_delete(stack);
return 1;
}
printf("Stack length is %zu\n", stack_length(stack));
char popped;
if (stack_pop(stack, &popped) != 0){
printf("Error: failed to pop from stack\n");
stack_delete(stack);
return 1;
}
printf("Popped element: %c\n", popped);
if (stack_pop(stack, &popped) != 0){
printf("Error: failed to pop from stack\n");
stack_delete(stack);
return 1;
}
printf("Popped element: %c\n", popped);
printf("Stack length is %zu\n", stack_length(stack));
stack_delete(stack);
return 0;
}
@@ -1,46 +0,0 @@
#include "stack.h"
#include <stdlib.h>
stack_t *stack_create(size_t size) {
stack_t* stack = (stack_t*) malloc(sizeof(stack_t));
if (stack == NULL) {
return NULL;
}
stack->array = (char*) malloc(size * sizeof(char));
if (stack->array == NULL) {
free(stack);
return NULL;
}
stack->size = size;
stack->length = 0;
return stack;
}
void stack_delete(stack_t *stack) {
if (stack != NULL) {
free(stack->array);
free(stack);
}
}
size_t stack_length(stack_t *stack) {
return stack->length;
}
int stack_push(stack_t *stack, char c) {
if (stack->length >= stack->size) {
return -1;
}
stack->array[stack->length] = c;
stack->length++;
return 0;
}
int stack_pop(stack_t *stack, char *dest) {
if (stack->length == 0) {
return -1;
}
*dest = stack->array[stack->length - 1];
stack->length--;
return 0;
}
@@ -1,22 +0,0 @@
#ifndef STACK_H
#define STACK_H
#include <stddef.h>
typedef struct stack{
int size;
char* array;
int length;
} stack_t;
stack_t* stack_create(size_t size);
void stack_delete(stack_t* stack);
size_t stack_length(stack_t* stack);
int stack_push(stack_t* stack,char c);
int stack_pop(stack_t* stack, char* dest);
#endif
@@ -1,8 +0,0 @@
CC = gcc
all: workdir.c print_file.c
${CC} -o workdir workdir.c
${CC} -o print_file print_file.c
clean:
rm -f workdir print_file
@@ -1,38 +0,0 @@
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#define SIZE 512
int main() {
int fd = open("./test.txt", O_RDWR);
if (fd == -1){
perror("could not open file");
return EXIT_FAILURE;
}
char * buffer = (char *) calloc(SIZE, sizeof(char));
if (buffer == NULL) {
perror("could not allocate buffer");
close(fd);
return EXIT_FAILURE;
}
ssize_t r = read(fd, buffer, SIZE-1);
if (r == -1) {
perror("could not read file");
free(buffer);
close(fd);
return EXIT_FAILURE;
}
return 0;
printf("%.*s", SIZE-1, buffer);
free(buffer);
close(fd);
return EXIT_SUCCESS;
}
@@ -1,31 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
char *mywdfunc(unsigned int bufsize) {
if (bufsize < 100) {
return NULL;
}
char *buf = (char *)calloc(bufsize,sizeof(char));
if (buf == NULL){
return NULL;
}
if (getcwd(buf,bufsize-1) == NULL) {
free(buf);
return NULL;
}
return buf;
}
int main() {
char *ret = mywdfunc(512);
printf("%s", ret);
free(ret);
return EXIT_SUCCESS;
}
@@ -1,6 +0,0 @@
# Übung 2 Prozessliste
Dies ist die Vorlage für die Hausaufgabe "Prozesstabelle".
Bitte forken Sie diese Vorlage über den Button Fork und wählen Sie ihre Gruppe als URL aus.
Anschließend können Sie in Ihrer Version des Projektes arbeiten :)
@@ -1,34 +0,0 @@
// zum Erstellen der Liste, wobei die Liste zu Beginn einen Prozess mit PID = 1 und PPID = 0 enthalten soll
dl_proc_list* dl_proc_list_create() {
dl_proc_list* proc_list = (dl_proc_list*) malloc(sizeof(dl_proc_list));
if (proc_list == NULL) {
return NULL;
}
proc_list->PID = 1;
proc_list->PPID = 0;
}
// zum Einfügen eines Prozesses mit PID pid in die Liste, unter den folgenden Bedingungen:
// – Die Liste ist stets aufsteigend sortiert,
// – jede Prozess-ID kommt höchstens einmal vor und
// – als neuer Elternprozess wird der Prozess mit der bisher höchsten Prozess-ID festgelegt.
int dl_proc_list_insert(dl_proc_list *list, int pid){
}
// zum Abfragen der PID und PPID des Prozesses an der gegebenen Position in der Liste und Abspeichern der erhaltenen Werte in den Parametern pid und ppid,
int dl_proc_list_get(dl_proc_list *list, int position, int* pid, int* ppid){
}
// zum Entfernen des Prozesses p mit der PID pid aus der Liste, unter den folgenden Bedingungen:
// – Das Löschen des Prozesses mit PID = 1 soll verhindert werden und
// – die Kindprozesse des zu löschenden Prozesses p erhalten den Elternprozess von p als neuen Elternprozess.
int dl_proc_list_remove(dl_proc_list *list, int pid){
}
// zum Freigeben des allokierten Speichers.
void dl_proc_list_free(dl_proc_list *list){
}
@@ -1,32 +0,0 @@
Implementieren Sie eine Prozesstabelle mithilfe einer doppelt verketteten Liste.
Die Elemente der Liste entsprechen den vereinfachten Prozessleitblöcken. Für jeden Pro-
zess umfasst der zugehörige Leitblock die Prozess-ID (PID) und die ID des Elternprozesses
(parent PID, PPID).
Beachten Sie dabei:
• Geben Sie für die Funktionen der doppelt verketteten Liste im Fehlerfall negative
Werte und im Erfolgsfall 0 zurück. Falls der Rückgabetyp ein Pointer ist, soll die
Funktion im Fehlerfall NULL zurückgeben.
#ifndef dl_proc_list
#define dl_proc_list
#include <stddef.h>
typedef struct dl_proc_list {
int PID;
int PPID;
} dl_proc_list;
dl_proc_list* dl_proc_list_create()
int dl_proc_list_insert(dl_proc_list *list, int pid)
int dl_proc_list_get(dl_proc_list *list, int position, int* pid, int* ppid)
int dl_proc_list_remove(dl_proc_list *list, int pid)
void dl_proc_list_free(dl_proc_list *list)
#endif
@@ -1,16 +0,0 @@
#include <stdio.h>
int main() {
int a[8];
int i;
printf("Size of A: %lu\n", sizeof(a));
printf("Array A:");
for (i = 0; i < (sizeof (a)/4); i ++) {
a[i] = 1;
printf("%i",a[i]);
}
printf("\n");
}
@@ -1,9 +0,0 @@
#include <stdio.h>
unsigned long size (int* a){
return sizeof (a);
}
int main (int argc , char ** argv ){
int a[8];
printf ("%lu",size (a));
}
Submodule 2024_Grundlagen_Betriebssysteme_Rechnernetze/uebung-3-pthreads deleted from 61606e3117
File diff suppressed because it is too large Load Diff
@@ -1,6 +0,0 @@
- [X] Übung 1
- [X] Übung 2
- [X] Übung 3
- [ ] Übung 4
- [ ] Übung 5
- [ ] Übung 6
+89
View File
@@ -0,0 +1,89 @@
import sys
import rasterio
import numpy as np
def create_change_map(old_tif, new_tif, out_tif):
"""
Creates a change map from two classified TIFF files by:
1. Cropping both to their overlapping extent.
2. Encoding changes as (old_class * 10 + new_class).
Parameters
----------
old_tif : str
Path to the old classified TIFF file.
new_tif : str
Path to the new classified TIFF file.
out_tif : str
Path to the output change map TIFF file.
"""
# Open both rasters
with rasterio.open(old_tif) as src_old, rasterio.open(new_tif) as src_new:
# 1) Check that both have the same CRS
if src_old.crs != src_new.crs:
raise ValueError("Error: Old and new rasters must have the same CRS for cropping.")
# 2) Check that both have the same resolution
# (assuming square pixels; if not, adjust accordingly)
old_res = (abs(src_old.transform.a), abs(src_old.transform.e))
new_res = (abs(src_new.transform.a), abs(src_new.transform.e))
if not (np.isclose(old_res[0], new_res[0]) and np.isclose(old_res[1], new_res[1])):
raise ValueError("Error: Old and new rasters do not have the same resolution.")
# 3) Determine the overlapping bounding box
left = max(src_old.bounds.left, src_new.bounds.left)
bottom = max(src_old.bounds.bottom, src_new.bounds.bottom)
right = min(src_old.bounds.right, src_new.bounds.right)
top = min(src_old.bounds.top, src_new.bounds.top)
if left >= right or bottom >= top:
raise ValueError("Error: The input rasters have no overlapping extent.")
# 4) Create windows that correspond to this overlapping area
window_old = src_old.window(left, bottom, right, top)
window_new = src_new.window(left, bottom, right, top)
# 5) Read the data from each window (single band assumed)
old_data = src_old.read(1, window=window_old)
new_data = src_new.read(1, window=window_new)
# 6) Confirm they now have the same shape after cropping
if old_data.shape != new_data.shape:
raise ValueError("Error: The cropped rasters do not have the same shape.")
# 7) Generate the change map as old_value * 10 + new_value
change_data = old_data * 10 + new_data
# 8) Build the output profile
out_transform = src_old.window_transform(window_old)
out_profile = src_old.profile.copy()
out_profile.update({
'height': old_data.shape[0],
'width': old_data.shape[1],
'transform': out_transform,
'dtype': rasterio.int16,
'count': 1,
'compress': 'lzw' # optional compression
})
# 9) Write out the change map
with rasterio.open(out_tif, 'w', **out_profile) as dst:
dst.write(change_data.astype(rasterio.int16), 1)
def main():
# Expect exactly three arguments besides the script name
if len(sys.argv) != 4:
print("Usage: python change_detection.py <old_classified.tif> <new_classified.tif> <out_change.tif>")
sys.exit(1)
old_tif_path = sys.argv[1]
new_tif_path = sys.argv[2]
out_tif_path = sys.argv[3]
create_change_map(old_tif_path, new_tif_path, out_tif_path)
print(f"[INFO] Change map created: {out_tif_path}")
if __name__ == "__main__":
main()
+96
View File
@@ -0,0 +1,96 @@
import argparse
import rasterio
import geopandas as gpd
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from rasterio.features import geometry_mask
from shapely.geometry import mapping
# Step 1: Load the Raster Data
def load_raster(raster_path):
with rasterio.open(raster_path) as src:
bands = [src.read(i) for i in range(1, src.count + 1)]
profile = src.profile
return np.stack(bands, axis=-1), profile
# Step 2: Extract Features and Labels from Training Data
def extract_training_data(raster, training_shapefile, profile):
training_labels = gpd.read_file(training_shapefile)
features = []
labels = []
for _, row in training_labels.iterrows():
class_id = row['Class'] # Ensure 'class_id' column exists in the shapefile
geom = [mapping(row['geometry'])]
mask = geometry_mask(
geom, transform=profile['transform'], invert=True, out_shape=(profile['height'], profile['width'])
)
masked_pixels = raster[mask]
features.append(masked_pixels)
labels.append(np.full(masked_pixels.shape[0], class_id))
return np.vstack(features), np.hstack(labels)
# Step 3: Train the Random Forest Classifier
def train_classifier(features, labels):
X_train, X_test, y_train, y_test = train_test_split(features, labels, test_size=0.3, random_state=42)
classifier = RandomForestClassifier(n_estimators=100, random_state=42)
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
print("Classification Report:")
print(classification_report(y_test, y_pred))
return classifier
# Step 4: Classify the Entire Raster
def classify_raster(raster, classifier, profile, output_path):
rows, cols, bands = raster.shape
flattened_data = raster.reshape(-1, bands)
predictions = classifier.predict(flattened_data)
classified_image = predictions.reshape(rows, cols)
profile.update(
count=1,
dtype=rasterio.uint8,
nodata=255
)
with rasterio.open(output_path, "w", **profile) as dst:
dst.write(classified_image.astype(rasterio.uint8), 1)
return classified_image
def main():
parser = argparse.ArgumentParser(description="Random Forest classification of a raster using training shapefile.")
parser.add_argument('--raster_path', required=True, help='Path to the input raster file.')
parser.add_argument('--training_shapefile', required=True, help='Path to the training shapefile.')
parser.add_argument('--output_path', required=True, help='Path for the classified raster output.')
args = parser.parse_args()
# Load raster and metadata
print("Loading raster...")
raster, profile = load_raster(args.raster_path)
# Extract training data
print("Extracting training data...")
features, labels = extract_training_data(raster, args.training_shapefile, profile)
# Train the classifier
print("Training the classifier...")
classifier = train_classifier(features, labels)
# Classify the raster
print("Classifying the raster...")
classify_raster(raster, classifier, profile, args.output_path)
print("Classification complete. Output saved to:", args.output_path)
if __name__ == "__main__":
main()
+39
View File
@@ -0,0 +1,39 @@
import argparse
import rasterio
import numpy as np
from sklearn.cluster import KMeans
def main(input_file, output_file, n_clusters):
with rasterio.open(input_file) as src:
raster_data = src.read()
profile = src.profile
rows, cols = raster_data.shape[1], raster_data.shape[2]
raster_data_reshaped = raster_data.reshape(raster_data.shape[0], -1).T
kmeans = KMeans(n_clusters=n_clusters, random_state=0)
kmeans.fit(raster_data_reshaped)
cluster_labels = kmeans.labels_
classified_raster = cluster_labels.reshape(rows, cols)
with rasterio.open(
output_file, 'w',
driver='GTiff',
height=rows,
width=cols,
count=1,
dtype=classified_raster.dtype,
crs=src.crs,
transform=src.transform,
) as dst:
dst.write(classified_raster, 1)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Unsupervised classification for raster data.")
parser.add_argument("input_file", type=str, help="Path to the input .tif file.")
parser.add_argument("output_file", type=str, help="Path to save the classified .tif file.")
parser.add_argument("--n_clusters", type=int, default=4, help="Number of clusters for classification (default: 4).")
args = parser.parse_args()
main(args.input_file, args.output_file, args.n_clusters)
-31
View File
@@ -1,31 +0,0 @@
# Lab Assignment 1 - Cartopgraphy, Colors, and Displaying Remotely-Sensed Data
Name: Joaquin Gottlebe
Matrikelnummer: 829101
## Map 1
![](map1.png)
## Question 1
#### Data
Data: The Land Surface Temperature (LST) and Emissivity daily data are retrieved at 1km pixels by the generalized split-window algorithm and at 6km grids by the day/night algorithm. In the split-window algorithm, emissivities in bands 31 and 32 are estimated from land cover types, atmospheric column water vapor and lower boundary air surface temperature are separated into tractable sub-ranges for optimal retrieval. In the day/night algorithm, daytime and nighttime LSTs and surface emissivities are retrieved from pairs of day and night MODIS observations in seven TIR bands. The product is comprised of LSTs, quality assessment, observation time, view angles, and emissivities.
Satelite: eMODIS Global LST V6
Entity ID: EMGLSTA20220911202209206
Begin Date: 2022-09-11 00:00:00-05
End Date: 2022-09-20 00:00:00-05
Source: https://earthexplorer.usgs.gov/
#### Map
![](map2.png)
## Question 2
![](plot1.png)
-11
View File
@@ -1,11 +0,0 @@
.PHONY: all run pdf clean
PYTHON=venv/bin/python
PANDOC=pandoc
all: run pdf
run:
$(PYTHON) script.py
pdf:
$(PANDOC) Lab1.md -o rcm01_2425_lab1_gottlebe_829101.pdf
-31
View File
@@ -1,31 +0,0 @@
# Lab Assignment 2
Name: Joaquin Gottlebe
Matrikelnummer: 829101
## Question 1
![](maps/ndvi_ndwi.png)
## Question 2
![](maps/surface_temp_b10.png)
![](maps/surface_temp_b11.png)
The original Raster file included values from -125 C which are not realistic in germany. Also Maximum temperatures from 44 degrees are not common, but could be explainable through realy heat conductiv material on very small areas.
Between Water bodies and land bodies. and also the north and south of the area.
## Question 3
![](maps/true_color.png)
![](maps/false_color.png)
The main differences of the map are the Bands and their display of it. For example the true color composite consists of band 2,3 and 4 in the order of RGB as 4,3,2. The false color composite consists of band 3,4 and 5 in the order ich which Vegetation is the most visible (5,4,3).
## Question 4
![](maps/ndvi_chiloe_2013.png)
![](maps/ndvi_chiloe_2024.png)
I choose this study area because i was on this island Chiloe in Chile for a bit and noticed a lot of National parks and vegeation there and i wanted to know how this changed in these past years. These two images show difference in NDVI between 2013 and 2024 of the island Chiloe in Chile and surroundings. I chose NDVI as it shows the difference in vegetation very well.
-23
View File
@@ -1,23 +0,0 @@
.PHONY: all run_scripts
# Path to the Conda environment and scripts
CONDA_ENV_NAME = gdal_env
ACTIVATE_SCRIPT = ~/miniforge3/bin/activate
SCRIPTS = top_of_atmosphere.py ndvi.py ndwi.py
PANDOC=pandoc
all: run_scripts
run_scripts:
@echo "Activating Conda environment and running scripts..."
@source $(ACTIVATE_SCRIPT) && conda activate $(CONDA_ENV_NAME) && \
python3 toa.py data/LC08_L1TP_193023_20170602_20170615_01_T1_MTL.txt toa data/LC08_L1TP_193023_20170602_20170615_01_T1_B2.TIF data/LC08_L1TP_193023_20170602_20170615_01_T1_B4.TIF data/LC08_L1TP_193023_20170602_20170615_01_T1_B3.TIF data/LC08_L1TP_193023_20170602_20170615_01_T1_B5.TIF && \
python3 toa_radiance.py data/LC08_L1TP_193023_20170602_20170615_01_T1_MTL.txt toa_radiance data/LC08_L1TP_193023_20170602_20170615_01_T1_B10.TIF data/LC08_L1TP_193023_20170602_20170615_01_T1_B11.TIF && \
python3 ndvi.py toa/LC08_L1TP_193023_20170602_20170615_01_T1_B4_toa.TIF toa/LC08_L1TP_193023_20170602_20170615_01_T1_B5_toa.TIF ndvi && \
python3 ndwi.py toa/LC08_L1TP_193023_20170602_20170615_01_T1_B3_toa.TIF toa/LC08_L1TP_193023_20170602_20170615_01_T1_B5_toa.TIF ndwi && \
python3 surface_temperature.py data/LC08_L1TP_193023_20170602_20170615_01_T1_MTL.txt toa_radiance/LC08_L1TP_193023_20170602_20170615_01_T1_B10_toa_radiance.TIF toa_radiance/LC08_L1TP_193023_20170602_20170615_01_T1_B11_toa_radiance.TIF surface_temperature && \
python3 toa.py data2/LC08_L1TP_233089_20131224_20200912_02_T1_MTL.txt toa2 data2/LC08_L1TP_233089_20131224_20200912_02_T1_B2.TIF data2/LC08_L1TP_233089_20131224_20200912_02_T1_B4.TIF data2/LC08_L1TP_233089_20131224_20200912_02_T1_B3.TIF data2/LC08_L1TP_233089_20131224_20200912_02_T1_B5.TIF && \
python3 toa.py data3/LC08_L1TP_233089_20240410_20240419_02_T1_MTL.txt toa3 data3/LC08_L1TP_233089_20240410_20240419_02_T1_B2.TIF data3/LC08_L1TP_233089_20240410_20240419_02_T1_B4.TIF data3/LC08_L1TP_233089_20240410_20240419_02_T1_B3.TIF data3/LC08_L1TP_233089_20240410_20240419_02_T1_B5.TIF && \
python3 ndvi.py toa2/LC08_L1TP_233089_20131224_20200912_02_T1_B4_toa.TIF toa2/LC08_L1TP_233089_20131224_20200912_02_T1_B5_toa.TIF ndvi2 && \
python3 ndvi.py toa3/LC08_L1TP_233089_20240410_20240419_02_T1_B4_toa.TIF toa3/LC08_L1TP_233089_20240410_20240419_02_T1_B5_toa.TIF ndvi3 && \
$(PANDOC) Lab2.md -o rcm01_2425_lab2_gottlebe_829101.pdf
-119
View File
@@ -1,119 +0,0 @@
# Cleanup
project = QgsProject.instance()
layer_ids = list(project.mapLayers().keys())
for layer_id in layer_ids:
project.removeMapLayer(layer_id)
# Loading B10 Layer
path_st_b10 = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/false_color/false_color.tif"
st_b10_layer = QgsRasterLayer(path_st_b10, "False Color Composite")
if not st_b10_layer.isValid():
print("st_b10 layer failed to load!")
else:
QgsProject.instance().addMapLayer(st_b10_layer)
print("st_b10 Layer loaded!")
# Styling Layer
st_b10_style_path = '/home/huaqo/dev/courses/2024_Remote_Sensing/styles/false_color.qml'
if not st_b10_layer.loadNamedStyle(st_b10_style_path):
print("Failed to load st_b10 style!")
else:
print("st_b10 style loaded!")
# Load layout
layout = QgsPrintLayout(project)
layout.initializeDefaults()
# Map
map_item = QgsLayoutItemMap(layout)
map_item.attemptMove(QgsLayoutPoint(20, 30, QgsUnitTypes.LayoutMillimeters)) # Added space between top and map
map_item.attemptResize(QgsLayoutSize(200, 150, QgsUnitTypes.LayoutMillimeters)) # Reduced height for better spacing
map_item.zoomToExtent(st_b10_layer.extent())
layout.addLayoutItem(map_item)
# Add Coordinate Grid
grid = map_item.grid()
grid.setEnabled(True)
grid.setIntervalX(100000) # Set interval for grid lines in map units
grid.setIntervalY(100000)
grid.setAnnotationEnabled(True)
grid.setAnnotationPrecision(0) # Set annotation precision for grid labels
grid.setFrameStyle(QgsLayoutItemMapGrid.Zebra) # Optional grid style
# Label
title_label = QgsLayoutItemLabel(layout)
title_label.setText("False Color Composite - Lab 2")
title_label.setFont(QFont("Arial", 16))
title_label.setHAlign(Qt.AlignCenter)
title_label.attemptMove(QgsLayoutPoint(105, 10, QgsUnitTypes.LayoutMillimeters))
title_label.adjustSizeToText()
layout.addLayoutItem(title_label)
# Legend
legend_item = QgsLayoutItemLegend(layout)
legend_item.setLinkedMap(map_item)
legend_item.setTitle("Legend")
legend_item.setFrameEnabled(True)
legend_item.attemptMove(QgsLayoutPoint(245, 30, QgsUnitTypes.LayoutMillimeters)) # Adjusted for better alignment and spacing
layout.addLayoutItem(legend_item)
# Scalebar
scalebar_item = QgsLayoutItemScaleBar(layout)
scalebar_item.setStyle('Single Box') # Change to 'Single Box' or 'Double Box' for a proper scalebar
scalebar_item.setLinkedMap(map_item)
scalebar_item.setUnitLabel('m') # Add unit label to make it informative
scalebar_item.setNumberOfSegments(4) # Specify the number of segments in the scalebar
scalebar_item.setNumberOfSegmentsLeft(0) # Segments to the left of zero (if any)
scalebar_item.setUnitsPerSegment(50000) # Set distance per segment in map units
scalebar_item.setFont(QFont('Arial', 10)) # Set font size for better readability
scalebar_item.setHeight(5) # Set the height of the scalebar
scalebar_item.applyDefaultSize()
scalebar_item.attemptMove(QgsLayoutPoint(20, 190, QgsUnitTypes.LayoutMillimeters)) # Moved below the map for better organization
layout.addLayoutItem(scalebar_item)
# North Arrow
north_arrow_item = QgsLayoutItemPicture(layout)
north_arrow_item.setPicturePath('/home/huaqo/dev/courses/2024_Remote_Sensing/styles/north_arrow.svg')
if not north_arrow_item.picturePath():
print("North arrow image failed to load!")
north_arrow_item.setReferencePoint(QgsLayoutItemPicture.UpperLeft)
north_arrow_item.attemptMove(QgsLayoutPoint(30, 40, QgsUnitTypes.LayoutMillimeters)) # Adjusted placement for better visibility
north_arrow_item.attemptResize(QgsLayoutSize(15, 15, QgsUnitTypes.LayoutMillimeters)) # Increased size for better visibility
layout.addLayoutItem(north_arrow_item)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Author: Joaquin Gottlebe")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 100, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Date: 16.11.2025")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 110, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Coordinate System
info_label = QgsLayoutItemLabel(layout)
info_label.setText("CRS: EPSG 32633")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 120, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Export
export_path = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/maps/false_color.png"
exporter = QgsLayoutExporter(layout)
export_result = exporter.exportToImage(export_path, QgsLayoutExporter.ImageExportSettings())
if export_result != QgsLayoutExporter.Success:
print("Failed to export map!")
else:
print("Map exported to:", export_path)
-73
View File
@@ -1,73 +0,0 @@
from osgeo import gdal
import numpy as np
import sys
import os
import re
def tif_to_array(path):
data = gdal.Open(path)
if data is None:
raise FileNotFoundError(f"Cannot open file: {path}")
band = data.GetRasterBand(1)
array = band.ReadAsArray().astype(np.float32)
return data, array
def handle_nodata(array):
clean_array = np.where((array < 0) | (array > 1), np.nan, array)
return clean_array
def ndvi_calc(NIR,RED):
ndvi_array = (NIR - RED) / (NIR + RED + 1e-10)
return ndvi_array
def save_tif(array,data,output_path):
driver = gdal.GetDriverByName('GTiff')
rows, cols = array.shape
out_data = driver.Create(output_path, cols, rows, 1, gdal.GDT_Float32)
out_data.SetGeoTransform(data.GetGeoTransform())
out_data.SetProjection(data.GetProjection())
out_band = out_data.GetRasterBand(1)
out_band.WriteArray(array)
out_band.SetNoDataValue(-9999)
out_band.FlushCache()
out_data = None
def get_output_path(output_dir,input_path):
basename = os.path.basename(input_path)
basename_no_ext = os.path.splitext(basename)[0]
basename_no_ext = re.sub(r'_B[1-9]|_B10|_B11', '', basename_no_ext)
path = os.path.join(output_dir, f"{basename_no_ext}_ndvi.TIF")
return path
def print_min_max(array, label):
print(label," Min:", np.nanmin(array), " Max:",np.nanmax(array))
def main():
if len(sys.argv) != 4:
print("Usage: python3 script.py <red_band_path> <nir_band_path> <output_directory>")
sys.exit(1)
red_path = sys.argv[1]
nir_path = sys.argv[2]
output_dir = sys.argv[3]
red_data, red_array = tif_to_array(red_path)
nir_data, nir_array = tif_to_array(nir_path)
red_array = handle_nodata(red_array)
nir_array = handle_nodata(nir_array)
ndvi_array = ndvi_calc(nir_array, red_array)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
output_path = get_output_path(output_dir,red_path)
save_tif(ndvi_array, red_data, output_path)
print_min_max(red_array, "RED")
print_min_max(nir_array, "NIR")
print_min_max(ndvi_array, "NDVI")
if __name__ == "__main__":
main()
-119
View File
@@ -1,119 +0,0 @@
# Cleanup
project = QgsProject.instance()
layer_ids = list(project.mapLayers().keys())
for layer_id in layer_ids:
project.removeMapLayer(layer_id)
# Loading NDVI Layer
path_ndvi = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/ndvi3/LC08_L1TP_233089_20240410_20240419_02_T1_toa_ndvi.TIF"
ndvi_layer = QgsRasterLayer(path_ndvi, "NDVI")
if not ndvi_layer.isValid():
print("NDVI layer failed to load!")
else:
QgsProject.instance().addMapLayer(ndvi_layer)
print("NDVI Layer loaded!")
# Styling NDVI Layer
ndvi_style_path = '/home/huaqo/dev/courses/2024_Remote_Sensing/styles/ndvi.qml'
if not ndvi_layer.loadNamedStyle(ndvi_style_path):
print("Failed to load NDVI style!")
else:
print("NDVI style loaded!")
# Load layout
layout = QgsPrintLayout(project)
layout.initializeDefaults()
# Map
map_item = QgsLayoutItemMap(layout)
map_item.attemptMove(QgsLayoutPoint(20, 30, QgsUnitTypes.LayoutMillimeters)) # Added space between top and map
map_item.attemptResize(QgsLayoutSize(200, 150, QgsUnitTypes.LayoutMillimeters)) # Reduced height for better spacing
map_item.zoomToExtent(ndvi_layer.extent())
layout.addLayoutItem(map_item)
# Add Coordinate Grid
grid = map_item.grid()
grid.setEnabled(True)
grid.setIntervalX(100000) # Set interval for grid lines in map units
grid.setIntervalY(100000)
grid.setAnnotationEnabled(True)
grid.setAnnotationPrecision(0) # Set annotation precision for grid labels
grid.setFrameStyle(QgsLayoutItemMapGrid.Zebra) # Optional grid style
# Label
title_label = QgsLayoutItemLabel(layout)
title_label.setText("NDVI Chiloe 2024 - Lab 2")
title_label.setFont(QFont("Arial", 16))
title_label.setHAlign(Qt.AlignCenter)
title_label.attemptMove(QgsLayoutPoint(105, 10, QgsUnitTypes.LayoutMillimeters))
title_label.adjustSizeToText()
layout.addLayoutItem(title_label)
# Legend
legend_item = QgsLayoutItemLegend(layout)
legend_item.setLinkedMap(map_item)
legend_item.setTitle("Legend")
legend_item.setFrameEnabled(True)
legend_item.attemptMove(QgsLayoutPoint(245, 30, QgsUnitTypes.LayoutMillimeters)) # Adjusted for better alignment and spacing
layout.addLayoutItem(legend_item)
# Scalebar
scalebar_item = QgsLayoutItemScaleBar(layout)
scalebar_item.setStyle('Single Box') # Change to 'Single Box' or 'Double Box' for a proper scalebar
scalebar_item.setLinkedMap(map_item)
scalebar_item.setUnitLabel('m') # Add unit label to make it informative
scalebar_item.setNumberOfSegments(4) # Specify the number of segments in the scalebar
scalebar_item.setNumberOfSegmentsLeft(0) # Segments to the left of zero (if any)
scalebar_item.setUnitsPerSegment(50000) # Set distance per segment in map units
scalebar_item.setFont(QFont('Arial', 10)) # Set font size for better readability
scalebar_item.setHeight(5) # Set the height of the scalebar
scalebar_item.applyDefaultSize()
scalebar_item.attemptMove(QgsLayoutPoint(20, 190, QgsUnitTypes.LayoutMillimeters)) # Moved below the map for better organization
layout.addLayoutItem(scalebar_item)
# North Arrow
north_arrow_item = QgsLayoutItemPicture(layout)
north_arrow_item.setPicturePath('/home/huaqo/dev/courses/2024_Remote_Sensing/styles/north_arrow.svg')
if not north_arrow_item.picturePath():
print("North arrow image failed to load!")
north_arrow_item.setReferencePoint(QgsLayoutItemPicture.UpperLeft)
north_arrow_item.attemptMove(QgsLayoutPoint(30, 40, QgsUnitTypes.LayoutMillimeters)) # Adjusted placement for better visibility
north_arrow_item.attemptResize(QgsLayoutSize(15, 15, QgsUnitTypes.LayoutMillimeters)) # Increased size for better visibility
layout.addLayoutItem(north_arrow_item)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Author: Joaquin Gottlebe")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 100, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Date: 16.11.2025")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 110, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Coordinate System
info_label = QgsLayoutItemLabel(layout)
info_label.setText("CRS: EPSG 32633")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 120, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Export
export_path = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/maps/ndvi_chiloe_2024.png"
exporter = QgsLayoutExporter(layout)
export_result = exporter.exportToImage(export_path, QgsLayoutExporter.ImageExportSettings())
if export_result != QgsLayoutExporter.Success:
print("Failed to export map!")
else:
print("Map exported to:", export_path)
-139
View File
@@ -1,139 +0,0 @@
# Cleanup
project = QgsProject.instance()
layer_ids = list(project.mapLayers().keys())
for layer_id in layer_ids:
project.removeMapLayer(layer_id)
# Loading NDVI Layer
path_ndvi = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/ndvi/LC08_L1TP_193023_20170602_20170615_01_T1_toa_ndvi.TIF"
ndvi_layer = QgsRasterLayer(path_ndvi, "NDVI")
if not ndvi_layer.isValid():
print("NDVI layer failed to load!")
else:
QgsProject.instance().addMapLayer(ndvi_layer)
print("NDVI Layer loaded!")
# Loading Additional Layer
path_overlay = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/ndwi/LC08_L1TP_193023_20170602_20170615_01_T1_toa_ndwi.TIF" # Replace with your actual layer path
ndwi_layer = QgsRasterLayer(path_overlay, "NDWI")
if not ndwi_layer.isValid():
print("NDWI layer failed to load!")
else:
QgsProject.instance().addMapLayer(ndwi_layer)
print("NDWI Layer loaded!")
# Styling NDVI Layer
ndvi_style_path = '/home/huaqo/dev/courses/2024_Remote_Sensing/styles/ndvi.qml'
if not ndvi_layer.loadNamedStyle(ndvi_style_path):
print("Failed to load NDVI style!")
else:
print("NDVI style loaded!")
ndwi_style_path = '/home/huaqo/dev/courses/2024_Remote_Sensing/styles/ndwi.qml'
if not ndwi_layer.loadNamedStyle(ndwi_style_path):
print("Failed to load NDWI style!")
else:
print("NDWI style loaded!")
# Reference system (optional, uncomment if needed)
# crs = QgsCoordinateReferenceSystem("EPSG:4326")
# crsSrc = QgsCoordinateReferenceSystem("EPSG:32633")
# crsDest = QgsCoordinateReferenceSystem("EPSG:4326")
# Load layout
layout = QgsPrintLayout(project)
layout.initializeDefaults()
# Map
map_item = QgsLayoutItemMap(layout)
map_item.attemptMove(QgsLayoutPoint(20, 30, QgsUnitTypes.LayoutMillimeters)) # Added space between top and map
map_item.attemptResize(QgsLayoutSize(200, 150, QgsUnitTypes.LayoutMillimeters)) # Reduced height for better spacing
map_item.zoomToExtent(ndvi_layer.extent())
layout.addLayoutItem(map_item)
# Add Coordinate Grid
grid = map_item.grid()
grid.setEnabled(True)
grid.setIntervalX(100000) # Set interval for grid lines in map units
grid.setIntervalY(100000)
grid.setAnnotationEnabled(True)
grid.setAnnotationPrecision(0) # Set annotation precision for grid labels
grid.setFrameStyle(QgsLayoutItemMapGrid.Zebra) # Optional grid style
# Label
title_label = QgsLayoutItemLabel(layout)
title_label.setText("NDVI & NDWI - Lab 2")
title_label.setFont(QFont("Arial", 16))
title_label.setHAlign(Qt.AlignCenter)
title_label.attemptMove(QgsLayoutPoint(105, 10, QgsUnitTypes.LayoutMillimeters))
title_label.adjustSizeToText()
layout.addLayoutItem(title_label)
# Legend
legend_item = QgsLayoutItemLegend(layout)
legend_item.setLinkedMap(map_item)
legend_item.setTitle("Legend")
legend_item.setFrameEnabled(True)
legend_item.attemptMove(QgsLayoutPoint(245, 30, QgsUnitTypes.LayoutMillimeters)) # Adjusted for better alignment and spacing
layout.addLayoutItem(legend_item)
# Scalebar
scalebar_item = QgsLayoutItemScaleBar(layout)
scalebar_item.setStyle('Single Box') # Change to 'Single Box' or 'Double Box' for a proper scalebar
scalebar_item.setLinkedMap(map_item)
scalebar_item.setUnitLabel('m') # Add unit label to make it informative
scalebar_item.setNumberOfSegments(4) # Specify the number of segments in the scalebar
scalebar_item.setNumberOfSegmentsLeft(0) # Segments to the left of zero (if any)
scalebar_item.setUnitsPerSegment(50000) # Set distance per segment in map units
scalebar_item.setFont(QFont('Arial', 10)) # Set font size for better readability
scalebar_item.setHeight(5) # Set the height of the scalebar
scalebar_item.applyDefaultSize()
scalebar_item.attemptMove(QgsLayoutPoint(20, 190, QgsUnitTypes.LayoutMillimeters)) # Moved below the map for better organization
layout.addLayoutItem(scalebar_item)
# North Arrow
north_arrow_item = QgsLayoutItemPicture(layout)
north_arrow_item.setPicturePath('/home/huaqo/dev/courses/2024_Remote_Sensing/styles/north_arrow.svg')
if not north_arrow_item.picturePath():
print("North arrow image failed to load!")
north_arrow_item.setReferencePoint(QgsLayoutItemPicture.UpperLeft)
north_arrow_item.attemptMove(QgsLayoutPoint(30, 40, QgsUnitTypes.LayoutMillimeters)) # Adjusted placement for better visibility
north_arrow_item.attemptResize(QgsLayoutSize(15, 15, QgsUnitTypes.LayoutMillimeters)) # Increased size for better visibility
layout.addLayoutItem(north_arrow_item)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Author: Joaquin Gottlebe")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 100, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Author
info_label = QgsLayoutItemLabel(layout)
info_label.setText("Date: 16.11.2025")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 110, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Coordinate System
info_label = QgsLayoutItemLabel(layout)
info_label.setText("CRS: EPSG 32633")
info_label.setFont(QFont("Arial", 12))
info_label.setHAlign(Qt.AlignLeft)
info_label.attemptMove(QgsLayoutPoint(245, 120, QgsUnitTypes.LayoutMillimeters))
info_label.adjustSizeToText()
layout.addLayoutItem(info_label)
# Export
export_path = "/home/huaqo/dev/courses/2024_Remote_Sensing/lab2/maps/ndvi_ndwi.png"
exporter = QgsLayoutExporter(layout)
export_result = exporter.exportToImage(export_path, QgsLayoutExporter.ImageExportSettings())
if export_result != QgsLayoutExporter.Success:
print("Failed to export map!")
else:
print("Map exported to:", export_path)
-81
View File
@@ -1,81 +0,0 @@
from osgeo import gdal
import numpy as np
import sys
import os
import re
def tif_to_array(path):
data = gdal.Open(path)
if data is None:
raise FileNotFoundError(f"Cannot open file: {path}")
band = data.GetRasterBand(1)
array = band.ReadAsArray().astype(np.float32)
return data, array
def handle_nodata(array):
clean_array = np.where((array < 0) | (array > 1), np.nan, array)
return clean_array
def ndwi_calc(GREEN, NIR):
ndwi_array = (GREEN - NIR) / (GREEN + NIR + 1e-10)
return ndwi_array
def save_tif(array, data, output_path):
driver = gdal.GetDriverByName('GTiff')
rows, cols = array.shape
out_data = driver.Create(output_path, cols, rows, 1, gdal.GDT_Float32)
out_data.SetGeoTransform(data.GetGeoTransform())
out_data.SetProjection(data.GetProjection())
out_band = out_data.GetRasterBand(1)
out_band.WriteArray(array)
out_band.SetNoDataValue(-9999)
out_band.FlushCache()
out_data = None
def get_output_path(output_dir, input_path):
basename = os.path.basename(input_path)
basename_no_ext = os.path.splitext(basename)[0]
basename_no_ext = re.sub(r'_B[1-9]|_B10|_B11', '', basename_no_ext)
path = os.path.join(output_dir, f"{basename_no_ext}_ndwi.TIF")
return path
def print_min_max(array, label):
print(label, " Min:", np.nanmin(array), " Max:", np.nanmax(array))
def main():
if len(sys.argv) != 4:
print("Usage: python3 script.py <green_band_path> <nir_band_path> <output_directory>")
sys.exit(1)
green_path = sys.argv[1]
nir_path = sys.argv[2]
output_dir = sys.argv[3]
green_data, green_array = tif_to_array(green_path)
nir_data, nir_array = tif_to_array(nir_path)
green_array = handle_nodata(green_array)
nir_array = handle_nodata(nir_array)
ndwi_array = ndwi_calc(green_array, nir_array)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
output_path = get_output_path(output_dir, green_path)
save_tif(ndwi_array, green_data, output_path)
print_min_max(nir_array, "NIR")
print_min_max(green_array, "GREEN")
print_min_max(ndwi_array, "NDWI")
if __name__ == "__main__":
main()

Some files were not shown because too many files have changed in this diff Show More