- Apple took home 72% of the profits with only 21.7% of unit sales (up from 15.4% in Q3).
- Samsung's 29% of the profits came from 28.9% of unit sales (down from 32.3% in Q3).
- 43 cents of every dollar spent in the world on a cellphone in Q4 ended up in Apple's coffers.
- Samsung got 36 cents. Nokia got 7 cents. All the rest got less than 5.
- For 2013, Walkley predicts that Apple and Samsung will split 103% of the profits, 69/34.
Apple took home 72% of all handset profits last quarter
PMA02:44
4G may lead to bigger smartphone bills
PMA02:42
Thinking about upgrading to a 4G phone? Prepare to pay more. Before you know it, those 2-gigabyte data caps your carrier put in place just aren't going to cut it.
The average American will use 6.2 GB of data on their mobile devices each month in 2017, according to the latest annual Visual Networking Index released by Cisco (CSCO, Fortune 500). To put that into context, Americans used just 752 MB Americans on average last year.If data plans stay the same five years down the road, the average user's smartphone bill could grow by $40 a month.
The wide-spread roll-out of 4G, the lightning-fast wireless networks that all four of the major carriers are in the process of deploying across the country, is expected to be the main culprit. 4G is capable of speeds comparable to your home broadband service, and it's roughly 10 times faster than 3G. By 2017, Cisco predicts that the average smartphone connection speed will grow more than three-fold.
JavaScript Interview Questions
PMA01:56
JavaScript Interview Questions
What is the difference between == and === ?
The == checks for value equality, but === checks for both type and value.
difference between innerHTML and append() in JavaScript?
InnerHTML is not standard, and its a String. The DOM is not, and although innerHTML is faster and less verbose, its better to use the DOM methods like appendChild(), firstChild.nodeValue, etc to alter innerHTML content.
break and continue statements?
Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop.
Javascript closures?
A closure takes place when a function creates an environment that binds local variables to it in such a way that they are kept alive after the function has returned. A closure is a special kind of object that combines two things: a function, and any local variables that were in-scope at the time that the closure was created.
What is Strict Mode in JavaScript?
Strict Mode has been introduced as part of ECMAScript 5 and introduces new, restricted variant of JavaScript which has following aims:
- Throws errors for actions that are rather silly but previously didn’t throw an error
- Throws errors for potentially unsafe actions
- Disables functions that are poorly thought out
- Potentially code in strict mode could run faster by eliminating mistakes that would make it difficult for JavaScript engines to perform optimizations
Is javascript case sensitive?
Yes javascript is case sensitive.
isNaN function?
Return true if the argument is not a number.
GET and POST in HTML forms?
GETmethod: Parameters are passed in the querystring. Maximum amount of data that can be sent via the GET method is limited to about 2kb.
POSTmethod: Parameters are passed in the request body. There is no limit to the amount of data that can be transferred using POST. However, there are limits on the maximum amount of data that can be transferred in one name/value pair.
Differentiate between “var a=5” and “a =5” ?
difference is between the two is that one variable is local and the other is global.
• String
• Boolean
• Function
• Object
• Null
• Undefined
Examples are isNaN , Number, new Array().
How to set the cursor to wait ?
document.body.style.cursor = 'wait';
//do something interesting and time consuming
document.body.style.cursor = 'auto';
//do something interesting and time consuming
document.body.style.cursor = 'auto';
What's Prototypes for JavaScript?
Objects have "prototypes" from which they may inherit fields and functions.
a checkbox using Javascript?
var checked = window.document.getElementById("thmyCheckBox").checked;
What does "5"+2+4 evaluate to?
Since 5 is a string, everything is a string, so the result is 524.
How to create arrays in JavaScript?
declare an array like this
var scripts = new Array();
We can add elements to this array like this
scripts[0] = "A";
scripts[1] = "B";
scripts[2] = "C";
scripts[3] = "D";
var scripts = new Array();
We can add elements to this array like this
scripts[0] = "A";
scripts[1] = "B";
scripts[2] = "C";
scripts[3] = "D";
isNaN function?
Return true if the argument is not a number.
GET and POST in HTML forms?
GETmethod: Parameters are passed in the querystring. Maximum amount of data that can be sent via the GET method is limited to about 2kb.
POSTmethod: Parameters are passed in the request body. There is no limit to the amount of data that can be transferred using POST. However, there are limits on the maximum amount of data that can be transferred in one name/value pair.
Differentiate between “var a=5” and “a =5” ?
difference is between the two is that one variable is local and the other is global.
How to get value from a textbox?
document.getElementById('txtbox1').value;
• NumberWhat are global variables?
Global variables are available throughout your code: That is, the variables have no scope. Local variables scope, on the other hand, is restricted to where it is declared (like within a function). The var keyword is used to declare a local variable or object, while omitting the var keyword creates a global variable.
// Declare a local variable
var localVariable = "testtest";
// Declare a local variable
var localVariable = "testtest";
// Declare a global
globalVariable = "Cghdg";
globalVariable = "Cghdg";
What are JavaScript types?
• String
• Boolean
• Function
• Object
• Null
• Undefined
What is this keyword?
It refers to the current object.
how html Elements using javascript?
the getElementById method is preferred.
document.getElementById("test").style.color = "green";
how html Elements using javascript?
the getElementById method is preferred.
document.getElementById("test").style.color = "green";
Prototypes
PMA01:37
Every Java-
Script object has a second JavaScript object (or null, but this
is rare) associated with it. This second object is known as a
prototype, and the first object inherits properties from the
prototype.
All objects created by object literals have the same prototype
object, and we can refer to this prototype object in JavaScript
code as Object.prototype. Objects created using the new keyword
and a constructor invocation use the value of the proto
type property of the constructor function as their prototype.
So the object created by new Object() inherits from Object.pro
totype just as the object created by {} does. Similarly, the object
created by new Array() uses Array.prototype as its prototype,
and the object created by new Date() uses Date.prototype as its
prototype.
Object.prototype is one of the rare objects that has no prototype:
it does not inherit any properties. Other prototype objects
are normal objects that do have a prototype. All of the built-in
constructors (and most user-defined constructors) have a prototype
that inherits from Object.prototype.
Object.create() is a static function, not a method invoked on
individual objects. To use it, simply pass the desired prototype
object:
// o1 inherits properties x and y.
var o1 = Object.create({x:1, y:2});
Script object has a second JavaScript object (or null, but this
is rare) associated with it. This second object is known as a
prototype, and the first object inherits properties from the
prototype.
All objects created by object literals have the same prototype
object, and we can refer to this prototype object in JavaScript
code as Object.prototype. Objects created using the new keyword
and a constructor invocation use the value of the proto
type property of the constructor function as their prototype.
So the object created by new Object() inherits from Object.pro
totype just as the object created by {} does. Similarly, the object
created by new Array() uses Array.prototype as its prototype,
and the object created by new Date() uses Date.prototype as its
prototype.
Object.prototype is one of the rare objects that has no prototype:
it does not inherit any properties. Other prototype objects
are normal objects that do have a prototype. All of the built-in
constructors (and most user-defined constructors) have a prototype
that inherits from Object.prototype.
Object.create() is a static function, not a method invoked on
individual objects. To use it, simply pass the desired prototype
object:
// o1 inherits properties x and y.
var o1 = Object.create({x:1, y:2});
JavaScript Timers
PMA01:35
setTimeout() and setInterval() allow you to register a function
to be invoked once or repeatedly after a specified amount
of time has elapsed. These are important global functions of
client-side JavaScript, and are therefore defined as methods of
Window, but they are general-purpose functions and don’t
really have anything to do with the window.
The setTimeout() method of the Window object schedules a
function to run after a specified number of milliseconds elapses.
setTimeout() returns a value that can be passed to clear
Timeout() to cancel the execution of the scheduled function.
to be invoked once or repeatedly after a specified amount
of time has elapsed. These are important global functions of
client-side JavaScript, and are therefore defined as methods of
Window, but they are general-purpose functions and don’t
really have anything to do with the window.
The setTimeout() method of the Window object schedules a
function to run after a specified number of milliseconds elapses.
setTimeout() returns a value that can be passed to clear
Timeout() to cancel the execution of the scheduled function.
Retrieving the Response
PMA01:33
A complete HTTP response consists of a status code, a set of
response headers, and a response body. These are available
through properties and methods of the XMLHttpRequest
object:
• The status and statusText properties return the HTTP
status in numeric and textual forms. These properties hold
standard HTTP values like 200 and “OK” for successful
requests, and 404 and “Not Found” for URLs that don’t
match any resource on the server.
• The response headers can be queried with getResponse
Header() and getAllResponseHeaders().
• The response body is available in textual form from the
responseText property.
The XMLHttpRequest object is used asynchronously: the
send() method returns immediately after sending the request,
and the response methods and properties listed above aren’t
valid until the response is received.
response headers, and a response body. These are available
through properties and methods of the XMLHttpRequest
object:
• The status and statusText properties return the HTTP
status in numeric and textual forms. These properties hold
standard HTTP values like 200 and “OK” for successful
requests, and 404 and “Not Found” for URLs that don’t
match any resource on the server.
• The response headers can be queried with getResponse
Header() and getAllResponseHeaders().
• The response body is available in textual form from the
responseText property.
The XMLHttpRequest object is used asynchronously: the
send() method returns immediately after sending the request,
and the response methods and properties listed above aren’t
valid until the response is received.
WebSocket() constructor
PMA01:31
socket with the WebSocket() constructor:
var s = new WebSocket("ws://ws.example.com/resource");
The argument to the WebSocket() constructor is a URL that uses
the ws:// protocol (or wss:// for a secure connection like that
used by https://). The URL specifies the host to connect to,
and may also specify a port (WebSockets use the same default
ports as HTTP and HTTPS) and a path or resource.
Once you have created a socket, you generally register event
handlers on it:
s.onopen = function(e) { /* The socket is open. */ };
s.onclose = function(e) { /* The socket closed. */ };
s.onerror = function(e) { /* Something went wrong! */ };
s.onmessage = function(e) {
var m = e.data; /* The server sent a message. */
};
In order to send data to the server over the socket, you call the
send() method of the socket:
s.send("Hello, server!");
When your code is done communicating with the server, you
can close a WebSocket by calling its close() method.
WebSocket communication is completely bidirectional. Once
a WebSocket connection has been established, the client and
server can send messages to each other at any time, and that
communication does not have to take the form of requests and
responses.
var s = new WebSocket("ws://ws.example.com/resource");
The argument to the WebSocket() constructor is a URL that uses
the ws:// protocol (or wss:// for a secure connection like that
used by https://). The URL specifies the host to connect to,
and may also specify a port (WebSockets use the same default
ports as HTTP and HTTPS) and a path or resource.
Once you have created a socket, you generally register event
handlers on it:
s.onopen = function(e) { /* The socket is open. */ };
s.onclose = function(e) { /* The socket closed. */ };
s.onerror = function(e) { /* Something went wrong! */ };
s.onmessage = function(e) {
var m = e.data; /* The server sent a message. */
};
In order to send data to the server over the socket, you call the
send() method of the socket:
s.send("Hello, server!");
When your code is done communicating with the server, you
can close a WebSocket by calling its close() method.
WebSocket communication is completely bidirectional. Once
a WebSocket connection has been established, the client and
server can send messages to each other at any time, and that
communication does not have to take the form of requests and
responses.
3 Top Internet Marketing Tips
PMA05:59
One Traffic Source
Submit your Blog to Content Aggregators like AllTop.com and 9Rules.
If you have a top-notch blog that regularly publishes valuable content (which you should), then you can submit your blog to sites like Alltop.com and 9Rules.com. These are content aggregators that aggregates the best content from around the web.
Write Tutorials! Tutorials are a HUGE untapped traffic source online. If you have a
website related to graphic design, wordpress, web development, SEO,
marketing, or programming, then you can use tutorials to send thousands of visitors to your website. There are hundreds of websites online that you can submit your tutorials to.
SEO your Site
Submit your Blog to Content Aggregators like AllTop.com and 9Rules.
If you have a top-notch blog that regularly publishes valuable content (which you should), then you can submit your blog to sites like Alltop.com and 9Rules.com. These are content aggregators that aggregates the best content from around the web.
Write Tutorials! Tutorials are a HUGE untapped traffic source online. If you have a
website related to graphic design, wordpress, web development, SEO,
marketing, or programming, then you can use tutorials to send thousands of visitors to your website. There are hundreds of websites online that you can submit your tutorials to.
SEO your Site
- Format — text or image? image map? javascript? drop-downs? Text is best.
- Page URLs — look at URL structure, path names, file names. How long are URLs? How far away from the root are they? Are they separated by dashes or underscores?
- Are keywords used appropriately in text links or image alt tags?
Reading DOC file in php
PMA05:14
read PDF and DOC files using PHP
Reading PDF Files
$content = shell_exec('/usr/local/bin/pdftotext '.$filename.' -');
Reading DOC Files
$content = shell_exec('/usr/local/bin/antiword '.$filename);
concat() Method
PMA04:55
The concat() method returns the array
resulting from appending its arguments to
the array on which it was invoked.
Given the script: