Daily Archives

Articles indexed Wednesday April 14 2010

Page 12/122 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How to find the leaky faucet that loads into Malloc 32kb

    - by Rob
    I have been messing around with Leaks trying to find which function is not being deallocated (I am still new to this) and could really use some experienced insight. I have this bit of code that seems to be the culprit. Every time I press the button that calls this code, 32kb of memory is additionally allocated to memory and when the button is released that memory does not get deallocated. What I found was that everytime that AVAudioPlayer is called to play an m4a file, the final function to parse the m4a file is MP4BoxParser::Initialize() and this in turn allocates 32kb of memory through Cached_DataSource::ReadBytes My question is, how do I go about deallocating that after it is finished so that it doesn't keep allocating 32kb every time the button is pressed? Any help you could provide is greatly appreciated! - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //stop playing theAudio.stop; // cancel any pending handleSingleTap messages [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(handleSingleTap) object:nil]; UITouch* touch = [[event allTouches] anyObject]; NSString* filename = [g_AppsList objectAtIndex: [touch view].tag]; NSString *path = [[NSBundle mainBundle] pathForResource: filename ofType:@"m4a"]; theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; theAudio.delegate = self; [theAudio prepareToPlay]; [theAudio setNumberOfLoops:-1]; [theAudio setVolume: g_Volume]; [theAudio play]; }

    Read the article

  • iPhone generalPasteboard loses contents if application is closed by an -openURL: call

    - by Kojiro
    I have a method, that puts something on the pasteboard. This method is called one of two ways, one, as an IBAction from a button, the other from another method which afterwards closes the application by doing: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:"]]; The problem arises only when the application is not closed using the home button, but is closed using the line above. When that happens, the pasteboard contents are lost. I assume this problem has something to do with the object being cleaned up improperly when it closes this way, but have no idea why it is doing that. I have even tried to intentionally leak the object that gets put on the pasteboard, but it still gets lost on the way out. Here is the method: - (IBAction) copyLink { NSString *stringForPasteboard = @"here is the string"; [[UIPasteboard generalPasteboard] setURL:stringForPasteboard]; [stringForPasteboard release]; }

    Read the article

  • What could cause the keypad backlights to spontaneously illuminate on my Palm Treo? [closed]

    - by LeopardSkinPillBoxHat
    I have a Palm Treo 680 smart phone. I have noticed recently that when the phone is turned off, the keypad backlights will spontaneously illuminate. This is particularly annoying because it drains the battery life of the Treo -- when I woke up this morning, the battery was completely flat and I had to plug it in to wake it up again. I suspect that this has something to do with the Energy Dimmer application (I have version 2.16 installed). I have disabled this application today to see if it makes the problem go away. Has anyone else had this problem, and do you have any solutions?

    Read the article

  • What happens when a computer starts?

    Hi All, Hopefully the title isn't funny to be ignored! But I have a genuine interest in understanding what happens when a computer is turned on. i.e. how the computer works on startup, various initializations that take place. For example, is bootstrap loader the first step, when are device drivers loaded etc.. Please guide me to understand. Regards, darkie

    Read the article

  • Python 2.7 est disponible en bêta, que pensez-vous de ses améliorations ?

    Mise à jour du 14.04.2010 par Katleen Python 2.7 est disponible en bêta, que pensez-vous de ses améliorations ? La bêta de Python 2.7 vient d'être mise en ligne par ses développeurs. Cette dernière version de Python 2.x apporte beaucoup de nouveautés, contrairement aux versions ultérieures qui ne seront plus que des correctifs (bugs-fix-only-mode) jusqu'à l'arrivée de la version 3.0 du langage. Parmis les nouvelles fonctionnalités apportées par cette version 2.7, on note particulièrement : - des dictionnaires ordonnés - un module d'entrées/sorties (io) beaucoup plus rapide - des vues des dictionnaires - un modules sysconfig

    Read the article

  • string parsing to double fails in C++

    - by helixed
    Here's a fun one I've been trying to figure out. I have the following program: #include <iostream> #include <string> #include <sstream> using namespace std; int main(int argc, char *argv[]) { string s("5"); istringstream stream(s); double theValue; stream >> theValue; cout << theValue << endl; cout << stream.fail(); } The output is: 0 1 I don't understand why this is failing. Could somebody please tell me what I'm doing wrong? Thanks, helixed

    Read the article

  • How do I write a powershell script that gets the file with the most recent last write time from a fo

    - by Shoko
    The subject line says it all. I'd also like to do this using pipes. I figured that I could use Get-ChildItem, Measure-Object and Where-Object, but Measure-Object doesn't like dates. Should I have a script block which loops through each item returned from Get-ChildItem and does a comparison to see if it's the most recent? I thought that there should be a handy PS cmdlet for that.

    Read the article

  • converting string to int in C++

    - by xbonez
    I am trying to convert a string I read in from a file to an int value so I can store it in an integer variable. This is what my code looks like: ifstream sin; sin.open("movie_output.txt"); string line; getline(sin,line); myMovie.setYear(atoi(line)); Over here, setYear is a mutator in the Movie class (myMovie is an object of Movie class) that looks like this: void Movie::setYear(unsigned int year) { year_ = year; } When I run the code, I get the following error: error C2664: 'atoi' : cannot convert parameter 1 from 'std::string' to 'const char *' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

    Read the article

  • Help Qt Widgets for creating Accessories Bar on my device

    - by Surjya Narayana Padhi
    Hi Geeks, For a handheld device I want to put a vertical Bar which will contain widgets that show the battery status of device, network connectivity status, Date and Time etc. For this Bar I have chosen a GroupBox and for the widgets inside that (lets say batter status) I am planning to use QPushButton. Is it correct I am doing or there is some special widgets for this purpose? Please suggest.

    Read the article

  • Running a Python script outside of Django

    - by geejay
    I have a script which uses the Django ORM features, amongst other external libraries, that I want to run outside of Django (that is, executed from the command-line). Edit: At the moment, I can launch it by navigating to a URL... How do I setup the environment for this?

    Read the article

  • Visual Basic .NET Help

    - by Daniel
    How can I get this code into a loop? contact.first_name = list.Item(0) contact.middle_name = list.Item(1) contact.last_name = list.Item(2) contact.age = list.Item(3) contact.mobile_phone = list.Item(4) contact.home_phone = list.Item(5) contact.work_phone = list.Item(6) contact.home_street = list.Item(7) contact.home_city = list.Item(8) contact.home_state = list.Item(9) contact.home_zip = list.Item(10) contact.work_street = list.Item(11) contact.work_city = list.Item(12) contact.work_state = list.Item(13) contact.work_zip = list.Item(14)

    Read the article

  • How do I show information to users belonging to different groups (web) in modx

    - by Gaurav Sharma
    Hello Everyone, I have created a website using modx evolution v1.0.2. The website that I have developed has 12 different types of users (categorized in groups). Each user will be shown a different price depending on the group to which he belongs. Till now I have been able to fetch the group name of current logged in user (created a snippet for that), but how can I achieve the above mentioned functionality so that each user should be able to see only the price that I have coded according to his group. For example: If a user is associated with the 'ocassional' group then he should be shown the price as , say, 50 bucks and if a user is associated with the 'regular' group then he should be shown the price as, say, 40 bucks I can easily do this by coding a single snippet for every product's variant, but there are a lot of variants (more than 100 and growing). I have created a resource(page) for every product and it's variant. Every variant has a price. It is this price that I want to be shown according to the logged in user group membership. I hope I am able to explain my query clearly. Please help me do this functionality. Thanks

    Read the article

  • How to fix an error in a Mercurial changeset comment?

    - by Sly
    Is there a way to rewrite the hg commit message if the wrong information was entered? We always include our Bug ID when we commit a changeset. For instance: hg commit -m "Bug 14585: LastName field should be mandatory" But If I put the wrong bug ID, is there a way (through an extension maybe) to fix the comment once the changeset has been committed and pushed to a central repo?

    Read the article

  • A/B testing on App Engine?

    - by Silver Dragon
    What would be the simplest implementation of an A/B testing system running on App engine? I'm especially keen towards performance implications of using Datastore for back-end (with looong query times), and database design.

    Read the article

  • Unable to list owned images and running instances from Amazon Web Services using Zend Framework

    - by Marcel Tjandraatmadja
    I am using Zend Framework's library to manage EC2 instances and AMI. However I can't list the AMI's I own and can't list existing EC2 instances. $ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey); $instances = $ec2Instance ->describe(); $ec2Instance -describe() should list all instances but it is returning no instances even though I have three of them running at this time. $ami = new Zend_Service_Amazon_Ec2_Image($awsAccessKey, $awsSecretKey); $images = $ami->describe(); $ami-describe() returns all the public images but none of them are the ones I created even though I have two AMIs. Does any one know what I am missing here?

    Read the article

  • integer division properties

    - by aaa
    hi. does the following integer arithmetic property hold? (m/n)/l == m/(n*l) At first I thought I knew answer (does not hold), but now am not sure. Does it hold for all numbers or only for certain conditions, i.e. n > l?

    Read the article

  • UITableViewCell with custom gradient background, with another gradient as highlight color

    - by Rich
    I have a custom UITableViewCell with a custom layout. I wanted a gradient background, so in my UITableViewDelegate cellForRowAtIndexPath: method, I create a CAGradientLayer and add it to the cell's layer with insertSubLayer:atIndex: (using index 0). This works just fine except for two things: Most importantly, I can't figure out how to change to a different gradient color when the row is highlighted. I have tried a couple things, but I'm just not familiar enough with the framework to get it working. Where would be the ideal place to put that code, inside the table delegate or the cell itself? Also, there's a 1px white space in between each cell in the table. I have a background color on the main view, a background color on the table, and a background color on the cell. Is there some kind of padding or spacer by default in a UITableView?

    Read the article

  • SQL SERVER What is Spatial Database? Developing with SQL Server Spatial and Deep Dive into Spatial

    What is Spatial Database?A spatial database is a database that is optimized to store and query data related to objects in space, including points, lines and polygons. While typical databases can understand various numeric and character types of data, additional functionality needs to be added for databases to process spatial data types. (Source: Wikipedia)Today [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Silverlight Rough Cut Editor Real Time Highlights

    The NAB Show is an annual trade show produced by the National Association of Broadcasters. It is taking place in Las Vegas this week and you can check out Microsoft at the NAB Show 2010. It is interesting to watch the broadcast and web industry collide converge head on. With the launch of Silverlight 4 this morning one could say this week is a perfect storm. The media press releases from Microsoft are coming thick and fast. REDMOND, Wash. April 8, 2010 Microsoft Corp. today announced that...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Easy to implement .net library for geocoding using a free service?

    - by Kjensen
    I need to geocode adresses (get lat/long from addresses) using in .Net, to store in the database. What is the library/project to look into, to get that done? After a search here, on google and codeplex.com, I have found there to be a few options, that seem like they will do what I ask for... But some of them could be crap and a waste of time - and some might just be stellar. Which one is the one to go for? Have you used any of them?

    Read the article

  • Need Java https proxy which can be enhanced to emulate production https proxy behaviour

    - by Thorbjørn Ravn Andersen
    I have a production environment which require access through a proxy server. Occasionally said server returns blank responses badly confusing the Metro web service library causing all kinds of interesting RuntimeExceptions. I believe the proxy is Squid. In order to handle these better, I would like to set up a similar scenario here with a local proxy under my control causing all kinds of interesting failures. A quick survey strongly indicated I was not asking right. So, the question is, is there a simple, open source HTTPS/HTTP whatever proxy written in Java suitable for this purpose?

    Read the article

  • Implementation work in networking to be done as thesis

    - by vinutheraj
    I am planning to do an implementation project as my one year MTech thesis, can you help me find some places to find any good work to be implemented ? I already looked into Tor, nmap and some other opensource projects involved in GSOC. Can you please direct me to other opensource work going on in networking where I may find some work to be done as an implementation project ?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >