Tag Archives: dynamic

Google introduces Native client: It might be like java, it might be like activex, jury is still out

9 Dec

Ok I’m kinda confused are they trying to replace java, or activex, both…?

From: http://google-code-updates.blogspot.com/2008/12/native-client-technology-for-running.html

Modern PCs can execute billions of instructions per second, but today’s web applications can access only a small fraction of this computational power. If web developers could use all of this power, just imagine the rich, dynamic experiences they could create. At Google we’re always trying to make the web a better platform. That’s why we’re working on Native Client, a technology that aims to give web developers access to the full power of the client’s CPU while maintaining the browser neutrality, OS portability and safety that people expect from web applications. Today, we’re sharing our technology with the research and security communities in the hopes that they will help us make this technology more useful and more secure.

Check It Out:
Google Code Blog: Native Client: A Technology for Running Native Code on the Web

Building Something Scalable: Caching

5 Oct

I’ve been seriously getting my kicks with scalability fora number of months, so why not start on ongoing series where I talk about what I’ve learned / found?

So welcome to to the first: Building Something Scalable – An ongoing experiment. This post covers caching. I’ll cover delivery in the next post.

Keep in mind language wise I’m using php, but the general advice should be sound, regardless of language. If you disagree with something or have a better way, feel free to comment.

So now that I’ve ranted off 4 topics, maybe I should expand on them a bit.

Use Caching

Caching is a good thing, but use caching is a pretty vague statement, so let’s expand.

Caching isn’t just a one ring to rule them all type of solution. Its actually a fixture of a number of different solutions, that work together to boost your site / applications overall performance.

Database caching

I consider database caching a 2 part solution. You have the mysql query cache, but I also like to have a server side query cache as well. Why? I tend to use oop and having a server side query cache allows me to cut some overhead both appilcation wise, and by preventing me from having to connect / query mysql.

The big issue with server side query caches is stale queries. The mysql query cache prevents stale caches automaticly, but with a server side query cache we’ll need to set a TTL (time to live). I tend to go with something really low like 5-10 seconds.

5-10 seconds may seem pointless, but it allows higher traffic applications to handle a number of requests with fewer queries to mysql. This takes some of the load from mysql, so  your database is performing under less load than it would have without the server side query cache.

There is plenty of information on the mysql query cache online, so fire up google and start researching. For your server side cache here a few things to keep in mind

  1. keep your cache in a secure location. If your using a file cache this means outside of your web directory
  2. hashing is a quick and painless way to uniquely id your queries. md5(’select * from table1′) will allows return md5(’select * from table1′) if done correctly.
  3. prevent cache filename collisons.
  4. do a light weight encoding on cache files. base64_encode / base64_decode are quick and easy to use. They’re not secure, but its a good idea to add some basic obfuscation
  5. keep your TTL low. Your query cache should try to stay as fresh as possible.

Opcode Cache

Php is compiled / ran at runtime (when you request a page / script). Opcode caches store the compiled code so that your code doesn’t have to be compiled for every request. Opcode caches can increase your codes performence by up to 90%, but then again, any increase helps the overall perforence of your site / application.

There are a number of opcode caches avaible for php. I prefer xcache, but there are a number of other opcode caches available for php.

Static content cache

Static content unlike dynamic content is, well static. Your probably wondering: Why cache something thats already static? Simple, performence. Static content though is cached / served differently than dynamic content. I know this touching more on delivery, but its still worth mentioning.

Static content is often served through a CDN (content delivery network) or a web cache. A CDN and web cache act similarly, except that a cdn has a number of servers setup in various locations.

Content Delivery Network
A CDN acts just as it’s name says: It delivers your content via its network of servers. The CDN selects a server closest to the location of the user, and serves your content from that location. Whats the benifit? Faster delivery of your content. Is it worth it? That’s a question only you can answer. Do some research, compare the solutions, check you budget – and you’ll have your answer.

Web Cache
A web cache or reverse proxy simply put delivers your content faster. I’m not to well versed in the science of it all, but here’s a basic break down of what I do know:

Web caching software like vanish (in the past squid was the standard) handle servering static content better than apache, and with a smaller footprint. The web cache creates a cache of your content when requested and then delivers your content from its memory / disk cache.

The most obvious benefit from all this? Reduced server load. Apache is a resource hog (there I said it), but that will be covered in a future post in this series. By moving static content delivery to software created just for this task your freeing resources and of course getting content to users quicker.

Output Cache
So far we’ve looked at a number of ways to increase the speed of dynamic and static content, but there’s still one major item left out: Output Caching.

As your scripts / application generates pages, you can cache them to be served for future requests. Output caches in general can be as basic or complex as you need them. A few things to keep in mind.

  1. stale content, your cache should have aTTL(time to live) that prevents it from serving stale content
  2. filename collisons – your naming scheme should prevent filename collisons
  3. store your cache outside of your web folder
  4. logged in users / vs non logged in users – come up with a solution that deals with this.

Variable / Object Caches

Your code has objects and variables, often some of these objects are database intensive. An object / Variable cache is a way to store your objects and variables. The thing to keep in mind with these types of caches is speed.

It makes no sense to cache something like $var=1+1;. You can run that command quicker than you would access it from the cache. A good example of somethign to cache would a class object that runs a number of queries on the database, but accesses content that doesn’t change as often. By caching this object you can prevent a few database queries (or cache calls). Or a class object that generates a number of child class objects.

I could go on and on about this subject but lets get to the point. If your application is running on only one server use a file cache. If your application uses more than once server look into memcached / memcachedb.

Thats it.
Hopefully that was short and sweet, the next post will cover delivery.

Greg – Out

all about the wordpress 2.5 caching system

23 Apr

theres a post on neosmart that answers alot of questions about the new caching system in wordpress

Ever since the creation of interpreted languages and the birth of dynamic web content, developers have been on the lookout for tools, workarounds, and extensions in search of a solution for a solution to bring maximum performance to the world of dynamically-generated web pages.

Perhaps the simplest, most straight-forward, and most effective of these solutions is the caching technique. In most caching implementations, the dynamic content generated by user requests to a particular URI on a server trigger the caching mechanism which then stores the generated content in a “storage facility” somewhere. Future requests to the same URI retrieve the stored content rather than spend time and effort re-creating the response.

The most-popular method of caching involves the archiving of the complete HTML response generated by the webserver and then stored as a static content on the hard drive for retrieval at a later date (usually with some mechanism responsible for expiring the content upon certain actions or after a set amount of time).

WordPress 2.5 and the Object Cache… The NeoSmart Files

news: 2057 Toyota BioMobile Mecha Concept

12 Oct

2057 Toyota BioMobile Mecha Concept | Auto Unleashed

Toyota lost its mind. After presenting the i-REAL wheelchair Concept, here’s the Toyota Mecha Concept, which is scheduled to be released in 2057 (probably in the spring…or summer…or winter…do you really care?). This is crazy, right? Except that it’s not like this, the Mecha Concept was created for the Design Challenge at the upcoming L.A. AutoShow.

And here’s what Toyota was thinking about when they created these designs:

“It is year 2057 and due to limited ground space, vertical architectures have caused the transportation industry to create new pathways that also explore vertical space. An innovative solution is discovered in biomimicry. Inspired by life found in nature, the vehicle is powered by pollution with dynamic driving instincts and structural adaptations to accommodate the user’s need for space.

Powered by ScribeFire.

simple viewer flash image gallery

27 Sep

this is old news, Just realized i’ve never mentioned simple viewer.

simple viewer is a flash gallery system. I’ve used it for a number of projects (actually using it now) and it allows for dynamic content / config.

Features:

* Intelligent image pre-loading.
* Intuitive image navigation
* Lightweight (17k).
* Customizable interface – Set text color, frame color and width, navigation position.
* Resizable interface – Interface scales to fit browser window.
* Cross platform – Windows/Macintosh/Linux (requires Flash 7 or higher).
* Flash 7 detection. Users without Flash 7 are messaged to upgrade Flash.
* International font support.
* Keyboard Navigation (Cursor keys, Home, End, Page Up/Down)
* Mousewheel navigation
* Optionally right-click to open image in a new window.
* Free!

Creating your own SimpleViewer gallery is easy. There are 5 options for creating a SimpleViewer gallery:

*
Automatic via Desktop software

Automatically create a SimpleViewer gallery using desktop software (such as PhotoShop, Picasa, iPhoto, RapidWeaver, Aperture, Lightroom). View Automatic Desktop Instructions.
*
Automatic via Server-side Script

Automatically create a SimpleViewer gallery using a script that runs on your web server. Scripts are provided for PHP, ASP and Cold Fusion. View Automatic via Server-side Script Instructions.
*
Manual

Manually create a SimpleViewer gallery using a text editor and image editing software of your choice. View Manual Instructions.
*
FlickrViewer

FlickrViewer allows you view Flickr photo sets using SimpleViewer. Download FlickrViewer here. Note: FlickrViewer currently supports SimpleViewer v1.7. Dustin Senos has updated FlickrViewer to work with SimpleViewer v1.8.
*
SimpleViewerAdmin

SimpleViewerAdmin is an web based admin interface which allows you to create and manage multiple galleries. Note: SimpleViewerAdmin currently supports SimpleViewer v1.7. Ben Hughes has updated SimpleViewerAdmin to work with SimpleViewer v1.8.
*
Using WordPress

WP-SimpleViewer is a plugin to easily integrate SimpleViewer galleries into Wordpress.

check it out: get it now!
http://www.airtightinteractive.com/simpleviewer/

how to: configuring a plesk catch all domain

3 Sep

setting up a catch domain in plesk takes a little bit more than just wild card dns.

enarion.net has a how to covering the final steps

In this article you’ll learn to configure Plesk that it uses one subdomain as catch-all for all non-existing subdomains.
Why would you need catch all subdomains

Maybe you have a few subdomains. But sometimes your visitors are accessing non-existing subdomains. So the best solution would be to either redirect them to your main website or at least show them a list of available pages.
Here comes the catch-all subdomain : There you can either configure Apache that it redirects all accesses to the main webpage (via 301, as written e.g. in this article Migrate domain names with .htaccess ) or just have a static (or dynamic, of course) page displayed to the user.

check it out :
http://enarion.net/web/plesk/plesk-catchall-subdomains/

Flash : dynamic button tip

6 Jun

FYI – if your making a dynamic button remember to have it refer to it’s self using this. _root.something works for calling _root functions or if you have an exact path, but i’ll be using this from now on. took me 30 minutes to figure out why my buttons weren’t rolling over correctly 6 @ 6 levels deep.

to test this make a movie, got a few levels deep and make a dynamic (as) button. then add a rollover that traces _name, then this._name yeap weird,makes since, but still weird.

enjoy, sid

Good flash dynamic buttons and gradients tutorial

6 Jun

came across a good and simple flash tutorial covering dynamic buttons using gradients and the glow filter.

From the site :

In this easy ActionScript lesson I will explain to you how to create professional, clean and polished buttons. No design tools will be used in this tutorial. Just pure ActionScript code! Please note that this is a lesson made for Flash 8 pro. You will learn how to:

* Create new movie clips from scratch,
* Create nested movie clips with ActionScript too,
* Create stunning gradients and other graphics via ActionScript,
* Import and embed fonts into Flash, understand how they work and add to the size of your SWF movie,
* Create dynamic text fields from scratch and format them using the myriad properties available in ActionScript,
* Import, create and apply filter effects to movie clips and text fields, and more.

Below are a few examples of the many buttons, menus and designs that you can create via ActionScript.

view it : http://www.lukamaras.com/tutorials/actionscript/amazing-actionscript-designed-button.html

flash, 2001, and has development really changed?

17 Apr

Ok so I spoke with another developer from the team i’m on right now (seriously i’m loving dif – they rock). anyways so i’m talking to him, we do the normal feeling each other out, then start speaking on back in the day (5+ years ago).

Back then it seemed most flash developers, hell most web guys in general did it as a just something to do. we stumbled into this little world and found we really liked it, quite a few ended up making it or profession, others just kept it a pass time.

But the other developer made a comment that inspired this post : back then we just did it cause it’s fun.

It’s so true, i do web (development, etc) because i love it, it’s fun. When i was at the point recently when i needed to again decide which route to take – i decided to stick with my web stuff, ok i did interview for one sys admin gig – but the company was awesome (damn logic tests).

Anyways the point is i could have done a number of things but i decided to stick with web. Why? Because i friggin love it. the same fun, joy, excitement that developed back when i was still using front page and jacking lil pimp episodes is still what i get now, what i feel now.

and now to the point, back in 2001 i interviewed at my then college for a web related position – funny thing is i got it, till they realized i had absolutely no credentials.

so after that big wreck in the spokes (it was my last ditch attempt to stay interested), i looked up the flash teacher (i was a flash fiend ), asked about his class. our convo went like this

Me : so what do you teach?
him : i teach the basic tweens, then move into actionscript
me : oh do you get into dynamic, xml etc?
him : oh no
me : oh so what do you cover in as?
him : stop, goto’s u know the basic’s
me : do you cover motion?
him : no i teach the students which sites to use when they need to find stuff like that
me: oh, well thank you for your time

I quit school the next day.

I’ve know friends who went to school for flash, or web programming to a decent about of them this is just something you do, a good job. they don’t care about experimenting, code challenges, etc. to them its a job.

i know alot of people skill learn the hard way, and fair amount of people going to school for web fields also play on there on, but theres a large group going to school and only learning a job, not a passion…

So whats the point? no clue, just wondering what i can do to help them love it – not just do it.

also i felt like ranting and this seems an appropriate topic for the day