Search

Geek Girl Joy

Artificial Intelligence, Simulations & Software

Tag

GitHub

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

Carousel of Color

Somewhat recently I was speaking with a certain cherry-blossom who lives on a far away tropical island where strange pocket sized monsters roam freely.

The little cherry-blossom knew that when she finally bloomed she would wear the most beautiful shade of pink the islanders had ever seen!

However, she hasn’t yet figured out what exact shade of pink to dye her petals.

Now, I thought about how I could help the little bud by running a simulation or training an artificially intelligent color bot, but I just couldn’t think of anything that could surpass a “color wall of swatches” / a gradient with some color channel plus/minus toggle buttons/sliders.

What I mean is, consider how one of Quentin Tarantino’s more bizarre characters does color:

How GIMP does color
How GIMP does color

At first glance it might seem a little intimidating but just a click on a gradient or an adjustment to a slider conveniently labeled for their RGB color channel and you can easily find just about any color you are looking for!

You can even type in a number between 0 – 255 in any of the fields or even cooler still, you can change the hex color “HTML notation” and it will change the RGB color values for you.

Don’t worry so much about the LCh sliders, they stand for Hue, Chroma & Lumanance (not in that order 😛 ) and they are a somewhat more advanced color space model that you need not concern yourself with unless you are curious, but almost everyone kinda grasps the RGB color model since most of us learn it as children so it will probably be easier for most people to use those.

The thing is, this is really unsatisfying as a recommendation to give the blossom because that’s more of a technical tool than a fun app to help you find your favorite petal color.

Now… as I said I am unsure if I can improve that process, however I am willing to take crack at simplifying it!

But, me being the one duck short of a full box of quacker jacks that I am, I couldn’t bring myself to post the simple HTML RGB color picker prototype I assembled because… it just came off as so… BASIC!

As such, I resolved to challenge myself to build a better prototype!

But I needed a set of project goals & design principles…

Prototype Goals
  • Functional enough to help the cherry-blossom find her favorite pink.
  • Challenge the blossom to find her color using the prototype.
  • Display relevant info at the end like… the RGB values, the hex color code and what the name of the closest color with a name is.
  • Simple enough that anyone could use it without being overwhelming.
  • Even though it’s just a prototype, epic mega geek points if I can do it in 3D.
  • Bonus points if I can make it run on mobile and desktop.
  • Additional bonus points will be awarded for unnecessary (but tasteful) skeuomorphic ornamentation and chromatic theatrics.

These seem like lofty goals but I am confident that I can achieve at lease a few of them because I have already started building this prototype. 😛

I’m calling it Chroma-tron and although it’s far from finished (or even functional), I am hosting the code online using GitHub Pages (not a sponsor but I do have a free account) where you can see a live demo:

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

Currently it just spins and highlights the sections of the conic color model your mouse is over but the idea is that as I update the code on GitHub you will be able to follow along by previewing the updates live allowing you to see what has changed, though due to my schedule I cannot guarantee I will update the project daily but I will try to work on it as frequently as I can.

Here’s three bits of trivia about the Chromatron prototype:

  • There are 48 different colors on the “Carousel of Color”.
  • Each color does have a name.
  • When we’re finished, our prototype will be capable of representing about 16,581,375 different colors.

One other bit of information is that if this prototype works out well, I will use similar techniques to build a 3D version of my FANN Neural Network Visualizer and depending on how successful I am and how much trouble it is, we might even be able to watch the ANN “think” in real time 3D but I still have much experimentation before we get there, anyway lets talk about a wallpaper.

Wallpaper

Sadly, no wallpaper today because I’ve been super busy and haven’t had the time to finger paint something nice for you but that won’t always be the case. As a condolence prize you win a fully 3D animated rotating conic color model to enjoy instead! 😛

Also, if you just want the featured image, here you go:

The lines in the image remind me of iron filings in a magnetic field. 😛

And before I forget, here’s a link to the Chromatron prototype that you can revisit from time to time to see updates to the app.

Chromatron on GitHub Pages: https://geekgirljoy.github.io/Chromatron/

