Wednesday, January 11, 2012

Debugging Tips

1.  Put in checkpoints.  alerts in Javascript or MsgBox in VB/VBA.  This will help you pinpoint where the breakdown actually occurs.


2.  Remove functions and complexities.  Unit test each part at a fundamental level.


3.  Remove variables!  Simplify your code.  It'll run faster and cleaner and your problem should reveal itself.

4.  PHP: In PHP check for semi-colons.  Annoying!

5.  Check that variable names are exact matches.  Use the CTRL+F.  It'll help.


6.  Javascript/AJAX:  Variables take time to change.  Make sure if you're using alert keys that you take the Asynchronous nature of AJAX into account.

Monday, January 9, 2012

Work

Today all I got done was work for my job.  It was cool but terrible.  Cool because it's always kind of cool to hone your programming skills no matter what the language is.  It kind of sucks though because it's not where I want to be honing my skills.  I need to be working on my other shit as opposed to this.  Tomorrow what I want to get done is to work on getting that information to display on the screen on click of the event.  I'll have to work on that.  After that I'll have a bit of similar work to do on some other JQuery screens.  But I should be about done after that and looking into building the PHP to check the script on the back end and to move forward.

Nice. Nice.  Nice.  Also I'll have to design the database but because I've designed so many in the past that shouldn't be too difficult.  The goal of that business is to drive it at minimal cost to make it earn 1,000 dollars a week.  That's the first goal.  The second year goal is to have it make 250,000 dollars a year and then a million in the third year.  But I'll have to work to solidify that. 

Work.  Work.  Work.

A New Pedia

What if there was a very simple way to leverage a large business without really doing anything except gathering data?  What if it was possible to create a website completely and totally based on another website? What if I took a certain website, made it actionable, and drove my revenue model that way in total. 

It feels like I might have just stumbled onto something that's huge.

Sunday, January 8, 2012

Agnostic Users

I just made a discovery.  I typed google into my browser but I must've transposed some letters because I eneded up at another search engine.  Someone clever bought the name that was closest to google's.  

But then something funny happened.  I decided that I didn't need Google per say but I just needed any search engine.  I used the search engine and while it didn't get it right I used it again to try.  I say all of that to say this.

Buying the 'neighbors' of a search engine is really smart if you have a service you're trying to offer that is very similar to the company you're trying to move on.  It seems very smart indeed.

Friday, January 6, 2012

Verify Routing Number Code (JavaScript)

Hi,

I used JQuery here.  You might want to use it if you're going to use this code to verify routing numbers according to a very simple algorithm that simply uses the 371 371 371 checksum.

function confirmRoutingNumber(strRoutingNumber)
                {
                   
                    var routingArray = new Array();
                    var total = 0;
                    var i = 0;
                   
                    //alert("Inside confirmRoutingNumber function");
                   
                    for(i = 0; i < strRoutingNumber.length ; i++)
                    {
                       
                   
                       
                        routingArray[i] = Number(strRoutingNumber.charAt(i))
                       
                        //alert("I: " + i + " Digit: " + routingArray[i]);
                       
                        //alert("I: " + i + " Digit: " + accountArray[i]);
                       
                       
                       
                        if ( i % 3 == 0 )
                        {
                            routingArray[i] = routingArray[i] * 3;
                           
                               
                        }
                        else if (i % 3 == 1)
                        {
                           
                            routingArray[i] = routingArray[i] * 7;
                           
                        }
   
                           
                        total = total + routingArray[i];
                    }
                   
                    //alert("Routing Number Total: " + total);
                   
                    if (total % 10 === 0)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }

Luhn Algorithm Implemented in JS code

Hi,

Here's my Javascript code for the Luhn Algorithm.  Check it out.  Just let me know you've used it. It'll make me happy.  :D

    function luhnCheckSum(strAccountNumber)
                {         
               
                    //alert("Inside confirmAccountNumber function");                      
                    var accountArray = new Array();
                    var total = 0;
                    var i = 0;
                   
                    for(i = 0; i < strAccountNumber.length - 1; i++)
                    {
                       
                       
                   
                       
                        accountArray[i] = Number(strAccountNumber.charAt(i));
                       
                        //alert("I: " + i + " Digit: " + accountArray[i]);
                       
                        if ( (accountArray[i] > 9)  && (i%2 == 1) )
                        {
                            accountArray[i] = 1 + accountArray[i] % 10;
                           
                               
                        }
                           
                        total = total + accountArray[i];
                    }
                   
                    total *= 9;
                   
                    var lastDigit = 0;
                   
                    lastDigit = total % 10;
                   
                    var checkSumDigit = 0;
                   
                    checkSumDigit = Number(strAccountNumber.charAt(9));
                   
                    //alert("Checksum According to Calculation: " + lastDigit + " CheckSum Digit" + checkSumDigit);
                   
                    if (lastDigit === checkSumDigit)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                   
                }



Monday, January 2, 2012

Distractions

No one's still reading my blog.  This is awesome.  Now onto the next one.


So I spoke to my sister before the New Year.  We spoke about some of our goals for the New Year.  It was funny because a lot of her goals had a lot to do with work for me.  But to be honest I'm not really that interested in her goals.  Her goals are all in show business.  And to me show business is a shaky business.  It's not the type of business that I want my future company based on.  Sure, it adds some pizazz and it's fun.  But it's tremendously unstable.  And to do the things that I want to do I can not have massive amounts of unstability.  Yet the allure is appealing.  But I must reject it.  I must learn to say no to her a lot more often despite her disdain.  


I don't really care for her life or her lifestyle.  I enjoy some of her freedom but her well being is mostly based on likability.  I don't think likability is something to build a future on.  I think likability is like a suited pair in poker, a nice to have but not necessary (or even sufficient) to win.  Computers alone are like a pair of Queens but mixed with math their like a pair of Kings.  After I add my other creative talents to them it'll be like a pair of Aces.  I'm just uncomfortable with the paths she's aligned.   I'll have to communicate this with her at the right time.  Next weekend we're supposed to work together on a project. :-/  I'd rather work on my own projects. But nonetheless we're supposed to work together on a project.  I'll work with her on that one and then deliver the news that I will be busy for the foreseeable future.  I am finding her ideas and her timelines to be a distraction.  I am not really that into it.


Next, this week I worked on programming GFM.  It did not go as quickly as planned.  I ran into some snags with an overall understanding of the LAMP stack and it's relationship to Aptana.  


Aptana is primarily a front end software development tool.  It can edit PHP but it can not run it and the PHP compiler is not included with Aptana.  Therefore you must first install PHP.  Then you must install Apache with is the container for PHP.  Aptana does a good job of integrating with MySQL but it is quite a bit of thinking and configuring to get Aptana, PHP, and Apache to work together seamlessly if you're not familiar with the architecture.  Fortunately for me I am now.  


I also learned quite a bit about the $.getJSON and the JSON data structure.  I still have more the learn.  But I am confident of this: I can now leverage the skills that I have learned with PHP into faster and more significant development.  I am eager to move forward.  I have a lot to learn though specifically about LAMP stack especially about the configurations.  There is quite a bit to know.