Search Results

Search found 205 results on 9 pages for 'sai srikanth'.

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

  • Uninstall Mongo DB completely

    - by Srikanth
    I followed the following steps to install MongoDb on my centos machine. http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/ As mentioned at the end of the document, in the phpinfo() the mongoDb support was enabled. Now i need to undo all the actions i did. Till now i hve uninstalled remi-release-6.rpm which i had installed by following the link above. How to uninstall completely and undo all actions I did?

    Read the article

  • Predicate in Java

    - by srikanth
    I am going through the code which uses Predicate in Java. I have never used predicate. Can someone guide me to any tutorial or conceptual explanation of predicate and their implementation in java ? Google didnt help much...

    Read the article

  • 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

  • Set List View Size Android

    - by Sandeep
    Hello , I am using List View in my project where i have used a xml file which is used to create the list item.Then i have used it programmatically in my class which is extended by ListActivity. But the problem is i have to add a button in the bottom of screen which is not related to list view but List view covers all the screen. So,is there any way to add button in bottom with list view in android. My Code is :- import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; public class Options extends ListActivity { String[] items; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); requestWindowFeature(Window.FEATURE_RIGHT_ICON); items = getResources().getStringArray(R.array.chantOption_array); setListAdapter(new IconicAdapter()); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setBackgroundResource(R.drawable.ichant_logo); setFeatureDrawableResource(Window.FEATURE_RIGHT_ICON, R.drawable.icon_t); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // When clicked, show a toast with the TextView text Toast.makeText(getApplicationContext(), items[position], Toast.LENGTH_SHORT).show(); if ("Gayatri Mantra".equals(items[position].toString())) { int[] timeintervals = { 23900, 24000 }; // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio) startChantActivity(2, 108, R.drawable.gayatri, R.raw.gayatri, R.drawable.icon_gayatri, "Gayatri Mantra", timeintervals); } if ("Om Mani Padme Hum".equals(items[position].toString())) { int[] timeintervals = { 5500, 8200, 11100, 13900, 34100, 36700, 39500, 42300, 59300, 62000, 64800, 67600, 124600 }; // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio) startChantActivity(2, 108, R.drawable.ommanipadmehum, R.raw.om_mani, R.drawable.icon_padme, "Om Mani Padme Hum", timeintervals); } if ("Sai Ram".equals(items[position].toString())) { // Audio time interval for bead+total time duration of audio int[] timeintervals = { 4800, 7500, 10400, 12600, 15800, 18600, 21600, 24400, 25000 }; // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio) startChantActivity(2, 108, R.drawable.sairam, R.raw.sairam, R.drawable.icon_sairam, "Sai Ram", timeintervals); } if ("Aum".equals(items[position].toString())) { // Audio time interval for bead+total time duration of audio int[] timeintervals = { 12850, 13000 }; // startChantActivity(TotalMala_loop,Total_Bead_Loop,BacgroundImage,Icon,Title,BeadsTotalTimeIntervals+totalTimeDurationOfAudio) startChantActivity(2, 108, R.drawable.aum, R.raw.aum, R.drawable.ico_aum, "Aum", timeintervals); } } }); } class IconicAdapter extends ArrayAdapter { IconicAdapter() { super(Options.this, R.layout.list_item, items); } public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = getLayoutInflater(); View row = inflater.inflate(R.layout.list_item, parent, false); TextView label = (TextView) row.findViewById(R.id.label); label.setText(" "+items[position]); ImageView icon = (ImageView) row.findViewById(R.id.icon); if (items[position].equals("Gayatri Mantra")) { icon.setImageResource(R.drawable.icon_gayatri); } if (items[position].equals("Om Mani Padme Hum")) { icon.setImageResource(R.drawable.icon_padme); } if (items[position].equals("Sai Ram")) { icon.setImageResource(R.drawable.icon_sairam); } if (items[position].equals("Aum")) { icon.setImageResource(R.drawable.ico_aum); } return (row); } } protected void startChantActivity(int mala_loop, int beads_loop, int background, int media, int titleIcon, String title, int[] timeintervals) { Bundle bundle = new Bundle(); bundle.putInt("mala_loop", mala_loop); bundle.putInt("beads_loop", beads_loop); bundle.putInt("background", background); bundle.putInt("media", media); bundle.putInt("titleIcon", titleIcon); bundle.putString("title", title); bundle.putIntArray("intervals", timeintervals); Intent intent = new Intent(this, ChantBliss.class); intent.putExtras(bundle); startActivityForResult(intent, this.getSelectedItemPosition()); } } And Corresponding xml file is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:paddingLeft="2px" android:paddingRight="2px" android:paddingTop="2px" android:layout_height="wrap_content" /> <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="22sp" android:textColor="#ff000000" /> </LinearLayout> Thanks in Advance: Sandeep

    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

  • How to write onclick event for ListView in Android?

    - by Srikanth Naidu
    Hi i have the listview the sixitems in it, but when i call alet function on event it doesnt work ? let me know how to write a function on item event on click? public class PhotoListView extends ListActivity { String[] listItems = {"HeadShot", "BodyShot ", "ExtraShot", "Video Take1", "Video Take2", "Video Take3", }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setListAdapter(new ArrayAdapter(this,android.R.layout.simple_list_item_1, listItems)); } OnListclick ListView Shot = getListView(); protected void onListItemClick(View view) { if(view == Shot){ AlertDialog.Builder alertbox = new AlertDialog.Builder(this); // set the message to display alertbox.setMessage("Please Get Ready"); }

    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

  • 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

  • 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 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 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

  • Java script Gallery - how to show a next image with an arrow - shiftImg(1)

    - by Srikanth Naidu
    //html file Image slideshow </script>   Loading image. Please wait 1     1/12 2/12 3/12 4/12 5/12 6/12 7/12 8/12   // //JS File var displayWaitMessage=true; // Display a please wait message while images are loading? var activeImage = false; var imageGalleryLeftPos = false; var imageGalleryWidth = false; var imageGalleryObj = false; var maxGalleryXPos = false; var slideSpeed = 0; var imageGalleryCaptions = new Array(); function startSlide(e) { if(document.all)e = event; var id = this.id; this.getElementsByTagName('IMG')[0].src = 'images/' + this.id + '_over.gif'; if(this.id=='arrow_right'){ slideSpeedMultiply = Math.floor((e.clientX - this.offsetLeft) / 5); slideSpeed = -1*slideSpeedMultiply; slideSpeed = Math.max(-10,slideSpeed); }else{ slideSpeedMultiply = 10 - Math.floor((e.clientX - this.offsetLeft) / 5); slideSpeed = 1*slideSpeedMultiply; slideSpeed = Math.min(10,slideSpeed); if(slideSpeed<0)slideSpeed=10; } } function releaseSlide() { var id = this.id; this.getElementsByTagName('IMG')[0].src = 'images/' + this.id + '.gif'; slideSpeed=0; } function gallerySlide() { if(slideSpeed!=0){ var leftPos = imageGalleryObj.offsetLeft; leftPos = leftPos/1 + slideSpeed; if(leftPos>maxGalleryXPos){ leftPos = maxGalleryXPos; slideSpeed = 0; } if(leftPos<minGalleryXPos){ leftPos = minGalleryXPos; slideSpeed=0; } imageGalleryObj.style.left = leftPos + 'px'; } setTimeout('gallerySlide()',20); } function showImage() { if(activeImage){ activeImage.style.filter = 'alpha(opacity=50)'; activeImage.style.opacity = 0.5; } this.style.filter = 'alpha(opacity=100)'; this.style.opacity = 1; activeImage = this; } function initSlideShow() { document.getElementById('arrow_left').onmousemove = startSlide; document.getElementById('arrow_left').onmouseout = releaseSlide; document.getElementById('arrow_right').onmousemove = startSlide; document.getElementById('arrow_right').onmouseout = releaseSlide; imageGalleryObj = document.getElementById('theImages'); imageGalleryLeftPos = imageGalleryObj.offsetLeft; imageGalleryWidth = document.getElementById('galleryContainer').offsetWidth - 80; maxGalleryXPos = imageGalleryObj.offsetLeft; minGalleryXPos = imageGalleryWidth - document.getElementById('slideEnd').offsetLeft; var slideshowImages = imageGalleryObj.getElementsByTagName('IMG'); for(var no=0;no<slideshowImages.length;no++){ slideshowImages[no].onmouseover = showImage; } var divs = imageGalleryObj.getElementsByTagName('DIV'); for(var no=0;no<divs.length;no++){ if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML; } gallerySlide(); } function showPreview(imagePath,imageIndex){ var subImages = document.getElementById('previewPane').getElementsByTagName('IMG'); if(subImages.length==0){ var img = document.createElement('IMG'); document.getElementById('previewPane').appendChild(img); }else img = subImages[0]; if(displayWaitMessage){ document.getElementById('waitMessage').style.display='inline'; } document.getElementById('largeImageCaption').style.display='none'; img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1); }; img.src = imagePath; } function hideWaitMessageAndShowCaption(imageIndex) { document.getElementById('waitMessage').style.display='none'; document.getElementById('largeImageCaption').innerHTML = imageGalleryCaptions[imageIndex]; document.getElementById('largeImageCaption').style.display='block'; } function shiftImg(imageIndex){ } window.onload = initSlideShow;

    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

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