Friday, October 31, 2014

Facebook's News Feed is 50% faster on iOS

You might have noticed that your Facebook News Feed is faster than it used to be on your iPhone or iPad. You're not crazy :P.
Ios-app
Facebook has made the News Feed operate 50% faster than the previous version in the iOS app, according to the company.
About two years ago, Facebook switched from HTML5 to native iOS code to make the app perform as smoothly as possible. But the developers noticed something strange: Each time the app updated, it would take longer for the News Feed to load. And gradually, users started noticing, too.
"As we added more and more features to the app, every part of the app got slower," Adam Ernst, a software engineer at Facebook's New York office, told Mashable.

The slower speeds were associated with a data storage problem in Facebook's app. In most iOS apps, data models are managed by "core data," but there was a quirk in the Facebook iOS app's system. The core data originally worked with only a few dozen code entities, but that number escalated to hundreds.
The engineers developed a different way to store data that significantly cut back on the app's inner workings, which resulted in a much faster News Feed. The software developers began rolling out the rewrite publicly this summer. Facebook is promising to keep rolling out improvements to the News Feed's performance.

White House breached (Russian Attack)

 

The worlds most secured line "The White House" told the NYT this week that its EOP network was hacked two or three weeks ago, and played down the breach to press by emphasizing that it was on an unclassified network only — where the hackers conducted "fairly standard espionage." So basically, the intruders accessed the network that handled everything else that happens on unclassified computers in the Executive Office of the President, which indicates that this breach is very likely much more serious than is being reported. Mitigation included staffers having to change their passwords and intranet or VPN access being temporarily shut off. The Washington Post reported that Russian hackers may be to blame.

FireEye revealed APT28 when it released its latest Advanced Persistent Threat report on Tuesday, "APT28: A Window Into Russia's Cyber Espionage Operations" (.PDF link). In a blog post FireEye wrote,
This report focuses on a threat group that we have designated as APT28. While APT28’s malware is fairly well known in the cybersecurity community, our report details additional information exposing ongoing, focused operations that we believe indicate a government sponsor based in Moscow.
In contrast with the China-based threat actors that FireEye tracks, APT28 does not appear to conduct widespread intellectual property theft for economic gain. Instead, APT28 focuses on collecting intelligence that would be most useful to a government.
Specifically, FireEye found that since at least 2007, APT28 has been targeting privileged information related to governments, militaries and security organizations that would likely benefit the Russian government.

The Shellshock attacks are stacking up. Organizations are unable to keep up with Shellshock patching processes, and incident response practices are lagging: Security researchers released two new Shellshock-related attack warnings Thursday as they witness attackers take advantage of the Bash bug in UNIX and Linux systems.

The next version of the Google Chrome browser expected in six weeks will arrive with support to fallback to SSLv3 disabled by default. Chrome 39, due to be released in six weeks' time, will be the first step in Google's plan to remove SSLv3 support from its Chrome browser.We knew two weeks ago when the Drupal team disclosed a really, really bad SQL injection vulnerability in Drupal 7 that it was important for admins to update quickly. Drupal claims a million users on project site drupal.org and over 30,000 developers. But there's no evidence yet of actual, widespread attacks.

Write an Efficient C Function to Convert a Binary Tree into its Mirror Tree


Mirror of a Tree: Mirror of a Binary Tree T is another Binary Tree M(T) with left and right children of all non-leaf nodes interchanged.

MirrorTree1

Trees in the below figure are mirror of each other

Algorithm - Mirror(tree):
(1)  Call Mirror for left-subtree    i.e., Mirror(left-subtree)
(2)  Call Mirror for right-subtree  i.e., Mirror(left-subtree)
(3)  Swap left and right subtrees.
          temp = left-subtree
          left-subtree = right-subtree
          right-subtree = temp


you're not satisfied, lets shoot with the program..:P

Program:
#include<stdio.h>
#include<stdlib.h>
 
/* A binary tree node has data, pointer to left child
   and a pointer to right child */
struct node
{
    int data;
    struct node* left;
    struct node* right;
};
 
/* Helper function that allocates a new node with the
   given data and NULL left and right pointers. */
struct node* newNode(int data)
 
{
  struct node* node = (struct node*)
                       malloc(sizeof(struct node));
  node->data = data;
  node->left = NULL;
  node->right = NULL;
   
  return(node);
}
 
 
/* Change a tree so that the roles of the  left and
    right pointers are swapped at every node.
 
 So the tree...
       4
      / \
     2   5
    / \
   1   3
 
 is changed to...
       4
      / \
     5   2
        / \
       3   1
*/
void mirror(struct node* node)
{
  if (node==NULL)
    return
  else
  {
    struct node* temp;
     
    /* do the subtrees */
    mirror(node->left);
    mirror(node->right);
 
    /* swap the pointers in this node */
    temp        = node->left;
    node->left  = node->right;
    node->right = temp;
  }
}
 
 
/* Helper function to test mirror(). Given a binary
   search tree, print out its data elements in
   increasing sorted order.*/
void inOrder(struct node* node)
{
  if (node == NULL)
    return;
   
  inOrder(node->left);
  printf("%d ", node->data);
 
  inOrder(node->right);
 
 
/* Driver program to test mirror() */
int main()
{
  struct node *root = newNode(1);
  root->left        = newNode(2);
  root->right       = newNode(3);
  root->left->left  = newNode(4);
  root->left->right = newNode(5);
   
  /* Print inorder traversal of the input tree */
  printf("\n Inorder traversal of the constructed tree is \n");
  inOrder(root);
   
  /* Convert tree to its mirror */
  mirror(root);
   
  /* Print inorder traversal of the mirror tree */
  printf("\n Inorder traversal of the mirror tree is \n"); 
  inOrder(root);
   
  getchar();
  return 0; 
}


Time & Space Complexities: This program is similar to traversal of tree space and time complexities will be same as Tree traversal 
 Enjoy the shot...:)