SlideShare a Scribd company logo
Last-FI
Ross McKinlay 2013
Me
@pezi_pink
www.pinksquirrellabs.com
fsharp.org
Last-Fi!
Raspberry Pi & F#
• You want the SOFT float version of the Raspbian
Linux distro! Save yourself lots of headaches!
• Fully update your Pi (apt-get update, apt-get upgrade)
• Ensure the SSH server starts when your Pi boots
• apt-get mono-complete
• Develop your projects on
another machine, and use
WinSCP / PuTTY (or similar)
to transfer
Access to the GPIO pins
http://www.airspayce.com/mikem/bcm2835/
# tar -zxf bcm2835-1.3.tar.gz
# cd bcm2835-1.3/src
# make libbcm2835.a
# cc -shared bcm2835.o -o libbcm2835.so
• You will need to download and build the bcm2835
library on the Pi which will enable you to access
the pins
• In order to interop with .NET / Mono you must use
a shared object (so) against a statically linked
binary.
• You are now able to reference the .so file like any
normal .dll file for interop using the [<DllImport>]
attribute
LCD Screen!
• Almost all these displays use the Hitachi HD44780
LCD Controller
• Can be operated in 8 bit or 4 bit mode and either
way they take up a ton of IO pins !
• After the initialization, the general usage is to shift a
bunch of bits onto the data lines that will instruct the
LCD what do to, then pulse the E line to indicate it
should look at and act on the data.
• Reading and writing data is almost identical except
you hold the RS line high between writing text in
ASCII binary
LCD Screen!
LCD Screen!
• Using agents to isolate state and provide
timing. It’s a self contained async system that
can only be changed via safe messaging
• Messing about with low-level timing and bit
shifting
• Cunning use of TryReceive to provide
overrideable temporary text and text scrolling
NES Pad!
• A NES pad is nothing more than a 8-bit parallel to serial shift
register!
• Simply hold LATCH low (Write/Shift in this diagram) and then each
successive pulse on the CLOCK line will shift the state of the next
button onto the DATA line (Q in this diagram)
NES Pad!
• Low-Level signal manipulation
• Reading values using functional techniques such as list
folding
• Isolating state and providing safe asynchronous
operation for both manual and interval polling via
message passing
• Use of active patterns to determine internal state
• Using first-class events to trigger on patterns
• Use of active patterns to provide the consumer an
elegant way of expressing the matching of button
depressing, depress durations and history sequence
Last.Fm API
• Unfortunately does not have any metadata
associated with it such as a WSDL or an Odata
endpoint which means I cannot use a type
provider ! :’( Boo, Hiss
• There are .NET libraries consisting of large
object hierarchies to access Last.Fm but I’m
only interested in small portion of the API and
don’t really want to use one of these…
MPC / MPD and the “Player”
• Music Player Deamon is the linux software I
am using to play the music. It is capable of
streaming from an internet address.
• MPC is the command-line interface to the
deamon which allows control via the
command line
• The “Player” object provides access to the
user’s Last.Fm station via MPC and raises
events to show stuff that’s happening
The core program…
• ServiceStack is used to host a webservice that can
provide information about what’s playing and
perform some control functions, via the Player
object
• NES / LCD /Player objects are initalized and
various events hooked up between them
• GO!! Everything at this point is async, the main
program thread just sits there doing nothing (and
more importantly, not blockng anything!)
The Website!
• The website uses Funscript, which is a F# to
JavaScript compiler and a TypeScript type
provider that allows direct access to JS
libraries with F# code
• Funscript also hosts its own webserver, so I
don’t need to mess about with ASP.NET linux
equivalents
Last-Fi
Last-Fi
Last-Fi
Last-Fi

More Related Content

What's hot

Net Scheme English Version
Net Scheme English VersionNet Scheme English Version
Net Scheme English Version
Tod Morita
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
Pradeep Kumar TS
 
Wireless openflow (english)
Wireless openflow (english)Wireless openflow (english)
Wireless openflow (english)
Hiroaki Kawai
 
Pharo Status ESUG 2014
Pharo Status ESUG 2014Pharo Status ESUG 2014
Pharo Status ESUG 2014
Marcus Denker
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
Tomas Doran
 
Local development using telepresence
Local development using telepresenceLocal development using telepresence
Local development using telepresence
Irvi Aini
 
Thoughts on consistency models
Thoughts on consistency modelsThoughts on consistency models
Thoughts on consistency models
rogerbodamer
 
Pharo Status Fosdem 2015
Pharo Status Fosdem 2015Pharo Status Fosdem 2015
Pharo Status Fosdem 2015
Marcus Denker
 
MPI, Erlang and the web
MPI, Erlang and the webMPI, Erlang and the web
MPI, Erlang and the web
Lenz Gschwendtner
 
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
OSMC 2013 | Zabbix: A Practical Demo by Rihards OlupsOSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
NETWAYS
 
Continuous Performance Regression Testing with JfrUnit
Continuous Performance Regression Testing with JfrUnitContinuous Performance Regression Testing with JfrUnit
Continuous Performance Regression Testing with JfrUnit
ScyllaDB
 
Concurrent Programming in Python
Concurrent Programming in PythonConcurrent Programming in Python
Concurrent Programming in Python
Adam Englander
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for Ceph
ScyllaDB
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
C4Media
 
Real-time Debugging using GDB Tracepoints and other Eclipse features
Real-time Debugging using GDB Tracepoints and other Eclipse features Real-time Debugging using GDB Tracepoints and other Eclipse features
Real-time Debugging using GDB Tracepoints and other Eclipse features
marckhouzam
 
Advanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTngAdvanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTng
marckhouzam
 
Rust Primer
Rust PrimerRust Primer
Rust Primer
Knoldus Inc.
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)
Jyrki Pulliainen
 
Service Discovery with Consul - Arunvel Arunachalam
Service Discovery with Consul  - Arunvel Arunachalam Service Discovery with Consul  - Arunvel Arunachalam
Service Discovery with Consul - Arunvel Arunachalam
Neependra Khare
 

What's hot (19)

Net Scheme English Version
Net Scheme English VersionNet Scheme English Version
Net Scheme English Version
 
Installation of ns2
Installation of ns2Installation of ns2
Installation of ns2
 
Wireless openflow (english)
Wireless openflow (english)Wireless openflow (english)
Wireless openflow (english)
 
Pharo Status ESUG 2014
Pharo Status ESUG 2014Pharo Status ESUG 2014
Pharo Status ESUG 2014
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
Local development using telepresence
Local development using telepresenceLocal development using telepresence
Local development using telepresence
 
Thoughts on consistency models
Thoughts on consistency modelsThoughts on consistency models
Thoughts on consistency models
 
Pharo Status Fosdem 2015
Pharo Status Fosdem 2015Pharo Status Fosdem 2015
Pharo Status Fosdem 2015
 
MPI, Erlang and the web
MPI, Erlang and the webMPI, Erlang and the web
MPI, Erlang and the web
 
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
OSMC 2013 | Zabbix: A Practical Demo by Rihards OlupsOSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
OSMC 2013 | Zabbix: A Practical Demo by Rihards Olups
 
Continuous Performance Regression Testing with JfrUnit
Continuous Performance Regression Testing with JfrUnitContinuous Performance Regression Testing with JfrUnit
Continuous Performance Regression Testing with JfrUnit
 
Concurrent Programming in Python
Concurrent Programming in PythonConcurrent Programming in Python
Concurrent Programming in Python
 
Seastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for CephSeastore: Next Generation Backing Store for Ceph
Seastore: Next Generation Backing Store for Ceph
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Real-time Debugging using GDB Tracepoints and other Eclipse features
Real-time Debugging using GDB Tracepoints and other Eclipse features Real-time Debugging using GDB Tracepoints and other Eclipse features
Real-time Debugging using GDB Tracepoints and other Eclipse features
 
Advanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTngAdvanced Tracing features using GDB and LTTng
Advanced Tracing features using GDB and LTTng
 
Rust Primer
Rust PrimerRust Primer
Rust Primer
 
Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)Taming Pythons with ZooKeeper (Pyconfi edition)
Taming Pythons with ZooKeeper (Pyconfi edition)
 
Service Discovery with Consul - Arunvel Arunachalam
Service Discovery with Consul  - Arunvel Arunachalam Service Discovery with Consul  - Arunvel Arunachalam
Service Discovery with Consul - Arunvel Arunachalam
 

Similar to Last-Fi

Pipecut - slides from presentation at MeetBSD California 2014
Pipecut - slides from presentation at MeetBSD California 2014Pipecut - slides from presentation at MeetBSD California 2014
Pipecut - slides from presentation at MeetBSD California 2014
david_w_maxwell
 
Harmonic Stack for Speed
Harmonic Stack for SpeedHarmonic Stack for Speed
Harmonic Stack for Speed
Yung-Yu Chen
 
The internet of $h1t
The internet of $h1tThe internet of $h1t
The internet of $h1t
Amit Serper
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
Tomas Doran
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_Final
Sam Knutson
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at Tuenti
Andrés Viedma Peláez
 
PROCESS WARP
PROCESS WARPPROCESS WARP
PROCESS WARP
祐司 伊藤
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Panagiotis Kanavos
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
fukamachi
 
A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chat
yeokm1
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
Tomas Doran
 
The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10
mark-smith
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
Akhil Kaushik
 
Autobahn primer
Autobahn primerAutobahn primer
Autobahn primer
Robbie Byrd
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
Ranjan Baisak
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
Hajime Tazaki
 
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingmicrobit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
ssuser5feb2c1
 
Stream processing in python with Apache Samza and Beam
Stream processing in python with Apache Samza and BeamStream processing in python with Apache Samza and Beam
Stream processing in python with Apache Samza and Beam
Hai Lu
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
Sagiv Ofek
 
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck - Pravega: Storage Rei...
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck -  Pravega: Storage Rei...Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck -  Pravega: Storage Rei...
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck - Pravega: Storage Rei...
Flink Forward
 

Similar to Last-Fi (20)

Pipecut - slides from presentation at MeetBSD California 2014
Pipecut - slides from presentation at MeetBSD California 2014Pipecut - slides from presentation at MeetBSD California 2014
Pipecut - slides from presentation at MeetBSD California 2014
 
Harmonic Stack for Speed
Harmonic Stack for SpeedHarmonic Stack for Speed
Harmonic Stack for Speed
 
The internet of $h1t
The internet of $h1tThe internet of $h1t
The internet of $h1t
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
Bit_Bucket_x31_Final
Bit_Bucket_x31_FinalBit_Bucket_x31_Final
Bit_Bucket_x31_Final
 
Experiences with Microservices at Tuenti
Experiences with Microservices at TuentiExperiences with Microservices at Tuenti
Experiences with Microservices at Tuenti
 
PROCESS WARP
PROCESS WARPPROCESS WARP
PROCESS WARP
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
A Science Project: Swift Serial Chat
A Science Project: Swift Serial ChatA Science Project: Swift Serial Chat
A Science Project: Swift Serial Chat
 
Cooking a rabbit pie
Cooking a rabbit pieCooking a rabbit pie
Cooking a rabbit pie
 
The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10The linux kernel hidden inside windows 10
The linux kernel hidden inside windows 10
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Autobahn primer
Autobahn primerAutobahn primer
Autobahn primer
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
 
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingmicrobit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
 
Stream processing in python with Apache Samza and Beam
Stream processing in python with Apache Samza and BeamStream processing in python with Apache Samza and Beam
Stream processing in python with Apache Samza and Beam
 
Node.js for Rubists
Node.js for RubistsNode.js for Rubists
Node.js for Rubists
 
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck - Pravega: Storage Rei...
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck -  Pravega: Storage Rei...Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck -  Pravega: Storage Rei...
Flink Forward SF 2017: Srikanth Satya & Tom Kaitchuck - Pravega: Storage Rei...
 

Recently uploaded

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 

Recently uploaded (20)

Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 

Last-Fi

  • 4.
  • 5.
  • 7. Raspberry Pi & F# • You want the SOFT float version of the Raspbian Linux distro! Save yourself lots of headaches! • Fully update your Pi (apt-get update, apt-get upgrade) • Ensure the SSH server starts when your Pi boots • apt-get mono-complete • Develop your projects on another machine, and use WinSCP / PuTTY (or similar) to transfer
  • 8. Access to the GPIO pins http://www.airspayce.com/mikem/bcm2835/ # tar -zxf bcm2835-1.3.tar.gz # cd bcm2835-1.3/src # make libbcm2835.a # cc -shared bcm2835.o -o libbcm2835.so • You will need to download and build the bcm2835 library on the Pi which will enable you to access the pins • In order to interop with .NET / Mono you must use a shared object (so) against a statically linked binary. • You are now able to reference the .so file like any normal .dll file for interop using the [<DllImport>] attribute
  • 9. LCD Screen! • Almost all these displays use the Hitachi HD44780 LCD Controller • Can be operated in 8 bit or 4 bit mode and either way they take up a ton of IO pins ! • After the initialization, the general usage is to shift a bunch of bits onto the data lines that will instruct the LCD what do to, then pulse the E line to indicate it should look at and act on the data. • Reading and writing data is almost identical except you hold the RS line high between writing text in ASCII binary
  • 11. LCD Screen! • Using agents to isolate state and provide timing. It’s a self contained async system that can only be changed via safe messaging • Messing about with low-level timing and bit shifting • Cunning use of TryReceive to provide overrideable temporary text and text scrolling
  • 12.
  • 13.
  • 14. NES Pad! • A NES pad is nothing more than a 8-bit parallel to serial shift register! • Simply hold LATCH low (Write/Shift in this diagram) and then each successive pulse on the CLOCK line will shift the state of the next button onto the DATA line (Q in this diagram)
  • 15. NES Pad! • Low-Level signal manipulation • Reading values using functional techniques such as list folding • Isolating state and providing safe asynchronous operation for both manual and interval polling via message passing • Use of active patterns to determine internal state • Using first-class events to trigger on patterns • Use of active patterns to provide the consumer an elegant way of expressing the matching of button depressing, depress durations and history sequence
  • 16. Last.Fm API • Unfortunately does not have any metadata associated with it such as a WSDL or an Odata endpoint which means I cannot use a type provider ! :’( Boo, Hiss • There are .NET libraries consisting of large object hierarchies to access Last.Fm but I’m only interested in small portion of the API and don’t really want to use one of these…
  • 17. MPC / MPD and the “Player” • Music Player Deamon is the linux software I am using to play the music. It is capable of streaming from an internet address. • MPC is the command-line interface to the deamon which allows control via the command line • The “Player” object provides access to the user’s Last.Fm station via MPC and raises events to show stuff that’s happening
  • 18. The core program… • ServiceStack is used to host a webservice that can provide information about what’s playing and perform some control functions, via the Player object • NES / LCD /Player objects are initalized and various events hooked up between them • GO!! Everything at this point is async, the main program thread just sits there doing nothing (and more importantly, not blockng anything!)
  • 19. The Website! • The website uses Funscript, which is a F# to JavaScript compiler and a TypeScript type provider that allows direct access to JS libraries with F# code • Funscript also hosts its own webserver, so I don’t need to mess about with ASP.NET linux equivalents

Editor's Notes

  1. BCM2835 - 700mhz ARM chip, and VideoCore, 1080p HD Encode / Decode. 512mb.