Wednesday, December 17, 2008

Powerful MySQL 5.1 - Cool is an understatement

MySQL 5.1 is here - as I was reading through MySQL's white paper on the new features, I occasionally thought, "yeah, that is cool." The most exciting things though were when I read about some features that made me get excited enough to want to blog about it. There are some totally powerful and powerfully cool features in 5.1

SQL Profiling

For example, the SQL Profiling Utility which lets you see exactly how much time the SQL server did doing what while it logged a profiling session. You can start and stop the session, then look back at each query that happened and then see in microsecond detail what things are taking a long time and which are taking... well, microseconds.
You'll be able to see in certain terms what things are taking a long time and what queries, indexes, or settings or hardware should be improved.

Replication

There are great replication features available that make it more reliable and able to ensure that the master and slave or a whole cluster are correctly in sync. Hurray for row-based replication!

Query Logs

The Slow Query Log and General Query Log are now logged as CSV files, which are accessible (along with any other CSV file) through the MySQL server, which makes it easy to see exactly which queries are taking the longest.

Process List

The show processlist command can now also be accessed through SQL (someone read my thoughts!) which means I can have one thread check whether another thread is currently running a query and how long it has been running, and how many other things are running and then the thread could decide whether it should go ahead or wait or abort. That would have been so hard before, and now it would be pretty simple.

CSV Storage Engine

The CSV Storage Engine gives us a whole new way to think about how to deal with CSV files. You can load any file instantly into MySQL and access it there as a normal table with SQL commands. I could have really used this 5 or 10 years ago, and all my manual work importing CSV files would have been handled in a fraction of the time. A ton of the work that we have to do with programming can now be done with SQL queries instead.

Event Scheduler

There is now an Event Scheduler which makes it easy to optimize tables or execute any other command and set them on a MySQL cron rather than have to depend
on (or remember to setup) Linux crons and their accompanying programs.

Table and Index Partitions

There are awesome new indexing features - the coolest is the ability to create Table and Index Partitions. Now queries against sets of data only need to look for the data in a fraction of the table.
Say we have web logs that are being added to a database or click through tracking data. Over time it grows and grows until we have millions of records. In the past we'd have to delete data or else summarize it and archive it, at which point we don't actually have all the data available to us anymore, just the summary, or we don't have it at all. If we setup table partitions instead, we can migrate partitions off to other physical locations (meaning we could move a set of the table to another physical disk partition), and the table would just keep plugging along. Meanwhile, the queries that only care about the last week or month, or the last year, as well as the queries that only care about January 3 years ago don't have to look through huge indexes or scan the whole table, they just look in the partitions they need data from and use the indexes for those partitions. That is a huge, HUGE benefit. This is the kind of thing that makes a Google search engine run quickly.

Full-text search enhancements and Plug-ins!

There is enhanced full-text search capability, with even the option to build your own plug-ins.


I haven't read about new features this cool for a long time. It will mean a lot of people being able to use a lot of data more efficiently and more quickly than ever before.

Saturday, November 08, 2008

Glow Brightly bedtime song

My 7-year-old daughter spontaneously came up with another bedtime song that I want to write down before I forget. I'm sure she'll like it if I remember it and sing it to her again...


Goodnight fireflies! Close your eyes.

Glow brightly. Glow brightly.


While you sleep the stars will shine.

Glow brightly. Glow brightly.

Actually, I came up the second part to match the first right after she sang it.

The melody goes like this:
Mi Sol Mi Do, Mi Sol Mi -
Re Mi Fa, Mi Fa Sol.

Mi Sol Mi Do, Mi Sol Mi -
Re Mi Fa, Mi Re Do.

I think I'll try to come up with another verse now...

Heaven's close now. Close your eyes.

Let your heart glow brightly.


Sing your praises to the skies!

Glow brightly! Glow brightly.


At first I wasn't sure whether it should say "Pray for hope now", or "Heaven's close now." Michelle like it better with "Heaven's close" and I think I like that better too.

Like with my other songs on this blog, feel free to use this, but if you ever write it down or use it, you need to give credit to me and my daughter. Let me know if you like it or use it in a public venue or want to try to make money with it, since it is after all copyright Daniel Lee Gibby, November 2008.

:)

Wednesday, November 05, 2008

Conserving our Nation's Precious Resources

