2013年5月12日星期日

[UPDate]connect Retina MacBook Pro 15' LCD 2880x1800 to iMac as external display


Teardown

http://www.ifixit.com/Teardown/MacBook+Pro+Retina+Display+Teardown/9493/1

MacBook Pro 15" A1398  two module:  LSN154YL01-001    LP154WT1-SJA1 

how to use this LCD Screen
http://www.ifixit.com/Answers/View/92815/What+is+the+model+number+of+the+2880x1800+LCD


I have buy one Retina MacBook Pro upper kit, then plug it to my MBP, it's work fine.
But if i plug it as second Screen, must teardown the connect cable, so I buy a LCD screen.

connect to my Retina MacBook Pro


identity as a Color LCD
rmbp:~ yarshure$ ioreg -lw0 | grep IODisplayEDID | sed "/[^<]*</s///" | xxd -p -r | strings -6
Color LCD
Color LCD

but can't show modes,  and the machine is very hot, I must shutdown it.

I have another Mac ,iMac 27 2011, so the connect the screen to iMac.

System Information screen
 Display Menu screen shot

System Preferences setting arrangement

my cable 


note:
1 cable + LCD, no LED back light kit,  I have buy some LED light, When arrive , I will test it, use My Retina MBP LCD as a light kit is too bad.

update 2013.9.18
 connect rMBP LCD to rMBP  use dp2mbpr http://dp2mbpr.rozsnyo.com
RDM(retina display menu) show two LCD running in HiDPI mode on Mac OS X Mountain Lion
on Mac OS X Mavericks Beta8 external LCD can't running in HiDPI mode, scale 1.0 very fine.

 System info:
 Detail infomation
 Setting:


2013年4月23日星期二

iOS Animation 001

Animation is Easy, today We learning basic Animation use  UIImageView(just like play film).
First need prepare a set of image frames, you can use PhotoShop or any other image edit tool do this.

Second Open Xcode , setup a project from "Single view Application" template.

Three some type 

2013年3月31日星期日

Auto Layout Demo code

UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    [button setTranslatesAutoresizingMaskIntoConstraints:NO];
    
    [button setTitle:@"action" forState:UIControlStateNormal];
    [self.view addSubview:button];
    
    NSLayoutConstraint *btnCon=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-20.0];
    
    NSLayoutConstraint *btnCon2=[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:[button superview] attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20.0];
    [self.view addConstraint:btnCon2];
    [self.view addConstraint:btnCon];

2013年3月19日星期二

Facebook iOS position interview question

   last week Facebook recruit found me in LinkedIn, so he ask me if you would be interested in iOS opportunities within Facebook. I currently live in Shanghai,China, if have a chance go to bay area wok is biggest change in my life.  So I accept his request.
   next is recruiter test question :

 Question 1: When running out of memory, how does the system give your app one last chance to prevent being killed?
a) Autorelease
b) Jetsam
c) Memory Warning
d) UIApplicationWillTerminateNotification
 Question 2: What is the difference between a UIView's 'frame' and its 'bounds'
a) 'frame' defines the view's position and size; 'bounds' defines its clipping rect
b) 'frame' defines the view's clipping rect; 'bounds' defines its position and size
c) 'frame' defines position and size in the coordinate space of its superview; 'bounds' defines position and size in the coordinate space of the view itself
d) They are equal
 Question 3: The delegation pattern is often used to:
a) Report value changes from a Model to a Controller
b) Communicate messages back from one object to its owning object
c) Broadcast messages from a singleton object (e.g. NS User Defaults) to its listener
d) All of the above
Question 4: Which of the following cannot be retained:
a) NSString literal
b) NSNull
c) NSInteger
d) NSNotification
 Question 5: A block cannot:
a) Be subclassed
b) Be retained or released
c) Access 'self' from the scope in which it is declared
d) Be passed as an argument
another question : what does KVO stand for?

   yesterday Facebook Engineer give me a Skype interview:




@interface UIControl: UIView
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;
@end
@implementation UIControl
- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents
{
  // How would you implement this?
}
// A UIControlEventTouchUpInside just happened. Let every interested target know…
- (void)_fireTargetsAndActionsForEvent:(UIControlEvents)controlEvent
{
  // ???
}
 
[myButton addTarget:self action:@selector(didTapButton:) forControlEvents:UIControlEventTouchUpInside];


  others question:
how runloop work and autorelease object?
will lead to myButton retain target self?
_fireTargetsAndActionsForEvent complexity?

Today morning, I receive recruiter mail, he told I don't get  chance to next round interview.
I'm very sad, maybe there have many candidates who are best than me.  So I don't have chance work for the company, the interview experience is good for me.

2013年1月19日星期六

Fix external SSD file system on Mac OS X

I use Retina MacBook Pro, the internal SSD capacity is 256G, no enough for me.
so I usual attach a usb SSD driver, usb 3.0 speed is very good for SSD, but the SSD driver file system crash 
three times.

some time can you Disk Utility.app  fix it, but today ,the tool give me
rMBP:~ yarshure$ sudo fsck_hfs -ry  /dev/disk1s2
** /dev/rdisk1s2
   Executing fsck_hfs (version diskdev_cmds-557.3~1).
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
** Rebuilding catalog B-tree.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** Repairing volume.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** Repairing volume.
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is VM
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 220)
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume VM could not be repaired after 3 attempts.

 the file system too weak, I search the web, found DiskWarrior.app.
It help me fixed the crash system.

2013年1月17日星期四

Birthday greetings

     Today is your birthday, mother。Can you hear me ?  I'm you litter son, I wish you happy every day in heaven, no illness suffering.
     This garden and hours was builded by our family. We lived in it   more than twenty years.