All Things Techie With Huge, Unstructured, Intuitive Leaps

MySQL ROW_COUNT() Bug?


Had a strange bug with a MySQL stored procedure.  Consider the following line:

START TRANSACTION;
Insert into conversations(subjectLine) values(subjectLine);
IF (ROW_COUNT() > 0) then
set @pass1 = 1;
end if;

 Look closely at the IF statement.  It works perfectly on a Windows server.  When you put the CREATE statement on a Linux machine in the mysql command line, it fails and fills with garbage.  

The fix took some head-scratching, but here it is:

START TRANSACTION;
Insert into conversations(subjectLine) values(subjectLine);
IF ((SELECT ROW_COUNT()) > 0) then
set @pass1 = 1;
end if;

I had to put (SELECT ROW_COUNT()) to make it work in the Linux command line.

Mobile Has Crossed The Rubicon


This morning, I have reached a watershed moment.  It is a fascinating discovery for me, but perhaps you have already known it.  Mobile has crossed the Rubicon. By that, I mean that mobile viewing of my youtube channel has beaten out the regular youtube watch page.  I just checked out the analytics for one video, and it is astonishing:


Mobile devices
1,039 (58.1%)

YouTube watch page
730 (40.8%)

Embedded player on other websites
19 (1.1%)

YouTube other
1 (0.1%)


When you couple that with the fact that PC sales are way down, it looks like mobile has truly come of age and the desktop is going the way of the dodo bird.  It look like even the laptop is headed on the way out.

Here is the take-away.  For us developers, we have to start thinking more and more in terms of mobile, even for enterprise computing.

Just for the record, you can watch my mobile video channel here:
http://www.youtube.com/user/ochsblogger


New Type of Spam -- Blog Comments


NOTE:  IF YOU ARE READING THIS BECAUSE YOU GOT AN EMAIL FROM ME, READ THIS BLOG ENTRY, BUT ESPECIALLY THE TEXT IN RED BELOW.

I am getting a new type of spam -- link spam in my blog comments.  Link spam isn't new, however the way it is presented is.

Here is the story.  I became aware of link spam when my mother-in-law got a malware virus that sent messages to all of her email contacts.  The message was that I could earn good money by posting links.  This is of course, blackhat SEO.

The twist is this.  They picked a blog of mine that gets a lot of traffic, but not many new updates.  This is from a blog about my high school days.  I have run out of content (pictures that I have taken in high school), but my classmates and school mates google and find the pictures.  It is quite a popular blog and it is also featured in Wikipedia.  So this blog is targeted.  I must get at least 20 or more comments on various blog posts.  They all contain links.  But they are written in a friendly manner so as to pass muster.  Here are two examples:


Hey there, I think your site might be having browser compatibility issues. When I look at your website in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, excellent blog! Stop by my webpage: Florist st cloud Fl

Hі, itѕ pleаsant post regaгԁing media prіnt, wе all be familіar with meԁia is а fantastic sοuгce of facts. Alsο visit my blоg - Look for Special discounts Motels costs



The links are everything from Florida florist shops to chiropractors in Wisconsin to whatever.  I am sure that the owners of these links pay the spammer to link post and create visibility of their websites.  There is one born every minute.  What I have started to do, is to inform the owners of the links that they were scammed.

If you were referred to this blog post by email, your pathetic attempts to raise your website profile has failed.  If you paid to have your links published, you were cheated.  You are participating in a spam scheme and you have lost your money.


Uncaught ReferenceError: $ is not defined?

Okay, so I had a onload javascript function with a paramter called in a jsp.  I got the parameter from a URL.


<%

String thisParam = request.getParameter("myParam");

%>


Immediately after this line, I called a onload function passing the above parameter:

<body onload="call(<%=thisParam%>)">

I kept getting the value of thisParam is not defined.  Uncaught Reference Error.

So what cured it?

I was missing the single quotes:

<body onload="call('<%=thisParam%>')">

Hope this helps someone.

Java 8 -- Lamdas and Closures


I found this excellent blog post on Java 8 Lamda and closure:

http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html

It explains everything succinctly.  Other articles were clear as mud.  This one did it for me.

Boston Marathon Conspiracy Theories


It didn't take long for the conspiracy theory nuts to come out.  This widely circulated picture of the man on roof during explosion is part of the conspiracy theory.  The domain name   http://bostonmarathonconspiracy.com/  was bought to keep this domain out of the hands of nuts.  It has just a sober message on it to remember the victims.

This picture was a twitter sensation yesterday.  It seems that terrorist events like this, seem to attract all of the nutbars in the land.

Hunting Down The Boston Bomber


I was shocked and dismayed that someone would bomb the Boston Marathon.  The marathon is the ultimate example of how to triumph in Life by preparation, practice, true grit, determination and everything that makes us rise above the animals as human beings.

The second thought that ran through my mind, is that technology should and could be employed in the hunt to bring the Boston Bomber to justice.  I am sure that the FBI and Homeland Security are doing this, but if it were me, I would start with the premise that the bombs were detonated remotely with cell phones.  There was no suicide bomber here.  Radio Control using Radio Shack remote controllers would be out of the question due to range and interference   The easiest way for a sociopath to detonate the devices would be a throw-away cell phone.

So, going on that premise, I would data mine the cell tower data looking for numbers that didn't come back up after the bombings.  I would narrow the gap to look for numbers that were not in existence a month before the bombing, and I would data-mine the records to show which cell phone numbers have not returned to active service after the bombing.

From there, I would have probably hundreds or even thousands of numbers.  I would then program an auto-dialer to try and establish a SIP connection with the Subscriber Interface Modules of the numbers that came up in my search.  If I was able to establish contact with the SIM card, they would be eliminated as suspects.

The net result of such a search could be a throw-away, over-the-counter cell phone, but it could be identified as to where it was possibly bought, the geographic area in which it was first turned on,  and it would provide a possible starting point clues in bringing the bomber to justice.

If these anti-social, anti-human animals use technology to create terror, we have to use that same or better technology against them to take them out of this society that we live in.

Edit a day later:  It appears that there was a crude electronic timer in the bomb.  That still doesn't negate the idea of datamining the cell phone records at the time of the bombing.

Navigating a VPN connection, Viewing directories using VPN connection



It's been a dog's age since I played with a VPN on Windows.  You can set up an VPN following these instructions:

http://www.pcworld.com/article/210562/how_set_up_vpn_in_windows_7.html

So I did it and then thought: "OK, what now?  How do I navigate or see directories?".  I had forgotten.

Open an Explorer window (Windows key + e) and in the navigation bar, type in a double backslash followed by the IP address followed by another backslash then C$ to get to the base C drive directory.  From there, click to your hearts content to navigate.

Hope this helps.

Facebook Pictures Land You in Jail in the Bahamas

Banana Republic Police Chief Ellison Greenslade.

Taken from the Tribune of the Bahamas.


By DANA SMITH

Tribune Staff Reporter

dsmith@tribunemedia.net

POLICE Commissioner Ellison Greenslade has warned the public not to post “lewd” or “obscene” pictures on social media and has vowed to pursue such cases and bring charges.

He said yesterday that technology should be used for “positive reasons, not to malign persons’ characters,” and called on the public to report any published photos of such a nature.

“I send a clear message to all and sundry: have your fun on social media, send your messages to your friends; but this issue of posting lewd pictures of people, obscene pictures of people – whether they are alive or dead or injured – is an area that’s going to get you into grave problems.”

Calls to The Tribune following the commissioner’s announcement noted that earlier this week, a 17-year-old girl attempted to commit suicide by drinking bleach after an ex-boyfriend posted a nude video of her on 
Facebook, yet there have been no reports of charges in connection with this.

And, they asked, if Mr Greenslade intends to focus on social media – which in most cases a member of the public has to agree to view – what will he do about more public websites?

When asked if any charges have been made in connection with recent instances of nude photos or recordings being posted on-line, the commissioner said: “If we haven’t, then I intend to. I am going to pursue every single one of them.

“We have looked at charges already for any number of cases but I am saying particularly to persons who are grieved – the commissioner has said it – I am available to speak to them. If you don’t feel that we are moving quickly enough in the CDU or any other department, bring it to my attention. Bring it to my attention and we are going to move to deal with it.”

Mr Greenslade added: “There’s one thing to have the pictures – if it’s an adult, you are doing some things in the privacy of your own home as a consenting adult with some other adult – that has absolutely nothing to do with me, you, or the police department.

“However, where you are manipulated as a citizen to take those images and to post them – in any form – to the extent that they are now infringing upon the rights of a person and causing them undue harm and damage to their reputation, you are now on a very, very slippery slope.”

The commissioner called upon the public to report any instances to police and affirmed the police are in a position today where they can “hold the line” – or uphold the law – as it relates to the Internet.

“I don’t want to be overly aggressive with my comments other than to say, I’d like to see some improvements,” he said. “I believe we need to afford the best protection to our people.

“It’s a beautiful thing to be able to use technology but we need to use it for positive reasons, not to malign persons’ characters, not to steal monies from their bank accounts, not to cause them undue harm – or any harm for that matter. I am so pleased that I have an opportunity to say to the public, we stand with you and I’m not going to stand by. But you must let us know so if you’re surfing the net and you come across it. Trust me and send it to me and let me as commissioner give a directive.”

Despite democracy, there are some things that “you cannot do,” Mr Greenslade said, if those things contravene the law.

Many callers mentioned tabloid websites that regularly publish false and damaging content of a political nature, but have never been prosecuted.

Mr Greenslade added: “I sound that clarion call this morning and I demonstrate by action, how serious I am about that. I am prepared to speak to it again and again, until that message is clear. If you post on Facebook or any other social media anything that is contrary to law, that is obscene or indecent, and it infringes upon the rights of any other citizen, this commissioner and all members of the RBPF – I daresay all of us in public safety – are going to take action because we have a problem with that. We are not going to ignore it.”


Background Context:  The Bahamas has one of the highest murder per capita rates in the world.  The islands are rife with drug running, human trafficking, shootings and robberies.  Tourists are robbed at gun point.  The unsolved murder rate is incredibly high.  There was an extra-judicial killing of an escaped prisoner by a prison guard who has never been brought to justice.  There has been two high profile murders of prominent gay men that are unsolved because of "special involvement" with the men on a personal level by the Prime Minister.  A British banker was putatively killed by his ex-partner and never been brought to justice.  The first Prime Minister's son killed his girl friend.  And yet they are going to prosecute Facebook picture postings.  This came about when an activist posted Facebook pics of a prisoner who died in custody.  This police chief arrested that man yesterday.  Someone should call Amnesty International.

Original link:  http://www.tribune242.com/news/2013/apr/05/commissioner-warning-over-use-of-social-media/

Amazon Just Doesn't Care for Content Providers


Amazon has a unique paradigm.  They create a marketplace and then invite the public to contribute content to their marketplace.  I am an Android developer (as well as an Apple developer) and I get regular emails from Amazon harassing me to upload my apps to the Amazon store.

Amazon also makes the Kindle which is a dedicated eReader.  They created a self-publishing platform where any Tom, Dick or Harry can sell their books to the public directly.  They also created a community forum for these same people to connect with one another to solve their publishing issues.

It was a masterful stroke, because with the forum, they no longer needed a support line at Amazon.  Other users would answer the questions.  It is a prime example of maximizing the profits while minimizing the expenses.

However, in the minimizing their expenses department, the forum moderators do not even visit every day.  Hence when the robo-spammers attack, the forums are filled with link farms, link spam and crap.  It takes days for the moderator (probably an intern) to notice and clean out the spam.

Amazon certainly knows how to save a buck.

As for me, I think that the reason is that Amazon knows that dedicated hardware to read books is on the way out with the new tablets coming online.  Still, they should show a measure of respect for the content providers that made them millions.

Surface Windows 8 Touchscreen -- Piece of Crap for Web Developers


We have an enterprise web app.  Every time a new version of any browser comes out, we wonder about compatibility.  Back in the early days of the web, it was a total pain in the ass to develop for IE, Netscape, Opera, Safari, FireFox and the lot.  They all had their quirks.

It seems that everyone has learned except Microsoft.  We had issues with IE 9 that we coded around.  We were compatible with IE 10 on a laptop.  But get this.  We have a simple css drop-down menu.  Here is the code:


.menu a:hover{
color:#bbbbbb;
background-color:#fff;
transition:color .3s, background .3s,-moz-box-shadow 2s, -webkit-box-shadow 2s, box-shadow 2s;
-moz-transition:color .3s, background .3s,-moz-box-shadow 2s, -webkit-box-shadow 2s, box-shadow 2s;
-webkit-transition:color .3s, background .3s,-moz-box-shadow 2s, -webkit-box-shadow 2s, box-shadow 2s;
-o-transition:color .3s, background .3s,-moz-box-shadow 2s, -webkit-box-shadow 2s, box-shadow 2s;
-moz-box-shadow:0 2px 4px #fff;
-webkit-box-shadow:0 2px 4px #fff;
box-shadow:0 2px 4px #fff;
cursor:pointer;
}

It works really well with everyone.  Even with IE 10.  Time to relax.  Not on your life.  Although it works with IE10, it doesn't work on the Surface, touch screen.  It works on a regular screen but not on the touch screen.  It is enough to make you want to pull out your hair.

Microsoft is truly dead man walking.

java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0



One of my programming guys was getting this error:

java.lang.UnsupportedClassVersionError:  Unsupported major.minor version 51.0

and Tomcat failed to start.

The message from the tomcat logs was:

SEVERE: Catalina.start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]

The fix was simple.  He was compiling at JRE version 1.7 and the JRE on the server was 1.6.  This was easily fixed in Eclipse under Project Properties > Java Compiler.

Hope this helps someone.

Programmers in Paradise - iOS Apple App Programming Bootcamp


So you have always wanted to program apps for iPhone, and sell them on iTunes.  But you don't know where to begin?  What about Programmers in Paradise? 

All you have to do, is pack your bathing suit, some shorts and sandals, perhaps a snorkel and show up to an Apple iOS Programming Boot Camp in the Bahamas.  You will stay at an all inclusive, be given to keep,  a MacBook Pro and an iPad and get intensive bootcamp training and hands on instruction to develop your iPhone apps.  You will learn how to create apps in Objective C using XCode, and you will be doing it in the tropical sun.

There is even provision for extras like learning the Zen of Programming by attending a few meditations lessons at a genuine Buddhist ashram, lessons in kiteboarding and an a few snorkeling trips.

Inquiries to:  DataPrivacy@mail.com


MySQL for iOS and iOS -- Compiled Libraries


Hey.  Do you need some compiled MySQL libraries for iOS and iOX.  Karl Kraft is a frigging genius and I downloaded his source for a MySQL client.  I built it for iOS/iOX and it built first time, every time with no issues, and it worked the first time that I tried it.

If you want to save some time, or are having trouble compiling, I have loaded a zip file on fileden.com with the lib folder.  It is separated into

libmysqlclient.a for IOS
libmysqlclient.a for IOX


You can find the binaries here:
http://www.fileden.com/files/2011/6/23/3156918/lib.zip
in a zip folder.  And here is some code samples on how to use it:

http://www.karlkraft.com/index.php/2010/06/02/mysql-and-objective-c/

Good Luck.

Chrome Browser Blocker

Here is a strange one for you.  I went to isizulu.net, an African site.  The site hosts a Zulu language translator.  I had a word in Zulu that I wanted translated.  I searched for this translator online and when I clicked on it, I got the following message:  "Google Chrome not welcome.  isiZulu.net disapproves of Google because their "services" are designed to trample on privacy and monopolize the web.  Please choose a different browser vendor."

Strange.