Posts

php - Different folder for views - Laravel 5.4 -

i'm trying make reusable dashboard apps, decided put in folder app/dashboard . i've managed have routes, controller, middlewares, etc. but, i'd have views in folder. added path in config/view.php , problem if have 2 views same name in app/dashboard/views , in default resources/views , of course view in default path loaded. do have better idea? can return view('dashboard:login') in controller using laravel standard tools? look @ part of documentation https://laravel.com/docs/5.5/packages#views . right, need use 2 colons return view('dashboard::login');

neural network - how / where weights and bias get value/updates in tensorflow -

from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("mnist_data/", one_hot=true) import tensorflow tf x = tf.placeholder(tf.float32, [none, 784]) w = tf.variable(tf.zeros([784, 10])) #weights! b = tf.variable(tf.zeros([10])) # bias! y = tf.nn.softmax(tf.matmul(x,w)+b) y_ = tf.placeholder(tf.float32, [none,10]) cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_*tf.log(y), reduction_indices=1)) train = tf.train.gradientdescentoptimizer(0.01).minimize(cross_entropy) sess= tf.interactivesession() tf.global_variables_initializer().run() in range(10): xs,ys = mnist.train.next_batch(100) sess.run(train, {x: xs,y_:ys}) print(sess.run(w,{x: xs,y_:ys} )) cross_validation = tf.equal(tf.argmax(y,1), tf.argmax(y_,1)) acu = tf.reduce_mean(tf.cast(cross_validation, tf.float32)) print(sess.run(acu, {x:mnist.test.images, y_: mnist.test.labels})) this tensorflow tutorial code. understand completely, don't understand intuit...

python - How can I check if a warning was raised but still not to turn it into an exception -

i have method get_font can raise defaultfontwarning . want check if warning raised , run piece of code if it's case. my current solution is def set_font(self): warnings.catch_warnings(): warnings.filterwarnings("error") try: self.font = get_font(self.path, self.size) except defaultfontwarning: self.is_default = true this attaches is_default self , silences warning user cannot see it. how can check if warning raised still not turn exception , output it? raise warning (or type; such userwarning ), retain original traceback. def set_font(self): warnings.catch_warnings(): try: self.font = get_font(self.path, self.size) except defaultfontwarning e: raise warning(*e.args).with_traceback(e.__traceback__) none using from none rid of during handling ... message. can use own message such 'bad font' replacing *e.args : raise warning('bad font...

Use code to set Suggestion Mode in Google Doc -

Image
i trying make code.gs file set editing mode "suggesting" in google doc changes seen group. other users (not me certainly) open document , forget set "suggesting" mode , after many edits, late go back. thanks in advance help.

java - 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.Unsat -

i looking convert spring boot + spring security + h2 https://github.com/szerhusenbc/jwt-spring-security-demo mongodb. did following changes see issue. please guide how can fixed ? please let me know how can fixed issue ? dont have idea left implement ? caused by: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'websecurityconfig': unsatisfied dependency expressed through field 'userdetailsservice'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'jwtuserdetailsserviceimpl': unsatisfied dependency expressed through field 'userrepository'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'userrepository': cannot resolve reference bean 'mongotemplate' while setting bean property 'mongooperations'; nested exception org.springframework.beans.factory.unsatisfieddependencyexce...

css - Force Spans to Wrap In Inline-Block Parent -

i'm writing app wrap individual characters in spans better handle click events. characters in div display: inline-block . how text wrap? i've tried: div { display: inline-block; word-wrap: wrap; word-break: break-all; } as as overflow-wrap: break-word; white-space: pre-wrap; to no avail. can see, works on normal text, not on text wrapped in spans. jsbin: http://jsbin.com/hugiqohawi/edit?html,css,output set width div elements. span s wrap @ point. for fluid width, use 100% : div { display: inline-block; word-wrap: wrap; word-break: break-all; width: 100%; }

postgresql - How do i use DataGrip to access a postgres instance behind a docker virtual network? -

Image
i have dockerized database micro services. can run manual queries using following: $ ssh user@foo.domain.com $ docker exec -it postgres bash docker$ psql -u postgres -h 127.0.0.1 -d postgres the web services talk 1 using docker bridged virtual network batman . networks: batman: driver: bridge in alignment postgres security best practices - not expose postgres port 5432 host machine @ foo.domain.com. sibling containers in 'batman' docker network allowed connect database. in traditional datagrip / postgres setup, ssh hosted box postgres served, , use local psql client (rules from: pg_hba.conf). a dockerized system requires 1 additional step (exec). seeing datagrip doesn't seem allow prefixed connection commands, how use datagrip access postgres instance behind docker virtual network? i think should possible: add simple container ssh server in same ( batman ) network set connection via ssh tunnel: configure connection if on network (so ho...