Languages

The machines we love to hate

Moderator: Wiz Feinberg

Post Reply
User avatar
b0b
Posts: 29108
Joined: 4 Aug 1998 11:00 pm
Location: Cloverdale, CA, USA
Contact:

Languages

Post by b0b »

I've been doing some web programming lately, and it got me thinking. When I did my first web site, I just had to learn one language - HTML - and it was pretty straightforward. Today, you basically need to know 5 different, unique programming languages:
  1. HTML - to structure the content of the page
  2. CSS - to control the appearance of the page
  3. JavaScript - to interact with the reader on his "device"
  4. PHP (or Java, Python, Ruby, etc.) - to generate the page on the server
  5. mySQL - to interact with a database on the server
Darn, this is complicated! :?

What a difference 25 years makes. :lol:
-𝕓𝕆𝕓- (admin) - Robert P. Lee - Recordings - Breathe - D6th - Video
User avatar
Jim Fogle
Posts: 1086
Joined: 23 Jul 2019 9:47 am
Location: North Carolina, Winston-Salem, USA
Contact:

Post by Jim Fogle »

Darn bOb, 🤨

How about English so you can read and write the posts!

😷
Remembering Harold Fogle (1945-1999) Pedal Steel Player
Dell laptop Win 10, i3, 8GB, 480GB
2023 BiaB UltraPlus PAK
Cakewalk by Bandlab Computer DAW
Zoom MRS-8 8 Track Hardware DAW
User avatar
Wiz Feinberg
Posts: 6091
Joined: 8 Jan 1999 1:01 am
Location: Mid-Michigan, USA
Contact:

Post by Wiz Feinberg »

Yep to all of those technologies. Same here. And I thought learning Spanish was complicated! Not compared to some web and computer languages.

Here's a fer instance of something I did earlier today.

The problem:
Bingbot was misindexing my blog articles. It left off the actual folder where the blog is published, resulting in hundreds of 404 Not Found errors. This is hilarious since it was trying to index files it already knows exist! It just had the wrong starting paths.

Solution:
Experiment in a test folder on the server until I figure out the right codes to redirect the bot up one directory. It took me quite a while to get it right: 15 minutes.

RedirectMatch 301 ^/(\d{4})/(\d{2})/(.*) /FOLDERNAME/$1/$2/$3

This simple application of Regular Expressions inside a 301 permanent redirect rule solved the problem and is now letting this misguided search engine verify the existence of the articles it was looking for in the wrong place. Anybody could do this, right?

To some, this may look like black magic from the Dark Web. In reality it is just a normal web programming language called Regular Expressions, wrapped inside what is known as a "redirect directive," inside a special control file known as .htaccess
"Wiz" Feinberg, Moderator SGF Computers Forum
Security Consultant
Twitter: @Wizcrafts
Main web pages: Wiztunes Steel Guitar website | Wiz's Security Blog | My Webmaster Services | Wiz's Security Blog
User avatar
Fred Treece
Posts: 3920
Joined: 29 Dec 2015 3:15 pm
Location: California, USA

Post by Fred Treece »

Funny, I was just reading about Google employees today, and what they actually do at work. They have to know all those languages you mentioned, b0b, plus they have to have an aptitude for “abstract math”. And the kicker —- “We are looking for a certain personality type” —- without actually explaining what that personality type is. On a different website, an employee described some of the daily routine an $80k Google guy can expect, which included a trip to their own coffee bar and a mid morning YouTube session watching panda bears do forward rolls.
User avatar
Richard Sinkler
Posts: 17067
Joined: 15 Aug 1998 12:01 am
Location: aka: Rusty Strings -- Missoula, Montana

Post by Richard Sinkler »

Fred Treece wrote:Funny, I was just reading about Google employees today, and what they actually do at work. They have to know all those languages you mentioned, b0b, plus they have to have an aptitude for “abstract math”. And the kicker —- “We are looking for a certain personality type” —- without actually explaining what that personality type is. On a different website, an employee described some of the daily routine an $80k Google guy can expect, which included a trip to their own coffee bar and a mid morning YouTube session watching panda bears do forward rolls.
Don't underestimate the value of pandas doing forward rolls. 🐼 😉
Carter D10 8p/8k, Dekley S10 3p/4k C6 setup,Regal RD40 Dobro, NV400, NV112 . Playing for 53 years and still counting.
Steven Schwartz
Posts: 46
Joined: 19 Sep 2020 5:37 pm
Location: Longview Washington, USA

Post by Steven Schwartz »

This newbie to the steel world has programmed computers since 1971.

I still have nightmares about using PHP 15 years ago. I am so glad I am retired.

Thanks b0b for all you do. Every time I see your name "b0b" I smile inside. It's one of the coolest geekiest names I know. Btw, that is a complement.

Thank you for maintaining this website.
User avatar
b0b
Posts: 29108
Joined: 4 Aug 1998 11:00 pm
Location: Cloverdale, CA, USA
Contact:

Post by b0b »

Regular expressions {{{{shudder}}}}. I never learned that language, but it's all over the place the phpBB code. I recently had to decipher this line, a mix of PHP and regex:

Code: Select all

$sig = ($sig_bbcode_uid != '') ? preg_replace("/:(([a-z0-9]+:)?)$sig_bbcode_uid(=|\])/si", '\\3', $userdata['user_sig']) : $userdata['user_sig'];
I now understand what it does, but I still don't know what the '\\3' actually means. Wiz?
-𝕓𝕆𝕓- (admin) - Robert P. Lee - Recordings - Breathe - D6th - Video
User avatar
Wiz Feinberg
Posts: 6091
Joined: 8 Jan 1999 1:01 am
Location: Mid-Michigan, USA
Contact:

Post by Wiz Feinberg »

b0b wrote:Regular expressions {{{{shudder}}}}. I never learned that language, but it's all over the place the phpBB code. I recently had to decipher this line, a mix of PHP and regex:

Code: Select all

$sig = ($sig_bbcode_uid != '') ? preg_replace("/:(([a-z0-9]+:)?)$sig_bbcode_uid(=|\])/si", '\\3', $userdata['user_sig']) : $userdata['user_sig'];
I now understand what it does, but I still don't know what the '\\3' actually means. Wiz?
b0b;
I'd only be guessing what the \\3 means. Because it is quoted and separated from the other expressions by commas, it is part of an equation and is a variable, or represents a variable's position.

As a RegEx, a backslash is used to escape a literal. The literal is probably \3. The additional backslash escapes that identifier. It might indicate 3 items in a line of input to keep the RegEx engine from continuing processing forever.

The entire expression deals with User ID and a Signature existing or not existing.
"Wiz" Feinberg, Moderator SGF Computers Forum
Security Consultant
Twitter: @Wizcrafts
Main web pages: Wiztunes Steel Guitar website | Wiz's Security Blog | My Webmaster Services | Wiz's Security Blog
User avatar
b0b
Posts: 29108
Joined: 4 Aug 1998 11:00 pm
Location: Cloverdale, CA, USA
Contact:

Post by b0b »

The lack of comments in phpBB code really irks me sometimes. Someone once told me, "When you solve a problem with a regular expression, you end with two problems - the original one and the regular expression."
-𝕓𝕆𝕓- (admin) - Robert P. Lee - Recordings - Breathe - D6th - Video
User avatar
Ian Rae
Posts: 5826
Joined: 10 Oct 2013 11:49 am
Location: Redditch, England
Contact:

Post by Ian Rae »

In the late 60s I learned Fortran so I could make punched cards. The actual computer was in another city.

I have shown no interest since.
Make sleeping dogs tell the truth!
Homebuilt keyless U12 7x5, Excel keyless U12 8x8, Williams keyless U12 7x8, Telonics rack and 15" cabs
Bill McCloskey
Posts: 6877
Joined: 5 Jan 2005 1:01 am
Location: Nanuet, NY
Contact:

Post by Bill McCloskey »

I made my career being an expert in VRML of all things. Do you remember Virtual Reality Modeling Language Bob?

In the 90's my actual, on the card, title was VRML Evangelist for SGI.

Those were some fun, fun times. Nothing better than being part of the most hedonistic, coolest, company on the planet at the birth of the 3D and Internet industries and living in Silicon Valley....

ah the 90's.
Steven Schwartz
Posts: 46
Joined: 19 Sep 2020 5:37 pm
Location: Longview Washington, USA

Post by Steven Schwartz »

Hedonistic companies in Silicon Valley?? I grew up in Silicon Valley. Worked for Corvus and Apple in the 80's doing early networking. Corvus was definitely the most hedonistic. Beer on tap 24 hours a day in the cafeteria. Lots of "breaks" to the parking lot.

By the time I started with Apple in 1986, the world was moving on from beer and "breaks" to lattes and smoothies.

I survived the 80's, barely. I must never forget how messed up a lot of that was.

Steve
User avatar
Slim Heilpern
Posts: 328
Joined: 19 Mar 2016 9:18 am
Location: Aptos California, USA
Contact:

Post by Slim Heilpern »

b0b wrote:Regular expressions {{{{shudder}}}}. I never learned that language, but it's all over the place the phpBB code. I recently had to decipher this line, a mix of PHP and regex:

Code: Select all

$sig = ($sig_bbcode_uid != '') ? preg_replace("/:(([a-z0-9]+:)?)$sig_bbcode_uid(=|\])/si", '\\3', $userdata['user_sig']) : $userdata['user_sig'];
I now understand what it does, but I still don't know what the '\\3' actually means. Wiz?
And that's the rub with regular expressions: reverse engineering them if you don't live and breath that language is a pain in the butt. There are plenty of books on composing regular expressions, but I haven't seen one that teaches you how to quickly read them. If you're like me, and bump into them only occasionally, it can be painful. I'm not knocking their usefulness, just whining about how unintuitive that language is.

- Slim
Chromatic Harmonica, Guitar, and Pedal Steel (Williams U12 Series 700, Emmons lap)
http://slimandpenny.com
User avatar
Wiz Feinberg
Posts: 6091
Joined: 8 Jan 1999 1:01 am
Location: Mid-Michigan, USA
Contact:

Post by Wiz Feinberg »

FYI, Writing and testing Regular Expressions is tedious. So, i use a program that matches regular expressions to text. It is known as RegEx Match Tracer. The last version was 3.x, published in 2013. It still works for me!
"Wiz" Feinberg, Moderator SGF Computers Forum
Security Consultant
Twitter: @Wizcrafts
Main web pages: Wiztunes Steel Guitar website | Wiz's Security Blog | My Webmaster Services | Wiz's Security Blog
User avatar
b0b
Posts: 29108
Joined: 4 Aug 1998 11:00 pm
Location: Cloverdale, CA, USA
Contact:

Post by b0b »

An expert on phpBB Refugees attempted to explain to me what the '\\3' means. I still don't quite get it. Makes me wonder if there's an easier way to do it. Probably not.

http://www.phpbb2refugees.com/viewtopic ... 1002#11002
-𝕓𝕆𝕓- (admin) - Robert P. Lee - Recordings - Breathe - D6th - Video
User avatar
Lee Baucum
Posts: 10326
Joined: 11 Apr 1999 12:01 am
Location: McAllen, Texas (Extreme South) The Final Frontier

Post by Lee Baucum »

Ian Rae wrote:In the late 60s I learned Fortran so I could make punched cards. The actual computer was in another city.

I have shown no interest since.
I took one semester of FORTRAN in college, in the early 1970s.

It didn't help one bit (or byte) having the computer in the same building!

:lol:
User avatar
Ake Banksell
Posts: 85
Joined: 30 Aug 2016 6:44 am
Location: Stockholm, Sweden

Post by Ake Banksell »

At least you didn’t have to deal with different accents b0b. :lol:
Post Reply