Daily Archives

Articles indexed Thursday April 22 2010

Page 8/123 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Emailing HTML from within an iPhone app is stopping at special characters

    - by user141146
    Hi, I have an iPhone app that will let users email some pre-determined text as HTML. I'm having a problem in that if the text contains special characters within the text (e.g., ampersand &, , <), the NSString variable that I use for sending the body of the email gets truncated at the special character. I'm not sure how to fix this (I tried using the method stringByAddingPercentEscapesUsingEncoding…but this hasn't fixed the problems). Thoughts on what I'm doing wrong / how to fix it? Here is sample code showing what I'm trying to do Thanks!!! - (void)send_an_email:(id)sender { NSString *subject_string = [NSString stringWithFormat:@"Summary of %@", commercial_name]; NSString *body_string = [NSString stringWithFormat:@"%@<br /><br />", [self.dl email_message]]; // email_message returns the body of text that should be shipped as html. If email_message contains special characters, the text truncates at the special character NSString *full_string = [NSString stringWithFormat:@"mailto:?to=&subject=%@&body=%@", [subject_string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [body_string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; [[UIApplication sharedApplication] openURL:[[NSURL alloc] initWithString:full_string]]; }

    Read the article

  • simplify a preload image function in jQuery

    - by robertdd
    after i spent 2 day searching a preload function in jQueryi with no succes, i manage to do this: after i upload the image on server, in a list i get this: <li id="upimagesDYGONI"> <div class="percentage">100%</div> <div class="uploadifyProgress"> <div align=" center" class="uploadifyProgressBar" id="upimagesDYGONIProgressBar" style="width: 100%;"> <!--Progress Bar--> </div> </div> </li> with this function, i preload the image: $.getlastimage = function(id) { $.getJSON('operations.php', {'operation':'getli', 'id':id,}, function(lastimg){ $("#upimages" + id + " .percentage").text('processing'); $("#upimages" + id).append('<a href=""><img id="' + id + '" src="" alt="" /></a>') .parent().attr({"href":"uploads/"+ lastimg +'?'+ (new Date()).getTime()}); $("#"+id).hide().attr({"src":"uploads/"+ lastimg +'?'+ (new Date()).getTime(), "alt":lastimg}) .load(function() { $(this).show(); $("#upimages" + id + " .percentage").remove(); $("#upimages" + id + " .uploadifyProgress").remove(); }); }); } })(jQuery) and i get this: <li id="upimagesLRBHYN" style="" class=""> <a href="uploads/0002.jpg?1271901177027"> <img alt="0002.jpg" src="uploads/0002.jpg?1271901177028" id="LRBHYN" style="display: block;"> </a> </li> how i can simplify the function? i want to use the full power of jQuery!! any idea?

    Read the article

  • Why does my simple strict XHTML file give errors when I include jquery?

    - by Colen
    I'm trying to make a simple strict HTML file that includes jquery: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Test File</title> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> </head> <body> </body> </html> But Firefox displays the following errors in the error console when I try to load it: Error: d.style is undefined Source File: http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js Line: 33 Error: jQuery is not defined Source File: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js Line: 19 Help! I don't understand :(

    Read the article

  • Android: Conversion to Dalvik format failed: Unable to execute dex: null

    - by Adam Haile
    I'm trying to use the SmugFig SmugMug API on Android. It was designed for J2SE I would imagine, so I'm not sure it will even work on Android, but I figured it was worth trying as opposed to trying to create my own API. When I load the project though, I get the following error: Conversion to Dalvik format failed: Unable to execute dex: null It doesn't say what package it fails on, just "Android Packaging Problem", but it did not do this before I added SmugFig and it's dependency JARS to the build path. Where should I look? Or does this mainly me that it just won't work with those libraries?

    Read the article

  • data path (travel) of tcp data from "write" syscall downto I/O registers programming

    - by osgx
    Hello Is there a good overview of tcp data path in Linux (2.6, not 2.4 if the path actually differ)? Where is a packet on different stages of tcp/ip stack handling? How packet is packed to tcp segment, then ip packet. How it is transmitted to network card? (with series of I/O regs write and DMA?) Is it transmitted to network card in the "write" syscall handler (with some deep callstack) or is it transmitted at some other moment?

    Read the article

  • How to prefix a positive number with plus sign in PHP

    - by user318466
    I need to design a function to return negative numbers unchanged but should add a + sign at the start of the number if its already no present. Example: Input Output ---------------- +1 +1 1 +1 -1 -1 It will get only numeric input. function formatNum($num) { # something here..perhaps a regex? } This function is going to be called several times in echo/print so the quicker the better.

    Read the article

  • Is there a way to debug ASP.NET MVC code using a symbol server (instead of downloading the source an

    - by Pure.Krome
    Hi folks, Is it possible to step through the official ASP.NET MVC 2 code via using the Symbol Server thingy in visual studio 2010? I know I can download the full open source MVC code from codeplex, build it and then get my code to reference THAT codebase dll's... But i'm wondering if this could be achieved by using the Symbol Server stuff instead? If so, can someone go through some steps please, about how to achieve this?

    Read the article

  • Reading/writing from named pipes under mono/Linux

    - by weismat
    I would like to read/write from a named pipe/FIFo queue under Linux. I have tried the standard classes StreamWriter and other classes from System.IO, but it fails because it is using seek. Has anyone ever written/read from a named pipe using Mono?. I am managing to read and write - but not the same time...

    Read the article

  • Electronic Postage provider compatible with Microsoft Word Mail Merge

    - by theguy
    We're looking for an e-postage provider that is capable of working with the Mail Merge function in Microsoft Word 2007. Every now and then we extract addresses from our database to mail letters or notices. We use Mail Merge in Word 2007 to print the address information straight to the envelopes and then run all the envelopes through a Pitney Bowes Postage Meter. It would save us a huge step if we could somehow get an e-postage provider where we can just print out the postage straight to the envelopes along with the addresses at the same time. Anyone know of such a provider or a better solution?

    Read the article

  • verify cert with certutil.exe

    - by Michal
    Hi, I have stupid problem, what is correct syntax on verify certificate in certificate store with certutil.exe. I have client certificate in cerstore. I try this: certutil.exe -verify CertCommonName but in finish with this error : DecodeFile returned The system cannot find the file specified. 0x80070002 (WIN32 : 2) LoadCert(Cert) returned The system cannot find the file specified. 0x80070002 (W IN32: 2) CertUtil: -verify command FAILED: 0x80070002 (WIN32: 2) CertUtil: The system cannot find the file specified. When I ping certutil.exe -ping it connect to pc.

    Read the article

  • Using variables inside macros in SQL

    - by Tim
    Hello I'm wanting to use variables inside my macro SQL on Teradata. I thought I could do something like the following: REPLACE MACRO DbName.MyMacro ( MacroNm VARCHAR(50) ) AS ( /* Variable to store last time the macro was run */ DECLARE V_LAST_RUN_DATE TIMESTAMP; /* Get last run date and store in V_LAST_RUN_DATE */ SELECT LastDate INTO V_LAST_RUN_DATE FROM DbName.RunLog WHERE MacroNm = :MacroNm; /* Update the last run date to now and save the old date in history */ EXECUTE MACRO DbName.RunLogUpdater( :MacroNm ,V_LAST_RUN_DATE ,CURRENT_TIMESTAMP ); ); However, that didn't work, so I thought of this instead: REPLACE MACRO DbName.MyMacro ( MacroNm VARCHAR(50) ) AS ( /* Variable to store last time the macro was run */ CREATE VOLATILE TABLE MacroVars AS ( SELECT LastDate AS V_LAST_RUN_DATE FROM DbName.RunLog WHERE MacroNm = :MacroNm; ) WITH DATA ON COMMIT PRESERVE ROWS; /* Update the last run date to now and save the old date in history */ EXECUTE MACRO DbName.RunLogUpdater( :MacroNm ,SELECT V_LAST_RUN_DATE FROM MacroVars ,CURRENT_TIMESTAMP ); ); I can do what I'm looking for with a Stored Procedure, however I want to avoid for performance. Do you have any ideas about this? Is there anything else I can try? Cheers Tim

    Read the article

  • Change .NET Framework version of application pool to 3.5?

    - by Sean Sexton
    I've installed .NET Framework 3.5 SP1 on web server (Server 2008 Enterprise), so running IIS 7.0. I want to change the version of .NET Framework used by an existing site. So I right-click on appropriate Application Pool and selected Edit Application Pool. The .NET Framework dropdown does not include an explicit entry for framework 3.5, but just 2.0.50727. Does anyone know off the top of their head--is this just because the version of the core RTL in 3.5 is still 2.0? Or do I need to do something additional to get IIS to see version 3.5? (Did try restarting IIS). Thanks!

    Read the article

  • Scope of controls inside Silverlight XAML

    - by synergetic
    I have defined a textbox with x:Name="txtMyTextBox" inside UserControl called MyView. I've noticed that I can do the following: MyView myView = new MyView(); myView.txtMyTextBox.Text = "something"; Why txtMyTextBox is accessible that way? Is it public or internal field? Can I make it private?

    Read the article

  • CSS for toolbar with UI Slider centered between left and right buttons

    - by Tauren
    I'm attempting to create a 100% width toolbar. This toolbar needs to have a variable number of buttons aligned to the left side, as well as a variable number of buttons aligned to the right. That's the easy part. But now I want to put a jQuery UI slider in the center that takes up the full remaining space between the buttons on the left and the buttons on the right. I'm having troubles figuring out a pure-CSS way of doing this. I've tried something like below, but I really don't want to have fixed percentage widths. If there is only one button on the left and one on the right, then I want the centered slider to take the full space between them, not just 33% of the full width. .toolbar {width: 100%;} .toolbar .toolbar-left {float: left;width: 33%;} .toolbar .toolbar-right {float: right;width: 33%;} .toolbar .toolbar-center {margin: 0 auto;width: 33%;} I'm using UI Buttons for my buttons and styling -- see an example. In that example, there is a toolbar that is the full width of the page. Imagine the two right most sets of buttons being aligned to the right of the toolbar. Then in the middle empty space, I want to put a UI Slider, and use all the space between buttons (minus some padding). Is there a way to do this with CSS, or will I need to whip up some javascript to position things properly?

    Read the article

  • Custom UITableViewCell changing indexPath While Scrolling ?

    - by Chris
    I have a custom UITableViewCell which I created in Interface Builder. I am successfully Dequeuing cells, but as I scroll, the cells appear to begin calling different indexPaths. In this example, I am feeding the current indexPath.section and indexPath.row into the customCellLabel. As I scroll the table up and down, some of the cells will change. The numbers can be all over the place, but the cells are not skipping around visually. If I comment out the if(cell==nil), then the problem goes away. If I use a standard cell, the problem goes away. Ideas why this might be happening? // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"CalendarEventCell"]; if (cell == nil) { NSLog(@"Creating New Cell !!!!!"); NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CalendarEventCell" owner:self options:nil]; cell = (UITableViewCell *)[nib objectAtIndex:0]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } // Set up the cell... [customCellLabel setText:[NSString stringWithFormat:@"%d - %d",indexPath.section, indexPath.row]]; return cell; }

    Read the article

  • How to programmatically fill a database

    - by Dwaine Bailey
    Hi There, I currently have an iPhone app that reads data from an external XML file at start-up, and then writes this data to the database (it only reads/writes data that the user's app has not seen before, though) My concern is that there is going to be a back catalogue of data of several years, and that the first time the user runs the app it will have to read this in and be atrociously slow. Our proposed solution is to include this data "pre-built" into the applications database, so that it doesn't have to load in the archival data on first-load - that is already in the app when they purchase it. My question is whether there is a way to automatically populate this data with data from, say, an XML file or something. The database is in SQLite. I would populate it by hand, but obviously this will take a very long time, so I was just wondering if anybody had a more...programmatic solution...

    Read the article

  • AVAudioRecorder Won't Record On Device

    - by Dyldo42
    This is my method: -(void) playOrRecord:(UIButton *)sender { if (playBool == YES) { NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&error]; [player setNumberOfLoops:0]; [player play]; } else if (playBool == NO) { if ([recorder isRecording]) { [recorder stop]; [nowRecording setImage:[UIImage imageNamed:@"NormalNormal.png"] forState:UIControlStateNormal]; [nowRecording setImage:[UIImage imageNamed:@"NormalSelected.png"] forState:UIControlStateSelected]; } if (nowRecording == sender) { nowRecording = nil; return; } nowRecording = sender; NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; [sender setImage:[UIImage imageNamed:@"RecordingNormal.png"] forState:UIControlStateNormal]; [sender setImage:[UIImage imageNamed:@"RecordingSelected.png"] forState:UIControlStateSelected]; recorder = [[AVAudioRecorder alloc] initWithURL:fileUrl settings:recordSettings error:&error]; [recorder record]; } } Most of it is self explanatory; playBool is a BOOL that is YES when it is in play mode. Everything works in the simulator however, when I run it on a device, [recorder record] returns NO. Does anyone have a clue as to why this is happening?

    Read the article

  • RenderAction in an HtmlHelperExtension Method?

    - by TimLeung
    I am trying to call the RenderAction Extension Method within my own Html Helper: System.Web.Mvc.Html.ChildActionExtensions.RenderAction(helper, "account", "login"); this is so that along with some additional logic, I would like all html helpers to use a common method name structure when calling it on the view: <%= Html.CompanyName().RenderAccount() %> but the problem I am having is that, asp.net will complain about not finding the actual route it needs to process. It does not take in the parameters of "controller" to be used as the action and "login" to be used as the action. It seems to only reference the current route. Any ideas how I can package up the RenderAction?

    Read the article

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