Definition of “Abstraction” in Computer Science

I’ve been working on putting together a simpler definition for “abstraction” than I’ve been finding online that doesn’t get into other Computer Science concepts.

Here’s the conclusion I’ve come to:

There’s a few “common” meanings of the word that help to gather the full understanding of the word:

– To draw away
– To separate

and finally:

– To form a general concept from consideration of particular instances
(All definitions were taken from the Chambers Dictionary)

So, if I saw chicken wrapped in a tortilla, covered in cilantro, smothered with salsa and lime and being enjoyed by the limelight of Mexican horn music, I could abstract that this is a taco.

Similarly in computer science, I don’t want to have give all those little details every time I describe something to my program, I want to just be able to say “taco” and the program would put together my cilantro, chicken, tortilla and lime programs together. Thusly, I define “taco” as meaning all of that. I have created a layer of “abstraction”. Now I can “abstract” myself further when I want to describe my dining experience by putting my taco program together with my table program and my cerveza program. Then I would define it as my “lunch program”. As a result, I now I just say “Lunch” and my program understands and creates the whole taco party.

If that’s too simple for you, I’m sorry. This wasn’t intended for you though. Check out the WikiPedia article instead.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
0

Some WordPress Basics

Here are some basics on keeping your site healthy and working for you in the future or your posterity. Not applying these basics will result in a massive headache for you or someone else later on…

  • When Building a new site always start building with a child theme. Many themes come pre-packaged with a theme and that’s great – you should totally use it. If not, you have to make it yourself.
    You can follow the steps here to create one: https://codex.wordpress.org/Child_Themes or use a plugin like https://wordpress.org/plugins/one-click-child-theme/ – which is great for beginners.
  • Don’t rename the Parent theme. Keep it the same name that the vendor created it with, doing otherwise will make it so you can’t update the theme in many circumstances. Side note: you’re not kidding anyone by renaming a theme… It’s obvious you didn’t make it from scratch, so stop being a douchebag and leave a little cred for the theme devs. 😉
  • NEVER EVER make a change to the parent theme. Doing this will allow your changes to get overwritten on the next update and you always want to keep your themes and plugins up-to-date to get the latest security patches and code updates.
  • If you have to edit WooCommerce files, do so in your child theme following these instructions: https://docs.woothemes.com/document/template-structure/ . Thoroughly comment out any changes you make as WooCommerce does make changes to template files every now and then and you need to be able to update those customized files if needed.
  • If you are using the DIVI theme or an Elegant Themes plugin be sure to install the Elegant Themes Updater to get the latest plugin/theme updates.
  • If you are using any theme from Theme Forest be sure to install the Envato WordPress Toolkit plugin and hook up the API following their instructions. This way you can easily download any updates. This has to be downloaded from GitHub ( https://github.com/envato/envato-wordpress-toolkit )
  • If you are using any plugin or theme from WooCommerce (besides the basic WooCommerce plugin), then you must install the WooTheme Helper plugin. This will enable to update your premium WooCommerce plugins.
  • When using the WooTheme Helper, Envato WordPress Toolkit or the Elegant Themes Updater be sure to hook it up with their respective APIs as per their site’s instructions.

If you don’t apply these you’re going to have a bad time. Not to mention Magicarp will come after you.

And you don’t want that to happen.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
0

How to – 301 Redirects

301 Redirects are what tell your browser, “Hey! This page has permanently moved! Go to xyz location!”

This is useful if you are for some reason changing domain names or simply changing a few pages URLs. You don’t want to lose any “link juice” (the great Google Elixir) your old pages may have. Not to mention, if you have people linking to your site, you don’t want them to be reaching 404s!

301 Redirects to the rescue!

If you are using WordPress or another CMS there’s probably an easier to use plugin to do this, but I’m a huge fan of keeping plugins to an absolute minimum. Plus this is really simple to do.

Connect to your site via FTP and in the root directory you will generally find a file called .htaccess.

Open it up and copy a backup of the file locally.

On a new line add (the spacing has to be exactly as below):

Redirect 301 /old-site-page/ http://yoursite.com/new-site-page/

/old-site-page/ is a relative URL of your old web page and http://yoursite.com/new-site-page/ is an absolute URL of the page you want users to be redirected to.

Now what if /old-site-page/ had a subdirectory e.g. /old-site-page/sub-site-page/

The order of how you handle this is important because if you do this:

Redirect 301 /old-site-page/ http://yoursite.com/new-site-page/
Redirect 301 /old-site-page/sub-site-page/ http://yoursite.com/new-site-page/sub-site-page/

You’re going to have a bad time. The second redirect you declared won’t work as you have already redefined what “/old-site-page/” means.

Do it this way and have a good time:

Redirect 301 /old-site-page/sub-site-page/ http://yoursite.com/new-site-page/sub-site-page/
Redirect 301 /old-site-page/ http://yoursite.com/new-site-page/

Remember to test that it worked after you finished!

Obviously Hackerman GIF

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
1

Direct Link Your Clients to Leave You a Google My Business Review in 2016

You use to be able to directly link to the review box on Google for your business by simply getting the link to the about portion of your Google + page and simply adding “?review=1” to the end of the URL.

It’s now 2016 and this is not the case anymore.

Fortunately, it’s still simple to do!

  1. Type in your business name in Google.
  2. Click on “Write a Review”
    Link to Google My Business Reviews
  3. A pop-up box will appear and again click on “Write a Review”.
    Link to Google My Business Reviews Part 2
  4. Copy the new URL in the URL bar and create your link.

See? It’s Pretty painless, so go out there and make it rain Google reviews!

Make it rain gif

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
1

Hacked and Some Prevention Tips

One of the websites I manage got hacked today.

Suddenly my site is infecting people with Boner ads and I mean, why? Can’t Viagra sell itself?

At this point in my career I’m pretty used to it, but today I found this “code” in the midst of infection:

Douchebag Hacker

God damn I’m sorry, but, how douchey is that?

I’m still in a mystery as to why someone would hack? It’s not like there’s a shortage of Web Development jobs. Is it to be “cool”? I know Hollywood kinda portrays it that way, but it’s really not. You’re just being an asshole.

Well, enough ranting for today; here are some tips for staying safe in WordPress:

  • Use a Security Plugin and enable automatic scans. I use WordFence and I’ve been quite happy with it. It alerts you on any hacking attempts, malware injections, and if a plugin or theme needs updating. It also blocks IPs and has a myriad of other cool features – for free.
  • Always keep your plugins and themes up-to-date. I can’t stress this enough, hackers are relentless and are always finding new vulnerabilities. Keeping everything up-to-date means you have the most up-to-date security protection or at least as far as that developer is aware of. Remember to take a backup before any updates!
  • Use Comment Moderation Software like Akismet or WP Spam Shield. This will help prevent malware and spam links from making their way onto your site.
  • Don’t use a common username like “admin”, it’s just not safe (more details here).
  • Make sure your password is tough one and is not on this list (Source: https://www.skyhighnetworks.com/):
     
    Top Passwords of 2015
  • Important! Please take the time to get a knowingness and understanding of what Hardcore Hacking Mode is and what it looks like.

As a final note, why are you listening to me? Didn’t I start off this post on a rant about being hacked?

Yes, I did…

Well, all I can say is, it happens. In this day and age it’s a constant battle between black hat and white hat online. Target got hacked big time in 2013, the Playstation Network got hacked in 2011 and the list goes on (Check out this from information is beautiful for a pretty neat infographic on the subject).

Really the best we can do is write the best code possible, keep all of our security up-to-date and stop clicking on those boner ads ;).

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
0

How to Replace the Main Background Image with Revolution Slider in the Cafe Pro Theme by Genesis

I noticed a lot of people asking about this, so here’s the solution!

  1. Download Slider Revolution from Code Canyon and install it per Code Canyon’s instructions.
  2. Navigate to this folder: /public_html/wp-content/themes/cafe-pro via FTP.
  3. Open the front-page.php file and right before this last bit of code:
    genesis();

    Add this code:

  4. Save the file. This adds the Revolution Slider to our Home Page template.
  5. Open up the Cafe Pro theme’s style.css (/public_html/wp-content/themes/cafe-pro/style.css) file and add this code:

    If you look at the site now, you will see it isn’t quite there yet.
    We need to comment out some JavaScript that is conflicting with our CSS.

  6. Open up the home.js file (/public_html/wp-content/themes/cafe-pro/js/home.js) and comment out both instances of this code:

You did it!

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrShare on RedditBuffer this pageDigg thisEmail this to someone
Tell Your Friends
0