Simplified Site Management: The Power of SSI (Part 3 of 3)

Posted on Wed 30 March 2022 in Programming

Welcome back to the final installment of our exploration into Simplified Site Management using Server Side Includes (SSI). If you haven't followed the previous episodes, I encourage you to catch up to fully grasp the concepts we're about to dive into. In our previous discussions, I promised to provide you with a visual representation in the form of a crude flowchart, and I'm here to deliver on that promise. Be sure to click on it to get the full view, and feel free to keep it open in another window as a reference.

 

As you've been following along, you might be wondering where all of this is leading. What's the grand vision behind splitting our web pages into various files and using SSI to orchestrate them seamlessly? Well, let's delve into that now.

 

The core idea here is to enable the editing of specific sections of a website within individual files while safeguarding against unintentional and site-wide changes. It's all about maintaining well-formed markup across the board. Well-formed markup is the bedrock of a stable and functional website. It ensures that every tag opened is properly closed, except for singular instance tags like "img," which do not require a closing counterpart.

 

Imagine you're responsible for maintaining a website with a consistent left-hand navigation menu across its many pages. Now, with traditional methods, altering this menu could be a daunting task, requiring updates across numerous files. This complexity increases the likelihood of errors and site-wide disruptions.

 

However, by employing the strategy we've been discussing, you can make changes to that menu in a single file, such as "left_menu.html," knowing that your modifications will exclusively affect that specific part of the website. It's like precision surgery for your site updates—no accidental changes to the header or content sections.

 

Let's take a closer look at the "index" file, which I refer to as the requested file—the file that your web browser requests when you visit a webpage. This index file governs the customized sections of your webpage. Here's where the magic happens. Let's say you've promised a vendor a prominent skyscraper ad in the right-most column of most pages, but some pages have only three columns, sans the skyscraper. On all other pages, you want four columns: the usual three plus a fourth with that eye-catching animated skyscraper ad.

 

In the default values file, you'll notice the use of the "!" symbol, which signifies "not" just like in many programming languages. So, "! $title" evaluates to true if no "title" value has been set. This technique allows us to provide sensible default values for variables, ensuring that we never have undefined states or unhandled variables.

 

Moreover, I've introduced a "sanity check" for the "$right_column" variable in the default values file. This ensures that "$right_column" will always be either "yes" or "no," avoiding any ambiguous states in between.

 

In practical application, you can condense these conditionals into single lines, reducing clutter and maintaining clarity. While Apache leaves a blank line for each line used, which might lead to excessive white space at the top of the file, it doesn't impact functionality.

 

Now, when it comes to the skyscraper ad conditional, I placed it in the page loading file to ensure that the div for the ad is only present on pages that explicitly include it.

 

In practice, I typically use fewer lines in each file, and the conditionals are more concise, all on one line. The key takeaway is that this approach to site management streamlines updates, minimizes the risk of errors, and enhances efficiency.

 

You can explore SSI directives in greater detail in the Apache Docs, tailoring your SSI strategy to match your server's specific version. If you encounter any version-related challenges, don't hesitate to reach out, and I'll be more than happy to assist.

 

And with that, we conclude this series on Simplified Site Management using SSI. If you have any questions or need further guidance, please feel free to ask. Happy programming, and may your websites always run smoothly.

 

Footnote:

Later, I implemented a web page that allowed office staff to access these files without requiring FTP access, reducing the risk of unintended deletions.


Landlording Consistency: Learning from Past Mistakes

Posted on Tue 29 March 2022 in Texas • Tagged with Erath County, REI

Let's be honest, we all make mistakes, and sometimes, those mistakes come back to haunt us in unexpected ways. Over a year ago, I found myself in a predicament caused by a lapse in judgment. Today, I'm sharing my story as a cautionary tale, hoping that others can learn from my oversight.

 

You see, I'm the owner of a small mobile home park in Stephenville, Texas. I've made this park my home, and my business model involves leasing out my land to mobile home owners. Notably, I don't own any of the homes in the park, except for my own residence.

 

Around a year ago, circumstances weren't in my favor. I wasn't feeling well, confined to my home, and during this time, two homes in the park were sold. The mistake I made was not acting promptly when I learned of these sales. I should have immediately informed the new buyers, who were also the current residents, that they had no existing lease and needed to vacate the park without delay. But, regrettably, I didn't take that crucial step.

 

I allowed complacency to set in, never requiring these individuals to sign a lease agreement. Fast forward to yesterday, and one of the residents approached me with surprising news. They had sold their home, and the new owner was moving in the very next day. Needless to say, I was taken aback.

 

For those who haven't experienced mobile home park management, picture owning an apartment building. Now imagine striking up a conversation with a tenant who casually mentions that they've transferred their lease to someone you've never met, and they're vacating in just three days!

 

In Texas, and likely in many other states, landlord-tenant laws require landlords to provide notice equivalent to at least the length of the payment cycle. If you collect rent biweekly, two weeks' notice is required. If it's a monthly arrangement, 30 days' notice must be given. And for those on a six-month payment cycle, six months' notice is mandatory. Of course, if a lease specifies a longer notice period, that should be adhered to.

 

Before I ventured into the world of landlording, I, like many others, believed that a 30-day notice was merely a courteous gesture. It seemed common sense that tenants should provide more than three days' notice before vacating. Unfortunately, my assumption didn't align with reality, and I found myself in a challenging situation.

 

During a recent meeting with the buyer and seller of one of these homes, communication hurdles added to the complexity. Conversations had to be facilitated through an interpreter, which further complicated matters. The seller questioned each point I raised, expressing that such issues hadn't arisen when she initially purchased the house.

 

This meeting was undoubtedly an arduous one, and it served as a stark reminder of the importance of consistent and proactive landlording practices. By sharing my experience, I hope others can avoid similar pitfalls and navigate the complex landscape of property management with greater ease.

 

In conclusion, landlording consistency is key. Learn from my mistakes, and always ensure you have clear and documented lease agreements in place. Your proactive approach today can save you from unexpected challenges tomorrow.


Proof and Evidence: The Nuances in Language

Posted on Sun 27 March 2022 in Words

Words hold a special place in the hearts of writers, and I believe I've written enough to claim that title, though not as a professional writer. Nevertheless, I've been compensated for my writing in the past, and I anticipate future opportunities.

 

When I encounter the improper use of a word, two thoughts cross my mind. Firstly, am I correct in my assumption about the misuse? Secondly, should I bring it to the attention of the user? Usually, I find my assumption to be accurate, but I often refrain from pointing out these linguistic faux pas.

 

One recurring error I've noticed is people using the word "proof" when they really mean "evidence." Just earlier today, I stumbled upon such an instance, which prompted me to consult a dictionary to reaffirm that the two terms are not interchangeable. Following that, I conducted a Google search in search of a comparison between "proof" and "evidence."

 

Lo and behold, I found a relevant discussion on the matter. I won't attempt to summarize the entire page, as it's concise enough for you to peruse and gain a clear understanding of the distinction between "proof" and "evidence." It's continually astounding how accessible research has become in the age of the World Wide Web. Truly, this is an incredible time to be alive.


The Truth About Real Estate Deals: "50 Cents on the Dollar"

Posted on Fri 25 March 2022 in Texas • Tagged with Economics, REI

In the world of real estate investing, you'll often come across catchy slogans like "50 cents on the dollar" or "buy property for half off." It's an alluring promise, but let's debunk the myth right here: when a property is sold for a specific price, that is its actual worth at that moment.

 

Is it theoretically possible to buy a property and immediately sell it for a profit, maybe even doubling your money? With a double closing, you could technically achieve this in a single transaction. However, such deals are rare and not the norm in real estate.

 

So, what determines the value of a property? It's straightforward. The value is precisely what someone is willing to pay for it. If you purchase a property for $50,000 and sell it for $100,000, its worth is $100,000 because that's the price someone was willing to pay you.

 

But did you buy a $100,000 property for $50,000? Absolutely not, not even hypothetically. You added value to the property, which influenced the buyer's willingness to pay more than the seller initially did.

 

