Daily Archives

Articles indexed Wednesday April 28 2010

Page 27/119 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • delete in tableView..

    - by totato
    I just add this methods in .h file : - (IBAction)EditTable:(id)sender; - (IBAction)DeleteButtonAction:(id)sender; and in .m file : (IBAction)DeleteButtonAction:(id)sender{ [tableList removeLastObject]; [Table reloadData]; } (IBAction) EditTable:(id)sender{ if(self.editing) { [super setEditing:NO animated:NO]; [Table setEditing:NO animated:NO]; [Table reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Edit"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStylePlain]; } else { [super setEditing:YES animated:YES]; [Table setEditing:YES animated:YES]; [Table reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Done"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStyleDone]; } } when I run the program and click the delete button (red button) the program is stop ! whats the problem ? please any help ?

    Read the article

  • Transforming a string to a valid PDO_MYSQL DSN

    - by Alix Axel
    What is the most concise way to transform a string in the following format: mysql:[/[/]][user[:pass]@]host[:port]/db[/] Into a usuable PDO connection/instance (using the PDO_MYSQL DSN), some possible examples: $conn = new PDO('mysql:host=host;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user', 'pass'); I've been trying some regular expressions (preg_[match|split|replace]) but they either don't work or are too complex, my gut tells me this is not the way to go but nothing else comes to my mind. Any suggestions?

    Read the article

  • Configure Rails app to retrieve ALL emails from inbox

    - by Kartik Rao
    I'm using the following code to retrieve emails from my Gmail inbox. def get_mail Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE) Net::POP3.start('pop.gmail.com', 995, "uname","pass") do |pop| unless pop.mails.empty? pop.each_mail do |mail| email = TMail::Mail.parse(mail.pop) email_obj=EmailedQueries.new email_obj.save_email(email.from,email.subject,email.body_html) end end end end This works just fine, but it retrieves only new mails from the inbox. Instead, I want a seperate function that will retrieve ALL emails from the inbox. This function will be used rarely. I wont be retrieving all mails all the time. Only when necessary. Thanks!

    Read the article

  • Selecting random top 3 listings per shop for a range of active advertising shops

    - by GraGra33
    I’m trying to display a list of shops each with 3 random items from their shop, if they have 3 or more listings, that are actively advertising. I have 3 tables: one for the shops – “Shops”, one for the listings – “Listings” and one that tracks active advertisers – “AdShops”. Using the below statement, the listings returned are random however I’m not getting exactly 3 listings (rows) returned per shop. SELECT AdShops.ID, Shops.url, Shops.image_url, Shops.user_name AS shop_name, Shops.title, L.listing_id AS listing_id, L.title AS listing_title, L.price as price, L.image_url AS listing_image_url, L.url AS listing_url FROM AdShops INNER JOIN Shops ON AdShops.user_id = Shops.user_id INNER JOIN Listings AS L ON Shops.user_id = L.user_id WHERE (Shops.is_vacation = 0 AND Shops.listing_count > 2 AND L.listing_id IN (SELECT TOP 3 L2.listing_id FROM Listings AS L2 WHERE L2.listing_id IN (SELECT TOP 100 PERCENT L3.listing_id FROM Listings AS L3 WHERE (L3.user_id = L.user_id) ) ORDER BY NEWID() ) ) ORDER BY Shops.shop_name I’m stumped. Anyone have any ideas on how to fix it? The ideal solution would be one record per store with the 3 listings (and associated data) were in columns and not rows – is this possible?

    Read the article

  • fftw in Visual Studio?

    - by drhorrible
    I'm trying to link my project with fftw and so far, I've gotten it to compile, but not link. As the site said, I generated all the .lib files (even though I'm only using double precision), and copied them to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib, the .h file to C:\Program Files\Microsoft Visual Studio 9.0\VC\include and the .dll to C:\windows\system32. I've copied the tutorial program, and the exact error I am getting is: 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_free referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_destroy_plan referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_execute referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_plan_dft_1d referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_malloc referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) So, what could be wrong with my project setup? Thanks!

    Read the article

  • How to upgrade a VB6 app with .NET components

    - by Craig Johnston
    I want to make a change to a VB6 app which consists of a .EXE, no VB6 DLLs but a handful of .NET DLLs. The interop is achieved by a one of the .NET dlls being referenced by the VB6 app which seems to require REGASM-ing of an associated .tlb file. If I want to change only the VB6 app .exe, could I just compile it and drop it into the app folder on existing installations or are there going to be binding issues?

    Read the article

  • Need help in Architecture design in java

    - by palakolanusrinu
    Can anyone help in architecture design of one of my complex application. Requirement : In web based application, we need to generate Excel kind of report as HTML page and after that we need to perform different kinds of operations like Add manual rows Delete rows Edit rows adding comments based on each cell viewing the added comments. attaching the file based on each cell viewing the attached file. Collapsible functionality for some of rows In the process of design we have come up with DB design and application framework is Spring. and for Web not yet finalized. what is the best approach to implement this kind of UI? --JSF?(keep in mind we need to Excel operations like above mentioned operations) -- Any reporting tool which will provide editing functionality? Please suggest me How can we do it? and what is the best technology for it? or is there any reporting tools?

    Read the article

  • Why is floating point byte swapping different from integer byte swapping?

    - by CJ
    I have a binary file of doubles that I need to load using C++. However, my problem is that it was written in big-endian format but the fstream operator will then read the number wrong because my machine is little-endian. It seems like a simple problem to resolve for integers, but for doubles and floats the solutions I have found won't work. How can I (or should I) fix this? I read this as a reference for integer byte swapping: http://stackoverflow.com/questions/105252/how-do-i-convert-between-big-endian-and-little-endian-values-in-c

    Read the article

  • SubSonic generated code and always filtering records

    - by cmroanirgo
    Hi, I have a table called "Users" that has a column called "deleted", a boolean indicating that the user is "Deleted" from the system (without actually deleting it, of course). I also have a lot of tables that have a FK to the Users.user_id column. Subsonic generates (very nicely) the code for all the foreign keys in a similar manner: public IQueryable<person> user { get { var repo=user.GetRepo(); return from items in repo.GetAll() where items.user_id == _user_id select items; } } Whilst this is good and all, is there a way to generate the code in such a way to always filter out the "Deleted" users too? In the office here, the only suggestion we can think of is to use a partial class and extend it. This is obviously a pain when there are lots and lots of classes using the User table, not to mention the fact that it's easy to inadvertently use the wrong property (User vs ActiveUser in this example): public IQueryable<User> ActiveUser { get { var repo=User.GetRepo(); return from items in repo.GetAll() where items.user_id == _user_id and items.deleted == 0 select items; } } Any ideas?

    Read the article

  • Android color picker - updating color array

    - by zorglub76
    Hi all, I'm trying to create a color picker for Android that looks like a minimalistic version of Gimp's. So, it has a hue slider and a rectangle with saturation/value variants of a color chosen in hue slider. Question: what is the best way to create the rectangle? Right now, I'm creating an 200x200 array of pixels, but it takes ~5sec to create and display rectangle with that array. And I need colors in rectangle to change whenever I change the value in hue slider... Rectangle is bitmap, btw. Can I use color matrices on that and how? Any examples? Thanks in advance!

    Read the article

  • Clock battery broken on Solaris - how to workaround until I can fix the battery

    - by weismat
    My main Solaris server has an issue with its battery and thus I loose around 20 seconds per day. Currently I am using rdate once in the morning to synchronise the time. Which approach should I use until I can change the battery on a weekend? Should I switch from rdate to ntp? The machine runs plenty of cronjobs and thus I need to ensure that everything is started even when the time is changed.

    Read the article

  • Read only bind-mount?

    - by depesz
    I use mount -o bind to mount directories inside chroots, which works really well. The problem is that I'd like some of these bind-mounted directories to be read only in chroot. Is it possible? If not - any other way to achieve it? I was thinking about using NFS for localhost mounts, but it looks like overkill.

    Read the article

  • .NET TCPListener limitation ?

    - by Karnalta
    Hi all, I have a question about the usage of TCPListener in .NET... I am thinking about a client/server application and being new to this kind of application I have search a bit around the web and the solution which come the more often is to create a new thread for each new client connection. This solution seem fine but I was wondering if it was still usable with a application where you can have thousands of client at the same time ? Of course if there is thousands of client the application will not be hosted on a small desktop but on a real server, but is it the way to design an application for a large number of client ? Thank for help.

    Read the article

  • Efficient data structure for fast random access, search, insertion and deletion

    - by Leonel
    I'm looking for a data structure (or structures) that would allow me keep me an ordered list of integers, no duplicates, with indexes and values in the same range. I need four main operations to be efficient, in rough order of importance: taking the value from a given index finding the index of a given value inserting a value at a given index deleting a value at a given index Using an array I have 1 at O(1), but 2 is O(N) and insertion and deletions are expensive (O(N) as well, I believe). A Linked List has O(1) insertion and deletion (once you have the node), but 1 and 2 are O(N) thus negating the gains. I tried keeping two arrays a[index]=value and b[value]=index, which turn 1 and 2 into O(1) but turn 3 and 4 into even more costly operations. Is there a data structure better suited for this?

    Read the article

  • SQL Alias as Table.column

    - by bakerjr
    hi, is it possible to alias an aggregate function in a select clause as AliasTable.AliasColumn? The reason is because I want minimum modifications in my arrays (I'm using PHP). Thanks! P.S. I'm using SQl Server 2008

    Read the article

  • Reading from an embedded resource stream

    - by shadeMe
    I've been trying to access an image resource named "IndexPointer.jpg" in an embedded RESX file called "Images.resx". GetManifestResourceNames() returns a single value - SCtor.Images.resources". Assembly::GetExecutingAssembly()-GetManifestResourceStream("SCtor.Images.resources.IndexPointer.jpg") only returns a nullptr. Obviously, I've got the manifest name wrong. What would be the correct one ?

    Read the article

  • Event handler triggered twice instead of once

    - by kwokwai
    Hi all, I am sorry that I have asked two questions in a few minutes. In a html file, I got three child DIV tags in a parent DIV tag: <div id="container"> <div id="frag-123">123</div> <div id="frag-124">124</div> <div id="frag-125">125</div> </div> Now when I click either the three child DIV tags, I will see two alert boxes pop up instead of one: The first alert box will show something like this: frag-123, and the second alert box will show something like this: container I dont know why. I just want to get the ID value of a child DIV, not the one from the parent DIV. <script> $(function() { $("div").click(function() { var imgID = this.id; alert(imgID); }); }); </script> Please help.

    Read the article

  • Fault address when malloc/free pthread_t across threads

    - by scleung
    Fault address occurred when i malloc pthread_t to save a newly created thread id and free it in another thread. Codes as follows: typedef struct _TaskInfo { // int dummy_int; pthread_t tid; } TaskInfo; void* dummy_task(void* pArg) { free(pArg); return NULL; } void create_task() { TaskInfo *pInfo; pthread_attr_t attr; // set detached state stuff ... pInfo = (TaskInfo*) malloc(sizeof(TaskInfo)); pthread_create(&pInfo->tid, &attr, dummy_task, pInfo); // destroy pthread attribute stuff ... } int main() { int i; while(i < 10000) { create_task(); ++i; } return 0; } When I uncomment the member dummy_int of TaskInfo it sometimes ran successfully, but sometimes failed. My platform is VMWare + Ubuntu 9.10 + ndk r3 Thanks!

    Read the article

  • Problem with generic list and extension method(C#3.0)

    - by Newbie
    I have an issue. I am making an extension class for a Collection and it is generic.. like public static class ListExtensions { public static ICollection<T> Search<T>(this ICollection<T> collection, string stringToSearch) { ICollection<T> t1=null; foreach (T t in collection) { Type k = t.GetType(); PropertyInfo pi = k.GetProperty("Name"); if (pi.GetValue(t,null).Equals(stringToSearch)) { t1.Add(t); } } return t1; } } But I cannot add items to t1 as it is declared null. Error: object reference not set to an instance of the object. I am calling the method like List<TestClass> listTC = new List<TestClass>(); listTC.Add(new TestClass { Name = "Ishu", Age = 21 }); listTC.Add(new TestClass { Name = "Vivek", Age = 40 }); listTC.Add(new TestClass { Name = "some one else", Age = 12 }); listTC.Search("Ishu"); And the test class is public class TestClass { public string Name { get; set; } public int Age { get; set; } } Using : (C#3.0) & Framework - 3.5 Thanks

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >