Fuel Efficiency - Regression Analysis
Data Mining and Business Analytics with R
This example shows a very simple regression analysis using fuel data of 38 cars. Code is copied from the book “Data Mining and Business Analytics with R” with minor modification on the graphs.
There are 2 learning points to be remembered with this example.
Leaps package with regsubsets fuction.
Regsubsets function allows to perform regression on subsets of data, particularly useful to compare across model’s predictors to understand the fit of the model.
https://www.rdocumentation.org/packages/leaps/versions/2.1-1/topics/regsubsets
Cross-Validation
Cross-validation removes one case from the data set of n cases, fits the model to the reduced data set, and predicts the response of that one case that has been removed from the estimation. This is repeated for each of the n cases. The summary statistics of the n genuine out-of-sample prediction errors (mean error, root mean square error, mean absolute percent error) help us assess the out-of-sample prediction performance. Cross-validation is very informative as it evaluates the model on new data. We find that the model with all six regressors performs better. It leads to a mean absolute percent error of about 6.75% (as compared to 8.23% for the model with weight as the only regressor).
> FuelEff
GPM WT DIS NC HP ACC ET
1 5.917 4.360 350 8 155 14.9 1
2 6.452 4.054 351 8 142 14.3 1
3 5.208 3.605 267 8 125 15.0 1
4 5.405 3.940 360 8 150 13.0 1
5 3.333 2.155 98 4 68 16.5 0
6 3.636 2.560 134 4 95 14.2 0
7 3.676 2.300 119 4 97 14.7 0
8 3.236 2.230 105 4 75 14.5 0
9 4.926 2.830 131 5 103 15.9 0
10 5.882 3.140 163 6 125 13.6 0
11 4.630 2.795 121 4 115 15.7 0
12 6.173 3.410 163 6 133 15.8 0
13 4.854 3.380 231 6 105 15.8 0
14 4.808 3.070 200 6 85 16.7 0
15 5.376 3.620 225 6 110 18.7 0
16 5.525 3.410 258 6 120 15.1 0
17 5.882 3.840 305 8 130 15.4 1
18 5.682 3.725 302 8 129 13.4 1
19 6.061 3.955 351 8 138 13.2 1
20 5.495 3.830 318 8 135 15.2 1
21 3.774 2.585 140 4 88 14.4 0
22 4.566 2.910 171 6 109 16.6 1
23 2.933 1.975 86 4 65 15.2 0
24 2.849 1.915 98 4 80 14.4 0
25 3.650 2.670 121 4 80 15.0 0
26 3.175 1.990 89 4 71 14.9 0
27 3.390 2.135 98 4 68 16.6 0
28 3.521 2.670 151 4 90 16.0 0
29 3.472 2.595 173 6 115 11.3 1
30 3.731 2.700 173 6 115 12.9 1
31 2.985 2.556 151 4 90 13.2 0
32 2.924 2.200 105 4 70 13.2 0
33 3.145 2.020 85 4 65 19.2 0
34 2.681 2.130 91 4 69 14.7 0
35 3.279 2.190 97 4 78 14.1 0
36 4.545 2.815 146 6 97 14.5 0
37 4.651 2.600 121 4 110 12.8 0
38 3.135 1.925 89 4 71 14.0 0
CODE
## first we read in the data
FuelEff <- read.csv("https://www.biz.uiowa.edu/faculty/jledolter/DataMining/FuelEfficiency.csv")
#FuelEff <- read.csv("FuelEfficiency.csv")
FuelEff
#----------------------------
plot.new()
#par(mfrow=c(1,1))
par(mar=c(4,4,1,1)+0.1,mfrow=c(3,3),bg="white",cex = 1, cex.main = 1)
plot(GPM~MPG,data=FuelEff)
plot(GPM~WT,data=FuelEff)
plot(GPM~DIS,data=FuelEff)
plot(GPM~NC,data=FuelEff)
plot(GPM~HP,data=FuelEff)
plot(GPM~ACC,data=FuelEff)
plot(GPM~ET,data=FuelEff)
dev.copy(png,'fueleff_xyplot.png',width = 800, height = 800)
dev.off()
FuelEff=FuelEff[-1] #ignore the MPG column
FuelEff
## regression on all data
m1=lm(GPM~.,data=FuelEff)
summary(m1)
cor(FuelEff)
## best subset regression in R
library(leaps)
X=FuelEff[,2:7]
y=FuelEff[,1]
#use the regsubsets function from package leaps to compute regression of the subsets
#https://www.rdocumentation.org/packages/leaps/versions/2.1-1/topics/regsubsets
out=summary(regsubsets(X,y,nbest=2,nvmax=ncol(X)))
tab=cbind(out$which,out$rsq,out$adjr2,out$cp)
tab
m2=lm(GPM~WT,data=FuelEff)
summary(m2)
## cross-validation (leave one out) for the model on all six regressors
n=length(FuelEff$GPM)
diff=dim(n)
percdiff=dim(n)
for (k in 1:n) {
train1=c(1:n)
train=train1[train1!=k]
## the R expression "train1[train1!=k]" picks from train1 those
## elements that are different from k and stores those elements in the
## object train.
## For k=1, train consists of elements that are different from 1; that
## is 2, 3, …, n.
m1=lm(GPM~.,data=FuelEff[train,])
pred=predict(m1,newdat=FuelEff[-train,]) #adding the new data, which is ignored earlier
obs=FuelEff$GPM[-train]
diff[k]=obs-pred
percdiff[k]=abs(diff[k])/obs
}
me=mean(diff)
rmse=sqrt(mean(diff**2))
mape=100*(mean(percdiff))
me # mean error
rmse # root mean square error
mape # mean absolute percent error
## cross-validation (leave one out) for the model on weight only
n=length(FuelEff$GPM)
diff=dim(n)
percdiff=dim(n)
for (k in 1:n) {
train1=c(1:n)
train=train1[train1!=k]
m2=lm(GPM~WT,data=FuelEff[train,])
pred=predict(m2,newdat=FuelEff[-train,])
obs=FuelEff$GPM[-train]
diff[k]=obs-pred
percdiff[k]=abs(diff[k])/obs
}
me=mean(diff)
rmse=sqrt(mean(diff**2))
mape=100*(mean(percdiff))
me # mean error
rmse # root mean square error
mape # mean absolute percent error
Graphs and Outcomes
## regression on all data
m1=lm(GPM~.,data=FuelEff)
summary(m1)
Call:
lm(formula = GPM ~ ., data = FuelEff)
Residuals:
Min 1Q Median 3Q Max
-0.4996 -0.2547 0.0402 0.1956 0.6455
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.599357 0.663403 -3.918 0.000458 ***
WT 0.787768 0.451925 1.743 0.091222 .
DIS -0.004890 0.002696 -1.814 0.079408 .
NC 0.444157 0.122683 3.620 0.001036 **
HP 0.023599 0.006742 3.500 0.001431 **
ACC 0.068814 0.044213 1.556 0.129757
ET -0.959634 0.266785 -3.597 0.001104 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.313 on 31 degrees of freedom
Multiple R-squared: 0.9386, Adjusted R-squared: 0.9267
F-statistic: 78.94 on 6 and 31 DF, p-value: < 2.2e-16
cor(FuelEff)
GPM WT DIS NC HP ACC ET
GPM 1.00000000 0.92626656 0.8229098 0.8411880 0.8876992 0.03307093 0.5206121
WT 0.92626656 1.00000000 0.9507647 0.9166777 0.9172204 -0.03357386 0.6673661
DIS 0.82290984 0.95076469 1.0000000 0.9402812 0.8717993 -0.14341745 0.7746636
NC 0.84118805 0.91667774 0.9402812 1.0000000 0.8638473 -0.12924363 0.8311721
HP 0.88769915 0.91722045 0.8717993 0.8638473 1.0000000 -0.25262113 0.7202350
ACC 0.03307093 -0.03357386 -0.1434174 -0.1292436 -0.2526211 1.00000000 -0.3102336
ET 0.52061208 0.66736606 0.7746636 0.8311721 0.7202350 -0.31023357 1.0000000
## best subset regression in R
library(leaps)
X=FuelEff[,2:7]
y=FuelEff[,1]
out=summary(regsubsets(X,y,nbest=2,nvmax=ncol(X)))
tab=cbind(out$which,out$rsq,out$adjr2,out$cp)
tab
(Intercept) WT DIS NC HP ACC ET
1 1 1 0 0 0 0 0 0.8579697 0.8540244 37.674750
1 1 0 0 0 1 0 0 0.7880098 0.7821212 72.979632
2 1 1 1 0 0 0 0 0.8926952 0.8865635 22.150747
2 1 1 0 0 0 0 1 0.8751262 0.8679906 31.016828
3 1 0 0 1 1 0 1 0.9145736 0.9070360 13.109930
3 1 1 1 1 0 0 0 0.9028083 0.8942326 19.047230
4 1 0 0 1 1 1 1 0.9313442 0.9230223 6.646728
4 1 1 0 1 1 0 1 0.9204005 0.9107520 12.169443
5 1 1 1 1 1 0 1 0.9337702 0.9234218 7.422476
5 1 0 1 1 1 1 1 0.9325494 0.9220103 8.038535
6 1 1 1 1 1 1 1 0.9385706 0.9266810 7.000000
m2=lm(GPM~WT,data=FuelEff)
summary(m2)
Call:
lm(formula = GPM ~ WT, data = FuelEff)
Residuals:
Min 1Q Median 3Q Max
-0.88072 -0.29041 0.00659 0.19021 1.13164
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.006101 0.302681 -0.02 0.984
WT 1.514798 0.102721 14.75 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.4417 on 36 degrees of freedom
Multiple R-squared: 0.858, Adjusted R-squared: 0.854
F-statistic: 217.5 on 1 and 36 DF, p-value: < 2.2e-16


| PostgreSQL 9.0.10 Documentation | ||||
|---|---|---|---|---|
| Prev | Up | Appendix E. Release Notes | Next |
Release date: 2003-05-22
This release contains a variety of fixes for version 7.3.2.
A dump/restore is not required for those running version 7.3.*.
Repair sometimes-incorrect computation of StartUpID after a crash
Avoid slowness with lots of deferred triggers in one transaction (Stephan)
Don't lock referenced row when UPDATE doesn't change foreign key's value (Jan)
Use -fPIC not -fpic on Sparc (Tom Callaway)
Repair lack of schema-awareness in contrib/reindexdb
Fix contrib/intarray error for zero-element result array (Teodor)
Ensure createuser script will exit on control-C (Oliver)
Fix errors when the type of a dropped column has itself been dropped
CHECKPOINT does not cause database panic on failure in noncritical steps
Accept 60 in seconds fields of timestamp, time, interval input values
Issue notice, not error, if TIMESTAMP, TIME, or INTERVAL precision too large
Fix abstime-to-time
cast function (fix is
not applied unless you initdb)
Fix pg_proc entry for timestampt_izone (fix is not applied unless you initdb)
Make EXTRACT(EPOCH FROM timestamp without time zone)
treat input as local time
'now'::timestamptz gave wrong answer if timezone changed earlier in transaction
HAVE_INT64_TIMESTAMP code for time with timezone overwrote its input
Accept GLOBAL TEMP/TEMPORARY as a synonym for TEMPORARY
Avoid improper schema-privilege-check failure in foreign-key triggers
Fix bugs in foreign-key triggers for SET DEFAULT action
Fix incorrect time-qual check in row fetch for UPDATE and DELETE triggers
Foreign-key clauses were parsed but ignored in ALTER TABLE ADD COLUMN
Fix createlang script breakage for case where handler function already exists
Fix misbehavior on zero-column tables in pg_dump, COPY, ANALYZE, other places
Fix misbehavior of func_error()
on type names containing '%'
Fix misbehavior of replace()
on strings containing '%'
Regular-expression patterns containing certain multibyte characters failed
Account correctly for NULLs in more cases in join size estimation
Avoid conflict with system definition of isblank()
function or macro
Fix failure to convert large code point values in EUC_TW conversions (Tatsuo)
Fix error recovery for SSL_read
/SSL_write
calls
Don't do early constant-folding of type coercion expressions
Validate page header fields immediately after reading in any page
Repair incorrect check for ungrouped variables in unnamed joins
Fix buffer overrun in to_ascii
(Guido Notari)
contrib/ltree fixes (Teodor)
Fix core dump in deadlock detection on machines where char is unsigned
Avoid running out of buffers in many-way indexscan (bug introduced in 7.3)
Fix planner's selectivity estimation functions to handle domains properly
Fix dbmirror memory-allocation bug (Steven Singer)
Prevent infinite loop in ln(numeric)
due to roundoff error
GROUP BY got confused if there were multiple equal GROUP BY items
Fix bad plan when inherited UPDATE/DELETE references another inherited table
Prevent clustering on incomplete (partial or non-NULL-storing) indexes
Service shutdown request at proper time if it arrives while still starting up
Fix left-links in temporary indexes (could make backwards scans miss entries)
Fix incorrect handling of client_encoding setting in postgresql.conf (Tatsuo)
Fix failure to respond to pg_ctl stop -m fast after Async_NotifyHandler runs
Fix SPI for case where rule contains multiple statements of the same type
Fix problem with checking for wrong type of access privilege in rule query
Fix problem with EXCEPT in CREATE RULE
Prevent problem with dropping temp tables having serial columns
Fix replace_vars_with_subplan_refs failure in complex views
Fix regexp slowness in single-byte encodings (Tatsuo)
Allow qualified type names in CREATE CAST and DROP CAST
Accept SETOF type[]
, which formerly had to
be written SETOF _type
Fix pg_dump core dump in some cases with procedural languages
Force ISO datestyle in pg_dump output, for portability (Oliver)
pg_dump failed to handle error return
from lo_read
(Oleg Drokin)
pg_dumpall failed with groups having no members (Nick Eskelinen)
pg_dumpall failed to recognize --globals-only switch
pg_restore failed to restore blobs if -X disable-triggers is specified
Repair intrafunction memory leak in plpgsql
pltcl's elog command dumped core if given wrong parameters (Ian Harding)
plpython used wrong value of atttypmod (Brad McLean)
Fix improper quoting of boolean values in Python interface (D'Arcy)
Added addDataType()
method to PGConnection interface for JDBC
Fixed various problems with updateable ResultSets for JDBC (Shawn Green)
Fixed various problems with DatabaseMetaData for JDBC (Kris Jurka, Peter Royal)
Fixed problem with parsing table ACLs in JDBC
Better error message for character set conversion problems in JDBC


DONNIE BRASCO A film review by Walter Frith Copyright 1997 Walter Frith
The cinematic talents of Al Pacino have reached new heights with 'Donnie Brasco'. Pacino has played a criminal many times in his career and from the high profile and diverse characterizations of Michael Corleone in both 'Godfather' movies to the lacerating and despicable thug he played in 'Scarface' (1983) to the hilarious over the top gangster under heavy make-up in 'Dick Tracy' (1990), this legendary actor has managed to find new dimensions every time he sets out to play the bad guy. In many ways, re-inventing yourself in a lot of films can be more difficult than anything else you attempt in screen acting and I suspect Pacino enjoys living up to the challenge.
In 'Donnie Brasco', which is based on a true story, Al Pacino plays a life long member of the Mafia whose career in crime is marked with what he claims are twenty six assassinations as a hit man and he praises himself on a level of greatness that others in the organization aren't willing to recognize since he has not managed to move up much all the years he's been involved in his seedy and unrewarding lifestyle. His character is really a pathetic example of a life wasted. His still lives in a second class ordinary apartment with his junkie son and a female companion.
Enter an undercover FBI agent played sternly and completely in control at all times by Johnny Depp. His assignment is to get inside the life of Pacino and the organization he associates with and break it up. It's a job he performed for almost three years from 1978 to 1981 and his work along with other agents led to over two hundred indictments and one hundred convictions.
Having gotten close to Pacino's character leads to problems for him as he develops conflicting loyalties since Pacino treats him like a son and promises to make him a 'made' guy. Depp's character encounters family problems with his wife and children who feel shunned by his devotion to work and commitment elsewhere.
Director Mike Newell has created a convincing and meaningful crime saga with unpretentious characters and scenes of sorted detail combined with a screenplay by Paul Attanasio ('Quiz Show') based on the novel 'Donnie Brasco' by Joseph D. Pistone and Richard Woodley. Pistone is the FBI agent Depp plays in the film and while Pacino makes the film, Depp still proves he's one of this generation's finest young actors.
OUT OF 5> * * * *
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Fake Brat: Part IV
Katelyn and I trotted up to apartment 6B where the sound of muffled voices and loud music was coming from. A few seconds before Katelyn was about to ring the doorbell, my phone started to ring.
“Ugh, just a second. It’s my parents, if I don’t answer now they won’t stop calling me all night long.” I told Katelyn as I answered the phone.
Before I could even put the phone up to my ear, the screeching sound of my mothers voice flew through the speakers.
“Where the heck are you?”
“I’m fine thanks for asking,” I sighed, “I’m at a friend’s house.”
“Do you think after what you did at the gala I will allow you to just wonder off like that?”
“Nothing happened mother! I just fell on a guy, that’s it.”
“Nothing happened?!” She asked me, her voice slowly rising in volume to match her obvious anger. “You embarrassed both me and your father and just left the party! That’s what happened.”
All of the sudden there was a low voice talking to my mother in the background.
“Is that her?” My father asked.
“You are in so much trouble young lady!”
“Oh I’m sorry, is your secretary too busy that you actually noticed something going on in your family.” I asked him my anger growing just as much as theirs. “You know what, do whatever you want, I’ll see you later.” I hanged up before either of them could say anything else. I turned back around to face Katelyn and gave her a small nod. She replied with a warm smile before ringing the doorbell.
“Hey Joe!” Katelyn shouted as Joe opened the door to his apartment. He didn’t change at all since the last time we saw him. He was still the same thin, tall guy with dark hair and a matching beard. I mean, if you can even call two hairs on his chin a beard. We told him it looked ridiculous but he wouldn’t listen claiming that it made him more of a “man.”
“Hey ladies,” Joe replied once he saw it was us. “Dressed a bit formal for my party?” He asked examining our long gowns.
“You are throwing a party and didn’t think of inviting us? Consider me offended!” Katelyn replied ignoring his question.
Joe shrugged, “I knew you two would be coming whether I was inviting you or not so there wasn’t really any need to.” He opened the door wider allowing us to walk passed him and into the apartment. Joe, being a sophomore at university, had a small apartment all to himself meaning that every now and then he would allow himself the pleasure of throwing a party. The apartment wasn’t luxurious and opulent like the things I was used to, but that is why I loved coming here so much. Unlike the other parties Joe threw, there wasn’t such a large crowd of people.
“You wouldn’t believe what Jennifer did at her parent’s friend’s gala just about an hour ago.” Katelyn said not waiting a minute longer to share my embarrassing moment with our friend. After I fell on the new kid in front of everyone Katelyn pulled me away from the crowd. Together we sneaked out the back entrance of the hotel and caught a taxi so that we could come here. We both knew better than to stick around the gala after the stunt I had just pulled off.
“Let me guess, she fell on some handsome blonde hair, green eyed guy in front of everyone.” Joe replied while dropping down to sit on his old sofa.
“Yeah…  He replied pulling out his phone. “Jennifer Moorse throws herself on her new mysterious guy at the Clarkson’s gala at the Royal Hotel.” Joe read off one of the sites.
“What?!” I snatched the phone out of his hands. I scroll down the page only to see that he was telling the truth. They were actually claiming that I “purposely threw” myself on him! It couldn’t get any more embarrassing than that.
 Joe reassured me once he saw my flushed face. He took his phone back and pocketed it in his jeans. “Just relax and have some fun.” I replied with a nod and allowed Katelyn to drag me off to the kitchen so we could get something to drink.
The hours passed and so did the memory of the gala. We danced and laughed along the beat of the music. The room was hot and sticky, filled with the warmth of too many human bodies in a closed place. My mind was fuzzy, my sight was blurry and my skin was numb. I had lost Katelyn a few minutes after we had started dancing and was now talking to a girl about a book we had both read. Slowly losing interest in the subject I looked around the foggy room. There was one guy sitting on the old sofa watching television, but he seemed indecisive of what he wanted to watch as he continued to flip through the channels. A group of his friends called his name distracting him from the television that was now left on the News. All of the sudden I felt my feet move away from the girl in the middle of her discussion and towards the television as a picture of my parents appeared near the reporter.
“Turn it up…” I told the guy sitting on the old sofa.
“What?” The guy asked me not really paying attention to what I had said.
“I said turn it up!” I shouted at the guy, getting annoyed that he was being so slow. Startled by my sudden aggression he turned the volume up. The whole room seemed to be silenced, the only thing I could hear was the reporter’s annoyingly perfect voice, “ Jacobe Moorse and Cassandra Moorse instantly dead in a car accident seconds after their exit from the Royal Hotel…”
To be continued…


-->
For our support vector machine to give us a reliable model, the most important thing was to feed it a large amount of accurate and relevant data in the correct format.
We spent many hours working on ways to obtain the necessary weather data however we couldn’t find a single free source that could give us sufficient data in the correct format. All APIs that could be used required funding and we had none.
Finally, we decided that we had no choice but to use the BeautifulSoup library in Python to webscrape weather data. We used this to obtain 6.5 years of weather data for 19 locations in the United States. The weather data obtained included temperature, humidity, wind speed and rain. The script was optimised so that we only had to make 1 request to obtain 1 month of weather data. The source provided 6 hour averages, from 00:00 to 06:00, from 06:00 to 12:00, from 12:00 to 18:00 and from 18:00 to 00:00 hence giving us 4 data points for each day. Of course, there were occasions when the source didn’t have data for some times and we had to take this into account.
"""If the current element is a temperature, tempBool becomes true. This checks for that"""
if tempBool== True:
#converting the temperature from string to float
word=float(word)
"""Appending the temperature to a temporary temperature array
The temperature array contains at most 4 temperatures at any given time."""
tempotemp.append(word)
tempcount+=1
"""If the value of temperature is not 0, then add 1 to a variable.
This keeps track of how many data points we don't have values for.
It comes in handy for calculating averages"""
if word!=0.0:
tempnonz+=1
tempBool=False
"""There's 4 temperature data points every day, this keeps track of how many have
been added to the temporary array. Once there's 4, both them and the daily averages
calculated from them are added to the final temperature array"""
if tempcount==4:
if (sum(tempotemp)/float(len(tempotemp)))== 0:
tempotemp.append("no data")
else:
#Here we calculate the average and append it to the end of the temporary array
tempotemp.append(sum(tempotemp) / float(tempnonz))
"""Keeps track of the last 14 days of weather data, used to provide the past
14 day weather average for every day"""
if len(lastWeekTemp)==14:
lastWeekTemp.pop(0)
#We append daily average to it (last element in the temporary array is the average)
lastWeekTemp.append(tempotemp[4])
else:
lastWeekTemp.append(tempotemp[4])
tempAvg.append(sum(lastWeekTemp) / float(len(lastWeekTemp)) )
#We append the 4 data points + average array to a final temperature array
temperature.append(tempotemp)
#We zero everything readying it for when the next temperature value is found
tempnonz=0
tempcount=0
tempotemp=[]
This system was applied to all data types giving us 4 large arrays, each containing multiple nested arrays. Each nested array contained 1 day of data. There were also 4 large arrays containing past 14 day averages for each data type for each day.
Wildfire data for every single day was obtained through the USDA Forestry Service: This included whether a fire occurred and what the cause of the fire was. We adapted this to a useful format and filtered out all fires that were caused by arson, railroads and even nearby children.
#Setting up the csv containing 6.5 years of weather data.
with open('6_years.csv', 'r') as csvfile:
reader = csv.reader(csvfile)
for row in reader:
if len(row)==0:
#ignoring empty rows
pass
else:
wildfires.append(row)
for element in wildfires:
element=[''.join(element)]
for item in element:
x = item.split('\t')
#removing wildfires that took place due to arson, nearby children or railroads
if (x[4]==7) or (x[4]==5) or (x[4]==6):
pass
else:
data.append(x)
data = data[1:]
for element in data:
#obtaining date and location for each wildfire
day=str((str(element[17]).split()[0]))
day=day.split("-")
day= str(day[1]+"/"+day[2] + "/"+ day[0])
"""An array exists for each location we are obtaining data for. If a fire occurred in any of those
locations, the date of that fire is added to the array"""
fireDict[locationUrl[forests[element[0]]]].append(day)
We merged all the data we had giving us 1 massive array. This contained multiple nested arrays, each representing 1 day. Each nested array contained temperature, humidity, wind rain data + daily averages and 14 day averages.
#For each date we have weather data for
for each in currentDate:
currentBool=0
#If there was a fire on that day, append 1 to fireList, else append 0.
for day in fireDict[locationList]:
if each==day:
currentBool=1
else:
pass
fireList.append(currentBool)
"""Merge arrays for all data types to create 1 massive array of arrays. Each array within it represents 1 day of data.
This works since there's exactly the same amount of data for each data type.
We also append a boolean indicating whether there was a fire or not on that day to the arrays."""
for each in range(len(temperature)):
finalArray.append(temperature[each]+humidity[each]+wind[each])
finalArray[Counter].append(currentDate[each])
finalArray[Counter].append(weather[each])
finalArray[Counter].append(rainAvg[each])
finalArray[Counter].append(tempAvg[each])
finalArray[Counter].append(humAvg[each])
finalArray[Counter].append(windAvg[each])
"""We append the name of the location we are appending data for to the array"""
finalArray[Counter].append((list(locationUrl.keys())[list(locationUrl.values()).index(locationList)]))
finalArray[Counter].append(fireList[each])
Counter+=1
We used the Pandas library to convert the array to a Pandas Dataframe which was then converted to a csv. Each nested array was turned into 1 row in the csv and the date was made into the index.
df= pd.DataFrame(finalArray,columns=["Temp1","Temp2", "Temp3","Temp4", "avgTemp", "Hum1","Hum2","Hum3","Hum4"
,"avgHum","Wind1","Wind2","Wind3","Wind4","avgWind", "CurrentDate", "Rain"
,"14DayAvgRain","14DayAvgTemp", "14dayAvgHum", "14DayAvgWind", "Location" ,"Fire"])
df = df.set_index('CurrentDate')
df.to_csv("MergedWildfireWeather.csv")
The script was only run once, to obtain data hence some inefficiencies in the code were tolerated. The csv produced by this was balanced then fed into the support vector machine.


Toggle navigation
Interspect Training and Services
What we do
Who we are
Contact Us
We are here to help
Contact Us
Call us : 0920.640.0731 or (02) 401.7864
Get in Touch
Submit


BY EDWIN JAHIEL
BROKEN ENGLISH (New Zealand, 1996) *** Directed by Gregor Nicholas. Written by Nicholas, Johanna Pigott, Jim Salter. Produced by Robin Scholes. Photography, John Toon. Editing, David Coulson. Production design, Mike Kane. Music, Murray McNabb. Cast: Rade Serbedzija (Ivan, the father), Aleksandra Vujcic (daughter Nina), Julian Arahanga (Eddie), Marton Csokas (Darko), et al. A Sony Classics release. In several languages. 90 minutes. Rated NC-17 (see text).
Broken English is the language spoken in New Zealand by immigrants from many countries. The last half-dozen years have seen a wave of people who want to become Kiwis (the nickname for New Zealanders).
Long ago, the first inhabitants were Polynesians. Much later they took on the name Maori ("normal") to differentiate themselves from the European colonists and settlers, mostly from the British Isles plus a hefty amount of Dutch. Numerous Croatians arrived in waves in the 1890s, the 1950s and the 1990s.
A family of recent Croatian emigres with their own values holds center stage in the movie. Dominating all is Ivan, played by a Yugoslav film and stage star, now London-based and doing well.
One has to know the Croatian temper to understand Ivan. He is abrupt, imperious, intractable. He is doing well in business, yet remains in a constant bellicose mood. Much of this is caused by his hatred of Serbs, whose atrocities toward Croats seem to reprise older ones by another country. Historical enmities smolder.
Ivan insult for the Serbs is "Chetniks." That is the pot calling the kettle black. During the Nazi occupation of Yugoslavia, the Serbs had two resistance movements, the royalists/nationalists Chetniks, under Colonel Mihailovic, and the communist Partisans under Tito.The two groups fought the Germans as well as each other.
The apple of Ivan's eye is Nina, one of his two daughters. She is played by first-time actress Aleksandra Vujcic, a newcomer to New Zealand who did not even want to be in movies. Ms. Vucjic fits her part to a t. She has presence, earthy sexiness and good looks. In many shots she reminds one uncannily of Lolita Davidovich, the actress born in Canada of Yugoslav parents.
Nina is something of a promiscuous Daisy Mae figure sometimes trampishly dressed. Early on, her Tata ("daddy"in Serbo-Croatian), engaged in the national activity of talking politics, drinking, and smoking with cronies, notices that Nina is coupling with a young man in a parking lot. He demolishes the car. You don't have to be an exceptionally possessive father to act that way. Feelings run high in the Balkans. From the Danube down to Crete, there is still a tradition of fathers and brothers who may knife to death any man who has sullied a daughter's or sister's honor. Ivan is more of a familiar figure than an exception.
The restaurant where Nina works is owned by an immigrant Chinese, a "soignee" lady who is into extra-curricular money-making schemes. Nina's New Zealand-born mother enables the young woman to hold a New Zealand passport. The lady boss proposes that she marry, in name only, and for a bundle, the chef, Mr. Wu, a refugee from China in need of establishing residency for himself and later for his also undocumented Chinese girlfriend.
Meanwhile Nina comes on strong to Eddie, her handsome Maori kitchen-mate.  The latter got the movie a rare and ludicrously severe NC-17 rating. The activity is suggested rather than seen, as it takes place in darkness. Director Nicholas has appealed, to no avail. It has also been suggested that the real reason was a four-letter disparagement of the Pope (Croats are Catholics) and his appeals to brotherhood.
Nina and Eddie live together. Furious Ivan blows hot and cold towards Nina, now loving now mad as hell. Still, his opposition becomes an uneasy wait-and-see truce until it explodes and Nina is made literally into a prisoner within a sealed room at Ivan's house. For more developments, see the film. It is time well spent.
I was puzzled by most reviewers' recurring mention of the movie as a Romeo and Juliet story, until I saw this comparison (plus "star-crossed lovers), in the press-book. This is an inaccurate simplification. It would have been valid had the lovers belonged to same-origin but warring (vendetta-prone) tribes. But here we have a racial situation.
In spite of simplifications and cliches, the film is interesting, authentic as an ethnographic document and as an insight into the increasingly multi-racial New Zealand, a land of just three-and-half million people.An insider's job, it captures diversities and tensions, it peeps into the colorful Croatian Kiwis.
At one point, Nina, ordered by Tata to attend a celebration, brings along Eddie. The situation is tense yet there's also a wonderfully warm and joyous side to it as the extras, including many members of the Dalmatian Club of Auckland, sing with abandon lovely songs. And, in a nice invention, it just happens that in the neighbors' yard, at a Maori gathering, swaying Maori perform Polynesian songs. The musical duel and the beauty of both ethnic repertories are cleverly , if artificially, symbolic of contrasts and similarities.
The most beautiful and lyrical scene however, comes after Eddie has left Nina --temporarily, don't fret. She joins him on a tourist boat he runs with a friend, and she swims among the dolphins.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Man injured after crashing into wall in central Las Vegas
by Alexis EgelandA man is expected to survive after police say they believe he suffered a medical episode and crashed his car into a wall Tuesday afternoon in central Las Vegas.
The man was driving a silver Ford truck just after 3 p.m. near 4860 Topaz St., near Tropicana and Eastern avenues, Metropolitan Police Department Lt. Brian Boxler said. The truck hit a wall, electrical box and water valve.
The man was taken to Sunrise Hospital and Medical Center with minor injuries, Boxler said.


Find the best place to vote right now for the May 27, 2014 primary run-off election in Travis County.
This application finds voting places closest to where you are right now.
It knows not only about day-of-the-election voting places, but also early voting places -- both the fixed locations that are available throughout the early voting period as well as mobile locations that move around from day to day.
Depending on your web browser settings, you may be prompted to allow your location to be identified. Once you have been located, it will draw a map showing your position and nearby voting places.
Here are some things you can do with the map:
Elections in the City of Austin are administered by the Travis County Clerk's Election Division.
The "Vote" icons identify voting places for the selected "you are here" location.
A "lit up" icon shows a voting place open right now. A dimmed icon shows a closed voting place.
|
The election day voting place for the "you are here" location.  Note that for some elections, the State of Texas allows "Election Day Vote Centers". For these elections, you can vote at any polling place, not just the one in your assigned neighborhood precinct. Election day vote centers will be in effect for the this election. That means you may vote at any designated voting place for this election. |
|
|
The early voting place that is closest to the "you are here" location. If you are registered to vote in Travis County, then you can vote at any of the early voting places during the early voting period. |
|
|
A mobile early voting place that is convenient to the "you are here" location. The mobile early voting places are open only at certain times during the early voting period. If you are registered to vote in Travis County, then you can vote at any mobile early voting place that is open. The map will display only mobile early voting places that are convenient to your "you are here" location. You won't see any mobile places if you are in a location where the fixed early voting place is the best choice. |
New Texas voter id requirements are now in effect. You will need to bring a picture id with you when you want to vote. For more information, visit the Keep Calm and Vote On website.
Sponsored by Open Austin.
This application is possible thanks to the open government data provided by the Travis County Clerk (voting places) and the Travis County Tax-Assessor Collector (voting districts).
This application is written by Chip Rosenthal (chip@unicom.com). It is published as open source. You may download the source code at: https://github.com/chip-rosenthal/voteatx
Icons made by Icons8 from www.flaticon.com
[BACK]


My Nana (grandpa in Hindi) is living life. Even at age 76, he is still able to attend Friday prayers at the Mosque, go on walks, and is surrounded by his children and grandchildren. And perhaps most importantly, he is able to live in his own home. My family's role is to support my Nana so that he can live life on his own terms.
Why can't all seniors live this kind of life? Before reading Atul Gawande's Being Mortal, I thought this lifestyle for seniors was ideal. The lives of seniors is a topic we tend to avoid discussing until we are forced to, and it certainly is not at the forefront of the minds of most 20 year olds. But it should be. The number of Americans over 65 will double by 2060 and will make up ~24% of our entire population. Before you know it, we'll be in that population as well.
Thinking about senior life is not new to me. My mom works as an occupational therapist at a nursing home, and I have been volunteering at nursing homes since I was 11. From early on, I knew that something was wrong with how we treated seniors, especially in the United States, and it deeply upset me. But these past few months, I've been digging into why, and what the ideal scenario for senior life looks like.
And it turns out, while my Nana's way of life is great, it's not scalable. My Nana's lifestyle was only manageable because many of his children have not left his home. But the historical pattern is clear: “as soon as people get their resources and opportunity to abandon that way of life, they are gone”.
In contemporary society, we often do not see caring for seniors as a shared, multigenerational responsibility like my Nana, but instead, as a private state that largely involves doctors and institutions like nursing homes. But this is not inherently bad. Gawande argues that “modernization did not demote seniors. It demoted the family: It gave people - the young and the old - a way of life with more liberty and control, including the liberty to be less beholden on other generations”. The ideal scenario for modern society is seniors being able to live the lives they want, while still providing freedom to both generations.
A huge appeal to college students is the idea of freedom. After years of curfews, we are finally free to live our lives and do what we want. But imagine after living most of your adult life this way, to return to the restricted lifestyle you had as a kid. But this time, the curfew is not set by your parents, but by your children, or by biology.
According to Gawande, our biggest fear as we age is losing our way of life and the ability to do the things we love. This is something we can all relate to, as we have all lived life at some point with restrictions on what we enjoy doing. However, the problem for seniors is that the medical world is focused not on maintaining their way of life, but rather on prolonging their life. As a senior, your preferences and desires are often ignored.
Medicine's primary goal is amelioration. When faced with a new decision, medicine tells us to go for a new treatment with the hopes of prolonging life. Medicine avoids having tougher discussions on the lives that seniors want to lead. While prolonging life sounds great, it often doesn't work out as planned. With every treatment, side effects often include compromising their standard of living and doing what they love. With every added procedure, there is the inevitable recovery period that can lead to seniors spending their last days on a hospital bed instead of in the home they love, surrounded by the people they love.
On a more positive note, there are still many ways that seniors are living their final years to the fullest. What I personally found inspiring in “Being Mortal” were the stories of seniors continuing to find purpose in life during their final days. My favorite example was how Dr Bill Thomas brought animals to the Chase Memorial Home, which caused residents such as Mr.L, who had rarely spoken before, to come out of their shells. Residents took the dogs for walks and actively talked to others about how their birds were doing.
Gawande also mentions living communities that allow seniors to maintain their lifestyles while still being cared for by caregivers. This provided a stark contrast from the traditional nursing home style that provide the utmost safety in exchange for days that blur together and a lack of consideration for what seniors want in life.
I have spent a lot of time thinking about this book, thinking about my parents, my senior friends, and eventually how I would like to live life as I age. What I am most fearful of is losing purpose. As I am in the midst of figuring out what I want to do with my life, I can't help but feel like we've given up on people that have done so much for us and need our help the most.
But I am an optimistic person, and as the senior population continues to grow, I am excited to see how we approach this continual struggle against our own biological clocks. I feel inspired to find ways to provide a purposeful life for seniors that fits into contemporary society. I hope more young people think about this inevitable problem as well, because unless you want to live in a nursing home, it's up to us to define our own purposeful futures.
Aging


Jeans are always a good choice, so you pick your favourite pair out to wear.

Do you want a baggy shirt or a fitted shirt?


?
1
0
1
2
3
4
5
6
7
8
9
IU
g|^jgg
?
?
?
?
m
:
Õ
I
cm
copyright
reserved
Botanical
Garden
S^P^BOTANICAL
GARDEN
01443822
CUBA
Dipholis
salicifolia
(L)
A.
DC.
Tree
of
20'
in
woods.
Fruit
black
and
shiny.
Between
Central
Soledad
and
dock
on
Rio
Caonao.
Collector:
R.A.
Howard
5l53
6/17/1
fl.
Determined
by
R.
A.
Howard
01443822
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Coding101
I am a...
Secondary School Graduate
Student/
Graduate/
Awaiting NYSC
Employed/
Corp Member/
Unemployed


Whale carcass disentangled off PE harbor
by Algoa FMVolunteers of the SA Whale Disentanglement Network (SAWDN) were activated on Saturday, following reports of a whale carcass entangled in the fishing nets of a fishing boat approximately 7 nautical miles off-shore of the Port of Port Elizabeth.
Spokesperson, Craig Lambinon says after being released from fishing ropes, but still entangled in fishing nets, the carcass of the 11-meter Brydes Whale was towed to Coega harbour, with the permission of the harbour authorities, where the NSRI assisted in the recovery of the carcass to a landing zone to cut the remainder of the fishing nets.
He says NSRI sea rescue craft then towed the whale carcass out to the deep sea where it was released.
Lambinon says samples from the carcass were collected for the Department of Environmental Affairs and marine scientists.
(Pic: SAWDN)


fishing communities revenue fisheries changes regime commercial shifts diversity stocks species Alaskan diversification opportunities Fig. time turnover {border-style community px;} #ffffff;} change data catch revenues catches shift using composition market resilience Alaska individual price salmon series trends used Supplementary resources abrupt common communities. economic permit shared trend Pacific access fishery harvest relative shifts. small years Diversification North diverse ecosystem error fish major natural ocean portfolio social-ecological DFA Fisheries Nature compared computed large px; response stock {font-family Ocean annual cent different ecosystems example, factor fisheries. font-size included marine need total use However, average buffer communities, community's coupled data. double; global increased index level linear model number systems value Communities Diversity Science USA a). analysis benefits border-color border-width capital distribution hidden highly human-natural line models negative observation provides reduced resource results revenue. risk second solid; specific strategies {font-style {font-weight (diagonal Alaska. CFEC Commercial Ecol. Importantly, Mar. Regime Table Tables ability allocated approach area b). biological bold capacity census conditions courier; dependent dynamic economies effect em; emerging fisheries, following future harvested highest impact important income indicates influence likely limited livelihoods loadings management markets, markets. overall patterns plotted provide provided pt;} saw scale scales set significant smaller state strongly systems. trend. values year


Forms - API v3 Example 1 (External) test
Using
this endpoint
we can submit data using AJAX.
First Name:
Last Name:
Email Address:
Phone:


Visit the official government website for more information Click Here
Rashtriya Sanskriti Mahotsav is the flagship festival of the Ministry of Culture.It has been organized since 2015 with the active participation of Seven Zonal Culture Centres.It was started with an intention to exhibit the rich cultural heritage of the country in all its rich and varied dimensions namely, Handicrafts, Cuisine, Painting, Sculpture and Performing Arts- Folk, Tribal, Classical and Contemporary- all at one place. It has been playing a pivotal role to take the vibrant culture of India out to the masses instead of confining it to auditoria and galleries. It has been instrumental in showcasing folk and tribal art, dance, music, cuisines & culture of one state in other states reinforcing the cherished goal of “Ek Bharat Shreshtha Bharat”. It also provides an effective platform to the artists and artisans to support their livelihood. It reconnects the people (especially the youth) with their indigenous culture, its multifaceted nature, magnificence, and historical importance in the context of ‘India as a Nation’ over the millennia.


The CXMLNode class defines an XML node in the TouchXML library.
Inherits from NSObject*
Defines the type of the XML node.
- (CXMLNodeKind)kind
The name of the node.
- (NSString *)name
The string value of the node's contents.
- (NSString *)stringValue
The index or position of the node in relationship to it's siblings.
- (NSUInteger)index;
The level of the node within the XML document.
- (NSUInteger)level
References the root document of the node.
- (CXMLDocument *)rootDocument
The parent of the node.
- (CXMLNode *)parent
The number of children that the node contains.
- (NSUInteger)childCount
AN array of the node's children.
- (NSArray *)children
Retrieves a child node at the given index.
- (CXMLNode *)childAtIndex:(NSUInteger)index
The node's previous sibling.
- (CXMLNode *)previousSibling
The node's next sibling.
- (CXMLNode *)nextSibling
The textual description of the node.
- (NSString *)description
The contents of the node as XML.
- (NSString *)XMLString
The contents of the node as XML with options.
- (NSString *)XMLStringWithOptions:(NSUInteger)options
Retrieves an array of nodes based on an XPath query.
- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error
Retrieves an array of nodes based on an XPath query.
- (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error
The contents of the node as XML with options.
- (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str
Defines an enumeration of the types of nodes.
typedef enum { CXMLInvalidKind, CXMLElementKind, CXMLAttributeKind, CXMLTextKind, CXMLProcessingInstructionKind, CXMLCommentKind, CXMLNotationDeclarationKind, CXMLDTDKind, CXMLElementDeclarationKind, CXMLAttributeDeclarationKind, CXMLEntityDeclarationKind, CXMLNamespaceKind, } CXMLNodeKind;


Heat the oil in a large frying pan, and fry the chicken until lightly browned, in batches if necessary. Add the garlic and fry for 1 more minute.
Add the stock, herbs and lemon. Simmer for 15-20 minutes or until chicken is cooked through.
Remove the chicken and keep warm. Whisk the crème fraîche and honey into the sauce. Boil and reduce until slightly thickened.
Return the chicken to the pan and reheat. Serve with cooked rice or pasta, and green vegetables.


Resources
Alexandra Walker, NCE, CRC, LPC Intern
Home
About Company Name
Book a Service
Resources
FAQ


Project Euler
The best way I've found to learn new programming concepts is to build a small project. Sometimes I'll make a puzzle solver or a command line tool, but by far my favorite project to work on is Project Euler. It's a collection of math problems designed to be solved with the aid of a computer. The problems are usually simple, but because they can be solved in many ways, they're useful for learning how to use new libraries.
This page serves to document my progress in solving Project Euler problems. My initial goals in taking on this project were testing, benchmarking, iterators, paralellism, and optimization. My language of choice is Rust, which I believe to be one of the best programming languages for small projects. With one "cargo new" I can start coding with no further setup. Rust also has many mature libraries which can be incorporated into any project with ease. Additionally, Rust has a reputation for being fast and safe, which I will put to the test as I solve each problem.
Problem 1: Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
pub fn euler_1(limit: u32) -> u32 {
let mut sum = 0;
for i in 1..limit {
if i % 5 == 0 || i % 3 == 0 {
sum += i;
}
}
sum
}
pub fn euler_1_iter(limit: u32) -> u32 {
(1..limit).filter(|i| i % 5 == 0 || i % 3 == 0).sum()
}
pub fn euler_1_par_iter(limit: u32) -> u32 {
(1..limit).into_par_iter().filter(|i| i % 5 == 0 || i % 3 == 0).sum()
}
pub fn euler_1_loop(limit: u32) -> u32 {
let mut sum = 0;
let mut threes = 3;
let mut fives = 5;
while threes < limit {
sum += threes;
threes += 3;
}
while fives < limit {
sum += fives;
fives += 5;
if fives >= limit { break }
sum += fives;
fives += 10;
}
sum
}


Previous: Per-rule events, Up: Per-rule events [Contents][Index]
Most users will fix the second limitation
(see lim2Ex)
by falling back
on marker symbols.
For those users who for some reason prefer to avoid this,
in this section we present
a workaround that is based on introducing a new symbol,
one dedicated to acting as the LHS of (R3)
of lim2Ex
.
We show the fix as another example,
one which we will call
fixEx
.
fixEx
is identical to
lim2Ex
with
the following exceptions:
(R3)
in lim2Ex
is replaced with the following rules:
[ A1 ::= W X ] (R3a) [ A ::= A1 ] (R3b)
In these two rules,
rule (R3a)
is the replacement rule
for rule (R3)
in lim2Ex
,
and A1
is the new LHS symbol,
which is dedicated to serving as the LHS
of rule (R3a)
.
MARPA_EVENT_SYMBOL_COMPLETED
event
is activated for symbol A1
,
instead of for symbol A
.
(R3a)
has the same semantics
as rule (R3)
in lim2Ex
,
the rule that it replaced.
(R3b)
has pass-through semantics.
MARPA_EVENT_SYMBOL_COMPLETED
event
for symbol A1
,
instead of symbol A
.
fixEx
will accept the same language
as lim2Ex
,
with the same semantics as lim2Ex
.
A MARPA_EVENT_SYMBOL_COMPLETED
event
will trigger at the end of (R3a)
,
this time for symbol A1
,
but at exactly the same parse location as it did
for symbol A
in lim2Ex
.
And a MARPA_EVENT_SYMBOL_COMPLETED
event
will no longer trigger at the end of (R4)
,
which is the fix we were looking for.


--- title: Test post author: ian date: '2019-08-24' slug: test-poist categories: - Development tags: - golang description: Desc hacker_news_id: '' lobsters_id: '' meta_img: /images/image.jpg ---
This is a test post.


The Caribbean, how exciting!
Choose payment option below. Don't worry, you won't be asked
to pay until we send you a sweet deal.


--- Day 2: Password Philosophy ---
from original text
a list (your puzzle input) of passwords (according to the corrupted database) and the corporate policy when that password was set.
For example, suppose you have the following list:
let example = """1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc
"""
echo example
1-3 a: abcde 1-3 b: cdefg 2-9 c: ccccccccc
Each line gives the password policy and then the password. The password policy indicates the lowest and highest number of times a given letter must appear for the password to be valid. For example, 1-3 a means that the password must contain a at least 1 time and at most 3 times.
In the above example, 2 passwords are valid. The middle password, cdefg, is not; it contains no instances of b, but needs at least 1. The first and third passwords are valid: they contain one a or nine c, both within the limits of their respective policies.
How many passwords are valid according to their policies?
structure the data
something I love about Nim (wrt to my usual language Python) is that the first thing you do is structure your data (i.e. deciding types) and that is solving half of the problem.
type
Policy = object
min, max: Natural
ch: char
Row = tuple[policy: Policy, password: string]
Db = seq[Row]
and also that helps in naming. how do I call the parse function? well, parse!
Do I want to extract parsing for the first row? easy and I do not have to pick a new name!
func parse(line: string): Row =
var
i, j: int
s, t: string
if not scanf(line, "$i-$i $w: $w", i, j, s, t):
debugEcho "error while parsing: " & line
if s.len != 1:
debugEcho "error in s.len. s: ", s, "; line: ", line
result.policy.min = i
result.policy.max = j
result.policy.ch = s[0]
result.password = t
proc parse(lines: seq[string]): Db =
for i, line in lines:
result.add parse(line)
Also I love the fact that strscans prevents me to learn regular expressions.
Let's see how parsing work on base example:
echo (parse example.strip.splitLines).join("\n")
(policy: (min: 1, max: 3, ch: 'a'), password: "abcde") (policy: (min: 1, max: 3, ch: 'b'), password: "cdefg") (policy: (min: 2, max: 9, ch: 'c'), password: "ccccccccc")
ok, good. Now let's solve part1 (for this example)
part 1
func isValid(r: Row): bool =
var count: int
for c in r.password:
if c == r.policy.ch:
inc count
if count >= r.policy.min and count <= r.policy.max:
true
else:
false
func part1(input: string): int =
for row in parse(input.strip.splitLines):
if row.isValid:
inc result
echo part1 example
assert example.part1 == 2
2
now it's time to get the *!
echo part1 "2020/input02.txt".readFile
445
ok, I did spend a bit of time debugging here, just to find out that I forgot to past content in file...
That's the right answer! You are one gold star closer to saving your vacation.
--- Part 2 ---
from original text
Each policy actually describes two positions in the password, where 1 means the first character, 2 means the second character, and so on. (Be careful; Toboggan Corporate Policies have no concept of "index zero"!) Exactly one of these positions must contain the given letter. Other occurrences of the letter are irrelevant for the purposes of policy enforcement.
func isValid2(r: Row): bool =
var count: int
if r.password[r.policy.min - 1] == r.policy.ch:
inc count
if r.password[r.policy.max - 1] == r.policy.ch:
inc count
count == 1
func part2(input: string): int =
for row in parse(input.strip.splitLines):
if row.isValid2:
inc result
echo "example: ":
part2 example
echo "part2: ":
part2 "2020/input02.txt".readFile
example: 1 part2: 491
That's the right answer! You are one gold star closer to saving your vacation.


Api Server for BitGreen Blockchain
This server can be used to query the transactions by simple https calls.
Query Transactions by Account
You can filter the transaction by account and from date/time to date/time by the following parameters:
account - is the account code SS58 format
dts - is the date and time of start, in the format YYYY-MM-DD HH:MM:SS.
dte - is the date and time of end, in the format YYYY-MM-DD HH:MM:SS.
For example:
https://testnode.bitg.org:9443/transactions?account=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY&dts=2021-08-03+00:00:00&dte=2021-08-20+23:59:59
Will search the transactions for the account: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
between 03 Agust 2021 time 00:00:00 and 20 August 2021 time 23:59:59.
"testnode.bitg.org" should be replaced with your domain name.
Query Single Transaction by Txhash
You can get the data of a single transaction searching by txhash, for example:
https://testnode.bitg.org:9443/transaction?txhash=0x91935fe79c429695eb34ca2a191ee2ec7e40b2734691ce7a8ba758c7e1f01e22


In this website, we present our example clips, for those who are interested in the result of our works.
For more details, please refer to our paper here,
And you can find our codes here. Note that the codes we release is a reimplemented version of our system in python, which may generate a slightly different result, and we are still working on it to make the documentation complete.
Click the sidebar on the left can help you move to a specific example.
Firefox / Google chrome is recommended when browsing this site.
All clips used in this website are for academic purpose only.
In this section, we briefly show some image/spectrum to help understand our works more clearly.


ros-init - Create a roswell script (optionally based on a template)
ros init [TEMPLATE] NAME [ARGS…]]
Specifies the name of a template, defaulted to default template. However, if TEMPLATE is not specified and FILENAME matches one of the templates being stored, then it automatically uses the template. To suppress this behavior, you should explicitly specify TEMPLATE as default.
Thus you are warned when you use this command from a shell script. In order to achieve a consistent and desired behavior, it is adviced that they should always explicitly specify the template name.
Specify the output filename, or “-” to indicate stdout. When TEMPLATE is default, it automatically appends a file type “.ros”.
Initialises a roswell file based on a template. User-specified templates can be added by ros-template(1).
The default template is something like:
#!/bin/sh
#|-*- mode:lisp -*-|#
#| <Put a one-line description here>
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
;;#+quicklisp (ql:quickload '() :silent t)
)
(defpackage :ros.script.test.3703600390
(:use :cl))
(in-package :ros.script.test.3703600390)
(defun main (&rest argv)
(declare (ignorable argv)))
;;; vim: set ft=lisp lisp:
This is basically a shell script which immediately invokes Roswell by exec (see sh(1)). Roswell loads the same script as an input, skips multi-line comments, reads the rest of the file as a Common Lisp program, and finally invokes a function main with command-line arguments.
sbcl(1) ros(1) ros-template(1)
_


If you are not redirected automatically, follow the link to https://github.com/kbroman/MUGAarrays
https://github.com/kbroman/MUGAarrays


mtx-select is a Material form field wrapper of ng-select. Ng-Select Demos
mtx-select
ng-select
Warning:


---
layout: post
title: ! "My Flickr Photostream hit 1000 as of 18:08 GMT. Never had this many \tviews!
(http://www.flickr.com/photos/verdammelt/)"
published: true
date: 2009-12-14
categories: []
posterous_url: http://verdammelt.posterous.com/my-flickr-photostream-hit-1000-as-of-1808-gmt
posterous_slug: my-flickr-photostream-hit-1000-as-of-1808-gmt
---
I guess lots of people really like to see scantily clad people (mostly
men) in small amounts of tight clothing running though the streets of
Boston on a cold winter day.


Max Balter
About
Resume
Projects
Publications
Contact
© 2016 Max Balter
Robotic Venipuncture
Mobile Vein Imaging App
Point-of-care Blood Analysis
Video Laryngoscope
3D Flying Prey Simulator
Robo Darts
Putt Putt Boat Engine
Gorilla Mandible Biomechanics


Author : {{quote.author}} Published {{quote.postedtime | date}} days ago. Like {{this.quote.upvote}} Dislike {{this.quote.downvote}}


| Contents | Previous | Next | Java Management Extensions (JMX) Technology Overview |
The Java Management Extensions (JMX) Remote API Specification describes how you can advertise and find JMX API agents by using existing discovery and lookup infrastructures. The specification does not define any discovery and lookup APIs specific to JMX technology.
This chapter provides a brief outline of existing discovery and lookup infrastructures that you can use with JMX technology, in the following sections:
For more information about these infrastructures, see the “References” section of the Java Management Extensions Remote API 1.0 Specification.
Lookup services can be used by JMX agents and JMX clients. A single JVM can contain many JMX agents and/or JMX clients.
The Java Management Extensions (JMX) Technology Tutorial and its accompanying examples demonstrate how to use lookup services to advertise and find JMX agents. The procedure is similar for all three infrastructures. The main difference is that in SLP and JNDI, the agent registers addresses with the lookup service, whereas when using the Jini network technology, the agent registers a JMX connector stub with the lookup service.
The Service Location Protocol (SLP) provides a framework that allows networking applications to discover the existence, location, and configuration of networked services in enterprise networks.
The following steps summarize the procedure defined in the JMX Remote API specification for using the SLP lookup service to advertise and find JMX agents:
The JMX Remote API specification defines URL schemes which are compliant with the SLP protocol. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional SLP lookup attributes that are provided at registration time.
The JiniTM Network Technology is an open software architecture that enables developers to create services that are adaptable to changes in the network. The Jini specification offers a standard lookup service. A running Jini lookup service can be discovered with a simple API call.
The following steps summarize the procedure defined in the JMX Remote API specification for using the Jini lookup service to advertise and find JMX agents:
The JMX Remote API specification defines bindings with Jini technology based entries. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional entries to specify when registering an agent connector.
The Java Naming and Directory InterfaceTM (JNDI) API is a standard extension to the Java platform. It provides Java technology-enabled applications with a unified interface to a number of naming and directory services.
The JMX Remote API specification details how an LDAP server can be used to store and retrieve information about JMX connectors exposed by JMX agents.
The following steps summarize the procedure defined in the JMX Remote API specification for using the JNDI lookup service:
The JMX Remote API specification defines an LDAP schema for registering addresses and explains how a client can discover a registered agent. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines a lease mechanism.
| Contents | Previous | Next |
Java Management Extensions (JMX) Technology Overview Java Management Extensions (JMX), Java 2 Platform, Standard Edition 5.0 |
Copyright © 2004 Sun Microsystems, Inc. All rights reserved.


BBC Strictly Come Dancing's Michelle Visage tells ITV Lorraine Kelly she 'wasn't asked to do Strictly tour'
"I was gutted"
by Rebecca KoncienzcyMichelle Visage has said she was "gutted" when she wasn't asked to take part in the Strictly Come Dancing tour.
The 51-year-old became the latest celebrity to leave the BBC show on Sunda y when the judges chose to save YouTube star Saffron Barker and her partner AJ Pritchard over Michelle and her professional partner Giovanni Pernice.
Since her departure there have been a number of stories about her in the press, including the decision for her not to be on the Strictly tour next year.
She told Lorraine Kelly: "There is a lot of controversy about this.
"I wanted to do it, I was not asked to do it, there was a problem with dates at first, but I am gutted. But that is just the way it goes."
There were also reports that her and Gio clashed, arguing backstage and that she had stormed off the BBC show on Saturday.
Happy to answer questions, the Drag Race UK judge said: "They [the press] said I stormed out of actual Blackbpool - I was at the party till 3am dancing with Kelvin and Oti and Gio.
"None of it's true. I am a party girl and I love people, I would stay to the end."
Speaking about rumours that her and Gio had come to blows during rehearsals, she said she had prayed to get him as her professional partner: "We have such and incredible relationship and this thing has been so much richer because of him.
"I rang him yesterday, and he is busy with the pro stuff but I said, 'any hours you have can we dance?'"
After she was voted off the reality show, following her final performance to Madonna's 'Vogue', she told Tess Daily: "This whole experience has been amazing.
"At 51 years old and never danced in my life, I never thought I'd be able to do what I have done and to have such an incredible partner.
"To be here for my husband and my kids and the entire community, that's why I did what I did.
"I am so honoured to be welcomed by my new friends here."
Pernice admitted that the couple had been through a range of emotions during their time together, but said he has respect for his partner despite their arguments.
He said: "We laugh, we cry, we fight and we argue and we've done everything but I've loved every single second. I think you are inspirational."
Fans at home were devastated to see her go, many venting their frustration on Twitter, one @beckhughesxo said: "Can’t believe they saved Saffron over Michelle."
Another, @WestCountrySuzi said: "Awwwww.....that's a real shame...thought she'd make it to the final."
A third, @IshMotherBec said: "Another slightly shock exit. Although it's at the stage when almost any exit feels wrong."
A fourth, @AaronLR1991 said: "I’m so annoyed!"
And a fifth @evilcheltdevil added: "Gutted for @michellevisage and @pernicegiovann1 - just the worst result."
Can't get enough of TV and celeb news?
For all the latest TV and celeb news you can follow us on Twitter @celebliverpool and Facebook via https://www.facebook.com/pg/Celebrityliverpoolecho
You can also follow our individual reporters:
Rebecca Koncienzcy: @RDKoncienzcy
Lottie Gibbons: @lottgibbons
Sophie McCoid: @Mccoidsophie
*Lorraine is on ITV1, weekdays from 8:30am


The Thing (1982) (a.k.a John Carpenter's The Thing) Directed by John Carpenter. Starring Kurt Russell. Reviewed by Michael A. Turton<EMAIL_ADDRESS>Director John Carpenter once noted in an interview that he was puzzled by the the indifference of audiences to _The Thing_. In view of the cult status of so many of his films, the failure of _The Thing_ to find popularity is a bit of a mystery, all the more so since it features the same pairing of director and actor (Kurt Russell) that helped make _Escape from New York_ a cult classic.
_The Thing_ is taken from one of the best SF short novels ever written, a Golden Age work by John Campbell entitled "Who Goes There?." There are some changes which in my view strengthen the storyline (surprising for a Hollywood script). The film is also a remake of an old (and now hokey) horror movie.
The story takes place in an isolated antarctic research station. As the film begins, a dog shows up chased by a seeming madman in a helicopter. When the man accidently shoots one of the station personnel in an attempt to kill the dog, he is shot to death by one of the researchers. The dog wanders around the station for a few hours before being put in the kennel with the other dogs. When he is, strange things begin to happen.
Meanwhile MacReady (Kurt Russell), the taciturn helicopter pilot, hops over to the madman's point of origin, a Norwegian research station. There he discovers that everyone is dead. Some of the bodies are bizarrely changed, others the result of bloodily painful suicide. Slowly, as the evidence comes in, MacReady learns that the Norwegians found an ancient spacecraft beneath the ice that contained an alien capable of assimilating and becoming any species, from dog to human. As the story unfolds, it becomes apparent that not everyone at the research station is human anymore.......
The story moves at a more leisurely pace than some of Carpenter's other tales, since the viewer needs more information to understand what is going on. Characters are boldly-drawn, just this side of being stereotypes, but MacReady, whose character screams Vietnam vet, is given an introspective side which doesn't quite save him from becoming the cliched hard-edged, gruff hero.
The special effects are excellent and have held up well, although there are some fairly silly inconsistencies that are probably necessary to increase the horror factor. For example, people's bodies split open and the alien pops out a la the film _Alien_. Why? The alien is not _inside_ the person, the alien _is_ the person. The sound effects are wonderful, especially in the scene where one of the station personnel, fleeing the station during his "change," suddenly reveals he is an alien.  Is there no other form they can take?
Carpenter's direction is competent and the tension builds well, following the original story more or less faithfully in general right up to the end, where there is a radical departure. Unlike Campbell's original, in which the good guys win out by a nose, Carpenter's version is both bloodier and more ambiguous, requiring much more sacrifice. In that sense, the movie is more realistic than the original story. In my judgement, the changes Carpenter made in the plot make it a much stronger story. Additionally, the understated score by a veteran movie composer is a winner.
Carpenter resists well the urge to Hollywoodize this classic. There is no love story here (no female characters), no redemptive ending and no blond-haired, blue-eyed people save the world.
_The Thing_ is one of my personal favorites. I give it 4 out of 5 stars. Always a solid rental choice.
Copyright 1998 by Michael A. Turton
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


The Internet Corporation for Assigned Names and Numbers (ICANN)
Domain Name System (DNS)
Without IP addresses you could not connect with any websites and they could not share information with you
Domain Name System
Transfer Protocol
Coding and Styling
The Internet works through a packet routing network in accordance with the Internet Protocol (IP), the Transport Control Protocol (TCP) and other protocols
Let's dive in for more details!! Use the Menu bar to navigate to different Topics.


This method is used for solving non-linear partial differential
equations of order one involving two independent variables.
A general method for solving the most general non-linear partial
differential equation of order one i.e., the method for solving
\[f(x,y,z,p,q)\space =\space 0\]
involving two independent variables x and y is given by Charpit and is known as Charpit’s method. This method is applied to solve only those partial differential equations which cannot be solved by already known methods. The basic idea in Charpit’s method is the introduction of another partial differential equation of order one of the form
\[g(x,y,z,p,q)\space =\space\]
\[dz\space =\space pdx + qdy\]
This is a linear partial differential equation of order one with x, y, z, p and q as independent variables and g as the dependent variable. Thus, it can be solved by Lagrange’s method.
Step 1. Transfer all the terms of given PDE to L.H.S. and denote the entire expression in L.H.S. by f(x, y, z, p, q).
Step 2. Write down the Charpit’s auxiliary equations.
Step 3. Find the values of ∂ f/ ∂ x , ∂ f/∂ y etc. occurring in Charpit’s auxiliary equations. Put them in Charpit auxiliary equations and simplify.
Step 4. Choose two proper fractions from Charpit’s auxiliary equations such that the resulting integral may come out as simplest relation involving at least one of p or q or both.
In mathematical analysis, Clairaut's equation (or the Clairaut equation) is a differential equation of the form
\[y(x)\space =\space x\frac{dy}{dx}\space +\space f(\frac{dy}{dx})\]
where f is continuously differentiable.
The singular solution envelopes are x=-f^'(c) and y=f(c)-cf^'(c).
A partial differential equation known as Clairaut's equation is given by
\[u\space =\space x u_x\space + y u_y\space +\space f(u_x+u_y) \]
Boundary value, condition accompanying a differential equation in the solution of physical problems. In mathematical problems arising from physical situations, there are two considerations involved when finding a solution: (1) the solution and its derivatives must satisfy a differential equation, which describes how the quantity behaves within the region; and (2) the solution and its derivatives must satisfy other auxiliary conditions either describing the influence from outside the region (boundary values) or giving information about the solution at a specified time (initial values), representing a compressed history of the system as it affects its future behaviour. A simple example of a boundary-value problem may be demonstrated by the assumption that a function satisfies the equation f′(x) = 2x for any x between 0 and 1 and that it is known that the function has the boundary value of 2 when x = 1. The function f(x) = x2 satisfies the differential equation but not the boundary condition. The function f(x) = x2 + 1, on the other hand, satisfies both the differential equation and the boundary condition. The solutions of differential equations involve unspecified constants, or functions in the case of several variables, which are determined by the auxiliary conditions.


Rohingya campaigners launch Myanmar boycott
The Free Rohingya Coalition begins 'Boycott Myanmar Campaign' in the face of genocide hearings at the ICJ.
Human rights campaigners supporting Myanmar's Rohingya mainly Muslim minority have called for a global boycott of the country, a day before genocide hearings begin at the International Court of Justice (ICJ) in The Hague.
The Free Rohingya Coalition (FRC) said in a statement on Monday it was starting the "Boycott Myanmar Campaign" with 30 organisations in 10 countries. It called on "corporations, foreign investors, professional and cultural organizations to sever their institutional ties with Myanmar".
More:
More than 730,000 Rohingya fled to neighbouring Bangladesh following the brutal crackdown by the military in August 2017, which United Nations investigators have concluded was carried out with "genocidal intent".
The FRC statement added that the campaign was intended to "to bring to bear economic, cultural, diplomatic and political pressure on Myanmar's coalition government of Aung San Suu Kyi and the military".
"We are doing this to correct the wrongdoings of Myanmar government and military...not because we hate our fellow Burmese," Ro Nay San Lwin, a Rohingya Muslim and cofounder of the FRC, told Al Jazeera.
"We want to see our country as a developed country but as the investments are financing the genocide we are compelled to do this," he added.
Myanmar at The Hague
Myanmar's de facto leader and Nobel Peace Prize laureate Aung San Suu Kyi, who arrived in the Netherlands on Sunday, is set to defend her country's record during three days of hearings initiated after a lawsuit was filed by the Gambia in November.
Aung San Suu Kyi's office posted a picture of her arrival at Amsterdam's Schiphol airport where she was greeted by the ambassador to the Netherlands and then headed to The Hague, where the World Court is located.
Aung San Suu Kyi has come under severe criticism in recent years for her unwillingness to speak out on the Rohingya crisis, despite the Myanmar military's violent campaign against the minority group.
Several demonstrations are planned in the coming days in the Dutch city by Rohingya survivor groups, as well as by government supporters.
The Gambia filed the suit on behalf of the Organisation of Islamic Cooperation, in which Buddhist-majority Myanmar is accused of genocide, the most serious international crime, against its Rohingya minority.
During three days of hearings, its legal team will ask the 16-member panel of UN judges at the ICJ to impose "provisional measures" to protect the Rohingya before the case can be heard in full.
Aung San Suu Kyi's office said last month that she would lead her country's team in The Hague to "defend the national interest".