Archive for the Програмиране Category

» Efficient JavaScript

Съдържание на статията:

ECMAScript

  1. Avoid using eval or the Function constructor
    1. Rewrite that eval
    2. If you want a function, use a function
  2. Avoid using with
  3. Don’t use try-catch-finally inside performance-critical functions
  4. Isolate uses of eval and with
  5. Avoid using global variables
  6. Beware of implicit object conversion
  7. Avoid for-in in performance-critical functions
  8. Use strings accumulator-style
  9. Primitive operations can be faster than function calls
  10. Pass functions, not strings, to setTimeout() and setInterval()

DOM

  1. Repaint and reflow
    1. Keeping the number of reflows to a minimum
    2. Minimal reflow
  2. Document tree modification
  3. Modifying an invisible element
  4. Taking measurements
  5. Making several style changes at once
  6. Trading smoothness for speed
  7. Avoid inspecting large numbers of nodes
  8. Improve speed with XPath
  9. Avoid modifications while traversing the DOM
  10. Cache DOM values in script variables

Document loading

  1. Avoid keeping alive references from one document to another
  2. Fast history navigation
  3. Use XMLHttpRequest
  4. Create SCRIPT elements dynamically
  5. location.replace() keeps the history under control

Статията тук: http://dev.opera.com/articles/view/efficient-javascript/

Memcached е кешираща система, позволяваща съхранието на данни в оперативната памет на една или повече машини. По произход Memcached създаден за LiveJournal, но днес се използва от някои от най-големите сайтове в света – Wikipedia, Facebook, Digg, Bloglines и други.

Следната презентация дава доста ясна представа за същността и възможностите на Memcached:

» Memcached официален сайт

Докато си разчиствах букмарковете срещнах един много симпатичен JavaScript tutorial:

http://www.howtocreate.co.uk/tutorials/javascript/

Хареса ми това, че нещата са структурирани много добре. Информацията е хубаво синтезирана и не е ограничена само до ниво “малоумни”. Да си призная при всяко следващо преглеждане срещам или нови неща, или ако не, то поне готини тарикатлъци.

Това пък ми напомни, че навремето имах едно PDF книжле JavaScript Bible Gold Edition (2K pages, 35MB filesize) с автор Danny Goodman. Горещо го препоръчвам!!

At the end of May this year, the Facebook team announced major changes to the package’s developer tools, known as the Facebook Platform. Although the platform itself had been available for several months prior to this release, a host of new features were announced at f8, the Facebook developer event in San Francisco. This launch generated a lot of press coverage — from the Wall Street Journal to TechCrunch. But the important question is: why should you care?

According to Alexa, Facebook is one of the top 20 sites on the Web, and it has some impressive statistics:

  • The site’s growth is around 3% per week, which equates to 100,000 new users per day.
  • 50% of registered users visit the site every day.
  • The site attracts more traffic than eBay: 40 billion page views per month, which equates to an average of 50 pages per user, per day.

Just looking at these statistics should start you thinking about the ways in which you can leverage this level of traffic to benefit your own web site. If you could tap into the Facebook userbase, you could very easily and quickly increase the audience’s awareness of your brand, product, service, or web site.

Whole article: Developing with the Facebook Platform and PHP by David Mytton

Направи ми впечатление едно чудесно решение за multiple-file-upload през уеб:

What is SWFUpload

A small javascript/flash library to get the best of both worlds – The great upload capabilitys of flash and the accessibility and ease of html/css

  • Upload multiple files at once by ctrl/shift-selecting in dialog
  • Javascript callbacks on all events
  • Get file information before upload starts
  • Style upload elements with XHTML and css
  • Display information while files are uploading using HTML
  • No page reloads necessary
  • Works on all platforms/browsers that has Flash support.
  • Degrades gracefully to normal HTML upload form if Flash or javascript is unavailable
  • Control filesize before upload starts
  • Only display chosen filetypes in dialog
  • Queue uploads, remove/add files before starting upload

Върши добра работа и най-якото е, че можеш да го накараш да изглежда и да се държи точно както си поискаш.

link: http://swfupload.mammon.se/