Search Results

Search found 8247 results on 330 pages for 'smart phone'.

Page 216/330 | < Previous Page | 212 213 214 215 216 217 218 219 220 221 222 223  | Next Page >

  • sqlite eatingup memory on iPhone when doing insert

    - by kviksilver
    I am having problem with inserting data to sqlite database. char *update="INSERT OR REPLACE INTO ct_subject (id,id_parent, title, description, link, address, phone, pos_lat, pos_long, no_votes, avg_vote, photo, id_comerc, id_city, placement, type, timestamp, mail) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"; sqlite3_stmt *stmt; if(sqlite3_prepare_v2(database, update, -1, &stmt, nil) == SQLITE_OK){ sqlite3_bind_int(stmt, 1, [[[newCategories objectAtIndex:i] valueForKey:@"id"] intValue]); sqlite3_bind_int(stmt, 2, [[[newCategories objectAtIndex:i] valueForKey:@"id_parent"] intValue]); sqlite3_bind_text(stmt, 3, [[[newCategories objectAtIndex:i] valueForKey:@"title"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 4, [[[newCategories objectAtIndex:i] valueForKey:@"description"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 5, [[[newCategories objectAtIndex:i] valueForKey:@"link"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 6, [[[newCategories objectAtIndex:i] valueForKey:@"address"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 7, [[[newCategories objectAtIndex:i] valueForKey:@"phone"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 8, [[[newCategories objectAtIndex:i] valueForKey:@"pos_lat"] UTF8String], -1, NULL); sqlite3_bind_text(stmt, 9, [[[newCategories objectAtIndex:i] valueForKey:@"pos_long"] UTF8String], -1, NULL); sqlite3_bind_int(stmt, 10, [[[newCategories objectAtIndex:i] valueForKey:@"no_votes"] intValue]); sqlite3_bind_text(stmt, 11, [[[newCategories objectAtIndex:i] valueForKey:@"avg_vote"] UTF8String], -1, NULL); if ([[[newCategories objectAtIndex:i] valueForKey:@"photo"] length]!=0) { NSMutableString *webUrl = (NSMutableString *)[[NSMutableString alloc] initWithString:@"http://www.crotune.com/public/images/subjects/"]; [webUrl appendString:[[newCategories objectAtIndex:i] valueForKey:@"photo"]]; UIImage *myImage = [self getWebImage:webUrl]; if(myImage != nil){ sqlite3_bind_blob(stmt, 12, [UIImagePNGRepresentation(myImage) bytes], [UIImagePNGRepresentation(myImage) length], NULL); } else { sqlite3_bind_blob(stmt, 12, nil, -1, NULL); } [webUrl release]; [myImage release]; } else { sqlite3_bind_blob(stmt, 12, nil, -1, NULL); //NSLog(@" ne dodajem sliku2"); } sqlite3_bind_int(stmt, 13, [[[newCategories objectAtIndex:i] valueForKey:@"id_comerc"] intValue]); sqlite3_bind_int(stmt, 14, [[[newCategories objectAtIndex:i] valueForKey:@"id_city"] intValue]); sqlite3_bind_int(stmt, 15, [[[newCategories objectAtIndex:i] valueForKey:@"placement"] intValue]); sqlite3_bind_int(stmt, 16, [[[newCategories objectAtIndex:i] valueForKey:@"type"] intValue]); sqlite3_bind_int(stmt, 17, [[[newCategories objectAtIndex:i] valueForKey:@"timestamp"] intValue]); sqlite3_bind_text(stmt, 18, [[[newCategories objectAtIndex:i] valueForKey:@"mail"] UTF8String], -1, NULL); } if (sqlite3_step(stmt) != SQLITE_DONE) { NSLog(@"%s", sqlite3_errmsg(database)); NSAssert1(0,@"nemogu updateat table %s", errorMsg); } else { NSLog(@"Ubacio %d",i); }sqlite3_finalize(stmt); What happens is that it starts to eat memory until it finaly quits... On memory warning i close and open database again, I have set cache size to 50 as mentioned in some posts here, and tried putting query into statement - same result.. it just garbles mamory and app quits after 300 inserts on iphone or somewhere around 900 inserts on iPad... Any help would be appreciated..

    Read the article

  • function to efficiently check a change of value in a nested hashmap

    - by zcaudate
    the motivation is for checking what has changed in a deeply nest map, kind of like a reverse of update-in. This is a simple example: (def p1 {:a {:a1 :1 :a2 :2} :b {:b1 :1 :b2 :2}}) (def p2 (update-in p1 [:a :a1] (constantly :updated)) ;; => {:a {:a1 :updated :a2 :2} ;; :b {:b1 :1 :b2 :2}} (what-changed? p1 p2) ;; => {:keys [:a :a1] :value :updated) (what-changed? p2 p1) ;; => {:keys [:a :a1] :value :2) I'm hoping that because clojure maps are persistent data-structures, there may be a smart algorithm to figure this out by looking at the underlying structure as opposed to walking through the nested maps and comparing the difference.

    Read the article

  • Windows development on a Mac Pro

    - by Frank
    Looking to do iphone, android, and possibly windows phone development on a Mac Pro. What are the pluses and minuses of using a Mac Pro and a dual boot. Unlike most, Windows 7 will be the primary OS since most supporting software will be done with Visual Studio 08/10 over the next year. I have found driver issues from a few years ago. Do any of these issues still exist?

    Read the article

  • Show or hide fields depending on the Acl9 role - Ruby on Rails

    - by Michaël
    Hi, I am using Acl9 to manage the roles and I want to hide the checkbox usertype if the user has the role :customer and show it if the role is :manager. I want that just the :manager can edit all the fields and some for the :customer. Thank you for your help! <h1>Editing user</h1> <% form_for(@user) do |f| %> <%= f.error_messages %> <p> <%= f.label :usertype %><br /> <%= f.check_box :usertype %> </p> <p> <%= f.label :surname %><br /> <%= f.text_field :surname %> </p> <p> <%= f.label :firstname %><br /> <%= f.text_field :firstname %> </p> <p> <%= f.label :phone %><br /> <%= f.text_field :phone %> </p> <p> <%= f.label :email %><br /> <%= f.text_field :email %> </p> <p> <%= f.label :registrationdate %><br /> <%= f.datetime_select :registrationdate %> </p> <p> <%= f.label :login %><br /> <%= f.text_field :login %> </p> <p> <%= f.label :password %><br /> <%= f.text_field :password %> </p> <p> <%= f.submit 'Update' %> </p> <% end %> <%= link_to 'Show', @user %> | <%= link_to 'Back', users_path %>

    Read the article

  • How can I write this shorter? c#

    - by nLL
    public static string GetUa(HttpRequest hr) { try { string visitorBrowser = hr.UserAgent.ToString(); string originalBrowser = hr.ServerVariables["X-OperaMini-Phone-UA"]; string anotherOriginalBrowser = hr.ServerVariables["X-Device-User-Agent"]; //novarra if (!String.IsNullOrEmpty(originalBrowser)) { return "OPERAMINI " + originalBrowser; } else { if (!String.IsNullOrEmpty(anotherOriginalBrowser)) { return "NOVARRA " + anotherOriginalBrowser; } else { return visitorBrowser; } } } catch { return "No UA Found"; } }

    Read the article

  • Comments for Function in Emacs

    - by Ryan
    I'm looking for a way to add comments for my functions in Emacs. Of course doxymacs is a nice candidate. But I prefer another way works without the necessary libs. Can anyone recommend some others ways for adding smart comments for functions in Emacs? Thanks. Edit: Now I found this: http://nschum.de/src/emacs/doc-mode/, but it seems that it does not work well after I require it into my .emacs and add hook for js-mode. Doesn't it support js functions ?

    Read the article

  • Get an iPad/iPhones unique information from your app?

    - by MikeN
    How do you get the unique identifying information from an iPhone/iPad within an app? For instance, I want my app to send support emails to my website for users who have problems and I need to uniquely identify the phone number/id of the device it is running on. Is this possible, forbidden?

    Read the article

  • What will happen if I change the type of a column from int to year?

    - by MachinationX
    I have a table in MySQL 4.0 which currently has a year field as a smallint(6) type. What will happen if I convert it directly to a Year type with a query like the following: ALTER TABLE t MODIFY y YEAR(4) NOT NULL DEFAULT CURRENT_TIMESTAMP; When the current members of column y have values like 2010? I assume that because the year type is technically values from 1-255, values above that will be truncated or broken. So if MySQL isn't smart enough to realize that 2010(int) = 110(year), what would be the simplest query or queries to convert the values? Thanks for your help!

    Read the article

  • iPhone xcode - Best way to control audio from several view controllers

    - by Are Refsdal
    Hi, I am pretty new to iPhone programming. I have a navBar with three views. I need to control audio from all of the views. I only want one audio stream to play at a time. I was thinking that it would be smart to let my AppDelegate have an instance of my audioplaying class and let the three other views use that instance to control the audio. My problem is that I don´t know how my views can use the audioplaying class in my AppDelegate. Is this the best approach and if so, how? Is there a better way?

    Read the article

  • Why I should use an N-Tier Approach When using an SqlDatasource is ALOT EASIER ?

    - by The_AlienCoder
    When it comes to web development I have always tried to work SMART not HARD. So for along time My Aproach to interacting with databases in my AspNet projects has been this : 1) Create my stored procedures 2) Drag an SQLDatasource control on my aspx page 3) Bind a DataList Control to my SQLDatasource 4) Insert, Update & Delete by using my Datalist or programmatically using built in SQLDatasource methods e.g MySqlDataSource.InsertParameters["author"].DefaultValue = TextBox1.Text; MySqlDataSource.Insert(); Recently however I got a relatively easy web project. So I decided to employ a 3-tier Model...But I got exhausted halfway and just didnt seem worth it ! It seemed like I was working too HARD for a project that could have been easily accomplished by a couple of SqlDataSource Controls. So Why Is the N-Tier Model better than my Approach? Has it anything to do with performance? What are the advantages of the ObjectDataSource control over the SqlDataSource Control?

    Read the article

  • How to pass data between controls and persist the values in WPF

    - by randyc
    I am stuck on how to pass data from one control to another. If I have a listbox control and the Contol Item contains a datatemplate which renders out 5 fields ( first name, last name, email, phone and DOB) all of which come from an observable collection. How can I allow the user to select a listbox item and have the valuesbe stored within a new listbox control? Is this done through the creation of a new collection or is there a more simple way to bind these values to a new control? thank you,

    Read the article

  • Network Differences

    - by Chris
    I am busy working on a java app to run on blackberries but on some devices i am testing on, the code does not seem to be working and im having a hard time pinpointing where the problem lies. My question is: Could the problem with some phones working and not working have t odo with the type of network they are running on such GSM vs CDMA and would the code that stops working on some devices be in one of the following areas: 1) Listeners - such as MessageListener and Phone Listener 2) UI Objects - simple test labels and buttons 3) Connection to a web service using ksoap2

    Read the article

  • Wordpress & Vanity User URLs

    - by st4ck0v3rfl0w
    Hi All, Was wondering if anyone had any smart approaches to creating dynamic vanity user urls upon user registration. My site basically uses emails as usernames. I have the regex to strip the text before the "@" symbol (e.g. "[email protected]" becomes "name") I would then like to take the "name" and create a vanity url (e.g. domain.com/name or name.domain.com) Any thoughts on how to accomplish this with Wordpress? I'm a pretty advanced Wordpress user and my first thoughts were to do the following Verify user registration Upon successful user registration create page name with username as the title (this would help me achieve the www.domain.com/username) Apply preset template to that page with the desired view Any and all thoughts are welcome.

    Read the article

  • mysql table creation problem..

    - by pradeep
    Hi, I have a small problem. I am creating an appointment table where in the foreign key is patient id which is referenced from patient table.This table is for all registered patients. there will be unregistered patients also, who will be seeking appointments.SO i just need to store the name,phone and few details. I don't want to make these 2 as different tables. So is there a way to skip the integrity check of foreign key when i ma inserting unregistered patient data

    Read the article

  • iphone app time counter

    - by Sam
    I would like to create a time counter in my app that shows the user how many minutes the app has been running the current session and total. How do I create such time counter and how do I save the value to the phone? I'm new to app developement.

    Read the article

  • telephone application programming on Linux

    - by Daniel Stevens
    I'm a Linux user looking to write a program which will pick up the phone, dial a number, play a recording and record what the person on the other end of the line says and save it to an audio file. I will want to use the modem that came with my computer if possible. What should I use to write this program?

    Read the article

  • Memory allocation in Linux

    - by Goofy
    Hello! I have a multi threaded application where I allocate buffers with data, which then wait in queues to be send via sockets. All buffers are reproducible because I use only buffers of fixed size in whole program (1024, 2048, 2080 and 5248 bytes). I noticed, that my program usually use up to 10 buffers of each length type at the same moment. So far I always manually allocate new buffer and then free it (using malloc() and free ()) where it's not needed any more. I started wondering if Linux is enough smart to cache this memory for me, so next time I allocate new buffer system only quickly receive a buffer I have already used before and not perform heavy operation of allocating new memory block?

    Read the article

  • Prevent log4net to send duplicate issues via SMTP

    - by jrEwing
    Hi, we have bridged our log4net with Jira using SMTP. Now we are worried that since the site is public what could happen to the Jira server if we get alot of issues in the production environment. We have already filtered on Critical and Fatal, but we want to see either some acumulator service on log4net or a plain filter which identifies repeating issues and prevents them from being sent via Email. Preferably without having to change the error reporting code, so a config solution would be best. I guess dumping the log into a db and then create a separate listener some smart code would be a (pricy) alternative.

    Read the article

  • How to send a business card to a mobile using C#?

    - by sourabh0612
    Is there any way to send a business card to a mobile phone using C#? I have an application in j2me which requires some set of data corresponding to some contacts so I want to send the business card of that contact via my server Business Card is a type of special sms which contains the contact details of any person

    Read the article

  • Django: common template subsections

    - by Parand
    What's a good way to handle commonly occurring subsections of templates? For example, there is a sub-header section that's used across 4 different pages. The pages are different enough to not work well with template inheritance (ie. "extends" doesn't fit well). Is "include" the recommended method here? It feels a bit heavyweight, requiring each subsection or snippet to be in its own file. Are there any performance issues in using include or is it smart about forming template from the subsections (ie. if I make extensive use of it, do I pay any penalties)? I think what I'm looking for is something like template tags, but without the programming - a simple way to create a library of html template tags I can sprinkle in other templates.

    Read the article

  • Using std::bad_alloc for C pointers

    - by otibom
    I'm using a library written in C in a C++ project. I'd like to use C++ exceptions to handle C errors. In particular, it would be nice to have an exception thrown if an allocation fails. I can do this in constructors of classes which hold C-style pointers to C structs : if (c_object == NULL) throw std::bad_alloc(); But if the class is responsible for several C objects they are no ways of free-ing all already allocated pointers since the destructor isn't called. I have a feeling I could use smart-pointers, but I don't have much experience with them. What's more, I have to have access to the original C pointers to use the C api properly. Is there an elegant solution to this ?

    Read the article

< Previous Page | 212 213 214 215 216 217 218 219 220 221 222 223  | Next Page >