Ac rwy'n creadio bod ymlaen yn ein cyfnod o'r hyffordd yna fawr a'r byd i'r llyfr wedi'i lleol ar y syniad. Ac rydyn ni'n meddwl iawn i'r rwyng hwn, mae'n rhaid i'r lleol yn dda i'r lleol ar gyfer gyfer GSC o'r ysbryd. A dyna'r lleol yn ddengylcheddol i'r lleol, rydyn ni'n meddwl i'r lleol yn dda i'r lleol, You have to take an interest in science You have to take an interest in philosophy A lot of people would probably want to walk out And never have to think about those horrors of their school days again But no, I think that the significance Why we say that you should have an interest in philosophy Why you should have an interest in science Is because Marxism at its root is really a philosophy of change It's a philosophy of development Of a society of nature and of human thinking And yeah, this finds itself confirmed best in my opinion Throughout the natural world and in the developments of the natural sciences as well And indeed, you might not think you have a philosophy But you do have a philosophy It is your worldview and you can bet your bottom dollar That the ruling class have their philosophy They have their philosophy of change For the ruling class, if you think about it Change for them is whatever maintains the status quo You know, we have to sort of understand that this system is the most natural system And you know, the law of the jungle of the market Is merely the translation into human affairs Of the law of the jungle of nature And this is the most natural system And any attempt to change it Any attempt to shoehorn us into some more altruistic Or socialistic form of society always is unnatural Leads the totalitarianism and everything else And as far as possible, I mean these people sound ridiculous But pre-2008 you have people like Gordon Brown Saying that he, Chancellor of the Exchequer Elected in 1997 had done what no one had done In 300 years of capitalist history He had put an end to boom and bust Obviously these people look ridiculous now Francis Fukuyama who in a similar period Was talking about the end of history That in other words the system tends towards equilibrium It expels its contradictions Nowadays we look at these people And we think they're utterly ridiculous But of course it reflects the mentality of the ruling class Who want to argue basically that the status quo Is the only possible mode of existence And therefore give up That's their philosophy of change Can be summed up in two words Give up in any notion of changing the world This is the most natural system And if change does take place It takes place in a slow evolutionary Gradualistic way basically And therefore don't think about revolution Marks and Engels had a whole industry Dedicated to disproving their ideas But Lenin and Trotsky were the devil You know these people, these revolutionaries These were tried to impose upon us An unnatural system And therefore we need our own philosophy The working class needs its own philosophy Because fundamentally I think that if the working class Cannot conquer its own world view Cannot understand its own relationship to the world Independently of the world view of the ruling class How is it going to conquer power How is it going to transform society So for us and for the most advanced layers Of the working class it's necessary If we want to transform society That we first of all conquer our own understanding Of society, our own understanding Of our relationship to society and nature Our own philosophy of change And Marks and Engels took a lot of interest In the natural sciences and they took a lot of interest In philosophy as well of course Marks himself was a student of philosophy Before he was a communist And they took a lot of interest In philosophy I apologise to any students of philosophy In the audience today because philosophy As it is today is basically It is a complete swamp It's a complete desert compared to philosophy As it existed in Marks' youth in Germany And it reflects the fact that the ruling class Nowadays is completely and utterly They've lost confidence in themselves They've lost confidence in their system And therefore the dominant philosophy Is the reflection of this in the minds of academics Is that basically we cannot understand history History is irrational This is the post modern philosophy That we all have our own narrative But understanding objective laws which govern The development of society is a complete impossibility And therefore the idea of progress in particular Is completely out of the question And this is really a reflection Of the pessimism of the ruling class In academia Now in Marks' youth philosophy Was very different And this was a reflection of the fact That capitalism as a system was very different It was still a revolutionary system It was revolutionising not just industry, science and technique But you had great events like the French Revolution Which gave a huge impetus to human thinking And the capitalist class were fighting A struggle against all of the rubbish That had basically come down from the Middle Ages Against feudalism, against absolutism Against mysticism and the Catholic Church Philosophy and science were themselves Battlegrounds in the class struggle And therefore you had giants of philosophy In this period quite unlike today And one of the greatest philosophers Of the modern age really A product of this period was a guy called George Wilhelm Friedrich Hegel Of whom Marks in his youth Was an avid follower of his ideas And he made a, I hesitate to say a discovery He rescued really a very ancient idea An idea which owes its origins to the, there are elements of it In ancient Eastern religions and philosophies And it finds a very developed form In ancient Greek philosophy So it was not a new idea And this idea we refer to as dialectics basically Now what is dialectics? Dialectics, Engels explains Represents the general law of development of nature, society and thought That's a pretty, that's a pretty bold claim The idea that there is some general law of development Of all of the, of basically the whole of matter And the whole of this material world So like all sciences philosophy has its specialist language But I think like all genuinely profound ideas Dialectics is not really a very complicated idea It can be very simply expressed And I think it can best be expressed Through examples, through looking at how We need to discover it in nature, in society Rather than, it's not something we can simply impose upon the world around us It is a product of the world around us And therefore it needs to be discovered and explained Through the phenomena of nature and of social development So let's have a bit of a look What is this dialectics thing So if I were to sum it up I would probably use the aphorism of an ancient Greek philosopher A guy called Heraclitus To later philosophers was known as Heraclitus the Dark Because he wrote in riddles and aphorisms And this sort of thing And he said the following which I think sums up dialectics very nicely He says that everything both is and is not For everything is in flux Everything is in a constant process of change I both do and do not step in the same river twice Now this is an interesting idea That completely contradicts our notion of common sense How can everything both be and not be I am me, my name is Ben Nice to meet you I'm not Ben as far as I know This is a phone, it's not not a phone It contradicts common sense I'll come back to this question of common sense in a minute But let's look at this question in a little more detail Am I really me Well if I go down to the level of my cells in my body We'll see that they're constantly excreting matter into my bloodstream Which has been removed from my kidneys and other organs And I'm constantly ingesting food Which is being reabsorbed into my cells From the bloodstream, these new nutrients So that over the course of months or maybe years I don't know exactly the time frame Every single molecule in my body Will have been replaced by new molecules And then if I ask you in a few months or years Am I still the same person There is no simple answer The answer is both yes and no I'm both am and I'm not the same person at the same time Excuse me It is a contradiction And it is a contradiction The logic you are taught in schools Formal logic basically So-called common sense logic cannot deal with Everything in formal logic either is Or it is not And there is this law of the excluded middle Dialectics on the contrary Is a philosophy of change It is a philosophy of things in their motion And in their motion things have contradictions Contradictions are not absurdities Contradictions are very real Motion itself is an expression Of contradiction that something can be And not be in the same place at the same time And so Our common sense ideas Break down when we take into consideration Motion That's not to say formal logic doesn't have Its area of applicability But certainly Things start to break down These fixed categories cease to be fixed They become blurry and things turn into their opposites And we see this in biology in particular I took myself as an organism We see that within biology Common sense has told people for thousands Of years that things fall into Fixed static categories Something is either a dog or a cat Or a lizard or a plant or an animal But of course the Greeks Who had a very profound grasp of dialectics Did understand that actually Within biology species can change The idea of anaximanda had His had a theory of evolution But it was only in the past 100 years That you really had this put on a scientific basis With the theory of evolution Through natural selection That things are not so fixed Let's look at some examples I mean the most fundamental division Within the sphere of organic life Is probably that between plants and animals And yet if you go into the ocean The majority of biomass in the ocean Is composed of tiny microscopic organisms Called plankton And many of these plankton move around And interact with their surroundings like animals Yet they have chloroplasts And photosynthesised like plants They don't fit into any of these static categories Right? You can discover these examples Of this throughout nature, viruses Have none of the processes of metabolism Like the rest of living life as we know it And yet they are able to reproduce Much like life, they defy the categorisation Even into the categories of organic And inorganic life And The history of our own species And how we conceive of the development Of our species, likewise Has defied this simple categorisation It used to be that there was a very simple Linear notion of how human life evolved That we had these ape-like creatures That developed into upright apes The Australopithecines And that these Then led to the emergence of hominids Our more human-like ancestors And finally homosapiens Sort of the crowning glory upon that But in actual fact more discoveries have shown That there is no clear distinction That the discovery of new fossils The advance of paleontology has shown There's all sorts of Specimens that fit into neither the Australopithecines Nor the hominids And in fact far from being this linear progress What we have is all sorts of offshoots Evolutionary dead ends, re-mergers We have the interbreeding in Europe Of neanderthals with homosapiens To a certain extent So this simple linear image Of progressive development has broken down Under examination And in fact if we look at the difference Evolutionarily speaking between us And our nearest living relatives Like the higher apes We see that amongst the higher apes There is only a very small genetic difference Actually the difference is as little as 1.2% Difference in our genes And those of Bonobo apes for example Which is a tiny difference To give you a sense of proportion The difference between me and any of you In this room Genetically speaking could be as great as 0.1% Which means that the leap from Between us is only 1.12% Of the difference of the leap between me and an ape So it's a very small difference Actually genetically speaking And yet within this tiny quantitative Difference represents such a tremendous Leap that we are separated By an enormous gulf from the rest Of the animal kingdom We really in many respects are not animals Like the rest of the animals Unconscious beings that only are able to project themselves A very limited amount into the future We have wrought changes upon the natural world Which the only point of comparison Can be like the evolution Of multi cellular life 550 million years ago Such is the scale of this revolution Contained within this tiny amount Of genetic difference And this is precisely how dialectics explains That change takes place Not through gradualistic slow Progressive development Quantitative changes Reach a tipping point And then you have huge qualitative transformations Revolutions, catastrophes, upheavals As we are discussing today Could I have some more water? And indeed Darwin's discovery That the process of evolution through natural selection Is really the discovery of dialectics This law of quantity transforming Into quality As applied to the biological world After all the differences between organisms Within a species Can be measured quantitatively In their genetics In the lengths of their clods Or fins or limbs and so forth And yet these small quantitative differences accumulate To make complete qualitative transformations The emergence of new species It is dialectics confirmed within nature And yet Darwin's conception of this Reflected the prejudices around him The gradualist reformist prejudices Basically He saw evolution as taking place Not through these qualitative leaps But in a slow gradualistic manner Much in the same way that for example The branches slowly emerge smoothly From the root of a tree The trunk of a tree And This is not what the This is not actually what the fossil record shows us We actually see that there are periods When species look completely the same You go millions of years Ammonites look exactly the same And then suddenly an adaptation Or a speciation they change Of one species But you have mass extinctions Huge upheavals Undoubtedly there was change taking place Small changes within their ecosystem Within their genetics Within their variation Within their genes of that species The gene pool of that species And yet this slow gradual Progressive development Of gradual change Quasi-equilibrium basically exists This is then punctuated by tremendous revolutions Which owes itself to two scientists in particular Stephen J. Gould and Niles Elridge And in fact There was one piece of evidence That Darwin put forward Such was his sort of attachment To this slow gradualistic evolutionary theory of change That he thought it was a legitimate Counterargument to his entire theory basically And that was If you go back 600 million years There was only really one type of fossil That we see in abundance And it's called a stromatolite A big blob Which is formed when single-celled algae Basically formed mats essentially That's all that existed These single-celled organisms forming these big blobs Basically all over the planet And then 550 million years ago You see a sudden explosion A huge variety of complex multi-cellular life forms And some of them have names like hallucinogenia Because they're so unlike anything you've ever seen They are like from another world A fantastic array Of new species evolving In what is a blink of an eye geologically speaking And Darwin could not explain this Now we see that there are There are breakthroughs Stephen Jay Gould puts forward the theory That what actually happened Is that you had one of these tiny little algae Sat in one of these Stromatolites basically Underwent a very small genetic change It wouldn't have looked very different From the algae around it And yet it started doing something remarkable To bring up all of the algae around it And this was like a whip basically At the back of these prey algae That were trying to escape from it That forced them to evolve mechanisms To get away from this Out-of-control grazing algae basically And it in turn Underwent an evolution to try and overcome these It was basically a giant arms race Began 550 million years ago And it hasn't stopped accelerating since A huge variety of species emerged From that difference And he would not have been able to tell the difference Between these two microscopic organisms So you see that evolution Really takes place in this manner Of a punctuated equilibrium Equilibria punctuated by these tremendous revolutions And this theory can be applied actually Punctuated equilibria Is a phenomena of the whole of nature around us In many respects It isn't just something that can be looked at in biology And yet when Darwin was writing I talked about him discovering dialectics In evolutionary biology Which was a far more advanced science in many respects It achieved a far greater level Of completion It had even ossified into a complete world view Completely rejected what we would understand As dialectics The world view which had developed In the mid-19th century Was fundamentally the same as that developed by Newton In 1687 in his Principia And according to this view of the world The universe was governed essentially By simple, time-reversible Mechanistic laws Which can be calculated to a high degree of precision And everything could be understood in these laws We also could be understood Our hearts are nearly pumps Our arms are like levers These are simple mechanistic Newtonian laws And this was developed to such a high degree It became so ossified That a guy called Laplace Put forward the idea that imagine If we had this hyperintelligence People derogatory Derogatory Refer Refer to this as Laplace's demon Subsequently Imagine if you had an intelligence Which knew the positions and momentum of every single particle And part of the universe around us We could basically Predict how the entire universe Would evolve for all of eternity And furthermore we could even reverse the clock To say what the starting conditions of the universe were In other words This view of the universe Completely expelled the notion of accident From physics Everything was a matter of iron necessity And if we see things that we don't understand It's simply because there are gaps in our knowledge Of the precise positions of everything in the universe So it completely expelled the notion of accident Everything became a matter of necessity If you like within nature Now some, particularly within the idealist school of philosophy Rejected this view Because they said actually Whilst we have these laws of nature Nothing actually conforms to it Galileo talks about how two things drop At the same time they don't Because of air resistance and everything else And therefore he said actually everything in nature Is subject to contingency to accident And so forth If there are laws within nature They are unknowable because we cannot know the thing in itself The laws we have are the products of Our a priori Products of a priori understanding And we use reason and so forth to basically Bring order to chaos So the world is governed by accident So the idealist took the opposite position Expelling necessity from the real world Hegel His great revolutionary breakthrough I think in many respects Was he saw that accidents and necessity Although contradicting each other Exist and depend upon each other They condition each other He said that he made the following very profound statement That necessity expresses itself through accident Now this is a very interesting idea In my opinion And we've just looked at an example of that idea Darwinian evolution is precisely an example Because once One individual within a species It can be the fittest it likes It can be very well adapted to its surroundings And yet A forest fire can kill it off anyway It can entirely accidentally fall into The jaws of a predator And despite this fact that You have this All of these accidents within nature Over the course Of only a few dozen generations Only a few hundred individuals within a species This resolves itself Into the well-describable law Of evolution basically That the species as a whole Will adapt in the direction of its greatest fitness Within that ecosystem So you see that necessity expresses itself Through a multitude of accidents And in fact Trotsky even went on to say The following which I really like Because I think it shows how Accidents expresses itself through necessity Also in human history He said the following in my life He said that broadly speaking The entire historical process Is a refraction of the historical law Through the accidental In the language of biology one might say That the historical law is realised Through the natural selection of accidents Excuse me On this foundation there develops that Conscious human activity which subjects Accidents to a process of artificial selection So he saw that this unity Of accident and necessity Actually amplifies and gives rise To the possibility of artificial selection Of the subjective factor intervening In the objective processes Of social development That the two are interdependent if you like Now just coming back to this question Of the Newtonian view of the world Of course we know that it was In many respects brought down A revolution overthrew it And put it in its rightful place That was in quantum mechanics and relativity But in fact the first attacks upon The universe didn't come from that Direction they actually came From the theory of heat in the 19th century Started to be used polemically Actually against Laplace's demon Attacking this notion that everything is governed By this iron necessity And you had a great breakthrough By a guy called Ludwig Boltzmann In 1870 who basically Gave a new interpretation to an idea Which had been empirically discovered What we discovered is that if you have an engine You burn coal And you turn it into heat And that is transmitted into motion Some of that energy When it goes through its transformations This energy is neither created nor destroyed But a lot of it is lost as heat Which is just disordered chaotic motion It's just molecular motion That is uncontrollable And it dissipates into the universe And Boltzmann said that actually this reflects The fact that systems as a whole Tend towards the most probables outcome An example When you had a field of sheep And you had a field of cows That's a very orderly system All the sheep and the cows are separated by a fence If I open the gate to that fence The sheep and the cows will start wandering around And eventually there will be half the sheep in one And half the sheep in the other And likewise with the cows Until motion has ceased You've reached an equilibrium basically This was an interesting interpretation Of this notion That heat tends to increase You have a dissipation of energy within the universe This second law of thermodynamics And what this seems to say It was a revolution really Because what it said is you can calculate How heat dissipates and so forth But it takes place in a probabilistic manner Through a lot of tiny accidents Statistically you get the objective necessity Of the laws of the transformation Of energy The second law of thermodynamics Emerged from this So for the first time There was an attempt to unify accident and necessity Within physics And yet So this was a big step forward It introduced history into physics You can boil an egg but you can't un-boil an egg If you leave a cup of coffee down on the table It will go down to room temperature It won't spontaneously start rising in temperature So suddenly the universe had a history It was not this time reversible piece of clockwork Mechanism that the Newtonian view had And yet it itself is extremely one-sided Because if you consider it What it says is that there is dissipation It says that things tend to chaos And to disorder if you like And there is undoubtedly there are phenomena Like the cooling cup of tea or these animals That are allowed to roam on this chaotic farm That we've set up in my imagination It undoubtedly has a certain field of applicability And yet what it says Is things tend towards equilibrium Motion actually tends to cease In these cases And this was taken to an extreme To say that actually if you think of the universe as a whole Motion is running down So we have a clockwork universe Where the spring is not being wound down Until eventually we'll have a heat death Everything will be the same temperature Everything will reach an equilibrium And motion will cease So this whilst it was a step forward We had the clockwork universe And then we have a clockwork universe Which is winding down to an eventual death And stasis Again an extremely undialectical view Of the universe and one which actually does not correspond To the world around us in many respects If you look at the world around you You'll see that things are winding up You have not greater dispersion Of not just dissipation That is one feature of the universe But you also have growing organisation Growing complexity within the universe Within biology You had originally the primordial soup Which was complete disorder Which eventually organised itself into single-celled organisms And then more and more and more complex organisms And human history follows the same development Not in a linear fashion But you have this process of development From the less complex forms of organisation To the more highly organised And more complex forms of human society And culture and so forth So clearly it is a one-sided tendency But it came about Fundamentally in my opinion Partly as a result of a natural process Within science Because science itself has to break things down Into their constituent parts It has to look at things in their isolation You have to understand Before you can understand for example How air resistance works You have to imagine we get all of the air out of the room And then we drop these two objects And see how they fall It isolates things, it forms closed systems Because it is necessary to do so In order to understand these more simple things But therefore it's all the more necessary To have a philosophy To be able to put the universe back together Because actually things don't exist in closed isolated systems In a closed system you can have A pendulum which very nicely goes Back and forwards for all eternity You can have a cup of tea reaching an equilibrium With its surroundings and you can have cows and sheep Ffrolicking on a farm Or whatever you want But the universe is not a closed system It is an open system As Richard Lewontin said The great Marxist biologist Or a pancreas or a stomach or an intestine They only exist under the knife of the anatomist In nature you only have the whole organism And we have to understand things In their interactions In their complexity and development As a whole The problem is actually That is very complicated because By isolating these closed systems You create a class of very easily Solvable problems within physics But for example if I don't look at a farm But I consider an open ecosystem It is actually far more complex Every part interacts with every other part You have not simple Random motion of cows and sheep You have great migrations And herds And these herds break up into smaller herds Because they need to go and look for resources Because they are at threat of overeating the vegetation You have predation You have over-predation So that predators themselves Enter into a decline in their populations Because they have eaten too many of the prey animal So you have feedback loops within the world And you have extreme complexity basically And that's very difficult to actually model Whereas it's very much easier to model these simpler Abstract ideas These models that we create That science often creates And therefore In order to be able to look at these open systems More complex systems such as the weather for example Which itself is not simply It doesn't reach an equilibrium of stasis Like the cup of tea reaching room temperature But it does not reach an equilibrium of stasis Like the cup of tea reaching room temperature It is constantly out of equilibrium In fact we see that Non-equilibrium Open systems Dynamic systems are the norm Equilibrium is not the norm It is actually the It is a very special case basically Within nature Most things are far from in equilibrium And the weather is exactly one of those You see That however a big That forward really I think a tremendous revolution Took place in the middle of the 20th century Which allowed us to begin exploring these things For the first time in mathematical detail And that was of course the invention of the computer Now for the first time we're able to actually model Extremely complex systems Or at least create Models that approximate To these systems And indeed there was a guy called Edward Lorenz Who in the middle of the 20th century Began sitting down to a computer trying to predict the weather And he used a very simple model It only had 12 parameters It clearly wasn't like the weather that we understand it But you know he modeled things like Humidity, wind speed, pressure Temperature and so forth And he expected to be able To predict how this system would unfold For an unlimited Amount of time basically And what he found is he ran this model And then he ran it again And he found that it started off doing the same thing And then it started to diverge Until eventually after a period of time It was completely unrecognisable The system was completely different And what he found is he put The figures that he put back into the system Had a rounding error of 0.001 Difference with the original parameters It was a tiny difference basically And yet this had profound implications For science, what it actually said Is that The Weather we may have these deterministic laws Even though we may be able to understand All that there is to understand About the weather Yet you have this extreme sensitivity To starting conditions That out of these predictable laws can arise chaos Can arise unpredictability And this was led to the interpretation As you may have heard of the butterfly effect The idea that a butterfly flapping its wings In Britain Can have such a tiny difference here But it could have the overall effect of causing a hurricane In the Caribbean for example Of course that's a slight misinterpretation In many respects so it's one sided Because it's not the butterfly that causes it It's the interaction of all of the parts of the system That cause the development of these patterns So we actually lose a certain amount of predictability Within these chaotic systems And you can see that human society In many respects is more like the weather Than it is like a swinging pendulum Or a fields of cattle and sheep Or whatever silly example I gave earlier It is an extremely chaotic system With all sorts of interacting factors Going on And yet whilst we lose a lot of the ability To predict the weather long term We can say that there are well defined features Within the weather that are very well understood Under what circumstances they arise We have only a very limited number Of pressure systems, storms, hurricanes Cloud patterns and so forth So on another level We see that there are patterns That constantly repeat but never exactly repeat That the weather never repeats But it rhymes really And likewise in human history We can see that there are developments That we understand how these developments take place But they never take place in exactly the same way And in fact I don't really have time to go into The idea of strange attractors Within chaos theory And I don't really want to explain what they are But if you plot These Parameters That Edward Lorenz was talking about Is that the system forms these patterns Spiral patterns actually Never exactly repeating itself But forming very similar patterns And I'll compare that to the theory Of dialectics of the negation of the negation Which this is how Alan describes it in Reason and Revolt He says that dialectics envisages The fundamental processes At work in the universe and society And in the history of ideas Not as a closed circle Where the same processes merely repeat themselves In an endless mechanical cycle There's an open-ended spiral of development In which nothing is ever repeated Exactly in the same way before Now I don't have a huge amount of time left So I'm going to bring things to a close In a minute But first of all I want to look at another Feature of these Non-linear dynamic Systems which is very well explained In a book that I highly recommend There's a few books that I recommend really That come ready to read dialectics of nature And anti-during in particular And on top of that Reason and Revolt Which I've just quoted from It looks at how dialectics Finds itself confirmed in nature But when you've read those I highly recommend a fourth book Which is a book called Ubiquity By a guy called Mark Buchanan And what he showed Is that what he explains in this book Is that other scientists have showed That these complex systems Tend towards actually self-organisation And in particular They tend to organise to a very special state Which is very rare in equilibrium physics And that is called the critical state The boundary, the turning point Between one state and another One phase and another In equilibrium physics You have to actually fine tune things To get them to this precise boundary You have to get to a very specific temperature Or pressure or what have you If you want to go from That find the state between magnetised And non-magnetised iron, for example It's at about 700-something degrees centigrade You have to fine tune things To get them on that barrier In equilibrium physics Much like balancing a pencil on its lead It's very unstable However, what he found is in Non-equilibrium physics In dynamic systems Things actually tend towards this critical state They tend towards this fine tuning This fine balancing basically And under those circumstances In this critical state You can see that tiny effects can have Massive qualitative effects basically Outcomes Tiny inputs can have massive outcomes You can have, for an example that he gives Is a pile of sand Where you drop grains upon that sand Until it becomes steeper and steeper And what you find is it organises into a critical state Where the next grain of sand Might have the effect of causing an avalanche of one or two sand grains Or it might be a few hundred Or it might be a few million And in fact where it falls could collapse the east Or the west side of the sand pile And it's entirely down to accident How that takes place So this organisation of things Into their critical state Where tiny effects can have massive changes On a system Qualitative changes on a system Were discovered and examples were given In this book by Buchanan Of earthquakes Of stock market crashes Fluctuations in fashion War, mass extinctions So in other words there is this lawfulness To how change takes place In these non-equilibrium systems Which I don't have that much time To go into unfortunately But finally to bring it back I want to give an example from our own experience Which is a society Why is this interesting? Why is this of interest to us As revolutionary Marxists who want to transform society And why is it of interest to us As Marxists What does this actually tell us About society? Well likewise As in nature within society You find this critical state Constantly re-emerging and in fact We had a debate within Britain Amongst Marxists the supporters of socialist appeal In 2015-2016 After the election of Jeremy Corbyn Now what we had said for many years Is we had said That as the class struggle develops in Britain The Labour Party will be transformed And yet in our articles In 2015-2016 We described Jeremy Corbyn As an accident basically It was something that might or might not have happened Basically And some comrades said How can a revolution And we just called it the Corbyn Revolution In many of our In much of our literature How can a revolution be caused by an accident It seems absurd And yet Precisely it was an accident After all Corbyn could have been hit by a bus The day before God forbid Margaret Beckett Might have had a sudden Sense might have suddenly come to her And she decided not actually to nominate Corbyn Or any of these sort of things might have happened Corbyn might have decided Not to have breakfast in the morning And that made him a bit grumpy To stand for an election of the leader of the Labour Party History is made up of all of these tiny accidents Many of them ridiculous And yet they can have profound and far reaching effects And what I would say is actually If you look at every single revolution in history Has been started apparently Been started by an accident in fact Just in 2010 You had the death of a young man called Mohammed Bouazizi in Tunisia Now this young man's life in many respects Was nothing special There was nothing special about this particular young man But he was so humiliated And by the regime His life was such a daily struggle Simply to survive That he killed himself He immolated himself And that particular suicide Which is definitely not the first And certainly won't be the last suicide In Tunisia by a young man Who's reached the end of desperation Had a massive effect It's based on It's basically resonated With millions of people Who saw in that young man their own conditions And went out onto the streets And brought down a dictator And eventually of course it didn't just have that effect in Tunisia It had an effect in Egypt And the wider Middle Eastern North Africa And yet what this man did Was in many respects an accident He might have or he might not have done so And likewise in the Lebanon Who can say that the insurrectionary movement That we've seen in the Lebanon Is anything to do with WhatsApp Or charging for WhatsApp calls It has nothing to do with that It has everything to do with the build up Of anger within society Until the point where it reached That tipping point basically Where an accident can have a massive effect And another example which I think Illustrates this much better in many ways Because it shows what an imprint An accident can have on history Is the example of Hugo Chávez in Venezuela Because after all He was an officer in the Venezuelan army Had died fighting guerrillas In the jungles of Venezuela Of course he would not have been able to play the role That he did in the Venezuelan revolution In 1998 onwards So in many respects he was himself An accident of history Yet who can doubt the huge impact That this accident had A decisive impact Venezuela will never be the same again It has laid down a tradition amongst the workers and the poor The Bolivarian tradition Which was a creation of Hugo Chávez And so it had a huge impact A decisive impact And yet of course If he had not come along Or if Mohammed Bouzizi had not killed himself In that way Or if Jeremy Corbyn had decided not to stand for the Labour Party There would have still been these revolutionary movements But they would have expressed themselves Very differently, decisively differently Possibly In Britain for example If Corbyn had not stood for election Back in 2015 as I think was entirely possible That he might have decided not to Many of the lefts also had a completely pessimistic view They didn't think they were going to win this He stood because it was his turn John McDonald stood twice And he stood because it was It was his turn basically There were lefts who thought that they shouldn't stand They would get humiliated, they would get thrashed I don't know and I'm not saying that that was the position of Jeremy Corbyn But if he hadn't have stood What would have been the outcome From the point of view of the development of the Labour Party I don't think it's beyond the realms of possibility To say That you could have seen the near destruction of that party Under a right wing leadership A Blairite or whoever else An Andy Burnham or a Liz Kendall of this world Had been at the leadership The Labour Party in England and Wales could have gone the same way That it went in Scotland So you see that things were in many respects On a knife edge And an accident falling one of two sides Of different transformative effects And indeed of course That anger would have still been there Had Corbyn not been elected If the Labour Party had even been more or less destroyed But it would have found another expression A very different expression So you see that one small accident Can have a decisive effect And in many respects I think like Trotsky's analogy is a very beautiful one The idea that history is the natural selection Of a whole host of accidents Because in many respects That simply That Revolutions are caused by accidents I would go so far as to say That the whole of history is in many ways Nothing but a whole host of accidents Some of which have a bigger and a smaller effect Think of economics for example What is economics What is the market economy If it's not whether I decide to buy a cheese sandwich At lunch at Tesco Or if I decide to go and get a pastry At the wonderful stall over there Or whether I decide to take out a mortgage Which I obviously can't afford There is a strong necessity of pushing me against that Or I decide until The housing market crashes And decide to get a mortgage a few years later Whether an investor buys Or an investor sells There's a whole host of accidents And yet out of that myriad of accidents Emerges the law Of capitalist development Which has very well definable features The law of the boom and bust Of the cycle of capitalist economics The longer term trends The secular stagnation that we're seeing setting in And we can see that in many respects History is composed of a whole infinite host of accidents Like those sand grains falling upon That sand pile that I talked about a minute ago Whether I decide Whether I sleep in in the morning Or whether Jeremy Corbyn stands for election Or whether a young man kills himself in Tunisia There is this whole host of accidents That eventually form if you like Much like the falling sand grains form a dune They form a landscape Which determines where the future accidents may fall But not necessarily where they will fall So I think by understanding these processes By studying them in nature And also studying them in society Looking at the history of revolutions And seeing that a small effect Can have a huge qualitative transformation Upon a system We can understand how we can best use our forces We are going through a process Of artificial selection ourselves We are artificially selecting The most advanced workers and youth And bringing them together in a revolutionary organisation To overthrow capitalism So that when the moment comes We can decisively throw our small forces Onto the scales of history And tip it in a way that will transform The whole of human history decisively With the socialist transformation of society


