Posts

javascript - CSS/JS won't work if I include the header -

here index.html file <!doctype html> <html> <head> <meta charset=utf-8> <title>title</title> <meta name=viewport content="width=device-width, initial-scale=1"> <meta http-equiv=x-ua-compatible content="ie=edge"> <link href=assets/css/elegant-icons.min.css rel=stylesheet type=text/css media="all"/> <link href=assets/css/bootstrap.css rel=stylesheet type=text/css media="all"/> <link href=assets/css/theme.css rel=stylesheet type=text/css media="all"/> <link rel=stylesheet type=text/css href="assets/css/style.css"/> </head> <body> <div id="inc"></div> <div class=main-container> <section class="no-pad coming-soon fullscreen-element"> </section> </div> <script src=assets/js/jquery.min.js></script> <sc...

php increment a number in static constructor -

i need increment number in constructor of class, without calling static functions. code follows: class addup { static public $num; function __construct($num) { echo 'my number is==>' . $num; static::$num++; } } $inc = new addup();//instantiated object echo '<br>'; echo $inc::$num;//should 2, still 1, should $inc = new addup() or $inc->addup() implemented in class? echo '<br>'; echo $inc::$num;//should 3, still 1 echo '<br>'; echo $inc::$num;//should 4, still 1 any ideas welcome, thank you upd made following refactoring: $inc = new increment();//my number is==>2 echo '<br>'; $inc = new increment();//my number is==>3 echo '<br>'; $inc = new increment();//my number is==>4 echo '<br>'; $inc = new increment();//my number is==>5 is way without calls functions in class? a static property means value of static property same across multiple instantia...

Add a new field to array elements in a foreach PHP - Laravel -

i have variable: $families = array( array( 'expand' => '', 'family_id' => 'aaer', 'active' => true, 'description' => 'wall art', 'group_id' => 5 ), array( 'expand' => '', 'family_id' => 'eerr', 'active' => true, 'description' => 'personalised mugs', 'group_id' => 4 ), ); and want add $families items field called 'href', this: $families = array( array( 'href' => 'http://mipage/wall-art/aaer', 'expand' => '', 'family_id' => 'aaer', 'active' => true, 'description' => 'wall art', 'group_id' => 5 ), array( ...

java - Handling broken pipe exception in @ControllerAdvice does not work as well -

good day. know "broken pipe" not critical exception , mean client did not wait response server. , know there many similar question can not find answer on s.o. i want keep logs clear found solution . and tried write like: @controlleradvice public class controlleradvisor { private static final logger logger = logmanager.getlogger(); @responsebody @exceptionhandler(ioexception.class) @responsestatus(httpstatus.service_unavailable) public object brokenpipehandle(ioexception e, httpservletrequest req) { if (stringutils.containsignorecase(exceptionutils.getrootcausemessage(e), "broken pipe")) return null; return new errordto(e.getmessage()); } } but broken pipe exception still happened , have in logs: java.io.ioexception: broken pipe @ sun.nio.ch.filedispatcherimpl.write0(native method) ~[na:1.8.0_91] @ sun.nio.ch.socketdispatcher.write(socketdispatcher.java:47) ~[na:1.8.0_91] @ sun.nio.ch.i...

javascript - initiate a number of vertices/triangles for vertex shader to use -

Image
i've been playing around vertexshaderart.com , i'd use learned on separate website. while have used shaders before, effects achieved on site depend on having access vertices/lines/triangles. while passing vertices easy enough (at least three.js, though kind of overkill simple shaders, in cases in need shader materials too), creating triangles seems bit more complex. i can't figure out source, how triangles created there, when switch mode here? i'd replicate behavior have no idea how approach it. create number of triangles through 3 many individual objects performance takes hit rapidly. triangles created here separate entities or part of 1 geometry? vertexshaderart.com more of puzzle, toy, art box, creative coding experiment example of webgl. same true of shadertoy.com. example like this beautiful runs @ 20fps in it's tiny window , 1fps fullscreen on 2014 macbook pro , yet mbp can play beautiful games huge worlds rendered fullscreen @ 60fps . in ...

ios - How to use variable that have value outside the code block -

what im trying print (output : western australia) self.statename = state["provincestatename"] to detailaddressarr = ["\(userdata!["addressline1"] as! string)", "\(userdata!["addressline2"] as! string)", "\(userdata!["city"] as! string)", "\(userdata!["postalcode"] as! string)", self.statename, "\(userdata!["countrycode"] as! string)"] but when run, return nothing. here code class myprofileviewcontroller: baseviewcontroller, uitableviewdelegate, uitableviewdatasource,fbsdkloginbuttondelegate, uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate { @iboutlet weak var profiletableview: uitableview! @iboutlet weak var profileimg: uiimageview! @iboutlet weak var bigidlbl: uilabel! @iboutlet weak var usernamelbl: uilabel! let personalarr = ["salutation", "given name", "family name", "date of birth...

web applications - How to secure a spring webapp using a LDAP server -

i have webapp created using spring , maven. means not have web.xml. need know how secure web app using spring security. need connect ldap server , cross check credentials against it. complete beginner in scenario. please help. guidelines or tutorials welcome. the best starting point excellent reference documentation . there's getting started guide here . if have specific problems or questions details in documentation or guide, feel free ask again :)