Sunday, March 13, 2016
no image

I was experiencing very low internet speed on my pc so i searched for it and found a useful method to increase the browsing speed by sending more than one request at a time to the website server. I am Going to tell here that how to do it in Firefox.

1. Type "about:config" into the address bar and hit return. Scroll down and look for the following entries:

network.http.pipelining
network.http.proxy.pipelining
network.http.pipelining.maxrequests

Normally the browser will make one request to a web page at a time.When you enable pipelining it will make several at once, which really speeds up page loading.


2. Alter the entries as follows:

Set "network.http.pipelining" to "true"
Set "network.http.proxy.pipelining" to "true"
Set "network.http.pipelining.maxrequests" to some number like 30. This means it will make 30 requests at once.


3. Lastly right-click anywhere and select 

New-> Integer.

Name it "nglayout.initialpaint.delay" and set its value to "0".

This value is the amount of time the browser waits before it acts on information it receives.If you're using a broadband connection you'll load pages 2-30 times faster now.


Tuesday, February 25, 2014
no image


Facebook Messages represents one of the most technically challenging products that we've ever created. As we mentioned when we launched Facebook Messages, we needed to build a dedicated application server to manage its infrastructure.

We recently discussed the Messages back end and how we scaled the service to handle all the communication coming from email, SMS, Facebook Chat, and the Inbox. Today we'll explore the internals of the application server.

The Application Server Business Logic

The application server integrates with many Facebook services and shields this complexity from these various clients. It provides a simple interface for its clients to perform standard message operations, including creating, reading, deleting, and updating messages and the Inbox.

The flow for each of them is as follows.

When creating new messages or replying to existing ones, the application server delivers the message to the recipients on behalf of the sending user. If a recipient is specified by his or her email address, the server fetches the attachment from HayStack (if any), constructs the HTML body, and builds an RFC2822 message.



When messages are sent to a user, the server receives them from external email addresses and dispatches incoming messages to the proper recipients if the address is a reply handler. The server finally delivers the message to the user's mailbox, running all pre- and post-processing as needed, and determining the folder and thread where the message should be routed based on a number of signals.



When reading messages, the server gets various statistics about the user's mailbox, like its capacity; number of messages, threads and replies; and the number of friends with whom the user has interacted. It also gets folder statistics and attributes, the list of threads by various search criteria (folder, attributes, authors, keywords, and so forth), and thread attributes and the individual messages in the thread.

When deleting messages, the server marks messages and threads as deleted. An offline job actually removes the message contents.

When updating messages and threads, the server changes the message- or thread-level attributes, like its read and archive statuses, any tags, and so forth. It also handles subscribe and unsubscribe requests on threads with multiple users.



Managing Group Threads

Facebook Messages manages group message threads using a chat room model. Users can be added (subscribed) to and leave (unsubscribe from) threads. To enforce this model when email addresses are specified for recipients in a thread, the application server creates a reply handler, like a chat room ID. When an email recipient replies to a thread, the message is sent to the reply handler address.

To optimize read performance and simplify migration and backup processes, message threads are stored with a denormalized schema, so each user has his or her own copy of thread metadata and messages. The server broadcasts subscription and unsubscribe events, synchronizing the thread metadata among all recipients so it can handle the subscription and reply handler in a decentralized manner. The server also manages various corner cases when interacting with users who still have the old Inbox or were subscribed by their email addresses.

Caching User Metadata

When a user access his or her Inbox, the application server loads the most common user metadata (called active metadata) and stores it in a least recently used cache. Subsequent requests from the same user can be served promptly with fewer HBase queries.

We need to make fewer HBase queries because HBase doesn't support join. To serve one read request, the server may need to look up multiple indexes and fetch metadata and the message body in separate HBase queries. HBase is optimized for writes rather than reads, and user behavior usually has good temporal and spatial locality, so the cache helps to solve this problem and improve performance.

We've also put a lot of effort into improving cache efficiency by reducing the user memory footprint and moving to finer-grained schema. We can cache 5%-10% of our users and have an active metadata cache hit rate of around 95%. We cache some extremely frequently accessed data (like unread message counts displayed on the Facebook home page) in the global memcache tier. The application server dirties the cache when new messages arrive.

Synchronization

HBase has limited support for transaction isolation. Multiple updates against the same user might occur simultaneously. To solve potential conflicts between them, we use the application server as the synchronization point for user requests. A user is served by a particular application server at any given time. This way, requests against the same user can be synchronized and executed in a completely isolated fashion on the application server.

Storage Schema

MTA Proxy strips attachments and large message bodies and stores them in Haystack before they can reach the application server. However, metadata, including search index data and small message bodies, are stored in HBase and maintained by the application server. Every user's mailbox is independent of every other user's; user data is not shared in HBase. A user's data is stored in a single row in HBase, which consists of the following parts:



Metadata Entities and Indexes

Metadata entities contain the attributes of mailbox objects, like folders, threads, messages, and so forth. Each entity is stored in its own HBase column. Unlike a traditional RDBMS, HBase does not have native support for indexes. We maintain the secondary indexes at the application level, where they are stored as key/value pairs in separate columns as well.

For example, to answer the query "loading unread threads on the second page of the Other folder," the application server first looks up the metadata index to get the list of threads that meet the criteria, then fetches the metadata entities of the specified threads, and constructs the response with their attributes.

As we mentioned earlier, caching and effective preloading reduces the number of HBase queries for better performance.

Action Logs

Any update to a user's mailbox (like creating or deleting messages, marking threads as read, and so forth) is immediately appended to a column family in chronological order, called an action log. Small message bodies are also stored in action logs.

We can construct or reinstate the current state of user's mailbox by replaying action logs. We use the ID of last action log replayed as the version of metadata entities and indexes. When a user's mailbox is loaded, the application server compares the metadata version and latest action log ID, and updates the mailbox content if the metadata version lags behind.