for the next 40 minutes or so, I'm gonna be talking about voice controlled home automation in Ruby. So if you wanna follow along, you can go to this link that's cut off on the screen. Also on Twitter, I just tweeted out a link. So I've got all these slides are available on GitHub, also all the code I'm gonna be talking about and showing and talking over and through is available on my GitHub. So one thing for this talk, if you've got questions as I'm going along, please feel free to shout out, raise your hand, try to get my attention. So something comes up that I probably didn't explain very well, just grab my attention and we'll try to take questions as we go. So what this talk is, I've had a home side project that I've been working on, on and off over the last few years and what it is today, I've got a voice controlled television remote. So I use the Amazon Alexa and I'm able to control my TV with just my voice. So there's kind of two halves to this talk. First part, I'm gonna explain why and how I built a HTTP web based TV remote. Then the second part, we're gonna talk about the Amazon Echo, how it works, how to build your own skills for it and then how to more specifically build a skill to control the TV that I've got. In the end, we'll tie it all together and I'll show a little video of all this working in action. Quick introduction, I'm on Twitter, GitHub and I live and work in Chicago at a company called DRW where a principal trading firm offices in London, New York, Singapore, Montreal and Austin. Primarily, I write Ruby JavaScript enclosure but occasionally, like Monday, I find myself writing in programs like C. So all across the board in terms of technology staff. One quick warning before we begin. I know some people have hard feelings about JavaScript. There will be some JavaScript in this talk.  Okay, so let's jump in the time machine and go back to February 2014. Around this time, a lot of coworkers, programmer, friends of mine, were doing the DIY home automation thing. A lot of people were using Raspberry Pi's or Arduinos and so I decided I should probably have one of these, I don't know. So Raspberry Pi's a very small computer, takes up a very low amount of electricity. It's very inexpensive, $35 I think. And it runs Linux, so who would want an extra Linux server running in their apartment? But at the time I bought it, I had no idea what I was gonna do with it. Turned out it was a good purchase. So not long after that purchase, March 2014, I got an email from the apartment building I lived in at the time. The email said that everyone in the building had to upgrade to Tivo, upgrade their cable service. But the benefit of doing so would be a lower rate. So at the time, I lived in this crazy world where I didn't record TV. Mostly I watched live sports, so that was kind of okay. But in order to save money, I figured why not, I'll give this Tivo a big shot. So kind of life changing, can't believe I lived without it for so long. And of course, with great power, the power to record live TV, comes lots of buttons on a remote. So the remote picture down the lock is what I had before Tivo. And it's fine, it's a standard TV remote. Changed the channel, changed the volume, no big deal. One on the right, kind of the same, but there's like 20 extra buttons. I don't know, honestly to this day, some of these buttons I've never touched. You look above the one, two, three on the numpad, there's colored buttons here that say ABCB. I don't know what they do, I've never touched them. I don't think I ever will. I'm scared to find out what would happen if I actually didn't touch them. So I thought way too much about TV remotes when this crazy remote came into my life. And as a result of that, I tried the Tivo app. Now, meaning that it's gotten better, I don't know. Hopefully no one listening to this right now worked on this app, because I might say some not-nest things about it.  Only because it's so big, you can't actually press all the buttons without scrolling. So not only did I not like the remote in the first place, they wanted me to scroll around in order to use it. It didn't make a lot of sense to me. The other feature of this app, which was kinda cool, was a built-in TV guide with the remote buttons. So you can see what's on TV and then click it and get your TV to turn it, turn to that channel. That was cool, except for the whole scrolling and the app not catching any data. So anytime you scroll to see other channels, there's this long loading process that made it pretty much un-easeable. So I kinda wondered, maybe it's a better way. And the hacker in me started thinking, maybe I could run a man in the middle of tech or network traffic between the app on my phone and the Tivo device. Thankfully, I didn't go down that path too far. And I started Googling around. It turns out that Tivo has an API. So there's a TCP protocol for Tivo. Probably many of you have Tivos at home and had no idea this existed, that's why we're here. So basically, there's a setting you can turn on and it opens up a TCP board. You can connect up to it with a command line utility like NetGad, or yeah, and it's super easy. Tell that, not NetGad. And so you can just send commands. And basically anything you can do with the remote, you can tell your Tivo to do by sending a TCP command. What do the commands look like? It's basically a command, a space, and then a parameter. And it's all just asking characters. Super simple to play around with. So some example commands, there's the course CH command which changes your channel. You can do the teleport guide command which will bring up the TV guide on your screen. And if the command that's not really as cool as it sounds, teleport to live TV. So one thing to note about a Tivo controller is when you press the volume buttons, it's not communicating with the Tivo, it's actually communicating through the IR signal to your TV. So despite having all this power through the Tivo TCP protocol, I still needed a way to talk to my TV. Luckily, I had a sharp aquas which also has a TCP protocol. I think it's fairly unusual for TV manufacturers to include an API like this, but I was lucky enough that my TV actually had a protocol. So similar to the Tivo protocol, you cut the TCP socket and then you send commands and parameters. So in this case, there are four character length commands followed by four character length parameters. So you might have to add some spaces to make sure everything lines up right. But you can send a power command to turn on and off the TV, you can change the input, you can change the volume, you can also ask for the volume, which is useful so you know what the previous volume was and you can mute. So I can't really think of too many other things you wanna do with the TV. And obviously the Tivo stuff, you can do anything else with that. So at this point, as I'm discovering this stuff, remember it was still back three and a half years ago, I finally found a use for my Raspberry Pi. I could write a little web app that maintained a TCP connection to both my Tivo and my TV, and then there was HTTP-based TV remote. So that's exactly what I did. I grabbed Sinatra and I started writing some Ruby. So for the TCP connections, I decided to use an event machine connection. That machine's a library I'm familiar with and it plays nicely with Sinatra in order to have a nice, a bent model and it handles the TCP life cycle for you. So I can give the event machine connection a IP address and a port and then a connection class, which I'll show you in a second. I've got different classes for both the TV and the Tivo. And then the API, if you will, to my remote control is just a bunch of get commands. They're all gets, because that was kind of the simplest thing I could do. If I want to have to worry about using a post, it's easy to test from the command line in Perl. It's easy to test and use from the browser. So I've got the ability to change the volume up or down, set the volume to a specific number. I can meet the TV on mute, turn the power off. There's no power on button. I actually handle that when I change the channel, I sort of have this implied feature that if I'm changing the channel, I probably want the TV to be on and I probably want the input to be set to, in this case, one. And then the last command here at the bottom is kind of a pass through to Tivo. So I can kind of keep all that logic flexible outside of this little pass through. So I need command and value, I want to send to Tivo. I can do that at the slash Tivo command here at the bottom. So quick look at what the TCP connection classes look like. For the Tivo, it's really simple. When I receive data, I'm just gonna log it. Turns out the Tivo connection never really gives you anything too interesting. So I don't need to keep track of any state or do anything as a result of list of commands. Also, if you think about failure models here, if I press a button on a remote and it doesn't go to that channel, I'm just gonna press it again so I don't really care about air handling a whole bunch. It failed in a really good way. And then the second method here, one bind is called, the connection is lost and then I just want to do that to kind of keep all the state connected. The TV connection class is a little bit more complicated because of maintaining state of your volume. So if you think about any TV remote you've ever used, there's a volume up button and a volume down button. And they go in increments of one, one unit of volume, whatever that means. And the way the Sharp Aqua's TCP Pro all works is you have to set a number for the volume. And so in order to set a number, you have to know what the previous volume state was. So when the TCP socket opens, I start pulling the volume that's this send data command here. The reason I pulled for it is it turns out the Sharp Aqua's doesn't always expand. So I've learned over time that if I just pull for it I can second, eventually I'll figure out what the volume is and then when I go to increment it, it'll be able to take that volume from its current state and add one to it. And then to receive data method here, I'm ignoring data that's an error or an okay. And the only other data I get besides that is a number back and that's my volume. So I store that in the volume variable. If I unbind, I want to reconnect again. Down here at the bottom is the code to make sure I'm sending commands and parameters that are the right length and also maintaining the state of volume. So I've got the Smajra app, it's running on my Raspberry Pi and I built a little web app on top of that. So here's kind of what my TV remote looks like and it's great because I can pull it up on my phone, I can pull it up on my computer, let's say I'm at home sitting on the couch, searching the internet and I want to change the channel. Just open a tab in my browser, click a button, it's done. I don't have to reach for the remote, it's great. As you can see I've got a TV guide data in here. There are lots of places on the internet where you can get very accurate TV guide data. And so the other thing to note about this remote, there's no channel numbers, right? I don't care if it's CVS or 602, I just want to turn on CVS, why should I care about the numbers? So I got rid of numbers and just went with channel names. The other thing is it's very custom, with the nine or 10 channels on this picture are kind of the nine or 10 channels I tend to watch, usually the channel that shows boards. So it's also easy to make sort of customized special remotes for certain times of the year, so I don't know if there's any college basketball fans here, but in March, this is what my remote turns into. Four channels with all the games and I'll never lose track of which teams playing on which channel. So that's kind of the first half of this talk. And so now the second half we're gonna play around with the Amazon Echo. So first off, I have to apologize. I could not get this device to connect to the account that's locked by. So we're gonna go to plan B and I had some issues with this, so we'll see how it goes. The Amazon Alexa is set up so that even if you don't have an Amazon official device, you can actually use the underlying voice services. And so there's a website out there called EchoStone.io and if this lets you use Alexa, even if you don't have an Alexa device, so we're gonna try to use that in place of the Alexa itself. So just to begin, I wanna play around a little and see what this thing gives us. So we'll start with see if Alexa wants to tell us what your birthday is. Alexa, what's your birthday? My birthday is November 6th. Okay, so Alexa's got a little bit of personality. I think November 6th is probably the day that the device first went on sale. Let's try to find out what the weather is. Alexa, what's the weather for tomorrow? Here's the forecast for tomorrow in Angeberg. Look for mostly sunny weather with a high of 58 and a low of 36. So I don't know what city that actually is. What I was expecting to happen with the actual device is we would get the weather for Chicago and then I would tell you that we got the weather for Chicago because the device is programmed and set up to give us Chicago's weather. But let's see if we can get the New Orleans weather and it might be more interesting. Alexa, what's the weather in New Orleans? Currently, in New Orleans, Louisiana is 72 degrees with clear skies and sun. Today, you can expect partly sunny weather with a high of 74 degrees and a low of 57 degrees. Okay, beautiful day, I can't believe there's so many of you inside listening to me. Another thing that's kind of fun to play around with with Alexa is just sort of like random and trivia facts. I like to try to understand their algorithms and throw a random question to see what it knows, what it doesn't know. And I kind of think about we Google something and they give you that little box at the top that always has the exact right answer you're looking for. Those are the sorts of things that Alexa has had to be really good at answering. Alexa, who was the 23rd president? The 23rd US president was Benjamin Harrison. Okay, so Alexa got that one. And then another thing that I always end up doing, I'm watching a movie or a football game and I want to know like how old is that person? I don't know why I always had this question but it just always pops in my head and Alexa's great for that. Alexa, how old is Tom Brady? Tom Brady is 40 years old. All right. And then one more and then we'll move on with the talk. So Alexa, it's all a joke. What did the Buddha say to the hot dog winner? Make me one with everything. All right, so Alexa's full of interesting jokes. The last time I gave this talk, I got an engineering joke so that was great but not as good today. Okay, so a few facts about the echo. June 2015, they released the Alexa skills kit and what this did, it allowed anyone to write a skill for the Alexa. I think this was the first kind of mainstream popular voice service that released an SDK and I think that's one of the main drivers why the Alexa is sort of at the top of the food chain in terms of voice services compared to the Google home device and Siri. There's a lot of, there's over 25,000 published skills, over 15 million devices have been sold and just to give you a sense of some of the things that I use Alexa for, gotta put jeopardy every day. You get six or 12 questions depending on the day. Shopping list is really nice. Let's say I'm in the kitchen, I run out of the spice, I get to stream out, Alexa adds cinnamon to the shopping list. Then there's an app that goes with the device, I'll be in the grocery store, pull out the app and all those things I forgot I ran out of are just right there waiting for me.  Just stream out Alexa, set a timer for 15 minutes and you don't have to worry about it. The weather, another thing I ask it all the time and then finally, my favorite skill for the Alexa is control in 1988. So what is this thing? What is it actually doing? So this is a very high level overview, but the device sits there and it's waiting. It's waiting for the wake word which is Alexa. There's some other wake words you can set but Alexa's kind of the most popular one. And once it hears the wake word, it starts sending what it hears up to the Alexa voice service. So if you think about this web page that I've been using, it's not sitting listening to the wake word, I have to either click the microphone button or hold spacebar, but it does the same thing. Once it captures the audio that you say, it sends it kind of number two in this picture, sends it up to the Alexa voice service. So when it gets to the Alexa voice service, Amazon does this amazing trick where they figure out what it is you just said. So in this example I'm saying we call Pandora to play music. Pandora is what's called the invocation name on the skill. So Amazon figures out what that skill is looking for, what utterance is it called that it's looking for. In this case, keep playing music with the utterance. Then it takes all that information, turns it into a JSON message and sends it over to the skill server. Skill server does its thing, we're gonna dig into that in a minute, send the response back, then the voice service sends it back on for the voice and you hear music. So building a custom skill there's kind of two ways to do this. One is to use AWS Lambda. The other is you create your own self-posted web service. Basically you have to receive an HTTP post. And so there's kind of pros and cons, right? AWS Lambda, you don't have to manage the compute resources, you don't need to pass around the pass-as-sell certs. You get kind of all the Amazon building access control security. It's gonna be free for a long time on the free tier. However, you're limited to a couple of runtime environments, Java, C-sharp, Python, Java script. Notice I didn't say Ruby. So of course we're gonna figure out how to do run an AWS Lambda function. And so that's what we're gonna dig into. So first, I'll start with kind of a hello world of Amazon Alexa skills. So I just want Alexa, open the greeter. Hello Ruby conference, I'm glad this demo worked. All right, so I'm really glad that worked because I already had the texture not here. So this is the JavaScript account Solview. This is a AWS Lambda function that gets invoked through the Amazon Alexa. And it's pretty simple, this is just a hello world example, but the function that's invoked gets two arguments. The first one is your event object. It's kind of like the request object, all the information about what Amazon heard someone say. Second object is contact, which has a succeed method on it. So the simplest thing to possibly do is to just call that succeed with, in this case, the response and its output speech and then some text. And that is what Alexa will say after you respond. So pretty simple, hello world. And so now we're gonna figure out how to do that in Ruby and then eventually build up a language and build up a skill that actually does something a little more interesting than just saying it can't message. So using Ruby in Lambda, first step is you need a pre-compiled Ruby binary. The reason is, as I mentioned, there are only four available run times for AWS Lambda. So when you upload your Lambda function, you can upload a zip with really whatever you want. And then you can shell out from that JavaScript function and you can execute anything you want. Of course, it's gonna have to be able to execute on the platform where the Lambda function is actually running. So the Ruby binary I grabbed is that I didn't build it myself. There's a great product out there called Cable Ruby. It's got pre-compiled Ruby binaries for a number of different platforms. One platform is the Linux X8664 and that is what AWS Lambda runs in. So I could grab that Ruby binary and then shell out from that Lambda function to invoke a Ruby code and voila, I'm in Rubyland writing a Alexa scale. So then shell out, execute the Ruby, package up all the Ruby together with the JavaScript file, configure your Lambda function to execute that JavaScript which will then invoke the Ruby and all this you upload to S3 or do the Lambda web UI relatively straightforward to configure it all. So what does this look like? So now we've got our Ruby greeter. So let's do this one. Alexa, open the Ruby greeter. Hello from Ruby. All right, so we've got kind of split string code going on here. The top half is our JavaScript and all it's doing is in that Lambda function it's just exacting out to Ruby, running Ruby, running our color world.rb file and then passing a callback in and that callbacks in both when Ruby's not executing and then I'm able to access standard error from the Ruby process. I just part standard error as JSON and call context.succ.net. So the Ruby code here, pretty simple, this example, I'm just writing some, taking a Ruby cache, converting it to JSON and writing it to standard app. So that kind of ties everything together. You can imagine teaching that event object, the first argument to the Lambda function, turning that into a string and including that as an argument to the Ruby code and that's what the next example we walk through is gonna actually do. So now that we kind of have the very simple hello world example going we need to build a language for our skill in order to understand text. So I wanna be able to say, Alexa, tell the TV to turn on ESPN and I need to understand that I said ESPN and not the OC. So to do that, we need an interaction model and we can build a Alexa call to that in tolerances. So we're gonna go through an example of just having Alexa repeat what we say. So we can have a intent called repeat name and we're just gonna say T say blank and that blank is what's called a slot and we're gonna name it a name. And so we have an intent schema is something that you have to configure when building a skill. So there's one intent here, it's called repeat name and again it's got a slot and then I'm actually telling Amazon to expect a US first name. The more specific you are when building up your language with Amazon, the better it is at actually matching the speech of gears and giving you a text that makes sense on the other end. So what this looks like when you're building a skill, you've got the name for your skill in this case name repeater, the invocation name is here, it's just repeater in this case. Then you draw your intent schema in one of the boxes and also your tolerances get put there as well. So just a couple of steps and you're off and running. So let's try this out. Does anyone wanna throw out a name that we'll see if Alexa can understand? We might only get one part of that but we'll see. Alexa, tell the repeater to say Alexander Hamilton. I heard you say Hamilton. All right, so we only got the Hamilton and that's because we go back and look our utterance here is to say, and it's just expecting one word, had I put two words in there and we could have gotten both words back but it kind of just ignored that Alexander part and matched up on Hamilton. I don't know why I picked one versus the other but that's why we only got one word and not two. But that's okay. So looking at the Ruby code, this is the Ruby that runs being executed from the JavaScript Lambda function and I take the first argument to Ruby now is gonna be that event request object and I'm just going deep into that object to pull out the main value and then I'm plugging it in down here in the output speech in order to get a response back. So now that we can pull out words that I've said to Alexa, I need a way to get that information back to the Raspberry Pi sitting on my home network and I could have opened up a port to my home network but that seems very insecure and scary. So the way I solved this problem was by using AWS simple queue service, SQS for short. It's another Amazon service and it's just an easy way to pass messages from one place to another. So I can easily send a message with an HTTP guide or post. You can also use AWS SDK to do that and then the same deal I'm receiving that in AWS SDK. So receiving a message, this is code that is gonna run on the Raspberry Pi. I'm using the AWS SDK Young. Just configuring my key name and a couple parameters, wait time of 20 seconds. So it's kind of just doing a long pull all the time and then I print the message out to the bottom. So sending to a queue from Ruby in Lambda requires a couple things. So I can issue an HTTP guide or post to send a message to the queue. However, AWS has this kind of complicated process of signing one of those requests so you sign it in order for AWS to know you are and say you are, you have the right credentials to add a message to that queue, the message is new and not old. So the signing process is a little complicated and in order to help with that, you could pull in the AWS SDK. However, getting that done into Lambda would require some groups, so I kind of cheated. I found the simplest dependency I needed, which was the AWS SIGV4 Gen. That Gen has four files and no dependencies. So what I did was I grabbed those four files, I threw them in that zip-up package that I sent to Lambda and so now I've got the AWS SIGV4 and signed my messages to send them to SIGV4. So that's this big blob, send SIGV4 function, takes a key, a secret, and a queue. Those things I've configured through environment variables and then a message is what is the actual text I want to send to that SQS queue to hopefully get off the other end of my home network. So this function does all the signing, does a synchronous get request. I want to make sure I'm done sending to SQS before I move on and respond back to Alexa. So this code is gonna look pretty similar to the last example except for this one call, sending to SQS, I waited for that to finish, then I respond back to Alexa. So let's try this example. I'm going to run that RGCMe code here in super good font. I'm gonna start that, switch back over here. Alexa told the message sender to send Alexander Hamilton. I heard you say Hamilton. Okay, and there is Hamilton showed up from Lambda, from Ruby to SQS, right here to my laptop. All right, so now that we've got all that out of the way, it's time to actually build our TV language one part. So there's now more than just having a name repeating there's a bunch of things that I'm gonna wanna have, change channel, an off one, volume up, volume down, volume set, back, mute, unmute. You can imagine some other ones like fast forward, rewind, whatever you wanna do. Most of these are gonna be pretty straightforward, they're not gonna need any slots, but changing the channel, I've got a slot and also if I wanna set the volume to a specific number using an Amazon number type. So the channel slot type is a list of channels that's a custom made slot, what that looks like. It's just gonna be a list of all the words that are channel made that I'm hoping will help Amazon understand what I say.  I mean, it's very frustrating. So we've got our intents and then the utterances are the last piece and so you can have more than one utterance for an intents. And in fact, the more utterances you have, the better it is. For changing the channel, I've got one here, turn on, and then the channel, change to it on the channel. The more things you have, the easier it is on the user because the user doesn't have to remember the exact perfect specific language. It's a little more conversational, although not completely, the more things you have, the easier it is to use and the better chance it is that Amazon is gonna understand the speech that appears and turn it into the correct data to send to your skill. So we've got all these intents, utterances, so now the TV skill starts again, we've got our syntax.js function, then there's gonna be a lookup channel function. This is there in order to handle channel numbers if I want to just throw a number out there to be more specific or a new channel that I haven't figured yet. Otherwise, there's a little map to lookup channel name to number. So then I've got two half-geteer commands and responses. The commands are what I'm gonna send to SQS, and hopefully you'll remember those HTTP get-rocks from my Sinatra web app. We've been in this talk, they look a lot like those, so that's actually what I'm gonna send to SQS is like the ending portion of a URL. The responses are what Alexa's gonna say back, then I have a couple special cases if I'm setting the value to a number or changing the channel, I need to append the value number or the channel number to me and have both the command and the response. So then I send off SQS and I send the response back to Alexa, and so the final step is a little script that runs on the Raspberry Pi in a loop. I run my Ruby SQS go-snare, play the output of that into this XR scroll command, and that issues HTTP get to a local host the port I'm running my Sinatra server on, and at the end of that, I'm inserting what came back through SQS. So, time to take a look at this in action. Alexa, call the TV to turn on NBC. Changing the channel to 605. Alexa, call the TV to turn on WGN. Changing the channel to 609. Alexa, call the TV to set the volume to 24. Changing the volume to 24. Alexa, tell the TV to mute. Mute. Alexa, tell the TV to turn off. Now turning off the TV. All right, so there you have it, voice control commodimation using Ruby. There's a bunch of links on the last slide in this presentation that go into a lot more detail than I could in 40 minutes, but you can pull a lot of reference data for all the stuff, all the code that backed all these examples is on my GitHub. I think I'm just about out of time. I'll hang out for a while, so if you have more questions, I'll be around and I'll play answer them. Thank you.


THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Bruce Gachock Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet? Upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Caitlin Buckley Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet? Upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Chris Pyle Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz with sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet? Upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by David Lawrence Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet? As toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Florence Short Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet? As toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Garth Burton Regal the earth-scenes with diamonds today, jamming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet? As toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Gina Briggs Regal the earth-scenes with diamonds today, gleaming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet? As toiling life's road with wearying feet upward we strive, but failing so oft in struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem, this recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Graham Scott Cheltenham England GrahamScottAudio.com Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft? Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Julie Birks Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft? Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Julie Birks Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft? Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Kevin S. Regal the earth-scenes with diamonds today, gemming all nature in blazing array. The picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive, but failing so oft in the struggles that bear us a rite and a loft? Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Leanne Howlett Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet? Upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Larry Wilson Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet? Upward we strive, but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Mary Ann Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Phil Shemf Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by Tyrell Sorenson Regal the earth-scenes with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain. THE SLEET By Nanny Rebecca Glass Read for LibriVox.org by V. M. Nielson Regal the earth seems with diamonds today, gemming all nature in blazing array. A picture more fairy-like never could be than this wonderful icicle filigree.  Gorgeous and grand in the March sunlight. The Frost King magician has changed the spring showers to turquoise and topaz and sapphire bowers. And what is the lesson we learn from the sleet as toiling life's road with wearying feet upward we strive but failing so oft in the struggles that bear us a rite and a loft. Tis this, that the hard breath of winter's chill blast alone can this mantle of loveliness cast. And thus our sharp winds of trial may prove angels to weave us bright garments of love. End of poem This recording is in the public domain.


Hello again everybody, this is Keith at 30 Second Sci-Fi at the 50th Street Studios. Before I get started with this book review, I want to remind all of you that every Saturday at 10 a.m. Pacific we watch bad cartoons on the 50th Street Studio Twitch channel, and we have great fun. Please come. And at 6 p.m. Pacific every Saturday, we live stream excellent movies. So please visit this address, give us a follow at the Twitch channel over there, and see you then. Okay, now for this book review. It's called Teya of Oz. It's Book one of the Ozite cycle by Rebecca Demarest, a local author here in the Seattle area. I bought this from her at a convention. I Think two years ago. Yeah, I think it was two years ago.  It's only 35 pages long. It's a short story There are four chapters and chapter four is an epilogue. So there's really just three chapters and there's several Full page illustrations. So it's not even 35 pages. Anyway, the book as a whole is not one of my favorites the story is basically a Nancy Drew mystery Teya solves a mystery and It reads it's so short that it really reads like an Outline or a collection of ideas for a larger novel But the reason I'm telling you about it and the reason I'm reviewing it is because the starting premise Is something that that I've never forgotten. It's it stayed with me this whole time. Okay, here's the thing We are in Oz of course and it is generations later after Dorothy first appeared there. So basically today there are hundreds or maybe even thousands of Humans from the United States who are refugees in Oz Because as global warming is worsening all of the tornadoes and hurricanes are sweeping hapless mid-western Americans to Oz and There's a great difficulty among the various governments of Oz about what to do with them The Emerald City doesn't want them the Munchkins don't want them How do they house them? How do they feed them? And there's also a tremendous influx of artifacts the wreckage of homes and warehouses and all sorts of stuff from the human world that's resulted in kind of a black market trade in these Rare items that everybody in Oz wants Anyway, that's the starting point if you find that Intriguing and I kind of do even though the book ultimately Itself wasn't one of my favorites. The starting premise is so interesting and I wanted to recommend it to you. Okay. Thank you. See you next time Thank you for watching. Please become a sponsor follow the link on screen and in the description below Where you can make a monthly pledge or a one-time donation to help me Continue to make videos and please leave a comment. Let me know what you think give it a thumbs up thumbs down See you next time. Bye


What is going on guys welcome back to the channel and I appreciate you being here today I am back with another destiny to top five video and today we have top five epic gambit plays of the week But before we get into the video guys if you do enjoy it at the end leaving a like really helps out and I do I appreciate that support and if you have any amazing clip you want to get featured and share with a world Send it into the email. I just linked at the top of the video description. Let's get straight into this top five in At number five. We have a clip sent in by gunslinging hero using all his ass not to take Take him up you're invading make a mess Guardian down one minute remains Ten seconds you make this look easy In a number four we have a clip sent in by salty nighty Queen Five-page video is obvious. What happens here one down two for one Ten seconds left Guardian down invaders off the field three down We have a clip sent by a juggernauter one of those clips you think is all over, but wow what a comeback We have a clip sent by each gather at one point it's clear he gives up I mean looking at them primeval health bars.  We just want that so they got to be In a number one we have a clip sent in by stink. I actually don't know how this happened It was so close. It was more like a draw.  I can't yeah Why aren't they doing shit? I'll go over. All right It's about pieces about pieces about pieces.  Yeah, I'm dead.  Oh my god. Oh my god.  Oh my god. I'm recording that Holy crap, bro Holy crap But guys that is the end of this top five gambit plays if you enjoyed the video leaving a like really does help out If you are new around here and enjoy daily deaths in the two videos Be sure to subscribe and remember to submit any amazing clip you have to the email I've just linked at the top of the video description but guys. Thanks as always for stopping by and hopefully I will see you on that next one


Hey learners, I decided to try the jam thing in my bread machine today, and as you can see I put in about a cup of frozen fruit, just any frozen fruit you have on hand. Half a cup of sugar. I believe it was like a lemon. The juice of a lemon, and then half a packet of pectin that you buy from the store, and it just looks like this. And it's gotten really hot and started thawing the frozen fruit already. I will report back when it's all done and in my jars. Okay, so my jam is done, and I didn't make it very much. I filled half my jar. So maybe next time I would double this recipe, and I might actually use a little bit less pectin. It's a little jelly for my taste. But it worked, and I'm excited to see that I can use frozen fruit now for something else. Usually use it for cobblers, smoothies, but here we go. Jam. So stay tuned for more Awesome Lauren Learns videos to come this week. Don't forget to subscribe. Please, please, please tell your friends about this channel. It's been a really fun project, and I'm excited to share it with all of you. Subscribe, like, comment, and I will see you next time.