You can get the code in the GitHub repo.

Chromatron on GitHub: https://github.com/geekgirljoy/Chromatron

Anyway, I’m going to be kind to myself and keep today’s post short. 😛

Feel free to make suggestions about the app if you want to. 🙂


All my content is sponsored by my patrons over on Patreon who help make free software, art and tech tutorials possible.

Today I would like to thank Marcel for their generous ongoing support but as I always say, if all you can do is like share comment and subscribe, well… that’s cool too! 😉

Much Love,

~Joy

My Transcendent Badge

So… it’s no secret that I haven’t been posting lately which has more to do with minor health problems, no it wasn’t the C or the T viruses, more than anything else it’s mostly been me just letting life get in the way of my propagandist hobby!

And before we begin I would just like to say that I am saddened to hear about electrical engineer/mythbuster/roboticist Grant Imahara’s death. 😦

But setting that sad news aside, I started working today by checking the comments on my blog to clear out all the spam and one shining gem stood out among the crowd of coprolite.

One spammer put in just that little extra bit of effort to troll me about not posting and it’s so perfectly executed I just have to share it, though I’m not exceedingly stupid so I’m going to remove the phishing link (NEVER click the phishing links!!!).

The spammer trolled on:

“Reliable postings. Regards. home loans”

Note that the “home loans” part was the phishing link.

This level of attention to detail could possibly mean that it came from My Dear Spammer Creep but it’s not quite their style… in any case, I do feel such exquisite warmth and love from the community of spammer trolls who have clearly taken up permanent residence near my blog!

Also of note, though changing topics, is I recently got the chance to consult with a friend on some PHP code, and he claims I “saved him some time”/”he owes me a soda!!”.

Personally, I think I probably should have suggested using the existing “rest” function rather than writing a separate security token “auth” function but I guess that’s what missing too much sleep will do to you!

I only hope that the duct tape holds well enough to muffle all the screams!

Anyway, during my unannounced hiatus I was awarded a “badge” on GitHub, which was an unexpected surprise! 🙂

I didn’t even know GitHub had badges! 😛

But, if you’re gonna receive one, this one seems like a mildly interesting one to get!

It’s called the “Arctic Code Vault Contributor” merit badge / award thingie.

The “Arctic Code Vault” is a backup of “all of its (GitHub’s) public open source code” which means it is a little like a “participation trophy” so I guess I shouldn’t be too smug about it even though I do feel a little twinge of the o’l narcissism flaring up!

What it means is that some of my code was deemed moderately useful enough by someone, who isn’t myself, a friend or family, to be preserved for at least 1000 years in a secure, remote underground nuclear hardened facility as insurance against the unfortunate event of, (cough)… “Total Atomic Annihilation” for you know… posterity sake.

Actually, it’s not a half bad idea because IF “world leaders” decide to start a nuclear war and obliterate modern society and there are survivors… they can rise from the stone age when they reacquire the information and technology contained within the cache.

Think Vault-Tech “Prepared for the Future!” but “real” and without the evil experiments… hopefully!

I imagine in a thousand years someone will crack that sucker open and Joan Wilder/Jack T. Colton blow the dust off of El Corazón and uncover my code.. oh, uh… and everyone else’s too and review it as like a digital time capsule. Indiana Jones will probably go along just to make sure things stay above board!

I will say that It is kinda nice to know that something I’ve done will be preserved at least as far as 1000 years into the future, even if it’s not me personally surviving cryogenically preserved like Walt Disney in the vault until 3020ish, though now I’m having an idiocracy flash back! 😛

And not to be resting on my laurels or anything but… sure seems like I can now die with the greatest sense of accomplishment knowing that no matter what happens going forward in this nihilistic universe we all live and do other things in, my name and accomplishments will certainly outlast EVERYTHING, most if not all of you, will EVER do!

#GameOverIWin 😛

Granted, that shouldn’t stop all of you from trying to beat my score, but let’s be honest… that’s hard to do and your ass feels pretty warm and comfy right where it is!

Also, it amuses me to no end because some programmers look at PHP code like a cockroach (for only somewhat valid reasons), but now thanks to me (oh and the archivists too I guess)… like a cockroach,  PHP is going to survive global nuclear fallout and it could even become the technological bedrock that all “future code” is derived from!

Just think of it, PHP 10,000 AD…

Now that’s a VR experience I’d pay to play!

Here’s the thing though, if I’m being totally honest, I always expected that this blog would be the thing of mine that would be archived and preserved (probably by law enforcement but possibly also by historians) to enlighten the future masses… at the very least so future generations could study my bizarre ramblings for wisdom and insights into inferior primitive human physiology, if not my physical brain as well!

Oops, my narcissist is showing again, thought I tucked that in.

In any case, it’s notable that the subterranean vault/bunker that my code is being stored in is like right next to the “Svalbard Global Seed Vault” which is essentially the same thing but with seeds for foods and textile crops and probably like trees and grass and some flowers and stuff.

Anyway… most likely, almost everyone will eventually get one badge or another on GitHub which means badges could become some kind of “status symbol” that quadfurcates the coding community into “the haves” and “the have nots” vs “the wants” and “the want nots”.

And sure, they give you the option of not displaying them but even the choice of not displaying them is just information that will feed back into the primitive gamified online social interaction mechanisms of hominids in 2020, yielding more stratification when the more radical members of the “the want nots” group argue that “badges” are “inherently divisive” and possibly even “evil” due to the discord (not the app) they cause and the more centrist “the haves”+”the wants” will say they are just jealous and “the have nots”+”the wants” will sympathetically agree while “the haves”+”the want nots” will empathetically not give a damn leaning towards possibly agreeing with the more radical faction of the “the want nots”!

But see, the quadchotomy isn’t so simple because the choice to NOT show a badge “says something” just as much as the inverse and opposite, which might be “the opt-in to participate/receive an accolade”+”the choice to display it” (as opposed to being forced to have to receive and display it) and of course we can’t forget the “NULL results” where despite active participation (willful or not), some folks just wont get any!

Making this a quintchotomy? Hmmm… actually, it’s starting to feel more like an octochotomy but likely that’s just me over analyzing things again. 😛

I simply do not have the time and energy to parse the complex tree resulting from such a model of human interaction but I’ll tell you this, what it feels like is a drug and a dealer!

Of course we all know the first few badges are free but uh… once you need the poison you’re addicted and you’ll do anything for the yummy reinforcing taste of that sweet “social feedback”!

This Could Be You!:

It hurts real bad man! I’m Jonsin’ here! I just need a little LIKE to hold me over till I write my next post or publish my next script on GitHub so I can earn another badge!”

It could only be a matter of time before they roll out “the paid subscription shiny badges”!

Oh its “totally cosmetic” but WE ALL KNOW the “shiny badges” get all the cool “extra perks” that are fundamentally NOT cosmetic!

Ha! What about the mostly intangibles?!

Like, after receiving the “Arctic Code Vault Contributor” badge, I’ve noticed a totally undeserved non-insignificant bump in the appreciable average annual starting salary for the job offers I receive via email… oh uh… not that I’m complaining though! 😛

So, multiply that effect by a factor of paid badges like “Professional Hoopajooper” & “Expert in Foo’Barification” (I happen to be both), which of course would only be accessible behind a paywall because “there’s a test and we TOTALLY verify all the blah blah…” (I’m having CompTIA A+ flashbacks here), that establishes that you are an #AOkayNumber1SuperCoder or you know… whatever the thing is and as a result of the fact that those badges could become “status symbols” of being “qualified/elite” they could also become hiring markers that indicate “fitness” for employment!

“We WOULD hire you BUT… you’re not a member of the “Green Check Mark Badge” group on GitHub and in our experience, check mark members are simply the bestest best!”

Now… despite my serious concerns over a gamified scifi apocalyptic future where digital badges are as good as or better than currency and are counterfeited en masse in back alleys and in old boarded up warehouses the world over… after much thought and deliberation, though not wishing to feed the zeitgeist and also genuinely not wishing to throw my lot in with the more radical faction of the “the want nots”… I have decided follow the path of least resistance and leave the badge displayed on My GitHub page because in the end, it takes more effort than I care to exert to disable it and then have to defend that decision.

And… if you think about it, it is kind of a cute little asterisk / literal special snowflake badge thingie… or maybe… an  “arctic north star”?

I’m not really sure actually and in any case, my thoughts keep returning to the phrase…

“The first one is free…”

The whole thing feels a little Skinnarian or possibly Pavlovian, and its hard to say if the bell rings therefore I salivate, or if I salivate so therefore I ring the bell?!

Though this will compute…

if ($badges == $carrots){

$Joy->IsStillUncertainOf(‘What the stick might be’);

}

Certainly such things are above my pay grade and would likely mean I’d have to find someway to break the fourth wall and view the universe from the perspective of the simulation creators looking in… on the other hand… that might just be me being solipsistic again!

Anyway, my source code says I owe you all a wallpaper.

A Transcendent Space Girl Wallpaper

So… today’s wallpaper is inspired in part by the Code Vault award and by the background image in the video or Kotovsky86’s – Space Traveller:

I love the image of the girl with the alien sky background with her sort of scifi “designer canvas” look.

I imagine that she isn’t actually on that planet, it’s an animated digital wallpaper that lines the walls of the corridor she’s in.

She arrived a little earlier than her water ice hauling contract required and her Orion was securely moored with the docking pylon.

She crossed the airlock in the mooring tether to board the station while the bots offload the ice and a few dozen tons of food and industrial supplies.

First stop is of course the system famous Atomic Spacer’s bar and grill, best grub you’ll find 800 million miles from earth! Their name and slogan are probably a little on the nose but they sell Florps and that’s good enough for everyone!

The lights and colors in the bar make it seem like a familiar future. Just sitting there you’d never even know you were millions of miles from earth.

As she sat down,  a notification from corporate about a bonus of 75 Kryptos being deposited into her digital wallet displayed the top right corner of her gamified Kiroshi contact lenses hud.

The company likes it when you make them look good to their customers.

She received another notification that an “Early Bird” badge was added to her permanent record.

She mentally swiped left on both and brought up the news feed from Earth while she waited for the robot to come take her order…

“In other news… Ms. Crystalline Actinide from the Global Archivists Guild tweeted today that the 2019 Arctic Code Vault time capsule has finally been opened after 1000 years and archeologist computer scientists are reviewing the code now…”

As the broadcast continues, for one brief nanosecond, my name flashes across the video feed in her contact lenses and at that moment, centuries long past my death, I will step forward in time and transcended my death, even if is just for a blink of an eye!

My Transcendent Badge Wallpaper
My Transcendent Badge Wallpaper

If you are wondering, yes I have a Patreon, if not, no worries!

Much Love,

~Joy

 

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

 

 

Lets build an Auto Coding GIT Commit Bot

My friend Oliver approached me recently with an idea for a project that we could both work on together and after he explained the basic premise I was on board!

The initial concept was wouldn’t it be fun to have a bot that could publish your git commits for you? Which of course the only correct answer is “HELL YEAH!”!

Oliver, built a prototype and then had the great idea of using a Raspberry Pi to act as a sort of “Auto Commit Robot” and to test his newly minted bot he modified it to create randomly generated files to commit, and that’s when it hit us… There was a bigger story here…

One of the first uses for the bot we considered was the the idea that although most employers are reasonable and will look at the quality of your code, there are still some that look at how frequently you commit as a large indicator of how ‘driven’ or ‘voracious’ of a programmer you are, which if you think about it makes absolutely no sense at all!

So Oliver suggested, what if you were to just commit the random text he was generating to a private repo but have your commit data publicly available on your GitHub account, this would allow you to push commits every day (or at least on a schedule) and establish a history of regularly pushing commits which is exactly what he built! When he publishes his half of this project I will link to it here.

I highly recommend when it’s published that you head over to read his post and give it a like too! He’s also really nice so feel free to leave him a comment as well, I am sure he would appreciate it! 😉

