Tuesday, March 29, 2011
Friday, March 25, 2011
Thursday, March 24, 2011
Tuesday, March 22, 2011
Create web apps in JavaScript right from your browser
Associative Array Flexibility.
var AssociativeArray = function() {
this.hash = new Array();
this.size = function() {
var size = 0;
for(var i in this.hash) {
if(this.hash[i] != null) {
size++;
}
}
return size;
};
this.clear = function() {
this.hash = new Array();
};
this.add = function(key, value) {
if(key == null || value == null) {
throw "NullPointerException { \"" + key + "\" : \"" + value + "\" }";
}
else {
this.hash[key] = value;
}
};
this.get = function(key) {
return this.hash[key];
};
this.remove = function() {
var value = this.hash[key];
this.hash[key] = null;
return value;
};
this.contains_key = function(key) {
var exist = false;
for(var i in this.hash) {
if(i == key && this.hash[i] != null) {
exist = true;
break;
}
}
return exist;
};
this.contains_value = function(value) {
var contains = false;
if(value != null) {
for(var i in this.hash) {
if(this.hash[i] == value) {
contains = true;
break;
}
}
}
return contains;
};
this.is_empty = function() {
return (parseInt(this.size()) == 0) ? true : false;
};
this.keys = function() {
var keys = new Array();
for(var i in this.hash) {
if(this.hash[i] != null) {
keys.push(i);
}
}
return keys;
};
this.values = function() {
var values = new Array();
for(var i in this.hash) {
if(this.hash[i] != null) {
values.push(this.hash[i]);
}
}
return values;
};
this.to_string = function() {
var string = "{\"array\": [\n";
for(var i in this.hash) {
if(this.hash[i] != null) {
string += "\t{ \"" + i + "\" : \"" + this.hash[i] + "\" },\n";
}
}
return string += "]}";
};
}
this.hash = new Array();
this.size = function() {
var size = 0;
for(var i in this.hash) {
if(this.hash[i] != null) {
size++;
}
}
return size;
};
this.clear = function() {
this.hash = new Array();
};
this.add = function(key, value) {
if(key == null || value == null) {
throw "NullPointerException { \"" + key + "\" : \"" + value + "\" }";
}
else {
this.hash[key] = value;
}
};
this.get = function(key) {
return this.hash[key];
};
this.remove = function() {
var value = this.hash[key];
this.hash[key] = null;
return value;
};
this.contains_key = function(key) {
var exist = false;
for(var i in this.hash) {
if(i == key && this.hash[i] != null) {
exist = true;
break;
}
}
return exist;
};
this.contains_value = function(value) {
var contains = false;
if(value != null) {
for(var i in this.hash) {
if(this.hash[i] == value) {
contains = true;
break;
}
}
}
return contains;
};
this.is_empty = function() {
return (parseInt(this.size()) == 0) ? true : false;
};
this.keys = function() {
var keys = new Array();
for(var i in this.hash) {
if(this.hash[i] != null) {
keys.push(i);
}
}
return keys;
};
this.values = function() {
var values = new Array();
for(var i in this.hash) {
if(this.hash[i] != null) {
values.push(this.hash[i]);
}
}
return values;
};
this.to_string = function() {
var string = "{\"array\": [\n";
for(var i in this.hash) {
if(this.hash[i] != null) {
string += "\t{ \"" + i + "\" : \"" + this.hash[i] + "\" },\n";
}
}
return string += "]}";
};
}
Thursday, March 17, 2011
data and each in jquery
//We can call it via:
$("div").data("role") === "page";
$("div").data("hidden") === true;
$("div").data("options").name === "John";
Data is good for preventing race conditions.
//Given this HTML Structure
- Apple
- Orange
- Mango
- Blueberry
- Watermelon
//We can retrieve the value with:
$('li').each(function(index) {
alert(index + ': ' + $(this).text());
});
//Alternatively, loop through JSON
var data = "{ name: "John", lang: "JS" }";
$.each( data, function(k, v){
alert( "Key: " + k + ", Value: " + v );
});
Identify fonts being used
Have a font type you need to figure out but only have an image to identify it from?
font comparer
find some interesting font stuff:
Always useful centering layout with css
div#container
{
margin-left: auto;
margin-right: auto;
width: 50em;
}
Does not work for IE5.5 and down, or IE6 in quirks mode.
{
margin-left: auto;
margin-right: auto;
width: 50em;
}
Does not work for IE5.5 and down, or IE6 in quirks mode.
Javascript binary howto.
Here's the howto. Now if only I had a whyto.
http://bateru.com/news/2011/03/javascript-binary-operations-the-easy-way/
http://bateru.com/news/2011/03/javascript-binary-operations-the-easy-way/
Execute and test php and javascript
You can test your scripts outcome right on this page.
Monday, March 14, 2011
Node.js explanation worth reading!
Node.js is all the rage these days. Get a head start on the coming web dev revolution.
http://blog.carbonfive.com/2011/03/09/node-js-overview/
http://blog.carbonfive.com/2011/03/09/node-js-overview/
Thursday, March 10, 2011
Tuesday, March 8, 2011
Free lance gigs part 5
This one has an affiliate system. This give me an idea. Kind of a findersfee for freelancers etc.. Could be major!
http://rfq.programmingbids.com/
http://rfq.programmingbids.com/
Free lance gigs part 4
With 4 different sites you should be able to find work that no one else is taking and make a living out of it!
http://www.project4hire.com/
http://www.project4hire.com/
Free lance gigs part 1
Get some extra work. Start your own web development business!
http://www.elance.com/p/landing/provider.html
http://www.elance.com/p/landing/provider.html
Monday, March 7, 2011
Create sprite images widget
This is kinda important. Make sprite images with ease.
Create HTML form widgets easily and style them
Easy to create form and form styling.
Learn and create tables
Cool site for generating, learning and using tables.
get the css shell for your html
That rhymed.. LOL
Sketching tools with HTML5
A way to sketch out designs to deal with layout or maybe other things.
http://smashinghub.com/10-best-html5-sketching-and-drawing-tools-for-designers.htm
http://smashinghub.com/10-best-html5-sketching-and-drawing-tools-for-designers.htm
Subscribe to:
Comments (Atom)