Posts

php - Apache configuring ssl -

i have following namevirtualhost *:443 <virtualhost 55.55.55.55:443> #<virtualhost *:443> sslengine on sslcertificatefile /path/to/cert/mycert.crt sslcertificatekeyfile /path/to/key/mykey.key sslcacertificatefile /path/to/bundle/bundle.crt serveradmin info@mydomain.com servername www.mydomain.com documentroot /var/www/html/ </virtualhost> i have java program accesses above url using https. when comment out virtualhost line ip address , uncomment wildcard line, java program gives me "peer not authenticated" exception. when leave is, java program works expected. main reason want way have other subdomains define other sections. what issue using wildcard virtualhost line? the issue defining ip address directive being used. however, when used *:443 directive have servername www.mydomain.com , not accessing www when try access page virtualhost block not being used. rather there _default:443 directive in different c...

encoding - What's the best way to url encode only query keys and params in Java? -

i encode query keys , parameters of url (don't want encode /, ? or &). what's best way in java? for example, want convert http://www.hello.com/bar/foo?a=,b &c =d to http://www.hello.com/bar/foo?a=%2cb%20&c%20=d build url this: string url = "http://www.hello.com/bar/foo?"; url += "a=" + urlencoder.encode(value_of_a); url += "&c=" + urlencoder.encode(value_of_c);

c# - Castle interface proxy with a dynamic target -

i trying use castle dynamicproxy implement typesafe version of signalr hub. goal being when use clients.all rather getting dynamic object have interface use. the code rather hacky @ moment wanted prove work before go through trouble of making nice: public interface ichatclient { void broadcastmessage(string name, string message); } public class chathub : typesafehub<ichatclient> { public void send(string name, string message) { clients.all.broadcastmessage(name, message); } } public abstract class typesafehub<tinterface> : hub tinterface:class { public new typesafehubcallerconnectioncontext<tinterface> clients { { return new typesafehubcallerconnectioncontext<tinterface>(base.clients); } } } public class typesafehubcallerconnectioncontext<t> t:class { private ihubcallerconnectioncontext context; private proxygenerator proxygen; public typesafehubcallerconnection...

java - How to use GWT $entry Function in JSNI? -

the $entry function in gwt used uncaught exceptions reported javascript gwt. what difference between following $entry calls , 1 correct one? the following versions call instance java functions. version 1: public final native string test(double arg) /*-{ var instance = this; var callexternal = $entry(function(arg) { return instance.@com.example.myclass::javafunction(d)(arg); }); var x = callexternal(arg); }-*/; version 2: public final native string test(double arg) /*-{ var x = $entry(instance.@com.example.myclass::javafunction(d)(arg)); }-*/; is there different use whether use static or non static java functions? update: the following versions call static java functions. version 1: public final native string test(double arg) /*-{ var callexternal = $entry(function(arg) { return@com.example.myclass::javafunction(d)(arg); }); var x = callexternal(arg); }-*/; version 2: public final native string test(double ...

PHP If statement not working as I thought it should -

i'm trying set error checking on form, have following far: if (empty($fname)) { $error = true; $error_fname = "please fill in first name"; }else if (empty($lname)) { $error = true; $error_lname = "please fill in first name"; } and although in first if statement assigns string variable $error_fname is, second else if statement nothing, doesn't assign error variable. any this? if meet first condtion never throw second, don't use if else 2 if , put error in array otherwise might overwrite if both condition met $error_lname = array(); if (empty($fname)) { $error = true; $error_lname[] = "please fill in first name"; } if (empty($lname)) { $error = true; $error_lname[] = "please fill in last name"; } if need 2 separate errors might use different variables if (empty($fname)) { $error = true; $error_fname = "please fill in first name"; } if (...

"Launch failed. Binary not found" error for C in Eclipse 4.3.0 on OS X 10.9.2 -

since today have not been able compile c programs in eclipse not create necessary binaries when build project, in fact won't create binaries folder @ all. have tried i've seen on here try fix it, , it's gotten worse. here's i've tried far , results: from "launch failed. binary not found." snow leopard , eclipse c/c++ ide issue , in terminal: cd /usr/bin sudo rm cc gcc c++ g++ sudo ln -s gcc-4.0 cc sudo ln -s gcc-4.0 gcc sudo ln -s c++-4.0 c++ sudo ln -s g++-4.0 g++ this supposed change path 32-bit gcc 4.0 64-bit 4.2. after doing however, had major problem: no longer had type of gcc evidenced fact when called gcc -v in terminal, returned: -bash: gcc: command not found in attempt make things right, re-downloaded command line tools xcode , reinstalled them, , xcode acknowledges indeed installed. despite this, calling gcc -v still returned -bash: gcc: command not found. after repeating process, got same result, makes seem if cannot install/fi...

php - Values Cannot be read by MySQL? -

i have query in mysql, have values in database there comma example (monday, tuesday). reads data if there 1 inside (monday) or (tuesday) when data more 1 , comma mysql doesn't read it. i've tried charindex didn't work or maybe used wrong syntax. help. here's snippet want read data if (date_format(ts.`date`, '%w') <> r.`number`, 0, 1) 'restday' i tried if (charindex(date_format(ts.`date`, '%w') <> r.`number`, 0, 1)) 'restday' but sends error message