Posts

Showing posts from May, 2013

javascript - Delete Result input if both values from other inputs are not in it -

please edit title if have better. couldn't think of way this. in short, have 2 form field values going resultcell element. this works, need delete result text if doesn't have both values of cellinput , cellselection in it. any appreciated. html <input type='text' id='cellinput'/> <select id='cellselection'> <option value='@tmomail.next'>tmobile</option> <option value='@vzwireless.com'>verizon</option> </select> <input type='text' id='resultcell'> javascript var cellin = document.getelementbyid('cellinput'); var dropdown = document.getelementbyid('cellselection'); var textbook = document.getelementbyid('resultcell'); dropdown.addeventlistener('change', function(){ textbook.value = cellin.value + dropdown.value; }); you need check length of input , ensure isn...

java - How to prevent Jsoup from throwing exception on http error? -

i using jsoup make app info public transport card cash balance. if user input incorrect card id , app send website, server send http error 409 , output card such id doesn't exist. managed write simple peace of code: if (res1.statuscode() == 200) { doc1 = res1.parse(); answer = doc1.body(); title = answer.text(); } else if (res1.statuscode() == 409) { title = "neteisingas kortelÄ—s numeris arba nepavyko patikrinti"; } which writes string title , because without solution, leave title empty, leads string tokenizer exception in other part of code. after have come question how prevent jsoup throwing exception? my exception: 07-27 23:30:12.831 22409-22427/com.bjobs.vvtcards w/system.err: org.jsoup.httpstatusexception: http error fetching url. status=409, url=https://mano.vilniustransport.lt/card/card-check?number=1231234566&_csrf_token=ke_q5doiizhcib5osus-n6mlslxh-im78brcfyn631c 07-27 23:30:12.831 22409-22427/com.bjobs.vvtcards w/system.err: @ org...

Python Selenium using onclick -

i using selenium in python , cannot find , select ok button. here code trying use not finding button. submitelem = driver.find_element_by_name('ctl00$placeholdermain$ctl01$rptcontrols$btnok') submitelem.submit() and webpage code <input name="ctl00$placeholdermain$ctl01$rptcontrols$btnok" value="ok" onclick="javascript:webform_dopostbackwithoptions(new webform_postbackoptions(&quot;ctl00$placeholdermain$ctl01$rptcontrols$btnok&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl00_placeholdermain_ctl01_rptcontrols_btnok" accesskey="o" class="ms-buttonheightwidth" type="submit"> any advice on doing wrong? found suggestions add onclick*= did not seem work. as noted earlier, if element in iframe, need switch contexts . additionally, if element takes time show on dom, due being dynamically rendered javascript, might n...

url rewriting - Rewrite Url Twice ocpsoft first Rewrite then PrettyFaces -

currently i'm using prettyfaces, nowadays have add prefix urls pretty-config based on information retrieved user session. purpose decided use rewrite. example in pretty-config have many entries this: <url-mapping id="notepad"> <pattern value="/my/notepad/#{num}" /> <view-id value="/notepad.xhtml" /> </url-mapping> <url-mapping id="book"> <pattern value="/my/book/#{isbn}" /> <view-id value="/book.xhtml" /> </url-mapping> and when user john login application want have urls containing prefixed john while still using features of prettyfaces. achive goal have written these rules: .addrule()//number 1 //to compatibile entries pretty-config .when(direction.isinbound() .and(path.matches("/{username}/my/{rest}") .and(usernameinurlmatchesusernameinsession))) .perform(substitute.with("/my/{r...

c# - How to pass Jenkins string parameter in Nunit Test -

Image
i have added string parameter in smoke test job use in nunit test(written using c#) pass parameter dynamically based on environments. highly appreciated. thanks. here string parameter in jenkins: i want use "currentenv" jenkins in code, i'm using config file shown below: public class helper { public static readonly int currentenv = getcurrentenv(); private static int getcurrentenv() { var envappsetting= configurationmanager.appsettings["currentenv"]; int currenv; switch (envappsetting) { case "dev": currenv = 1;// dev case "qa": currenv = 2; // qa break; default: currenv = 1; break; } return currenv; } }

python - Calling function on valid values of masked arrays -

i have 2 numpy masked arrays: >>> x masked_array(data = [1 2 -- 4], mask = [false false true false], fill_value = 999999) >>> y masked_array(data = [4 -- 0 4], mask = [false true false false], fill_value = 999999) if try divide x y , division operation not performed when 1 of operands masked, don't divide-by-zero error. >>> x/y masked_array(data = [0.25 -- -- 1.0], mask = [false true true false], fill_value = 1e+20) this works if define own division function, div : >>> def div(a,b): return a/b >>> div(x, y) masked_array(data = [0.25 -- -- 1.0], mask = [false true true false], fill_value = 1e+20) however, if wrap function vectorize , function called on masked values , error: >>> np.vectorize(div)(x, y) traceback (most recent call last): file "<input>", line 1, in <module> file "/usr/lib64/py...

javascript - Highcharts rounding yaxis and xaxis digits -

i trying round yaxis , xaxis down. example 3843 should 3.843 on graph , tooltip show 3.843 k. i have got tooltip working cant change graphs yaxis , xaxis value graph can show sides fully. as can see here: http://jsfiddle.net/kzl0phfu/ this xaxis looks like yaxis: { gridlineinterpolation: 'polygon', linewidth: 0, min: 0, gridlinecolor: "#808080", gridlinedashstyle: "solid", gridlinewidth: 2, labels: { format: '{value:.2f}', style: { color: '#c4c4c4', font: '11px trebuchet ms, verdana, sans-serif' } } } use datalabels formatter achieve desired result plotoptions: { area: { datalabels: { usehtml: true, enabled: true, formatter: function() { value = this.y; numericsymboldetector = math.abs(this.y); if (numericsymboldetector > 1000) { value = highcharts.numberformat(value / 1000, 3, '.', '') ; } ...

docusignapi - Connect DocuSign to Dynamics -

what type of account needed complete connect "docusign dynamics"? in reference page 7 step 3 of docusign dynamics 365 crm quick start guide. guide states has admin user. is dynamics 365 system administrator or global administrator. if global administrator access mode required? (administrative, read-write, or non-interactive). if read-write need permanent account? when try connect account dynamics 365 system administrator following message: you can't access application docusign dynamics needs permission access resources in organization admin can grant. please ask admin grant permission app before can use it. when try use microsoft admin account (global admin) administrative access mode error: an unknown error has occurred. please contact support @ support@docusign.com. https://partner.docusign.net/partners/msdynamics/error?message=system.servicemodel.faultexception%601%5bmicrosoft.xrm.sdk.organizationservicefault%5d%3a+principal+use...

how to get file name safetly and compare it in windows minifilter driver -

hello i'm new @ filterdriver writing i'm apologizing basic question , try file name pre read function , check if it's equal file name , logic according info. this function: flt_preop_callback_status swapprereadbuffers( _inout_ pflt_callback_data data, _in_ pcflt_related_objects fltobjects, _flt_completioncontext_outptr_ pvoid *completioncontext ) { pflt_io_parameter_block iopb = data->iopb; flt_preop_callback_status retvalue = flt_preop_success_no_callback; pvoid newbuf = null; pmdl newmdl = null; pvolume_context volctx = null; ppre_2_post_context p2pctx; ntstatus status; ulong readlen = iopb->parameters.read.length; pflt_file_name_information nameinfo = null; unicode_string file_name; // // skip irp_paging_io, irp_synchronous_paging_io , // toplevelirp. // if ((data->iopb->irpflags & irp_paging_io) || (data->iopb->irpflags & irp_synchronous_paging_io) || iogettoplevel...

php - Laravel broadcasting auth route simply returns "true" -

i'm using default broadcast::routes() in broadcastserviceprovider.php pusher. on local dev environment pusher auth route https://example.com/broadcasting/auth returns correct value this: {"auth":"26459d435d6228d35d:264d007419334bebb44539854e6ff54b6f09342aed2653822f5e90674650345000"} however, when deploy aws, route string true . this, of course, breaks pusher. in pusher debug console see error: auth info required subscribe private-app.user.5 what cause broadcaster auth return true ?

Can't overwrite CSS for media query -

https://codepen.io/everybodysfeelingwonderland/full/ojyrpm/ somehow can't change color of nav links smaller screen size in media query. should turn white, stays gray bigger screens. @media , (max-width: 580px){ nav li a, nav ul li{ color: white; text-align: right; display: block; } nav li { text-decoration: none; color: #666666; font-size: 20px; } media queries not add specificity selector. control if code inside ignored or not. which means that... @media (condition) { selector { value } } selector { value } ...will apply "another value" , because it's placed later , has same specificity . need invert them , work intended: a selector { value } @media (condition) { selector { value } }

Simplifying error handling in go -

in c , similar languages following shortcuts can applied detect error , stop on first non-zero result (void)(result = dosomething() || result = dosomething() || result = dosomething() ) if (result == 0 && ... in golang, can't seem that. for example: if result = dosomething() || result = dosomething(); result < 0 { fmt.printf("error occurred\n"); } c able treat integers boolean expression when checking non-zero. for example can write if (result = dosomething() || ... ) instead of if ( (result = dosomething()) == 0 || ... ) but in go, can't that. i thought write: if result = dosomething() == 0 || result = dosomething() == 0; result < 0 { fmt.printf("error occurred\n"); } but error. syntax error: result = dosomething() || result used value there has way of chaining these together. or in style of javascript promises dosomething().dosomething.dosomething.error() approach possible? a...

Join three tables in SQL Server 2008 -

i have 3 tables. a id name --- ---- 1 abc 2 asd 3 qwe b id income --- ------ 1 2 2 3 1 4 c name total ---- ---- abc 8 asd 20 i want join 3 tables sql query produce output id income total --------------- 1 6 8 2 3 20 could me? you try this: select t1.id, sum(t2.income) income, sum(t3.total) total table1 t1 join table2 t2 on t1.id = t2.id join table3 t3 on t3.name = t1.name group t1.id order t1.id

C# dictionary multiple classes as values -

i'm searching way create dictionary accepte multiple classe value. i'm getting value xiaomi gateway , foreach kind of equipment, i've got class each kind of equipement. for example magnet sensor : [xiaomiequipement("magnet")] public class magnet { public string model { get; set; } = "magnet"; public string sid { get; set; } public string battery { get; set; } = "cr1632"; public int batterylevel { get; set; } public magnetreport report { get; set; } } [xiaomiequipement("magnet_report")] public class magnetreport { public int voltage { get; set; } public status { get; set; } } and wallplug : [xiaomiequipement("plug")] public class plug { public string model { get; set; } = "plug"; public string sid { get; set; } public string battery { get; set; } = "cr2450"; public int batterylevel { get; set; } public plugreport report { get; set; } } [xiaomi...

python - Pandas: Change column values based on dictionary keeping rows with no match -

i have data frame country names , modify of values based on dictionary: endict = { "republic of korea": "south korea", "united states of america": "united states", "united kingdom of great britain , northern ireland": "united kingdom", "china, hong kong special administrative region": "hong kong" } i'm able create 'mask' with: mask = (energy['country'].isin(endict)) however, i'd apply mask on 'country' column when 'true' not modify values not contained in dictionary, i.e. keeping values of rows no match. any idea? thanks in advance. we can use series.replace() method: energy['country'] = energy['country'].replace(endict, regex=true)

wpf - How to I pass additional data to a bound datagrid? -

so have data grid bound object, there way pass addition list/variable it? specifically: <datagrid x:name="indoorunittable" itemssource="{binding boundlist, mode=twoway, notifyonsourceupdated=true, updatesourcetrigger=propertychanged}" ... <datatemplate x:name="propertyfromothertable"> <textblock text="{binding otherlistiwant, mode=twoway, converter={staticresource converterfortwolists}, updatesourcetrigger=propertychanged}"/> </datatemplate> you have use converterparameter in binding, passed converter parameter. hope have understood question correctly ;)

spring - JMSTemplate and DefaultMessageListenerContainer -

i have 2 queues in redhat activemq, 1 used consuming , other 1 both producing , consuming object messages. once consumed main queue pushed 2nd queue further processing, while using jmstemplate messages getting lost randomly, i using same bean activemqconnectionfactory on 2 of dmlc container , jmstemplate let me know how ensure messages not getting lost in jmstemplate. i double check nobody else check messages on queues have. if there sort of development environment have several instances of application running - might compete messages. developer launching instance of app using same connection string activemq, or dev/stage environments.

ide - How can I automatically format C# line indentations like VB.NET -

when write in vb.net, ide automatically formats line indents perfectly, don't have use tab key @ anytime. in c#, when needed edit line of code, , perhaps wrecked indentation this... void myvoid() { if (1==1) { int ithis = 5; //line ugly indentation } } ..., , have correct indentation manually or use ctrl akf fix it. in vb.net, ide fix automatically when skip other line. how can make easy in vb.net? power commands has option automatically format document when save. there's lighter-weight extension titled format document on save should same.

jquery - Bind remote JSON Data to a Kendo TreeView - only getting first tier -

i'm trying kendo treeview display json data. var treeviewdatasource = new kendo.data.hierarchicaldatasource({ transport: { read: { url: "/utilities/tool/get/treeview", type: "get", datatype: "json" } } }); $("#tree-view").kendotreeview({ loadondemand: false, datasource: treeviewdatasource, select: onselect }); where json data looks this: [{ "text": "create", "description": "create transaction", "items": [ { "text": "pseudo", "feature": "create", "items": [ { "text": "fix", } ], "nodechildren": 1 } ], "nodechildren": 1 }, { ...

eclipse - Change Momentics IDE 4.7 Theme -

i wondering if possible override normal , feel of momentics 4.7. don't care default eclipse , feel , prefer dark editor. if possible, enjoy dark monokai theme present in sublime, tips regarding great. uses momentics regularly know of way import settings allow appearance dark?

Excel VBA module static variable comes to Nothing after use -

i trying share variable between 2 subroutines in module. i have declared variable @ top of file: option explicit private targetworkbook workbook i have 2 subroutines, 1 set it, , 1 use multiple times. setter pretty simple: sub setwbtarget() set targetworkbook = thisworkbook end sub the using subroutine runs fine first time, calls foul when running subsequently until set again. here truncated user of static (not global) variable sub testtargetworkbook() if (targetworkbook nothing) msgbox "need set targetworkbookfirst. stopping", vbokonly, _ "failed transfer" else dim wb workbook dim ws worksheet dim twb workbook set wb = thisworkbook set ws = wb.worksheets(1) set twb = targetworkbook ws.activate end if end sub edit: did not finish subsequent calls, rather single-stepped until bad happen, reset project. of course cleared shared variable. i kept entry...

react native - Mobx Autorun running too often / need it to skip in some cases / run only after finished -

i know not best practice performant solution have found far. monitors object, , transforms object in autorun. this setup working excellently small data sets, when there lot of changes, gets stuck in "100 cycles , didn't settle" error. i wondering if there way iterate once / collate changes , apply them in 1 hit. i have tried number of solutions / workarounds involve timers, deep object comparison (ie don't run if hasn't changed) etc, either disable autorun or lead extremely bad performance. i guess in summary: is there way make autorun not execute changes on same frame? is there better solution autorun watch every observable in object? is there way limit autorun? is there better solution? it hard useful without minimal code example of doing. sounds reading , modifying same data in autorun, introduces cycles. consider using reaction allows better separate data want listen react, versus action want take once change occurs

typescript - Angular 2 Project Structure With Multiple Modules -

i'm developing first angular 2+ application , i'm running couple issues regarding how best structure application. i've begun developing area of application user can things log in, , create account. these 2 routes, have several components (login form, signup form, login page, signup page, etc). continuing declare these in root module seems messy, application grows in size. how should proceed going forward? make module each route? make 1 module encompasses both login , signup functionality since they're similar? i'm not finding online guidance great! thank you! the official style guide suggested @brijmcq , documentation modules give first orientation. you should group application's classes in modules feature (and definetly not type). depends on context draw line. small application 1 root app module might sufficient, in cases having feature modules makes lot of sense. typically, module handles more 1 route, there might cases though, 1 route p...

Android save the entire state Activity -

i’m developing game, , when user playing , blocks cellphone or change app , long time passes, app when bring front starts again. i want continue moment pauses game. read onsaveinstancesate , of that, see can save values 1 one. in activity have 150 things save solution. not way save entire activity in easier option? cant’t save 150 values. could break 150 values smaller objects? using library such icepick make cleaner code.

javascript - Jquery multiple selectors and multiple contains -

can search div multiple selectors each contains in 1 jquery string? needs , not or search . $('.row .people:contains("james") .tags:contains("episode")') the above selection should return first div below. <div class="row"> <span class="people">james</span> <span class="tags">episode</span> </div> <div class="row"> <span class="people">bill</span> <span class="tags">episode</span> </div> <div class="row"> <span class="people">james</span> <span class="tags">podcast</span> </div> you can use jquery's .has() check if element contains descendants. can nest :contains within .has() statement. that'll allow check if .row contains span text. then can add second .has() statement check has both spans matched text. note in ...

wireshark - Libpcap ICMP Packet never responded to -

Image
i'm playing around libpcap trying send ping whenever send requests never responded to, no errors given , looks identical regular ping sent through ping utility. the left packet sent through ping on terminal , right through app. far can tell data field optional don't include it, , identifier/sequence numbers can random, randomised. am missing obvious here? i notice haven't validated ip header checksum. sure in fact correct? if isn't next router silently drop packet consistent you've seen. wireshark should able validate ip header checksum if switch on.

multithreading - NSProgressIndicator built-in animation raises CA_ASSERT_MAIN_THREAD_TRANSACTIONS -

this looks bug in either nsprogressindicator or xcode 9 me: run xcode 9 beta 1 or beta 4, in macos 10.12.6. file > new project, macos, cocoa app, objective-c or swift, arc or not, no storyboards, latest (10.13) sdk. in app target's environment, set ca_assert_main_thread_transactions=1 . in app delegate, add iboutlet progressindicator . in nib, add nsprogressindicator window, connect outlet. leave checkbox indeterminate switched on. in -applicationdidfinishlaunching , call -startanimation: on progressindicator . build , run. expected result: progress indicator should happily show indeterminate progress, because did on main thread. actual result: app crashes, citing ca_assert_main_thread_transactions, when -startanimation: called. you can see in tiny demo project . did wrong? expected result incorrect? p.s. asked on apple's developer forums, still awaiting moderator approval after 2 working days, deleted , came here instead :( update: still...

javascript - chart.js data api options in html -

i've been trying create half doughnut using chart js library starting template chart options provided using html attributes: <canvas id="mychart" class="ex-graph" width="200" height="200" data-chart="doughnut" data-value="[{ value: 230, color: '#1ca8dd', label: 'returning' }, { value: 130, color: '#1bc98e', label: 'new' }]" data-segment-stroke-color="#252830"></canvas> the options want provide are: options: { rotation: 1 * math.pi, circumference: 1 * math.pi } so tried without success following: <canvas class="ex-graph" width="200" height="200" data-chart="doughnut" data-value="[{ value: 230, color: '#1ca8dd', label: 'returning' }, { value: 130, color: '#1bc98e', label: 'new' }]" data-segment-s...

go - How to initialize nested struct in golang? -

type important struct { client string `json:"client"` response summary `json:"response"` } type summary struct { name string `json:"name"` metadata clientdata `json:"metadata"` } type clientdata struct { income string `json:"income"` } v := &important{ client: "xyz", response: summary[{ name: "test", metadata: clientdata { "404040"}, } }] //error: cannot use summary{ name: "test", metadata: clientdata { "404040"}, } (type summary) type []summary more... what doing wrong here? to put simply, goofed syntax of slice literal slightly. mistake logical, sadly doesn't work. the following fixed version: v := &important{ client: "xyz", response: []summary{ { name: "test", metadata: clientdata { "404040...

Spark SQL Infer Missing Data -

i have 2 tables i'm joining on date. 1 of them may not have entry given key , date, need check previous days (up 5) , use stale values if possible. table 2 contains data of format date, attribute, <additional columns> , uploaded ideally every day each attribute (there many attributes). table 1 can have many different entries each given (date, attribute) pair, or none @ all. i'm looking way join tables 1 , 2 such every entry in table 1 joined data in table 2 corresponding date , relation attribute , , if no corresponding entry in table 2 exists, joined recent entry in table 2 predates table 1 entry, provided table 2 entry not more 5 days out of date. i can code relatively using loop (or while loop, short-circuit), various reasons, in sql. i'm using hive of data have hivecontext available , can use windowing functions. however, can't figure out how use lag() on range opposed on physical rows in table. think can left outer joins on successive subtraction...

javascript - Semantic UI - `gulp build` returns JS error -

i installed latest version of semantic-ui when building assets gulp build , compiling js returns errors below, while css compiled fine. building assets [10:48:00] created: dist/components/site.js [10:48:00] plumber found unhandled error: gulpuglifyerror: unable minify javascript caused by: defaultserror: `preservecomments` not supported option file: /home/forge/mysite.co/public/semantic/dist/components/site.js [10:48:00] created: dist/components/form.js [10:48:00] plumber found unhandled error: gulpuglifyerror: unable minify javascript caused by: defaultserror: `preservecomments` not supported option file: /home/forge/mysite.co/public/semantic/dist/components/form.js [10:48:00] created: dist/components/accordion.js [10:48:00] plumber found unhandled error: gulpuglifyerror: unable minify javascript caused by: defaultserror: `preservecomments` not supported option file: /home/forge/mysite.co/public/semantic/dist/components/accordion.js [10:48:00] created: dist/components/checkbo...

aleagpu - Alea doesnt release memory correctly -

Image
it seems alea not disposing class devicememory2d correctly my code checking free memory let getfreememory () = let free = marshal.allochglobal sizeof<uint64> let total = marshal.allochglobal sizeof<uint64> let freeptr = nativeinterop.nativeptr.ofnativeint<nativeint> free let totalptr = nativeinterop.nativeptr.ofnativeint<nativeint> total cudainterop.cumemgetinfo(freeptr, totalptr) |> cusafecall let result = nativeinterop.nativeptr.get freeptr 0 marshal.freehglobal free marshal.freehglobal total uint64 result and here's code checks whether there's leak seq.init 100 (fun _ -> use arr = gpu.default.allocatedevice<float>(1000,1000) getfreememory() |> printfn "%d" ) |> seq.iter id from output image, memory doesn't seem disposed can try latest beta version: https://www.nuget.org/packages/alea/3.0.4-beta3

c++ - C windows gui font-size change on hmenu -

i have menu in resource file winapi , elements of menu small, there way make font size bigger or change color of text? either adding code in main code or changing resource file.. i have tried font 13, "ms sans serif" did not work idr_mymenu menu begin font 13, "ms sans serif" popup "&file" begin menuitem "&exit", idd_file_exit end popup "&stuff" begin menuitem "&go", id_stuff_go menuitem "&file kapat", idd_file_kapat end end

Split an Array into all possible Combinations of Subsets of length 2 -

i have array, say ar = [1,2,3,4,5] i need find list of arrays (or matrix) contains possible ways split array exhaustive sets of pairs. eg. [ [[1,2],[3,4],[5]], [[1,2],[3,5],[4]], [[1,2],[4,5],[3]], [[1,3],[2,4],[5]] ... [[1,5],[3,4],[2]] ] please try use pseudocode, or refrain using language-specific functions i give intuition solve type of question. first can see problem can solved recursively. why that? first take 2 elements array, then solve same problem rest of elements of array. if length of array 2 or 1 stop. following rough pseudo code. solve(arr){ if len(arr)==1 or 2{ return arr } take 2 elements (say [1, 5]) remainder = [2, 3, 4] solve(remainder) }

java - finding xpath of dropdown for application developed in angular -

html code dropdown: <div class="margin-bottom"> <select ng-class="{'invalid-select':(selecteditem == '-1' &amp;&amp; submitted)}" class="select-lg select-custom ng-pristine ng-untouched ng-valid ng-not-empty ng-valid-required" name="items" ng-model="selecteditem" ng-options="item.id item.name item in items" required="" ng-change="onchange()" style=""> <option value="" selected="selected" class="">select one</option> <option label="stage test" value="number:682">stage test</option> <option label="automation 1" value="number:687">automation 1</option> <option label="automation 3" value="number:688">automation 3</option> <option label="new co" value="number:690">...

Openerp create 2 bar in graph view -

how make 2 group bar image in openerp graph ? image my xml : <field name='productfunction' group="true"/> <field name='average_gross_margin_fnc'/> but show only average_gross_margin_fnc. please answer. thank you this double grouping. in screenshot have posted have grouped sales team , date order, try grouping records using fields. click on grouped element on top left of chart instead of stacked

jquery - Material Design lite menu is not working in angular 2 -

trying use material design lite menu menu never appears on screen. while research found problem material design lite isn't designed used dynamic pages. found few solution seems not worked mdl not working angular2 integrating material design lite angular2 https://github.com/google/material-design-lite/issues/4243 https://getmdl.io/started/#dynamic here app.component.ts import { component } '@angular/core'; var componenthandler: any; @component({ selector: 'my-app', templateurl: 'home/homepage', }) export class appcomponent {} homepage.cstml <button id="test1" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="test1"> <li class="mdl-menu__item">mobile app</li> <li class=...

c++ - Is it possible to make a 64 bit positioning system for Unreal Engine/Unity ? -

i've been wondering if 1. 64 bit positioning system make possible transition earth space , further planet, kinda kerbal space program without origin shifting real data derived it. 2. possible , how? just figure out each integer increment represents , you're done. millimetres should sufficient, that's still +/- ten trillion kilometre range if you're using signed value. that's going offer more consistency in positioning floating point value, downside each xyz vector 192 bits, or 24 bytes.

laravel - Issue in window.Echo -

i following this tutorial implement pusher in laravel 5.4 below step step things done. composer require pusher/pusher-php-server npm install --save laravel-echo pusher-js instantiated echo instance in resources/assets/js/bootstrap.js initialized pusher key in env , in bootstrap.js file. finally, wrote below code in blade. <script> debugger; window.echo.channel('sendmessagechannel.1') .listen('.app.events.sendmessageevent', (e) => { console.log(e); }); </script> also added <script src="{{ asset('js/app.js') }}"></script> reference in layout. while debugging, found window.echo undefined. am missing anything? once install laravel-echo , pusher-js, need run npm run dev app.js can have both libraries.

angular2 routing - Angular 2/4 named router-outlet is not rendering HTML -

Image
multiple router-outlet not working desired. here application wire frame is: here routing: const routes: routes = [ { path: '', redirectto: 'dashboard', pathmatch: 'full' }, { path: 'dashboard', component: homecomponent } , { path: 'contact', children: [ { path: '', component: contactcomponent, outlet:'container' }, { path: 'list', component: contactcomponent, outlet:'container' } ] } ,{ path: "**", component: pagenotfoundcomponent } ]; and here links: <a [routerlink]="['/contact', {outlets: {container: ['']}}]">contact</a> <a [routerlink]="['/contact/list', {outlets: {container: ['list']}}]">contact list</a> so, on clicking link whole application goes blank , no console error. html be...

Selenium php-webdriver check attribute after click -

<a class="lnk" href="http://www.google.com">go google</a> when click on link, css class 'loading' append. how test before redirecting google.com. $element = $driver->findelement(webdriverby::classname('lnk')); $element->click(); is there way check class attribute contains 'loading' before redirecting destination? you can use javascript edit href attribute , add timeout $element = $driver->findelement(webdriverby::classname('lnk')); $href = $element->getattribute('href'); $script = "javascript:settimeout( function() { window.location = {$href} }, 5000 );" $driver->executescript("arguments[0].setattribute('href', arguments[1]);", $element, $script); now yo have enough time check if class attribute contains loading $element = $driver->findelement(webdriverby::classname('lnk')); $class = $element->getattribute('class'); if (strp...

javascript - Cant set AngularJS variable in ng-reapeat -

i want implement list should visible after click. when try set value on ng-click , value scope in on clicked element. <ul data-ng-init="showiatalist = false"> {{showiatalist}} <-- false :( should true after click on link list <li data-ng-repeat="value in data.departureiatalist"> <a href="javascript:" data-ng-if="$index < 3 || showiatalist"> {{value}} </a> {{showiatalist}} <a href="javascript:" data-ng-if="!showiatalist && $index == 3" data-ng-click="showiatalist = true"> {{showiatalist}} <-- after click true, true should , on top showiatalist variable </a> </li> </ul> fyi, every ng-repeat item has own scope. reason why data-ng-click="showiatalist = true" works specific scope , not main $scope . you can write example: $scope.data.showiatalist = false; and work...

jquery - Bootstrap | Navigation Bar | not working | not compiling classes -

<nav class="navbar navbar-default"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">brand</a> </div> <!-- collect nav links, forms, , other content toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class=...

tomcat - ClassNotFoundException in spring project with maven -

i have created spring project maven , works fine. trying add jar file project, eclipse not give errors when start server , try access page uses class jar file classnotfound exception. my steps are.. 1 - put jar file in src->main->resources 2 - added build path right clicking , saying add build path. 3 - add project tomcat , start server the thing looked @ tomcat deployment directory , .jar file appears in classes directory. when take copy file classes lib (which has libraries downloaded maven) project works fine.

javascript - Isolate scope value is replaced only if it exists - AngularJS Directive -

template : <ui-print text="print" panel="#paper1" wait-for-data="adc.waitfordata" callfront-fn="adc.somefunction()"></ui-print> <ui-print text="print" panel="#paper2"></ui-print> directive : scope: { text: '@', panel: '@', callfrontfn: '&', waitfordata: '=' }, link: function($scope) { var invokeprint = function(panel) { $window.print(); $scope.waitfordata = true; } $scope.printpanel = function(panel) { if (!$scope.waitfordata) { invokeprint(panel); } else { $scope.callfrontfn(); } }; $scope.$watch('waitfordata', function(n) { if (n === false) { invokeprint($scope.panel); } }); } hi guys, trying understand how isolate scope works here. if @ above code there 2 element directives. 1 has waitfor...

shell - Grep vars from a file with ansible to use later in a task with a for loop -

i relatively new ansible. i have parameters.yml this: parameters: stuff: bullshit otherstuff: otherbullshit domain_locale: domain.locale.test domain_differentlocale1: domain.differentlocale1.test domain_differentlocale2: domain.differentlocale2.test domain_differentlocale3: domain.differentlocale3.test uninteresting_stuff: uninteresting_bullshit this file in directory, symlink in defaults/main.yml. doesn't matter. what accomplish grep somehow within ansible task these domain.*.test values , use vars in task ansible. other task write directly after 127.0.0.1 localhost in same line in /etc/hosts . i not sure of modules use in ansible. include_vars has no additional grep see it. set_fact not read different file(can combine shell command? how?). lineinfile not have source , dest, limited 1 file. i thought post me: ansible read multiple variables same name vars_file not need grep part, need. here go: --- - hosts: localhost gather_facts:...

apache - Apache2.4 - PHP 5.6 and PHP7.1 running at the same time -

i'm looking run both php 5.6 , 7.1 in development server (debian 9), apache. know nginx can handle this, need apache. here confs # main configuration file, running php7.1 <virtualhost xx.xx.xx.xx:80> servername www.mydomain.com serveralias mydomain.com documentroot /var/www/mydomain.com/html </virtualhost> <virtualhost xx.xx.xx.xx:80> servername xx.xx.xx.xx <directory /> deny </directory> </virtualhost> # php 5.6 <virtualhost xx.xx.xx.xx:80> servername foo.mydomain.com documentroot /var/www/foo.mydomain.com/html <filesmatch \.php$> sethandler "proxy:unix:/var/run/php/php5.6-fpm.sock" </filesmatch> </virtualhost> the 7.1 working, while 5.6 returns 404. ! similar problem have been asked. go link. please read on given link. may help. run multiple php version on apache serve using fast-cgi

pixel - Python SFTP - command 'arm-linux-gnueabihf-gcc' failed with exit status 1 -

raspbeery pi3 raspbian jessie pixel (latest) python 3.4 i know can push commands terminal python. wanted use more python-centric approach possibly updated later on on system. i trying install pysftp, keep getting stuck. installed dependencies 1 @ time. first pycrypto paramiko pysftp. pycrypto installs fine, paramiko having issue. command use: sudo pip3 install paramiko this error get: compilation terminated. error: command 'arm-linux-gnueabihf-gcc' failed exit status 1 i have googled , checked , believe have installed python3-dev stuff necessary along using command: apt-cache search gnutls | grep dev my friend told me install things on list, still did not work. i have downloaded whl files , tar files , gone through , still did not work. relatively new stuff , know missing os. have no idea start. please me. thanks. i did obvious thing in world , worked, silly old me. sudo apt-get install gcc i did uninstall alot of thing...

android - getActivity() / context in a ViewHolder in Kotlin Andorid -

i'm building viewholder , adapter fragment , when try make onclick viewholder, none of contexts pass in work. there no activity getactivity() can use, , p0!!.context nor itemview.context work either. should getting context from, , how reference it? thank you! package com._________.criminalintent import android.os.bundle import android.support.v4.app.fragment import android.support.v7.widget.linearlayoutmanager import android.support.v7.widget.recyclerview import android.view.layoutinflater import android.view.view import android.view.viewgroup import android.widget.textview import android.widget.toast class crimelistfragment: fragment() { private var mcrimerecyclerview: recyclerview? = null private var madapter: crimeadapter? = null override fun oncreateview(inflater: layoutinflater?, container: viewgroup?, savedinstancestate: bundle?): view? { // fragment_crime_list.xml has recyclerview element = crime_recycler_view // inflate fragment activity ...

How to convert raw query into Laravel Eloquent way -

i have raw query. how can convert 1 laravel eloquent. select * `results` q inner join `answers`as on q.question_id = a.question_id , q.team1 = a.team1 , q.team2 = a.team2 , q.score1 = a.score1 // table relationships. results hasmany answers. results hasmany predictions. prediction model here. as far understood question,you can't relationship joins. please try query. result::join('results q', function ($join) { $join->on('answers.question_id', '=', 'q.question_id') ->on('user_answers.team1', '=', 'q.team1') ->on('user_answers.team2', '=', 'q.team2') ->on('user_answers.score1', '=', 'q.score1') ->on('user_answers.score2', '=', 'q.score2'); })->get(); now can run query relational data.