Categories
Articles

UITableViewCell Selection

I have seen many many applications so far, i mean really awesome applications. Still one thing i see which is almost common with all of them except few one is that Custom UITableViewCells does not change text color when selected/highlighted. I am also a developer and i know these kind of things miss out while developing applications in rapid development cycles and under timeline pressure :(. but then it really shows high level of ignorance from developers side.

The solution is simple. Generally what we do is we create custom UIView and add it inside UITableViewCell. Just we need to do some extra coding in UIView. as shown in TableViewSuite.

CustomCellView.h

#import <UIKit/UIKit.h>

@interface CustomCellView : UIView {
    BOOL highlighted;
}

@property (nonatomic, getter=isHighlighted) BOOL highlighted;

@end

CustomCellView.m

#import "CustomCellView.h"

@implementation CustomCellView

@synthesize highlighted;

- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
    }
    return self;
}

- (void)setHighlighted:(BOOL)isHighlighted {
    // If highlighted state changes, need to redisplay.
    if (highlighted != isHighlighted) {
        highlighted = isHighlighted;
        [self setNeedsDisplay];
    }
}

- (void)drawRect:(CGRect)rect {
    UIColor *nameTextColor;
    if( self.highlighted ) {
        nameTextColor = [UIColor whiteColor];
    } else {
        nameTextColor = [UIColor blackColor];
    }
    // Draw code
}

- (void)dealloc {
    [super dealloc];
}

@end
Categories
Articles

Socha hai – Rock On tabs

I didn find good tabs for it anywhere so here i am posting my own version…

PART1
E--5----------------------------------------------------
B--7--------------------------3--------------2-3--------
G--7------4~----4-6-7---------2--0-2-4-----4-----2h4p2--
D--5--5-7-------------7h9p7~~---------------------------
A--5----------------------------------------------------
E--5----------------------------------------------------

PART2
E-------------------------------------
B---3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3---
G----2-2-2-2-0-0-0-0-4-4-4-4-2-2-2-2--
D-------------------------------------
A-------------------------------------
E-------------------------------------

PART1 & PART2 together 2 times

D
aasma hai neela kyun
Bm
paani geela geela kyun
G            A
gol kyun hai zamee
D
silk mein hai narmi kyun
Bm
aag mein hai garmi kyun
G                A
do aur do paanch kyun nahi
.. and so on
    
Categories
Articles

YMSG16 Authentication

The new Yahoo messenger v9.0 uses ymsg 16 protocol. For login process client sends username and password to yahoo login server: https://login.yahoo.com, and in response server sends Token which is then used for client authentication process on scs.msg.yahoo.com:5050

This login process goes through multiple steps as follows..

Step 1: Send username and password to login server

Https request url:

https://login.yahoo.com/config/pwtoken_get?src=ymsgr&login=<username>&passwd=<password>

Https response and meaning:

Invalid username  : 1235

Wrong password  : 1212

Information Valid : 0 ymsgr= <token>partnerid=<pid>

data is used in step 2 for further processing.

Note: and seem to appear in pair for given username and password

Step 2: Send token to login server

Https request url:

https://login.yahoo.com/config/pwtoken_login?src=ymsgr&token=<token>

Https response and meaning:

Invalid ymsgr  : 100

Information Valid : 0 crumb=<crumb> Y=<Y-Cookie> T=<T-Cookie> cookievalidfor=

<crumb>, <Y_Cookie>, <T_Cookie> and <B_Cookie> are used in client authentication on receiving challenge string from Pager server.

Note: is received in header of the reponse.

Step 3: After receiving challenge string from pager server

When client receives challenge string from pager server, it sends encrypted response to server. This response is formed using received in Step 2 and challenge received from pager server.

Process for forming response:

crypt = crumb + challenge

hash = MD5(crypt)

response = BASE64(hash)

replace ‘+’ by ‘.’ in response

replace ‘/’ by ‘_’ in response

replace ‘=’ by ‘-’ in response

Client sends this calculated response for received challenge along with <Y_Cookie>, <T_Cookie> and <B_Cookie>.

Categories
Articles

I’ll always remember…

Firstly, I would like to talk about the first year; there is lot to say about. I was in some other college then I got admission here, in Watumull. Those days were so different than today’s. I was one unknown guy in that class. I still remember, our class was on the fourth floor first room – a ‘window-class’ with very beautiful view of the sea face. In all labs chintu, saili, pappu, neha n me were in one group. Always these girls used to do all calculations n we all guy used to copy those things. We were together as one class, even instrumentation people. I just can’t forget that physics lab (torture place), anna ki cutting while doing metal work, drawing sheets….and the word ‘chavrya’.

Then comes second year, here the first thing happened was, I topped the college… i still remember, I was on the stairs going up… and avinash was running down…”abe vinay, tune top kiya”…yes, these were the words. My class selected me as a CR. Now I was no more some unknown guy. Here the other most important thing, a new person came into our life…Misal Sir… New people took admission…a new category…we used to call them “diploma people”. But very soon they became one of us. I really felt bad about my friends who got drop. And 1 more little funny thing, I made navneet my sister…I can’t forget every person even girls were shocked…”are you mad, how can you do that…” because Watumull was famous as “Navneet’s college”. Hahahahhaha….

Third year…is there anything special. This time I was not topper n all, but my class again wanted me as CR, that was against the rule but still. First time I realized something that cannot be expressed in words. I got ATKT…I failed in exam for the first time in my life (hope it is the last time). Moreover, my life also took a strange turn here, suddenly everything was so different. Don’t want to say much about it, but it was funny that some people were ready to help in that.

Many things happened in between third n fourth year…now again life is so much different. There is not much to say about it surprisingly. Kk, jits, teju – my project group-”Xml guys”. First time we submitted Misal Sir’s journal with more than 2 pages.

Finally, “last but not the least”…I can’t forget your handwriting priya n saili….all my journal work n assignments in every year was aapki meherbani. and one more thing, all you people have malloced special place in my memory…I really can’t forget any one of you. BE COMPS 07 is the best class in the universe. 

String theory says that we live in 11 different dimensions, worlds…I can live in infinite number of worlds with you all people. After reading this last sentence kavat will say “chavrya shuru ho gya…”