Month: October 2009

Product Review: Motorola Motorokr S9 Headphones

I ordered a pair for a very good price ($33) from on Amazon.com. The price was right, I’d seen this same model priced at $80 or more on other sites. The seller was CCMAccessories.

Motorola Motorokr S9 earphones

The first pair I got didn’t work. Seems Motorola still has issues with the AC adapter. I contacted CCM and they issued an RMA. Took about a week but I got the new pair today. Charged them up, paired them with my iPod Touch and I’m loving them so much that I now have to get the bluetooth module for my computer.

I used to be in the camp that wondered what the hell good bluetooth was except for those asshole earphone/mic aka Uhura units. Now I know.

They sound pretty good. I haven’t yet become accustomed to wearing them but from all I’ve read I will. So far, so good. I have to figure out how to get Fring to work with them. It expects a cell phone but there has to be a way to trick it.

Some thoughts on the marriage equality issue

I’ve noticed that the tactic has changed in the fight over marriage equality. One consistent theme has always been about the children.

But I do know one thing. Knowing that homosexuality exists, or that people of the same sex can be married is pretty much accepted by kids. And that’s what the religious bigots are concerned about.

They’re concerned that you’ll see greater acceptance and tolerance of gay people. This is already becoming an issue. Just here in RI the age group 18 to 29 years supports marriage equality by an overwhelming majority of 82%. Sure that means 18% of them don’t support it but when you think about it, that tracks with the percentage of religious dipshits in this area.

And I can tell you, more of those same young people are embracing the concept of atheism too. The churches and the bigots are in for a rude awakening very soon.

And it won’t come a moment too soon for me.

The Myth that you need advanced math for computer programming

So the other day I was asked to do a program review for an educational entity. One thing that struck me is that they’ll teach them about nested IF statements in an Excel worksheet, but won’t take the logical jump to a VBA script using a CASE statement, or using DLOOKUP in Access, etc. Especially since they were doing payroll worksheets that could have benefited greatly from VBA for the tax calculations.

I should define VBA, it’s Visual BASIC for Applications. Note the BASIC – that stands for Beginners All-Purpose Symbolic Instruction Code. Some command keywords, LET, DIM, IF, CASE, DLOOKUP, and math functions like +, -, *, /, and MOD. some string functions like RIGHT, LEFT, MID, INSTR (In String, it returns the position of the first occurrence of the character in the function parameter.)

One interesting little piece I wrote took a 10 character UPC code, and then calculated the check digit. The algorithm is to sum up the digits, then round to the nearest 10’s unit and the difference between your sum and the nearest 10’s unit is the check digit.

That works out to a function that looks like this C = (UPCSum MOD 10) – in essence it give you the remainder which is useful for finding how close you are to the next tens unit. So now we land at C=10-(UPCSum MOD 10) which gives us what we need to add to get there.

Here’s another snipet of code, one that prepends “00” to each value in a column of data:

 Public Sub FixUPC()
    Dim dbs As Database, rst As Recordset
    Dim strSQL As String
    Dim UPC As String
    Dim PLU As String
       Set dbs = CurrentDb
       strSQL = "SELECT * FROM pre-export-frz_veg"
       Set rst = dbs.OpenRecordset(strSQL)
        rst.MoveFirst
    rst.MoveLast
              With rst
            .Edit
            UPC = .Fields("UPC")
            UPC = "00" + UPC
           .Field("UPC") = UPC
           .Update
        End With
      rst.Close
    Set dbs = Nothing    
 End Sub

Ok now I’ll explain what it all does:

First let me explain this was used to pad UPC numbers out to 14 characters. Standard UPC without check digit is 10 characters, with check 11 characters and GTIN (Europen code) 14 characters. You see where I’m going here.

1. Public Sub FixUPC() – all this does is define a subroutine or section of code. The Public keyword says it is accessible to all other subs, the FixUPC is the name of the subroutine, while the () is the default for closed parameters.

2. Dim dbs As Database, rst As Recordset – Here we see Dim which Dimension or Dimension a variable of type. So dbs is defined as the variable Database connection descriptor. rst is defined as the variable to contain the records returned by the query.

3 through 5. These dimension string variables for various things like the SQL language string, or the the UPC string to contain the UPC number we’re going to perform the operation on. You may note that PLU isn’t used anywhere in the code. It’s a relic of modular code. In other words, I have this saved so that I could re-use it later in other modules.

6. Set dbs = CurrentDb – Simply sets the dbs variable to point to the database in use at current

7. strSQL = “SELECT * FROM pre-export-frz_veg” – Defines the SQL (Standard Query Language) to get the data you want. The way it’s defined here it just gets everything from the table pre-export-frz_veg.

8. Set rst = dbs.OpenRecordset(strSQL) – rst contains the record set returned by the SQL statement referenced in line 7.

9. rst.MoveFirst – Moves to the first record in a recordset. Notice the rst+dot convention. MoveFirst is a method of the object rst.

10. rst.MoveLast – MOves to last record in a recordset. This is sometimes required to get the database result set to fully load. See note 9 above.

11. With rst – In other words, do this until we reach the end of the recordset (rst).

12. .Edit – this allows you to edit the contents of a database row/column cell. Notice the dot in front, that’s a reference to the rst object.

13. UPC = .Fields(“UPC”) – This is a meaty part. It says assign the variable UPC with the value from the field in the record called UPC.

14. UPC = “00” + UPC – This adds the string literal “00” to the front of the UPC code.

15. .Field(“UPC”) = UPC – Again we see the dot operator, here we say to replace the content of the field UPC with the value of the variable UPC.

16. .Update – This commits the record.

17. End With – outer boundary of the With statement.

17. rst.Close – Closes the recordset. This further commits the change.

18. Set dbs = Nothing – Just good practice. This is useful when you’re dealing with multiple database tables.

19. End Sub – End the subroutine. Required for every one.

See, very simple.

During the open discussion I explained that during my I.T. career most of the programming I did was either BASH scripting, or VBA scripting with a smattering of modifying PHP scripts. Never ran across C though did hit C++ a couple times, and even a little COBOL.

Instead they reserve the C++ course for math whizzes. Even if you do games programming and even now 99% of that is flash/ActionScript based (Been there, done that, got the t-shirt) most of the physics is built into the language already. And that’s what you need, a good physics course, not so much any math beyond intermediate algebra.

My friend says I’m being subversive by proposing this. That I would give people better data skills to the point where they’d tell their bosses to go to hell. If so, I like it!

But the myth still exists in education that you can’t take a programming class until you’ve taken high end math classes. I can tell you that this is as far from the truth as you can get.

It’s ridiculous.

Mr. (Aka Bishop) Tobin calls out Rep. Kennedy over abortion issue in health care debate

Now this should get interesting.

(PROVIDENCE, R.I.) -The Most Rev. Thomas J. Tobin, Bishop of the Roman Catholic Diocese of Providence, today issued the following statement in response to a Cybercast News Service article that reported: Rep. Patrick Kennedy (D-R.I) told CNSNews.com that the Catholic Church is doing nothing but fanning “the flames of dissent and discord” by taking the position that it will oppose the health-care reform bill under consideration in Congress unless it is amended to explicitly prohibit funding of abortion.

“Congressman Patrick Kennedy’s statement about the Catholic Church’s position on health care reform is irresponsible and ignorant of the facts. But the Congressman is correct in stating that “he can’t understand.” He got that part right.

As I wrote to Congressman Kennedy and other members of the Rhode Island Congressional Delegation recently, the Bishops of the United States are indeed in favor of comprehensive health care reform and have been for many years. But we are adamantly opposed to health care legislation that threatens the life of unborn children, requires taxpayers to pay for abortion, rations health care, or compromises the conscience of individuals.

Congressman Kennedy continues to be a disappointment to the Catholic Church and to the citizens of the State of Rhode Island. I believe the Congressman owes us an apology for his irresponsible comments. It is my fervent hope and prayer that he will find a way to provide more effective and morally responsible leadership for our state.”

Here’s my message to Mr. Tobin:

I wish someone had scraped you out of your mothers twat when you were just a blastocyst. Your mother should have squirted vinegar up there. The result would have been either spontaneous abortion or you would have survived it and become the biggest asshole around. Even if she didn’t do that, you’re still an asshole Mr. Tobin. I shall not call you by your honorary title since I do not believe in the hooey of your religion. Stop hiding behind your non-existent deities for once and realize (much to the chagrin of Governor Carcieri – another 1st class asshole) that abortion should be legal and available until we get our heads out of our asses about sex in general.

FRC tries to derail Jennings

Kevin Jennings is the Safe Schools Czar in the U.S. An openly gay man as a matter of fact.

And now the homophobes are using quotes from his own book to justify his removal. If there’s one reason I love the FRC it’s because they allow you to edit the emails you send to the state education people for your state.

So in my case the original FRC message was:

I am writing to urge you to speak out against Kevin Jennings, President Obama’s choice to lead the office of Safe and Drug Free Schools at the Department of Education. Mr. Jennings has displayed a long record of fighting AGAINST parental rights in schools. The most dramatic illustration of Jennings’ unfitness for a “safe schools” post involves an incident when he taught at Concord Academy, a private boarding school in Massachusetts. In his book One Teacher in Ten (the title is based on the discredited myth, now abandoned even by “gay” activist groups, that ten percent of the population is homosexual), he tells about a young male sophomore, “Brewster,” who confessed to Jennings “his involvement with an older man he met in Boston.” But at a GLSEN rally in 2000, Jennings told a more explicit version of “Brewster’s” story. Jennings here quotes the boy and then comments: “‘I met someone in the bus station bathroom and I went home with him.’ High school sophomore, 15 years old. That was the only way he knew how to meet gay people.”

Did Jennings report this high-risk behavior to the authorities? To the school? To the boy’s parents? No — he just told the boy, “I hope you knew to use a condom.” Sex between an adult and a young person below the “age of consent” (which varies from state to state) is a crime known as statutory rape, and some states mandate that people in certain professions report such abuse.

I strongly urge you to contact the Obama Administration to remove Kevin Jennings from his post. Our children deserve better, our families deserve better, and our nation can do better.

Which I changed to:

I am writing to urge you to speak in support of Kevin Jennings, President Obama’s choice to lead the office of Safe and Drug Free Schools at the Department of Education.

Mr. Jennings has displayed a long record of support for equal rights. The most dramatic illustration of Jennings’ fitness for a “safe schools” post involves an incident when he taught at Concord Academy, a private boarding school in Massachusetts. In his book “One Teacher in Ten” he tells about a young male sophomore, “Brewster,” who confessed to Jennings “his involvement with an older man he met in Boston.” But at a GLSEN rally in 2000, Jennings told a more explicit version of “Brewster’s” story. Jennings here quotes the boy and then comments: “‘I met someone in the bus station bathroom and I went home with him.’ High school sophomore, 15 years old. That was the only way he knew how to meet gay people.”

Jennings had no duty to report this high-risk behavior to the authorities. He just told the boy, “I hope you knew to use a condom.” Sex between an adult and a young person below the “age of consent” (which varies from state to state) is a crime known as statutory rape, and some states mandate that people in certain professions report such but at the time mandatory reporting was not required. I think what Mr. Jennings did at the time was sage advice and quite proper in the realm of things.

I strongly urge you to contact the Obama Administration to support Kevin Jennings in his post. Our children would be well served by Mr. Jennings.

BTW, in case you’re wondering I edited the homophobic twaddle.

Sometimes they make it too easy.

What our legislators are up to

For some time now the Washington Post has had rss feeds of all vote activity for my congressional representatives. It’s not too easy to setup if you don’t know that XML can be used for rss feeds.

But I’d really love to see our local rag, the Providence Journal start a similar service. As it stands we have no way of knowing how our local critters vote unless we peruse the house journals that get posted occasionally. Of course they don’t make it easy. See here.

The above is from February 24th, 2009. A former co-worker of mine figured out how to scrape the info but the project was quashed by the legislature. What is more galling is that the vote tally system is all computerized. It’d be easy to pull out the info.

But this is RI, they don’t want us to know what they’re doing.