Search Results

Search found 5 results on 1 pages for 'xoail'.

Page 1/1 | 1 

  • Help converting some classic asp code to c# (.net 3.5)

    - by xoail
    I have this block of code in a .asp file that I am struggling to convert to c#... can anyone help me? Function EncodeCPT(ByVal sPinCode, ByVal iOfferCode, ByVal sShortKey, ByVal sLongKey) Dim vob(2), encodeModulo(256), decodeX, ocode decodeX = " abcdefghijklmnopqrstuvwxyz0123456789!$%()*+,-.@;<=>?[]^_{|}~" if len(iOfferCode) = 5 then ocode = iOfferCode Mod 10000 else ocode = iOfferCode end if vob(1) = ocode Mod 100 vob(0) = Int((ocode-vob(1)) / 100) For i = 1 To 256 encodeModulo(i) = 0 Next For i = 0 To 60 encodeModulo(asc(mid(decodeX, i + 1, 1))) = i Next 'append offer code to key sPinCode = lcase(sPinCode) & iOfferCode If Len(sPinCode) < 20 Then sPinCode = Left(sPinCode & " couponsincproduction", 20) End If 'encode Dim i, q, j, k, sCPT, s1, s2, s3 i = 0 q = 0 j = Len(sPinCode) k = Len(sShortKey) sCPT = "" For i = 1 To j s1 = encodeModulo(asc( mid(sPinCode, i, 1)) ) s2 = 2 * encodeModulo( asc( mid(sShortKey, 1 + ((i - 1) Mod k), 1) ) ) s3 = vob(i Mod 2) q = (q + s1 + s2 + s3) Mod 61 sCPT = sCPT & mid(sLongKey, q + 1, 1) Next EncodeCPT = sCPT End Function

    Read the article

  • facebook iphone app architecture

    - by xoail
    does anyone know or predict how facebook's iphone app architecture could look like? More specific to what could be built into the app (client) what could be rendered on demand? Do you think the main menu layout of the app (where all the navigation buttons are there) are on the client or being rendered dynamically? Similarly apps like NYTimes or US News, what portion is done on the client and what is rendered dynamically. What could be the best way to render things on-demand. Would it be ok to use to UIWebView and render most of the app in it? A quick overview would help. Thank you!

    Read the article

  • How to extend a large website to iPhone app?

    - by xoail
    I am trying to create an iphone app for a large website (as big as amazon.com) and it involves using cookies and what not to get authenticated via the apache intercepter and access the web services exposed by the main website. For that I am looking for strategies to go about developing it. I am new to iphone dev and mostly looking for some architectural guidance. Does anyone know how does apps like ebay and amazon work seamlessly across the website and iphone?

    Read the article

  • How to extend a large website to an iPhone app?

    - by xoail
    I am trying to create an iPhone app for a large website (as big as amazon.com) and it involves using cookies and what not to get authenticated via the Apache intercepter and access the web services exposed by the main website. For that I am looking for strategies to go about developing it. I am new to iPhone development and I am mostly looking for some architectural guidance. Does anyone know how services like eBay and Amazon work seamlessly across the website and iPhone app?

    Read the article

  • iPhone NSCalendar - Incorrect Calendar Drawn for users outside US

    - by xoail
    After trying to work on someone else's code, and so many different iterations, I am unable to understand what am I doing wrong with dates on a calendar month view. I am trying to present a calendar in month view fashion like calendar.app but unfortunately some users in countries like Australia, UK are reporting incorrect alignment of Days to Dates. For instance in Australia it displays 17th March as Friday. Any help is highly appreciated! Here is the code sample I am using: -(void)setCalendar { NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = [gregorian components:units fromDate:[NSDate date]]; self.currentDate = [gregorian dateFromComponents:comps]; NSInteger weekdayInteger=[comps weekday]; currentMonth=[comps month]; currentYear=[comps year]; NSString *dateString=[[NSString stringWithFormat:@"%@",currentDate] substringToIndex:10]; NSArray *array= [dateString componentsSeparatedByString:@"-"]; NSInteger currentDay=[[array objectAtIndex:2] intValue]; currentMonthConstant=currentMonth; currentYearConstant=currentYear; currentDayConstant=currentDay; currentConstantDate=[NSString stringWithFormat:@"%d/%d/%d",currentDayConstant,currentMonthConstant,currentYearConstant]; currentFirstDay=((8+weekdayInteger-(currentDay%7))%7); if(currentFirstDay==0) currentFirstDay=7; [gregorian release]; } And this is how im populating the calendar: -(void)fillCalender:(NSInteger)month weekStarts:(NSInteger)weekday year:(NSInteger)year { currentMonth=month; currentYear=year; currentFirstDay=weekday; UIButton *temp; NSInteger numberOfDays=[self getNumberofDays:month YearVlue:year]; currentLastDay=(currentFirstDay+numberOfDays-1)%7; if(currentLastDay==0) currentLastDay=7; NSString *monthName=[self getMonth:month]; NSInteger grid=(weekday-1); monthLabel.text=[NSString stringWithFormat:@"%@ %d",monthName,year]; for(int i=1;i<=numberOfDays;i++) { if([frontView isEqualToString:@"view1"]) temp=[arr_View2Buttons objectAtIndex:grid]; else temp= [arr_View1Buttons objectAtIndex:grid]; [temp setBackgroundImage:nil forState:UIControlStateNormal]; [temp setUserInteractionEnabled:TRUE]; UILabel *aLbl = (UILabel *)[temp viewWithTag:123]; [aLbl setText:[NSString stringWithFormat:@"%d",i]]; // check for today if(currentDayConstant == i && currentMonthConstant == currentMonth && currentYearConstant == currentYear) { [aLbl setTextColor:[UIColor blueColor]]; } else { [aLbl setTextColor:[UIColor colorWithRed:69/255.0 green:2/255.0 blue:71/255.0 alpha:1.0]]; } [temp setTag:i]; grid++; if(grid==35) grid=0; } } And finally viewdidload: - (void)viewDidLoad { [super viewDidLoad]; [self setCalendar]; // set views [self.view1 setFrame:CGRectMake(0,45,320,232)]; [self.view2 setFrame:CGRectMake(0,277,320,232)]; [self.view addSubview:self.view1]; [self.view addSubview:self.view2]; frontView = @"view2"; [self fillCalender:currentMonth weekStarts:currentFirstDay year:currentYear]; frontView = @"view1"; }

    Read the article

1