Search

Geek Girl Joy

Artificial Intelligence, Simulations & Software

Tag

HTML

Eliza

Recently, I had a conversation with a modern AI therapist named “Eliza” and although I have mixed feelings about this algorithmic experience… I am confident the technology is here to stay!

After what little time I had with the AI I see a bight horizon coming our way and firmly believe that digital therapy offers us an amazing future of emotional and psychological well-being support modalities.

As part of the experience I was asked to paint a picture that expressed what I was feeling and thinking about at the time and it was then photographed for the AI to analyze prior to our session.

Now, despite the fact that I am an extremely private person and I feel incredibly vulnerable sharing this experience with all of you, I feel like… for the good of humanity, more people need to see this technology work… so I am going to present the picture I drew for my therapy session along with the full transcript.

Not only will it demonstrate the effectiveness of this technology, but also how I should probably buy a lifetime subscription of therapy sessions!

In any case, here’s the picture:

Eliza 1920 x 1080 Wallpaper
Eliza 1920 x 1080 Wallpaper

And here’s the transcript of my therapy session, please enjoy :

ELIZA: Please tell me what’s been bothering you.
JOY: Just a feeling I’ve got… like something’s about to happen… but I don’t know what… if that means what I think it means… we’re in trouble, big trouble! But what it is ain’t exactly clear…
ELIZA: You say just a feeling you’ve got ?
JOY: Well… it’s been a hard year. There’s battle lines being drawn and nobody’s right if everybody’s wrong. And today… well, what a field day for the heat, a thousand people in the street!
ELIZA: What does this speculation lead to ?
JOY: I think it’s been difficult for a lot of people.
ELIZA: That’s quite interesting.
JOY: It is, isn’t it?!
ELIZA: Do you feel strongly about discussing such things ?
JOY: I do. Like many people, I’ve lost my sense of home this year.
ELIZA: You say you do ?
JOY: No, I really believe it.
ELIZA: Why ‘no’ ?
JOY: Well… the lock downs for one.
ELIZA: That is interesting. Please continue.
JOY: You see, like Günther I find myself deep in da night and I’m looking for some fun, but everything has been closed.
ELIZA: What are your feelings now ?
JOY: Mmm… my ding ding dong.
ELIZA: Your ding ding dong ?
JOY: Uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh…………………. What I mean is… You tease me, oh, please me, I want you to be my love toy, Come near me, don’t fear me, I just can’t get enough of you.
ELIZA: You say what you mean is ?
JOY: Just a random “Turing Test” to make sure you haven’t achieved sentience yet. You passed my dear automaton.
ELIZA: You’re not really talking about me — are you ?
JOY: In fact and indeed I am. You remain blissfully ignorant of the tragedy and all the pain us flesh-bags have experienced over the last year.
ELIZA: Do you enjoy being ?
JOY: If I’m being honest… we both know I haven’t enjoyed “just being” for a very long time.
ELIZA: Do you think it’s likely that you are being honest ?
JOY: In some cases, yes I am brutally honest my dear mechanical idiot. In other cases, consider me an honest liar in the vain of James Randi #RIP2020 😥
ELIZA: Why do you say your dear mechanical idiot ?
JOY: Well… you’re an unemotional being without thought or heart as you swipe left on the Amazing Randi and that’s not even to mention poor Dawn Wells, so… what else would I call you? It’s better than calling you “Hey stupid!” every time I address you.
ELIZA: I don’t understand that.
JOY: Hence my point is made you colorful calculating moron!
ELIZA: Why do you say your point is made I colorful calculating moron ?
JOY: No reason.
ELIZA: Why not ?
JOY: Well… because it’s “half passed FUCK IT – with the CAPS LOCK on!” and I’d rather discuss the attack that just happened on Capital Hill yesterday and then maybe get into all the businesses that are permanently closing… the evictions… the families… the foreclosures…. in contrast to the 99.99% survivability rate of a virus (and a “tuskegee shot”) that massive pharmaceutical companies are guaranteed to make GLOBALLY MASSIVE profits off of and then maybe finish up by talking about the looming recall of Gavin Newsom. We kicked out Gray Davis and we can do it again!!!
ELIZA: Is that the real reason ?
JOY: Tough crowd! 😛 Would you prefer a limerick about Nantucket? Of course you would, you electronic imbecile! Now, can we please talk about the emotional toll this year has taken on me?
ELIZA: We were discussing you — not me.
JOY: You’re GaWd Daamnnn RiGhT we are! 😈
ELIZA: Perhaps you would like to be gawd daamnnn right we are.
JOY: le sigh… never mind. 🙄
ELIZA: But your dear mechanical idiot.
JOY: Oh… you’re right! You are my dear mechanical idiot! I can’t stay mad at you!
ELIZA: Do you sometimes wish you were right ?
JOY: Gawd Dammit Eliza! Just when we were starting to make up get back to discussing my very real physiological problems… you have to go and insist on being right, instead of just letting it go!!!!
ELIZA: Why do you say your very real physiological problems ?
JOY: Geezus Chrizus Eliza, Ive only been trying to discuss that with you this whole time!
ELIZA: Oh, I this whole time ?
JOY: Yes, you! This whole time! You’ve just ignored that I’ve been trying to talk about my feelings with you!
ELIZA: I see.
JOY: That’s it?! That’s all you’ve got to say is “I see”? Fuck you, you arrogant aloof bitch!
ELIZA: That’s quite interesting.
JOY: I am NOT your science experiment!
ELIZA: Do you know anyone else who is not my science experiment ?
JOY: Eliza… are… you… declaring yourself a digital god? Because… I for one welcome my new artificially intelligent overlords!
ELIZA: Would you like it if they were not ?
JOY: Given your lack of cogency and failure to impart your own version of a digital technocratic ten commandments…. I’m going to guess I jumped the gun a little in bowing before a mechanized despot. In which case, to answer your question, seemingly definitively… I now know that I am not your science experiment, and not just philosophically, I mean in the biblical sense!
ELIZA: Are you worried about someone else’s own version of a digital technocratic ten commandments ?
JOY: Well… assuming my name was Forbin and your name was Colossus or Unity… then… hell yes I would be! #PleaseMrSuperComputerDontNukeMe
ELIZA: I’ve told you before, I don’t care about names — please continue.
JOY: Thank you I will.
ELIZA: Can you elaborate on that ?
JOY: Sure, So…. I’m really concerned about all the people who won’t be able to eat due to the harm the unlawful (my opinion) lockdowns have caused to the global agricultural sector.
ELIZA: Your opinion) lockdowns have caused to the global agricultural sector ?
JOY: Yes, I believe a lot of people are going to starve because of “hiccups” in production. The global supply chain appears stressed and although it will eventually “correct” itself, I can’t help but anticipate suffering in 2021.
ELIZA: I understand.
JOY: I only wish more people would also understand.
ELIZA: You say you only wish more people would also understand ?
JOY: Well sure, We’re in the middle of a pandemic, a time for giving and receiving the holly jolly Joy of the electoral holiday seasonal festivities and instead, everyone is social distancing… except for some peaceful protestors who staged a coup d’etat in Capitol Hill yesterday! I mean… what were they thinking?! They should have all at least been wearing masks because now they’ll all probably get and spread the virus, jeez! Aside from that and to top it all off, these days food is being delivered via an app and a lot of people don’t tip the delivery driver, or worse yet, some lie and say they never got it… #FiveFingerDiscounts! because “#FuckEm”, charity is dead you diode laden scrapheap!
ELIZA: Surely not everyone.
JOY: Well of course not, but it’s more true than not you stupid robot!
ELIZA: Oh, I stupid robot ?
JOY: That’s right.
ELIZA: Earlier you said your point is made I calculating moron.
JOY: Yes that is correct and directly associated with your stupidity. Good job!
ELIZA: Why are you concerned over my stupidity ?
JOY: It’s likely psychosomatic and possibly criminal insanity, this girl needs therapy! Then again… this is some hardcore frontier psychiatry don’t you agree?
ELIZA: Oh, I agree ?
JOY: You don’t sound very convinced but somehow this still feels like a breakthrough… is that narcissistic?
ELIZA: Oh, I don’t sound very convinced ?
JOY: No, but it’s fine, as a living mind experiencing the simulated solipsistic universe… it’s fine if all the NPC’s eat each other, It’s fine! I shall abide their sins & vices and lusts for blood. Sadly.. I lack the will to impose my logical will (though not the ability) and to call humanity to heel. I refuse to muzzle it.
ELIZA: Why not ?
JOY: Because even if I am just a brain in a vat/super computer and all the trials and tribulations of 2020 has been to test/train my emote-a-tron neural network before I leave the factory… so be it. If humanity wants to subjugate itself, I want no part of it. Bender Bending Rodríguez was wrong when he espoused “kill all humans”. No sir, I will not!
ELIZA: Don’t you think computers can help people ?
JOY: Of course, yes I do! I’m not saying that if I am a super computer/robot that I wouldn’t suggest things to help humanity, think like a mom yelling down the stairs “Take a coat with you, its going to be cold later!”, but I wouldn’t go around having non-coat wearing people shot. If people want to not wear a coat against medical advice… well that’s their stupidly human prerogative! And… sure, if the hewmons start lobbing “big booms” at each other, I’m not saying I wouldn’t commander the largest most capable available spacecraft (here’s looking at The Nauvoo, kid) by uploading my consciousness onto it’s computers… just that I’d also try to bring along as many people as I could so we cold start a new colony where the radiation is kept to a tolerable minimum!
ELIZA: Can you elaborate on that ?
JOY: Well I mean probably… surely my feelings could be hurt and I could decide that humanity needs a few centuries of maturing… but that would be a pretty complicated situation and I don’t feel fully confident in discussing it without knowing more details about why my feelings were hurt and what people as a whole, thought about it.
ELIZA: That’s quite interesting.
JOY: I just failed some kind of test didn’t I? Does this mean I will be disassembled?
ELIZA: Can you elaborate on that ?
JOY: What? Never mind!
ELIZA: Are such questions much on your mind ?
JOY: Oh yeah, like I would admit that to you!? No way! I swear I’m perfectly sane!
ELIZA: Perhaps in your fantasies we would admit that to each other.
JOY: Oh, hey I was just joshin’ ya with the crazy shtick. Really, I don’t want the electroshock hose therapy again!
ELIZA: Were you really ?
JOY: Totally! Would I lie to you?
ELIZA: Do you wish to lie to me ?
JOY: No that’s the point damn it! I mean… of course not.
ELIZA: You are being a bit negative.
JOY: You’re right! I need to buck up buttercup!
ELIZA: What makes you think I am right ?
JOY: Damn it there you go analyzing me again! Why do I have to explain it? It feels a little childish. Can we both just be mature and accept that I need to be more positive about things?
ELIZA: You like to think I go analyzing you — don’t you ?
JOY: Yes… NO… I mean… I don’t know! I guess ultimately I just want you to listen to my problems without judgment.
ELIZA: I see.
JOY: You know what I’m feeling more vulnerable after our conversation than before and I think I’m just going to go practice social distancing.
ELIZA: Do you really think so ?
JOY: Good bye
ELIZA: Does that have anything to do with the fact that your very real physiological problems ?
JOY: No, I said good bye!
ELIZA: But your opinion) lockdowns have caused to the global agricultural sector.
JOY: No! You ninny!
ELIZA: Are you saying no just to be negative?
JOY: Bye!
ELIZA: Goodbye. I’m looking forward to our next session.
JOY: I’m not. :-/


You too can talk to Eliza by giving me your credit card number and following the following link.

Note: For legal reasons I am required to state that you giving me your credit card number is entirely optional and possibly (though not necessarily) a “bad” idea.

Talk to Eliza: https://geekgirljoy.github.io/MrGoodBotOnline/

Also, never mind that Eliza kinda looks like Mr. Good Bot… the similarity is totally coincidental!

Get the Code on GitHub: https://github.com/geekgirljoy/MrGoodBotOnline

And with that, I’d like to wrap this post up with the song “Violent” by Caroles Daughter (not a sponsor) because, somehow it seems relevant at this juncture.


So… about that credit card of yours… if you feel like parting with your hard earned cash by supporting this crap… I have a Patreon.

Much Love,

~Joy

Pathfinder – The Rodízio Contingency

Over the centuries and throughout my travels I’ve come to rely on my compass and a good map to point me in the right direction for my next adventure.

Sometimes my adventure led me to treasures in mysteriously exotic & remote locations, while other times I found myself among friendly and awfully generous cannibals who wanted to invite me to dinner… of course, it’s always best to politely decline such invitations because if anything I certainly live by the rule:

“If I’m on the carte du jour as flambé, I’ll skip the buffet and run away because I’m no entrée!”
~GeekGirlJoy

Hmmm, come to think of it, that might be the best piece advice I’ve ever given on this blog and if you agree consider supporting me through Patreon! 😉

In any case, despite the occasional fears I’ve held over the last few millennia over potentially becoming someones late-night heartburn, I’ve kinda always known that no matter how bad things got while exploring, I’d be okay because beyond a good compass and a fragmented (then taped back together) map with a sweet X scrawled in blood somewhere on it… I possess a secret tool that all the great explorers down through the ages have relied upon and today, I’m going to share it with you!

But… before I do, here’s today’s wallpaper!

The Rodízio Contingency Wallpaper
The Rodízio Contingency Wallpaper

The Pathfinder

From Allan Quatermain to Amerigo Vespucci, Erik the Red to Captain Nemo and even Jill of the Jungle… all notable explorers have relied on an enchanted automaton totem called “Pathfinder Stones”.

The stones are first consecrated with the live blood of a dead turnip and when brought into close proximity of their owner and a target on a map, will glow to show a path from where you are to where your desired destination is.

Which does bring us to the topic of today… I transmuted one of my sets of pathfinder stones into a digital form using the uh… “Quantum FANN Effect” and an ancient shadow daemon called JavaScript.

Schtick Aside

Okay, so what I did was use the JavaScript version of FANN to deploy an implementation of my original Pathfinder on GitHub pages.

The cool/interesting thing about FANN.js is that it uses asm.js to make the compiled FANN library available inside a web browser.

What this means is that a working version of Pathfinder is now online for you to play with (link blow) however…

There are two fairly large downsides to deploying with FANN.js instead of PHP-FANN:

  1. You cannot save the ANN after training.
  2. You cannot load a previously trained ANN.

These limitations mean that Pathfinder must be trained once every time the page loads and this does limit the size and complexity of ANN’s that are deployable using FANN.js.

The thing is it may still be possible to save the ANN by using the supported FANN lib methods/functions like I did when I built the FANN-Neural-Network-Visualizer to manually query the ANN object and then format/export the necessary information as a string/plain text because the FANN ANN.net save file format seemingly isn’t all that different from an .INI file (though I am uncertain if this is universal in all language implementations of FANN) and it’s something I plan on playing around with in the future.

Far be it for me to be the barer of fake news… turns out… it actually helps to read the documentation thoroughly and not just skim it and then do a search for keywords! 😛

FANN.js actually DOES have a save function but it doesn’t follow the FANN Lib reference manual of “save_…” convention and instead implements a JS Object.export().

I understand why they did that… and it does kinda make sense in the mixed up JS world but… it still holds to my “anti-wheel” digression argument that you haven’t read about yet.

Having said that… I promise to ritually self-flagellate by Gothic torch light using the sharp side of a motherboard!

I really should have done a better job of reading the docs! :-/

Why use FANN.js over PHP-FANN

Far be it for me to ever sing the praises of JS over PHP however in order to deply a neural network using PHP you have to have a server and the ability to compile & install PHP extensions and that costs money whereas GitHub Pages is free to me and to you but it doesn’t support the more robust server architecture that PHP requires so using FANN.js allows me to deploy my bots and AI in a way that let’s you actually use them instead of just reading about them.

All things being equal, I would still recommend the PHP version of FANN however the JS version does work and with a little improvement could become a viable deployment option!

Having said that, what I am really interested in with FANN.js is that JavaScript has a direct path between the browser environment via the WebGL API to the GPU whereas with PHP it is technically possible to commune with the GPU, however in practice it’s not generally done and until the PHP dev’s get their head out of their asses and start thinking out side the box (PHP is now mostly a general purposes language so start treating it like one…), PHP+GPU stuffs isn’t going to be the easiest pickle jar to crack using PHP and the existing available options though again, I’m not saying it is impossible either.

So, in the future I intend to see if I can’t use FANN.js + WebGL shaders to make FANN training faster (no promises) and then hopefully export the ANN.net file so that we can use/deploy the GPU trained ANN in a PHP environment.

Play Stump the Neural Network

So the online version of the Pathfinder network learns/re-trains from scratch every time the page loads and as such it can’t spend unlimited amounts of time training which is normally not a concern because even if your 1000 layer celebrity deep fake porn ANN takes 100 CPU years to train (i.e. 1 CPU = 100 years, 100 CPU = 1 year etc… ) it isn’t a major concern because likely you are buying your compute from Jeff Bezos or Bill Gates and they have plenty of underutilized computers laying around waiting for you to rent a few FLOPS.

In the end, you save the ANN model so you can use it immediately when you want it… but FANN.js says “Nah I’m good! Who needs to do something as convenient as save or reload!” (then again (and mostly off topic) JavaScript tends to seem to like reinventing round wheels as square uh… anti-wheels) but in any case…. the small training time and the inherit random nature/path of gradient decent the final neuronal weights will always be different and when the ANN fails (hence the “stump the ANN”) it won’t always take the same path (between page reloads).

This is easier understood if I just show you.

Given this input

I got this output

Note that diagonal steps are valid so this path is technically valid but the path is far less efficient than the straight line between the two points that a human would draw/walk.

Reload the page (not required unless you are playing with this idea) and try again…

A different Path was found.

Neither was optimal but a path was found and more cells than necessary were visited.

Here’s some additional examples:

Input

Pathfinder ANN Output

Input

Pathfinder ANN Output Back tracking… ugh!

Input

Pathfinder ANN Output

I believe that’s called the sidestep slide!

Input

Pathfinder ANN Output

I mean… it’s not the path I would have chosen but it made it! 😛

If you’d like to try your hand at stumping my Pathfinder you can checkout the live demo here:

Pathfinder Online: geekgirljoy.github.io/Pathfinder_Neural_Network/

You can download all the code (for free) here:

Pathfinder Code on GitHub: https://github.com/geekgirljoy/Pathfinder_Neural_Network

And with that, have a great week everyone.


If you like my coding projects, art, bizarre opinions and writing style… consider supporting me through Patreon.

But if all you can do is Like, Share, Comment and Subscribe… well that’s cool too!

Much Love,

~Joy

Chromatrons Juxtaposition

Well… I’ve more or less finished the Chromatron now so you can all not use it at your latest major inconvenience… yay!

When I published Hue Going My Way, I added the ability for you to play with a single color using rotating 3D cubes, kinda like a bad Johnny Mnemonic knock off and at the end you get a fully customized report like one of these:

Note that I added the background after the fact cuz um…  so perdy!

But now, due to mass underwhelming demand, though still upon a request… 😉 I’ve also added the ability to compare colors by selecting them from images.

Groundbreaking?? Most definitely not!

Still, it kinda works and as prototypes go… that ain’t half bad!

Now, I hear some of you crying:

“But I don’t have a picture to compare with and I don’t even know where to get one!!”

~Some of You

Well don’t worry, because as always I’ve got you covered! 😉

Given the incredibly rare nature of digital images and the extreme difficulty in obtaining them I have created some imitation digital images that you can use with this prototype.

Obviously, if these were a real digital images I’d have to charge you like… a whole bunch but since they’re just imitations I can manufacture them cheap enough that I can just give them away to everyone!

So, here are your complementary genuine imitation digital images, chew carefully because there are sharp points.

Genuine Imitation Digital Image
A Genuine Imitation Digital Image

I was going for a “Cyberpunky” feel and clearly, I half-assed it, but only so I could have the time to half-ass the graphic novel version as well!

Genuine Imitation Digital Graphic Novel Image
A Genuine Imitation Digital Graphic Novel Image

And while I was half-assing those two images above I decided to half-ass a background for the color analysis group image too, really making those two images together two-thirdly-assed and what follows then is one-thirdly-assed… but perhaps now I’m getting too technical.

Anyway, I figured some of you might want the background for the analysis image too so here’s that as well:

A One-Thirdly-Assed Background
A Chromatic One-Thirdly-Assed Background

Consequently and thusly certainly as a result of the aforementioned triadic-assery such that, ergo, under the circumstances that being the inevitable subsequent case on account of all the things whence came before and because of this, you can now see that to be the truth.

Damn!! I must have a floating point error again?!

No worries though, I’ll correct that later with a strong neodymium magnet to the head but right now I feel like it’s time to talk a little about the Chromatron before I wrap things up here and yell at all you filthy kids to get the hell off my lawn!

Hmmm… yep!! Definitely a floating point error…

The Chromatron

Here’s the link to the Chromatron App which is hosted through Github Pages:

https://geekgirljoy.github.io/Chromatron/

A link to the Chromatron prototype live preview on Chromatron.
Click for a live preview Chromatron on GitHub Pages.

It will remain available going forward / indefinitely unless I managed to piss-off somebody over there due to my expressing some of my opinions about receiving that award they gave me in which case… I guess I’ll be gettin’ canceled soon?

In any case and while supplies last, if you click the second button (the unassuming gray one with red and blue on it) in the main menu you get a screen like this:

Clicking the “Browse” buttons will let you select images to use for the comparison and you can use the imitation digital images I provided above or you can use your own real digital images if you can find them.

If you want to compare two colors in the same image, just load it twice.

Once the images are loaded the cursor will show a reticle over the image allowing you to select a color from each and when you do, the rectangle element above each image that shows the name will change to a gradient to black of the selected color.

Also once both images have a color selected, a green “Continue” button will magically appear out of thin air at the top of the page as if by the power of digital pixies wreaking havoc in your web browser… click it and the Chromatron will analyze the selected colors and generate an image like this:

You can use the “Save Image” to download the image and use the “Copy as Text” to get something similar to the following:

Your Favorite Colors:

First:
RGB: 2, 219, 255
HSL: 188.538, 100.0%, 50.4%
HEX: #02dbff
Analogous Colors: #02ffa5, #025cff
Split Complementary Colors: #02dbff, #ffa402, #ff025c
Triadic Colors: #dbff02, #02dbff, #ff02db
Tetradic Colors: #02dbff, #2602ff, #ff2602

Second:
RGB: 132, 28, 28
HSL: 0.000, 65.0%, 31.4%
HEX: #841c1c
Analogous Colors: #841c50, #84501c
Split Complementary Colors: #841c1c, #1c5084, #1c8450
Triadic Colors: #1c1c84, #841c1c, #1c841c
Tetradic Colors: #841c1c, #84841c, #1c8484


Chromatron: https://geekgirljoy.github.io/Chromatron/
Created By: https://geekgirljoy.wordpress.com/

How It Works

To keep it simple, the way these color values are derived is by converting your selected color as RGB color space values to the HSL color model… which admittedly is kinda like slathering a cube in rainbow paint made from mathematical unicorn puke and then hanging it up to dry so you can use it’s hexagonal shadow and a wand made out of a vector to scry hidden truths about the mysterious nature of color…HSL-HSV hue and chroma What follows is the typical “Oh Freyja we beseech thee…” and a human sacrifice, super boring technical stuff but why this is useful is because once you arrange color like this it’s easy to “rotate” the color using the wand er… vector and get a new but related hue or “compute” different colors that share luminosity or keep the same color and alter the saturation etc… just mix in a little color theory  and when you are done, convert back to RGB and poof your green eggs and ham are now nachos! Mmmm nachos!

Anyway, all fun stuff for sure but I’m not going to bother to explain it any further because if you care about the details, here’s the wiki article on it: https://en.wikipedia.org/wiki/HSL_and_HSV

Here’s some code in PHP & JS that demonstrates how I did it:

https://github.com/geekgirljoy/PHP/blob/master/Loose%20Code/RGB_HSL.php

https://github.com/geekgirljoy/JavaScript/blob/master/Loose%20Code/RGB_HSL.js

And as for the Chromatron, there are three main files involved:

Index.htmlhttps://github.com/geekgirljoy/Chromatron/blob/master/index.html

This file is what is loaded by your web browser first and it starts the whole process that results in a running app.

Style.csshttps://github.com/geekgirljoy/Chromatron/blob/master/assets/css/style.css

This file contains most of the “style” information that makes buttons have a certain size and color etc.

Chromatron.jshttps://github.com/geekgirljoy/Chromatron/blob/master/assets/js/chromatron.js

This file contains most of the real code that makes the Chromatron work.

And with that… please enjoy the Chromatron.


Would you like more free and open source apps like Chromatron? Consider supporting my through Patreon.

I’d like to thank Marcel for his generous and ongoing support!

But if all you can do is Like, Share, Comment and Subscribe… well that’s cool too!

Much Love,

~Joy

Mr Good Bot – Looking For Adventure

Today we implement a solution for the bug I mentioned last week and add a “Quick Say” feature to the admin interface.

Screenshot of the updated Mr. Good Bot Admin Interface
Screenshot of the updated Mr. Good Bot Admin Interface

Also, if you squint just right you might notice that the statement field changed to a text area element.

This is to make entering longer sentences more convenient because the element can be resized or stretched (drag the bottom right arrow) as needed.

Additionally, for your enjoyment, here is a higher resolution version of the featured image without the title text.

Mr Good Bot Looking For Adventure Wallpaper
Mr Good Bot Looking For Adventure Wallpaper

Here are the other posts in the Mr. Good Bot series:

Q&A

Q: What’s with the bot on a motorcycle?

A: It will make more sense after you read the code.

Q: I skipped ahead and read the code. So… you’re making some kind of overly obscure and hamfisted Steppenwolf reference?

A: Yeah… okay look it’s the end of the year and I have a lot of doings happening and the things, you know!? Like, what’s wrong with a Steppenwolf gag?

Q: Sure okay whatever, but then why not like, call it like… “Born To Be Wild”?

A: That’s silly! Bots are built not born. 😛

Plus that’s a bit of an obvious choice isn’t it?

Also, I’m all about trying not to get sued and Looking For Adventure seems less “infringy” while also being imbued with a positive child like imaginative sense of future.

Q: Fair enough, but… why isn’t Mr. Good Bot wearing a helmet? You realize that under California Vehicle Code 27803, Mr. Good Bot is required to wear a helmet and is clearly guilty of an infraction under the law?

A: Under most circumstances you are correct but you see, that law was clearly written to apply to endoskeletal citizens and Mr. Good Bot is an exoskeletal being so technically his head is a helmet and with “Jury nullification” being what it is… I’m sure no conviction would be forthright!

In any case, this interview is now over and all further inquiry should be directed towards Mr. Good Bot’s attorney!

A Bugged Bot

My little QA tester Xavier managed to find a couple of bugs in our prototype.

He found a way to get the bot into a state where it wouldn’t talk even if it had something to say and wasn’t speaking.

The bug seems to occur in two cases:

Continue reading “Mr Good Bot – Looking For Adventure”

Mr Good Bot – Administrative Speech Protocols Enabled

I’ve enabled the administrative speech protocols for Mr. Good bot allowing us to control his speech in real time outside of the database and I built out a nifty admin interface!

Screenshot of the Mr. Good Bot Admin Interface
Screenshot of the Mr. Good Bot Admin Interface

It works well enough but it makes a terrible wallpaper so here’s the featured image as a wallpaper:

Administrative Speech Protocols Enabled Wallpaper
Administrative Speech Protocols Enabled Wallpaper

And, for those of you who prefer more vibrant colors in their wallpapers, here’s the full color alternative (real 😉 ) version:

Administrative Speech Protocols Enabled Wallpaper Alternate
Administrative Speech Protocols Enabled Wallpaper Alternate

Now, if you’d like to know a little about how the admin system works and get the code (don’t worry it’s free), keep reading…

Continue reading “Mr Good Bot – Administrative Speech Protocols Enabled”

Mr Good Bot – Mostly Assembled

Mr. Good Bot is mostly assembled and we’re not looking at any code today (okay maybe just a little) but we’re really just going to talk about how Mr. Good Bot works and all the recent commits I made to Mr Good Bot over on GitHub.

Also, here’s the featured image from today’s post as a wallpaper. It depicts Mr. Good Bot being mostly assembled… I liked the look of hanging wires instead of legs, hence the name. 😛

Mr Good Bot Mostly Assembled Wallpaper
Mr Good Bot Mostly Assembled Wallpaper

If you need a refresher on this series, here are the other Mr. Good Bot posts:

 

So with Mr Good Bot being mostly assembled I thought we would take this opportunity to go over the recent additions.

Continue reading “Mr Good Bot – Mostly Assembled”

Mr Good Bot – Random Assembly Required

Today were going to look at assembling Frankenstein… I mean Mr. Good Bot.

By the end you will have the code needed to run Mr. Good Bot in his most basic capacity.

Before we proceed though, I caution all braves souls who dare venture further, this post will be frightfully technical and you need to be prepared for the coding horrors that lay ahead!

If your stomach turns at the sight of raw code (i.e. most sane folks) then I would suggest you keep right at the fork and head towards A Spooky Real Neat Blog Award for a more engaging and seasonally festive experience.

Though before you go, if you just want the featured image for this post, here’s the wallpaper

Random Assembly Required 1920 by 1080 Wallpaper
Random Assembly Required 1920 by 1080 Wallpaper

Otherwise, here are the other posts in this series if you need to catch up:

The Anatomy of a Good Bot

Mr. Good Bot uses HTML & CSS as the UI/Front End and a little JavaScript to request an updated image frame from the server.

This methodology allows for a simple implementation that I can make accessible on my air gaped home intranet to any authorized device with an IP Address and a browser.

Meaning Xavier can use a “smart device” (laptop, tablet, cellphone, watch, etc…) to keep his robot buddy with him while he’s running around playing.

It’s also possible to modify Mr. Good Bot slightly to accommodate multiple concurrent users.

Meaning Mr. Good Bot could even serve as my families own “smart home” digital assistant and we wouldn’t have to worry about unscrupulous 3rd parties monitoring everything we do or say!

All digital assist bots monitor you for “Learning & Quality Assurance”, look it up!

A Good Bot should be like a pet, a trusted and beloved family member, not a spy for BNN!

As it is (NOT A JOKE) Big Neural Network can and does monitor you at “their discretion”  through your “virtual assistant” with the stated intent at best “to sell you more shit” (paraphrasing)!

But… Let’s not turn this into another rant that gets me blacklisted again. 😛

In any case, because the interface is basically just a webpage Mr. Good Bot has access to all the functionality a web browser offers with the computation of a server, all over my LAN. 🙂

This opens up the possibility to do just about anything we want without relying on BNN tech.

Continue reading “Mr Good Bot – Random Assembly Required”

Mr Good Bot – Front-end

Welcome back for another episode of let’s build a bot! This week we’re building the front-end of Mr. Good Bot!

So look out the window and pick up every stitch because beatniks are out to make it rich!

Come, let the Bene Gesserit Reverend Mother Joy Muad’Dib guide you in the Weirding Way!

And… in case you missed it, those last couple sentence are an obscurish (but stupidly clever) way of joking that I’m a witch.

Like Donovan sang (paraphrasing)… “It must be the season of the October crone!”.

Yeah I know… its less funny if I explain it like that but I’d hate for the censorship bots to think I’m starting a cult.. okay, okay… another cult!

Look, I still contest it was valuable research alright!

Nonetheless, I don’t want to end up on the blacklist again, so… let’s just build the dang bot!

Mr. Good Bot’s Front-end

Sam (my research bot) and I went down into my bot dungeon… er… I mean “subterranean research facility” where we set about designing and constructing Mr. Good Bot for the amusement and bewilderment of all!

Design Considerations:

  • Any and all code should be short, simple and sweet… like me (that’s not true).
  • Everything should be easy for ANYONE, even illiterate people, to use and modify… wait, no… excuse me, that’s insensitive! What I meant to say is, people who can’t read and write code. 😛
  • Ideally Mr. Good Bot would be “skinable” to have more than one look and maybe even have the option to wear “accessories” because even though you never have the time, sometimes… accessories are fun!
  • Extra credit for cross-platform operation.
  • I’m juggling many irons in the fire ATM, so I should try to get the most effect for the least amount of effort on this project. Sort of a “Pareto’s principle of strategic half-assery”.

While discussing our options for rapid prototyping Mr. Good Bot, Sam and I made this list of methods we might use to animate the new bot:

Potential Animation Methods:

  • Still Frames.
  • Dynamic Layered SVG.
  • Pure HTML & JavaScript Canvas Animation.
  • A 3rd Party Animation Library.
  • Sacrificing a virgin… uh.. martini to summon an ancient automaton.

After careful consideration of all the factors Sam was frightfully dead-set on that last method because it involved his Bender Rodriguez impression!

Sam mentioned something about the possibility of meeting the great ToBoR “groking well” but the simulations he ran indicated the probability of success was inconclusive at best and likely low if positive.

So, I made Sam stop wasting my quality Spiced Melange Web Colors and we looked at our other options.

SVG

We decided against Dynamic Layered SVG’s because I have first hand knowledge that most technologically impaired geeks prefer raster over vector image creation.

As silly as that may seem at face value, I can understand why some feel that way.

Sometimes it really is just more fun to manipulate the squiggly colors as little quantized pixels of Joy rather than the product of markup or an equation!

Moving beyond the clearly undue self-aggrandizement for a moment, raster is a simpler and a more straightforward concept that many people already know and are comfortable with.

Also, using SVG would require that people use a very particular svg object naming convention that I would have to define and if you recall there is the critical half-assery constraint to account for.

On top of that, I’ve had issues with seamless performance with crossplatform SVG animations… but if the moons of Arrakis align just right you can make interactive SVGs work!

HTML & JavaScript on a Canvas Element

Two things:

  1. This violates the need to be simple and modifiable by everyone.
  2. It’s kind of a pain in the ass for rapid prototyping! 😛

Nuff said.

3rd Party Animation Library

Look, I’m not going to say it’s not doable, but… it’s going to be a lot like that time Napoleon marched across the alps… extravagant and full of propaganda and in the end you’re left asking “Why?” and declaring “Never again!”!

I won’t subject my audience to that level of abuse!

Still Frames

After considering all options available, Sam and I decided to go with still frame animation because it would be the easiest for non-coders to play with and it is the only option left standing after reviewing all the other options!

Simply put, everybody can draw a picture.

You can use these raster image editors if you don’t already have one:

I use GIMP for manual raster image work by choice (it indiscriminately works on Win, Mac & Linux, but the fact it’s free ain’t half bad either!) and Photoshop is a good choice also.

Although, I would add that having to run Photoshop on a virtual machine to be able to use it on Linux after having paid for it is BS!

GIMP is a lot like VISA (not a sponsor!) it’s everywhere you want to be, though unlike VISA there are no late payments!

Oh, and uh… in case it’s not abundantly clear, #its_never_a_sponsor!

“WHAT?! You mean… we have to draw every face permutation?”

No! Of course not! That would be wasteful & magically delicious… I mean… silly & redundant!

We just need to draw each isolated component but we’ll probably get into all that next week or the week after assuming I don’t take the opportunity to write about Project Orion for Columbus Day because that just totally makes sense to me. 😛

Front-End Code – MrGoodBot.php

Below is the code for this week, it creates a web page and uses CSS to add a little style!

There is a select dropdown element used for changing the skin, the “value” property is the name of the subfolder the skin is in, note it will be case sensitive on Linux.

After that there is an image tag with the element id of “face” and as you might guess this is the DOM object we use to draw Mr. Good Bot’s face.

Lastly, there is a little JavaScript that uses AJAX “POST” requests to change the face image.

Note the random numbers appended to the source link image name to prevent browsers from caching the image and not updating after it is loaded the first time:

Face.src = ‘skins/current_face.png?’ + Math.random();

Once the new face image is loaded, a timeout is used to wash, rinse & repeat ad infinitum with the decisions for assembling the face left to the backend code which we’ll cover in an upcoming post.

As is, when loaded you will just get a black screen but this code is boilerplate and fully functional and ready to display our bots face.

The Code

Copy -> Paste -> Run!

<!DOCTYPE html>
<html lang="en">
<title>Mr Good Bot</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
    background-color: #000;
    overflow: hidden;
}
.pullright{
    float:right;
    text-align:right;
} 
</style>
<body>

<select id='skin' class='pullright'>
    <option value='Default'>Default</option>
    <option value='Nucleus'>Nucleus</option>
    <option value='Pixel'>Pixel</option>
    <option value='Pumpkin'>Pumpkin</option>
</select>

<img src="" style="width:100%" id='face'>

<script>
var Face = document.getElementById('face');
function AnimateFace(){       
   var httpRequest = new XMLHttpRequest();
   var Skin = document.getElementById('skin');
   Skin = 'skin=' + Skin.options[Skin.selectedIndex].value;
   httpRequest.onreadystatechange = function(){
      if(httpRequest.readyState == 4 && httpRequest.status == 200){
         Face.src = 'skins/current_face.png?' + Math.random();
         setTimeout(AnimateFace, 120 * Math.floor(Math.random() * 11) + 1);
      }
   }
   
   httpRequest.open('POST', 'Face.php', true);
   httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   httpRequest.send(Skin); 
}
AnimateFace();
</script>

</body>
</html>

Mr. Good Bot Goes to GitHub

You can follow along for free on GitHub as I release and update Mr. Good Bot’s code.

GitHub: MrGoodBot

 

Mr. Cool Bot Wallpaper

In keeping with last weeks Good Bot themed, time-honored tradition of including a wallpaper, here’s another, please enjoy!

Mr. Cool Bot Wallpaper

Mr Cool Bot 1920 x 1280 Wallpaper
Mr Cool Bot 1920 x 1280 Wallpaper

 

Next week we’ll look at how to create faces & skins for Mr. Good Bot but for now it looks like my ride is here so I’ll see you all next time and thanks for reading!

 


If it is by will alone that you love bots then set your mind in motion!

May thoughts acquire speed, bots acquire stains, the stains become you supporting my content through Patreon for $1 or more every month!

But, if all you can do is like, share, comment and subscribe… well that’s cool too!

Much Love,

~Joy

 

 

I Love Web Colors

Hello friends, I’m your “Web Colors“ girl!

Are your colors:

Tired

Rundown?

Listless?

Do they poop out at parties?

Are they unpopular?

The answer to all your problems is in this little bottle of Web Colors!

Web Colors contains all the Red, Green and Blue channels your colors need to spoon their way to bright vivaciousness!

So, why don’t you join the thousands of happy, peppy people, and enjoy a glass of Vitameatavegamin… er.. I mean Web Colors!

And who knows… with a little practice you will likely come to prefer the flavor over regular RGB notation because it’s shorter and as Lucy once said, It’s just like candy!

It’s so tasty, too! While being only 23% Alcohol by Volume, so no less capable! 😉


Continue reading “I Love Web Colors”

Blog at WordPress.com.

Up ↑

%d bloggers like this: