Posts

Showing posts from April, 2013

hibernate - How to save without locking all the tables on grails -

i have domain class using domain class property city : class tracker { string name, value; city city; int hits; date date; } and insert or update values using tracker.save(); in long job procedure. that working fine except when want update on city domain class while tracker saving something. , says lock wait timeout exceeded; try restarting transaction. stacktrace follows: message: lock wait timeout exceeded; try restarting transaction i don't make changes in city when saving tracker, think hibernate thinks , lock city domain too. try tracker.save(flush: true) or flush session after updates: def sessionfactory sessionfactory.currentsession.flush()

java - How to go from JOptionPane program to GUI interface -

for simple card game making, make gui in can play card game. previously, relying on joptionpane's show me drew. now, don't know how draw card gui made using swing interface in netbeans. i'd know best way implement original drawing method in button netbeans generated gui code. thank you! here's drawing method: public static void draw() { system.out.println(player1 + " drew " + suits[cardsuit(deck1[deck1cardposition])] + " of power " + (cardpower(deck1[deck1cardposition]))); joptionpane.showmessagedialog(null, player1 + " drew " + suits[cardsuit(deck1[deck1cardposition])] + " of power " + (cardpower(deck1[deck1cardposition]))); system.out.println(player2 + " drew " + suits[cardsuit(deck2[deck2cardposition])] + " of power " + (cardpower(deck2[deck2cardposition]))); joptionpane.showmessagedialog(null, player2 + " drew " + suits[cardsuit(deck2[deck2cardposition])] + " of powe

DB2 nickname doesn't support decfloat type? -

i created table columns of datatype decfloat , when tried create federated nickname table so: create server crv_test type db2/udb version '9.7' wrapper drda authorization "xxx" password "xxx" options ( dbname 'xxx' ); create user mapping db2inst3 server crv_test options ( remote_authid 'xxx', remote_password 'xxx' ); create nickname xx.xx crv_test.xx.xx; i got error below: db2 database error: error [] [ibm][db2/aix64] sql3324n column "paymoney" has type of "decfloat" not recognized. my remote db2 version 9.7 , local 9.5. have suggestion solve problem? interestingly, documented limitation of federated wrapper version 9.5: the data source data types correspond following db2 data types not supported of wrappers: xml, decfloat, structured types, , ref types. federation support in db2 has lagged behind engine development, in case support decfloat . if running lates

javascript - Changing object in Array -

var tab = new auitab({ element: document.getelementbyid("footer"), index: 1, repeatclick: false }, function(ret) { if (ret.index == 1) { bottomnav1(); } if (ret.index == 2) { var login_name = $api.getstorage('mobile'); if (typeof(login_name) != "undefined") { profile(); } else { login(); auitab.index = 1; } } }); i want change index value in array. can see, tried updating using auitab.index = 1 , tab = 1 (one of them should've worked according google). both did not work - new programming. there not aware of?

java - Whats the difference between ActionContext,ServletContext and ServletActionContext? -

in java ee, use actioncontext , servletcontext , servletactioncontext , have similar name, don't know difference between them. i know servletactioncontext inherit actioncontext . can explain them? there have many difference between them. servletcontext from servletcontext 's package( javax.servlet.servletcontext ) can know standard javaee webapplication class library. servletcontext provides standard servlet run-time environment. methods of servlet communicate web container. public interface servletcontext { // returns url prefix servletcontext. public string getservletcontextname(); //returns context-path web-application. public string getcontextpath(); //returns servletcontext uri. public servletcontext getcontext(string uri); //returns real file path given uri. public string getrealpath(string uri); public requestdispatcher getnameddispatcher(string servletname); public requestdispatcher getrequestdispatcher(string uri); servletcon

regex - Pass Java backreference to method parameter -

i need java port of https://gist.github.com/jbroadway/2836900 , simple markdown regex parser in php. i hoping use backreferences, can't make work. @ moment i'm not using hashmap , i've got 2 javafx textarea s i'll , set text via changelistener . { //... htmltextarea.settext(markdowntextarea.gettext() .replaceall("(#+)(.*)", header("$0", "$1", "$2")); } private string header(string text, string char, string content) { return string.format("<h%s>$2</h%s>", char.length(), char.length()); the backreference on $2 works, if returned, other backreferences don't. char.length() 2 since it's treated $2 , not backreference. id think of solution can keep style , don't need handle separately. the problem backreference values honored in replacement string. such, values passed header() method $0 , $1 , $2 literals , not captured values. since there's no version of replace

Winform combobox binding and setting default value with selected index -

i have case databatable datasource combobox , datatatable records change user selects field. want set default value in combobox when database has 1 record. works when write cmblist.items.count > 0 cmblist.selectedindex = 0 but loses focus goes blank. seems setting selectedindex 0 not update bindingsource values. what's solution please

ionic2 - Leaflet draw Marker from Json Data Ionic 2 -

i want draw markers json data on project on leaflet map i'm doing way l.marker([48.840346,2.319415]).addto(map). bindpopup("<b>x<b>"<img style='width: 100%' src='http://i.imgur.com/xmvjs1s.jpg'/></div> ",{minwitdh:256} "); i have enter info myself, , that's not way want but have data.json { "title": "a", "lat": 48.841491, "long": 2.355989, }, { "title": "b", "lat": 48.878849, "long": 2.312855, }, i want l.marker([lat,long]).addto(map). bindpopup("<b>title<b>"<img style='width: 100%' src='http://i.imgur.com/xmvjs1s.jpg'/></div> ",{minwitdh:256} "); to data , render marker on map?

php - Update a single record in NotORM is not working -

this code public function getbyid($id) { $source= $this->getsource(); return $this->db->usuarios[array('id' => $id)]; } public function update($user, $id) { $olduser = $this->getbyid($id); if($olduser) { return $olduser->update(array('nombreusuario' => $user['nombreusuario'], 'contrasena' => md5(sha1($user['contrasena'])), 'nombre' => $user['nombre'], 'apellido' => $user['apellido'], 'email' => $user['email'], 'fechanacimiento' => $user['fechanacimiento'], 'rolid' => $user['rolid'],

How to iterate multiple elements in single loop using python selenium -

below code working fine using multiple loops.is possible make 1 loop data. multiple loop code: for post in driver.find_elements_by_class_name("_1uozlx"): mobile_link += [ post.get_attribute("href") ] post1 in driver.find_elements_by_class_name("_3wu53n"): mobile_name += [ post1.text ] post2 in driver.find_elements_by_css_selector("._1vc4oe._2rq-nk"): offer_price += [ post2.text ] full code: from selenium import webdriver selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec selenium.common.exceptions import timeoutexception selenium.webdriver.common.by import import time import csv chrome_path = r"c:\users\venkatesh\appdata\local\programs\python\python35\chromedriver.exe" driver = webdriver.chrome(chrome_path) regionidarray = ["https://www.flipkart.com/mobiles/pr?otracker=categorytree&page=1&sid=tyy%2c4io", "https://www.flipkar

Equivalent to cut command in batch scripts -

is there utility in windows carries out same operations done cut command in unix. i have input lets a|b|c|d. since "|" delimiter therefore need fetch values separated "|". kindly advise. if trying in .cmd file can find examples typing for /? command prompt. otherwise if powershell option it's easy using string.split() .

java - FlatFileItemReader cannot be cast when being accessed from custom ItemReader -

i have application i'm attempting diagnose in setup i've done incorrectly, , not having luck in determining why it's not working outside of specific situations. first code i'm using. configuration.java @enablebatchprocessing @springbootapplication(scanbasepackages="com.lcbo") @enableintegration public class config { @autowired private jobbuilderfactory jobbuilderfactory; @autowired private stepbuilderfactory stepbuilderfactory; @autowired private lcboinventorytrackerproperties inventorytrackerproperties; @bean public job processlcboinventory(@qualifier("getlcbostoredatastep") final step getlcbostoredatastep) { return jobbuilderfactory .get("processlcboinventory") .incrementer(new runidincrementer()) .start(getlcbostoredatastep) .build(); } /** * tasklet downloads .zip file, unzips, , saves in appropriate folde

web component - How to sort the columns in the tool panel. Ag-Grid -

Image
edit: found out move column doesn't work in v6.4.0 example link: https://www.ag-grid.com/javascript-grid-tool-panel/toolpanelexample.html the order of columns visible in tool panel in same order defined in column definition. check image below. is possible sort them in tool panel in order(say alphabetically) without changing order shown in grid. what tried: i tried defining them in alphabetical order in columndefination , tried move them there position using columnapi.movecolumn() . doesn't seems work either increases complexity when have move columns , position them. questions: is possible/feasible? the movecolumn() function not working. can tell in version introduced not able find in changelog. additional details: using ag-grid enterprise version v6.4.0 please refer this plnkr . used same basic idea had, creating coldefs in alphabetical order in ongridready function moved columns respective placements. there 2 functions useful in doing

Minifier output JSP - Spring Boot -

i want compress output jsp file in spring boot application. tried compresses original file jsp think not solution. output of page mkyong. can suggest me method? you can use compressor html taglib. think can read tutorial, it's pretty good: jsp taglib html compressor , minifier

Css focus on button is working in Edge and in Chrome, but in Firefox and IE is not -

i'm loking on stack , on internet find solution fix problem button:focus i had creade dropdown focus menu, example ( http://koen.kivits.com/articles/pure-css-menu/ ) my css code: .dropdown-button:focus > .dropdown-list { display: block; visibility: visible; } .dropdown-button { padding-left: 0; text-decoration: none; display: list-item; box-sizing: border-box; position: relative; list-style-type: none; height: 100%; } .dropdown-list { padding-left: 0px; position: absolute; background-color: @action-dropdown; min-width: 180px; z-index: 1; text-align: left; border: 1px solid @action-border; display: none; transition: display 0.2s; } and html: <button class="button button-border btn-large" ng-disabled="!hashmap['object:1'].active" ng-click="hashmap['object:1'].actionevent()"><span class="hint">p

MySQL mysql_info alike message within a stored procedure (both affected and matched row counts) -

i trying figure out how both affected row count , matched row count within stored procedure after update query. aware of row_count function, returns number of rows changed query. how number of rows matched update query? row_count() - returns number of changed rows found_rows() - works select ... limit query diagnostics x = row_count - returns same row_count() diagnostics x = number - returns 0 diagnostics condition 1 x = message_text - returns null on success in php there mysqli_info() method, returns great result on update: rows matched: 40 changed: 38 warnings: 0 so, how message (or these 2 values - rows matched , rows changed) within stored procedure? or forced run select query same clause before update number of matched rows? can value returned select query trustful when run before actual update? can table change while stored procedure running? or should lock table? consider mysql 5.7. thanks. update the best solution found far (pseudocode): declare _rows_ma

typescript - I have a response coming from the server( JSON Response) Those contain image names -

stack overflow people, have data coming server images want display them under card view of application. kindly me out in displaying response here code home.ts import { component } '@angular/core'; import { navcontroller, loadingcontroller} 'ionic-angular'; import {httpprovider} '../../providers/http-provider'; @component({ selector: 'page-home', templateurl: 'home.html', providers:[httpprovider] }) export class homepage { newsdata: any; loading: any; constructor(public navctrl: navcontroller,private httpprovider:httpprovider,public loadingctrl: loadingcontroller) { this.loading = this.loadingctrl.create({ content: ` <ion-spinner ></ion-spinner>` }); this.getdata(); } getdata(){ this.httpprovider.getjsondata().subscribe( result => { this.newsdata=result.data.image; console.log("success : "+this.newsdata); alert("data coming"); }, err

Python 3.6 how to make a regular function work same way as lambda -

i'm bit puzzled converting following lambda function regular function: my_fun = lambda x,y:[i(j) i,j in zip(x,y)] where x list of types, say types = [float,float,float] and y list of integer values, say: values = [1,2,3] so, my_fun() converts integers floats. when run way: new_values = my_fun(types,values) it returns new list floats. now when comes define function in regular way: def my_fun(x,y): i,j in zip(x,y): i(j) it stops working. i'm not putting return inside / outside of loop return first / last instance once hits , not trying assign new list like: def my_fun(x,y): new_vals = [] i,j in zip(x,y): new_vals.append(i(j)) return new_vals because in case function looks overwhelmed me. can please explain fundamental difference between lambda , regular function in case, seems missing simple basic knowledge python 3.6? i thought might have been list-comprehension i'm using in lambda couldn't explain myself. ma

c# - My ViewModel should inherit from DependencyObject? -

okay goal set binding in code instead of xaml. source property custom dependency property string. target property located in viewmodel, , string, not dependency property (since viewmodel isn't dependencyobject, of course). so target property string property (we call property mytextproperty). this binding approach works via xaml (only tried x:bind far), can't seem able pull off pure c#. bindingoperations.setbinding() expects target dependency property, mytextproperty simple string property located in viewmodel. i want know if there way make work. viewmodel need dependencyobject? seems work if was, although never tried it. approach considered pattern/practice? appreciated. thanks. a possible solution create binding onewaytosource or twoway binding. in way it's possible bind dependencyproperty of control , "normal" property in viewmodel

html - str_replace in Javascript -

i want str_replace in javascript without using inbuilt function. want scratch code this. please can have code this? want javascript inbuilt function str_replace ditto without using str_replace. function replace(string, chartochange, chartoreplace){ var replaced = ""; for(var i=0; < string.length; i++){ if(string[i] == chartochange){ replaced = chartoreplace; } } return replaced; } js has function replace. go through link: https://www.w3schools.com/jsref/jsref_replace.asp

ios - Fullscreen HTML5 videos without controls (PhoneGap) -

i have webpage video in background , ui elements on top of it. similar demo https://codepen.io/dudleystorey/pen/knqyk i'm trying import phonegap , test ios phone doesn't work expected. ui elements , poster image display @ start once video loaded, disappear , video start controls visible (start, pause, sound, etc). is possible have video tag behave same browser in phonegap? found similar question adding following in config.xml not work. <preference name="allowinlinemediaplayback" value="true"/> phonegap ios html5 video opens player my video code <video poster="img/start-anim.jpg" id="anim" playsinline autoplay webkit-playsinline> <source src="videos/ideal.mp4" type="video/mp4"> </video>

unix - How to execute commands on different CLI from shell script? -

i have connect different cli , execute few commands , exit. sudo $signmcli connects cli. below script doesn't work. want execute exit in signmcli . #!/bin/bash -xv signmcli=/opt/sign/eabss7024/bin/signmcli if [ -f "$filecheck" ]; sudo $signmcli exit; fi if following, works: #!/bin/bash -xv signmcli=/opt/sign/eabss7024/bin/signmcli if [ -f "$filecheck" ]; echo 'exit' |sudo $signmcli fi but, want execute multiple commands in signmcli . there anyway redirect control signmcli , after executing commands, control comes back? you can execute multiple commands using semicolon operator in script. cmd1 ; cmd2 ; cmd3 ... in case, suggest use ; or &. echo 'exit'; sudo $signmcli this basic usage of commands. * a; b run , b, regardless of success of * && b run b if succeeded * || b run b if failed * & run in background.

angular2 formbuilder - Angular 2 Reactive Forms - Binding select drop down value in form array of a reactive form -

i have created reactive form has form array. form group pushed form array on button click. every button click generates section of html on screen. this form group contains 2 drop down lists having parent-child relation i.e. selection of item in parent drop down decides values populated in child drop down. when select value in parent drop down change event fetches results child has limited scope of specific form array element. change event fetches data , sets values child drop downs in each form array element. basic structure of mark up <form [formgroup] = "mainform" (ngsubmit)="savedata()"> <div>some form control</div> <div formarrayname = "myarray" *ngfor="let arrayitem of myarray.controls";let = index"> <div [formgroupname] = "i"> <div> <select class="form-control" (change)="onselect($event.target.value)" id="{{'header' + i}}" formcontrolname=

IntelliJ IDEA 2017 JavaScript indention broken -

with last update v2017 got strange indention function arguments: const myfunction = ({ b, c, d, }) => ( is there way 2 spaces , not aligning parenthesis? const myfunction = ({ b, c, d, }) => ( known issue; destructuring parameters formatted described in web-25899 in bug-fix update 2017.1 (coming soon)

How to execute a function once when boolean value changes in python? -

i monitoring external device outputs boolean value of false when condition not met, , boolean value of true when condition met. problem is, boolean value output more once after condition met. this output looks like: false false false false true true false false false so able monitor value , execute simple function, once each time boolean changes false true. have seen other languages have simple "on change" function, know possible , lot easier i'm making out be. currently have this. sake of explaining this, variable "ext_data" used external data python script monitoring. while true: if ext_data == true: print("true") pass this prints "true" every time boolean equal true, , when resets boolean still set true, multiple readings when want one. thanks helps out! edit: updated code using edgedetector class written holdenweb. ext_data = true/false # returns true or false depending on state

asp.net mvc - What should be written inside the connection string when migrating SQL db to Azure with VS2015? -

Image
the situation want deploy local db created in vs2015 azure. looking attached image, should write inside connection string?

android - Freeze or make Stable Web-view When I Select Action Bar Back?Prevent Loading/reloading every time -

Image
i want prevent page reload or freeze current web-view when select menu option menu this webview public class mywebv extends appcompatactivity { private webview webview; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.mwview); toolbar toolbar = (toolbar) findviewbyid(r.id.tb1); setsupportactionbar(toolbar); webview = (webview) findviewbyid(r.id.web5); websettings set = webview.getsettings(); webview.setwebviewclient(new webviewclient()); webview.setwebchromeclient(new webchromeclient()); set.setjavascriptenabled(true); set.setjavascriptcanopenwindowsautomatically(true); set.setloadwithoverviewmode(true); set.setusewideviewport(true); set.setdomstorageenabled(true); set.setallowuniversalaccessfromfileurls(true); set.setjavascriptcanopenwindowsautomatically(true); webview.sets

Chrome with disable-web-security option does not load images anymore -

since yesterday (6th of april) chrome not load images anymore. i don't errors, no images. it because start chrome (on osx) command: open -a google\ chrome --args --disable-web-security --user-data-dir everything working fine when start chrome in normal way.

nginx - client_max_body_size for images in location -

i want increase max size of attaching images posting in media directory, using such instruction getting 413 request entity large location ~* .+/media/.+\.(jpeg|gif|png|jpg) { client_max_body_size 20m; } what mistake? such instructions as: location ~* .+/media/.+ { client_max_body_size 20m; } and: location ~* .+\.(jpeg|gif|png|jpg)$ { client_max_body_size 20m; } don't working too

ffmpeg - How to avoid audio pts start from zero after reconfigure the atempo? -

i found pts of audio start 0 if reconfigure atempo filter in ijkplayer based on ffplay. the code snippet ijkplayer #ifdef ffp_avfilter_playback_rate if (fabsf(ffp->pf_playback_rate) > 0.00001 && fabsf(ffp->pf_playback_rate - 1.0f) > 0.00001) { if (afilters_args[0]) av_strlcatf(afilters_args, sizeof(afilters_args), ","); av_log(ffp, av_log_info, "af_rate=%f\n", ffp->pf_playback_rate); av_strlcatf(afilters_args, sizeof(afilters_args), "atempo=%f", ffp->pf_playback_rate); } #endif if ((ret = configure_filtergraph(is->agraph, afilters_args[0] ? afilters_args : null, filt_asrc, filt_asink)) < 0) goto end; is->in_audio_filter = filt_asrc; is->out_audio_filter = filt_asink; how avoid audio pts start 0 after reconfigure atempo filter ?

java - How to create multiple beans of same type according to configuration in Spring? -

i'm trying create specified number of beans of same type in spring. i've tried: @bean(name = "beanlist") public list<mybean> beanlist( @value("${number:1}") int number ) { list<mybean> beanlist = new arraylist<>(number); (int = 0; < number; i++) { beanlist.add(new mybean()); } return beanlist; } but not expected. in way, bean "beanlist" maintained spring context, instead of it's elements, can't specify name , init method or destroy method each element in list. any ideas? you have @ beanfactorypostprocessor , tried following code , it's working fine, bean s depends on mybean autowire d: @configuration public class appconfig implements beanfactorypostprocessor { @override public void postprocessbeanfactory(configurablelistablebeanfactory beanfactory) throws beansexception { (int = 0; < 3; i++) { system.out.println("r

products - Output cross sells on separated page in Woocommerce 3.0.0 -

in woocommerce shop, when user add product cart, redirected "accessories" page contained cross sells products, used: <?php wc_get_template( 'cart/cross-sells.php' ); ?> that worked fine until woo has been updated 3.0.0. im getting: notice: undefined variable: cross_sells is there better way how output cross sells on separated page? if no: im using old template (see below), seems working, im not sure if right way. if should tweak cross-sells v3.0.0 template, can that? if ( ! defined( 'abspath' ) ) { exit; } global $product, $woocommerce_loop; if ( ! $crosssells = wc()->cart->get_cross_sells() ) { return; } $args = array( 'post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'post__in' => $crosssells, 'meta_query' => wc()->query->get_meta_query() ); $products

qml - How to make a cell editable in qt tableview -

i try make cell editable using tableview in qt. have found few examples , came following: tableview { id: tableview objectname: "tableview" horizontalscrollbarpolicy: -1 selectionmode: selectionmode.singleselection layout.minimumwidth: 300 layout.fillheight: true layout.fillwidth: true model: trackableinfomodel itemdelegate: rectangle { text { anchors.verticalcenter: parent.verticalcenter text: styledata.value } mousearea { id: cellmousearea anchors.fill: parent onclicked: { if(styledata.column === 2){ //do } }

Fetch data from Oracle SP Out Param SYS_REFCURSOR in Unix Korn Shell Script -

i have stored procedure in oracle out parameter sys ref_cursor. need execute sp korn shell . read output , use email body. not find example code read sys ref cursor in unix. below code. how can read cur ? print cur doesnt seem print output. #!/usr/bin/ksh function runproc { #read ref cursor proc cur=`sqlplus -s $connectiondetails <<eof set pagesize 0 feedback on verify off heading off echo off var return_val ; exec myproc_retcur(weeknum ,return_val); exit; eof` print return_val return cur } #---start----- runproc cur sendmail "weekly load test results", cur you have print return_val in wrong place; shoudl inside sql*plus command, before exit, print out ref cursor variable. you need prefix return_val colon in procedure call, indicate it's using bind variable declared - though omitted variable type declaration well. seems want: function runproc { #read ref cursor proc cur=

Git for Visual Studio lists unchanged files in 'changes'? -

i'm using visual studio 2015 ,and git extension visual studio . what makes me confused when pull code servers, , visual studio's team explorer lists many unchanged files in 'changes' area, after clicked 'compare unmodified', shows nothing different. but when use git bash git diff command, changes whitespaces or empty line. i don't change code, how fix this? thanks!

Is configuration variable to disable signals in kernel needed? -

while configuring semi-posix nuttx kernel, came across config_disable_signals disable signals. not sure if same linux well. what use of having kernel signals disabled? if not useful, why have configuration variable? could have asked in nuttx forum know nuttx specifics, interested across kernels. here nuttx specifics: have config_disable_signals reduce minimal code footprint 3kib. important people working on hardware minimal resources. tried rid of once , pissed off lot of people.

symfony - Entity validation - either zero or at least three -

i'm using symfony 2.8 version , have encountered following problem. want field 'seealso' of entity 'article' restricted have either 0 (none) or @ least 3 objects (another articles). have these in yaml validation: seealso: - count: min: 3 minmessage: 'you have got pick 0 or @ least 3 articles' it checks if less 3 well, not allow me let field empty. how make work? you should define custom validation. can proceed in 2 ways 1 create custom validation constraint first of need create constraint class use symfony\component\validator\constraint; /** * @annotation */ class constraintzerooratleastthreeconstraint extends constraint { public $message = 'put here validation error message'; public function validatedby() { return get_class($this).'validator'; } } here have defined constraint message , you're telling symfony validator (that we're going define below) use symfony\component\v

javascript - What is the best way to dynamically change the style of an application built with Polymer? -

my idea have different files (either .css or .html) containing rules specific theme , load theme dynamically changing look&feel of polymer application @ runtime. i have found pretty useful method described here polymer using custom style @ document level (using .html files) frequently want define custom property values @ document level, set theme entire application, example. because custom properties aren't built browsers yet, need use special custom-style tag define custom properties outside of polymer element. try adding following code inside tag of index.html file basically define my-theme.html , defines variables used in application style, looks this: <style is="custom-style"> /* define document-wide default—will not override :host rule in icon-toggle-demo */ :root { --icon-toggle-outline-color: red; } /* override value specified in icon-toggle-demo */ icon-toggle-demo { --icon-toggle-pressed-

html - jquery validation with form inside tabs -

i have 2 tabs has input form inside these tabs(the tabs inside 1 form). in first tabs input required , second 1 isn't. lets didn't fill first input , on second tabs. , when submit form, validation on first tabs doesn't work. , submit form here html: <ul class="nav nav-tabs"> <li class="active"><a href="#price" data-toggle="tab">price</a></li> <li><a href="#category" data-toggle="tab">category</a></li> </ul> <div class="tab-content m-t"> <div id="price" class="tab-pane fade in active"> <div class="col-sm-4"> <div class="form-group"> {!! form::label('price','price',array('class' => 'control-label')) !!}<span><strong> * :</strong></span>

html - css modules styles getting overridden by css framework -

my custom styles css modules being overridden bulma defaults. html (jsx) (footer.js): import { html } 'snabbdom-jsx' import styles './footer.styl' export default function footer() { const sinks = { dom: view() } return sinks } function view() { return ( <div classname="container"> <div classname="tabs is-centered"> <ul> <li><a><h4 classname={`subtitle ${styles.text}`}>if have issues or suggestions, contact @ support@volcalc.net!</h4></a></li> </ul> </div> </div> ) } css (footer.styl): div ul li h4.text { color: #fff; } i try more specific adding class div in css like: div.container ul li h4.text { color: #fff; } which stops css taking effect, not there overridden. know why happens. webpack 2 config: var path = require('path') var webpack = require('webpack') var extracttextpl

flask - Is there a way to receive a notification as soon as a certain task with a certain task id is successful or fails using Celery for Python? -

i want know if there way monitor whether or not task completes or fails using python celery. have event want fire based on results of task. you can run task celery @shared_task try except block inside: @shared_task def my_task(input1, input2, ...): setting up... try: stuff fire_success_event() <- success event except exception: above stuff failed fire_fail_event() <- fail event return 1 <- fail return 0 <- success good luck :)

How to correctly work with class libraries in ASP.NET Core (.NET Framework) application -

Image
i have created new asp.net core web application (.net framework) in visual studio. this application intedned use windows authentication chosen option when creating project. i trying export models , repository code out respective external class library projects cannot work. has have experience of this? what should project.json files in each class library if need reference them in main web project etc. the prject.json file generated visual studio contains following code. { "dependencies": { "microsoft.applicationinsights.aspnetcore": "1.0.0", "microsoft.aspnetcore.diagnostics": "1.0.0", "microsoft.aspnetcore.mvc": "1.0.1", "microsoft.aspnetcore.razor.tools": { "version": "1.0.0-preview2-final", "type": "build" }, "microsoft.aspnetcore.routing": "1.0.1", "microsoft.aspnetcore.server.iisi

Java class from json with same name -

i have json object following: ... { "url": "checkout.bodenusa.com/en-us" }, { "url": [ ".bonton.com/checkout/", ".bonton.com/checkoutview" ] } ... how should java class response server. i try snippet, incorrect: @serializedname("url") @expose private list<string> urllist = null; @serializedname("url") @expose private string url; create model import com.google.gson.annotations.expose; import com.google.gson.annotations.serializedname; import java.util.list; public class model { @serializedname("url") @expose private list<string> url = null; @serializedname("apply") @expose private apply apply; @serializedname("controls") @expose private controls controls; @serializedname("remove") @expose private remove remove; public list<st

How to create & assign Application Pool to the website deployed via WebDeploy Package -

i create application specific apppool (e.g – test) & assign website(that's being deployed) either webdeploy package creation process (via setparameters.xml file) or msbuild.i have tried both options, still no luck. appreciate quick on this. note:i checked stack overflow sit, did not work me : how target existing application pool webdeploy? option 1 action taken resolve issue: created parameters.xml file in same project , did following changes. can see apppool name reflected in setparameters.xml file once package generated. but, apppool not created on iis once website deployed successfully. parameters.xml <parameter name="application pool" description="enter name of application pool." defaultvalue="test" tags="apppoolconfig"> <parameterentry kind="providerpath" scope="apppoolconfig" match="test"/> <parameterentry kind="deploymentobjectattribute" scope="

mongodb - Why does my Google Compute Engine instance make Mongo return incorrect results? -

on google compute debian instance, 2 concurrent mongo findoneandupdate in mongo shell make second 1 return null , though there plenty items left process. not happen on other hardware (like macbook pro on macos sierra) using same database , version numbers. what makes difference: removing sort; either because problem goes away, or because query fast chances of collision small. as said; running same mongodb version on different hardware/os (don't have access debian jessie on own hardware). what not make difference: adding/removing indices, returnoriginal . background info: google compute engine n1-highmem-2 (2 vcpus, 13 gb memory) instance running debian jessie mongodb version 3.4.3 the collection contains 1.8 million records. here's query ; names have been changed protect innocent: db.mycollection.findoneandupdate( { "foo" : { "$exists" : 1 }, "baz.pid" : { "$exists" : 0 }, "$or" : [

php - Text to speech not working in Twilio -

i create simple app in php. call phone number , play audio. working when changed <play></play> <say></say> ,it not working. answer phone no sound, , after 8 seconds hang up. there no error in logs. <?php require __dir__ . '/twilio-php-master/twilio/autoload.php'; use twilio\rest\client; // account sid , auth token twilio.com/user/account $sid = "acxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; $token = "018616xxxxxxxxxxxxxxxxxxxxxxxxxx"; $client = new client($sid, $token); $call = $client->calls->create( "+173145xxxxx","+183224xxxxx", array("url" => "https://xxxxx.ngrok.io/voice.php") ); echo $call; ?> this php file responds xml, <?php header("content-type: application/xml"); ?> <?xml version="1.0" encoding="utf-8"?> <response> <say>this test messsage.</say> </response>

python - TfIdfVectorizer with grouped tokens -

i've vectorized ~1million of textual documents tfidfvectorizer. vect1 = tfidfvectorizer() vect1.fit_transform(data) now need group (semantically similar) tokens , repeat vectorization. replacing tokens in raw data new ones seems tedious , time consuming me, since intend repeat process multiple grouping strategies. i've tried voc = vect1.vocabulary_ voc['cabman'] = voc['driver'] # grouping similar tokens have same ids ... vect2 = tfidfvectorizer(vocabulary=voc) vect2.fit_transform(data) valueerror: vocabulary contains repeated indices. is there efficient way accomplish without touching input data?

Facebook Commenting -

i displaying fb comments on website using following script <script>(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_gb/sdk.js#xfbml=1&version=v2.8&appid={here app id}"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> its working perfect, issue coming while commenting, there line below comment box your comment may appear on "page 1" facebook page. i want should show "page 2" page of mine, , admin of both pages. there way can associate commenting app other facebook page. created few other apps showing same page.

TYPO3 Backend XML FlexForms T3DataStructure / TCEforms -

i search example, can use in typo3 backend xml flexforms t3datastructure / tceforms other structure or divide php tca ? example: 2 elements side side, or 1 subheader ? in moment use 1 config , 1 label, , elements among each other: <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <t3datastructure> <meta> <langdisable>1</langdisable> </meta> <root type="array"> <type>array</type> <el type="array"> <rowcolumns type="array"> <tceforms type="array"> <label>spalten einrücken</label> <config type="array"> <type>check</type> <default>0</default> </config> </tceforms> </rowcolumn

linux - How to use sed to grep specifc values from a file -

i new using sed command , question might basic one. i having log file , trying grep errors , extract required values error lines. i facing problem when there more 9 pattern groups in sed. tried using sed -e have multiple sed not seem work. commands tried command #1: grep error file | sed -n 's_.*key1=\([0-9]*\), key2=\([0-9]*\),.* key3=(.*\), key4=\([a-za-z0-9_]*\),.* key5=\([a-z0-9]*\),.*key6=\([a-za-z0-9]*\),.*key7=\([0-9]*\), key8=\(.*\), key9=\(.*\), key10=\(.*\)}.*_\1,\2,\3,\4,\5,\6,\7,\8,\9,\10_p' in above output, number 10 being printed instead of value matching 10th pattern command #2: this awk command, did wanted though not able format proper comma separated values. awk -f "\n" '/error/ && match($0,/key1=([0-9]*), key2=([0-9]*),.*key3=(.*),key4=([a-za-z0-9_]*),.*key5=([a-z]*).*key6=([a-z]*),.*key7=([a-z0-9]*),.*key8=([0-9]*).*key9=([a-za-z0-9]*)/,a) { (i=1; in a; i++) { printf "%s%s", a[i], (i<leng