May 28th, 2011StackOverFlow win!

Yay! I made two achievements on StackOverflow.com with my first two answers there. One, I earned a “Teacher” badge for Active site similar to CSS Zen Garden? And two, I unlocked a few privileges that come with earning points there.

Teacher” badge for Active site similar to CSS Zen Garden + privileges gained

By earning a reputation of 21, I can now participate in meta, got new user restrictions removed (can post images, post more than one hyperlink in a question or answer, post any hyperlinks in my profile, contribute answers to protected questions, ask or answer questions too rapidly), create wiki posts, vote up (this is the privilege for which I actually started answering in the hope to earn enough reputation to vote the good answers up), flag posts, and talk in chat.Sawant [at] StackOverflow - 21 ReputationSo, now that I have started to rock the StackOverflow’s Q&A space for programmers (w00t), you can keep a tab on me there through my StackOverflow profile.

[Me happy at 4:30 am Pakistan time. w00t!]

Facebook Chat looks very simple by design, but if you pry deeper you’ll learn that it’s an impressive engineering and design feat. One must question: how was Facebook Chat, which was to serve over 70 million users when it was built (now serving over 500 million), developed? What technologies were put together to bake this web-based chat feature?

Eugene Letuchy, the lead developer of Chat, from Facebook, has put the answers down in a neat presentation that highlights the main aspects of what went into Facebook Chat.

At the heart of Facebook Chat, and thus the central part of this presentation, is a programming language called Erlang, which is a general-purpose concurrent, garbage-collected programming language and runtime system.

Erlang at Facebook

For the more curious among us, I’m listing below a glossary of terms – the technologies and the buzzwords – that have made Facebook Chat possible, and scalable, for over 500 million people. Most of these technologies are open source:

  • Erlang

    Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang\’s runtime system has built-in support for concurrency, distribution and fault tolerance.

  • Polyglot programming

    A polyglot is a computer program or script written in a valid form of multiple programming languages, which performs the same operations or output independently of the programming language used to compile or interpret it.

  • JSONP

    JSONP or “JSON with padding” allows a page to request and more meaningfully use JSON from a server other than the primary server.

  • Using Facebook Chat via Jabber/XMPP

    To make Facebook Chat available everywhere, they are using the technology Jabber (XMPP), an open messaging protocol supported by most instant messaging software, including iChat, Pidgin, Adium, Miranda and more.

  • Hackathon

    A hackathon is an event when programmers meet to do collaborative computer programming.

  • Thrift

    Thrift is a remote procedure call framework developed at Facebook (later submitted and accepted under Apache Software Foundation) for “scalable cross-language services development”.

  • Presence

    Presence information is a status indicator that conveys ability and willingness of a potential communication partner – for example a user – to communicate.

  • JavaScript

    JavaScript is primarily used in the form of client-side JavaScript, implemented as part of a web browser in order to provide enhanced user interfaces and dynamic websites.

  • PHP

    PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

  • Ajax

    Ajax is a group of interrelated web development techniques used on the client-side to create interactive web applications.

  • ejabberd

    ejabberd is a Jabber/XMPP instant messaging server written in Erlang. It is open source, cross-platform, fault-tolerant, clusterable and modular.

  • Polling

    Polling, or polled operation, refers to actively sampling the status of an external device by a client program as a synchronous activity.

  • Comet

    Comet is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. It’s also sometimes called as Ajax Push and Reverse Ajax, among others.

  • MochiWeb

    MochiWeb is an Erlang library for building lightweight HTTP servers.

  • Scribe (note)

    Scribe is a server for aggregating log data that\’s streamed in real time from clients. It is designed to be scalable and reliable.

  • FB303 (readme)

    fb303 is the shared root of all thrift services.

  • Concurrent programming

    In concurrent (parallel) programming, single tasks are split into a number of subtasks that can be computed relatively independently and then aggregated to form a single coherent solution.

  • Load balancing

    Load balancing is a technique to distribute workload evenly across two or more computers, network links, CPUs, hard drives, or other resources, in order to get optimal resource utilization, maximize throughput, minimize response time, and avoid overload.

  • Multicasting

    To transmit a single message to a select group of recipients. A simple example of multicasting is sending an e-mail message to a mailing list. Teleconferencing and videoconferencing also use multicasting, but require more robust protocols and networks.

  • Segfault

    A segmentation fault (often shortened to segfault) occurs when a program attempts to access a memory location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed.

  • OOM

    Out of memory (OOM) is an undesired state of computer operation where no additional memory can be allocated for use by programs or the operating system.

  • Hot code swapping

    Hot code swapping refers to the ability to alter the running code of a program without needing to interrupt its execution. Only a few programming languages support hot swapping natively, including Pike, Lisp, Erlang, Smalltalk, and Java.

  • Symmetric Multi-Processing (SMP)

    A multiprocessing architecture in which multiple CPUs, residing in one cabinet, share the same memory. SMP systems provide scalability.

Just came across a very interesting fact about ENIAC (the first general-purpose electronic computer): The ENIAC was programmed by six people … and all of them were women! Yes, you heard that right. All women.

The ENIAC, the world\’s first computer, was invented to calculate ballistics trajectories during World War II – a task that until then had been done by hand by a group of 80 female mathematicians. The six women who were chosen to make the ENIAC work toiled six-day weeks during the war, inventing the field of programming as they worked.

That, I must say, is quite a surprising fact (for me at least), especially since the stereotypical notion of women that is thrown around is that they are not good in mathematics and logic, and thus programming.

NetBeans logo After having tried many IDEs for PHP development, including Eclipse and Komodo Edit, I have found myself the most comfortable and productive with the excellent NetBeans IDE.

You can start building PHP applications with NetBeans right out-of-the-box by simply downloading NetBeans for PHP (version 6.8 is the latest as of this post). Debugging with it requires an additional download of Xdebug.

Here is a quick and step-by-step guide to quickly start developing and debugging your PHP application projects with NetBeans + Xdebug:

1. Download and install NetBeans IDE for PHP.

2. Download Xdebug (it’s a small DLL library file).

Advice: Among the plethora of download links available on that page, let me tell you that you generally wouldn’t want the ‘non-thread-safe’ version, so ignore that; go for the latest non-beta version. I downloaded 5.2 VC6 (32 bit) of Xdebug 2.0.5.

3. Next you need to make changes to php.ini found in apache\\bin folder (the location of your apache folder may vary depending on your installation, look for it).

Find “[Zend]” section in your php.ini file, which should look like the following:

   1: [Zend]

   2: zend_extension_ts = "E:\\Servers\\xampp\\php\\zendOptimizer\\lib\\ZendExtensionManager.dll"

   3: zend_extension_manager.optimizer_ts = "E:\\Servers\\xampp\\php\\zendOptimizer\\lib\\Optimizer"

   4: zend_optimizer.enable_loader = 0

   5: zend_optimizer.optimization_level=15

   6: ;zend_optimizer.license_path =

   7: ; Local Variables:

   8: ; tab-width: 4

   9: ; End:

 

Xdebug is not compatible with Zend Optimizer, so comment out lines 2 to 5 (by prefixing the line with a semi-colon), and add the following lines under [Zend] section heading:

   1: [Zend]

   2: zend_extension_ts="E:\\Servers\\php_xdebug\\php_xdebug-2.0.5-5.2.dll"

   3: xdebug.remote_enable=on

   4: xdebug.remote_handler=dbgp

   5: xdebug.remote_host=127.0.0.1

   6: xdebug.remote_port=9000

 

Note: Remember to change the path and filename to match your Xdebug path and version.

4. Restart Apache (if using XAMPP: Open the XAMPP Control Panel and first stop, then start Apache).

5. To verify if Xdebug is configured properly for debugging, create a php file containing this one line:

   1: <?php echo phpinfo() ?>

Save it in your htdocs folder [phpinfo.php], and open it in your browser [http://localhost/phpinfo.php]. If Xdebug is loaded successfully, you should see something like this:

Xdebug info with phpinfo()

That is it! Now you are ready to debug your applications with Xdebug using NetBeans IDE. Simply open your PHP project in NetBeans and press Ctrl + F5 or click Debug project button in NetBeans in the toolbar.

A detailed guide on configuring Xdebug with NetBeans can be found on this wiki: http://wiki.netbeans.org/HowToConfigureXDebug.

Happy coding! :)

Being in the field of IT (Computer Science), it\’s necessary to keep pace with the changing landscape, otherwise you would end up rendering yourself obsolete. It\’s no different with web development/programming: The landscape keeps changing, either on the user interface front or the browser side or the website back-end.

As of now, we are moving through the era of web application frameworks. That\’s the landscape we are surrounded with. Plenty of frameworks have been built during these years broadly categorized under software frameworks, web application frameworks and JavaScript frameworks (or libraries), and plenty more are being developed.

So better learn one now, before you are rendered obsolete.

I am considering the following frameworks:

image image image image Djangoimage

Read more about the most popular web frameworks that I am considering after the jump.

Read the rest of this entry »


© 2007 Zenning! | iKon Wordpress Theme by Windows Vista Administration | Powered by Wordpress