SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
Building an alarm clock
                         with node.js
                                 or


                     Hacking vs. Engineering
 Felix Geisendörfer                       29.09.2011 (v1)
Donnerstag, 29. September 2011
Text
                                  Welcome to the Siesta
                                 right-after-lunch Session!
Donnerstag, 29. September 2011
Building an alarm clock
                         with node.js
                                 or


                     Hacking vs. Engineering
 Felix Geisendörfer                       29.09.2011 (v1)
Donnerstag, 29. September 2011
@felixge

                                 Twitter / GitHub / IRC


Donnerstag, 29. September 2011
My Problem

                    • Getting up early in the morning

                    • That means before 12:00 (noon)


Donnerstag, 29. September 2011
This talk

                    • How I solved this problem

                    • Hacking vs. Engineering the solution


Donnerstag, 29. September 2011
Patient History

                    • 23 years

                    • Working from home

                    • Can work any hours

Donnerstag, 29. September 2011
So why get up early?


                    • To get more stuff done ...



Donnerstag, 29. September 2011
Previous attempts



Donnerstag, 29. September 2011
Text

                                 Behavioral Conditioning
Donnerstag, 29. September 2011
Text

                                 Flying alarm clock
Donnerstag, 29. September 2011
Text

             Circadian rhythm app (Sleep Cycle)
Donnerstag, 29. September 2011
Text

                                 Many alarms
Donnerstag, 29. September 2011
Nothing was working



Donnerstag, 29. September 2011
Text



Donnerstag, 29. September 2011
Donnerstag, 29. September 2011
Donnerstag, 29. September 2011
Donnerstag, 29. September 2011
Donnerstag, 29. September 2011
VLC
Donnerstag, 29. September 2011
pmset
Donnerstag, 29. September 2011
The Script


       https://gist.github.com/1a40a207cf6132f77efa




Donnerstag, 29. September 2011
sudo ./alarm.js 7 30


Donnerstag, 29. September 2011
Donnerstag, 29. September 2011
Result

                    • Reliably waking up at any time

                    • Get to choose different music every night


Donnerstag, 29. September 2011
Hacking vs. Engineering



Donnerstag, 29. September 2011
(Software) Engineering


                     “Rigorous application of science”




Donnerstag, 29. September 2011
Hacking


                                 “Playful cleverness”




Donnerstag, 29. September 2011
Hacking vs. Engineering
           this project


Donnerstag, 29. September 2011
Tests?

                                 Engineering: Yes


                                 Hacking: Maybe



Donnerstag, 29. September 2011
Airtunes?
                                    Engineering:

                                 Implement protocol

                                      Hacking:

                            Piggyback on iTunes or VLC
Donnerstag, 29. September 2011
Code
   var file = '/my/music/file.mp3';
   var vlcPath = '/Applications/VLC.app/Contents/MacOS/VLC';
   var vlc = spawn(vlcPath, [
     '-R',
     '--sout=#transcode {acodec = alac channels = 2, samplerate =
   44100}: raop{host=10.0.1.13,volume=255}',
     file
   ]);

   vlc.stdout.setEncoding('utf8');
   vlc.stderr.setEncoding('utf8');
   vlc.stdout.on('data', process.stdout.write);
   vlc.stderr.on('data', process.stderr.write);

   vlc.on('exit', function(code, signal) {
     console.log('vlc exit: %i %s', code, signal);
   });

Donnerstag, 29. September 2011
Wakeup from Sleep?
                                 Engineering:

    pmset schedule wakeorpoweron <datetime>

                                  Hacking:

     pmset schedule wakeorpoweron MTWRFSU
                      <time>
Donnerstag, 29. September 2011
Code
   var powerCmd = sprintf(
      'pmset repeat wakeorpoweron MTWRFSU %02d:%02d:00',
      powerHour,
      powerMinute
   );

   exec(powerCmd, function(err) {
     if (err) throw err;
     process.setuid('felix');
   });




Donnerstag, 29. September 2011
Turn off speakers?
                                      Engineering:

                   Install speakers in unreachable place.


                                      Hacking: ?


Donnerstag, 29. September 2011
Text

                                 Duct Tape
Donnerstag, 29. September 2011
Duct Tape of Concurrent I/O
Donnerstag, 29. September 2011
Engineering Solution for Concurrency
Donnerstag, 29. September 2011
Why am I talking about this?



Donnerstag, 29. September 2011
JS has a very hacker-driven
                                 culture


Donnerstag, 29. September 2011
Text

                                 Duct tape of the web
Donnerstag, 29. September 2011
Text

                                 Duct tape of the DOM
Donnerstag, 29. September 2011
• Hacking is lots of fun, go do it!

                    • Hacking can be a good solution!

                    • But be aware that many problems call for
                           an engineering approach.




Donnerstag, 29. September 2011
Where we need more
                                    engineering:

                    • Libraries

                    • Domain logic

                    • Performance

Donnerstag, 29. September 2011
TL;DL

                    • Hack when in doubt

                    • Engineer when clear


Donnerstag, 29. September 2011
Hacking Engineering




Donnerstag, 29. September 2011
Questions?




                                    @felixge
Donnerstag, 29. September 2011

Más contenido relacionado

Destacado

Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOEklavya Sharma
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907NodejsFoundation
 
The Enterprise Case for Node.js
The Enterprise Case for Node.jsThe Enterprise Case for Node.js
The Enterprise Case for Node.jsNodejsFoundation
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobilesDurairaja
 

Destacado (10)

Firebase slide
Firebase slideFirebase slide
Firebase slide
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance Investigations
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
HOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINOHOME AUTOMATION USING ARDUINO
HOME AUTOMATION USING ARDUINO
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907
 
The Enterprise Case for Node.js
The Enterprise Case for Node.jsThe Enterprise Case for Node.js
The Enterprise Case for Node.js
 
Home automation using android mobiles
Home automation using android mobilesHome automation using android mobiles
Home automation using android mobiles
 

Similar a Building an alarm clock with node.js

Scaling websites with RabbitMQ A(rlvaro Videla)
Scaling websites with RabbitMQ   A(rlvaro Videla)Scaling websites with RabbitMQ   A(rlvaro Videla)
Scaling websites with RabbitMQ A(rlvaro Videla)Ontico
 
Html5 episode 2
Html5 episode 2Html5 episode 2
Html5 episode 2Eric Smith
 
BDD For Zend Framework With PHPSpec
BDD For Zend Framework With PHPSpecBDD For Zend Framework With PHPSpec
BDD For Zend Framework With PHPSpecMarcello Duarte
 
Teletrain liever geen mensen om service te geven
Teletrain liever geen mensen om service te gevenTeletrain liever geen mensen om service te geven
Teletrain liever geen mensen om service te gevenVincent Everts
 
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting Strategy
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting StrategyTAG Recruiting Atlanta - 3 Phases of Mobile Recruiting Strategy
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting StrategyKane Cochran
 
Smartphones: The 21st Century Teacher Toolbox
Smartphones: The 21st Century Teacher ToolboxSmartphones: The 21st Century Teacher Toolbox
Smartphones: The 21st Century Teacher ToolboxKaren Bosch
 
web标准化交流会上海站bobby分享
web标准化交流会上海站bobby分享web标准化交流会上海站bobby分享
web标准化交流会上海站bobby分享裕波 周
 
web标准化交流会bobby分享
web标准化交流会bobby分享web标准化交流会bobby分享
web标准化交流会bobby分享裕波 周
 
How to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushHow to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushAcquia
 
開発者のためのiPhone⇔Androidアプリ移植のポイント
開発者のためのiPhone⇔Androidアプリ移植のポイント開発者のためのiPhone⇔Androidアプリ移植のポイント
開発者のためのiPhone⇔Androidアプリ移植のポイントyoski
 
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...tcs digital world
 

Similar a Building an alarm clock with node.js (20)

Scaling websites with RabbitMQ A(rlvaro Videla)
Scaling websites with RabbitMQ   A(rlvaro Videla)Scaling websites with RabbitMQ   A(rlvaro Videla)
Scaling websites with RabbitMQ A(rlvaro Videla)
 
Html5 episode 2
Html5 episode 2Html5 episode 2
Html5 episode 2
 
AudioSIG28Nov2011
AudioSIG28Nov2011AudioSIG28Nov2011
AudioSIG28Nov2011
 
BDD For Zend Framework With PHPSpec
BDD For Zend Framework With PHPSpecBDD For Zend Framework With PHPSpec
BDD For Zend Framework With PHPSpec
 
Teletrain liever geen mensen om service te geven
Teletrain liever geen mensen om service te gevenTeletrain liever geen mensen om service te geven
Teletrain liever geen mensen om service te geven
 
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting Strategy
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting StrategyTAG Recruiting Atlanta - 3 Phases of Mobile Recruiting Strategy
TAG Recruiting Atlanta - 3 Phases of Mobile Recruiting Strategy
 
Distribute the workload, PHPTek, Amsterdam, 2011
Distribute the workload, PHPTek, Amsterdam, 2011Distribute the workload, PHPTek, Amsterdam, 2011
Distribute the workload, PHPTek, Amsterdam, 2011
 
Smartphones: The 21st Century Teacher Toolbox
Smartphones: The 21st Century Teacher ToolboxSmartphones: The 21st Century Teacher Toolbox
Smartphones: The 21st Century Teacher Toolbox
 
Node Stream
Node StreamNode Stream
Node Stream
 
web标准化交流会上海站bobby分享
web标准化交流会上海站bobby分享web标准化交流会上海站bobby分享
web标准化交流会上海站bobby分享
 
web标准化交流会bobby分享
web标准化交流会bobby分享web标准化交流会bobby分享
web标准化交流会bobby分享
 
How to Install, Use, and Customize Drush
How to Install, Use, and Customize DrushHow to Install, Use, and Customize Drush
How to Install, Use, and Customize Drush
 
Titanium setup
Titanium setupTitanium setup
Titanium setup
 
開発者のためのiPhone⇔Androidアプリ移植のポイント
開発者のためのiPhone⇔Androidアプリ移植のポイント開発者のためのiPhone⇔Androidアプリ移植のポイント
開発者のためのiPhone⇔Androidアプリ移植のポイント
 
videocourse
videocoursevideocourse
videocourse
 
Distribute the workload, PHP Barcelona 2011
Distribute the workload, PHP Barcelona 2011Distribute the workload, PHP Barcelona 2011
Distribute the workload, PHP Barcelona 2011
 
clrh56
clrh56clrh56
clrh56
 
Video For Real Estate
Video For Real EstateVideo For Real Estate
Video For Real Estate
 
Future Tense
Future TenseFuture Tense
Future Tense
 
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...
AmbientTalk, a scripting language for Android devices - Dries Harnie, VUB - d...
 

Más de Felix Geisendörfer

Más de Felix Geisendörfer (14)

Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)
 
How to Test Asynchronous Code
How to Test Asynchronous CodeHow to Test Asynchronous Code
How to Test Asynchronous Code
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)
 
Node.js in production
Node.js in productionNode.js in production
Node.js in production
 
Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Node.js - A Quick Tour
Node.js - A Quick TourNode.js - A Quick Tour
Node.js - A Quick Tour
 
With jQuery & CakePHP to World Domination
With jQuery & CakePHP to World DominationWith jQuery & CakePHP to World Domination
With jQuery & CakePHP to World Domination
 
ActiveDOM
ActiveDOMActiveDOM
ActiveDOM
 

Último

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Building an alarm clock with node.js

  • 1. Building an alarm clock with node.js or Hacking vs. Engineering Felix Geisendörfer 29.09.2011 (v1) Donnerstag, 29. September 2011
  • 2. Text Welcome to the Siesta right-after-lunch Session! Donnerstag, 29. September 2011
  • 3. Building an alarm clock with node.js or Hacking vs. Engineering Felix Geisendörfer 29.09.2011 (v1) Donnerstag, 29. September 2011
  • 4. @felixge Twitter / GitHub / IRC Donnerstag, 29. September 2011
  • 5. My Problem • Getting up early in the morning • That means before 12:00 (noon) Donnerstag, 29. September 2011
  • 6. This talk • How I solved this problem • Hacking vs. Engineering the solution Donnerstag, 29. September 2011
  • 7. Patient History • 23 years • Working from home • Can work any hours Donnerstag, 29. September 2011
  • 8. So why get up early? • To get more stuff done ... Donnerstag, 29. September 2011
  • 10. Text Behavioral Conditioning Donnerstag, 29. September 2011
  • 11. Text Flying alarm clock Donnerstag, 29. September 2011
  • 12. Text Circadian rhythm app (Sleep Cycle) Donnerstag, 29. September 2011
  • 13. Text Many alarms Donnerstag, 29. September 2011
  • 14. Nothing was working Donnerstag, 29. September 2011
  • 22. The Script https://gist.github.com/1a40a207cf6132f77efa Donnerstag, 29. September 2011
  • 23. sudo ./alarm.js 7 30 Donnerstag, 29. September 2011
  • 25. Result • Reliably waking up at any time • Get to choose different music every night Donnerstag, 29. September 2011
  • 27. (Software) Engineering “Rigorous application of science” Donnerstag, 29. September 2011
  • 28. Hacking “Playful cleverness” Donnerstag, 29. September 2011
  • 29. Hacking vs. Engineering this project Donnerstag, 29. September 2011
  • 30. Tests? Engineering: Yes Hacking: Maybe Donnerstag, 29. September 2011
  • 31. Airtunes? Engineering: Implement protocol Hacking: Piggyback on iTunes or VLC Donnerstag, 29. September 2011
  • 32. Code var file = '/my/music/file.mp3'; var vlcPath = '/Applications/VLC.app/Contents/MacOS/VLC'; var vlc = spawn(vlcPath, [ '-R', '--sout=#transcode {acodec = alac channels = 2, samplerate = 44100}: raop{host=10.0.1.13,volume=255}', file ]); vlc.stdout.setEncoding('utf8'); vlc.stderr.setEncoding('utf8'); vlc.stdout.on('data', process.stdout.write); vlc.stderr.on('data', process.stderr.write); vlc.on('exit', function(code, signal) { console.log('vlc exit: %i %s', code, signal); }); Donnerstag, 29. September 2011
  • 33. Wakeup from Sleep? Engineering: pmset schedule wakeorpoweron <datetime> Hacking: pmset schedule wakeorpoweron MTWRFSU <time> Donnerstag, 29. September 2011
  • 34. Code var powerCmd = sprintf( 'pmset repeat wakeorpoweron MTWRFSU %02d:%02d:00', powerHour, powerMinute ); exec(powerCmd, function(err) { if (err) throw err; process.setuid('felix'); }); Donnerstag, 29. September 2011
  • 35. Turn off speakers? Engineering: Install speakers in unreachable place. Hacking: ? Donnerstag, 29. September 2011
  • 36. Text Duct Tape Donnerstag, 29. September 2011
  • 37. Duct Tape of Concurrent I/O Donnerstag, 29. September 2011
  • 38. Engineering Solution for Concurrency Donnerstag, 29. September 2011
  • 39. Why am I talking about this? Donnerstag, 29. September 2011
  • 40. JS has a very hacker-driven culture Donnerstag, 29. September 2011
  • 41. Text Duct tape of the web Donnerstag, 29. September 2011
  • 42. Text Duct tape of the DOM Donnerstag, 29. September 2011
  • 43. • Hacking is lots of fun, go do it! • Hacking can be a good solution! • But be aware that many problems call for an engineering approach. Donnerstag, 29. September 2011
  • 44. Where we need more engineering: • Libraries • Domain logic • Performance Donnerstag, 29. September 2011
  • 45. TL;DL • Hack when in doubt • Engineer when clear Donnerstag, 29. September 2011
  • 47. Questions? @felixge Donnerstag, 29. September 2011