The crucial questions to consider are ethical ones: Did you act ethically when buying the property, and did you act ethically when selling it? Unfortunately, the answer in many cases is no. Sometimes, sellers or buyers are cheated in these transactions, or even both.

 

Karma may not always come around, but the best defense against real estate hucksters is being informed. When you encounter someone touting "50 cents on the dollar" deals and offering real estate investment courses, ask them about the value they add to the properties they buy. Request documentation of their past deals, if possible.

 

Let's break down the formula again: You buy something at one price, add some value to it, and sell it at a higher price.

 

Higher Price = Lower Price + Value Added + Profit (or Loss)

 

Consider this scenario: You purchase a single-family residence at a county auction, but the property has its complications. You may need to wait for the redemption period to end (typically two years in Texas), evict tenants, perform maintenance, pay holding costs, and obtain fire insurance if the home remains vacant. These challenges are the value you add to the property before selling it.

 

This principle applies to various real estate strategies, from rehabilitation and renting to flipping contracts, wholesaling, lease options, PAC trusts, conversions, and more. To sell a property at a higher price, you must add value ethically.

 

While some real estate educators may not fully grasp this concept, the legitimate and ethical ones do. They're actively involved in real estate deals and can offer valuable insights into the hidden value they bring to properties without even realizing it.

 

In your real estate endeavors, always remember that adding value is crucial. It's your responsibility to assess the ethics of any scheme you encounter. As a final thought, remember the wisdom of James Garner's character in "The Rockford Files" - it's easier to shave when you can look at yourself in the mirror. So, act ethically in your real estate deals.


The Price Conundrum: Why Hide the Cost?

Posted on Mon 21 March 2022 in Marketing • Tagged with rants

It's a scenario that keeps playing out on the internet: I stumble upon a website that eagerly extols the virtues of a product, detailing all its wonderful features, but when it comes to the price, it's nowhere to be found. In some cases, I'm even required to fill out a form just to get a glimpse of the price tag.

 

Honestly, it makes me want to shake my head in disbelief. What on earth were these website owners thinking? They've invested time and money in advertising and marketing. They've meticulously researched and planned their strategies to lure me into their online store. They've passionately explained all the benefits and made a convincing case for why I need their product right now, today.

 

And then, they hesitate to close the deal by not revealing the price. It leaves me with only two possible conclusions. Either their product is priced so exorbitantly high that I wouldn't consider purchasing it, or they believe their product is so unique and unrivaled that there's simply nothing comparable or competitive with an online price tag.

 

But here's a reality check for them – they might be entirely mistaken. By keeping the price under wraps, they risk losing out on potential sales.

 

I once received some valuable sales training at Home Depot from a fellow who excelled at selling custom kitchens. It was one of those hands-on, one-on-one sessions that you wish happened more often. Although I can't recall his name, I vividly remember his parting advice after the generic presentation. He emphasized that the final two steps in every successful sale were to inform the customer of the price and then simply stop talking.

 

That, according to him, was the key to his remarkable success. He would walk customers through all the benefits, customize the kitchen to their liking, create a stunning design, and display it on the computer screen. Then, he would reveal the price and let it sink in.

 

Customers use the price to assess value. Without a clear price, our minds tend to fill in the blanks with wild speculations. Our imaginations run wild, often conjuring up ridiculously high figures. If a seller is too hesitant to disclose the price of their product, we can only assume that it's astronomically expensive, perhaps requiring a small loan to afford.

 

So, what triggered this frustration? I was recently browsing the internet in search of raised garden beds and stumbled upon a website for garden edging called Kwik Kerb (KwikKerb.org). They had advertised their website on Google in response to my raised bed search.

 

I visited their website and was greeted by an impressive display of garden edging products. They were unique and aesthetically appealing. However, to obtain the price, I was redirected to a form that requested my contact information and the best time for them to call me. Frankly, I was taken aback. Did I really need someone to call me just to provide me with the price of a product I was merely curious about?

 

