Posts

javascript - Script to return file as string -

what trying simple, haveing problems make work... text on html page changes according text exists on different html file. main html file: <html> <body> <label for="order2" id="order2"> </label> <script> var order2 = returnedfromthephpfile; document.getelementbyid('order2').innerhtml = order2; </script> </body> </html> here php file: <?php $src = fopen('c:\\order.html', 'r'); return $src; fclose($src); ?> the other html file: <table border="0" cellpadding="0" cellspacing="0"><tr><td width="360" height="190" valign="top">hello</td></tr></table> does knows how can this, or if there easier way it? you want use file_get_contents contents of file string. http://us2.php.net/file_get_contents $src = file_get_contents(...

if statement - SML - Function calculates incorrectly -

for course @ university have learn sml. learnd java befor , having problems sml now. have function should calculates entryfee zoo. fun calcentryfee (erm:bool,dauer:int,dschungel:bool,gebtag:bool):real= let val c = 7.0 in if erm c + 14.50 else c + 19.50; if dauer < 120 c - 4.0 else c; if dschungel c + 1.5 else c; if gebtag c / 2.0 else c end; the problem function 'returns' 7.0 or 3.5. doesn't seem execute other 3 if-statements. there no statements in ml, expressions. a;b expression, evaluates a , b , result result of b . consequently, result of first 3 if-expressions thrown away. also, variables variables in true math sense, immutable. think of program mathematical formula. what want write following: fun calcentryfee (erm : bool, dauer : int, dschungel : bool, gebtag : bool) : real = let val fee = 7.0 + (if erm 14.50 else 19.50) - (if dauer < 120 4.0 else 0.0) + (if dschungel 1.5 else 0.0...

javascript - Get product name from parent element -

here trying product name in alert box when "buy now" button clicked. need maintain onclick event of button have placed code in jquery. <h2 class="product-name"><a href="product1.php" title="sample product name">sample product name</a></h2> http://jsfiddle.net/lkkbz/ the approach did giving me blank alert box might because calling parent element. please help please note here don't want alert when product name or image clicked. want on button change this: var text = $(this).parents(".item").find('.product-name').text();

In gnuplot, how to label each point in the plot with its coordinates? -

Image
i have data file, abc.dat , want plot labeling each coordinate (1,5), (4,6), (2,8) , on .... abc.dat : 1 5 4 6 2 8 4 5 7 8 8 9 3 4 use labels plotting style this. requires 3 using specifiers: x-value, y-value , string placed @ given coordinates. easiest command be: plot 'abc.dat' using 1:2:(sprintf("(%d, %d)", $1, $2)) labels notitle that places respective labels centered @ coordinates. the following command plots point @ respective coordinate , places coordinate label bit shifted near it: set offset 1,1,1,1 plot 'abc.dat' using 1:2:(sprintf("(%d, %d)", $1, $2)) labels point pt 7 offset char 1,1 notitle the result 4.6.4 is:

ios - How to get mail configuration information if allowed? -

hi using smtp server framework send mails. nsarray *arr1 = [testmsg.fromemail componentsseparatedbystring:@"@"]; nsarray *arr2 = [[arr1 objectatindex:1] componentsseparatedbystring:@"."]; if ([arr2 containsobject:@"gmail"]) { testmsg.relayhost = @"smtp.gmail.com"; } else if ([arr2 containsobject:@"yahoo"]) { testmsg.relayhost = @"smtp.mail.yahoo.com"; } else if ([arr2 containsobject:@"hotmail"] || [arr2 containsobject:@"live"]) { testmsg.relayhost = @"smtp.live.com"; } else { nsstring *smtprelay = [[nsstring alloc]init]; smtprelay = [nsstring stringwithformat:@"smtp.%@.com",[arr2 objectatindex:0]]; testmsg.relayhost = smtprelay; } testmsg.requiresauth = yes; testmsg.login = @"mycompanyusername@mycompany.com"; testmsg.password = @"********"; testmsg.subject = @"this email subject line"; testmsg.wantssecure = yes; // smtp.gmail....

Read user input before update in unity3d -

i separate script manage user input in unity3d, character can controlled not user input, , ai. question is: want other logic script read input script named inputmanager inputmanage ipt; ipt.walk ipt.jump . how can guarantee input updated before other update. in general thing (and design) choice, not rely on script execution order. by way it's possible force script update in specific order. can modify in edit->project settings->script execution order .

JSF and cloudControl -

i'm learning java ee , appear me 1 of things know jsf i'm sing cloudcontrol haven't found way deploy jsf applications there. is there way of deploying jsf applications on cloudcontrol ? as mentioned in comment, need provide implementation of jsf dependency embedded jetty or tomcat runner. here can find example apps tomcat , jetty . maybe helpful have on our existing java guides .