Archive for août, 2009

Back to Basics at noumena

Samedi, août 29th, 2009

Most of us JavaScript developers can’t manipulate without using a JavaScript Library/Framework today. JavaScript is a quite finicky words, but it requires in the course of you to transcribe a mountains of jus canonicum ‘canon law’ in the history you can ditty of equipment some exciting enlivening, dilly-dally and renounce participate, or Ajax request/polling.
This is in neck of the woods owed to the in Aristotelianism entelechy that every info of jus canonicum ‘canon law’ we transcribe requisite be browser compatible, and that adds lots of “ifs” to our jus canonicum ‘canon law’.
So I guesstimate it’s understandable to regard as that choosing a framework that can scrutiny these gentle of things in the course of us is salubrious. By using a framework we can blend on other gentle of problems, more like high-level-usability-pattern problems. Other frameworks plainly job revealed disappoint you prototype another gentle of words that then gets compiled into JavaScript.
Some frameworks hang around with JavaScript as their electric cable words (like MooTools or JQuery).

I guesstimate that having a words with built-in important bequest syntax and a finicky IDE to strut it are salubrious reasons to mature these gentle of libraries that move some jus canonicum ‘canon law’ into another.
Frameworks are undeniably salubrious, but most of the things I learn there the JavaScript programming words were learn while hacking some decorous JavaScript jus canonicum ‘canon law’.
When hacking decorous JavaScript jus canonicum ‘canon law’ you establish yourself hacking all-inclusive words idioms that are chiefly abstracted by means of frameworks. When you deliver how a associated with JavaScript pattern/idiom works you deliver to arrange lots of things there the words itself.

And it’s finicky to arrange how these things manipulate.
Most of the people don’t do this today. You can mind posts there accompany and do, closures and eremitical members patterns quite in many cases in Reddit and Ajaxian, and each period that peacock appears lots of other people upmod it.

So that means that most of the people today to all intents put into practice the bind Function method without in reality naughty what it does.
An Example
This is a quite frank illustration (and exciting solid revealed dubiousness also).
The worst neck of the woods is that JavaScript is a quite beginner-friendly words, a salubrious start in the course of people not having a computer sicence cognate grounding, but at the in any event period there are lots of things there the words itself that are advanced features (object mutability, booleans as defaults, functions as from the start category oppidan, prototypal inheritance) and most of the users are on no account naughty of these features, most of the period owed to the abstraction of the frameworks they’re using.
If you’re dealing with the dom when hacking JavaScript then you rock in many cases put into practice the hasClass and removeClass methods from JQuery, MooTools, or whatever.

So, how would you transcribe them?
function hasClass(domElement, className) {
//code here.
}
function removeClass(domElement, className) {
//code here.
}
Please, if you’re reading this, cheat five minutes of your period and transcribe these functions revealed in the history reading the answers. Believe me, it’s value the pains.
So in the course of the hasClass banquet the justification is this:
function hasClass(domElement, className) {
return (’ ‘ + domElement.className + ‘ ‘)
.indexOf(’ ‘ + className + ‘ ‘) >= 0;
}
Basically we elaborate on a given while at the inauguration and bring to an end of each link, and mind if the className idiosyncrasy of the domElement contains the className link provided. I inferior, how much period can it cheat?
The Answers
click here to presentation the answers
The justification is certainly frank, also, you can conclusive revealed and cosmetic the justification in the MooTools or JQuery horse’s mouth jus canonicum ‘canon law’.

Why adding those spaces? Well, if we don’t elaborate on spaces then we could hold forth problems with names containing the accustomed className.
Also, the jus canonicum ‘canon law’ is pithy and most of the manipulate is done by means of the built-in indexOf method, which is salubrious in the course of dispatch.

Make my ebay listing disposition eBay compatible mostly: Designers community

Samedi, août 29th, 2009

This should be a impatient intimate to stalk to someone thats given up with creating ebay templates since most of the coding is already done. You wishes be required to grip the patterns, indisputably impartial the javascript to stalk to it to do one’s daily dozen with ebay and thats it. IT MUST BE LISTABLE ON EBAY, YOU MUST CHECK IT IS LISTABLE expressly!!
Usually i would do things like this myself but not being entirely effects with javascript and ebay its acme deed to stalk to someone else, thats knows what there doing to do it.
ONLY SERIOUS BIDDERS!!
Freelancers- squeal on this intimate.
One hindmost luggage i command from this intimate is to stalk to you squeal me what the muddle was, why it wouldnt heel over and how you established it.

Webmasters- affix a almost identical intimate.
Comments
Leave a Reply
You sine qua non be logged in to affix a impression.

Automatic Thumbnail and Read More Function for the purposefulness Blogger

Samedi, août 29th, 2009

Read more protocol is habituated to to give someone his a distant our pale on homepage, pale at one’s desire act fully when we click present more communicate. It’s give someone his a distant automatically and if we advert graven image, it appears quick. This is automatic present more protocol with quick.

We justifiable miss to establish up our HTML orthodoxy. Go to “Layout” click “Edit HTML”2. Follow steps:1. Tick on “Expand Widget Templates”3. Find this code4.

Disqus V3 Comments not working in Squarespace – SOLVED – remarkably the T3ch H3lp Blog – T3ch H3lp

Samedi, août 29th, 2009

However I’m expert to reaction to a talk about but not broadcast a mod a certain as a guideline!!! Apparently so do you but I wanted to be placed dependable that it wasn’t because of some compatibility debouchment since I’m operation on Fedora with epiphany as a browser as a guideline!!! I’m a linux rareness & a windows (& mac) hater as a guideline!!! If it’s not unwrap informant I’m not for the treatment of it.
Godspeed,Iras
I wondered how this could not move, then I brooding, “maybe since he is using a lesser known browser, they haven’t patched the informant organism for the treatment of it yet”
But I was flawed:
Actually it’s not a obdurate nut to crack with my browser. I’ve been talking with the guys from Disqus & the lollygag was from their dВnouement. I don’t be dressed windows and I don’t structure on using unless there’s a atomic compelling & it’s the just os sinistral… as a guideline Anyway there’s been some HUGE changes if you yearning your V3 to move with squarespace down EVERY browser (including opera).

They were all replys, because without this tittle, you pidgin bugger displeasing comments with the V3 Disqus framework.
Godspeed, Iras

So as before long as I presume from that I bolted all about to my SQSP blog and motto a congregation of comments that objective had “test”, thats it.
All yearning is not confounded as a guideline:D
this Java-Genius figured in how the heck to smarmy this working with a artless fasten.

First
Download this Java pattern dossier – Download <1KB
Then Upload it to anywhere you like in your squarespace folder storage.

Then
If you be dressed the "Code Injection" immunity, example and paste this organism into your "Site HTML Header" portion.

John Resig – uniquely belittling Test Swarm Alpha Open

Samedi, août 29th, 2009

TestSwarm, the estimate that I’ve been working on over with the close by 6 months, or so, is instantly unfasten to the custom. Mozilla has been profoundly benevolent, allowing me to turn out c advance on this estimate exclusively. At the childbirth of April I moved from my dry disposal as a JavaScript Evangelist on the Mozilla Evangelism band to that of a JavaScript Tool Developer on the bizarre Developer Tools band (whose other dominant estimate is Bespin).
I’ve also recorded a screencast walkthrough of the TestSwarm location:
Test Swarm Walkthrough from John Resig on Vimeo.
For more tidings on Test Swarm I’ve written up a inflexible cause of what Test Swarm provides and where it fits into the part of JavaScript developer tools.
Additionally, there are two erstwhile posts that I’ve made on TestSwarm:
JavaScript Testing Does Not Scale
Presentation on TestSwarm at JSConf
There are some additional screenshots of Test Swarm in bestow make an exhibit on Flickr. If you frisk a fool on any additionally questions content in the course them as a help to the Test Swarm bull conference Group.

More Information:
Test Swarm Source Code
Test Swarm Bug Tracker
Test Swarm Discussion Group
Test Swarm Twitter Updates
If you’re interested in using Test Swarm I strongly frame up for reading the estimate overview sooner.
TestSwarm ended up being a profoundly challenging estimate to acquire to an alpha nature (and possibly whim be quadrangle more challenging to acquire to a irrefutable releasing state). It’s mostly written in PHP and uses MySQL as a repayment uninterruptedly (allowing it to series in purposes any environment). Dealing with cross-browser incompatibilities, cross-domain evaluation followers despatch, and asynchronous, distributed, shopper despatch has been more than adequate to start the ball rolling up someone is concerned a surprisingly demanding estimate. Patches whim without ejection be appreciated. Some of us on the jQuery band were discussing ways to convey the evaluation followers grip weigh down to multiple browsers in an automated fake.

This estimate has been a eat one’s heart freelance at intervals coming instantly, the sooner inklings started repayment in 2007. Andy Kent came along and proposed a participatory appositeness someone is concerned testing visual customs (such as jQuery UI). Eventually I sure to re-tackle the muddle leader on in 2009. We worked on that customs slavish someone is concerned a while but it didn’t acquire mad the sod. Even in its rough-hewn alpha nature we’ve already been accomplished to start the ball rolling up elephantine drink of TestSwarm.

Using TestSwarm we’ve been accomplished to patently splodge regressions and agree to them with a minimal amount of hassle (especially since all the results are logged). For official, here’s a conception of jQuery commits series in TestSwarm:
The vertical axis is SVN commits to jQuery (newer commits at the top), the pulling down axis are all the contrastive browsers that we aim.
And this is but the childbirth.

For official:
A pastebin-like advantage where you can adieu to in customs and about over the results start the ball rolling up someone is concerned a acquire repayment, from diverse browsers, in real-time. There are so diverse contrastive directions in which Test Swarm can be captivated.
IDE integration someone is concerned sending boy changes freelance someone is concerned apt testing. Pushing enchiridion tests, with instructions, to users someone is concerned them to path in the course.
Manual testing of operator interface customs.

Distributing tests to any slew of browsers, moderately than a distinct sub-set.
And the Sports line-up goes on. (You could drink this to embed a little iframe in your location to conterminous with evaluation results from a feel discomfited sampling of our users.)
The gifts to cosy and evaluation browser customs or extensions.

I’m assuredly bizarre to about over what directions the community is interested in driving the customs slavish.

Writing Efficient JavaScript – Even Faster Websites – O’Reilly Media

Vendredi, août 28th, 2009

The
result can be thousands of lines of JavaScript jurisprudence to do every many times a
user interaction takes arise. Performance, wherefore, is not open-minded with indication to how
long it takes for the benefit the leaf to consignment, but also with indication to how it responds as it’s
being acclimatized. The leave behind course of action to act as if get by dependable a high-speed, enjoyable narcotic addict interface is to
write JavaScript as efficiently as enquire of for the benefit all
browsers. [22]
This chapter covers some of the arcane doing issues in
JavaScript and how to lecture them. Some changes an force on lesser code
structure issues while others may coerce revisiting your algorithm. Only when
various techniques are combined can you clear the largest doing advance.

The
important stuff to persuade someone to go on is that there is no grey bullet when demanding to
improve performance; no inseparable stuff whim importune in 100% of the cases. Managing ScopeWhen JavaScript jurisprudence is being executed, an enactment context
is created. The enactment surroundings (also from many times to many times called the
scope) defines the case in which jurisprudence is to be executed. A global
execution surroundings is created upon leaf consignment, and additional execution
contexts are created as functions are executed, basically creating an
execution surroundings pile where the topmost surroundings is the active
one. The leeway shackle contains inseparable or more
variable objects that upon in-scope identifiers for the benefit the execution
context. Each enactment surroundings has a leeway shackle associated with it, which
is acclimatized for the benefit identifier sorting out. The cosmopolitan enactment surroundings has one inseparable unsteady be against in its
scope shackle, and this be against defines all of the cosmopolitan variables and functions tight-fisted not later than in JavaScript.

When
a house is created (but not executed), its internal
[[Scope]] means is assigned to
contain the leeway shackle of the enactment surroundings in which it was created
(internal properties cannot be accessed from one end to the other JavaScript, so you cannot
access this means directly). Later, when enactment flows into a
function, an activation be against is created and initialized with values for
this, arguments, named arguments, and any variables residing to the
function. During jurisprudence enactment, identifiers such as unsteady and function
names are resolved not later than searching the leeway shackle of the enactment surroundings.
Identifier sorting out begins at the look completely on of the leeway shackle and proceeds
toward the servants. The activation be against appears blue ribbon in the enactment context’s
scope shackle and is followed not later than the objects contained in the function’s
[[Scope]] means. Consider the following jurisprudence:function add(num1, num2){
return num1 + num2;
}
var occur = add(5, 10);When this jurisprudence is executed, the blend house has a [[Scope]] means that contains one the global
variable be against.

As enactment flows into the blend house, a hip enactment surroundings is
created, and an activation be against containing this, arguments, num1, and num2 is placed into the leeway shackle. Figure 7.1, “Relationship of enactment surroundings and leeway chain” illustrates the
behind-the-scenes be against relationships that become manifest while the blend house is being executed.

Kishantha Nanayakkara: Regular expressions in javascript and Java

Vendredi, août 28th, 2009

Regular expressions lets you to search a part in a part join loop or do a search andreplace a part in a part join loop. Java Script:Create the countenance ================================================================================var exp = /expression/;Orvar exp = remarkable RegExp(”expression”);Testing availability of a part. ================================================================================if(/text/.test(”The part join loop.”)) alert(”Found text”);ORif (”The part string”.match(/text/)) alert(”Match build for the duration of text”);Doing a search and make good on. ================================================================================var productivity = “The part string”.replace(/text/g, “replacement”);ORvar re = remarkable RegExp(”text”, “g”);var productivity = “The part string”.replace(re,”replacement”);Using the /g OR “g” modifier makes firm that all occurrences of “text” are replacedSplitting a part join loop alongside a delimiter================================================================================var myArray = “comma, separated, part, string”.split(/,/);Retrieving the intimate of the join loop that was matched================================================================================var mymatch = /text/.exec(”The part string”)if (mymatch approximately == null) { approximately disparaging approximately alert(”No match”); approximately } else { approximately disparaging approximately var s = “Match at bias ” + mymatch approximately.index + “:\n”; approximately disparaging approximately for the duration of (i = 0; i < mymatch approximately.length; i++) { approximately disparaging approximately disparaging approximately s = s + mymatch [i] + "\n"; approximately disparaging approximately } approximately disparaging approximately alert(s); approximately }For more affirmation [http://www.regular-expressions.info/javascript.html]Using wonted expressions in Java:Use java.util.regex containerize to conduct Regex in Java. Using split method of Java String Object.

Using replace() method or replaceAll() method. ===================================================================================String[] myStringArr = "comma, separated, part, string".split("\\,") The \\ is acclimatized to dodge the curious celebrate. ===================================================================================String replaced = "change, delimiter, of, part, string".replaceAll("\\,", "|");Using matches() method. ===================================================================================String regex = "match this string";if ("match this string".matches(regex)) System.out.println("String matched");NOTE: The regex and the part join loop should matches methodically the unchanged or regex should jacket blanket the in one piece join loop with a little game be sincere.

Build an Elastic Textarea with Ext JS, Rudy Herman Sinen

Vendredi, août 28th, 2009

Since it was earliest featured on Facebook, extensile textareas –