Storing the action logs at the application level has brought great flexibility:
  • We can seamlessly switch to a new schema by replaying the action logs and generating new metadata entities and indexes with an offline MapReduce job or online by the application server itself.
  • We can perform large HBase writes asynchronously in batches to save on network bandwidth and reduce HBase compaction cost.
  • It is a standard protocol to exchange persistence data with other components. For example, we do application-level backup by writing the action logs to a Scribe log. The migration pipeline converts users' old Inbox data into action logs and generates metadata and indexes with offline MapReduce.

    Search Indexing

    To support full text search, we maintain a reverse index from keywords to matched messages. When a new message arrives, we use Apache Lucene to parse and convert it into (keyword, message ID, positions) tuples, then add them to an HBase column family incrementally. Each keyword has its own column. All messages, including chat history, email, and SMS, are indexed in real time.

    Testing via a Dark Launch

    The application server is new software we built from scratch, so we need to monitor its performance, reliability and scalability before we roll it out to more than 500 million users. We initially developed a stress test robot to generate fake requests, but we found that the results could be affected by quite a few factors, like message size, distribution of different types of requests, distribution of user activity rates, and so forth.

    In order to simulate the real production load, we did a dark launch, where we mirrored live traffic from Chat and the existing Inbox into a test cluster for about 10% of our users. Dark launches help us uncover many performance issues and identify bottlenecks. We also used it as a convincing metric to evaluate various improvements we made. Over time, we'll continue to roll out the new Messages system to all our users.
    Friday, January 17, 2014
    no image

    Here is the complete list of books that can help you for the preparation of JEE Main & JEE Advanced. These books are available for both Class 11 and Class 12.


    Best maths books for the preparation of JEE Main And JEE advanced 

    Coordinate GeometryTextbook of 
    Integral Calculus 
    for JEE Main & Advanced 
    Author : Amit M Agarwal
    Textbook of 
    Algebra Vol.1 
    for JEE Main & Advanced
    Author : Dr. SK Goyal
    TA Textbook of 
    Vectors & 3D Geometry 
    for JEE Main & Advanced
    Author : Amit M Agarwal
    A Textbook of 
    Algebra 
    for JEE Main & Advanced,
    Author : Dr. S K Goyal
    Play with Graphs
    A Magical book to teach 
    Problem Solving through Graphs
    Author : Amit M
    A Textbook 
    of Trigonometry 
    for JEE Main & Advanced
    Author : Amit M Agarwal
    Selected Topics in Mathematics 
    Statics & Dynamics, Statics & 
    Numerical Methods & Volume & Surfaces
    Author : Dr. S K Goyal
    A Textbook of 
    Differential Calculus 
    for JEE Main & Advanced
    Author : A Das Gupta
    IIT JEE Mathematics
    Author : M L Khanna
    A Textbook of 
    Algebra 
    for JEE Main & Advanced,
    Author : Dr. S K Goyal
    Tata McGraw-Hill's 
    Mathematics for IIT-JE


    Best Physics books for the preparation of JEE Main And JEE advance
    Understanding Physics 
    for JEE Main & Advanced 
    Mechanics Part 1&2
    Author : DC Pandey
    Understanding Physics 
    for JEE Main & Advanced 
    Electricity & Magnetism
    Author : DC Pandey
    Understanding Physics 
    for JEE Main & Advanced 
    Optics & Modern Physics
    Author : DC Pandey
    Understanding Physics for J
    EE Main & Advanced 
    Waves & Thermodynamics
    Author : DC Pandey
    H C Verma Part 1 
    for Physics
    I E Irodov
        
    Resnick & Halliday's Physics 
    For IIT-JEE, Resnick, 
    Halliday, Walker
    Science For Everuone
    Author : S. S. Krotov
        


    Best Chemistry books for the preparation of JEE Main And JEE advanced
    Numerical 
    Physical Chemistry 
    for JEE Main & Advanced
    Author : Neeraj Kumar
    A Textbook of Inorganic Chemistry 
    for JEE Main & Advanced 
    and Other Engineering Entrances
    Author : Dr. RK Gupta
    A Textbook of Physical Chemistry 
    for JEE Main & Advanced 
    and Other Engineering Entrances
    Author : Dr. R K Gupta
    Essential Physical Chemistry 
    for JEE Main & Advanced
    Author : Ranjeet Shahi
    A Textbook of Organic Chemistry 
    for JEE Main & Advanced and 
    Other Engineering Entrance Examination
    I E Irodov
      
    Morrison_Boyd 
    Organic Chemistry
    O P Tandon Organic 
    Chemistry, 
    Author : O P Tandon
    O P Tandon 
    Inorganic Chemistry
    Author : O P Tandon
    Modern Approach to 
    Chemical Calculations
    Author : R C Mukherjee
      
          
          
         
    Sunday, December 22, 2013
    no image

    I like using the same PHP script for both AJAX and non-AJAX content requests. Using one script just makes everything easier because it's only one file to update/edit and it's one more cache-able request. One way to try detect an AJAX request (as opposed to a regular page load) is by using the following PHP code:
    /* decide what the content should be up here .... */
    $content = get_content(); //generic function;
    
    /* AJAX check  */
    if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
     /* special ajax here */
     die($content);
    }
    
    /* not ajax, do more.... */
    $_SERVER['HTTP_X_REQUESTED_WITH'] is the golden ticket but not all servers provide this variable so having other checks in place will be important.
    Friday, December 20, 2013
    no image

    CSS doesn’t provide any official way to handle a click event in CSS. But there are some very interesting tricks that we can use to “detect” a click using CSS only, without a single line of JavaScript, and this is what we are going to talk about today.
    How ot Works ?
    The HTML
    1
    2
    <input type="checkbox">
    <p class="to-be-changed">I'm going to be red! It's gonna be legen... Wait for it...</p>
    The CSS
    1
    2
    3
    4
    5
    6
    7
    .to-be-changed {
        color: black;
    }
     
    input[type=checkbox]:checked ~ .to-be-changed {
        color: red;
    }
    As you can see, it relies on the :checked pseudo-class and on the general sibling selector ~. Please note that it also works like a charm with the adjacent sibling selector +. Basically, it says “if the checkbox is checked, then the following elements with the .to-be-changed class will be red”.
    Okay, a checkbox isn’t very sexy, but you can totally make something nicer by hiding the checkbox and binding a label to it. Something like this maybe:
    1
    2
    3
    <input type="checkbox" id="toggle">
    <label for="toggle">Click me!</label>
    <p class="to-be-changed">I'm going to be red! It's gonna be legen... Wait for it...</p>
    So we hide the checkbox and use the label to trigger the click event.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    input[type=checkbox] {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
     
    label {
        display: block;
        background: #08C;
        padding: 5px;
        border: 1px solid rgba(0,0,0,.1);
        border-radius: 2px;
        color: white;
        font-weight: bold;
    }
     
    input[type=checkbox]:checked ~ .to-be-changed {
        color: red;
    }
    This way, you have some kind of button triggering the color change on the paragraph. Isn’t that cool? Re-clicking on the button is switching the color back to black of course.
    (Note that there are different possibilities for hiding the checkbox, the most obvious of all being display:none.)
    Changing Color or Click Event with CSS

    Search PC Tips

    Loading...

    Followers