2011년 11월 10일 목요일

HTML5 Example - Web SQL.

 Here is an HTML5 Web SQL example. This is from www.html5rocks.com.


<!DOCTYPE html>
<html>
  <head>
    <style>
      body {
        color: #222;
        font: 14px Arial;
      }
      
      body a {
        color: #3D5C9D;
        text-decoration: none;
      }
    </style>
    <script>
      var html5rocks = {};
      html5rocks.webdb = {};
      html5rocks.webdb.db = null;
      
      html5rocks.webdb.open = function() {
        var dbSize = 5 * 1024 * 1024; // 5MB
        html5rocks.webdb.db = openDatabase("Todo", "1.0", "Todo manager", dbSize);
      }
      
      html5rocks.webdb.createTable = function() {
        var db = html5rocks.webdb.db;
        db.transaction(function(tx) {
          tx.executeSql("CREATE TABLE IF NOT EXISTS todo(ID INTEGER PRIMARY KEY ASC, todo TEXT, added_on DATETIME)", []);
        });
      }
      
      html5rocks.webdb.addTodo = function(todoText) {
        var db = html5rocks.webdb.db;
        db.transaction(function(tx){
          var addedOn = new Date();
          tx.executeSql("INSERT INTO todo(todo, added_on) VALUES (?,?)",
              [todoText, addedOn],
              html5rocks.webdb.onSuccess,
              html5rocks.webdb.onError);
         });
      }
      
      html5rocks.webdb.onError = function(tx, e) {
        alert("There has been an error: " + e.message);
      }
      
      html5rocks.webdb.onSuccess = function(tx, r) {
        // re-render the data.
        html5rocks.webdb.getAllTodoItems(loadTodoItems);
      }
      
      
      html5rocks.webdb.getAllTodoItems = function(renderFunc) {
        var db = html5rocks.webdb.db;
        db.transaction(function(tx) {
          tx.executeSql("SELECT * FROM todo", [], renderFunc,
              html5rocks.webdb.onError);
        });
      }
      
      html5rocks.webdb.deleteTodo = function(id) {
        var db = html5rocks.webdb.db;
        db.transaction(function(tx){
          tx.executeSql("DELETE FROM todo WHERE ID=?", [id],
              html5rocks.webdb.onSuccess,
              html5rocks.webdb.onError);
          });
      }
      
      function loadTodoItems(tx, rs) {
        var rowOutput = "";
        var todoItems = document.getElementById("todoItems");
        for (var i=0; i < rs.rows.length; i++) {
          rowOutput += renderTodo(rs.rows.item(i));
        }
      
        todoItems.innerHTML = rowOutput;
      }
      
      function renderTodo(row) {
        return "<li>" + row.todo  + " [<a href='javascript:void(0);'  onclick='html5rocks.webdb.deleteTodo(" + row.ID +");'>Delete</a>]</li>";
      }
      
      function init() {
        html5rocks.webdb.open();
        html5rocks.webdb.createTable();
        html5rocks.webdb.getAllTodoItems(loadTodoItems);
      }
      
      function addTodo() {
        var todo = document.getElementById("todo");
        html5rocks.webdb.addTodo(todo.value);
        todo.value = "";
      }
    </script>
  </head>
  <body onload="init();">
    <ul id="todoItems">
    </ul>
    <form type="post" onsubmit="addTodo(); return false;">
      <input type="text" id="todo" name="todo" placeholder="What do you need to do?" style="width: 200px;" />
      <input type="submit" value="Add Todo Item"/>
    </form>
  </body>
</html>


 Type this code and save it html5_websql.html. Open this file at your browser, I recommend Google chrome or Firefox not IE to test.


 Add some todos in test page, and close your browser and reopen this example. Your previous input will be alived.


2011년 11월 6일 일요일

How to Detect Mobile Browser

If users access your web system through mobile browser, you might like to redirect the access of them.

Follow this link, and download script file.

http://detectmobilebrowsers.com/

2011년 11월 2일 수요일

FIFA Manager 12 Player Stats Hex Location

  • How to Find any player's data in Memory

 If you want to edit your player, first, write down player's stat from "Shot power" to "Man Marking", like this. But here is very important point, that is the sequence. The stat "Free kicks" is not followed by "Foward runs" but "Finishing". You can compare the sequence of stats from next chapter's excel like table with the one on your game screen. I think you can undestand what I'm saying.


 And convert your values to Hex decimal. Find it with Memory editor.


 There are several locations related to your player. Because FIFA Manager 12 stores the player's stats each week like a snapshot. So edit "Shot power" value and check your editing was applied in game correctly. If not, recover to its original value and find next one.
  • Player's stats Hex Location
 This is Hex Location of each player's in memory. You can use this location information when editing player's stats with memory editor.



  • Userful Information

My previous posts can be helpful with this stats editing.


How to edit Player's characters


How to edit Player's Age



  • Be warned

 I found that editing young player below age 20 can cause stat drop. Each player's stat can be downed -2 ~ -3 per a week. After half season has passed, that player would become useless than before. So it would be better you edit your player's age to 23~24 yrs.


 Some fan of this game found that age 23~24 player's stat is not downed.



FIFA Manager 12 Money Cheat (Easy way)

This is a easy way how to increase manager's money, no momory editing.