Search Results

Search found 28948 results on 1158 pages for 'app showdown'.

Page 159/1158 | < Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >

  • Released object crashes app

    - by John Smith
    I am using objective-C++ (+Boost) for iPhone development. I am in a rather tight loop and need to allocate and release a certain object. The code is something like this. for (int i=0;i<100;i++) { opt = [[FObj alloc] init]; //do stuff with opt [opt release]; } The FObj object is something like @interface FObj MyCPPObj * cppobj; @end In the implementation of FObj there is a dealloc method: -(void) dealloc { delete cppobj; //previously allocated with 'new' [super dealloc]; } I am afraid that if i don't release then the 'MyCPPObj's will just pile up. But releasing makes the app crash after the first loop. What am I doing wrong? Or perhaps should I make cppobj and boost::shared_ptr? (do boost shared pointers automatically release their objects when an objective-C++ object is deleted?)

    Read the article

  • Can we use Resource Expressions in javascript and other parts except Literal?

    - by balexandre
    The Literal control works all the time <asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:ErrorMessages, errorCompanyNotFound %>" /> But if I want to use this as a parameter in an image, like <img src="blahblah" alt="" title"<%$ Resources:ErrorMessages, errorCompanyNotFound %>" /> It gives the annoying error Literal expressions like '' are not allowed. Use instead. Same happens if I try to access it through Javascript var noHit = '<%$ Resources:ErrorMessages, errorCompanyNotFound %>'; Does anyone had any idea how can I fetch the Global Resource value under this circumstances?

    Read the article

  • Unit testing task queues in AppEngine

    - by Swizec Teller
    For a very long time now I've been using task queues on AppEngine to schedule tasks, just the way I'm supposed to. But what I've always been wondering is how does one write tests for that? Until now I've simply made tests to make sure an error doesn't occur on the API that queues a task and then wrote the more proper tests for the API executing the task. However lately I've started feeling a bit unsatisfied by this and I'm searching for a way to actually test that the correct task has been added to the correct queue. Hopefully this can be done better than simply by deploying the code and hoping for the best. I'm using django-nonrel, if that has any bearing on the answer. To recap: How can a unit test be written to confirm tasks have been queued?

    Read the article

  • Soundboard app: Play sound as long as the user is pressing the button

    - by Pantelis Proios
    I am making a soundboard app and i am using sounds with over 30sec duration. I am playing the sound by connecting in IB my action with a "touch down" event, however the sound keeps playing once started. I connected in the some button a "touch cancel" & "touch up outside" event that is supposed to stop the sound but for some reason it doesn't. Can anybody provide a solution to my problem? ---Edit--- Here is my code: -(IBAction)playSound:(id)sender { NSString *soundFile; soundFile = [[NSBundle mainBundle] pathForResource:@"testSound" ofType:@"mp3"]; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundFile] error:nil]; audioPlayer.volume = volumeSlider.value; audioPlayer.numberOfLoops = -1; [audioPlayer prepareToPlay]; [audioPlayer play]; } -(IBAction)stopSound:(id)sender { [audioPlayer stop]; }

    Read the article

  • Port a Rails App from Windows to Mac or Linux

    - by Ryan Max
    Hello I've been a Rails developer on Windows for quite some time now, but I recently completed my biggest project yet (it's quite extensive, took me over a year to build) but I am having trouble deploying it. The combination of it's size, complexity and a windows environment is making it needlessly complex to deploy. I am thinking about getting an old mac mini and using it just for rails development. Either that or install unix on another box. Is there any way I can port my app to this mac or linux machine, without having to start over? I can't find any resources on the internets about this.

    Read the article

  • how to make a thread of never stop, and write something to database every 10 second..

    - by zjm1126
    i using gae and django this is my code: class LogText(db.Model): content = db.StringProperty(multiline=True) class MyThread(threading.Thread): def __init__(self,threadname): threading.Thread.__init__(self, name=threadname) def run(self,request): log=LogText() log.content=request.POST.get('content',None) log.put() def Log(request): thr = MyThread('haha') thr.run(request) return HttpResponse('')

    Read the article

  • Running the same code for get(self) as post(self)

    - by Peter Farmer
    Its been mentioned in other answers about getting the same code running for both the def get(self) and the def post(self) for any given request. I was wondering what techniques people use, I was thinking of: class ListSubs(webapp.RequestHandler): def get(self): self._run() def post(self): self._run() def _run(self): self.response.out.write("This works nicely!")

    Read the article

  • What approach should be suitable for user authentification in simle client/server app

    - by TerryS
    My previous question was closed so I will be more specific. I need to create an application, desktop one written in C#, that will ask for user credentials and after verification opens the GUI allowing to work with DB (black box for users). It should be used from everywhere, not LAN or SQL domain. I assume I would need to do the following: Create a client and a server applications that will deal with authentification. That would mean a lot of socketing stuff.. Once the user is verified, the client queries would be sent to database (client-server-DB). The server would need to send the DB data sets back to the client. As you can see, this is just my guess but I have no idea whether its too complicated or completely wrong. The main thing is that it must be desktop app (not web based one) and accessible from everywhere. I am interested in main points how to design the system and will be extremely grateful for that.

    Read the article

  • Objectify - Retrieve subclass instances with superclass query

    - by Deviling Master
    for a project i'm making, i'm using Objectify and Google AppEngine I'm quoting and old message from Google Groups, but the problem i have is the same: Here's the problem I'm trying to solve: I'd like to persist instances of several subclasses of one superclass to the datastore, and then retrieve them by querying for that superclass. (For example, a query for Game would return instances of Chess and Backgammon). Is there any way to accomplish this using Objectify? Because the thing i want is the same, but the topic does not provides yet an answer (it's 3 years old), I moved here with the same question. From 2010 to now, this question has been solved? Thanks Bye

    Read the article

  • FJSTransitionController setup and use in View Controller not main app delegate

    - by elliotrock
    I am trying to set up Corey Floyd's FJSTransitionController. My app uses a main view controller to manage the main view navigation. I also went through the source to fix it for ARC. Followed instructions and in my main delegate .h I have in the usual spots: FJTransitionController* mainTransitionController; @property (nonatomic,retain) FJTransitionController* mainTransitionController; delegate .m has the following @synthesize mainTransitionController And in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions mainTransitionController=[[FJTransitionController alloc] init]; // do I need to instantise? [self.window addSubview:mainTransitionController.view]; [mainTransitionController setViewControllerClass:[[mainViewController sendMissionsPanelViewController] class] forKey:@"missionView"]; The last line is complaining that there is no @interface for FJTransitionController? Any help please.

    Read the article

  • GAE JCache NumberFormatException, will I need to write Java to avoid?

    - by Jasper
    This code below produces a NumberFormatException in this line: val cache = cf.createCache(Collections.emptyMap()) Do you see any errors? Will I need to write a Java version to avoid this, or is there a Scala way? ... import java.util.Collections import net.sf.jsr107cache._ object QueryGenerator extends ServerResource { private val log = Logger.getLogger(classOf[QueryGenerator].getName) } class QueryGenerator extends ServerResource { def getCounter(cache:Cache):long = { if (cache.containsKey("counter")) { cache.get("counter").asInstanceOf[long] } else { 0l } } @Get("html") def getHtml(): Representation = { val cf = CacheManager.getInstance().getCacheFactory() val cache = cf.createCache(Collections.emptyMap()) val counter = getCounter(cache) cache.put("counter", counter + 1) val q = QueueFactory.getQueue("query-generator") q.add(TaskOptions.Builder.url("/tasks/query-generator").method(Method.GET).countdownMillis(1000L)) QueryGenerator.log.warning(counter.toString) new StringRepresentation("QueryGenerator started!", MediaType.TEXT_HTML) } } Thanks!

    Read the article

  • Parent key of type encoded string?

    - by user246114
    Hi, How do we create a parent key which is an encoded string? Example: class Parent { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String mEncKey; } class Child { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String mEncKey; // In the doc examples, they have Key as the type here. @Persistent @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true") private String mParentEncKey; } yeah I'm not sure how to make mParentEncKey an encoded string type, because the 'key' label is already being used? I would need something like?: key="gae.parent-pk.encoded-pk" not sure - is that possible? Thanks

    Read the article

  • How to set CSS style colors in GWT

    - by AmaltasCoder
    I have a GWT + AppEngine application that lets users create online polls. I want to let the poll creator choose from a variety of themes for his poll. We will save the theme a poll creator chose on the server and whenever a poll respondent access the poll he will get the questions with the chosen theme. A theme for us means a set of 4-5 colors which we will use to style the poll page. Our client side application is a GWT application with styles set inline in UiBinder templates elements, for example: <ui:style> .header { background: color1; padding: 6px 6px; } .anothercssclass { background: color2; padding: 6px 6px; } </ui:style> Please suggest how we can set the color1 and color2 from the theme saved on server. Please note this is NOT a GWT module theme question.

    Read the article

  • Android - Opening phone deletes app state

    - by Tom G
    Hey everyone, I'm writing an android application that maintains a lot of "state" data...some of it I can save in the form of onSaveInstanceState but some of it is just to complex to save in memory. My problem is that sliding the phone open destroys/recreates the app, and I lose all my application state in the process. The same thing happens with the "back" button, but I overloaded that function on my way. Is there any way to overload the phone opening to prevent it from happening? Thanks in advance.

    Read the article

  • Affine Transforms with Demo App

    - by Dex
    I have a demo app here https://github.com/rdetert/image-transform-test After importing an image, you can pinch, zoom, rotate the image. What I want to do is save out a 640x480 image (landscape mode) that looks identical to the live preview. So if there are 100px bars of empty space on the sides, I need the same empty bars in the final output (scaled appropriately). This is proving to be more difficult than I thought it would be. I can't quite get it to come out right after days of working on it. The magic method that generates the final image is called -(void)generateFinalImage Good luck! ;)

    Read the article

  • AppEngine: Can I write a Dynamic property (db.Expando) with a name chosen at runtime?

    - by MarcoB
    If I have an entity derived from db.Expando I can write Dynamic property by just assigning a value to a new property, e.g. "y" in this example: class MyEntity(db.Expando): x = db.IntegerProperty() my_entity = MyEntity(x=1) my_entity.y = 2 But suppose I have the name of the dynamic property in a variable... how can I (1) read and write to it, and (2) check if the Dynamic variable exists in the entity's instance? e.g. class MyEntity(db.Expando): x = db.IntegerProperty() my_entity = MyEntity(x=1) # choose a var name: var_name = "z" # assign a value to the Dynamic variable whose name is in var_name: my_entity.property_by_name[var_name] = 2 # also, check if such a property esists if my_entity.property_exists(var_name): # read the value of the Dynamic property whose name is in var_name print my_entity.property_by_name[var_name] Thanks...

    Read the article

< Previous Page | 155 156 157 158 159 160 161 162 163 164 165 166  | Next Page >