George Washington said:
"Of all the dispositions and habits which lead to political prosperity, Religion and Morality are indispensable supports."
Our constitution was made by a religious people.

Many times people invoke the separation of church and state to mean something it was not intended to be. This separation of church and state was probably first mentioned when President Thomas Jefferson mentioned a wall of separation between church and state in a letter to a Baptist church organization in Connecticut. The Danbury Baptists had previously written President Jefferson since they were concerned that the state of Connecticut was establishing a state religion that was not of their religious persuasion. Here is the text of President Jefferson's letter to the Danbury Baptists:
"To messers Nehemiah Dodge, Ephraim Robbins, & Stephen S. Nelson a committee of the Danbury Baptist association in the state of Connecticut.
Gentlemen
The affectionate sentiments of esteem & approbation which you are so good as to express towards me, on behalf of the Danbury Baptist association, give me the highest satisfaction. My duties dictate a faithful & zealous pursuit of the interests of my constituents, and in proportion as they are persuaded of my fidelity to those duties, the discharge of them becomes more & more pleasing.
Believing with you that religion is a matter which lies solely between man & his god, that he owes account to none other for his faith or his worship, that the legitimate powers of government reach actions only, and not opinions, I contemplate with sovereign reverence that act of the whole American people which declared that their legislature should make no law respecting an establishment of religion, or prohibiting the free exercise thereof, thus building a wall of separation between church and state.
Adhering to this expression of the supreme will of the nation in behalf of the rights of conscience, I shall see with sincere satisfaction the progress of those sentiments which tend to restore to man all his natural rights, convinced he has no natural right in opposition to his social duties.
I reciprocate your kind prayers for the protection and blessing of the common Father and creator of man, and tender you for yourselves and your religious association, assurances of my high respect & esteem.
(signed) Thomas Jefferson
Jan.1.1802."

Notice that nothing President Jefferson says disagrees with what President Washington said. When Jefferson spoke of the separation of church and state, he was not implying that the morals of the church should not guide the state, he was remembering the oppression of his fathers in Great Britain where they were not allowed to choose a religion because there was a state religion. He was assuring the Danbury Baptists that the nation would not choose any one religion over another. He actually didn't even go as far as to speak as to whether the state of Connecticut could or could not do that in his letter, but it might be implied.

Notice particularly the sentence where Jefferson mentions the separation of church and state:
"I contemplate with sovereign reverence that act of the whole American people which declared that their legislature should make no law respecting an establishment of religion, or prohibiting the free exercise thereof, thus building a wall of separation between church and state."
If we were to translate this to today's language, it might be written this way:
I think of the Constitution and its first amendment which was passed by the whole American people in high reverence. In effect that Constitution says that our legislature should not force anyone to worship in or belong to any particular religion, and also allows everyone to freely believe whatever religion they choose. This creates a wall of separation between church and state.
Many people falsely imply that Jefferson somehow meant that no church should have any right to speak in the public forum regarding anything that has to do with politics. Let's think of the logical implications of that line of thinking for a minute.

If we assume a church should not talk about anything political, it must be determined what is political and what isn't. Governmental politics is the process by which groups of people make various decisions that effect how the people are governed. As the government in the United States of America is defined so as to be ran 'by the people, for the people,' anything that would effect the rights of any citizen of the country would be considered something of political nature. Also, anything that would effect the government's interaction with any citizen of the country would be political in nature. We would also probably conclude that anything that effects or alters the ability for citizens to freely choose their path through their 'pursuit of happiness' is political.

So, in simple terms, if the people are discussing anything that would have an effect on citizens of the country, it is political.

So logically, if that is what is meant by politics, and if churches are to have no input on anything political, churches pretty much can't say anything at all about daily life in the world. I guess they are just supposed to talk about what came before this life and what will come in the afterlife but leave us in the dark about how we are supposed to get from here to there. That is the logical end result of the 'churches should stay out of politics' frame of mind.

So, I'd like to leave that frame of mind. I suppose there are some churches that say that it doesn't matter what you do, they say you are predestined to heaven or hell and God has already chosen your path, so just be thankful for what you have and go on with life. I know there are some churches that used to say pretty much exactly that, and there are many more today that say things fairly similar. But to me, a church that doesn't help me in my daily life to get closer to my end goal is not really doing me much good.

Here are two more letters that are sometimes misinterpreted to mean that Jefferson thought that in no way should religion ever give its stand on political issues.
"I do not believe it is for the interest of religion to invite the civil magistrate to direct its exercises, its discipline, or its doctrines; nor of the religious societies that the general government should be invested with the power of effecting any uniformity of time or matter among them. Fasting and prayer are religious exercises. The enjoining them, an act of discipline. Every religious society has a right to determine for itself the times for these exercises and the objects proper for them according to their own particular tenets; and this right can never be safer than in their own hands where the Constitution has deposited it... Every one must act according to the dictates of his own reason, and mine tells me that civil powers alone have been given to the President of the United States, and no authority to direct the religious exercises of his constituents (letter to Samuel Miller, Jan. 23, 1808).

...(O)ur rulers can have no authority over such natural rights, only as we have submitted to them. The rights of conscience we never submitted, we could not submit. We are answerable for them to our God. The legitimate powers of government extend to such acts only as are injurious to others. But it does me no injury for my neighbor to say there are twenty gods or no god. In neither picks my pocket nor breaks my leg (Notes on Virginia, 1785.)
I don't see why these letters would be misinterpreted to mean what people think they do, except that possibly people don't read 18th century English very well or maybe hope others don't. To me they are clear examples that show again a few things:
  1. Jefferson was religious himself
  2. It was his opinion that religion shouldn't ask the government to be in charge of it
  3. The government should not organize or direct religions for its people
  4. He believed we received inalienable rights of conscience and moral agency from God.
  5. Government should be tolerant of all religions.
If anyone else found a point in one of those letters that says something along the lines of 'religion should stay out of politics', I'd like to know where. Regardless, there is no wording regarding separation between church and state in the Constitution or the Declaration of Independence. Jefferson is regularly invoked for a separation that he did not imply.

Yet, we regularly hear of the separation of church and state as if Jefferson and other founding fathers meant that religion should stay out of politics completely. In fact, they meant nothing of the sort and meant much the opposite.

To ask that individuals leave their morals home in the forming of laws that govern the people is ridiculous and logically impossible. Not only that, it was not what our founding fathers had in mind for us. They were mostly all religious themselves, and they formed a government which allowed for the people to choose for themselves which religion or even a lack of religion they would follow.
"Our law is by definition a codification of our morality"
- Barrack Hussein Obama, 2006
Morally liberal arguments followed to their logical conclusion say that there is no need for morals at all, and that we would be all better off if everyone was just allowed to be 'free'. The problem is that logically following their definition of being free to its conclusion means that anyone should be allowed to do whatever they want with no consequences. Very few really think that and say "of course that's not what I think", but that is where those arguments lead.

The liberal view seems to be to make everyone be taken care of, which is a good goal, but it should not be done by coercion or by force, which is where morals come in. I should want to give to my neighbor because it is the right thing to do, not because I'll go to prison if I don't pay my taxes. That's morality.

If liberals don't really believe that everyone should be able to do whatever they want with no consequences, then they believe in morality in some form, which seems to basically be that we shouldn't hurt each other or each other's property. If that is all law is about, then the liberal mottos should be:
  1. Leave me alone and let me do what I want, and I'll leave you alone.
  2. I want my government to take care of me and everyone else.
Unfortunately, at their core, those two liberal mottos are selfish. Selfishness does not make a great country.

The pursuit of happiness should be allowed for all people so that they can make their own choices. If I am expected to support cause after cause through my taxes then I no longer have the choice whether I could use that money in some other way, whether it be to help someone else or not.

Our country rightfully allows someone who doesn't want to give to their neighbor to spend their money in whatever way they choose, even to their own destruction. We can try to help them make good choices, but their choices in their end are their own. There are certain inalienable god-given rights, and there are also government-given rights. Life, liberty and the pursuit of happiness are all based in choice.

For a government to be able to sustain itself over time, its people must:
  1. Sustain the principles of free choice
  2. Limit the number of additional government-given rights
  3. Not attempt to take away the inalienable rights of any of its people
Regarding not taking away inalienable rights and sustaining the principles of free choice, there are times that the government must make laws that do not actually limit a person's choice, but do impose consequences on those choices. There are horrific things that almost everyone in the world agrees should be against the law of the land. To kill another person is to take away the gift of life, which is tragic and wrong because it takes from the victim their free choice. It is similarly dangerous to tamper with the entrance into life, or to kill a life before it has even begun. Freedoms should be extended to all so they have the opportunity to be happy. When someone is seeking self gratification to the point of self destruction it is hard to know whether government should step in, but when it gets to the point that they are destroying the well being or lives of others, laws should be made and enforced so that there are limits to the damage an individual can do. The government over-steps its bounds if it attempts to limit the choice of any individual.
However, the government is morally bound to set consequences to those who take away the rights, property or life of others. If the government were not morally bound, there would be no basis to have any laws at all.

When people choose things that are destructive to themselves, it usually affects those around them. That is when laws that might seem pointed at taking away the liberties of individuals are really meant to protect others. For example, if all drugs were legalized many who would not otherwise have their lives destroyed would become victim.

Many times government over-reaches into individuals' lives... especially outside of our country. But individuals still have a god-given right to choose for themselves their own path. The reason good governments should have at their core a tie to religion and morality is because without those pillars the care for self becomes greater than the care for others. Those who care for others have morals that cause them to do so. When we care for others our happiness grows. When we care only for ourselves, we expect our government to take care of us but the government is unable to do it if no-one cares for others, because the government is run by the same people who give it power.

People tire of oppression, and rightly so. Over time their innate freedom of choice makes them want to be able to choose more. But if their choices are focused mainly on helping themselves, inevitably the government they seek to create is one that will take them back to the bonds that were once broken.

Look at Russia to see an example of what happens when freedom swells until the governed oppressed become courageous enough to overthrow their shackles, allowing a new government to be chosen. Their continuing struggle is more difficult for them because those making the choices of how the government should be were not given the opportunity to be taught morality. They were taught from their youth that their government would take care of them, and that their individual choice was limited only to what would 'benefit the society'. The irony being that in taking away the choice to find out for themselves what would lead to a fulfilling life, the people were not all happier or living in a more perfected society. So, the promises of the left to extend more and more government-given 'rights' to the people leads in its end to oppression of choice, while the leaders of the movement to subjugate the people claim that the people are getting a fuller expression of their rights.

Through history you don't often see political parties that claim for their platform to hold morally conservative values and yet otherwise have fiscally liberal values. Historically, our nation's democratic party was much more morally conservative and the republican party was more as well, along with being more fiscally conservative. The republicans have rightly lost recent elections because they didn't hold their moral ground and have at times lied and pandered along with the rest, out of fear and greed. That doesn't mean I should stop voting for the party that is most likely to uphold my values (and unfortunately only a party that can potentially win is able), otherwise I might vote for a third party, such as the Constitution party.

Today is a proud day for our nation and really shows how wise our Constitution was formulated in a way where no group would hold power except the majority. The change I hope in is that the majority will understand the founding basis of our country and the source of its providence. The day the majority choose evil is the day the nation will start to fall. My fears lie in that this happened before I was born. My hopes lie in that there are many who only choose incorrectly because they know not where to choose correctly and if they are educated with correct principles they will choose a government that governs fairly and continue to be blessed with the blessings of heaven.

I hope that no matter someone's belief they can be civil and respect my rights and not oppress me or secretively or unknowingly oppress those who don't have the full ability yet to choose for themselves because they haven't been free to have life's experiences to the point yet to where they can be accountable for their choices.

If people use their freedom of choice to infringe on the rights of others, on the right of parents to teach their morals, or on the unborn or the innocent (school kids who are still being taught what is right and wrong), by twisting true principles together with false ideas, I'll let my voice be heard. The way towards making sure no-one is oppressed is for everyone to be not harbor hateful or disrespectful attitudes towards their supposed oppressors. Sarcasim and generalizations are forms of attacks that warrant defense, and it is hard to not respond in kind - it is fallen human's nature. However, someone who governs their choices and who purposefully limits their actions so as to be respectful and yet maintain their views is able to open channels of communication and both sides are able to learn and find common ground. There has been hatred from both sides of the political and moral battles, but what angers me are the hateful accusations of hatred that do not exist.

As citizens of the world, and especially of the nation of the United States of America, we should recognize that mostly we hold the same values and that we can all hope our nation continues in peaceful strides towards real freedom of choice - the kind that the government cannot give and should not attempt to take away.

Tuesday, October 07, 2008

Music available from General Conference!

Last spring, as I've become accustomed to do after each General Conference, I downloaded the talks from the April 2008 sessions. I downloaded the talks and have enjoyed them ever since then. I also remember feeling the Spirit very strongly during the hymns the choirs sang, and I was hoping that I'd be able to download the music as well as the spoken word.

There wasn't a way to download the music without downloading each session as one large .mp3 file. I didn't want to do that, but I did decide to make a comment at the feedback link of the church site, asking whether they might consider making the songs from General Conference available as they do the talks.

I did receive a response from someone at the church thanking me for my suggestion. I don't remember the exact words they said, it didn't promise anything but I do remember that whoever it was that had written to me did think my idea had merit.

Well, six months have passed and we have just had another wonderful conference. Again, the talks were inspiring and music superbly motivational, each being a testimony of the kingdom of God being on the earth.

As I went to download the talks this time, there was a little more to the content of the page than I was used to. There is now a podcast available that automatically updates each conference. This makes it so your mp3 player can be setup to download the talks for you without you having to remember to come back and download the sessions (as if I'd forget). Even better than that, it makes it so you don't have to individually click to download each talk as an mp3, saving them into the folder you setup for them. Rather, it is all taken care of... just set up your subscription to the podcast once. I use WinAmp (I even paid for a Pro version a couple of years ago), but iTunes and many other programs can also subscribe to podcasts.

Well, to my surprise, as I put the podcast into WinAmp, it downloaded the first thing in its list automatically, and it was a hymn! The opening music you hear as the announcer says: 'This is the 178th Semi-annual General Conference of the Church of Jesus Christ of Latter-day Saints'. (Oops, I hope that wasn't an unauthorized transcription- but I think Bonneville Communications might be fine with that much...) So, quickly I looked through the list of mp3 files available in the podcast and all the hymns were there!

I went back to the Church website to see if they might have retroactively made hymns available, or if I might have missed the podcast option before. It was there for April, but no music was available. And then I noticed that there is even a link for just the music starting with this fall's conference!

They took my comment to heart and made the music available! I don't dare think that I'm the only one who asked for it, but if it was my request that made it happen, that's pretty neat. I'm listening to the music right now. It is heavenly.

Here's the mp3 podcast link.

Here's an mp4 podcast link.

Friday, May 30, 2008

Technical Google searches many times lead to irrelevant results

I've used Google from the beginning and it is great... but I was hoping that by now some search problems would be solved. The major feature I find lacking in any search engine is the ability to search for exact matches of any combination of characters. You know, the types of things that show up in programming source code, but usually get ignored by search engines.

Note: The rest of the below is pretty technical, someone who has knowledge of programming using perl or mysql would understand what I'm talking about in the details, but others will understand the gist of what I'm saying if they just skip past the parts that talk about the programming languages that I mention.

I know that MySQL by default doesn't allow full text indexing of the various characters + = , -, etc. and maybe that is why Google isn't able to search for something like '++' and find results for that exact match, but it sure would be handy if I could search for things related to coding in various languages and actually find results related to what I'm looking for.

For example, if I'm looking for help related to a hugely useful and hugely used functionality in Perl, I might look for help with the =~ operator, or ~=, whichever it is, I can never remember, which is why I've tried searching for it from time to time. The problem is, even if I search for that exact phrase with quotes around it- "=~", I don't get any results that have that exact match, unless I'm lucky and just happen to type perl "=~" and then the search for perl happens to show something down in the results with =~ in it. My point is there are tons of things like that which should be search-able, but aren't. There are pages on the web dedicated to explaining how to use =~ in perl, and if I were to search for 'perl "=~"', you would expect that I'd get 200-300 or more results and they'd be totally relevant. Instead, I'm left with nothing really relevant.

Here's another example related to searching for something related to MySQL. This is a lesser used functionality that MySQL has, but it is very valuable from time to time.

:= is a way of assigning a value from within a MySQL statement to a variable so that it can be used again in the WHERE part of the query. It isn't something that is used all the time, so when I forget what the syntax is, I try searching for it on Google. What happens? There are no relevant results. I also try searching for it on MySQL's site, and they have the same problem.

These types of things are pretty annoying. I wonder if any-one has worked on solving this problem. I've searched for another search engine that can handle it, and haven't found anyone yet.

Google was started by and was originally most useful to techies because of the enabling power it gave to those who used it. I think it is time that someone work on the problem of indexing and returning relevant results for technical programming-type phrase searches.

I'm sure it is more than just flipping a few switches, but I'll be waiting right here...