Spotify and PHP

Just took a look at the two repos of PHP classes/wrappers for the Spotify Web API. I was very surprised — also simultaneously disappointed and delighted — they were so small and did so little. Perhaps that’s unfair — I suppose they’re just fine for the types of apps I see people create using the Spotify API … nothing like what I’m working on.

So, cool, yeah … I get to make it all my own from scratch. Awesomeness.

Posted in PHP, Spotify | Leave a comment

Choosing a Specialty

Okay, I’m choosing PHP which I know isn’t hot or sexy but I have a few reasons.

  • It’s always been easy to understand
  • It’s always been easy to write
  • Learning new things has been easy
  • I’ve made more progress with it than JavaScript and Python
  • Unlike the JavaScript ecosystem, I don’t have to learn ten trillion new things to complete the smallest task
  • Unlike Python and Angular, for example, upgrading to the latest hasn’t made me want to cry and punch myself in the face
  • OH MY GOSH, these two:
  • Great books and authors are easy to spot & find and they age well
  • Active local PHP Meetup
  • That active local PHP Meetup is hosted by SourceToad — the company what’s gonna hire me and I will hug them and pet them and call them George.
    • Subhead/Sidebar: Their clients and projects make my mouth water and, as Meat Loaf would say, well … let’s keep this family friendly.
  • Not only is the web app I’m making primarily PHP but the coolest features/scripts I haven’t even started on are based on it.

So, once the current project is completed or in a state of rest, I’ll go back to the Spotify thing and try it in PHP (first it was Python, then JavaScript — learned a lot using both but never got it to the finish line).

Posted in PHP | Leave a comment

File Uploading Madness

The web app on which I’m working will include (sorry for the passive voice) a page for the user to upload an “observation.” As of last week, this small form included:

  • Two menus (Case, Action) from which the user selects … you could think of them as categories or tags
  • A text field to contain a description of the observation
  • Radio buttons that basically state if there are pictures available to support the text that aren’t uploaded (I thought the initial version would be just for text)
  • A submit button

insertObserveSevereCropNoFileInput.png

I came across a tutorial or two showing how “easy” it was to incorporate a file upload button. So I wrote that code and proceeded to test:

  1. It didn’t work
  2. I modified the code
  3. I tested again
  4. Lather, rinse, repeat

After spending hours removing everything (security, etc.) except the bare-bones script to upload the file, and re-testing the form over and over again, I suddenly noticed the Case menu was missing.

So I thought I’d spent hours trying to fix something that wasn’t broken (which happens frequently) because of something I’d never expect. Of course the form wasn’t working, one of the fields wasn’t contributing anything to the query.

Bit o’ Sidebar: Something you need to know is I often struggle with Dreamweaver’s FTP — I often have to close and reopen Dreamweaver to get it working again or use my host’s browser-based upload thingy. But if I’ve closed Dreamweaver and have to reopen it to do some editing so the FTP is “fresh” I’ll use that.

Now my pattern became removing or moving or rewriting the file-upload code, uploading the file to see if made a difference, and so on … based on a couple tutorials I’d found, I thought it was Bootstrap causing this either/or situation — I could either see the Case menu or have the file-upload button, but not both.

Eventually, I realized something even weirder … uploading my PHP file using Dreamweaver, the menu wouldn’t display. Uploading it via the browser, it finally did. Unfortunately for me, just by coincidence (sort of), whenever I put the file-upload field in, I was using the browser to upload my PHP file so the Case menu would appear but when I put the code back in, I was using Dreamweaver so there was a correlation but the cause wasn’t the code, the cause was, somehow, Dreamweaver although I have no explanation for that. Seems stupid but so did the other problem or two.

I still can’t get the file upload to work but at least I can see all the pieces that may or may not be broken.

I kept thinking I should just build a page that just uploads a file with nothing else to see if it would work but I kept thinking, “No, this is a simple problem, any second now, I’ll find the solution … building something from scratch would waste too much time.” Meanwhile, I waste hours … this happens far too often.

So now I’m taking the four best tutorials and I’m going to create each of those things from scratch with none of my code-baggage and see what happens.

Posted in Frustration | Leave a comment

Well, Fudge

After spending a good part of the weekend with my 12-year-old daughter (who loves baking and making truffles) beginning work on a new app for Amazon‘s Alexa to assist cooks with their inventory, shopping, and cooking, I was excited and optimistic not only about the app but the quality time with my daughter — we already spend time cooking and learning to code. This morning, I was most interested in a new article on Forbes — An Honest Review of Google Home and Amazon’s Alexa by Jay McGregor.

Until I saw that piece of shizzle write this:

“the kitchen aide that I assumed Home would be is less sous chef and more trainee irritant … What would be helpful is if it automatically added said ingredients to your shopping list.”

Thanks, douchebag, for inspiring countless others to become our instant competition. Competition without the constraints of “Father/daughter who can dev when they’re done with school, work, other family activities, homework, etc.”

Two thoughts:

  • If I see McGregor on the street, he’s getting punched in the face
  • Now, we’ll be extra motivated to make sure ours is not only awesome but vastly superior to all those coming before us because I’ll be damned if I’m giving up on this idea and crushing my daughter’s (or my) entrepreneurial and creative spirit.

Normally, I would be loathe to write about such a project here, but since this pile of putrid penises already told the world what a great idea it would be, I may as well.

Posted in myProjects | 3 Comments

Been Busy

Been concentrating on my new mobile app for the Private Investigation Firm (for whom I made the awesome Acro JS app) and it’s going really well. Been learning a lot about PHP, SQL and security shizzle for both. Normally, when I stop to write on the blog it’s to post something I learned about a problem I encounter or have solved. Things have been moving along quite well, though.

Except for this one thing.

  • Everything to do with users logging in is fine
  • Sessions regarding the above works great
  • Form for creating users works great
  • Security for the above works great — includes some salt and hash

But I need a form so users can have their information updated — assigning them cases, in particular — so I create that basic form based on the “create” form (and the “edit president” form from an earlier project) which meant it starts off with the same fields — including password.

I wondered what to do about that password field. I hadn’t yet thought much about the code behind, say, resetting passwords or even entering it to confirm other changes … I wondered what would happen if you didn’t enter anything … so I did that … because I’m impatient and sometimes do stupid things.

And locked myself out of my own app.

I can’t just go into the database and change my password because of the salt and hash sprinkled in via the “create user” form and expected by the “log in” form.

Fortunately, I’d created a second user for future testing. Unfortunately, it seems I wrote the password down incorrectly.

So now I have to go in and comment out security and session-related stuff temporarily so I can create a new, usable user or two.

This isn’t even frustrating — just embarrassing.

Posted in myLearning, myProgress | Leave a comment

I Have A Friend

I’m sure this little Easter egg has been around for a while, but I just noticed it.

friend.png

Posted in Humor | Tagged | Leave a comment

Fascinated By File Size

I am fascinated by file size. For example, the significant difference between printing to PDF versus saving as PDF using the exact same settings. Or saving the same word processing document as PDF with the same settings from MS Word vs Libre Office. Saving a JPG as a Photoshop PDF vs creating a PDF from the JPG using Acrobat Pro.

Anyway, this just happened: Client asked for one change in the video I produced. Whenever the word “bleach” appeared in on-screen text, they wanted it to be bold and red. The word bleach appeared three times. The formatting change resulted in the following file size change:

  • Before: 6.78 MB
  • After: 6.82 MB

Now you have something to discuss at parties. You’re welcome.

Posted in Video | Leave a comment