Tuesday, November 20, 2012

Article on Facebook and Corona

Link: http://gigaom.com/data/facebook-open-sources-corona-a-better-way-to-do-webscale-hadoop/

Corona is for scheduling and managing Hadoop jobs. Interesting part about the article is where it talks about the size and scale of the kind of data Facebook has to analyze and the infrastructure used to host it.

Friday, November 16, 2012

AWS S3: IAM Policy for Accessing S3 Bucket

In AWS S3, if you want to have a user account that is able to read/write to an S3 bucket and nothing else, use the following policy statements.

{
 "Statement": [
   {
     "Sid": "Stmtxxxxxxxxxxxxx",
     "Action": [
       "s3:ListAllMyBuckets"
     ],
     "Effect": "Allow",
     "Resource": [
       "arn:aws:s3:::*"
     ]
   },
   {
      "Sid": "Stmtxxxxxxxxxxxxx",
     "Action": [
       "s3:GetBucketLocation",
       "s3:ListBucket",
       "s3:ListMultipartUploadParts"
     ],
     "Effect": "Allow",
     "Resource": [
       "arn:aws:s3:::bucketname"
     ]
   },
   {
      "Sid": "Stmtxxxxxxxxxxxxx",
     "Action": [
       "s3:AbortMultipartUpload",
       "s3:DeleteObject",
       "s3:DeleteObjectVersion",
       "s3:GetObject",
       "s3:GetObjectAcl",
       "s3:GetObjectVersion",
       "s3:GetObjectVersionAcl",
       "s3:PutObject",
       "s3:PutObjectAcl",
       "s3:PutObjectVersionAcl"
     ],
     "Effect": "Allow",
     "Resource": [
       "arn:aws:s3:::bucketname/*"
     ]
   }
 ]
}
The ListAllMyBuckets permission isn't always needed. But some tools e.g. Cyberduck will have permission problems without it.

Friday, November 9, 2012

Article: Big data to be normal by 2020

Article Link: http://www.theregister.co.uk/2012/10/22/gartner_it_spending_big_data_projections/

Highlights:

  1. Big data to be as mainstream as ERP and supply chain management
  2. Social network and clickstream analysis will be the largest portion of big data spending this year
  3. Shortage of "data scientists" expected

Tuesday, November 6, 2012

iOS: String Format for Numbers With Leading Zeros

To obtain a formatted String with a fixed number or digits, and any shortfall padding by leading zeroes,   use the following function call


[NSString stringWithFormat:@"%04d", i];


This will return a String containing the integer "i" and will always be 4 digit long. If i is 1, then the String will be "0001". If it is 12, then the String will be "0012".

Friday, November 2, 2012

iOS: Differentiate Between iPhone and iPad

Use the function "UI_USER_INTERFACE_IDIOM()".

If what it returns is equals to "UIUserInterfaceIdiomPad", it's an iPad.

If what it returns is equals to "UIUserInterfaceIdiomPhone", it's an iPhone.

Reference: http://stackoverflow.com/questions/3905603/is-it-safe-to-check-for-ui-user-interface-idiom-to-determine-if-its-an-iphone

iOS Cocos2D Old Splash Screen Still Showing

Somehow, iOS simulators caches the loading image (e.g. Default.png), so even after you've deleted it, it still shows. In order to remove it, you'll need to do a clean operation in XCode, and also reset the simulator.

Reference: http://stackoverflow.com/questions/4768960/cant-get-rid-of-splash-screen-in-xcode