bIhAg RaVaL turned 6 today!
Cosimo Galluzzi
art blog(derogatory)

Acquired Stardust
cherry valley forever

pixel skylines
Jules of Nature
Alisa U Zemlji Chuda

Origami Around
wallacepolsom

oozey mess
let's talk about Bridgerton tea, my ask is open
AnasAbdin
will byers stan first human second

祝日 / Permanent Vacation
noise dept.

izzy's playlists!
Monterey Bay Aquarium
seen from Australia

seen from United Kingdom

seen from Germany
seen from United States
seen from United States

seen from Germany
seen from United States
seen from Malaysia

seen from Romania
seen from United States

seen from United Kingdom
seen from Malaysia
seen from China

seen from Indonesia

seen from United States
seen from Germany
seen from Ireland
seen from Romania
seen from TĂĽrkiye

seen from United States
@bihag
bIhAg RaVaL turned 6 today!

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Indian victory in cricket world cup final 2011 ... great to watch
Google Gears Basics part-3 database
Part-1
Part-2
Gear is providing the way to save data within user disk, let’s see Database part of google gear
The DataBase allow to store user’s data on the user’s computer. For security gear allows to access data related to particular domain. Gear is providing two classes to do database related functionality, Database and Resultset.Â
First you have to create Database object using gear factory. var database = google.gears.factory.create('beta.database', '1.0'); // open the database database.open('localApprDB'); // execute the sql database.execute('create table if not exists users (name varchar(100), user_req varchar(100), status varchar(100), last_modified_date datetime)');
The execute() method use bind parameters (?) to prevent SQL injection attacks and improve performance. SQLite database supports almost all the database functionality. Let’s try some simple insert-fetch with created users table.
database.execute("insert into users values (?, ? , ?, date('now'))", ['vicky', 'request for new laptop.', 'Active']);
The data declared in array will replaced with question marks(?). It’s good practice to bind variable, It will automatically escaped by the SQL engine. Gear adds rowid column to every table it’s unique integer id for every row of your table. After every successful insertion gear update lastInsertRowId readonly attribute of Database Object.
// database.execute() returns Resultset object. It has the results of executing the SQL. resultset = database.execute(select user_req from users where name=? and status=?",['vicky', 'Active']);
Resultset is providing methods to Iterate over rows like isValidRow(), next(), and close(), And to access columns you have field(), fieldName() and fieldByName() methods.
while (rs.isValidRow()) { console.log(rs.fieldName(0) + " == " + rs.field(0)); rs.next(); } rs.close();
Output :- name == vicky
The fieldName() and field() takes int index of column, and fieldByName() takes name of the desired field like rs.fieldByName('user_req').
That’s all about database, it’s for storing data on the local machine same way we handle database in any other language.
Google Gears Basics part-2 localServer
Part-1
Let’s look LocalServer first,
The LocalServer will allow to cache URL, Cached URLs served from the user’s disk. For security gear allows to access pages that have the same scheme, host, and port as the current domain.
First you have to create localserver object using gear factory. var localServer = google.gears.factory.create('beta.localserver', '1.0'); // version is optional There are two ways defined in gear API to manage URL cache. 1) ResourceStore :- The ResourceStore is deal with URLs. It will capture URLs using JavaScript, like html, JavaScript, images etc. A ResourceStore is a container of cached URLs. ResourceStore is better for capturing one file or array of files.
// creating store with name 'mbanph' var store = localServer.createStore('mbanph'); // Capture this page and the js library you need to run offline. store.capture(['include.js','style.css','../gears_init.js'], function(url, success, captureId){});
2) ManagedResourceStore :- The ManagedResourceStore is deal with URLs which defined in mainfest file, Gears captures and updates applications resource automatically. If you have lots of file to capture than better to use ManagedResourceStore option to capture resources.
content in offline.json file. { "betaManifestVersion": 1, "version": "version 1.0", "entries": [ { "url": "gearsTest.html"}, { "url": "include.js"}, { "url": "style.css"}, { "url": "../gears_init.js"} { "url": "checkOffline.js"}, { "url": "../images/logo.png"}, { "url": "../images/background.png"}, { "url": "../terms.pdf"} ] }
var store = localServer.createManagedStore('mbanph'); store.manifestUrl = '../offline.json'; store.checkForUpdate();
With ResourceStore and ManagedResourceStore you can create, open and delete store. other API related information you can find out here.
Google Gears Basics part-1
As per google definition “Gears is an open source browser extension that lets developers create web applications that can run offline.” Gears provides three key features:
LocalServer :- To cache and serve web application’s static resource ( HTML, images, JavaScript ) in offline mode mean serve the resource without internet connection.
Database :- To store and access local relational database from within the browser with using JavaScript API. To fulfill this gear is using open source SQLite database, It support almost all the database functionality like trigger, view, multiple tables etc…
WorkerPool (worker thread pool):- The API allows web applications to run heavy and expensive JavaScript operations in the background asynchronously, without blocking the main page’s script execution. How To Use It?
First thing you have to initialize gears_init.js script in your HTML file. If gear installed than you will get google.gears object, else you can direct user to customized install/upgrade page. You can specify personalise message, and return parameter for after installing redirecting our website url, Other parameters are icon_src, name.
<script src="gears_init.js"></script> <script> if (!window.google || !google.gears) { location.href = "http://gears.google.com/?action=&message=<your welcome message>" + "&return=<your website url>"; } </script>
To initialize any gear object you have to use google.gears.factory.create() method which takes two parameters. var obj = google.gears.factory.create('<classname>', '<version>');
That’s all about gear’s core methods,All other things comes under LocalServer, Database and WorkerPool.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming