Sunday, February 07, 2016

Deportation and Visas

This last GOP debate was much better than I expected.

Before jumping into my post. I want to counter a meme put forward by Trump. Trump claims that he is the most likely to beat Hillary Clinton.

I say the opposite is true. The Left is adept at exploiting wealth envy in campaigns. It is what they do best. As Trump's claim to fame is his ability to amass wealth and power, he is the candidate that the left is most likely to beat.

As for this post. I liked the direction that Rubio, and others, were taking with immigration debate. The salient point is that the US government must prove that it willing to enforce existing immigration laws before we can pass more lenient laws.

The United States is in a horrible situation where we have to deport millions of people.

Deporting millions sounds draconian until one looks at the numbers. Adding up the columns on the statistics page by the Bureau or Transportation Services indicates that over 250 million people entered the US in 2014.  Most people entering the US are on a passport waver program which allows stays in the US for up to 90 days.  The State Department issued about 10 millions of visas last year.

Both references bring up many unanswered questions. However, they establish that International Travel involves hundreds of millions of people.

Unfortunately, deportation is a necessary component of a smooth running international travel system.

A visa is a contract between a visitor and a host country.

Deportation is the primary mechanism for enforcing the contract.

Yes, I know, deportation is harsh. I would be against deportation except for the fact that it is intrinsic to a working visa system.

When one is dealing with hundreds of millions of travelers. It is not unreasonable to engage in millions of deportations each year.

I am for streamlining the deportation system because streamlined deportations allow for a more robust international travel system. When people follow the laws. We can actually increase travel.

To repeat my argument: A visa is a contract. Deportation is the enforcement mechanism of the contract. We have hundreds of millions of international travelers each year. A one percent fail rate means that we have to deport millions of people each year.

When the context of the argument is understood, the argument for deporting a million people is not harsh. It's simply a necessary part of making an international travel system work.

As for "sanctuary cities." The people who declare sanctuary cities feel great. However, these clowns are disrupting a system that involves hundreds of millions of people simply to make a feel good statement.

Standing against the clowns is largely a matter of showing the harm that they are doing to the hundreds of millions of legal travelers.

I do not believe that the US is going to end up deporting everyone whose violated their visa agreements since the last general amnesty.

However, the United States simply has to get a robust system of deportations in place to safeguard our current robust system of international travel. The last amnesty shows that the US government will not engage in reform after an amnesty.

Families and Immigration

One of the most persistent arguments against enforcing immigration laws is a belief that immigration laws break up families. Looking at the State Department Data, the vast majority of immigration visas are given to immediate and family sponsored immigrants. Over 90% of immigration visas are given for the purpose of keeping families together.

The statistics show that our laws favor the reunion of families over other concerns.

As for the breaking up of families. This is the result of international travel and not American laws.

When a person chooses to move over long distances (crossing national borders and all). That person is engaged in an activity that breaks familial bonds.

It is the individual's choice to emigrate that breaks up the family and not American law.

Yes, it is true that we witness the results of a decision. But the break up is not caused by our laws. The fact that we witness a drama does not mean we caused the drama.

I've noticed that all humans have human connections. People from a region are often related to a huge number of people. Developing the idea that immigration should take place in huge packs limits our nation's ability to accept immigrants from a diversity of places, because we can't just look at the individual who wants to immigrate, but all of the people attached to the individual.

The statistics show that our current system favors relatives of immigrants over all others.

It is really sad that moving abroad breaks up families, but I find it foolish to blame our immigration laws for breaking up families as some break of family must occur whenever people move abroad.

Wednesday, February 03, 2016

Dynamic SQL

I used to enjoy programming.

I stopped enjoying programming with the release of XHTML and PHP 5 (which included the PDO Object). XHTML made the code for web pages excessively terse. The ugly PDO statement in PHP somehow made me feel sick every time I used it.

I finally had to confront the beast and ask why the PDO object makes me feel like puking.

I went back and was looked at the code I was writing before the release of PDO and it dawned on me.

Through the years I had developed a rather dynamic approach to SQL.

The way my code worked is that I would pull the DDL for a group of Tables from the database. (DDL refers to the CREATE TABLE Statement). My program would generate HTML forms from the DDL.

When you press submit, the program would, again, pull the DDL from the database. Analyze the data according to the defined constraints on the table and dynamically produce the SQL. The program would call mysql_query and insert the data.

In other words, I could create a web form in the time that it takes to write a CREATE TABLE Statement.

I was actually preparing to submit the programs I used to GitHub.

PHP programmers: Imagine how much more productive you could be if the program you used automatically generated forms from your SQL Tables, and imagine that same program generated the SQL to validate and insert the code into your database.

The PDO program is built around a static approach to SQL.

The flow of a PDO program is as follows:

You open a connection. Define a SQL Statement. Bind the Data to the Statement then execute the query.

PDO assumes that that SQL is static. It expects the SQL statement to be fully formed before looking at the data.

My programs were all building SQL statements step by step. They would only execute the SQL if the data passed all of the constraints.

I was able to do more with the mysql_query() command than the PDOStatement Object because the former allowed for dynamic creation of SQL while the latter is built on a regressive static model for SQL.

To prove that the dynamic approach to SQL is better. Let's imagine a simple User_Preference table with 20 defined items.

The user pulls up the preferences page and update only one or two of the twenty items.

My program cannot know, in advance, what preferences the user will change until it looks at the data.

PDO fails because it expects the program to define the SQL before looking at the data.

The program must either loop through the data twice (The first time to create the SQL statement, and second time to bind the data to the statement) or it needs to make a copy of the data in a buffer to bind to the SQL statement.

I downloaded the source code for PHP. I was actually considering creating a branch of PDO that would allow for the creation of SQL statements. But, I don't feel comfortable with my skills in c at this time (and my web site is broken).

So, what I want to do is to get back to the point where I can generate forms from the DDL Statement for a single table.

Since this regressive PDO is  the biggest block to this goal. I decided to start with it. Here is the public test page for the code. Here is the code for the Test Page and Object.

The base of this program is code that I wrote a decade ago. The original program worked as follows. It defined the constraints on the data. It then looked at the data in $_POST and built a SQL query.

The flow for this version is: The program makes a copy of an array. It then looks at the definitions for the columns and finally constructs the SQL. It is very inefficient.

Yes, I wrote this code on 1/30/2015. I spent from 1/30 to 2/3 writing test scripts. I wanted the test page to work against live data. But I finally decided I didn't like having a page that just generates INSERT and UPDATE commands for no reason out in public.

The Test Page now just generates some sample SQL, but does not execute the code.

The next step is to create an object that generates a web form. That will be easier. Unfortunately, I have to spend the next several hours running chores.

Perhaps, if I complete this project, I can return to the point where creating web pages was fun.

Tuesday, February 02, 2016

Train Wrecks

I heard that several runaway trains are headed full speed into Iowa and that no-one's done any sort of line maintenance in the state for years.

The press is excited by the event as we might be looking at one of the worst train wrecks in our life time.

As for me, I've stopped blogging because I really have no interest in train wrecks.

Both the two major parties seem to be getting worse and worse.

Despite the great communication technology we have, the voices that want to stop the train wreck just can't break through.

I like Ben Carson ... but I think he spent too much time trying to create a conservative image and I am not really sure what direction he would lead the country.

I would love to see Rand Paul playing a bigger role in the GOP because the Pauls have thought through questions about liberty better than most of the GOP candidates.

As for the Democrats. Isn't anyone else interested in the strange phenomena that their Party only has three candidates and their campaigns seem more orchestrated than the GOP?

If the Democrats really were the party of the people one would expect a much more raucous primary.

Despite the fact that it is better organized than the GOP. The Democrats are more like a high speed passenger train running out control while the GOP is just a bunch of freight trains running out of control.

Freight train collisions are visually more appealing than high speed passenger train collisions, but the death and carnage of a TGV running off track is much higher than an freight train pile up.

Presidential politics is a train wreck. The answer to our nation's malaise will not be found in politics but in the people.

I think the best presidential candidate is the candidate who is most likely to listen to Congress and the people.

I see Trump as the worst candidate. I am hoping that the party will simply coalesce around who is every seen as the best candidate to beat Trump.

As for this year's crop of candidates. That is really the best the GOP can hope for.

My biggest fear is that Democrats will cross party lines to vote for Trump. If Trump wins the GOP nomination, the Democrats will be able to run a campaign on wealth envy and anti-capitalist sentiment.

If Trump wins, we will not only have an arrogant jerk as president. The nation will turn decidedly left as the Democrats run a pure Marxian campaign against Trump.

Both the Press and Socialist Left want Trump to win. I hope he stumbles.

As for me. I have no interest in watching train wrecks. So, I am just diverting my eyes while trying to find a better direction.

Monday, January 25, 2016

NamesSpaces and Base Instincts

PHP 5.3 included a new superstructure called "namespaces" that allows people to divide functions (and consequently the people who write functions) into a hierarchical structure.

Just as titles go before the names of Dukes, Lords and Kings. The namespace syntax goes at the top of the function. When the compiler sees the magical word "namespace" it takes a extra step to parse the file and prepend all of the functions with backslash delimited strings to put each function in its place in the the hierarchy.

If I put the line:

namespace Lord\Kevington;

at the top of my code, the program would add the string "\Lord\Kevington\"  to my programs.

If I put the code:

namespace musings\of\peasants;

At the top of your programs; then the compiler would properly encode your work as the musings\of\peasants. The backslash denotes the different layers in the programmatic hierarchy.

If I had a function called said(). The compiler would automagically change the function name to: \Lord\Kevington\said() before compiling the programs.

It would do the same to the \musings\of\peasants ... but ... sorry, while I am thinking of profound things to put in \Lord\Kevington\Said(), I am just not all that interested in the musings of peasants.

The stated purpose of namespaces is to avoid name collisions. Collisions occur when two programmers use the same function name. The compiler balks when the programmers try to combine their code in a single unit and one of the programmers has to change a function name to make the code work.

Now, PHP is a language designed to produce web pages. Web pages require highly optimized code that is executed in a single call.

A good web program is streamlined and a good web developer knows each and every line of code used in the production of the production of the page.

To be frank, if the framework used to create web pages is having problems with namespace collisions, then the proper course of action is to streamline the framework.

And, to be fair, PHP was one of the last programs to implement namespaces. I suspect that a primary reason that PHP implemented namespaces was simply to be consistent with Java and what is taught at the university.

I took a long and serious look at namespaces when namespaces were released with PHP 5.3..

Since namespaces are simply about the internal organization of code and do not in anyway enhance the experience of visitors to my site, I decided not to implement namespaces.

I've noticed a large number of extremely loud voices on Stackoverflow and GitHub pushing namespaces. So I gave them a good second look over these last several days.

Namespaces seem to be preferred tool by the political animals that programmers should try to keep out of the programming department.

The problem of namespaces is that, since namespaces were designed as a meta-element that underlies all of the code in a program, once one person starts implementing namespaces the namespaces soon take over all code.

Namespace technology is very similar in form to the ideologies developed by Hegel and Marx. The technology works at a root level to divide things up so that things can be captured and controlled by a ruling class.

When people set in to dividing things up at a root level, you can become powerful and force your political enemies into subservience.

People who the little reindeer games called "namespaces" are political enemies.

If you are politically ambitious programmer, you can start simply by including namespaces in your projects. This sets you up to becoming the politically powerful keeper of the keys.

The cool part about the game is that, since it takes place at a root level, once the namespace game is started everybody has to play or get excluded.

Namespace technology is a political tool used by base political element of the IT world to decide who gets included and who gets excluded. Sadly, IT Departments are often the hotbeds of interoffice politics.

The keeper of the namespaces is one of the most powerful hacks in an IT department full of hacks because, the person who designs the namespace hierarchy gets to decide who is included and who is excluded.

Isn't that spiffy?!

Of course, the really, really, really funny thing about namespaces is that the technology doesn't actually solve a problem.

Namespaces are as susceptible to name collisions as are all of the other conventions programmers adopted to avoid name collisions. In fact I can guarantee that name collisions will take place.

Imagine a situation where a large project branches. Two groups begin to develop extremely similar code. Anyone that tries to combine elements of these divergent project will have name collisions taking place at both the namespace level and the code level.

Yes, people will try to solve the conflicts by adding layers to the namespaces hierarchy, but each of these layers simply add to the long term administrative cost of the code.

Anyway, I spent the last several days researching namespaces and deciding if I want to use the insipid technology. I hate the technology, but since its a root technology, I know that those that don't play along with the game get excluded.

My heart screams RESIST, while my brain says you must go along to get along. As for now, I will maintain two versions of my code. One that uses namespaces and one that does not and I'll decide later which project to keep and which to ditch.

I really hate these political drones who want the world separated in political hierarchies. All they do is make work while adding no value.

The really funny part about namespaces is that namespaces themselves create

Namespaces and Security

 Note, I haven't examined all of the security ramifications of namespaces. Namespaces allow programmer to create two very similar code bases. (This is not hard to do with the copy command.)

I imagine that one could play some really good jokes on fellow programmers by switching namespaces. What is the difference between:

namespace all;
namespace a11;
Anything that makes it easy to switch code on a project gives me the willies.

Tuesday, January 19, 2016

Password Program

It is very important for web designers to protect the passwords with which they are entrusted.

A huge security risk happens when hackers break into a site and steal the user database with all of the passwords. If the passwords are poorly secured, hackers can figure out the preferred user name of a person and their preferred password.

(Many users use the same userName/PassWord combination on all sites. If a hacker cracks one password the hacker can go after accounts on different servers. It is wise to use different passwords for every online account. This is especially true of any account involving money.)

Web programs need to encode passwords in ways that make it difficult for the hacker to reassemble the password.

There are some nice industry standard algorithms that do a good job encoding passwords. But hackers have built massive "rainbow tables" that help them discern encoded passwords.

The standard PHP password is called password_hash() . This program tries to thwart hackers by creating a 60 character hash from the password. The PHP manual says they plan to move to a 72 character string shortly.

Storing 72 characters for a password seems absurd to me.

Since I have a small site. I think it will be better to create my own encoding program. The program does some fancy footwork with primes and bits to create a hash that is difficult to unhash. Here is the basic code used in my program. This second link is a form that tests the hash generator.

The program is still weak on handling multi-byte UTF8 characters and was optimized for passwords from 8 to 16 characters.

The reason that I wrote the program was to say that If we are forced to produce horrendously long password hashes, the password programs should output binary strings and not super long strings of characters.

I will change the value of the primes on my production server and intend to rewrite the program in c, just as soon as I learn to program in c. I need to improve the UTF8 support. Right now it uses each character in a multi-byte character, when I should only look at the last character.

The output is a 16 character binary string which is a bit more manageable than a 72 character string.

Off course, storing passwords in a Pain in the Tush. I've actually started using Oauth for authentication. Of course, that means that when a hacker breaks into a Twitter account the hacker can attack all the sites using OAuth.

Saturday, January 16, 2016

Windows 10

Yesterday was a total waste.

When I turned on the computer, the screen told me that Microsoft was desperate to do an update. So I clicked the okay button and went off to do chores. When I came back an hour later; I discovered that MS was knee deep into upgrading me to Windows10. I decided not to abort the operation.

The computer took until 4:30PM to complete the upgrade. A whole day wasted on an upgrade.

To make matters worse. While the upgrade was running, I discovered that something was horribly wrong with my email set up and I couldn't fix the problem because my computer was knee deep in an upgrade.

(Mental note: One of these days I should get  a second computer.)

I wasn't able to debug the email problem until 9PM. At 11:00PM I finally figured out the problem. In the MX record on, I had used the default value for priority which was 0. Apparently this is invalid. The mail worked for the first few days, but the invalid entry propagated and blocked incoming email.

I've concluded that the two most important steps in diagnosing email are (from a Unix terminal):

First use the telnet command to log into the computer to see if you can send an email manually.

telnet 25

If you can send the email, then use the dig command to check the MX record:

dig MX

I am now waiting to see if the changes I made to the MX record propagate through the system correctly.

Tuesday, January 12, 2016

Drinker's Permit

Apparently some states are thinking of lowering the "drinking age."

Personally I think the very existence of a "drinking age" is a net negative as it builds a myth that getting drunk is part of being an adult.

Completely eliminating the drinking age would have the effect of throwing children to wolves as there is subclass of human that seeks to take advantage of the young and inexperienced.

There are people who get kids drunk or stoned to take advantage of them.

The classical liberal approach to governance realizes that there is a freedom paradox.

A free society cannot give people the freedom to violate the liberties of their neighbors.

Alcohol diminishes self control. The wolves who ply children with drugs and alcohol are using chemicals to violate the freedom of the kids they target.

Since alcohol diminishes self control, I think the best approach to the question of drinking is to figure out how to structure the introduction of alcohol so that people gain control over alcohol before alcohol gains control over them.

I think it would be worthwhile to discuss concepts such as "Drinkers' Education" or a "Drinker's Permit" as ways to mitigate the damages caused by a set "drinking age."

Drinker's Education might take of the form of simply allowing wine and beer tasting events that do not require IDs. The events would have to have a built in safe guard to prevent over consumption. Drinkers' education might also take the simple form of allowing anyone to order a single drink with a meal at a restaurant without ID.

The "Drinkers' Permit" concept falls along the idea that people should learn about alcohol and its dangers and ease into drinking rather than waiting for some magic drinking age event where people drink in excess, lose self control and risk falling into the hands of manipulators.

It ideals of liberty is no some maniacal belief that we should throw children to the wolves hoping that the survivors will come out stronger. It is a realization that a society restrained by self-control is stronger than one depending on state control.

I believe that our drinking age and drug laws have made our society worse. The laws have created and funded a subculture where people where children and manipulated and drawn into addiction by the worst elements of our society.

That drinking laws are destructive does not mean that all alcohol laws are destructive. Imagine a rogue who plies kids with drugs and takes advantage of them. This rogue element is engaged in a base violation of the liberty of the targeted victims.

A person who violates others by plying them with drugs is doing as much if not more damage than a person who breaks your front window then walks off with your TV.

The discussion of eliminating these destructive laws must acknowledge the dangers of substances which diminish self control. A society of drug addicts is not a free society as the addicted are slaves to the pushers of addiction.

The concepts of "drinkers' education" or of a "drinker's permit" would fall into the moderate view favored by the US founders and the classical liberal tradition which promoted moderation and avoidance of paradoxes.

I would prefer the development of structures to promote self promotion before lowering the "drinking age," for lowering the drinking age does little more than change the age of the group that engages in in binge drinking.

Unicast v. Multicast

The next step in my upgrade is to get a handle on the current state of IPV6.

There are fewer IP addresses than people. The world exhausted its supply of IPV4 addresses; so the world needs to do something.

Unfortunately, instead of extending IPV4 by a few magnitudes, the powers that be designed IPV6 to replace IPV4.

The ugly side of this change is that IPV6 was designed from the top down to favor large publishers over small and individual publishers.

IPV4 was built on a unicast model. In this model, client PCs create a connection with the host server and pull down the desired information. The individual (and consequently the individual who owns the client) has greater control.

IPv6 is built around multicasting (aka, broadcasting). The IPv6 will be optimized for large centralized concerns that seek to pump out volumes of information to client minions.

I prefer the unicast model to the broadcast model as it encourages people to be a bit more deliberative in their intake of media. The unicast framework was also somewhat of an equalizers since the cost of getting information off a small local server was basically the same as getting it from a huge firm (Huge firms can realize economies of scale, but are not favored by the network structure itself.).

I hope that internet users resist the multicast features of IPv6. But the powers that be are powerful and they prefer a top-down controlled society to a free society and are adept at getting their way.

Life Wasted on Email

That was a bummer. I've spent the last several days setting up an email server. (grumble, grumble. I hate email).

The reason I am moving to a private server is that I am trying to figure out ways to reduce the amount of spoofed email sent my domain addresses.

I had pretty much stopped sending emails myself. I save all my sent emails. (minus test emails which I do delete). My primary email account shows that, In 2013, I sent 16 emails. In 2014 I sent 8 emails, and In 2015 I sent 1.

What happened to me is as follows: I am developing a number of community sites, which have a decent reputation.

I went with a premium web host run. The owner of the firm had a heart attack and died. His employees bought the firm and ran it into bankruptcy and a criminal spammer bought the assets and used my domains to engage in criminal spamming. The web host has access to the servers. Apparently he sent hundreds of millions of spams using my domains and signed up for every spammy email service available.

The result is that, even eight years after changing web hosts, I am deluged with spam.

I still get over 200,000 bounced emails a year. It is a complete nightmare for a person who doesn't like email to begin with.

I put the email on its own server because I want email quarantined from the rest of my doings and hopefully it will be easier to monitor.

The new email server is only working on my development account. It will be interesting to see how the configuration holds up with I point the production domains at it let the deluge begin.

Of course, I think it silly to have spent so much time and effort on email when I actually don't intend to use it for communication. The main thing I am trying to do is stop the spam that spoofs my domain in the sending address, and their is nothing I can do about that.

(Note, I have my domains marked up with tags. My current web host says they have not detected spam actually coming from my account. I am hoping that by hosting my own account that I will be able to say definitively that no spam comes from my site.

Tuesday, January 05, 2016

Privacy Policy

Web Developers are forced into posting privacy statements on their sites.

Personally, I find the pre-occupation with privacy statements amusing as the people who are selling user information are better at writing the statements than those who are not.

Unfortunately, I am not independently wealthy and need advertisers so I can pay my web hosting fees. One can make the argument that anyone who uses advertisers is selling user information; thus committing a crime against privacy.

But, as a small web site, I have neither direct access nor receive direct payment for the user information.

The reverse is actually true. So, let's say I was a successful affiliate marketer and ran a great campaign that resulted in hundreds of sales.

The advertisers will take the information that they gather about my campaign and figure out how to cut me out of the picture. Marketing is an ugly business.

Anyway, I hate writing privacy statements. Since I am in directly in the business of selling user information, I usually just fill the statements with silly jokes.

But, this time I decided to do something different.

Last month I wrote a program to view the web code on my site; So, I rigged my privacy policy  so that it shows the code I use to log hits and shows all of the information I've collected on the visitor's IP address. Here is the Source Code for Log_Hit().

I repeat. I have to track information on my site to monitor performance and to defend against DDOS attacks. In a DDOS attack, I have to start blocking the attacking IPs.

Small web sites don't have enough data to violate your privacy. It's the big players that you have to worry about. Unfortunately, the privacy rights advocates are forcing small sites to apologize for cookies and intrusive large companies that the small sites simply cannot control.