Posts

Showing posts from September, 2015

php - Is there a way to specify only some optional function args? -

i have function public function test($arg1, $arg2 = "a", $arg3 = "b") is there way call specifying $arg1 , $arg3 leaving $arg2 default value? function test($arg1, $arg2 = "a", $arg3 = "b") { if (is_null($arg2)) $arg2 = "a"; return $arg1.' '.$arg2.' '.$arg3; } echo test(1, null, 3); output: 1 3 will point out in javascript quite common: function test (input, callback) { $.post( "example.com/endpoint", input, function(err, data) { if (error || response.statuscode !== 200) { callback(true, response) } callback(null, data) }) } test({ 'id': 1, 'name': 'mary' }, function (err, data) { if (err) { console.log.error('error!!') console.log(data) } console.log.info(data) })

java - How to log everything in 'when' part of Drools rule? -

i have log responsible fire rule in drools objects, conditions etc. i able objects using agendaeventlistener , writing below code in beforeactivationfired method of it. @override public void beforeactivationfired(beforeactivationfiredevent event){ event.getactivation().getobjects(); } but how conditions , methods called on object? have object used global variable used validate values against values in cache i.e. in when part of rules different methods on global object(have hundreds of methods in it) called. now want have information on methods called can log information before hand because after execution values in cache might change. for example - if in when part below condition there wish know condition value of both sides in condition i.e. value of $val $cache.getcurrenttimestamp()(please note method called on cache not known beforehand). $val : timestamp, $val == $cache.getcurrenttimestamp() how can achieve task?

utf 8 - Mystery UTF-8-like encoding -

i've been given file supposedly in utf-8, there weird encodings of non-english characters. example, in mystery encoding, hangul string 한국경북영덕군강구면 is encoded as: 0xed959c 0xeab5ad 0xeab2bd 0xebb63f 0xec983f 0xeb3f95 0xeab5b0 0xeab095 0xeab5ac 0xeba9b4 (differences in bold) rather standard utf-8: 0xed959c 0xeab5ad 0xeab2bd 0xebb681 0xec9881 0xeb8d95 0xeab5b0 0xeab095 0xeab5ac 0xeba9b4" i'm seeing same phenomena cyrillic , chinese characters--some characters have same encoding utf-8, different. garbled characters have same byte width non garbled ones , i've verified aren't part of extension set. also, i've verified not java "modified utf-8". any other ideas may be? btw: don't have access code or people wrote file. also, i'm on mac 10.11.6 in case has it. your example string consists of utf-8, byte values (namely x81 , x8d) replaced ascii question mark ? (x3f). plausible explanation example

go - Twitter oauth golang getting Error "code":32,"message":"Could not authenticate you." -

i trying implement signing in twitter account in golang. first step in trying request token. reference used mrjones's code available @ below link. https://github.com/mrjones/oauth/blob/master/examples/twitterserver/twitterserver.go i getting following error. please let me know going wrong: {"errors":[{"code":32,"message":"could not authenticate you."}]} var twitterconf = &twitterconfig{ clientid: " consumer key", clientsecret: "my consumer key secret", redirecturl: "http://localhost:8080/oauth/twitteroauth2callback", endpoint: serviceprovider{ requesttokenurl: "https://api.twitter.com/oauth/request_token", authorizetokenurl: "https://api.twitter.com/oauth/authorize", accesstokenurl: "https://api.twitter.com/oauth2/token", }, } func handletwitterlogin(res http.responsewriter, req *http.request, _ httprouter.para

android - Can't build recovery image with AOSP 4.2.2 -

i trying build recovery.img aosp 4.2.2 following commands: cd myandroidsrc source build/envsetup.sh lunch make recoveryimage -j8 but keep running following error: find: `src': no such file or directory ... lot of "product_copy_files /frameworkds/base/data/.. .ogg ignored" messages ... cp -f /boot.img /device/myvendor/mydevice/boot/ cp: cannot stat `/boot.img': no such file or directory make: *** [out/target/product/mydevice/boot.img] error 1 make: *** deleting file `out/target/product/mydevice/boot.img' make: *** waiting unfinished jobs.... i tried build boot image with: make bootimage but results in same error @ make recoveryimage call. missing make call here or file structure wrong ? are using prebuilt boot.img if yes check path properly. cp -f /boot.img /device/myvendor/mydevice/boot/ can see above root of device tree should have boot.img being copied.

jquery datatables custom ajax client -

i have custom javascript client works remote api using ajax. suppose myapiclient below: var myapiclient = function() { this.invoke = function (config, callback) { // ... } } how can configure jquery datatables can use myapiclient rather built-in ajax working jquery datatables provides internally? that is, suppose loading remote data, need call client way: var client = new myapiclient(); client.invoke({ url: '/api/app/v1/some-entity/all', function(result, err) { // ... } }); thank already use ajax option define function retrieve data through own ajax call. as function, making ajax call left allowing complete control of ajax request. indeed, if desired, method other ajax used obtain required data, such web storage or firebase database. when data has been obtained data source, second parameter ( callback here) should called single parameter passed in - data use draw table. for example: $('#example').datatable( {

java - Spring boot with Spring Security and custom database -

sorry in advance bad english.. since have changed database configuration don't succeed log me on application. using spring security. before making changes worked. i have 2 entities : user.java userrole.java user.java package betizy.models; //imports @entity @table(name = "use_user") public class user { @id @generatedvalue(strategy = generationtype.auto) @column(name="use_id") private long id; @notnull @column(name = "use_username") private string username; @notnull @column(name = "use_password") private string password; @notnull @column(name = "use_email") private string email; //getters , setters } userrole.java package betizy.models; //imports @entity @table(name = "usr_user_role") public class userrole { @id @generatedvalue(strategy = generationtype.auto) @column(name="usr_id") private long id; @manytoone @joincolumn(name = "usr_use_id") private user user; @notnul

excel vba - UserForm Close button fails after form launched for second time -

i have userform , a, command button opens userform b using below code: private sub cmd_click() me.hide b.show end sub b, when closed via x button, runs following: private sub userform_terminate() unload me a.show end sub after: opening b (from a) closing b , returning and opening b again the close button on b ceases work. userform menu form leads several others, navigating , forth between menus pretty basic requirement. behaviour reproducible every form linked a, tertiary forms open those. given target demographic of older generation, want userforms intuitive use, means preserving regular close button functionality. does have info on this? may google-fu lacking, can't seem find has had same issue. input @ stage appreciated! use variable refer 2nd userform in first gives greater control on second forms status - can unset variable after have closed 2nd form , returned event handler instantiated in first place. guarantees each tim

c++ - Data File Handling - find count of word in file -

i have homework question: write function in c++ count presence of word ' do ' in text file. what have tried: i tried first search word ' d ' in text file, search ' o ' if present after it. #include <iostream> #include <fstream> using std::fstream; using std::cout; using std::ios; int main() { char ch[10]; int count=0, a=0; fstream f; f.open("p.txt", ios::in); while(!fin.eof()) { fin.get(ch) if (ch[a]=='d') { if ((a++)=='o') count++; } a++; } cout << "the no of do's is" << count; f.close(); } but idea useless. cannot think of other ideas. love have hint regarding in 2 scenarios: 1.count word 'do' independently existing. 2.count word 'do' present anywhere in text. this data file handling question. the algorithm follows have. structure while-loop

evaluation - Controlling Prolog variable value selection -

inspired an earlier question tried implement enumerate possibilities boolean expression. however, i'm having trouble variable choice. here's intended outcome: ?- eval(x^y, r). r = 0^0; r = 0^1; r = 1^0; r = 1^1; no. here's code: :- op(200, yfx, ^). split(v, r) :- var(v), r = 0. split(v, r) :- var(v), r = 1. split(x ^ y, xp ^ yp) :- split(x, xp), split(y, yp). this doesn't want simple case: ?- split(y, r). r = 0 ; r = 1 ; y = _g269^_g270, r = 0^0 ; y = _g269^_g270, r = 0^1 ; y = _g269^ (_g275^_g276), r = 0^ (0^0) ; y = _g269^ (_g275^_g276), r = 0^ (0^1) ; y = _g269^ (_g275^ (_g281^_g282)), r = 0^ (0^ (0^0)) . so, can see problem here, on way through split(y, yp) prolog has exhausted first 2 clauses, winds in split(x^y, ...) again, unifying y x'^y' , essentially. not sure need close off path except @ outset have structure ^/2 . i'd work nested structures, can't eliminate recursive processing of branches. edit : without operators

javascript - i am storing an array in sessionstorage and retrieving through sessionstorage. I am getting the data but i am unable to repeat the array -

var x=[ { "xyz":1, "abc":"dashboard", "def":0, }, { "xyz":2, "abc":"facility", "def":0 }] this original data.then storing data using session storage below--- $window.sessionstorage.setitem("useritems", json.stringify(x)); then retrieving data using sessionstorage--- $window.sessionstorage.getitem("useritems") i getting data correctly-- [{ "xyz":1, "abc":"dashboard", "def":0, }, { "xyz":2, "abc":"facility", "def":0 }] but unable repeat data , displaying data. you need wrap json.parse() : json.parse($window.sessionstorage.getitem("useritems"));

math - MATLAB: ways to compute the settling time of a signal in Matlab -

i compute settling time of signal y in matlab. should give amount of time required before signal reaches steady state error |y(t)-y_{ss}| smaller absolute value x , stays smaller x future times. i tried use matlab function stepinfo, defines value x "a fraction 2% of peak value future times" , not want. is there way adjust matlab function stepinfo, or way code myself?

c# - How to correlate data from datatables -

i have 3 datatables contains data follows. posting small part of these datatables. first datatable dtnc rnlidentifier(bsc) userlabel 3 test_123 5 fasi_123 6 kira_123 second datatable dtsite rnlsupportingid sitename {bsc 3,btsrdn 68} vm_ao_3980 {bsc 3,btsrdn 69} vm_ao_3981 {bsc 5,btsrdn 70} vm_ao_3975 {bsc 5,btsrdn 71} vm_ao_3976 {bsc 6,btsrdn 74} vm_ao_3233 {bsc 6,btsrdn 75} vm_ao_3234 third datatable dtcell cellmanager cellname {bts{bsc 3,btsrdn 68}} am_an_1000 {bts{bsc 3,btsrdn 68}} am_an_1001 {bts{bsc 6,btsrdn 74}} am_al_1200 {bts{bsc 3,btsrdn 68}} am_an_1201 the relation 1 row of dtnc contains many dtsite , 1 row of dtsite contains many dtcell .now if want push cell information in database cellname,sitename,userlabel ,but don't know how correlate them. if have 2

python - Scraping using Beautiful Soup leads to error only in a particular section (NullType object encountered) -

i'm trying list of injuries of particular team (liverpool in case) following website http://www.physioroom.com/news/english_premier_league/epl_injury_table.php it works fine teams(swansea), exits following errors (liverpool, everyon) typeerror: can't convert 'nonetype' object str implicitly here code using. from bs4 import beautifulsoup import urllib.request url = "http://www.physioroom.com/news/english_premier_league/epl_injury_table.php" html = urllib.request.urlopen(url).read() soup = beautifulsoup(html, "html.parser") #lp = soup.find(alt="liverpool away shirt").parent.parent.parent.next_sibling.next_sibling lp = soup.find(alt="swansea city away shirt").parent.parent.parent.next_sibling.next_sibling player_info = "" player_list = [] while true: if(lp.has_attr('id')): break else: tdlist = lp.find_all('td')# player_info = tdlist[0].string+"\t"

php - how to restrict registered user from trying to vote again -

this question has answer here: how restrict registered user trying vote twice [closed] 1 answer i'm new php coding , website designing. i'm trying develop online voting system, registered users only, allowed vote. have done , it's working fine, need after user have logged out, how can make user not able login again , vote twice? or how can redirect user second time? you can manage user taking field in database table. applying condition on field @ time of login able restrict user had given vote.

c# re-throw exception in a method designed to handle exceptions and preserve stacktrace -

i want write method handle exceptions , called inside catch block. depending on type of exception passed, exception either passed inner exception of new exception or re-thrown. how preserve stack trace in second case ? example : public void testmethod() { try { // can throw exception specific project or .net exception someworkmethod() } catch(exception ex) { handleexception(ex); } } private void handleexception(exception ex) { if(ex specificexception) throw ex; //will not preserve stack trace... else throw new specificexception(ex); } what not is, because pattern repeated in many places , there no factorization : try { someworkmethod(); } catch(exception ex) { if(ex specificexception) throw; else throw new specificexception(ex); } you need use throw without specifying exception preserve stack trace. can done inside catch block. can return handleexception w

android - Repeating alarm is not working in marshmallow -

i using following code start service periodically whether app foreground or not . intent getalertintent = new intent(getapplicationcontext(), getalertalarmreceiver.class); pendingintent getalertpendingintent = pendingintent.getbroadcast(getapplicationcontext(), 0, getalertintent, 0); alarmmanager getalertmanager = (alarmmanager) getapplicationcontext().getsystemservice(context.alarm_service); getalertmanager.setinexactrepeating(alarmmanager.rtc_wakeup, system.currenttimemillis(), 10000, getalertpendingintent); the code receiver following public class getalertalarmreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { intent = new intent(context, getalertserviceintent.class); context.startservice(i); } } and , service public class getalertserviceintent extends intentservice { public getalertserviceintent() { super("getalertserviceintent"); } @override public voi

Color-coded timeline plot in R -

i working on visualising user touch interactions within mobile application. plot them in one-dimensional timeline color-coded action type. i.e., 2 variables time (in ms, on x-axis) , type of touch (used color-code line). colors should able repeated. ideally plot this , , have found this previous question delivers similar, i'm wondering if there isn't better. is there other methods using r allow me this? i have workings of base r method. it's bit hacky, tweaking should work nicely. have removed reliance on data.table , timeline , , ggplot packages, opting using polygon function. df <- data.frame(set=c("x","y","z","x","y","z","x","y","z","x","y","z","x"), startdate=c(1380708900,1402963200,1420070400,1421280000,1410912000,1396310400,1397520000,1418860800,1404172800,1405382400,1395100800,1412121600,1413331200),

android parsing using php genrated JSON -

i have created php script , pick java im having trouble converting format can use. php <?php //pdo extension defines lightweight, consistent interface accessing databases in php. $db=new pdo('mysql:dbname=mydb;host=localhost;','root',''); //here prepare query analyzing, prepared statements use less resources , run faster $row=$db->prepare('select * drinks'); $row->execute();//execute query $json_data=array();//create array foreach($row $rec)//foreach loop { $json_array['drinks_id']=$rec['drinks_id']; $json_array['drink_name']=$rec['drink_name']; $json_array['description']=$rec['description']; //here pushing values in array array_push($json_data,$json_array); } //built in php function encode data in json format //print_r($json_array); echo json_encode($json_data,json_force_object); ?> json sample(each row accumative instead of being

python - How to insert QWidgets in the middle of a Layout? -

Image
i'm using qt framework build graphical user interface. use qgridlayout position qwidgets neatly. gui looks this: my application regularly adds new widgets gui @ runtime. these new widgets not added @ end of qlayout, somewhere in middle. the procedure bit cumbersome. applied on figure above, need take out widg_c , widg_d , ... qgridlayout. next, add widg_x and widg_y , , put other widgets again. how remove widgets qgridlayout: for in reversed(range(mygridlayout.count())): self.itemat(i).widget().setparent(none) ### as long you're dealing small amount of widgets, procedure not disaster. in application display lot of small widgets - perhaps 50 or more! application freezes second while procedure ongoing, annoying user. there way insert widgets somewhere in qlayout, without need take out other widgets? edit: apparently solution qvboxlayout simple. use function insertwidget(..) instead of addwidget(..) . docs can found link: http://doc.qt.io/qt-5/qboxlayou

Pact file with multipart-form data fails due to missing "CR" carriage return -

i trying write pact test uses multipartform data. pact doesn't support multipartform data post request out of box forming required post data myself , here looks like string newline = system.lineseparator(); return "--" + boundary + newline + "content-disposition: form-data; name=\"file\"; filename=\"" + filename + "\"" + newline + "content-type: " + contenttype + newline + "content-transfer-encoding: binary" + newline + newline + filecontent.trim() + newline + "--" + boundary + "--"; when pact runs request @ consumer end above generated data in new line char \r\n (crlf running on windows), when request hits mock server see body contains \n instead of \r\n causes request mismatch , pact doesn't generate pact file. not sure \r gets stripped off lets instead \r\n , use \n (which ideally not correct windows

c# - Is SSL certificate is need for implementing Azure authentication/Authorization to the Asp.net MVC? -

i have developed asp.net mvc web app work or school account authentication mode. created code base moved azure app service , same code working fine in local not in azure app service. suspect problem due not adding ssl certification website. thanks in advance..!! ssl certificate may needed oauth providers, it provided azure automatically (unless host app on custom domain). problem must different.

javascript - My JQuery count down is not working perfectly, -

i want make jquery timer count down. should have days, day, month, hours, seconds. used below code, not working. when browser refreshed, counter restarting. please me correct code. this jsfiddle https://jsfiddle.net/saifudazzlings/lfldo381/ the js code: var sec = 60; var min = 100; var hr = 24; var updatetimer = function() { var timer = localstorage.getitem('timer') || 0; var timermin = localstorage.getitem('timermin') || 0; var timerhr = localstorage.getitem('timerhr') || 0; $("div#timermin").html(timermin); $("div#timerhr").html(timerhr); if (timer === 0) { $("div#timer").html("00"); } else if (timer <= 1) { timer--; timermin--; localstorage.setitem('timermin', timermin); $("div#timermin").html(timermin); if (timermin < 1) { if (timerhr == 0) { localstorage.removeitem('timermin

How to produce a .js file from a haskell source file with haste? -

so noticed, while answering this question , 1 asked question appears javascript developer. , code wrote in haskell easy enough, thought give haste try , try compile javascript. so, downloaded windows binary package of haste (why .msi require reboot?!!?), added path, issued haste-cabal update , haste-cabal install split , after bit of reading output of hastec --help , issued: ps e:\h\stackoverflow> hastec -o hexagon.js --pretty-print hexagon.hs best guess on how output looking for. opposite expectation, haste output this: hastec.exe: user error (shell expression failed in readmodule: data.binary.get.runget @ position 8: not enough bytes) so, question: have java script source file? is possible have old version of haste lying around, or have intermediate files ( .jsmod , instance) different version of compiler in source directory? sounds (quite unhelpful) error message haste produces when runs corrupted intermediate file. check version of binary you're c

ruby on rails - Function draws Error with Postgres Databse but not on Sqlite -

so after shifting code heroku in postgres 1 of functions drawing error. def index @tutor = tutor.where(:admin => false) @tutor_array = [] @tutor_array << @tutor.fees_search(params[:fees_search]) if params[:fees_search].present? @tutor_array << @tutor.subject_search(params[:subject_search]) if params[:subject_search].present? @tutor_array << @tutor.lssubject_search(params[:lssubject_search]) if params[:lssubject_search].present? @tutor_array << @tutor.ussubject_search(params[:ussubject_search]) if params[:ussubject_search].present? @tutor_array << @tutor.jcsubject_search(params[:jcsubject_search]) if params[:jcsubject_search].present? @tutor_array.each |tutor| ids = @tutor.merge(tutor).map(&:id) @tutor = tutor.where(id: ids) end @tutor = @tutor.sort_by { |tutor| tutor.rating.rating }.reverse @tutor = @tutor.paginate(:page => params[:page], :per_page => 2) end the particular line

sqlite - SQL: checking if row contains contents of another cell -

i'm having difficulty sql query. i have 2 tables: table 1 id/first name 1 ben 2 barry 3 birl table 2 id/full name 1 ben rurth 2 barry bird 3 burney saf i want run check between 2 tables if contents of first name in table 1 not in full name in table 2 result returned, e.g. returning id 3, birl, in above example. i have been trying queries like: select first_name table_1 not exist (select full_name table_2) with no luck far. you can make use of like clause combined concatenation. select t1.first_name,t2.full_name table1 t1 join table2 t2 on t1.id = t2.id t2.full_name not '%' || t1.first_name || '%' or select t1.first_name,t2.full_name table1 t1 join table2 t2 on t1.id = t2.id t2.full_name not concat('%', t1.first_name, '%') this is, understanding both tables shares id column.

javascript - Problems with multiple dropdown menus -

i'm experimenting multiple dropdown menus. works problem third button closes when click on else third button doesnt work 2 other buttons, sidenote: when removed 3rd button second button work. here code. know way make work 3 buttons. <!doctype html> <html> <head> <link rel="stylesheet" href="neww.css" type="text/css"> </style> </head> <body> <ul> <li class="logo"><a href="new2.html" id="img"><img class="logos" src="logo.png" alt="hitachi logo"></a></li><br> <li><a href="#news">news</a></li><br> <li class="dropdown"> <button onclick="myfunction()" class="dropbtn">dropdown</button> <div id="mydropdown" class="dropdown-content"> <iframe name="

c# - Auto-populate CreatedByUserId in MVC5 models -

i have asp.net mvc5 crud application using windows authentication , site secured active directory group, members in group have same permissions. using entity framework 6 access database. i have basic user model @ present login domain\username . models reference model via createdbyuserid property, i've omitted relationships other models below. public class user { [databasegenerated(databasegeneratedoption.identity)] public int id { get; set; } [index(isunique = true)] [maxlength(100)] public string login { get; set; } [databasegenerated(databasegeneratedoption.computed)] public datetime createddatetime { get; set; } } i want able achieve 2 things though not sure how without repeating code in controllers: users authenticated via active directory group have user model created , stored in database, if doesn't exist. when new items created createdbyuserid populated id of user performing action. i believe first part achieved via gl

Convert uploaded file with php -

i want convert .bib files html using php script ( http://www.monperrus.net/martin/bibtexbrowser/ ) i have form <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file1"> </form> the upload.php : <?php $_get['library']=1; define('bibtexbrowser_bibtex_links',false); // no [bibtex] link default require_once('bibtexbrowser.php'); global $db; $db = new bibdatabase(); // $db->load('uploads/ref.bib'); $db->load("uploads/". $file_name); // printing 2014 entries // can $query = array('year'=>'.*'); $query = array('year'=>'2014'); $entries=$db->multisearch($query); uasort($entries, 'compare_bib_entries'); foreach ($entries $bibentry) { echo $bibentry->tohtml()."<br/>"; } ?> in other

pivot - MySQL converting colums to rows -

i'm trying figure out how count presidents, managers etc , convert columns rows in 1 query. example there sample db 'employee' here: http://www.mysqltutorial.org/tryit/ can count employees of types using query this: select sum(case when jobtitle = 'president' 1 else 0 end) 'presidents', sum(case when jobtitle 'vp%' 1 else 0 end) 'vps', sum(case when jobtitle '%manager%' 1 else 0 end) 'managers', sum(case when jobtitle '%rep' 1 else 0 end) 'reps' employees; but want convert columns rows , have no idea how include in query similar answer here: mysql convert column row (pivot table ) have idea? you use sub query standardise job titles, group , order case statement to produce output in descending order of bossiness. select jobtitle,count(*) ( select case when jobtitle = 'president'

jquery - Image size (responsive slider) -

i using responsive http://bxslider.com/ on website. problem is, have got large images big file size , if want watch website on mobile device, tooks ages load. the bxslider works img-tags in html , looking way, browser maby decide images version example large, medium or small chooose. i know, how work div's in css example media queries, not know, how done images in html. any suggestions? sorry, english :p for responsive images have put max-width:100% image tag. , outer div or element can set width. can re-wright repective of device width using css media query.

charts - Stackdriver Dashboard - Cannot save a dashboard with a custom log-based metric -

i have created log-based metric log messages generated dataflow job. filter on metric based behaving correctly (the expected data displayed in logs viewer when using filter). i trying create dashboard using user defined log-based metric following procedure described here https://cloud.google.com/logging/docs/view/logs_based_metrics#creating_a_chart however, after select custom metric metric drop-down, no data displayed in preview chart , save button not enabled. attempting use advanced options not either. troubleshooting section did not help. also, have waited lot of time after creating log-based metric , before attempting create chart make sure data available (to exclude situation noted on page mentioned above: "note: after have created logs-based metric, appear in relevant stackdriver monitoring menus have no data. takes few minutes stackdriver monitoring acquire data stackdriver logging.") am missing or bug? i'm product manager stackdriver. dataf

javascript - Multiple Arrays in Selects JQuery, PHP, MySQL -

i come because i'm working on php project want fast , smart. so, have make 2 selects using jquery work way: when pick in first select option, select apear options corresponding first select. i'm working objects, i'm going create arrays contain datas. so have 2 tables: material, family each material got family (idfamily) what want is: step 1: select family on first select step 2: on change, or on click or whatever (i'll figure out), second select appears. , in select, materials idfamily correspond family selected on first select appear. is possible if save datas in 2 arrays ($materials , $families) ? i'm sorry english, it's not native language. answers!

Css animation, increase height move up instead of down -

i have element want animate, has increase in height, when animation happens, height gained downwards. how can revert that? here's example: https://jsfiddle.net/sppp7jdv/ the code in example: $(".triggerzone2").on("click", function() { $(".rainbow").toggleclass("rainbowed"); }); .triggerzone2 { width: 200px; height: 100px; border: 5px solid black; margin-left: 15%; } .rainbow { width: 10%; height: 30px; position: absolute; z-index: -1; top: 10%; } .rainbowed { animation-name: myframes; animation-duration: 2s; animation-timing-function: ease-in-out; animation-delay: 0s; animation-iteration-count: 1; animation-direction: normal; animation-fill-mode: forwards; animation-play-state: running; } @keyframes myframes { { height: 0px; } { height: 400px; } } .color1 { width: 14%; height: 100%; background: linear-gradient(to right, white, #f

android - how to hide image view on coordinate layout (like fab hide on scroll)? -

Image
i want hide/disappear image view(like fab) when scroll coordinate layout behavior behave first while scroll and and layout xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:id="@+id/lyoutfeedloadmore" android:layout_width="match_parent" android:layout_height="40dp" android:layout_alignparentbottom="true" android:background="#fafafa" android:gravity="center" android:visibility="gone"> <progressbar android:id="@+id/progressbar" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </linearlayout> <vie