<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>dan</title><generator>Tumblr (3.0; @dldavis2)</generator><link>http://dldavis2.tumblr.com/</link><item><title>jquery replacement</title><description>&lt;p&gt;as i begin to make mobile apps, it’s become painfully clear that i simply don’t have the performance i’m used to in a browser. while i write fast javascript, i am stuck using jquery for the time being. I’m not a jQuery fan, but i’m not out to get it either. it is what it is, and it works. &lt;/p&gt;

&lt;p&gt;The problem is that it works slowly. I re-wrote the fade routine a few months back. mine uses 1/3 the cpu of jQuery’s native routine. I wanted more than just faster fades, i want fast everything, so i began another library.&lt;/p&gt;

&lt;p&gt;I don’t think it will replace jQuery, which at this point has a million nooks and crannies to replaicate. After reviewing what i use jQuery for, and what takes a long time to run, i’ve settled a a subset of functionality. The syntax is similar, but not compatible with jQuery.&lt;/p&gt;

&lt;p&gt;On the technical end, it’s based around Arrays of elements instead of jQuery’s custom objects. This lets me use [].map(), [].filter(), etc on the result set. The css selector is next gen: querySelectorAll() only, no backwards css path decoding codebase. I have the usual methods like show, attr, html, hide, each, toggle, css, events, etc at least partially working. &lt;/p&gt;

&lt;p&gt;the whole thing is currently ~2kb compressed, and performs about 8-12X faster than jQuery. &lt;br/&gt;
It’s complimenting to jQuery and does the same basic things, but fast.&lt;br/&gt;
if anything becomes of it, i’ll let you know.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/467074259</link><guid>http://dldavis2.tumblr.com/post/467074259</guid><pubDate>Mon, 22 Mar 2010 23:10:00 -0400</pubDate></item><item><title>libraries</title><description>&lt;p&gt;i had sworn off creating libraries, but i can’t stop myself. I will be releasing three new libraries in the next few weeks.&lt;/p&gt;

&lt;p&gt;1. a sequal to my F functional programming library, this time with several Function prototypes.&lt;br/&gt;
2. a Haskell data.list array method [].prototype package. almost all the Haskell functions are done.&lt;br/&gt;
3. a 10kb version of Prototype, all the same String and Array methods with some other bonuses.&lt;/p&gt;

&lt;p&gt;stay tuned for updates.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/305208515</link><guid>http://dldavis2.tumblr.com/post/305208515</guid><pubDate>Mon, 28 Dec 2009 19:42:48 -0500</pubDate></item><item><title>on accessibility</title><description>&lt;p&gt;&lt;b&gt;use consistent html from page to page.&lt;/b&gt;&lt;br/&gt;
even if your page is hard to use, a user knowing they have to jump ahead 20 links each page visit saves them a ton of time. if each page is different, that predictability is lost. It’s like the difference between cooking in your own kitchen versus a strangers. don’t make them constantly “look” around.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;sectionize everything.&lt;/b&gt;&lt;br/&gt;
 the idea is to group related info and features together so that a user can jump to a section, and then find the part they needed. imagine a grocery store without aisles or signs, how would anyone find anything?&lt;/p&gt;

&lt;p&gt;like a store,&lt;b&gt; use big signs to point to your most important sections&lt;/b&gt;.&lt;br/&gt;
h1s for nav, content and footer.&lt;br/&gt;
h2 for content sections&lt;br/&gt;
h3 for each paragraph (or two or three) of page content.&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
standard sections include headers, navigation, content, contact info, table of contents, and footers.&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
add a “skip to” menu, or &lt;b&gt;use ARIA landmark roles&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;don’t use &lt;br&gt;, use &lt;p&gt; or &lt;ul&gt; tags.&lt;/p&gt;

&lt;p&gt;don’t put meaning less text (“click here”, “more…”) inside of links, use the text as a label for the content. (“download page”, “NYT article about polar bears”).&lt;/p&gt;

&lt;p&gt;don’t repeat yourself in link text, each should be unique.&lt;br/&gt;
if not possible, use the title attrib to add more info.&lt;/p&gt;

&lt;p&gt;make the text of the navigation menu as short and direct as possible.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Place the most important word first&lt;/b&gt;, or asap, in all H1-5, labels, legends, and A tags.&lt;br/&gt;
to wit: never label like:&lt;br/&gt;
Enter your name, Enter your address, Enter your zip…&lt;/p&gt;

&lt;p&gt;realize that &lt;b&gt;there is no skimming, or glancing&lt;/b&gt;: they have to wait for steven hawking to read the label to them before they decide if that’s what they want.&lt;br/&gt;
the less they have to listen to, the faster and easier your site will be to use, which reflects well on you.&lt;/p&gt;

&lt;p&gt;if you make a flowchart of how a screen reader user would navigate your site, keep in mind that H tags, legends, and links are the decision points.&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;b&gt;people who read screens will benefit from these changes as well.&lt;/b&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/207437220</link><guid>http://dldavis2.tumblr.com/post/207437220</guid><pubDate>Thu, 08 Oct 2009 05:37:23 -0400</pubDate></item><item><title>35char jsonp fetcher for jQuery</title><description>&lt;p&gt;&lt;pre&gt;
//so you can paste into firebug
    $=jQuery;

// verify script load (just for this demonstration)
    window.mini=function(){alert('hello');}

//here's how to add a script:
    $("head").append("&lt;script src='http://danml.com/mini'&gt;"); 

&lt;/pre&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/203941287</link><guid>http://dldavis2.tumblr.com/post/203941287</guid><pubDate>Sun, 04 Oct 2009 01:03:00 -0400</pubDate><category>jQuery</category><category>jsonp</category><category>javascript</category><category>webservices</category></item><item><title>Temporary CSS</title><description>&lt;p&gt;Given the text of a styleSheet (strCSS), it will apply the styles to the current document.&lt;br/&gt;
The next time it’s called, the old styleSheet is replaced by the new text.&lt;br/&gt;
In this fashion, you can quickly create conditional styles document-wide.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;

The function returns the text it was fed, so you can use it in a chain.

&lt;pre&gt;
function useCSS(strCSS) {
	var D = document, ns, nsx, h = D.getElementsByTagName("head");
	if (!h[0]) {
	  return;
	} else {
	  h = h[0];
	}
	if (!useCSS._css) {
	  ns = D.createElement("style");
	  ns.type = "text/css";
	  h.appendChild(ns);
 	  useCSS._css=ns;
	} else {
	  ns = useCSS._css;
	}
	if (nsx = ns.styleSheet) {
	  return nsx.cssText = strCSS;
	} else {
	  ns.innerHTML = ""; 
	  ns.appendChild(D.createTextNode(strCSS));
	}
	return strCSS;
}
&lt;/pre&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/135072238</link><guid>http://dldavis2.tumblr.com/post/135072238</guid><pubDate>Fri, 03 Jul 2009 21:45:00 -0400</pubDate><category>javascript</category><category>css</category><category>style</category><category>stylesheets</category></item><item><title>Sprint for JavaScript</title><description>&lt;p&gt;usage:
&lt;tt&gt;“Inside a string id\n or \n “&lt;/tt&gt;

 (where id is (optional) token from table below, and n is the argument position to substitute.
&lt;pre&gt;
	"":	String (default)&lt;br/&gt;
	"$":	String&lt;br/&gt;
	"#":	Number&lt;br/&gt;
	"%":	Integer &lt;br/&gt;
	"!":	Boolean&lt;br/&gt;
	"_":	Char from charCode&lt;br/&gt;
	"@":  Locale version&lt;br/&gt;&lt;/pre&gt;


&lt;h4&gt;javascript code:&lt;/h4&gt;
&lt;code style="white-space: pre-wrap; border: 2px solid #000;display:block;padding:1em;"&gt;
function sprint(str){var S=String,A=arguments,c=S.fromCharCode,T={	
	"":	S,
	"$":	S,
	"#":	Number, 
	"%":	parseInt, 
	"!":	Boolean,
	"_":	function(n){return c(parseInt(n,10));},
	"@":	function(V){return V.toLocaleString ? V.toLocaleString() : S(V); }	}; 
  return S(str).replace(/([@#%$!_]?)([\x00-\x08])/g, 
	function(a,t,p){return T[t||""](A[p.charCodeAt(0)],10);
  });
}//end sprint()
&lt;/code&gt;

&lt;h3&gt;examples:&lt;/h3&gt;&lt;pre&gt;
sprint(  "Hello $\1. You are %\2 years old \1."  , "dan", 123 );
&lt;/pre&gt;
  //==”Hello dan. You are 123 years old dan.”

&lt;pre&gt;
sprint("Number(#):#\1, Integer(%):%\1, Char(_):_\1, \
String($):$\1, Boolean(!):!\1,  Local(@):@\1,  default:\1 "  , 1234.5678 );
//==
Number(#):1234.5678, 
Integer(%):1234, 
Char(_):Ӓ, 
String($):1234.5678, 
Boolean(!):true,  
Local(@):1,234.5678,  
default:1234.5678 
&lt;/pre&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/123799135</link><guid>http://dldavis2.tumblr.com/post/123799135</guid><pubDate>Mon, 15 Jun 2009 02:05:00 -0400</pubDate></item><item><title>what's that function?</title><description>&lt;p&gt;JavaScript lack the ability to reflect a method’s bound property name to the method’s function itself.

I figured out a simple way around this:

&lt;pre&gt;
function whoAmI(fn, that){
  for(var i in that){ 
   if(that[i]===fn){ 
      return i; 
   }
  }
} // end whoAmI()

this.fred = function john(){
  var myName = whoAmI(arguments.callee, this);
return myName;
}

fred()//==="fred"
&lt;/pre&gt;


this could be helpful to create re-usable or overloading functions that use the function’s calling  context as an input in their decision structure.

it can also snoop for a functions existance as a method on any object, by passing that object as the second argument. if found, you get the property name of the methods, otherwise it returns undefined.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/114544713</link><guid>http://dldavis2.tumblr.com/post/114544713</guid><pubDate>Thu, 28 May 2009 19:55:00 -0400</pubDate></item><item><title>on open source and js</title><description>&lt;p&gt;I came across this &lt;a href="http://www.theregister.co.uk/2009/03/23/stallman_javascript_warning/"&gt;register article &lt;/a&gt; “warning” that not all javascript is open source. I guess he doesn’t understand that all javascript run as source, so it’s all open, technically if not legally. Javascript can run, but it can’t hide.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Richard_Stallman"&gt;Stallman &lt;/a&gt;also says that browsers should let you change the code they run, and that you should be able “to let users detect such code and specify which Javascript code they’d like to run - the original or a modified form” (register). I thought that’s what greasemonkey already was…&lt;/p&gt;

&lt;p&gt;Perhaps he wants the entire scripting to write code he can keep up with. if wonder because ‘Stallman called Flash an “extended variant” of Javascript’. Not really, flash is closed, javascript is open. Don’t fence real webdevs in with flashers! &lt;/p&gt;

&lt;p&gt; I mean really, all the things he complains about are non-issues for anyone with firefox and webdev skills, due to the inherent nature of javascript. The javascript global environment is a big pool, and anyone can stick their finger in… &lt;/p&gt;

&lt;p&gt;Relax Stallman, this is your dream come true; you can read the source to google docs. try that with microsoft word!&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/89291760</link><guid>http://dldavis2.tumblr.com/post/89291760</guid><pubDate>Tue, 24 Mar 2009 02:46:00 -0400</pubDate><category>js</category><category>open source</category><category>javascript</category><category>stillman</category><category>open</category><category>google docs</category></item><item><title>php vs js</title><description>&lt;p&gt;I find php interesting. It’s more terse and expansive than my favorite language; javascript. It reminds me of VB6 a lot; tons of built ins and keywords.&lt;br/&gt;&lt;br/&gt;subtle syntax differences continue to frustrate me.&lt;br/&gt;&lt;br/&gt;I am torn as to which one is a “better” language. While PHP gives you a lot of &lt;br/&gt;functions to use, javascript aims for minimalism. &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;PHP seems to require more code to do the same thing as javascript.&lt;br/&gt;this is a result of valuing functions over methods. &lt;br/&gt;&lt;br/&gt;i am glad i learned javascript in detail first, because i know what i am missing.&lt;br/&gt;&lt;br/&gt;consider an example function, the string reverse procedure.&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;function reverse($string) {&lt;/pre&gt;&lt;pre&gt;    $newstring = "";&lt;/pre&gt;&lt;pre&gt;    for($i = strlen($string); $i &gt; 0; $i--) {&lt;/pre&gt;&lt;pre&gt;        $newstring .= $string[$i-1];&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt;    return $newstring;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;br/&gt;This is very close to the same procedure in VBA, which a computer science professor demonstrated to me.&lt;br/&gt;&lt;br/&gt;So, it seems that this is “the way” to do this. Indeed, with two minor adjustments, the function runs in javascript, giving the output expected:&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;function reverse($string) {&lt;/pre&gt;&lt;pre&gt;    $newstring = "";&lt;/pre&gt;&lt;pre&gt;    for($i = &lt;span style="color: rgb(255, 0, 0);"&gt;$string.length&lt;/span&gt;; $i &gt; 0; $i--) {&lt;/pre&gt;&lt;pre&gt;        $newstring &lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;= $string[$i-1];&lt;/pre&gt;&lt;pre&gt;    }&lt;/pre&gt;&lt;pre&gt;    return $newstring;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;br/&gt;so, i would not blame anyone for thinking this is a good way to do it in javascript. but it’s not. String concatenation is slow, requiring the string be rebuilt each append. Omitting a var statement creates globals that leak out of the function. Finally, and perhaps this is status quo, but the code is lengthy for what i am used to.&lt;br/&gt;&lt;br/&gt;prototypes reduce code length. a lot. &lt;br/&gt;compare a JS-only version of the same function:&lt;br/&gt;&lt;pre&gt;function reverse(s) {&lt;/pre&gt;&lt;pre&gt;    return s.split("").reverse().join("");&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;faster to write, faster to execute, less overhead and ram also…&lt;br/&gt;&lt;br/&gt;prototypes not only reduce code length, they are easier to program as well.&lt;br/&gt;the code to the right of each dot describes a transformation to be applied to the value left of the dot. The same variable is reused throughout. &lt;br/&gt;this also make it easier to modify.&lt;br/&gt;&lt;br/&gt;if i want to also convert the output to UPPERCASE, in php i would need to wrap a function around the output. This forces me to use the mouse or several arrow key presses, balance params, and make changes to two locations. &lt;br/&gt;&lt;br/&gt;in js, i can simply add another dot in the middle of the prototype chain, in one location, without balancing or extra keystrokes:&lt;br/&gt;&lt;pre&gt;s&lt;span style="color: rgb(255, 0, 0);"&gt;.toUpperCase()&lt;/span&gt;.split("").reverse().join("");&lt;/pre&gt; &lt;br/&gt;i don’t consider this simplistic (though it might be), i consider this concise.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/83560606</link><guid>http://dldavis2.tumblr.com/post/83560606</guid><pubDate>Wed, 04 Mar 2009 15:54:40 -0500</pubDate></item><item><title>site update</title><description>&lt;p&gt;added an index to the site.&lt;br/&gt;
i figure why not let people see more than a single page.&lt;/p&gt;

&lt;p&gt;i will be working on more creative displays, but the info is helpful, so here it is:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://danml.com"&gt;danml - index&lt;/a&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/76262929</link><guid>http://dldavis2.tumblr.com/post/76262929</guid><pubDate>Fri, 06 Feb 2009 18:37:52 -0500</pubDate></item><item><title>president obama let us use your webpages</title><description>&lt;p&gt;The US government creates and maintains vast storehouses of information. Most of these are publicly available online.

Among the more useful:

&lt;/p&gt;&lt;ul&gt;&lt;li&gt;
&lt;a href="http://factfinder.census.gov/servlet/DatasetMainPageServlet?_program=DEC&amp;_submenuId=&amp;_lang=en&amp;_ts="&gt;census data&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://weather.noaa.gov/weather/current/DTTF.html"&gt;weather data&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://tiger.census.gov/cgi-bin/mapsurfer?infact=2&amp;outfact=2&amp;act=move&amp;on=CITIES&amp;on=majroads&amp;on=water&amp;tlevel=-&amp;tvar=-&amp;tmeth=i&amp;mlat=&amp;mlon=&amp;msym=bigdot&amp;mlabel=&amp;murl=&amp;lat=41.80941&amp;lon=-87.61583&amp;wid=2.880&amp;ht=1.040&amp;conf=mapnew.con"&gt;royalty and advertisement free mapping&lt;/a&gt;

&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;br/&gt;
  Images can come from anywhere, but text cannot.

Thus the tiger mapping service has a &lt;a href="http://tiger.census.gov/cgi-bin/mapper/map.gif?&amp;lat=41.80941&amp;lon=-87.61583&amp;ht=1.040&amp;wid=2.880&amp;&amp;on=CITIES&amp;on=majroads&amp;on=water&amp;tlevel=-&amp;tvar=-&amp;tmeth=i&amp;mlat=&amp;mlon=&amp;msym=bigdot&amp;mlabel=&amp;murl=&amp;conf=mapnew.con&amp;iht=1359&amp;iwd=1422"&gt;REST API&lt;/a&gt; that can be used by/from any webpage.
Any webpage can use image data from anywhere, like this pic:&lt;br/&gt;&lt;center&gt;
&lt;img src="http://aa.usno.navy.mil/idltemp/diskmap_99.jpg" alt="current moon view" height="140" width="140"/&gt;&lt;br/&gt;&lt;small&gt;from the US navy&lt;/small&gt;
&lt;/center&gt;

&lt;br/&gt;&lt;br/&gt;
While an API for every bit of government data would be nice, i live in the real world. There is an ongoing economic crises, war, etc. 
&lt;br/&gt;&lt;br/&gt;
  Almost as good as an API would be simple allowable access from other pages. The information is supposed to be free. Without spending a dime, a server can be configuered to allow other webpages to fetch data from it, without a thrid party server. This allows more flexible use, greater creativivty, and removes cost barriers to upcoming programmers. 
&lt;br/&gt;&lt;br/&gt;

  A web page can be saved onto the desktop, thus not needing a server to view the webpage.
Once viewed, that saved page can fetch data directly from government webpages that have made a configuration change or two. It’s not a security problem; this information is already accessible to any browser, server, or regular desktop application. 
&lt;br/&gt;&lt;br/&gt;
  The simple change would mean that all this useful data would be available to mere web pages.
A 14 year old can write an application that 100 million people could use tomorrow; without cost to the programmer. Think of it as a small business incentive to individuals who are willing to work for the common good.

&lt;br/&gt;&lt;br/&gt;
There are a couple way to open the tap:
&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;
&lt;a href="http://www.w3.org/TR/access-control/#access-control-allow-origin"&gt;access conrtol header&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;
&lt;a href="http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00001621.html"&gt;crossdomain.xml&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

If the government were to pick one, it would be the standard overnight.

The Obama administration revamped the &lt;a href="http://www.kottke.org/09/01/the-countrys-new-robotstxt-file"&gt;white house’s robots.txt&lt;/a&gt; file on day one. 
Perhaps they will be open to allowing small fries access to the data to create new combinations, visualizations, and services we cannot yet imagine.

let’s not have any barriers that a 1kb text file cannot overcome!</description><link>http://dldavis2.tumblr.com/post/73652821</link><guid>http://dldavis2.tumblr.com/post/73652821</guid><pubDate>Tue, 27 Jan 2009 21:58:00 -0500</pubDate></item><item><title>green code</title><description>&lt;p&gt;Netbooks, cell phones and other battery-powered devices are quickly becoming a popular way to access the web. I wonder how different kinds code impact the battery usage of these gadgets.  &lt;a href="http://www.sectheory.com/browser-power-consumption.htm"&gt;A recent experiment &lt;/a&gt;showed that web pages using Flash sucked more power than pages with html and javascript alone. It says that “ajax” uses almost as much as Flash. I would presume he is talking about making additional URL request after the page loads. I can see where using the network would be a power drain.&lt;/p&gt;

&lt;p&gt;JavaScript can be used to reduce power consumption for mundane tasks like rotating banner ads,  running a “what’s new” section, or offering a photo slide show. Browsers are also getting much better at running JavaScript. Recent advances have lead to several times-fold increases in performance. This is good new for the battery life as well. If the JavaScript engine can run more efficiently, it has to draw less CPU power. &lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
This got me thinking about performance tuning;&lt;br/&gt;
  If you can make code that runs faster, it more likely than not uses fewer CPU executions.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;takeaway&lt;/b&gt;:&lt;br/&gt;
Performance testing and optimization will not only speed up your app/page, it reduces greenhouse gasses and increases battery life.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/70448449</link><guid>http://dldavis2.tumblr.com/post/70448449</guid><pubDate>Wed, 14 Jan 2009 11:01:21 -0500</pubDate></item><item><title>Random thoughts</title><description>&lt;p&gt;Scenario: You have 5000 people using your web site every day.&lt;/p&gt;

&lt;p&gt;Question: whats cheaper for you: smart servers and dummy terminals, or a dumb server and smart clients?&lt;/p&gt;

&lt;p&gt;Which one uses javascript more? &lt;/p&gt;

&lt;p&gt;Put those 3.8Ghz web browsers to work for you, code javascript.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/63087802</link><guid>http://dldavis2.tumblr.com/post/63087802</guid><pubDate>Thu, 04 Dec 2008 18:33:00 -0500</pubDate></item><item><title>snippit library</title><description>&lt;p&gt;now available &lt;a href="http://danml.com/snips.htm"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
go ahead and bookmark, updates will be auto-applied in the future as they roll out.&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/63087353</link><guid>http://dldavis2.tumblr.com/post/63087353</guid><pubDate>Thu, 04 Dec 2008 18:30:18 -0500</pubDate></item><item><title>finding square roots</title><description>&lt;p&gt;here is an interesting example function for javascript.
while not needed, it serves to demonstrate the procedure using javascript.

&lt;pre&gt;
function sqrt(number){
  var guess = 2, old=0;
  for(var step=0;step&lt;128;step++){
    old = guess;
       guess = (guess + (number/guess)) / 2;
    if(old===guess){break;}
   }
  return guess;
}
&lt;/pre&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/62984863</link><guid>http://dldavis2.tumblr.com/post/62984863</guid><pubDate>Thu, 04 Dec 2008 06:22:00 -0500</pubDate><category>javascript.</category><category>example</category><category>function</category><category>hello world</category></item><item><title>my blog</title><description>&lt;p&gt;&lt;b&gt;&lt;br/&gt;
News:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Readership is up as I am starting to link in public to the blog now.&lt;/p&gt;

&lt;p&gt;I figure why not tell people about it eh?&lt;/p&gt;

&lt;p&gt;Perhaps if nothing else, it’s an interesting example of what we can do without a server using static HTML and JavaScript, same-domain policy be damned.&lt;/p&gt;

&lt;p&gt;I’ve dumped a few extra articles in addition to plenty of opinions,  current JavaScript news, and useful links. more changes and features will roll out progressively. &lt;/p&gt;

&lt;p&gt;New readers:&lt;br/&gt;
Poke around, There’s something for everyone.&lt;br/&gt;&lt;small&gt;(well actually there’s probably only something for a small, elite fraction of the population. but that’s &lt;u&gt;you&lt;/u&gt; right?)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;Since my cost are nothing, I won’t run ads, or spy on you. Contact me if you see something interesting within. Thanks for reading,&lt;/p&gt;

&lt;p&gt;-Dan&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/61646076</link><guid>http://dldavis2.tumblr.com/post/61646076</guid><pubDate>Wed, 26 Nov 2008 05:55:00 -0500</pubDate><category>re-intro</category><category>article rollout</category><category>news</category><category>publicity</category></item><item><title>hacker Alphabit</title><description>&lt;p&gt;&lt;textarea rows="5" cols="40"&gt;&lt;br/&gt;
hackerAlpha = [“4”, “8”, “[“, “)”, “3”, “|=”, “6”, “/-/”, “1”, “_|”, “X”, “1”, “|v|”, “|\|”, “0”, “|*”, “(_,)”, “2”, “5”, “7”, “(_)”, “\/”, “\/\/”, “\xA0%”, “j”, “2”]&lt;/textarea&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/61642118</link><guid>http://dldavis2.tumblr.com/post/61642118</guid><pubDate>Wed, 26 Nov 2008 05:12:12 -0500</pubDate><category>hacker</category><category>javascript</category><category>humor</category></item><item><title>javascript factorial</title><description>&lt;p&gt;can it get any shorter? &lt;/p&gt;

&lt;p&gt;I don’t think so, but feel free to prove me wrong.&lt;br/&gt;&lt;code&gt;&lt;br/&gt;
  function factorial(n){return n?n--*factorial(n):1}&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/61641887</link><guid>http://dldavis2.tumblr.com/post/61641887</guid><pubDate>Wed, 26 Nov 2008 05:09:52 -0500</pubDate><category>javascript</category><category>demo</category><category>simple</category><category>hello world</category><category>factorial</category><category>math</category></item><item><title>google image search API</title><description>&lt;p&gt;&lt;a href="http://ajax.googleapis.com/ajax/services/search/images?v=1.0&amp;callback=gcb&amp;q=obama"&gt;http://ajax.googleapis.com/ajax/services/search/images?v=1.0&amp;callback=gcb&amp;q=obama&lt;/a&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/54622293</link><guid>http://dldavis2.tumblr.com/post/54622293</guid><pubDate>Wed, 15 Oct 2008 01:14:24 -0400</pubDate><category>google</category><category>api</category><category>json</category></item><item><title>Copy to Clipboard</title><description>&lt;p&gt;&lt;div class="smallfont"&gt;&lt;br/&gt;                                &lt;strong&gt;Copying text to clipboard with JavaScript&lt;/strong&gt;&lt;br/&gt;                        &lt;/div&gt;&lt;br/&gt;                        &lt;hr style="color: rgb(85, 85, 118); background-color: rgb(85, 85, 118);" size="1"&gt;&lt;br/&gt;                        &lt;!-- / icon and title --&gt;&lt;br/&gt;                &lt;br/&gt;                &lt;br/&gt;                &lt;!-- message --&gt;&lt;br/&gt;                &lt;div id="post_message_738429"&gt;&lt;br/&gt;                        &lt;br/&gt;                        Here is a simple way to place small bits of text upon the user’s clipboard.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Normally restricted by browser security, the clipboard is freely open to flash.&lt;br/&gt;&lt;br/&gt;this function uses a simple flash app to dump to the clipboard.&lt;br/&gt;&lt;br/&gt;It avoids any kind of user warning or confirmation regarding the clipboard that characterize JavaScript-only solutions.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thus, it requires flash to be installed.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div style="margin: 5px 20px 20px;"&gt;&lt;br/&gt;        &lt;div class="smallfont" style="margin-bottom: 2px;"&gt;Code:&lt;/div&gt;&lt;br/&gt;        &lt;pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 750px; height: 194px; text-align: left;"&gt;function copy(str) {&lt;br/&gt;   var D=document;&lt;br/&gt;    if(!copy.div) { copy.div = D.createElement('div'); D.body.appendChild(copy.div);  }&lt;br/&gt;&lt;br/&gt;flashVar = "Q1dTB3kAAAB4nKtgYI1nYOBfwMDAw8jgzPT//3975lAGBoYOdQYWhu\&lt;br/&gt;SczIKk/MSiFIac1Lz0kgyG4MriktRchuLUEme41DQmBg4GGRDJ6Cc0l4l  BAibCzsDO\&lt;br/&gt;CDSJgwksyRwkzuAA5AIAd7oY/w==";&lt;br/&gt;&lt;br/&gt;copy.div.innerHTML =  '&lt;embed src="'+flashVar+'" FlashVars="clipboard='+encodeURIComponent(str) +&lt;br/&gt;    '" width="0" height="0" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;';&lt;br/&gt;}&lt;/pre&gt;&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;Example:&lt;br/&gt;&lt;br/&gt;&lt;div style="margin: 5px 20px 20px;"&gt;&lt;br/&gt;        &lt;div class="smallfont" style="margin-bottom: 2px;"&gt;Code:&lt;/div&gt;&lt;br/&gt;        &lt;pre class="alt2" dir="ltr" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 750px; height: 34px; text-align: left;"&gt;  copy("Hello World!");&lt;/pre&gt;&lt;br/&gt;&lt;/div&gt;  -Run above then press &lt;CRTL&gt;+&lt;V&gt; in a text area.&lt;br/&gt;&lt;br/&gt;  -It should say Hello World!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;It is limited in the amount of data it can copy, about 2-4kb.&lt;br/&gt;&lt;br/&gt;It also cannot read the clipboard at all, so don’t bother to try.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Despite it’s shortcomings, i still find it very useful, and hope you might as well.&lt;/div&gt;&lt;/p&gt;</description><link>http://dldavis2.tumblr.com/post/54207807</link><guid>http://dldavis2.tumblr.com/post/54207807</guid><pubDate>Sun, 12 Oct 2008 10:30:19 -0400</pubDate><category>clipboard</category><category>flash</category><category>snip</category></item></channel></rss>

