Home
Self driving cars and ethics
- Details
It’s a happy sunny day as you are driven down the road by your self-driving car. You have been down this road 100 times. The trees sway in the wind and the flowers look even more amazing then you ever remember. You stare your lover in the eyes and toast to a most wonderful year and how the good times have made this year seem to fly by. Your lover points to the front of the car and reminds you of the time you kissed under the stars on the old single lane bridge that is approaching. As you speed toward the bridge you barley notice a person climbing the bridge supporting column. The person falls in your path. There is not enough time to stop. If the breaks are applied your car will surely plow into this person. If the car swerves left or right you will fly off the bridge and to your death. There is no override since you are in the back seat with your love. Someone is going to die today at the hands of software developer thousands of miles away.
The car’s onboard system constantly collects the information about what the car is doing and where the card is located geographically. It knows there is a living person in the front of it and is aware that it cannot stop in time. It quickly tries to find a safe route around the person it has determined that both left and right sides of the bridge have a huge elevation change indicating a cliff. The system estimates the chance of not falling off the cliff when impacting the column is slim to none.
The ethical module is the last set of processes that will be called before making its decision. It knows there are two lives in the car. It knows there is one life in the road way. The system is design to save as many lives as possible. The car slams into the person while applying the brakes in hopes to do as little damage as possible.
You and yours are lucky because if there had been one more person in the road way you’d been plummeting to your death.
GeoIP service
- Details
I wrote a GeoIP service.
it will get the ip of the user hitting the page or you can attach ip= to the query string.
get vars to pass are:
no format query modifiers will give you the following:
ip address matched to| loc id| country| state| city| zip | longitude | latitude
Formatting the Results:
format= xml,json,bar
Only the elements you want:
f=flags
Flags
- i = ip
- d = locid
- c = country
- s = state
- l = city (this is L for locality)
- z = zip
- n = longitude
- a = latitude
so if the query string had &f=naz you would get back longitude, latitude , and the zip code
Some Examples:
This would get the zip, lng, lat for the IP 8.8.8.8 in json format:
path/index.php?format=json&f=naz&ip=8.8.8.8
This would get the zip ,lng, lat of the person hitting the web server in json format:
path/index.php?format=json&f=naz
This would get the city, state of the person hitting the web server in bar format ( city|state):
path/index.php?format=bar&f=ls
Install LiteCoin pool on Ubuntu 14 server
- Details
#Login as root
mkdir downloads
cd downloads
nano /etc/gai.conf
#Find the Line: #precedence ::ffff:0:0/96 100
#and change to
precedence ::ffff:0:0/96 100
wget https://download.litecoin.org/litecoin-0.8.7.5/linux/litecoin-0.8.7.5-linux.tar.xz
tar xf litecoin-0.8.7.5-linux.tar.xz
cd litecoin-0.8.7.5-linux
cd bin
cd 64
./litecoind
#this will make the paths. #now nano
nano /root/.litecoin/litecoin.conf
#paste below
server=1
rpcallowip=127.0.0.1
rpcuser=p2pool
rpcpassword=SomeCrazyPasswordTHatIsLong
alertnotify=echo %s | mail -s "Litecoin Alert"
rpcport=10332
port=10333
#dont paste past here
#save it ctrl+o ctrl+x
./litecoind &
./litecoind getinfo
#look for "blocks" : 554673
#wait for block to down load (4-6 hours) check the current block count here for the chain
# http://explorer.litecoin.net/
sudo apt-get update
sudo apt-get install python-zope.interface python-dev python-twisted python-twisted-web git build-essential
cd /root/downloads
git clone https://github.com/forrestv/p2pool.git
cd p2pool
cd litecoin_scrypt
sudo python setup.py install
#check block status:
/root/downloads/litecoin-0.8.7.5-linux/bin/64/litecoind getinfo
#makre sure the entire chanin is downloaded then
python run_p2pool.py --net litecoin
#try to connect with a miner
minerd --url http://xxx.xxx.xxx.xxx:9327
#if it all works kill your miner
#kill the script
screen -d -m -S ltcp2pool ~/p2pool/run_p2pool.py --net litecoin --address YourWalletAddress --give-author 0 p2pool SomeCrazyPasswordTHatIsLong
Installing minderd on ubuntu server 14
- Details
#not sure why I have to keep doing the fix missing, but this works for me
apt-get install libcurl3-openssl-dev libncurses5-dev pkg-config automake yasm make build-essential
apt-get update --fix-missing
apt-get install libcurl3-openssl-dev libncurses5-dev pkg-config automake yasm make build-essential
mkdir downloads
cd downloads
wget http://garr.dl.sourceforge.net/project/cpuminer/pooler-cpuminer-2.4.2.tar.gz
tar -xvf pooler-cpuminer-2.4.2.tar.gz
cd cpuminer-2.4.2/
./configure
make
make install
minerd --url http://xxx.xxx.xxx.xxx:9327
minerd --url http://xxx.xxx.xxx.xxx:9327 --userpass SomefakeAccountName:FakePass
#Since I have a lot of miners I set my fakeAccount name to things like Miner1, LapTopMiner, etc..
#For fake password I just use x
Page 8 of 40