bryan.wilkinson@umbc.edu
ITE 373
Office Hours:
Mondays 10:30 AM - 11:30 AM and Thursdays 3:00 PM - 4:30 PM
or by appointment
Website: https://www.csee.umbc.edu/courses/undergraduate/433/spring18/
What is the output of the following code and why?
case 9 in
*9)
echo "This ends in a nine"
;;
9)
echo "This is a nine"
;;
*)
echo "Nothing Matched"
;;
esac
Scripting Languages | Systems Languages |
---|---|
Higher Level | Lower Level |
Loosely Typed | Strongly Typed |
Interpreted | Compiled |
Runs Slower | Runs Faster |
Faster Development | Slower Development |
Smaller Code Size | Larger Code Size |
Ousterhout, John K. "Scripting: Higher level programming for the 21st century." Computer 31.3 (1998): 23-30.
Ousterhout, John K. "Scripting: Higher level programming for the 21st century." Computer 31.3 (1998): 23-30.
sub fibRec {
my $n = shift;
$n < 2 ? $n : fibRec($n - 1) + fibRec($n - 2);
}
https://rosettacode.org/wiki/Fibonacci_sequence#Perl
print join('.', split /,/, 'Hello,How,Are,You,Today'), "\n";
http://rosettacode.org/wiki/Tokenize_a_string#Perl
fib() {
local n=$1
[ $n -lt 2 ] && echo -n $n || echo -n $(( $( fib $(( n - 1 )) ) + $( fib $(( n - 2 )) ) ))
}
https://rosettacode.org/wiki/Fibonacci_sequence#UNIX_Shell
string='Hello,How,Are,You,Today'
(IFS=,
printf '%s.' $string
echo)
http://rosettacode.org/wiki/Tokenize_a_string#UNIX_Shell
recfibo <- function(n) {
if ( n < 2 ) n
else Recall(n-1) + Recall(n-2)
}
https://rosettacode.org/wiki/Fibonacci_sequence#R
text <- "Hello,How,Are,You,Today"
junk <- strsplit(text, split=",")
print(paste(unlist(junk), collapse="."))
http://rosettacode.org/wiki/Tokenize_a_string#R
function fib(n) {
return n<2?n:fib(n-1)+fib(n-2);
}
https://rosettacode.org/wiki/Fibonacci_sequence#JavaScript
alert( "Hello,How,Are,You,Today".split(",").join(".") );
http://rosettacode.org/wiki/Tokenize_a_string#JavaScript
<?php
function fibRec($n) {
return $n < 2 ? $n : fibRec($n-1) + fibRec($n-2);
}
?>
https://rosettacode.org/wiki/Fibonacci_sequence#PHP
<?php
$str = 'Hello,How,Are,You,Today';
echo implode('.', explode(',', $str));
?>
library(ggplot2)
ggplot(midwest, aes(x=area, y=poptotal)) +
geom_point() +
geom_smooth(method="lm") +
coord_cartesian(xlim=c(0,0.1), ylim=c(0, 1000000)) +
labs(title="Area Vs Population", subtitle="From midwest dataset", y="Population", x="Area", caption="Midwest Demographics")
library(ggplot2)
gg <- ggplot(midwest, aes(x=area, y=poptotal)) +
geom_point(aes(col=state), size=3) + # Set color to vary based on state categories.
geom_smooth(method="lm", col="firebrick", size=2) +
coord_cartesian(xlim=c(0, 0.1), ylim=c(0, 1000000)) +
labs(title="Area Vs Population", subtitle="From midwest dataset", y="Population", x="Area", caption="Midwest Demographics")
plot(gg)
library(ggplot2)
# Filter required rows.
midwest_sub <- midwest[midwest$poptotal > 300000, ]
midwest_sub$large_county <- ifelse(midwest_sub$poptotal > 300000, midwest_sub$county, "")
# Base Plot
gg <- ggplot(midwest, aes(x=area, y=poptotal)) +
geom_point(aes(col=state, size=popdensity)) +
geom_smooth(method="loess", se=F) + xlim(c(0, 0.1)) + ylim(c(0, 500000)) +
labs(title="Area Vs Population", y="Population", x="Area", caption="Source: midwest")
gg + geom_label(aes(label=large_county), size=2, data=midwest_sub, alpha=0.25) + labs(subtitle="With ggplot2::geom_label") + theme(legend.position = "None") # label
# Plot text and label that REPELS eachother (using ggrepel pkg) ------------
library(ggrepel)
gg + geom_label_repel(aes(label=large_county), size=2, data=midwest_sub) + labs(subtitle="With ggrepel::geom_label_repel") + theme(legend.position = "None") # label