Daily Archives

Articles indexed Friday May 7 2010

Page 16/110 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Creating an mailto: URL with a URL in the body iPhone SDK

    - by Sjakelien
    UPDATE: I just found a similar post here: http://stackoverflow.com/questions/730101/how-do-i-encode-in-a-url-in-an-html-attribute-value Please consider the code below: I try to send an email message from within my iPhone app. The problem I encounter is that I want to put a URL in the body of the email. This URL contains two ampersands. I am encoding all the strings using "stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding", but the URL ends up in my new mail messagd truncated after the first ampersand. IE: "http://www.mydomain.nl/?cm=79&ctime=1246572000&cid=4772" becomes "http://www.mydomain.nl/?cm=79". Any suggestion what I could do to escape? NSString *eMailSubject = @"My Subject"; NSString *encodedSubject = [[NSString alloc] initWithString:[eMailSubject stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSString *eMailBody = @"http://www.mydomain.nl?cm=79&ctime=1246572000&cid=4772"; NSString *encodedBody = [[NSString alloc] initWithString:[eMailBody stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSString *urlString = [[NSString alloc] initWithString:[NSString stringWithFormat:@"mailto:?subject=%@&body=%@", encodedSubject, encodedBody]]; NSString *encodedURL = [[NSString alloc] initWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSURL *url = [[NSURL alloc] initWithString:encodedURL]; [[UIApplication sharedApplication] openURL:url];

    Read the article

  • How can I move TinyMCE's toolbar into a modal popup?

    - by Nate Wagar
    I'm using TinyMCE & jQuery and am having a problem moving TinyMCE's external toolbar to another location in the DOM. To further complicate things, there are multiple TinyMCE instances on the page. I only want the toolbar for the one that's currently being edited. Here's some sample code: $(textarea).tinymce({ setup: function(ed) {setupMCEToolbar(ed, componentID, displaySettingsPane)} ,script_url: '/clubs/data/shared/scripts/tiny_mce/tiny_mce.js' ,theme : "advanced" ,plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template" ,theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect" ,theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor" ,theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen" ,theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak" ,theme_advanced_toolbar_location : "external" ,theme_advanced_toolbar_align : "left" ,theme_advanced_statusbar_location : "bottom" ,theme_advanced_resizing : true }); var setupMCEToolbar = function (mce, componentID, displaySettingsPane) { mce.onClick.add(function(ed,e){ displaySettingsPane($('#' + componentID)); $('#' + componentID).fetch('.mceExternalToolbar').eq(0).appendTo('#settingsPaneContent'); }); } Basically, it seems as though the setupMCEToolbar function cannot track down the mceExternalToolbar to move it. Has anyone ever had success trying to do something like this? EDIT It's a Monday alright... it couldn't find the external toolbar because I was using children() instead of fetch(). There's still an issue in that: 1) Moving it is incredibly slow and 2) Once it moves, TinyMCE breaks. EDIT 2 A bit more clarification: The modal is draggable, thus making any purely-CSS workarounds a bit awkward...

    Read the article

  • What is the right way to scale a Flex application up to fullscreen?

    - by Impirator
    Fullscreen mode and I have been battling for a while in this Flex application, and I'm coming up short on Google results to end my woes. I have no problem going into fullscreen mode by doing a Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;, but the rest of the content just sits there in the top, left corner at it's original size. All right, says I, I'll just do a stage.scaleMode = StageScaleMode.SHOW_ALL and make it figure out how to pull this off. And it looks like it does. Except that when you mouse over the individual checkboxes and buttons and various components, they all fidget slightly. Just a slight jump up or down as they resize...on mouse over. Well, this is frustrating, but bearable. I can always just invoke invalidateSize() explicitly for all of them. But for the comboboxes. The ones at the bottom have their menus go off the bottom of the screen, and when I pop out of fullscreen mode, their drop downs cut off half way. I have no idea how to fix that. Can someone step in here, and put me out of my misery? What is the right way to scale a Flex application up to fullscreen? var button:Button = button_fullscreen; try { if(stage.displayState == StageDisplayState.FULL_SCREEN) { Application.application.stage.displayState = StageDisplayState.NORMAL; button.label = "View Fullscreen Mode"; stage.scaleMode = StageScaleMode.NO_SCALE; } else { Application.application.stage.displayState = StageDisplayState.FULL_SCREEN; button.label = "Exit Fullscreen Mode"; stage.scaleMode = StageScaleMode.SHOW_ALL; } invalidateSizes(); // Calls invalidateSize() explicitly on several components. } catch(error:SecurityError) { Alert.show("The security settings of your computer prevent this from being displayed in fullscreen.","Error: "+error.name+" #"+error.errorID); } catch(error:Error) { Alert.show(error.message,error.name+" #"+error.errorID); }

    Read the article

  • Hibernate deletion issue

    - by muffytyrone
    I'm trying to write a Java app that imports a data file. The process is as follows Create Transaction Delete all rows from datatable Load data file into datatable Commit OR Rollback if any errors were encountered. The data loaded in step 3 is mostly the same as the data deleted in step3. The deletion is performed using the following DetachedCriteria criteria = DetachedCriteria.forClass(myObject.class); List<myObject> myObjects = hibernateTemplate.findByCriteria(criteria); hibernateTemplate.deleteAll(myObjects); When I then load the datafile, i get the following exception nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: The whole process needs to take place in transaction. And I don't really want to have to compare the import file / data table and then perform an insert/update/delete to get them into sync. Any help would be appreciated.

    Read the article

  • The components of a brownfield application

    This article is taken from the book Brownfield Application Development in .NET. The authors define brownfield applications and discuss their three components - existing codebase, contamination by poor practices, and potential for reuse or improvement.

    Read the article

  • Make error in installing Math support for MediaWiki

    - by Masi
    How can you solve the following Make error in installing MediaWiki? ... /local/lib/site_perl . /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at t/maint/php-tag.t line 8. BEGIN failed--compilation aborted at t/maint/php-tag.t line 8. # Looks like your test died before it could output anything. t/maint/php-tag..........dubious Test returned status 255 (wstat 65280, 0xff00) t/maint/unix-newlines....ok Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/00-test.t 127 32512 ?? ?? ?? t/inc/Database.t 127 32512 ?? ?? ?? t/inc/Global.t 127 32512 ?? ?? ?? t/inc/IP.t 127 32512 ?? ?? ?? t/inc/ImageFunctions.t 127 32512 ?? ?? ?? t/inc/Language.t 127 32512 ?? ?? ?? t/inc/Licenses.t 127 32512 ?? ?? ?? t/inc/LocalFile.t 127 32512 ?? ?? ?? t/inc/Parser.t 127 32512 ?? ?? ?? t/inc/Revision.t 127 32512 ?? ?? ?? t/inc/Sanitizer.t 127 32512 ?? ?? ?? t/inc/Search.t 127 32512 ?? ?? ?? t/inc/Title.t 127 32512 ?? ?? ?? t/inc/Xml.t 127 32512 ?? ?? ?? t/maint/php-lint.t 254 65024 966 966 1-966 t/maint/php-tag.t 255 65280 ?? ?? ?? Failed 16/19 test scripts. 966/4248 subtests failed. Files=19, Tests=4248, 46 wallclock secs (33.15 cusr + 10.38 csys = 43.53 CPU) Failed 16/19 test programs. 966/4248 subtests failed. make: *** [test] Error 255

    Read the article

  • How can I load a file into a DataBag from within a Yahoo PigLatin UDF?

    - by Cervo
    I have a Pig program where I am trying to compute the minimum center between two bags. In order for it to work, I found I need to COGROUP the bags into a single dataset. The entire operation takes a long time. I want to either open one of the bags from disk within the UDF, or to be able to pass another relation into the UDF without needing to COGROUP...... Code: # **** Load files for iteration **** register myudfs.jar; wordcounts = LOAD 'input/wordcounts.txt' USING PigStorage('\t') AS (PatentNumber:chararray, word:chararray, frequency:double); centerassignments = load 'input/centerassignments/part-*' USING PigStorage('\t') AS (PatentNumber: chararray, oldCenter: chararray, newCenter: chararray); kcenters = LOAD 'input/kcenters/part-*' USING PigStorage('\t') AS (CenterID:chararray, word:chararray, frequency:double); kcentersa1 = CROSS centerassignments, kcenters; kcentersa = FOREACH kcentersa1 GENERATE centerassignments::PatentNumber as PatentNumber, kcenters::CenterID as CenterID, kcenters::word as word, kcenters::frequency as frequency; #***** Assign to nearest k-mean ******* assignpre1 = COGROUP wordcounts by PatentNumber, kcentersa by PatentNumber; assignwork2 = FOREACH assignpre1 GENERATE group as PatentNumber, myudfs.kmeans(wordcounts, kcentersa) as CenterID; basically my issue is that for each patent I need to pass the sub relations (wordcounts, kcenters). In order to do this, I do a cross and then a COGROUP by PatentNumber in order to get the set PatentNumber, {wordcounts}, {kcenters}. If I could figure a way to pass a relation or open up the centers from within the UDF, then I could just GROUP wordcounts by PatentNumber and run myudfs.kmeans(wordcount) which is hopefully much faster without the CROSS/COGROUP. This is an expensive operation. Currently this takes about 20 minutes and appears to tack the CPU/RAM. I was thinking it might be more efficient without the CROSS. I'm not sure it will be faster, so I'd like to experiment. Anyway it looks like calling the Loading functions from within Pig needs a PigContext object which I don't get from an evalfunc. And to use the hadoop file system, I need some initial objects as well, which I don't see how to get. So my question is how can I open a file from the hadoop file system from within a PIG UDF? I also run the UDF via main for debugging. So I need to load from the normal filesystem when in debug mode. Another better idea would be if there was a way to pass a relation into a UDF without needing to CROSS/COGROUP. This would be ideal, particularly if the relation resides in memory.. ie being able to do myudfs.kmeans(wordcounts, kcenters) without needing the CROSS/COGROUP with kcenters... But the basic idea is to trade IO for RAM/CPU cycles. Anyway any help will be much appreciated, the PIG UDFs aren't super well documented beyond the most simple ones, even in the UDF manual.

    Read the article

  • Opinions about Dabo

    - by driverate
    Has anyone used Dabo lately? How does it rate vs Boa Constructor, etc? I'm writing a new Python database app and Dabo looks promising, but what's the real-world scoop on it? Is it used by many developers? It's not talked about very much here on SO, or anywhere, as far as I can tell. I'm just a little concerned that the support community might be too small, or the possibility that writers might decide to throw in the towel. What is your assessment of Dabo?

    Read the article

  • SQL Server Express performance issue

    - by Developer IT
    Hi folks ! I know my questions will sound silly and probably nobody will have perfect answer but since I am in a complete dead-end with the situation it will make me feel better to post it here. So... I have a SQL Server Express database that's 500 Mb. It contains 5 tables and maybe 30 stored procedure. This database is use to store articles and is use for the Developer It web site. Normally the web pages load quickly, let's say 2 ou 3 sec. BUT, sqlserver process uses 100% of the processor for those 2 or 3 sec. I try to find which stored procedure was the problem and I could not find one. It seems like every read into the table dans contains the articles (there are about 155,000 of them and 20 or so gets added every 15 minutes). I added few index but without luck... It is because the table is full text indexed ? Should I have order with the primary key instead of date ? I never had any problems with ordering by dates.... Should I use dynamic SQL ? Should I add the primary key into the url of the articles ? Should I use mutiple indexes for seperate columns or one big index ? I you want more details or code bits, just ask for it. Basicly, every little hint is much apreciated. Thanks.

    Read the article

  • variable argument list in windows va_list

    - by shrikant
    hi, I wanted to have function which will accept as foo(...) { } usage of this would be foo(1,2,3); foo(1) foo(1,2,3,4,5,5,6); va_list can be used but again for that I have to pass foo(int count, ...), as this at run time i dont know how many argument i have. any pointer would be appreciated Thanks

    Read the article

  • C++ Microsoft SAPI: How to set Windows text-to-speech output to a memory buffer?

    - by Vladimir
    Hi all, I have been trying to figure out how to "speak" a text into a memory buffer using Windows SAPI 5.1 but so far no success, even though it seems it should be quite simple. There is an example of streaming the synthesized speech into a .wav file, but no examples of how to stream it to a memory buffer. In the end I need to have the synthesized speech in a char* array in 16 kHz 16-bit little-endian PCM format. Currently I create a temp .wav file, redirect speech output there, then read it, but it seems to be a rather stupid solution. Anyone knows how to do that? Thanks!

    Read the article

  • Can java do a timer on command line by overwriting the time on the same line?

    - by javaLearner.java
    HI I am a new java programmer (very new). What I want to do/test is (not sure if its recommendable or doable?), we know that System.out.println("Message"); will output the "Message" in command prompt. Is it possible to display the current time, without having to repeatly use the system.out.println()? Name, like instead of displaying: 10:00:01 10:00:02 10:00:03 I wand to have liek this: 10:00:0X where X will continue counting

    Read the article

  • How to pause the timer in c#?

    - by Jay
    I have a timer in my code and the interval is 10s When the timer elapsed, I will do some checking, and it may takes more than 10s for checking and some update jobs. However, if I didn't stop the timer, seems the checking will execute every 10s ... If I call the stop(), seems the timer cannot be start again ... ie something like: protected void timer_elapsed(object sender, EventArgs args) { __timer.Stop(); //Some checking here more than 10s __timer.Start(); } I just want another 10s to check again after the before checking is done. anyone can help?

    Read the article

  • mdadm cron job sends email that cron has run

    - by Andrew
    I've got an Ubuntu 8.04 server using mdadm to create several RAID1 arrays. I created /etc/cron.hourly/mdadm as follows: #! /bin/sh set -e mdadm --monitor /dev/md0 /dev/md3 /dev/md4 --oneshot (Yes, the array numbers are not sequential, and I'm not using --scan beacuse I have a degraded array that may or may not have been used as swap and I can't delete, but I think that's a separate issue. If it's the underlying cause of this, I need to fix it.) mdadm sends me email (configured in the /etc/mdadm/mdadm.conf) on DegradedArray etc. events. This is the desired behaviour. What is not desired, and I can't work out, is why cron is sending me (relatively pointless) emails, via an alias in /etc/aliases: From: root@<hostname> (Cron Daemon) To: root@<hostname> Subject: Cron <root@<hostname>> cd / && run-parts --report /etc/cron.hourly Content-Type: text/plain; charset=ANSI_X3.4-1968 X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin> X-Cron-Env: <HOME=/root> X-Cron-Env: <LOGNAME=root> Message-Id: <id@hostname> Date: Fri, 7 May 2010 13:17:01 +0930 (CST) /etc/cron.hourly/mdadm: mdadm: Monitor using email address "<root_alias@domain>" from config file I've got a dozen other servers behaving correctly (mdadm sends email, cron doesnt') with identical /etc/crontab files: # /etc/crontab: system-wide crontab # <snip comments> SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly <snip anacron jobs> Should I simply remove the --report, or is there something else in my cron config somewhere causing this?

    Read the article

  • Windows XP blue screen 0x8E error troubleshooting

    - by dotnet-practitioner
    I get following blue screen after running my laptop for an hour... A problem has been detected and windows has been shut down to prevent damage to your computer. [...] Technical Information: *** STOP 0x0000008E (0xc0000005, 0x805B03F5, 0xF703DC7C, 0x00000000) [...] So how can I tell if this is faulty memory or some other hardware problem? My laptop is a Toshiba Satellite A45-S250.

    Read the article

  • how do redirect values to other page without click event in html. Below code is fine IE. But Not in

    - by karthik
    I have implemented paypal in my web page. Process is 'given inputs are redirect to other page(2 nd page) which have to get that input and redirect to paypal page(third page). Here we submit data on first page. value pass to second page(in this page user interaction not allowed) after pass to third page.It works fine in IE . But Not In Mozila.Send any Solution. Code sample(second page): <%string product = Request.QueryString["productName"].ToString();% <% string amount = Request.QueryString["price"].ToString(); % " " document.all.frmpaypal.submit(); Fine in IE, Not In Mozila

    Read the article

  • easiest way to convert virtualbox snapshots to tree view

    - by amir beygi
    HI all My virtual box snapshot view is like this Name: Snapshot 2 (UUID: cb45aef4-54d4-4c4e-ad3e-dd7cccb6103a) Name: s131 (UUID: 8ec30c82-7796-4e51-8161-979f1b95fb0f) Name: s131 (UUID: 42066f33-969b-41f3-a779-7f6e2c45ea2c) Name: s131 (UUID: d71b9bc5-b862-46b5-ae4d-f88d3dd9756d) Name: s131 (UUID: 681896a9-7e61-4b5a-90bc-cb1bd785c6fc) Name: s131 (UUID: d7bf8593-d218-442d-b23b-4ee16e74087d) Name: s131 (UUID: e8b16fd2-7add-4294-b908-34c4e6dc79dc) Name: s131 (UUID: 57c3f5d7-d4ed-4a62-a7b8-5594f819e08e) Name: Snapshot 3 (UUID: 4a684149-9dd6-4bb2-baf5-5f590e91a344) Name: Snapshot 4 (UUID: d4cbaa7c-ae78-41e0-9962-46c587a9c667) Name: Snapshot 5 (UUID: 81567b6e-eea9-49a6-b3b8-a07f0be337d8) * and i want to convert this text to a tree like this Name: Snapshot 2 (UUID: cb45aef4-54d4-4c4e-ad3e-dd7cccb6103a) +--Name: s131 (UUID: 8ec30c82-7796-4e51-8161-979f1b95fb0f) +--Name: s131 (UUID: 42066f33-969b-41f3-a779-7f6e2c45ea2c) +--Name: s131 (UUID: d71b9bc5-b862-46b5-ae4d-f88d3dd9756d) +--Name: s131 (UUID: 681896a9-7e61-4b5a-90bc-cb1bd785c6fc) | +--Name: s131 (UUID: d7bf8593-d218-442d-b23b-4ee16e74087d) | +--Name: s131 (UUID: e8b16fd2-7add-4294-b908-34c4e6dc79dc) | +--Name: s131 (UUID: 57c3f5d7-d4ed-4a62-a7b8-5594f819e08e) +--Name: Snapshot 3 (UUID: 4a684149-9dd6-4bb2-baf5-5f590e91a344) +--Name: Snapshot 4 (UUID: d4cbaa7c-ae78-41e0-9962-46c587a9c667) +--Name: Snapshot 5 (UUID: 81567b6e-eea9-49a6-b3b8-a07f0be337d8) * or even an array that contents line number and parent's line number. My environment is linux, programming language is C, and i got this results from this shell command VBoxManage snapshot s2000 showvminfo s|grep Name|grep UUID

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >