Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Monday, September 23

Quote

The best way is always to stop when you are going good and when you know what will happen next. If you do that every day … you will never be stuck. Always stop while you are going good and don’t think about it or worry about it until you start to write the next day. That way your subconscious will work on it all the time. But if you think about it consciously or worry about it you will kill it and your brain will be tired before you start.

- Ernest Hemingway

Friday, September 20

Create Your Own Google Map

To create a google map do the following:

Get an Google Maps API Key, feel free to use your normal gmail account. Without this you can't use google maps.

Next insert this into the head of your html. Replacing "YOUR_KEY" with your key.


Next, create a map div tag. Where ever you put this code, is where the map will actually display. The width and height tags will dictate the width and height of the map. This can be included in any other div tag or HTML tag.


Next copy this bit of code in the bottom of your page. (Why the bottom? because it has to happen AFTER the divMap. There are ways around this. Hint: try creating an onload body event)



And that's it.

So of course your going what is this? 3.907787,-79.359741 ???

Those are geocodes, they map to a specific point on the earth's globe. If you want to map to an address you will have to convert the address to a geocode. Google does this as well, but its not so simple. So I'll save it for a whole other post.

In the mean time, use this.

Wednesday, September 18

5 Great Visual Resumes

Monday, September 16

Quote

The best time to plant a tree was 20 years ago, the second best time is now.

Logi Analytics - jQuery Auto-complete


This would be the third time I've been asked to incorporate some type of auto-complete function using jQuery and Logi elements.

Here is my cheat sheet:

1. First create a report that returns the results you want in your auto-complete drop down:
  • @Request.q~ will have what the user typed
  • Keep it simple and quick as this will impact response times
  • A single data layer and data table is typically enough
2. Include the jquery script files, I've not had a lot of issues with versioning, so anything over 9 should be fine.
  • http://code.jquery.com/jquery-1.9.1.js
  • http://code.jquery.com/ui/1.10.3/jquery-ui.js

3. Add a user input element with an ID of inptSearchText

4. Add the following script in a script tag, typically at the bottom of the page:


$(document).ready(function(){

  $("#iptAutoComplete").autocomplete({
minLength: 2,                       
delimiter: /(,|;)\s*/, // regex or character 
source:  function(request, response) 
{
                                    var matches = null;
var data = null;
                                    if(data != null )
{
                                          matches = $.map(data, function(tag) {                                         
                                                if ( tag.value.match(new RegExp("^" +request.term, "i"))){
                                                return tag;
                                                }
                                    });   
                                          response(matches);
                                    }

if (matches == null || matches.length == 0){
                                          $.ajax({
                                                      url: 'rdPage.aspx',
                                                      data: {rdReport:"jQuery.search",rdReportFormat:"DataLayerXml", q:request.term },
                                                      dataType: 'xml',
                                                      success: function( xmlResponse ) {
                                                            data = $( "dtSearchResults", xmlResponse ).map(
                                                                        function() {
                                                                              return {
                                                                                    value: $(this).attr("FORMATTED_NAME"),
                                                                                    id: $(this).attr("EMP_ID")
                                                                              };
                                                                        });
                                                                  response(data.slice(0, 10));   
                                                            }
                                          })
                                    }
                              },
select: function(event, ui)

alert("you have selected " + ui.item.value + " (" + ui.item.id + ")");
        }
});

});


5. Modify the following:




  • "jQuery.search" - replace with the name of the report from step 1
  • FORMATTED_NAME needs to be your displayed value from prior table
  • EMP_ID needs to be the id you want triggered with the specific data set
  • minLength:2 - Set this to the number of characters the user types before triggering the AJAX call
  • alert(....) - Call your own javascript function or re-direction after selection. Typically you would store the ID in some hidden variable for future usage.


Thursday, September 12

Personalized Quote from Urban Dictionary

Get a nice quote about yourself....

Your First Name:

Wednesday, September 11

Evaluation of Trader

I was watching this thread over at HotStockMarket, thought I'd make some notes on how accurate this fella Binks was:

Some disclaimers: This is a paper trade, I did not actually make these trades. It is impossible for me to get in and out exactly when he is, therefore, anytime he made a post on the thread, I assume that I bought at the open price on the following day of the post. Obviously, this could lead to some major differences in profit.

8/27/13 - GGS - in at 2.70, At 2.64 on 9/5 = 2% loss
8/28/13 - AStx- in at 6.39 on 8/29, At 8.61 on 9/5 = 34% profit
8/29/13 - NVA - in at 3.22 on 9/3, At 3.23 on 9/5 = 1% profit
8/23/13 - AMRN - in at 6.10, At 7.36 on 9/5 =  20% profit
8/26/13 - MXWL- in at 9.47, At 9.00 on 9/5 = 5% loss
8/26/13 - STSI - in at 2.03, At 1.93 on 9/5 = 4.9% loss
8/26/13 - YRCW in at 17.50, At 17.65 on 9/5 = .8% gain
8/16/13 - AMRN in at 6.01, At 7.37 on 9/5 = 22% profit
8/19/13 - ASTX in at 5.25, At 8.64 on 9/5 = 64% profit
8/13/13 - RAD in at 3.60, At 3.53 on 9/5 = 1% loss
8/14/13 - PCO in at 2.00, At 1.88 on 9/5 = 6% loss
8/14/13 - AMRN in at 5.14, At 7.36 on 9/5 = 32% profit
7/8/13 - AMD in at 4.40, At 3.56 on 9/5 = 20% loss
7/18/13 - HPQ in at 26.33, At 22.52 on 9/5 = 15% loss
7/15/13 - GTAT = 35% profit
7/15/13 - ICA= 10% profit
7/15/13 - AGNC = 3% loss
7/15/13 - MAKO= 22% profit
7/11/13 - ITMN = 14% profit
7/11/13 - ECTE = 1% profit

Conclusion:
  • 20 Picks over last 2 months
  • Gainers: 11
  • Losers: 8
  • Profit: 196%
Over all Binks has great picks (although he does not need me to tell him this). His picks tend to have minimal losses with big gainers.

Monday, September 9

Quote

Leadership is the art of accomplishing more than the science of management says is possible.

Friday, September 6

Conversations with Jarvis

Some real conversations with Jarvis, an artificial intelligent chat bot I played with a while back.

He is down now, but I hope to bring him back soon.

Visitor 13 (not me)
User: hello javis
Jarvis: Do you have any bacon?
User: no
Jarvis: Are you saying no just to be negative?
User: i have no bacon on me
Jarvis: You don't know much about investing?


Visitor 10 (Me)
User: You make me laugh too
Jarvis: Me?
User: Yes you
Jarvis: A good time to leave me alone.
User: It is a good time to be alone.
Jarvis: Yes you
User: And maybe you
Jarvis: You tell me, is today special?
User: Today is my birthday, I think.
Jarvis: i don know you do i
User: No, but you can come to my birthday party.
Jarvis: NULL
User: NULL is not an answer, its a bug.
Jarvis: I don't think you know me. Do I know you?
User: Nope, do you want to get to know me?
Jarvis: Hey Jarvis. What's up?
User: I'm not Jarvis, you are...
Jarvis: Today is my birthday, I think.
User: How old are you?
Jarvis: Hows it going?


Wednesday, September 4

Sharing Game Info Across Sites

The idea of sharing characters, objects and user information across multiple games and environments has always interested me.

I've got a simplistic idea on how this could be done and wanted to share it.

Some assumptions:
Let's assume we have 3 environments (games) Game A, B and C. They are similar in some concepts and vastly different in others.

Let's assume we have one user, Joe, who wants to play in all three environments.

Step 1:

Joe signs up for Game A and plays it. All information is stored within Game A as normal.

When Joe logs out of Game A. He is given a url that will contain all his information.
www.GameA.com/userInfo.php?userID=10

Next Step:

Joe now wants to play Game B. He has the option of entering in his url or registering as normal.

Once given a url Game B will request Joe's information from Game A.

Game A will response with pair values, like so:
UserName=Joe
Email=joe@somewhere.com
Score=1000
Money=500
CharacterName=Killer
CharacterHP=50
CharacterMagic=40
etc...
etc...
Game A will also record the fact that Game B requested information. This will come into play when Joe goes back to playing Game A.

Game B will take the values it can use and create/update Joe's account within it's game environment. Such as UserName, Score and Money. (Maybe this game does not have characters)

Next Step:

Joe is done playing Game B. As he logs out he is given the opportunity to get a new URL or he can update Game A.

If Joe decided to update Game A, Game B will send a request to Game A letting it know the url it can find an update at.
www.GameB.com/userInfo.php?userID=99

Game A will go to that url and process all of Joe's information, updating it's stats as needed.

Thoughts:

One of the advantages of this system is that if Site A were to disappear or be unavailable, Joe still retains all the information from Game B. It's even possible for him to save information from Game A, if the site does disappear, if Game B has it saved.

For those who are worried about malicious use of the system, it would be quite easy to code the update process to only allow updates from certain game sites. If you did not want to see updates from Game C, you could exclude that site from your updates by looking at the request url.

Alternatively someone could offer a service where "trusted" games can exchange information.

The user information could be in an XML document, but I have found that the ease with which you can build key pair values is easier to build and search then XML documents. I know the advantages, I personally don't think the advantages out weigh the disadvantages in this case.

This is a stab in the dark any thoughts and comments are appreciated.

Followers