Posts

html - batch make email link as image -

is there way convert mailto:example@exapmle.com email links in html page images showing same content/email address (i didn't have reputation post images, an example image ). knew website provide such kind of service, done 1 one. have webpage have many email links, want ask better or smarter way that. any response appreciated. thanks. yes. 1 way using php. basically, describing writing text image. can done using php imagettftext() function. see http://php.net/manual/en/function.imagettftext.php more info.

Python app engine non-standard package import -

i need non-standard app engine package named qrcode . pure python lib depends on pil, supported app engine. my folder structure is: app |--- handlers/ |------ my_handler.py |--- util/ |------ __init__.py |------ qrcode/ |--------- __init__.py |--------- qrcode/ |------------ __init__.py |------------ other lib files |--- index.py on index.py map my_handler.py , on my_handler.py call from util.qrcode import qrcode inside 1 of handler classes' method. problem importerror: no module named qrcode.main on __init__.py file. __init__.py: from qrcode.main import qrcode, make qrcode.constants import * qrcode import image qrcode.main 1 .py file inside qrcode package (to see whole package, check repository linked here ) i looked , can't find wrong. i'd appreciate help. thanks! other questions searched: appengine server cannot import atom module import custom package in python google app engine importing nested modules in python the python path i...

Addressability of dojo widget inside of a custom widget -

i think i'm missing obvious here in dojo 1.8 w.r.t. writing custom widgets. i have simple widget includes, among other things, currencytextbox. at runtime, able change currency of widget usd or eur or whatever else. normally, if wasn't widget, with registry.byid("mycurrenttextbox").set("currency","usd"); but nested widgets inside of custom widgets don't registered in registry. so, what's trick getting addressability widget , assigning widget attributes (not dom attributes) widget nested inside custom widget? add data-dojo-attach-point="mycurrenttextbox" widget definition in template. within widget can access textbox using this.mycurrenttextbox .

java - 2.2 and 4.1.2 differences in SimpleDateFormat? -

i have code: public static string week_day_short = "c"; public static string getweekday(int day) { gregoriancalendar calendar = new gregoriancalendar(); calendar.set(calendar.day_of_week, day + 2); dateformat formatter = new simpledateformat(week_day_short + ", " + date); return formatter.format(calendar.gettime()); } when run method on 4.1.2 okay , outputs mo;di;mi;... when run on 2.2 following error: java.lang.illegalargumentexception: unknown pattern character - 'c' @ java.text.simpledateformat.validateformat(simpledateformat.java:379) @ java.text.simpledateformat.validatepattern(simpledateformat.java:428) @ java.text.simpledateformat.<init>(simpledateformat.java:499) @ java.text.simpledateformat.<init>(simpledateformat.java:363) @ de.mayerhofersimon.vertretungsplan.utils.datehelper.getweekday(datehelper.java:54) the same when try "cc" short dayname or "ccc...

javascript - jquery onchange impacted by post event? -

i creating store products listed options (ie different sizes via drop down , different fabrics via selection of radio buttons). (check out www.searing.me/newstore) i wrote following code if selection made, price updated without needing post , refreshing top of screen. problem - when "add cart" prices getting updated price selected. so, in essence, on first product, if select "brown chord" option add $2.25 - price changes adding $2.25 $30.00 - $32.25. however, when click add cart - product right changed price $2.25 well. i assume has post registering onchange event each....i don't know. , i'm beginner jquery/javascript know what's happening. script is: function updateprice(e) { var product = $(e.target).closest('.product'); var price = parsefloat(product.data('price')); var sizeprice = parsefloat(product.find('[name=sizeselect] :selected').data('price')); if (isnan(sizeprice)) { ...

android - Check if piece of String is there in string java -

this question has answer here: in java, how check if string contains substring (ignoring case)? [duplicate] 6 answers i looking piece of code can search string in string. string mainstr = "it wednesday"; so need code return true if search "day" or "day" or "day" in mainstr . i tried methods like mainstr.contains("") and mainstr.indexof("") > -1 are not working me thanks :) if mainstr long string, approach may more efficient: string mainstr = "it wednesday"; string tosearch = "day"; boolean found = pattern.compile(tosearch, pattern.case_insensitive).matcher(mainstr).find(); the last line equivalent to boolean found = pattern.compile("(?i)" + tosearch).matcher(mainstr).find(); but beware tosearch may not contain regex meta characters if ...

Why does this dynamic Nginx proxy configuration not work? -

i have nginx configuration looks this: location /textproxy { proxy_pass http://$arg_url; proxy_connect_timeout 1s; proxy_redirect off; proxy_hide_header content-type; proxy_hide_header content-disposition; add_header content-type "text/plain"; proxy_set_header host $host; } the idea proxies remote url, , rewrites content header text/plain. for example call: http://nx/textproxy?url=http://foo:50070/a/b/c?arg=abc:123 and return contents of http://foo:50070/a/b/c?arg=abc:123 , wrapped text/plain header. this doesn't seem work though, 'invalid upstream port' errors: 2013/07/23 19:05:10 [error] 25292#0: *963177 invalid port in upstream "http://foo:50070/a/b/c?arg=abc:123", client: xx.xxx.xx.xx, server: ~^(?<h>nx)(\..+|)$, request: "get /textproxy?url=http://foo:50070/a/b/c?arg=abc:123 http/1.1", host: "nx" any ideas? i'm having hard time trying work out.