Now this is where I come in. My portion of this project stems from the fact that not everyone has a Raspberry Pi (or Linux machine since for this purpose they are basically are one in the same) lying around and also not everyone pays GitHub to maintain private repos, so a lot of people are just using GitHub to store free public repositories.

So, my challenge is to turn his bot into a cross platform solution so that it also works with public repos because anyone looking past just the number of commits would discover the ruse of randomly generated data.

So I modified my scenario a little bit so that my challenge was clearer.

Consider the following: It’s the the new year and you are looking to “get a head start on commits”… or maybe you have a bet with a friend that you can make more commits to your GitHub than they can between now and next month… or maybe you just want to watch the Stock Market fall… Whatever the reason is you decide that you happen to need an auto commit bot…

Once I had a scenario I knew that in order to solve this challenge the data that Oliver’s bot was pushing to the repo had to pass a basic “visual test” ( if not a run test ) even if the results of the code was useless.

With that in mind I set to work designing my methodology.

    1. First, I make the following assumption… ANY line of code that is capable of passing an eval() MUST be good because it “runs” so if I can generate the code segments and make it look like real code (more or less) even if it essentially does nothing, well it’s that much harder to question the validity of the commit, isn’t it?
    2. Further, use shell_exec() to execute the git commands in a cross-platform way.

I could hypothetically generate unit tests using the ASSERT function (thinking in PHP here 😛 ) if I wanted to go that route, though I’ll leave that for you to add to your own implementation!

  1. In any case I set to work coding generate-functions-example.php

    generate-functions-example.php

     


<?php 


function RandomString($length) {		
    $output = '';
    $alphabet = 'abcdefghijklmnopqrstuvwxyz';
    $alphabet_length = strlen($alphabet);

    for ($i = 0; $i <  $length; $i++) {
        $output .= $alphabet[mt_rand(0, $alphabet_length - 1)];
    }
	
	return $output;
}


function SelectLanguageFunction($param) {		
	$output = '';
	$action = mt_rand(0, 38);
	
	// abs
	 if($action == 0){
		$output .= 'abs(' . $param . ')';
	 }
	 // acos
	elseif($action == 1){
		$output .= 'acos(' . $param . ')';
	 } 
	 // acosh
	elseif($action == 2){
		$output .= 'acosh(' . $param . ')';
	 }
	 // asin
	elseif($action == 3){
		$output .= 'asin(' . $param . ')';
	 }
	 // asinh
	elseif($action == 4){
		$output .= 'asinh(' . $param . ')';
	 }
	  // atan
	elseif($action == 5){
		$output .= 'atan(' . $param. ')';
	 }
	 // atan2
	elseif($action == 6){
		$output .= 'atan2(' . $param . ', ' . "($param + " . mt_rand(3, 7) . ')  * pi())';
	 }
	 // atan
	elseif($action == 7){
		$output .= 'atan(' . $param . ')';
	 }
	 // atanh
	elseif($action == 8){
		$output .= 'atanh(' . $param . ')';
	 }
	 // bindec
	elseif($action == 9){
		$output .= 'bindec(' . $param . ')';
	 }
	 // ceil
	elseif($action == 10){
		$output .= 'ceil(' . $param . ')';
	 }
	 // cos
	elseif($action == 11){
		$output .= 'cos(' . $param . ')';
	 }
	 // cosh
	elseif($action == 12){
		$output .= 'cosh(' . $param . ')';
	 }
	 // decbin
	elseif($action == 13){
		$output .= 'decbin(' . $param . ')';
	 }
	 // dechex
	elseif($action == 14){
		$output .= 'dechex(' . $param . ')';
	 }
	 // decoct
	elseif($action == 15){
		$output .= 'decoct(' . $param . ')';
	 }
	 // deg2rad
	elseif($action == 16){
		$output .= 'decoct(' . $param . ')';
	 }
	 // exp
	elseif($action == 17){
		$output .= 'exp(' . $param . ')';
	 }
	 // expm1
	elseif($action == 18){
		$output .= 'expm1(' . $param . ')';
	 }
	 // floor
	elseif($action == 19){
		$output .= 'floor(' . $param . ')';
	 }
	 // fmod
	elseif($action == 20){
		$output .= 'fmod(' . $param . ', 0)';
	 }
	 // hexdec
	elseif($action == 21){
		$output .= 'hexdec(' . $param . ')';
	 }
	 // hypot
	elseif($action == 22){
		$output .= 'hypot(' . $param . ', ' . $param . ' * 2)';
	 }
	  // is_finite
	elseif($action == 23){
		$output .= 'is_finite(' . $param . ')';
	 }
	  // is_infinite
	elseif($action == 24){
		$output .= 'is_infinite(' . $param . ')';
	 }
	 // is_nan
	elseif($action == 25){
		$output .= 'is_nan(' . $param . ')';
	 }
	 // log10
	elseif($action == 26){
		$output .= 'log10(' . $param . ')';
	 }
	 // log1p
	elseif($action == 27){
		$output .= 'log1p(' . $param . ')';
	 }
	 // log
	elseif($action == 28){
		$output .= 'log(' . $param . ')';
	 }
	 // max
	elseif($action == 29){
		$output .= 'max(' . $param . ')';
	 }
	 // min
	elseif($action == 30){
		$output .= 'min(' . $param . ')';
	 }
	 // octdec
	elseif($action == 31){
		$output .= 'octdec(' . $param . ')';
	 }
	 // pow
	 elseif($action == 32){
		$output .= 'pow(' . $param . ',' . mt_rand(2, 7) . ')';
	 }
	 // rad2deg
	 elseif($action == 33){
		$output .= 'rad2deg(' . $param . ')';
	 }
	 // round
	 elseif($action == 34){
		$output .= 'round(' . $param . ')';
	 }
	 // sin
	 elseif($action == 34){
		$output .= 'sin(' . $param . ')';
	 }
	 // sinh
	 elseif($action == 35){
		$output .= 'sinh(' . $param . ')';
	 }
	 // sqrt
	 elseif($action == 36){
		$output .= 'sqrt(' . $param . ')';
	 }
	 // tan
	 elseif($action == 37){
		$output .= 'tan(' . $param . ')';
	 }
	 // tanh
	 elseif($action == 38){
		$output .= 'tanh(' . $param . ')';
	 }
	 return $output;		 
}


function SelectOpperation() {
	$action = mt_rand(0, 5);
	
	// Addition + 
	 if($action == 0){
		 return '+';
	 }
	// Subtraction -
	elseif($action == 1){
		 return '-';
	 }
	// Multiplication *
	elseif($action == 2){
		 return '*';
	 }
	// Division /
	elseif($action == 3){
		 return '/';
	 }
	// Modulus %
	elseif($action == 4){
		 return '%';
	 }
	// Exponentiation **
	elseif($action == 5){
		 return '**';
	 }
}




function GenerateRandomFunction() {	
	
	// name the function
    $function_name = ucfirst(RandomString(mt_rand(2, 7)));

	// how many parameters should the function take?
	$number_of_parameters = mt_rand(1, 3);
	$parameters = array();
	for ($i = 0; $i < $number_of_parameters; $i++) {
		 $param_name = RandomString(mt_rand(2, 5));
		 $parameters[] = "$$param_name";
    }
	
	// build function comment
	$funk_header = '/**' . PHP_EOL; // open comment
	$funk_header .= ' * Does Something' . PHP_EOL;  // function description
	$funk_header .= ' *' . PHP_EOL; 
	foreach($parameters as $parameter){
		$funk_header .= ' * @param ' . $parameter . ' Add Description' . PHP_EOL; // parameter description
	}
	$funk_header .= ' *' . PHP_EOL; 
	$funk_header .= ' */' . PHP_EOL;  // close comment
		
	// build function
	$funk = 'function ' . $function_name . '(' . implode(', ', $parameters) . '){ ' . PHP_EOL;
	
	// do something with the parameters
	$funk .= str_repeat(' ', 4) . 'return ';
	foreach( $parameters as $key=>$parameter){
		$funk .= SelectLanguageFunction($parameter); // do something with the parameters
		if($key < $number_of_parameters - 1){
			$funk .= ' '. SelectOpperation() .' '; // add opperation
		}
	}
	$funk .= ';'; // add semicolon

	// build end of function
	$funk .= PHP_EOL . '}' . PHP_EOL . PHP_EOL;
	
	return  $funk_header . $funk;
}
/////////////////////////////////////////////


$number_of_files = 10; // how many files to generate

// create the files
for($f = 1; $f <= $number_of_files; $f++)
{
	$file = fopen('functions/' . RandomString(mt_rand(3, 7)) . '.php','w');
	fwrite($file, '<?php' .  PHP_EOL);
	for($i = 0; $i < mt_rand(3, 17); $i++){
		fwrite($file, GenerateRandomFunction() . PHP_EOL);
	}
	fclose($file);
}

This code could be simplified by making use of arrays of language functions rather than hard coding them as if/else statements however I’ll leave that for you to implement if you want.

If you run this code the you will get 10 PHP files that contain a random number of functions (that will eval()) in a sub-folder called ‘functions’ and each function will have it’s own comment header that lists the parameters and included a place for a description of the function and the parameters.

At first glance the generated code appears complicated and useful, here is an example function generated:

/**
 * Does Something
 *
 * @param $cl Add Description
 * @param $jw Add Description
 * @param $qobwa Add Description
 *
 */
function Icbekz($cl, $jw, $qobwa){ 
    return atan($cl) + hypot($jw, $jw * 2) ** atan2($qobwa, ($qobwa + 3)  * pi());
}

You could use this function like this:


echo Icbekz(4.3, 7.1, 22);

With the resulting output being: 3.470139188433

Of course this works but the output is essentially useless except for exactly what we want it for, generating functional non-sense code!

At this point whatever you set the $number_of_files variable to is how many new files you will get in the functions folder every time the script is run.

Schedule this PHP script to run on a Linux machine using a Chron Job or on a Mac using a Scheduled Job or Windows using Scheduled Task so that it runs weekly, daily or even hourly depending on your needs.

Now all we need is a cross platform script to use GIT to upload the new files to your repo once the other script is complete.

update-repo.php

// !IMPORTANT! Manually Pull/Create your repo before using this script 

// This script assumes that you keep your repos in your 
// user folder in a folder called repos.
// Adjust the $local_path variable as needed
$repo_name = 'test';
$local_path = '$HOME'."/repos/$repo_name/"; // linux & mac path example
// $local_path = "%userprofile%\repos\$repo_name"; // win path example
////////////////////////////////////////////////////////////////////////////////////
/// Put anything you want to occur before the push here.
////////////////////////////////////////////////////////////////////////////////////

// comment this line after the script has run once
// it updates the config file for the repo to tell git to store the
// credentials after you enter them once
shell_exec("cd $local_path;git config credential.helper store");

// Pull Repo
shell_exec("cd $local_path;git pull");

// THE FIRST TIME THIS SCRIPT RUNS YOU WILL BE PROMPTED
// TO MANUALLY ENTER CREDENTIALS HERE.

// Add all new files
shell_exec("cd $local_path;git add *");

// Push new data
shell_exec("cd $local_path;git push origin master");

///////////////////////////////////////////////////////////////////////////////////
/// Put anything you want to occur after the push here.
///////////////////////////////////////////////////////////////////////////////////

Schedule this Script to run after the generator and all the newly generated code will be pushed to your GitHub repo on a regular interval! 😉

You can find this project on my GitHub account for free here: Auto Commit Bot

I have also created a version that will generate complete class files and you can see examples of the output on my GitHub in the classes subfolder for this project. All of my $1 or greater supporters on Patreon can download a copy of this project that includes the Class Generator.

Don’t forget to follow my up-to-date & ongoing research over on my public BookmarkNinja tab!

With that, everyone have a great day and I will see you all in my next post.

Much Love,

~Joy

Create a free website or blog at WordPress.com.

Up ↑