Search Results

Search found 165 results on 7 pages for 'srikanth naidu'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Facing Null Pointer Exception while using BIRT

    - by srikanth
    Hi, I am using BIRT APIs in a java program.My code is : package com.tecnotree.mdx.product.utils; import java.util.HashMap; import java.util.logging.Level; import org.eclipse.birt.core.exception.BirtException; import org.eclipse.birt.core.framework.Platform; import org.eclipse.birt.report.engine.api.EngineConfig; import org.eclipse.birt.report.engine.api.EngineConstants; import org.eclipse.birt.report.engine.api.HTMLRenderOption; import org.eclipse.birt.report.engine.api.IReportEngine; import org.eclipse.birt.report.engine.api.IReportEngineFactory; import org.eclipse.birt.report.engine.api.IReportRunnable; import org.eclipse.birt.report.engine.api.IRunAndRenderTask; import org.eclipse.birt.report.engine.api.ReportEngine; public class ExampleReport { public static void main(String[] args) { // Variables used to control BIRT Engine instance ReportEngine eng = null; IReportRunnable design = null; IRunAndRenderTask task = null; HTMLRenderOption renderContext = null; HashMap contextMap = null; HTMLRenderOption options = null; final EngineConfig conf = new EngineConfig(); conf .setEngineHome("C:\\birt-runtime-2_5_2\\birt-runtime-2_5_2\\ReportEngine"); System.out.println("conf " + conf.getBIRTHome()); conf.setLogConfig(null, Level.FINE); try { Platform.startup(conf); } catch (BirtException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } IReportEngineFactory factory = (IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY); System.out.println("Factory : " + factory.toString()); System.out.println(conf.toString()); IReportEngine engine = factory.createReportEngine(conf); System.out.println("Engine : " + engine); try { design = eng .openReportDesign("C:\\birt-runtime-2_5_2\\birt-runtime-2_5_2\\ReportEngine\\samples\\hello_world.rptdesign"); } catch (Exception e) { System.err .println("An error occured during the opening of the report file!"); e.printStackTrace(); System.exit(-1); } task = eng.createRunAndRenderTask(design); renderContext = new HTMLRenderOption(); renderContext.setImageDirectory("image"); contextMap = new HashMap(); contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext); task.setAppContext(contextMap); options = new HTMLRenderOption(); options.setOutputFileName("c:/temp/output.html"); options.setOutputFormat("html"); task.setRenderOption(options); try { task.run(); } catch (Exception e) { System.err.println("An error occured while running the report!"); e.printStackTrace(); System.exit(-1); } System.out.println("All went well. Closing program!"); eng.destroy(); } } But i am facing NullPointerException while creating the report. STACKTRACE : Exception in thread "main" java.lang.NullPointerException at org.eclipse.birt.report.engine.api.impl.ReportEngine$EngineExtensionManager.<init>(ReportEngine.java:784) at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:109) at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:18) at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory$1.run(ReportEngineFactory.java:1) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:14) at com.tecnotree.mdx.product.utils.ExampleReport.main(ExampleReport.java:47) Please help me regarding this... my project deadline has been reached... Appreciate your Reply Thanks in Advance

    Read the article

  • How can we add text in cocos2d by using UITextView ?

    - by srikanth rongali
    I want a UITextView in cocos2d. I used in init method UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0, windowSize.height/2,windowSize.width/2)]; textView.backgroundColor = [UIColor clearColor]; textView.text = @"I am First enemy"; [textView setEditable:NO]; [[[CCDirector sharedDirector]openGLView]addSubview:textView]; the orientation is [[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; I need the text to appear in landscape mode, but I am getting the text in following way. How can I make the text to appear in the landScape mode. I am working in cocos2d. CanOI scroll the text ? What should i add to make the text scroll up and down. Thank you.

    Read the article

  • Need Sharepoint like modal pop-up window

    - by Srikanth
    I need to show Sharepoint 2010 like pop-up window when clicked on a link in grid view. Once the modal pop-up displayed and user selected the Save button data base should be updated with given values in pop-up. How can I get this. Any Idea. As of now I am using below code to get it but no idea how to pass the values to Database once clicked on the button in pop-up Note: As of now I am not adding the gridview code here as I wanted to achieve it first with sample html then wanted to do with grid view. Java Script function openDialog() { var options = { html: divModalDialogContent, // ID of the HTML tag // or HTML content to be displayed in modal dialog width: 600, height: 300, title: "My First Modal Dialog", dialogReturnValueCallback: dialogCallbackMethod, // custom callback function allowMaximize: true, showClose: true }; SP.UI.ModalDialog.showModalDialog(options); } //Results displayed if 'OK' or 'Cancel' button is clicked if the html content has 'OK' and 'Cancel' buttons function onDialogClose(dialogResult, returnValue) { if (dialogResult == SP.UI.DialogResult.OK) { alert('Ok!'); } if (dialogResult == SP.UI.DialogResult.cancel) { alert('Cancel'); } } // Custom callback function after the dialog is closed function dialogCallbackMethod() { alert('Callback method of modal dialog!'); } HTML <div id="divModalDialogContent"> Hello World! <input type="button" value="OK"onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'Ok clicked'); return false;" class="ms-ButtonHeightWidth" /> <input type="button" value="Cancel"onclick="SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel clicked'); return false;" class="ms-ButtonHeightWidth" /> <asp:Button runat="server" ID="btnClicked" Text="Clicked" onclick="btnClicked_Click" /> <input type="button" value="Open" onclick="openDialog()" /> How can I call db upon clicking 'clicked' button in pop-up. Also I need to send parameters to pop-up Thanks in advance

    Read the article

  • log4j floods my console

    - by srikanth VM
    This is the log4j.properties that i have in my app log4j.rootLogger=B C log4j.logger.A=INFO, A1 log4j.debug=false log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %C - %m%n log4j.logger.B=INFO, A2 log4j.debug=false log4j.appender.A2=org.apache.log4j.FileAppender log4j.appender.A2.file=PRIME-log.txt log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %C - %m%n log4j.logger.C=INFO, A3 log4j.appender.A3=org.apache.log4j.FileAppender log4j.appender.A3.file=employee_pass_regeneration-log.txt log4j.appender.A3.layout=org.apache.log4j.PatternLayout log4j.appender.A3.layout.ConversionPattern=%d [%t] %-5p %C - %m%n I only want File appender so i only use that , but some how my console is always flooded with DEBUG messages which i have never used 8704 [http-8080-2] DEBUG org.springframework.web.servlet.view.JstlView - Rendering view with name 'passIndex' with model null and static attributes {} I guess these are all system messages , but with these debug messages its really hard to debug actually i mean i cannot find my own sysouts i tried log4j.debug=false but still i get these messages

    Read the article

  • How can I use removeFromSuperView and dismissModalViewControllerAnimated at same time ?

    - by srikanth rongali
    I have a UIViewController *view1 and another UIViewController *view2; I used presentModelViewController to navigate from view1 to view2. -(void)function:(id)sender { NSLog(@"The libraryFunction entered"); LibraryController *libraryController = [[LibraryController alloc]init]; [self presentModalViewController:libraryController animated:YES]; } I have another view UITableViewController *tableView; I added it to view2 as a subView. -(void)viewDidLoad { RootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain]; UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController]; self.navController = aNavigationController; [aNavigationController release]; [rootViewController release]; navController.view.frame = CGRectMake(0, 0, 320, 460); [self.view addSubview:navController.view]; } In RootViewController.m I have - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; } -(void)close:(id)sender { [self.view removeFromSuperview]; [self dismissModalViewControllerAnimated:YES]; } WhenI touch close button I need to return the view1. So, I removed the tableView by using removeFromSuperView. But, I am not able to get to the first view. I do not get where to use - (void)dismissModalViewControllerAnimated:(BOOL)animated; to navigate to first view1 where I have started ? How can I do this ? Thank You.

    Read the article

  • moviePlayBackDidFinish: is not called in application.

    - by srikanth rongali
    In my application I have used these notifications when playing a video. But, The problem is the control of the program is not entering in to the first two methods(moviePreLoadDidFinish and moviePlayBackDidFinish). It is entering into last method. So, after the video is played and I pressed Done button in the video, I cannot touch any object in screen. I mean I used play button for video to play in a view. After the video played the play button is deactivated. - (void) moviePreloadDidFinish:(NSNotification*)notification { } // Notification called when the movie finished playing. - (void) moviePlayBackDidFinish:(NSNotification*)notification { } // Notification called when the movie scaling mode has changed. - (void) movieScalingModeDidChange:(NSNotification*)notification { } I could not get where I was wrong ? Thank You.

    Read the article

  • CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteSheet

    - by srikanth rongali
    My code is in cocos2d. I am getting this error in my code. To get the fast animation I used CCSpriteSheet CCSpriteSheet *danceSheet = [CCSpriteSheet spriteSheetWithFile:@"new1.png"]; [self addChild:danceSheet]; CCSprite *danceSprite = [CCSprite spriteWithTexture:danceSheet.texture rect:CGRectMake(0, 0, 119, 320)]; [danceSheet addChild:danceSprite]; danceSprite.position = ccp(danceSprite.contentSize.width/2,danceSprite.contentSize.height/2); CCAnimation *danceAnimation = [CCAnimation animationWithName:@"dance" delay:0.1f]; int frameCount = 0; for (int x = 0; x < 13; x++) { // create an animation frame CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:danceSheet.texture rect:CGRectMake(x*119,0,119,320) offset:ccp(0,0)]; [danceAnimation addFrame:frame]; frameCount++; NSLog(@"frameCount value: %d", frameCount); if (frameCount == 13) break; } CCAnimate *danceAction = [CCAnimate actionWithAnimation:danceAnimation restoreOriginalFrame:NO ]; [danceSprite runAction:danceAction]; But when I touched the screen it is giving the error CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteSheet

    Read the article

  • how do we access values stored in NSMutableArray of NSMutableDictionary ?

    - by srikanth rongali
    I have stored values in NsMutableDictionaries . ThenI stored all the dictionaries in NSMutable Array. I need to access the values ? How can I do that ? -(void)viewDidLoad { [super viewDidLoad]; self.title = @"Library"; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleBordered target:self action:@selector(close:)]; cells = [[NSMutableArray alloc] initWithObjects:@"dict1", @"dict2", @"dict3", @"dict4", @"dict5", @"dict6", nil]; dict1 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 01 Feb #2", @"date", @"0.7", @"time", @"1.2MB", @"size", @"200*200", @"pix", nil]; dict2 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Wed, 02 Mar #3", @"date", @"1.2", @"time", @"2.2MB", @"size", @"300*300", @"pix", nil]; dict3 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Tue, 03 Apr #5", @"date", @"1.7", @"time", @"2.5MB", @"size", @"240*240", @"pix", nil]; dict4 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 01 Feb #2", @"date", @"0.7", @"time", @"1.2MB", @"size", @"200*200", @"pix", nil]; dict5 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 10 Nov #5", @"date", @"2.7", @"time", @"4.2MB", @"size", @"200*400", @"pix", nil]; dict6 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Mon, 11 Dec #6", @"date", @"4.7", @"time", @"2.2MB", @"size", @"500*200", @"pix", nil]; //[cells addObject:dict1]; //[cells addObject:dict2]; //[cells addObject:dict3]; //[cells addObject:dict4]; //[cells addObject:dict5]; //[cells addObject:dict6]; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [cells count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; //cell.contentView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 80.0f); [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; UIImageView *image1 = [[UIImageView alloc]init]; image1.frame = CGRectMake(0.0f, 0.0f, 80.0f, 80.0f); image1.tag = tag7; UILabel *dateLabel = [[UILabel alloc]init]; dateLabel.frame = CGRectMake(100.0f, 5.0f, 120.0f, 25.0f); dateLabel.font = [UIFont fontWithName:@"Georgia" size:10]; dateLabel.tag = tag1; UILabel *timeLabel = [[UILabel alloc] init]; timeLabel.frame = CGRectMake(100.0f, 30.0f, 40.0f, 25.0f); timeLabel.font = [UIFont fontWithName:@"Georgia" size:10]; timeLabel.tag = tag2; UILabel *sizeLabel = [[UILabel alloc] init]; sizeLabel.frame = CGRectMake(160.0f, 30.0f, 40.0f, 25.0f); sizeLabel.font = [UIFont fontWithName:@"Georgia" size:10]; sizeLabel.tag = tag3; UILabel *pixLabel = [[UILabel alloc] init]; pixLabel.frame = CGRectMake(220.0f, 30.0f, 40.0f, 25.0f); pixLabel.font = [UIFont fontWithName:@"Georgia" size:10]; pixLabel.tag = tag4; UILabel *shareLabel = [[UILabel alloc] init]; shareLabel.frame = CGRectMake(100.0f, 55.0f, 100.0f, 25.0f); shareLabel.font = [UIFont fontWithName:@"Georgia" size:10]; shareLabel.tag = tag5; UILabel *deleteLabel = [[UILabel alloc] init]; deleteLabel.frame = CGRectMake(220.0f, 55.0f, 100.0f, 25.0f); deleteLabel.font = [UIFont fontWithName:@"Georgia" size:10]; deleteLabel.tag = tag6; [cell.contentView addSubview:dateLabel]; [cell.contentView addSubview:timeLabel]; [cell.contentView addSubview:sizeLabel]; [cell.contentView addSubview:pixLabel]; [cell.contentView addSubview:shareLabel]; [cell.contentView addSubview:deleteLabel]; [cell.contentView addSubview:image1]; [dateLabel release]; [timeLabel release]; [sizeLabel release]; [pixLabel release]; [shareLabel release]; [deleteLabel release]; [image1 release]; } // Set up the cell... [(UILabel *)[cell viewWithTag:tag1] setText:[cells objectAtIndex:[dict1 objectForKey: @"date"]]]; [(UILabel *)[cell viewWithTag:tag2] setText:[cells objectAtIndex:[dict1 objectForKey: @"time"]]]; [(UILabel *)[cell viewWithTag:tag3] setText:[cells objectAtIndex:[dict1 objectForKey: @"size"]]]; [(UILabel *)[cell viewWithTag:tag4] setText:[cells objectAtIndex:[dict1 objectForKey: @"pix"]]]; [(UILabel *)[cell viewWithTag:tag5] setText:@"Share"]; [(UILabel *)[cell viewWithTag:tag6] setText:@"Delete"]; cell.imageView.image = [UIImage imageNamed:@"image2.png"]; return cell; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 80.0f; } I did in above way but it is not working. I know the mistake is at the accessing values. but, I could not get how to do it ? Thank You.

    Read the article

  • how can stop creating duplicates in camera roll while using UISaveVideoAtPathToSavedPhotosAlbum to s

    - by srikanth rongali
    I have a video in applications documents folder. I need it to be saved in camera roll. So, I used UISaveVideoAtPathToSavedPhotosAlbum method to save it in camera roll. It's working and I can see the video added to camera roll. But, the problem is every time I execute the application with same video(with same file name), it is added another time in camera roll instead of replacing the old one. So, it is creating the duplicates of the video. How can I make the application work like if a video is present in camera roll and again added with same file name, then old one is replaced by new video.

    Read the article

  • When we should use pushScene and replaceScene in cocos2d ?

    - by srikanth rongali
    Hi, I cocos2d, I am using pushScene and replaceScene to move to next scene. But, I am confused which we should use? When I am using replaceScene in some places app is crashing and giving errors like -[UITextView length]: unrecognized selector sent to instance 0x842a750 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UITextView length]: unrecognized selector sent to instance 0x842a750' But, in my program I am not passing length to UITextView. My program is in this way In scene1 I have UITextView, and I am replacing this scene with scene2. Then -(id)buttonPressed:(id)sender { [description removeFromSuperview]; // It is the textView(description) CCScene *Scene = [CCScene node]; CCLayer *Layer = [scene2 node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] replaceScene: Scene]; } But, when I am using pushScene in presence of replaceScene it is working good. Please clarify me which one should use in which cases ? Thank You

    Read the article

  • Cocos2D: Problem Rotating a CCMenu

    - by srikanth rongali
    If I try to do actions over menuItems but the actions are not running as expected. I think code below should make the menuItem rotate by 90 degrees but when I run it, the menuItem translates from its coordinates to another coordinate then returns to its original coordinate. The complete translation takes 3 seconds. What I need is for the menuItem to rotate by 90 degrees in place within a 3 seconds duration. Please explain where I have done wrong? CCMenuItemImage *targetE;//Globally declared CCMenu *menu;//Globally declared -(id)init { if( (self = [super init]) ) { isTouchEnabled = YES; CGSize windowSize = [[CCDirector sharedDirector] winSize]; targetE = [CCMenuItemImage itemFromNormalImage:@"grossinis_sister1.png" selectedImage:@"grossinis_sister1.png" target:self selector:@selector(touch:)]; menu = [CCMenu menuWithItems:targetE,nil]; id action4 = [CCRotateBy actionWithDuration:3.0 angle:90]; [menu runAction: [CCSequence actions: action4, nil]]; menu.position = ccp(windowSize.width/2 + 200, windowSize.height/2); [self addChild: menu z:10]; } return self; } @end Thank You.

    Read the article

  • How to access Postgresql using QT in Windows

    - by dummystories
    Hi to all, I am developing an application using QtRuby and postgresql. I sucessfully developed and running sucessfully in Linux. Now i want to run the same application in windows. But i am failing to connect to database(Postgresql). I am getting the following errors: QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC Can any one help how to resolve my problem. I am waiting for your replies. Regards, Narasimha Raju.Naidu

    Read the article

  • How we should load the MFMailViewController in cocos2d ?

    - by srikanth rongali
    I am writing an app in using cocos2d. This method I have written for the selector goToFirstScreen: . The view is in landscape mode. I need to send an email. So, I need to launch the MFMailComposeViewController. I need it in portrait mode. But, the control is not entering in to viewDidLoad of the mailMe class. The problem is in goToScreen: method. But, I do not get where I am wrong ? -(void)goToFirstScreen:(id)sender { NSLog(@"goToFirstScreen: "); CCScene *Scene = [CCScene node]; CCLayer *Layer = [mailME node]; [Scene addChild:Layer]; [[CCDirector sharedDirector] setAnimationInterval:1.0/60]; [[CCDirector sharedDirector] pushScene: Scene]; } This is my mailMe class to launch mail controller #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> #import <MessageUI/MFMailComposeViewController.h> #import "cocos2d.h" @interface mailME : CCLayer <MFMailComposeViewControllerDelegate> { UIViewController *mailComposer; } -(void)displayComposerSheet; -(void)launchMailAppOnDevice; @end #import "mailME.h" @implementation mailME -(void)viewDidLoad { NSLog(@"Enetrd in to mail"); Class mailClass = (NSClassFromString(@"MFMailComposeViewController")); if (mailClass != nil) { if ([mailClass canSendMail]) { [self displayComposerSheet]; } else { [self launchMailAppOnDevice]; } } else { [self launchMailAppOnDevice]; } } -(void)displayComposerSheet { CCDirector *director = [CCDirector sharedDirector]; [director pause]; [director stopAnimation]; [director.openGLView setUserInteractionEnabled:NO]; mailComposer = [[UIViewController alloc] init]; [mailComposer setView:[[CCDirector sharedDirector]openGLView]]; [mailComposer setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject:@"Hello!"]; NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"]; [picker setToRecipients:toRecipients]; NSString *emailBody = @"It is not working!"; [picker setMessageBody:emailBody isHTML:YES]; [mailComposer presentModalViewController:picker animated:NO]; [picker release]; } - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { switch (result) { case MFMailComposeResultCancelled: break; case MFMailComposeResultSaved: break; case MFMailComposeResultSent: break; case MFMailComposeResultFailed: break; default: break; } [mailComposer dismissModalViewControllerAnimated:NO]; [[UIApplication sharedApplication] setStatusBarOrientation:CCDeviceOrientationLandscapeLeft animated:NO]; CCDirector *director = [CCDirector sharedDirector]; [director.openGLView setUserInteractionEnabled:YES]; [director startAnimation]; [director resume]; [mailComposer.view.superview removeFromSuperview]; } -(void)launchMailAppOnDevice { NSString *recipients = @"mailto:[email protected]?&subject=Hello!"; NSString *body = @"&body=It is not working"; NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body]; email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]]; } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • how to delete contents from plist programmatically ?

    - by srikanth rongali
    I have a plist file. I want to delete the data from the plist. How can I do it programmatically ? My Plist have an array cells. cells is filled by dictionaries . Each dictionary is filled by string. I used the following way. NSString* plistPath1 = [[NSBundle mainBundle] pathForResource:@"details" ofType:@"plist"]; [cells removeObjectAtIndex:[clickedButtonPath row]]; NSMutableArray *array1 = [[NSMutableArray alloc] initWithCapacity:4]; array1 = cells; [array1 writeToFile:plistPath1 atomically: YES]; But the plist is not taking the changes. Thank you.

    Read the article

  • How is the 'is' keyword implemented in Python?

    - by Srikanth
    ... the is keyword that can be used for equality in strings. >>> s = 'str' >>> s is 'str' True >>> s is 'st' False I tried both __is__() and __eq__() but they didn't work. >>> class MyString: ... def __init__(self): ... self.s = 'string' ... def __is__(self, s): ... return self.s == s ... >>> >>> >>> m = MyString() >>> m is 'ss' False >>> m is 'string' # <--- Expected to work False >>> >>> class MyString: ... def __init__(self): ... self.s = 'string' ... def __eq__(self, s): ... return self.s == s ... >>> >>> m = MyString() >>> m is 'ss' False >>> m is 'string' # <--- Expected to work, but again failed False >>> Thanks for your help!

    Read the article

  • how to create a rounded transparent rectangle by using cocoa touch ?

    - by srikanth rongali
    Hi, I need to create a rounded rectangular box in which there will be 6 buttons in iPhone application. And the rectangular box is transparent. Each button have an image and text. And they are also transparent. ( Here transparent means we can see the background image of the box. Sorry for my vocabulary.) I could not get how to start it. I thought of the following one but, By using core graphics draw the outside rounded rectangle and then draw inside rectangles like 2x3 grid. Can I make with this ? Are there any good and easy methods than this. Please give me some idea how to start over with ? Thank you.

    Read the article

  • How to access web application class into silverlight application

    - by Srikanth
    Hi..I am beginner in silverlight..I have created a silverlight project. When a new silverlight project is created it is automatically creating a silverlight application and one web application. I have added a class in both applications. Now I want to access a method of web application class into silverlight application class. Is it possible? I have tried to add web application reference to silverlight but VS is not allowing. Is there any another way to do??

    Read the article

  • How to set probability for a targetSprite shooting accuracy in shooting game ?

    - by srikanth rongali
    Hi, My code is ion cocos2D. I have written code for generating the bullets from the enemy gun for every 0.3seconds. The enemySprite is in right side of the screen in (land scape mode) at winSize.height/2. the bullet starts from the same point and reach the player's end. I used rand() to generate y-coordinate for the bullet to hit on player side. Now, if the bullet bounded rectangle meets the player bounded rectangle the enemy won. If it misses enemy shoots again after 0.3 seconds. Every thing is fine up to here for me. But I have 10 enemies and each have accuracy of hitting player of probabilities ranging from 0.80 to 1.0. First enemy probability is .80 and 10 enemy's is 1.0. How can I adjust the probability for enemy such that it runs according to its probability. Player also hits the enemy.

    Read the article

  • Do [sprite stopActionByTag: kTag]; working differently for different CCActions ?

    - by srikanth rongali
    //prog 1 -(void)gameLogic:(ccTime)dt { id actionMove = [CCMoveTo actionWithDuration:1.0 position:ccp(windowSize.width/2-400, actualY)]; [actionMove setTag:6]; [self schedule:@selector(update:)]; [hitBullet runAction:actionMove]; } -(void)update:(ccTime)dt { if ( (CGRectIntersectsRect(hitRect, playerRect)) ) { [[[self getActionByTag:6] retain] autorelease]; [hitBullet stopActionByTag: 6]; } } //prog 2 -(void)gameLogic:(ccTime)dt { id actionMove = [CCMoveTo actionWithDuration:1.0 position:ccp(windowSize.width/2-400, actualY)]; id hitBulletAction = [CCSequence actionWithDuration:(intervalforEnemyshoot)]; id hitBulletSeq = [CCSequence actions: hitBulletAction, actionMove, nil]; [hitBulletSeq setTag:5]; [self schedule:@selector(update:)]; [hitBullet runAction:hitBulletSeq]; } -(void)update:(ccTime)dt { if ( (CGRectIntersectsRect(hitRect, playerRect)) ) { [[[self getActionByTag:5] retain] autorelease]; [hitBullet stopActionByTag: 5]; } } While prog1 is working prog2 is not working ? I think the both are same. But why the two stopActions are working differently in two prog1 and prog2 ? I mean the actions are stopped in prog1 but the actions are not stopping in prog2 ? thank You.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >