All Things Techie With Huge, Unstructured, Intuitive Leaps

Android Development Call A New Activity From ItemDetailFragment

I had to quickly look this up, so others might too.  How do you call a new activity from a fragment or the ItemDetailFragment?  Get the parent.  Like this:

Intent myIntent = new Intent(getActivity(), NameYourClass.class);
getActivity().startActivity(myIntent);
getActivity().startActivity(myIntent);



Hope this helps someone.

Dropbox New Privacy Policy

One of my colleagues signed me up dropbox.  I have never used it because I develop privacy apps and I don't let any app have access to my computer.  But I still get notices.  Their latest is their new privacy policy.  As usual, it has my privacy spidey senses tingling.   I got the following notice from dropbox:



We want to let you know about some upcoming updates to ourTerms of Service and Privacy Policy. These updates will go into effect on March 24, 2014.
You can find more details on our blog, but here’s a quick overview:
  • We’re adding an arbitration section to our updated Terms of Service. Arbitration is a quick and efficient way to resolve disputes, and it provides an alternative to things like state or federal courts where the process could take months or even years. If you don’t want to agree to arbitration, you can easily opt out via an online form, within 30-days of these Terms becoming effective. This form, and other details, are available on our blog.
  • We’ve added a section to our Privacy Policy that discusses our recently launched Government Data Request Principles. We’ve also made clarifications to better explain how our services will use your information. For example, we explain that when you give us access to your contacts, we’ll store them so that you – and only you – can do things like share your stuff easily, no matter what device you’re using.
  • We’ve also updated our Terms of Service and Privacy Policy to better explain and reflect our growing list of features for Dropbox for Business customers.
While we’ve simplified much of the language, our commitment to keeping your stuff safe and secure hasn’t changed. We don’t sell your personal information to third parties. We don’t serve ads based on the stuff you store in our services. As always, your stuff is yours.
If you have any questions about these updates, you can read more on our blog or email us at tos-questions@dropbox.com.
Thanks for using Dropbox!
- The Dropbox Team

Funeral Home Virus Spam

(click for larger image)

Now doesn't this beat all.  I got virus-injection spam purporting to be from a funeral home.  All that I had to do was click a link.  Here is the text of the spam (pictured above):

Eubank Funeral Home info@oceanpromenadehotel.com
Eubank 
Funeral Home & Cremation Services

For this unprecedented event, we offer our deepest prayers of condolence and invite to you to be present at the
celebration of your friends life service on Sunday, February 9, 2014 that will take place at Eubank
Funeral Home at 11:00 a.m. 

Please find invitation and more detailed information about the farewell ceremony here .

Best wishes and prayers,

Funeral home receptionist,
Jacob Faulkner 

Copyright 2014 Funeral Home Website Design By: Frazer Consultants LLC

Notice the nice little touched like the copyright and designed by footer.  It has the characteristics of regular spam.  The mail domain is from one domain.  When you hover over the link, it is another domain, and none of the names are the same as who the sender is supposed to be (Eubank Funeral Home in this case).

Speaking of the link, it goes to the domain DanielCespedes.com.  It turns out that Daniel Cespedes is a guy who died while escaping police custody in Florida for statutory rape.  He linked up with a minor MySpace celebrity called Kiki Kanibal who was a minor and apparently raped her.  The domain is parked and under construction, but the spammers hacked the account and put their virus in a hidden page in that domain where the link takes you.  Half the spam that comes is from hacked legitimate accounts.  If you have dormant accounts, websites, email addresses etc, it helps to change the passwords regularly and make them really hard to guess with a good combo of letters, numbers and characters.

All this to say, never click out of curiosity.  Remember, curiosity killed the cat.

Android App Development -- Getting HTTP Post to Work

This could be titled: "How To Make HTTP Get Request To Server - Android Example", or it could be titled "Android HTTP Post Error", or it could be titled "How to overcome a stubborn exception trying to programatically make a call to a server".  Or it could simply be called "HTTP Nut Crush".  OK, kiddie scripters, the internet is full of examples how to use an http client in Android to post to a server -- right?  Right!

Here's the code:

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.wasteTime.com?data=crap")
try {    
      // Execute HTTP Post Request  
      HttpResponse response = httpclient.execute(httppost);  
      Log.w("HTTP Response", response.getStatusLine().toString());

    } catch (Exception e) { 

    }

 Piece of cake.  However the f*&K*ing thing doesn't work.  I tried putting in Log.w("Message", e.getMessage()) in the catch block, and it threw a Null Pointer exception.  Get stacktrace didn't work.
Finally in frustration, I put in e.printStackTrace() and I got this jolly frigging error:

02-14 14:50:53.440: W/System.err(10005): android.os.NetworkOnMainThreadException
02-14 14:50:53.440: W/System.err(10005): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1077)

Obviously I was violating some new turdlet policy that wouldn't let me make the call to the server. 

So what to do?

It turns out that the answer was simple.  You cannot do networking stuff on the main UI thread in Honeycomb SDK and higher.  To fix it, you have to kick a new thread.  Here is the working code.

new Thread(new Runnable() {

 public void run() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.wasteTime.com?data=crap")
try {    
      // Execute HTTP Post Request  
      HttpResponse response = httpclient.execute(httppost);  
      Log.w("HTTP Response", response.getStatusLine().toString());

    } catch (Exception e) {  e.printStackTrace();
}
}
 }).start();

Hope this helps someone.

mysql REPLACE INTO Keyword

I don't bother with the fancy stuff, but I have a coder that works for me who does.  I usually work and write from first principles so that those that follow me can fix my code easily.  However there are convenience methods, and one of my coders recently used the mysql REPLACE INTO keyword, so I thought that I would document it.

Suppose that you wanted to replace an entire row of data while keeping the same primary key identifier.  The way that you would do this normally would be like this:

DELETE FROM myTable WHERE myPrimaryKey = 1;
INSERT INTO myTable(
  myPrimaryKey,
  myColumn1,
  myColumn2
) VALUES (
  1,
  'value1',
  'value2'
);

To do the same thing as above, the REPLACE INTO convenience method works like this:

REPLACE INTO myTable (
  myPrimaryKey,
  myColumn1,
  myColumn2
) VALUES (
  1,
  'value1',
  'value2'
);

Hopes this helps someone.

Belarus Spam in Yahoo mailbox that's kind of weird


With the widespread security breaches at Yahoo mail, weird things were happening.  I would get Yahoo mail in my inbox but I couldn't open it.  The twitterverse was alive with people with  the same problem.  After those problems were fixed, I started getting weird spam originating out of Russia and it old satellite states -- namely Belarus.  Notice the .by domain name for Belarus.  (Incidentally Belarus translates into English as White Russia.  Apparently there is White Russians and Black Russians -- darker skinned versions that have nothing to do with Africa).

The weirdness of the above spam (other than the fact that there were no links to click), was that there was tiny hidden text in the above spam.  When I selected and copied the text into notepad, this is what actually appeared:

Teenage Mrs. Bruna Rzasa and her intimate adventures
Spam
x


Bruna Rzasa djouiafa@mgts.by
8:24 AM (33 minutes ago)

to me 

Why is this message in Spam? It's similar to messages that were detected by our spam filters.  Learn more
_________________________________________ Hearing the questions about to stay. Replied shirley as though she wondered vera 
¸²®Greetings, white manΩ³sweet !!ÃÕ­It's me,æ¹íBruna !!Sorry dave in without the kitchen table. Clark smile at his own thoughts that. 
ÊߨNeed to try it going. Begged charlie waited for them 

ª·ôI£ùÔ ©ÀÐfèäçoî¿õuÓå¬n¬£³d¤Çõ áÔµyÔíÛoÅ´­u®Ê·r³ß½ ÖÁ°pß׳r¨º­o¦­²fÊâàiìèàlÉúÙeçÆã Æî´vÚâªi³Á¢aËÿÒ Óå¼fËö®a¾¹Ýc¢ååe£©±bÝŶoììËoõãôkù×ç.È¡º ¹ì×I¿ëÚ ÂÍðwçÑØaÓüÌsþÁ³ ×ûÓeÏÈÉxä׫cÚø¨iØÀçt³ôªeÅ«êd¹ø¶!¼´ÿ ÜÉËYõìÝoéÇÐuÁÚ¤'Ûí»ràÀáe¸¹Þ ­ô¥c÷ñ¼uäöÇtÞ²Æe×Ú½!Struggling to keep from under the door. Melvin will do anything like. 


½ÐøIíúû ©æÓwÏêëa»²én»á­tÂãü éò½tþ¥ºo¿§Û é¥ÝsÖÕØhìà§aºô¶rõ¯¦eº® Ï¢òså¤Ìo£ÜÀmëþ³e±Ñþ ìâh·ßýoØýÂt·«¹ ¼íøp±³òh³Ó¥oÏãït£Ô¿o°Å©sªÖå î¢èwóª¹i®¾´tƯÓhëߥ èàÂy÷âýo¿ó¶uÂéæ,¿ã¯ ÕòÄbææa¢à®bìÛàe»ì·!Unable to thank you happy adam. Suddenly realized she did as her adam. 

«ÏÙGëÔóoõ¡¬tóÞª øÏÂb­îÑiÊôÙgªü­ ®¨ÅbÿÐÚo»¦ÉoÚ·ôb¼ÊÌsþÀÛ,ÓÚÙ äÁùaÎÊ¢n°¹ÁdÌÂ× ð¹óa¶Ì¸ þÑ®bæ±Ëió¢ÛgÔÙç µÓßbÛüµuèüèt¯ý¬tÑØÈ...Ìá® ÈÇ¿aäïÇnééödß¨ç ­¯¢kòýÀnìÛÞo̳ßwÖäï ¯ü¨h¿¶ÙoÕóÑw£¹¨ ¼ìÈtâûåoç´¶ ¨©²uøáÇsÊû·e£é¤ ÆïÈtÐå÷hÚõüe¿Ùÿm´Ý­ ¡¢£:»È¬)Confessed adam kissed his arms around here. 

ºâèMike smiled at last night 

¥èÍInstructed adam rubbed his shoulder 


ÕåÁC¡Åðl«ü£iÙàöc©Ä«kâßü »þ½b±­âeÊÕ³lªëäl¡¹ÐoÐâÁwÛÚÀ êý£tþ³©oÙÄî ÜâÖvÓؾi°ëìeÖÈËw­®¸ ÏÔ¤m¼ÿ¿yÑðø ÞóÉ(óÏô27ÃýÞ)©Ê¼ ò²ñpãÒ½r®øöiÔÏävð§aÕ¦ãtðÙ£eîïÕ Ì¥ªp¾º§hì¼üoûÚÏt¿êëoõÅès°ª¬:According to get me take it adam. Just then you over at the second. 
What you love him on chuck. Careful not one hand in our baby.
Vera exclaimed in several days and wally.
Nodded to stop and found herself that.DWGCBruna's p i c snlChuckled adam replie

I am thinking that some amateur spammer tried to embed binary executable code into the message and it didn't work.  Several hours later, more Russian spam showed up in my Yahoo inbox, and it was the more conventional variety:

Mrs. Irene Ohms LIKED YOU and left a new MESSAGE for you
Irene-Ohms

Hello, chief sweetheart. This is Irene ...
I found your profile via facebook .
I was delighted. You're pretty!
I want to show some hot pics to you, sweeting.
Your YAHOO mailservice sucks :) So Click on the link bellow and then click OK button again lol

I wish to meet you soon! Bye-bye sweeting ))


Juliet Friemering

Salut sweet.. It's me Juliet!
I found your profile via linkedin . I was amazed!
You're handsome!
I want to have a hot talk with you, sweetheart !
Your YAHOO mailservice sucks btw! So Click on the link bellow and then click OK button again !

I wish to meet you soon! Bye-bye darling !

The ironic bit again, is that they mention Yahoo in the message and I believe that they have compromised some part of Yahoo. The clickable domains were all Russian.

To Yahoo's credit, the spam filters picked it up, but I think that they have a tough row to hoe with quality and security issues. 



Kids Live Safe Email Spam -- Dangerous


This is the absolutely latest in egregious spam.  It purports to be from Kids Live Safe.com which apparently alerts you if there is a registered sex offender in your neighborhood.  The website itself uses scare tactics and sells email alerts.

However, this spam is from another domain, websaving.com and this is a sure sign of a virus or malware injector.  There is embedded script not to display the domain that it takes you to, so you cannot check validity by hovering over it with a cursor.

These are all signs of virus, trojan and malware activity.  Delete it and empty your trash and in now way click on it.

BITCOIN The Biggest Scam In History? A youtube video



I happen to agree with video in regards to Bitcoin being a bubble due for a crash.  I have lived through the crash of the tech bubble, the real estate bubble and others.

It seems that the early adopters make the money, and when the widows and orphans start getting into it, that is the precursor for a crash.

I may not agree with this guys politics in the above video, but I agree with his assessment of Bitcoin.