Search Results

Search found 380 results on 16 pages for 'emil mp'.

Page 6/16 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Why doesen't it work to write this NSMutableArray to a plist?

    - by Emil
    edited. Hey, I am trying to write an NSMutableArray to a plist. The compiler does not show any errors, but it does not write to the plist anyway. I have tried this on a real device too, not just the Simulator. Basically, what this code does, is that when you click the accessoryView of a UITableViewCell, it gets the indexPath pressed, edits an NSMutableArray and tries to write that NSMutableArray to a plist. It then reloads the arrays mentioned (from multiple plists) and reloads the data in a UITableView from the arrays. Code: NSIndexPath *indexPath = [table indexPathForRowAtPoint:[[[event touchesForView:sender] anyObject] locationInView:table]]; [arrayFav removeObjectAtIndex:[arrayFav indexOfObject:[NSNumber numberWithInt:[[arraySub objectAtIndex:indexPath.row] intValue]]]]; NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *plistPath = [rootPath stringByAppendingPathComponent:@"arrayFav.plist"]; NSLog(@"%@ - %@", rootPath, plistPath); [arrayFav writeToFile:plistPath atomically:YES]; // Reloads data into the arrays [self loadDataFromPlists]; // Reloads data in tableView from arrays [tableFarts reloadData];

    Read the article

  • Storing Shell Output

    - by Emil Radoncik
    Hello everybody, I am trying to read the output of a shell command into a string buffer, the reading and adding the values is ok except for the fact that the added values are every second line in the shell output. for example, I have 10 rows od shell output and this code only stores the 1, 3, 5, 7, 9, row . Can anyone point out why i am not able to catch every row with this code ??? any suggestion or idea is welcomed :) import java.io.*; public class Linux { public static void main(String args[]) { try { StringBuffer s = new StringBuffer(); Process p = Runtime.getRuntime().exec("cat /proc/cpuinfo"); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); while (input.readLine() != null) { //System.out.println(line); s.append(input.readLine() + "\n"); } System.out.println(s.toString()); } catch (Exception err) { err.printStackTrace(); } } }

    Read the article

  • C# inheritance of fields

    - by Emil D
    This is probably a silly question, but here it goes.Imagine you have the following classes: public class C { } public class D : C { //A subclass of C } public class A { C argument; } Now, I want to have a class B, that inherits from A.This class would obviously inherit the "argument" field, but I wish to force the "argument" field in B to be of type D, rather than C.Since D inherits from C this shouldn't create any problems. So, how would achieve this in c# ?

    Read the article

  • NVP request - CreateRecurringPaymentsProfile

    - by jiwanje.mp
    Im facing problem with Trail period and first month payemnt. My requirement is users can signup with trial period which allow new users to have a 30 day free trial. This means they will not be charged the monthly price until after the first 30 days the regular amount will be charged to user. but the next billing date should be one month later the profile start date. but next billing data and profile start date shows same when i query by GetRecurringPaymentProfile? Please help me how can i send the Recurring bill payment for this functionality. Thanks in advance, jiwan

    Read the article

  • Zend Sessions problem with IE8

    - by Emil
    I'm running a Zend Framework powered website and it seems to have serious problems with sessions. I have a 5 step process where I save the form data in the session between the steps and then save it into the database on the last step. When we built the site sometimes the session just went away and forced us to restart. Now it seems to work again but recently we discovered an issue with Internet Explorer 8. It fails between step 2 - 3 and forgets the session. It works fine in IE6, IE7, FF, Chrome, Safari and even in my mobile web browser (SE P1). We're storing our sessions in the database and if I deactivate the session db handler it works. What's the difference between using the database and not using it for sessions? Do I loose something if I switch back? Bootstrap: /* Start session */ $saveHandler = new Zend_Session_SaveHandler_DbTable(array( 'name' => 'sessions', 'primary' => 'id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime' )); Zend_Session::rememberMe((int) $config->session->lifetime); $saveHandler->setLifetime((int) $config->session->lifetime) ->setOverrideLifetime(true); Zend_Session::setSaveHandler($saveHandler); Zend_Session::start(); and in my step controller $session = new Zend_Session_Namespace('wizard'); Then I'm just working with $session saving data in a stdClass in $session.

    Read the article

  • Tracking a Flash banner advert using clickTag and Google Analytics

    - by alistair.mp
    Hello. I'm trying to find out if there is a way of using clickTag and Google Analytics to track outgoing banner clicks. clickTag code: on (release) { if (clickTAG.substr(0,5) == "http:") { getURL(clickTAG); } } Maybe someone can tell me whether the following would work: on (release) { if (clickTAG.substr(0,5) == "http:") { getURL("javascript:pageTracker._trackPageview('/somebannerad');"); getURL(clickTAG); } } but I would ideally like a solution that worked with the standard clickTag code and didn't involve changing any code in the flash file. Anyone have any ideas? Thanks

    Read the article

  • Delphi low-level machine parameter access

    - by tonyhooley.mp
    There are many very low-level parameters measured by PCs and their processors (e.g. core temperatures, fan-speeds, voltage levels at various parts of the motherboard and processor internals) which are available and displayed by the BIOS, and by some aaplication programs. How does one access these low-level (real-time) data via Delphi? Is there a library? Is there a Windows API?

    Read the article

  • Cocoa giving error: <Error>: doClip: empty path.

    - by outtru.mp
    Coco gives error: Thu Jun 10 19:13:56 myComputer.local myApp[####] <Error>: doClip: empty path. But I don't have this function anywhere in my code (can't find by searching in frameworks / project)... Seems a lot of people complain about this because it goes into the console logs, but couldn't find any reason given as to what causes it on a progmatic level. Any thoughts as to what the problem is?

    Read the article

  • "Cannot find executable for CFBundle/CFPlugIn" error

    - by Emil
    Cannot find executable for CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) That's the error I get when I try to run this code: NSString *path = [[NSBundle mainBundle] pathForResource:[arraySubFarts objectAtIndex:indexPath.row] ofType:@"mp3"]; NSURL *file = [[NSURL alloc] initFileURLWithPath:path]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil]; self.player = player; [player prepareToPlay]; [player setDelegate:self]; [self.player play]; Any idea why? :S I have included the needed frameworks, and the code works great, the only thing is this odd Console-message..

    Read the article

  • html horizontal scrolling

    - by mp
    Hi, i have a simple css example, and i can't understand the behavior of one of my divs, when the horizontal scroll is displayed. so...when my browser window needs to display the horizontal scroll(when the window width is less than my div "content" width(1024px)), my div "footer" (that have the same "content's" parent and 100% width), seems to get an "extra blank space" on the right side. this space grows when I reduce the width of the window. any ideas about how can i get it off, or why it happens??thanks! heres my code: css: <style type="text/css"> html, body { height: 100%; width:100%; font-family:"Arial Black", Gadget, sans-serif; font-size:11px; font-variant:normal; } * { margin: 0; } .wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -4em; } #content{ width:1024px; margin:0px auto; background-color:#990; height:780px; } .footer, .push { height: 4em; width:100%; } #footer-content{ height:10px; background-color:#09F; width:100%; } </style> html: <body> <div class="wrapper"> <div id="content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam scelerisque varius tortor vitae pretium. Quisque magna ipsum, accumsan sit amet pretium sed, iaculis feugiat nibh. Donec vitae dui eros, eu ultricies nulla. Morbi aliquet, nisi in tincidunt rutrum, nisl justo sagittis nisi, nec dignissim orci elit vitae tortor. </p> </div> <div class="push"></div> </div> <div class="footer" style="background-color:#900; width:100%;"> <div id="footer-content"></div> </div> </body>

    Read the article

  • Monkeypatch a model in a rake task to use a method provided by a plugin?

    - by gduquesnay.mp
    During some recent refactoring we changed how our user avatars are stored not realizing that once deployed it would affect all the existing users. So now I'm trying to write a rake task to fix this by doing something like this. namespace :fix do desc "Create associated ImageAttachment using data in the Users photo fields" task :user_avatars => :environment do class User # Paperclip has_attached_file :photo ... <paperclip stuff, styles etc> end User.all.each do |user| i = ImageAttachment.new i.photo_url = user.photo.url user.image_attachments << i end end end When I try running that though I'm getting undefined method `has_attached_file' for User:Class I'm able to do this in script/console but it seems like it can't find the paperclip plugin's methods from a rake task.

    Read the article

  • 42 passed to TerminateProcess, sometimes GetExitCodeProcess returns 0

    - by Emil
    After I get a handle returned by CreateProcess, I call TerminateProcess, passing 42 for the process exit code. Then, I use WaitForSingleObject for the process to terminate, and finally I call GetExitCodeProcess. None of the function calls report errors. The child process is an infinite loop and does not terminate on its own. The problem is that sometimes GetExitCodeProcess returns 42 for the exit code (as it should) and sometimes it returns 0. Any idea why? #include <string> #include <sstream> #include <iostream> #include <assert.h> #include <windows.h> void check_call( bool result, char const * call ); #define CHECK_CALL(call) check_call(call,#call); int main( int argc, char const * argv[] ) { if( argc>1 ) { assert( !strcmp(argv[1],"inf") ); for(;;) { } } int err=0; for( int i=0; i!=200; ++i ) { STARTUPINFO sinfo; ZeroMemory(&sinfo,sizeof(STARTUPINFO)); sinfo.cb=sizeof(STARTUPINFO); PROCESS_INFORMATION pe; char cmd_line[32768]; strcat(strcpy(cmd_line,argv[0])," inf"); CHECK_CALL((CreateProcess(0,cmd_line,0,0,TRUE,0,0,0,&sinfo,&pe)!=0)); CHECK_CALL((CloseHandle(pe.hThread)!=0)); CHECK_CALL((TerminateProcess(pe.hProcess,42)!=0)); CHECK_CALL((WaitForSingleObject(pe.hProcess,INFINITE)==WAIT_OBJECT_0)); DWORD ec=0; CHECK_CALL((GetExitCodeProcess(pe.hProcess,&ec)!=0)); CHECK_CALL((CloseHandle(pe.hProcess)!=0)); err += (ec!=42); } std::cout << err; return 0; } std::string get_last_error_str( DWORD err ) { std::ostringstream s; s << err; LPVOID lpMsgBuf=0; if( FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, 0, err, MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), (LPSTR)&lpMsgBuf, 0, 0) ) { assert(lpMsgBuf!=0); std::string msg; try { std::string((LPCSTR)lpMsgBuf).swap(msg); } catch( ... ) { } LocalFree(lpMsgBuf); if( !msg.empty() && msg[msg.size()-1]=='\n' ) msg.resize(msg.size()-1); if( !msg.empty() && msg[msg.size()-1]=='\r' ) msg.resize(msg.size()-1); s << ", \"" << msg << '"'; } return s.str(); } void check_call( bool result, char const * call ) { assert(call && *call); if( !result ) { std::cerr << call << " failed.\nGetLastError:" << get_last_error_str(GetLastError()) << std::endl; exit(2); } }

    Read the article

  • Need help understanding _set_security_error_handler()

    - by Emil D
    So , I've been reading this article: http://msdn.microsoft.com/en-us/library/aa290051%28VS.71%29.aspx And I would like to define my custom handler.However, I'm not sure I understand the mechanics well.What happens after a call is made to the user-defined function ( e.g. the argument of _set_security_error_handler() ) ? Does the program still terminate afterward ? If that is the case, is it possible to terminate only the current thread(assuming that it is not the main thread of the application).AFAIK, each thread has its own stack , so if the stack of a thread gets corrupted, the rest of the application shouldn't be affected. Finally, if it is indeed possible to only terminate the current thread of execution, what potential problems could such an action cause? I'm trying to do all this inside an unmanaged C++ dll that I would like to use in my C# code.

    Read the article

  • Why is memory management so visible in Java VM?

    - by Emil
    I'm playing around with writing some simple Spring-based web apps and deploying them to Tomcat. Almost immediately, I run into the need to customize the Tomcat's JVM settings with -XX:MaxPermSize (and -Xmx and -Xms); without this, the server easily runs out of PermGen space. Why is this such an issue for Java VMs compared to other garbage collected languages? Comparing counts of "tune X memory usage" for X in Java, Ruby, Perl and Python, shows that Java has easily an order of magnitude more hits in Google than the other languages combined. I'd also be interested in references to technical papers/blog-posts/etc explaining design choices behind JVM GC implementations, across different JVMs or compared to other interpreted language VMs (e.g. comparing Sun or IBM JVM to Parrot). Are there technical reasons why JVM users still have to deal with non-auto-tuning heap/permgen sizes?

    Read the article

  • How do you implement an MPVolumeView?

    - by Emil
    Hey! I want the user to be able to change the system volume with a slider, and I realized the only way to do this is with an MPVolumeView. But I can't find any example code for it, and every method I try to implement won't show up. So what is the easiest and correct, working way of implementing a MPVolumeView?

    Read the article

  • containsObject - why doesen't this work?

    - by Emil
    Hi. I have an array that I am trying to check wether or not an indexPath(.row) exists in. I use this code: if ([array containsObject:[NSNumber numberWithInt:indexPath.row]]){ NSLog(@"Yep, it exists in there."); } the array consist of the numbers 3, 8 and 2. The index path loads numbers fromm 0 to 8 in a loop. Can anybody see why this doesen't work?

    Read the article

  • Get Object ID of UI element from code.

    - by andoriyu.mp
    I'm trying link 40 buttons to one event handler method and then do the processing work from one method instead of 40. I know how to link it but once I get there I don't know how to distinguish what button was pressed. Does anyone know how to reference the button object sender id or is there another way to solve this problem? Any help would be greatly appreciated.

    Read the article

  • Why is this leaking memory? UIImage `cellForRowAtIndexPath:`

    - by Emil
    Hey. Instruments' Leaks tells me that this UIImage is leaking: UIImage *image = [[UIImage alloc] initWithContentsOfFile:[imagesPath stringByAppendingPathComponent:[NSString stringWithFormat:@"/%@.png", [postsArrayID objectAtIndex:indexPath.row]]]]; // If image contains anything, set cellImage to image. If image is empty, try one more time or use noImage.png, set in IB if (image != nil){ // If image != nil, set cellImage to that image cell.cellImage.image = image; } image = nil; [image release]; (class cell (custom table view cell) also releases cellImage in dealloc method). I haven't got a clue of why it's leaking, but it certainly is. The images gets loaded multiple times in a cellForRowAtIndexPath:-method. The first three cells' image does not leak (130px high, all the space avaliable). Leaks gives me no other info than that a UIImage allocated here in the code leaks. Can you help me figure it out? Thanks :)

    Read the article

  • multiple ajax requests with jquery

    - by Emil
    I got problems with the async nature of Javascript / JQuery. Lets say the following (no latency is counted for, in order to not make it so troublesome); I got three buttons (A, B, C) on a page, each of the buttons adds an item into a shopping cart with one ajax-request each. If I put an intentional delay of 5 seconds in the serverside script (PHP) and pushes the buttons with 1 second apart, I want the result to be the following: Request A, 5 seconds Request B, 6 seconds Request C, 7 seconds However, the result is like this Request A, 5 seconds Request B, 10 seconds Request C, 15 seconds This have to mean that the requests are queued and not run simultaneously, right? Isnt this opposite to what async is? I also tried to add a random get-parameter to the url in order to force some uniqueness to the request, no luck though. I did read a little about this. If you avoid using the same "request object (?)" this problem wont occure. Is it possible to force this behaviour in JQuery? This is the code that I am using $.ajax( { url : strAjaxUrl + '?random=' + Math.floor(Math.random()*9999999999), data : 'ajax=add-to-cart&product=' + product, type : 'GET', success : function(responseData) { // update ui }, error : function(responseData) { // show error } }); I also tried both GET and POST, no difference. I want the requests to be sent right when the button is clicked, not when the previous request is finnished. I want the requests to be run simultaneously, not in a queue.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >