Tag Archives: archive

trim javascript faster than the Magna Carta

5 Feb

From: http://blog.stevenlevithan.com/archives/faster-trim-javascript

Since JavaScript doesn’t include a trim method natively, it’s included by countless JavaScript libraries

news: Yahoo releases service to query to web with json results

22 Dec

f’n sweet

From: http://ajaxian.com/archives/yql-converting-the-web-to-json-with-mock-sql

I like getting data from the web and I love JSON – as it is easy to use. The issue is that not many things on the web come as JSON from the get-go. Hence we need converters. You can use cURL and beautiful soup or roll your own hell of regular expressions. Alternatively you can use Yahoo Pipes to build your converter. Pipes is the bomb but a lot of people complained that there is no version control and that you need to use the very graphical interface to get to your data (which was the point of Pipes but let’s not go there).

AlasRejoice for there is a solution now available and it is called YQL. YQL is a SQL-style language to get information from all kind of web services, and – using oAuth – even Yahoo’s social graph. There is a test console available for you to get to grips with all the information it gives you access to (which is a lot!):

Check It Out:
Ajaxian » YQL – converting the web to JSON with mock SQL

Reads: the evolution of search

18 Dec

From: http://blog.tigerlogic.com/chunkit/the-evolution-of-search/

A look at the History, Vision, Innovators, and Future of Information Accessibility
1. Foundations

A. The Beginning – In the Pre-WWII era, information sharing was in its relative infancy compared to today. Without the help of more modern electronics, we had reached the upper limit in efficiency of how and where information was stored and shared. The organization and cataloging of information within libraries and archives had been well perfected, but the retrieval and dissemination of that information was being hindered by technology.

B. The Vision – In the burgeoning world of scientific advancement that characterized the United States during and after WWII, astute observers like Vannaver Bush began to realize the need for a better system of information sharing. In an article published in The Atlantic Monthly, Bush observed that:

Check It Out:
» The Evolution of Search ChunkIt!: TigerLogic ChunkIt!

couchdb: couchdb 101

11 Dec

So after 3-4 days of research and study I’m compiling a list of links that helped me finally understand couchdb. Still bunches to learn, but hopefully it will save others from 4 days of googling.

Start

The very first thing you should read is the work in progress online couchdb book:
Relax with CouchDB [http://books.couchdb.org/relax/]

Now that your started

The following sections are grouped by what I left the article better understanding. They may cover other areas, but then again more knowledge leads to better understanding right?

JSON

Just in case you don’t understand json:

http://webt.wordpress.com/2007/10/01/json/

Couch MapReduce

fyi: hashes

Depending on what language your coming from you may know hashes as arrays or associative arrays. When they say reduce returns a single value, they are referring to the hash value it returns (scratched my head for a while)

If your coming from php an easy way to connect the dots is to think of how serialize creates a string that represents your object. Only in couchDb this is a json string

I had my eureka moment here:

http://www.ibuildings.com/blog/archives/1291-Some-thoughts-on-CouchDB.html

Just in case you didn’t eureka:

http://rrees.wordpress.com/2008/03/09/couchdb-querying-data/

Damien Katz explains more on couch’s mapreduce ( check the part 2 near the end as well ):

http://damienkatz.net/2008/02/incremental_map.html

MapReduce Method

In case you didn’t know mapreduce isn’t something couch invented, you can learn more about mapreduce below.

explains the mapreduce method in detail:

http://code.google.com/edu/parallel/mapreduce-tutorial.html#MapReduce

the mapreduce white paper:

http://labs.google.com/papers/mapreduce.html

mapreduce lecture (didn’t watch, but it was recommended by google, so why not):

http://www.youtube.com/v/-vD6PUdf3Js

using couchdb

blog db example / couchdb “joins”:

http://www.cmlenz.net/archives/2007/10/couchdb-joins

user permissions system example / offers rdbms comparison:

http://kore-nordmann.de/blog/couchdb_a_use_case.html

aimee’s 8+ couchdb on rails series (links to part 1, but your good from there):

http://aimee.mychores.co.uk/2008/09/07/post/320/

couchdb internals

Ricy ho’s overview:

http://horicky.blogspot.com/2008/10/couchdb-implementation.html

Related discussion where btrees are further discussed (as well as some decent bantering):

http://www.reddit.com/r/programming/comments/792hf/couchdb_implementation/

Ayende Rahien has an indepth series on couch db called: reading erlang

http://ayende.com/Blog/archive/2008/09/24/reading-erlang-inspecting-couchdb.aspx

http://ayende.com/Blog/archive/2008/09/24/more-couchdb-reading-btreelookup.aspx

http://ayende.com/Blog/archive/2008/09/24/more-couchdb-reading-btreequery_modify.aspx

http://ayende.com/Blog/archive/2008/10/04/reading-erlang-couchdb-from-rest-to-disk-in-a.aspx

http://ayende.com/Blog/archive/2008/10/04/erlang-reading-couchdb-digging-down-to-disk.aspx

http://ayende.com/Blog/archive/2008/10/06/reading-eralng-couchdb-streams.aspx

The most important part

Use it damn it! get planning, hacking, pop locking and start playing with couch

sources

Sources not referenced already:

http://damienkatz.net/2008/09/peek_into_couchdb.html

http://jan.prima.de/plok/

couchdb: mapReduce explained

10 Dec

So far the the to biggest hurdles in my understanding of couchdb are mapReduce and how best to use data in it. Thanks to Michael Stillwell mapReduce I finally understand mapReduce.

From: http://www.ibuildings.com/blog/archives/1291-Some-thoughts-on-CouchDB.html

A few weeks ago Jan Lehnardt of CouchDB came by to Ibuildings UK and gave a talk about the project. CouchDB is a database that’s designed to be highly scalable, in terms of, well pretty much everything really: the amount of data it can handle, and the number of CPUs the distributed server can efficiently use in parallel, the number of concurrent clients. (Note though that CouchDB sits at version 0.8.1 at the moment, and many of the scalability features either haven’t been implemented, or haven’t been tested.) What follows is a short description of how CouchDB works, including the unusual MapReduce-powered database query technique, as gleaned from the talk and a few days’ worth of playing with it.

Check It Out:
Ibuildings – Ibuildings blogs > Some thoughts on CouchDB

couchdb: how to do "joins" in couchDb

10 Dec

While continuing my trolling for all things couchdb, I came across this tutorial. Christopher Lenz uses a blogging system to explain how a couchdb database could be setup and how to perform a join (or something similar). Better yet the reccomended join method comes from the couchdb creator himself :)

From: http://www.cmlenz.net/archives/2007/10/couchdb-joins

I’ve been playing more and more with CouchDB lately. After putting together a Python library, I worked on a brand new included HTML/AJAX interface. Now I’m starting to dive into the Erlang code, which is my first serious encounter with Erlang. In particular, I started a branch that aims to replace the HTTP server underpinnings with Bob Ippolito´s not-quite-released-yet Mochiweb library.

Despite all that activity (and past experience with the conceptually similar Lotus Notes), the correct approach to designing applications “the CouchDB way” isn’t always obvious to me at this point. Just today, there was a discussion on IRC how you’d go about modeling a simple blogging system with “post” and “comment” entities, where any blog post might have N comments. If you’d be using an SQL database, you’d obviously have two tables with foreign keys and you’d be using joins. (At least until you needed to add some denormalization.)

But what would the “obvious” approach in CouchDB look like?

Check It Out:
about:cmlenz – CouchDB “Joins”

couchdb – a few articles to get us started

9 Dec

Jan Prima, one of the devs on couchdb posts a “New at Couch” post on hey blog [http://jan.prima.de/plok/]

the last one was Nov. 8 and there are some great couchdb related links

From: http://jan.prima.de/~jan/plok/archives/160-News-at-Couch-November-2008.html

Welcome to another installment of News at Couch, our review of what’s new with, on and around CouchDB.

What’s the most interesting new idea you’ve seen in the field of web development in the past year?

New database architectures: CouchDB and friends.

— Tim Bray

Check It Out:
News at Couch – November 2008 – plok

Php: how to get base domain

8 May

The problem: take a url (in this case, we’ll specify an absolute url,
http and all) and return only the base domain. For instance, given
www.domain.com’ or ’sub.subdomain.domain.com’, it should return
‘domain.com’.

Simple
enough, but now consider: ‘http://www.example_site.com.pk’ or
http://damnlimies.co.uk’ or
‘http://username:password@this.is.a.worst.shortly.subdomain.thisIsMyMainWebsite.com.cl

It is an anvil upon which many a hammer has been broken:

http://lists.evolt.org/archive/Week-of-Mon-20031201/152316.html
http://www.webmasterworld.com/forum88/10656.htm

Anyway,
I think I have a solution. I won’t bother with the details of how I
arrived at it. Suffice to say, you just need to break down your own url
parsing process. It passed the battery of tests at the end:

Phosphorus and Lime: PHP: Get Base Domain

validating phone numbers with php

3 Jan

When relying on your end-user to supply information in the proper format, you’re S.O.L. when it comes to doing anything with that data. It’s best to use some proper PHP tools to validate your data and make sure it’s in a format your application can read before passing it along to other places. Follow me as I take a look at validating user-entered data in this first installment of what I hope to be a continuing series.

Most of the applications I work with have a Web-based front-end where users submit data. Other applications, also Web-based, involve data that has been imported from some other source, such as a text file. In both situations, the data that the application gathers is unreliable at best. I simply cannot trust a person or a text file (of data that was entered by a person) to enter data in the correct format that I require. In fact, since I’ve worked with text files that have been compiled from data entered by customer service reps, I’ve come to find that no two customer service reps enter data in the same way. In fact, most don’t enter data the same way twice!

Ben Ramsey » Blog Archive » Making It Valid: Telephone Numbers

Powered by ScribeFire.

way back machine

8 Nov

ever try to check out a site that nolonger exists? luckily the way back machine has them for you. It’s came in handy from time to time.

Internet Archive

Powered by ScribeFire.