Here's the irony: the form is powered by PHP (kkorgus.php). So, why couldn't the PHP programmer ask for the quantity of edging I needed and instantly calculate a price for me? It's a simple calculation, and the answer may lie in the fact that the price is so shockingly high that no one in their right mind would willingly pay it.

 

So, Kwik Kerb plans to have a slick salesperson call me and attempt to stall me long enough to make their exorbitant fee seem like a reasonable investment. Well, I've got news for them – I won't be filling out that form anytime soon.


Effective Redirects: A Quick Guide

Posted on Fri 18 March 2022 in Programming • Tagged with php, perl

I'll admit, this might serve as a handy reminder for me more than anything else, but let's dive in anyway.

 

Recently, I delved into the world of PHP 5.x and its header() function. During my exploration, I stumbled upon an interesting piece of information:

 

"HTTP/1.1 requires an absolute URI as an argument to the 'Location:' header, including the scheme, hostname, and absolute path, but some clients accept relative URIs."

 

Now, I don't know about you, but RFCs (Request for Comments, essentially internet standards documents) can be incredibly dull. So, I'm grateful to the sleep-deprived souls who unearthed this gem for the rest of us.

 

Following this standard doesn't just matter for PHP; it can also solve issues in other languages, like Perl. In Perl, many folks wisely use CGI.pm for handling redirects, and the CGI manual dishes out the same advice: utilize full URLs for redirects.

 

Here's a mini guide to redirection (basically, you just print out the redirect):

 

```perl

#!c:\Perl\bin\perl.exe

 

use strict;

use warnings;

 

use CGI;

my $query = CGI->new();

 

# This is the wrong way to redirect

# because the URL is missing the domain

# information:

print $query->redirect( "/site/admin/index.shtml" );

 

__END__

```

 

Notice that with the wrong approach, the address bar displays the program that initiated the redirect. If the user refreshes their browser, this program will be called again, which isn't ideal. Users see a dialog box (in IE) upon refreshing with this type of redirect, leading to a subpar user experience and potentially unforeseen consequences for the underlying database.

 

Now, here's the right way to redirect:

 

```perl

#!c:\Perl\bin\perl.exe

 

use strict;

use warnings;

 

use CGI;

my $query = CGI->new();

 

# This is the right way to redirect

# because we use a full URL

print $query->redirect( "example.com/site/admin/index.shtml" );

 

__END__

```

 

This time, the address bar displays the address of the page we're redirecting to. If the user refreshes their browser, this page will be called again, providing a smoother user experience.

 

Using full URLs in redirects is not only a better practice but also aligns with the HTTP 1.1 standard. And as a rule of thumb, sticking to standards often pays off handsomely.


A Valuable Lesson from EAAHosting's Misfortune

Posted on Thu 17 March 2022 in Marketing • Tagged with hosting

I recently had a conversation with the previous owner of EAAHosting.com, and he shared a cautionary tale that truly resonated. Regrettably, I realized I had neglected to inquire about his name during our discussion.

 

According to his account, EAA Hosting embarked on its journey as a modest operation and rapidly garnered a substantial customer base. With growth came improved pricing options from larger server wholesalers. However, they opted to keep their Customer Relationship Management (CRM) system hosted with a smaller server provider.

 

Sometime in the previous year, their CRM server, managed by fatnetworks.com, experienced a catastrophic failure, resulting in the loss of not only their CRM but also all customer contact information. Although most of their clients were hosted on servers from other, more dependable providers, EAA Hosting was forced to close its doors due to the irrevocable loss of vital customer data.

 

It appears that they were unable to persuade fatnetworks.com to restore the server or retrieve their lost data.

 

This unfortunate situation offers a vital lesson. It emphasizes the importance of choosing a CRM program that includes an offline or remote backup solution. Relying solely on control panel (CP) or H-Sphere to manage your customer data is risky unless you have a robust database backup strategy in place.

 

Personally, I wouldn't have immediately considered taking such precautions, but EAAHosting's story serves as a stark reminder of the potential consequences of neglecting data protection.


Empty Promises: The Peril of Political Pledges

Posted on Sun 20 February 2022 in The Good Fight • Tagged with economics

Barack Obama is currently championing a tax credit for college tuition, and I fervently hope that this remains nothing more than a promise, never to be realized. I recently came across an intriguing notion that a politician's primary duty is to make promises, with no obligation to actually fulfill them. So, why am I opposed to a tax credit?

 

One compelling argument was presented during a brief interview on my local news station. The speaker posited that this tax credit could potentially enable students to attend larger, more expensive universities. In her view, the tax credit might encourage students to allocate more funds toward education, whereas Obama's intention was to alleviate the financial burden of tuition.

 

In a scenario devoid of intervention, colleges would be compelled by the market to lower their prices if the cost of education became prohibitively high. The only reason we might find it necessary to implement a tax credit to facilitate access to education is if existing regulations have already disrupted this natural market mechanism.

 

Rather than resorting to a tax credit as a means to rectify regulatory interference, why not consider abolishing those regulations that are skewing the market in the first place? Why does addressing issues always entail the creation of more laws? Given that the market is adept at functioning autonomously, perhaps our approach to "doing something" should involve stepping aside and allowing the market to flourish independently.


Regulation's Influence on the Necessity of Antitrust Measures

Posted on Sun 13 February 2022 in The Good Fight • Tagged with economics

Regulation has a profound impact on the marketplace, sometimes in subtle ways, and at other times more overtly. It often leaves us grappling with unforeseen consequences. It's frequently assumed that Consumer Law is designed to empower consumers, as many believe that large corporations hold an excessive amount of power. But is this really the case?

 

In a truly free market, every trade is a voluntary exchange, devoid of any legal means to initiate coercion. Not even the government possesses this power. Advocates of free markets often argue that there's no need for antitrust laws or consumer protection legislation.

 

Consider, for instance, a scenario where a dominant market player, such as Intel, leverages its size to force other competitors out of a specific market by reducing its prices to a point where it sometimes sells below cost.

 

How does this negatively impact consumers? In the long run, Intel could raise its prices significantly and exploit consumers with monopolistic pricing. This fear has spurred numerous antitrust cases. In mixed markets, commencing a new business or competing in a fresh market frequently entails navigating through various obstacles. India, for example, encountered this issue for an extended period, with new ventures often taking years to navigate bureaucratic hurdles.

 

In a free market, one completely devoid of regulations, nothing hinders competitors from entering the market once prices inevitably rise again. Would a free market tolerate the practice of lowering retail prices below cost to achieve market dominance? Indeed, but only as long as prices remain low.

 

Unlike mixed markets, which necessitate measures to combat "unfair" practices such as price reductions, a free market lets price dynamics dictate market behavior. Charge excessively, and competitors will enter, driving prices back down. Charge too little, and you'll eventually struggle to meet payroll obligations.

 

In either scenario, the consumer benefits in a free market. In a society governed by a free market, it's less likely that we'll witness pricing manipulation as a means to eliminate competitors, because such tactics are more prone to failure compared to mixed-market environments.

 

Mixed-market systems create a demand for antitrust and consumer protection laws. In contrast, the free market doesn't impose regulations on the marketplace and prohibits the government from introducing new rules, rendering antitrust and consumer protection laws unnecessary.


Funny Religious Beliefs: A Glimpse into Unconventional Ideas

Posted on Fri 28 January 2022 in Religion

I stumbled upon a website this morning and found a quote from its January 2008 page that I just had to share:

 

"As far as I am concerned, if an answer to a question isn't in the Bible, then you have no business asking the question. A few years ago, when my wife suddenly had to get an emergency c-section, I was scared. But I didn't turn to any book about quarks. Luckily, I had my palm pilot with me, which just happened to have the entire King James Bible on it! I read a few passages that gave me the strength to pray for her and the baby to get through this ordeal. I sure didn't need any useless trivia books about quarks to find comfort in. I have very little use for science. In fact, it is an impediment to getting close to God."

 

This quote is indeed amusing. You can find the [thread on the website christianforums] where this statement originated. It appears that the author was quite serious. He makes other humorous remarks later in the thread but then mysteriously disappears. Perhaps he had a change of heart.