Posts

Showing posts from February, 2012

c++ - Vxworks sdOpen() errno: S_pgPoolLib_PAGES_NOT_ALLOCATED -

i trying read fpga registers user space application using vxworks function sdopen() (which create shared memory space). runned inside main function on vxworks 6.2 on arm-cortex a8. tried code still same error in title: sd_id sdid; sdid =sdopen( (char *)"iptest", // name : name of shared data region0, 0, //option om_create, // mode : open mode = create if not exits 4*1024, // size : size of shared data in bytes (off_t)0x25000000, // physaddress : optional physical address sd_attr_rw | sd_cache_off, (void **)&pvirtaddress); // attr : allowed user mmu attribute //pvirtaddress: optional virtual base address if(sdid == 0) { switch(errno) { case s_sdlib_virt_addr_ptr_is_null: printf("pvirtaddres...

c# - DbConnection::Open hangs, in case of unreachable server -

i have c++ application uses c# api access 1 mysql database. in case connection successful, retry reconnect ontimer event. problem if ip of server not found, second or third time try connect database with: dbconnection::open, application freezes , following message box displayed: server busy if press retry, exception raised: first-chance exception @ 0x754fc54f (kernelbase.dll) in myprogram_d.exe: 0xe0434352 (parameters: 0x80004005, 0x00000000, 0x00000000, 0x00000000, 0x711d0000). connection string: uid=userid;password='password';connection timeout=10; pooling= false; do know might go wrong , open function not return?

jmeter - Execute request for each element in CSV, not per user -

Image
i'm using jmeter 3.2 write tests. have csv file test account info. each row contains login info user. each user needs request token used on later requests. my test plan: the token request retrieves token. login requests logs in user , returns token. select customer card selects customer , returns final token. code postprocesser (i'm not experienced in this, advice appreciated): import org.json.simple.jsonobject; import org.json.simple.parser.jsonparser; // check if our map exists if (props.get("map") == null) { jsonobject obj = new jsonobject(); obj.put("${department}", new string(data)); log.info("adding department map. department: ${department}. token: " + new string(data)); props.put("map", obj.tojsonstring()); } else { // retrieve current map map = props.get("map"); jsonparser parser = new jsonparser(); jsonobject jobj = (jsonobject) parser.parse(map); // add new departme...

Resizing external image in Rmarkdown: html vs. ioslides output -

i'm using external images in rmarkdown document meant rendered ioslides , need resize them. doing html way works both when knit ioslides , html_document. <img src="image.png" style="height: 200px"/> doing markdown way below works when knit html_document not when knit ioslides (i.e., image isn't resized). ![](image.png){width=200px} my question is: how can make markdown resizing approach work when output ioslides?

java - Spring MVC Controller Test passing due to not finding model attribute -

i have created home controller below. controller fetches 5 dummy posts have created in "postrepository" class through postservice class. @controller public class homecontroller { @autowired postservice postservice; @requestmapping("/") public string gethome(model model){ model.addattribute("post", postservice); return "home"; } } i have implemented following test.. @runwith(springjunit4classrunner.class) @contextconfiguration(classes = {webconfig.class}) @webappconfiguration public class controllertest { @test //test home controller public void testhomepage() throws exception{ homecontroller homecontroller = new homecontroller(); mockmvc mockmvc = standalonesetup(homecontroller).build(); mockmvc.perform(get("/")) .andexpect(view().name("home")) .andexpect(model().attributedoesnotexist("post")); } } ...

wordpress - update product meta_data in wocommerce REST API -

i added new field using small plugin script... works fine in woocommerce interface , shows using rest api product here excerpt of results using $woocommerce->get() 'meta_data' => array (size=1) 0 => array (size=3) 'id' => int 3293 'key' => string 'kambusa' (length=7) 'value' => string '123' (length=3) using: $data = [ 'regular_price' => '21.00', 'meta_data' => [ ['kambusa' => '456'] ] ]; print_r($woocommerce->put('products/530', $data)); updates price ignores (without error) meta_data i searched web morning didn't find clear solution (some suggested have register_meta(), made tests nothing changed (the meta data show before registering)) following code used create filed in "admin" part of plugin $args = array( 'id' => $this->text...

image in angular 2 with webpack giving 404 -

i trying put image in project keep getting 404, set config in webapck , didn't solve . spilogo.jpg:1 http://localhost:4200/imagens/spilogo.jpg 404 (not found) index.html <!doctype html> <html lang="pt"> <head> <meta charset="utf-8"> <title>thegreatcthulhu</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="src/favicon.ico"> <link rel="" type="image/jpg" href="src/app/imagens/spilogo.jpg"> </head> <body> <app-root></app-root> </body> </html> my nav-bar.component.html <!-- dropdown structure --> <ul id="dropdown1" class="dropdown-content"> <li routerlinkactive="active"><a ro...

javascript - trigger resize event causes error $digest already in progress angularjs -

i'm trying set resize active on angualr js directive cause dygraph begin scope.option.eidth = 0 if set value.. after many tries found this: window.dispatchevent(new event('resize')); and in browser works ! if put no directive raises error angular.js:11655 error: [$rootscope:inprog] $digest in progress http://errors.angularjs.org/1.3.15/$rootscope/inprog?p0=%24digest i know caused scope state in digest instead of apply.. there way verify this? my code: (function() { var app = angular.module('dashboard.view', []); app.directive('dygraph', function(){ return { restrict: 'e', scope: { data : '=', options : '=?' }, template: '<div id="graphdiv" style="width: 100%"></div>', link: function (scope, elem, attrs) { var div = elem.children()[0]; sco...

java - Having trouble handling exceptions in Spring Integration -

i'm new spring integration , confused how send error messages designated error queue. want error message header on original message , end in separate queue. read can done header enricher, tried implement nothing showing in error queue. also, need separate exception handling class in order error messages make error queue or can throw exceptions in transforming methods? here xml config: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp" xmlns:rabbit="http://www.springframework.org/schema/rabbit" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/sprin...

c# - ASP.NET Core authentication cookie only received once -

i developing application asp.net core , using custom cookie authentication. cookieauthenticationoptions are: app.usecookieauthentication(new cookieauthenticationoptions() { authenticationscheme = cookieauthenticationdefaults.authenticationscheme, loginpath = new pathstring("/login"), accessdeniedpath = new pathstring("/unauthorized/"), automaticauthenticate = true, automaticchallenge = true }); the cookie created fine , can see in browser settings throughout whole time running application. homecontroller class: public homecontroller(ihostingenvironment env, iantiforgery antiforgery, ioptions<appsettings> appsettings, terminaldbcontext terminalcontext, iloggerfactory loggerfactory, ihttpcontextaccessor _httpcontextaccessor) { _env = env; _antiforgery = antiforgery; _appsettings = appsettings; _terminalcontext = terminalcontext; _logger = loggerfactory.createlogger<homecontroller>(); ...

Chrome changes Poster image on mouse hover with Afterglow HTML5 Video -

i'm using afterglow 's html5 video player. have created sample video poster attribute. when using chrome browser, when hover mouse on video, poster image disappear , reappear. creates blinking effect not want. how stop this? <script src="https://cdn.jsdelivr.net/afterglow/latest/afterglow.min.js"></script> <div class="video-div"> <div id="group_1" class="videocontainer"> <video id="video_s08e01" poster="http://via.placeholder.com/566x318" class="afterglow" width="566" height="318" style="z-index:1;"> <source type="video/mp4" src="https://www.w3schools.com/html/mov_bbb.mp4" /> </video> </div> </div> here jsfiddle. https://jsfiddle.net/zpo1cxbb/2/ just delete style="z-index:-1" video element. jsfiddle

html - Why doesn't flex item shrink past content size? -

i have 4 flexbox columns , works fine, when add text column , set big font size, making column wider should due flexbox setting. i tried use word-break: break-word , helped, still, when resize column small width, letters in text broken multiple lines (one letter per line) column not smaller width 1 letter size. try watch video: http://screencast-o-matic.com/watch/cdetln1tyt (at start, first column smallest, when resized window, widest column.i want respect flex settings always.. flex sizes 1 : 3 : 4 : 4) i know, setting font size , column padding smaller help... there other solution? i can not use overflow-x: hidden . jsfiddle: https://jsfiddle.net/78h8wv4o/3/ .container { display: flex; width: 100% } .col { min-height: 200px; padding: 30px; word-break: break-word } .col1 { flex: 1; background: orange; font-size: 80px } .col2 { flex: 3; background: yellow } .col3 { flex: 4; background: skyblue } .col4 { flex: 4; ...

ansible - Repo will not clone, "Permission Denied", using git module -

i've looked @ similar questions, not found answer yet. i can ssh in server (ubuntu 16.04) , clone git repo manually. leaves me believe isn't sshforwardagent issue. the error pretty typical: "cloning bare repository '/home/deploy/apps/myproject/production/cached-copy'...", "permission denied (publickey).", "fatal: not read remote repository.", ansible.cnf: [ssh_connection] ssh_args = -o forwardagent=yes the role looks this: - name: update bare git repository become_user: "{{ deploy_user }}" git: repo: "git@github.com:myuser/myproject.git" dest: "{{ deploy_to }}/cached-copy" version: "{{ branch }}" bare: yes update: yes accept_hostkey: yes ssh_opts: "-o stricthostkeychecking=no -o forwardagent=yes" the verbose output ansible is: "changed": false, "cmd": "/usr/bin/git clone --bare '' /home/deploy/apps/mypr...

python - How to parse twitter feed data using json.reads(line) -

i've downloaded big stream of twitter data in json format , saved text file. want read in, line line, , decode dictionary using json.reads() . my problem throws error on first line, assume means function doesn't think data json? have added line want decode @ bottom of post. when print lines code works fine, json.reads() function throws error. here code: def decodejson(tweet_data): line in tweet_data: parsedjson = json.loads(line) print(parsedjson) # want print confirm works. here error: file "/users/cc756/dropbox/pythonprojects/twitteranalysisassignment/tweet_sentiment.py", line 17, in analysesentiment parsedjson = json.loads(line) file "/users/cc756/anaconda/envs/tensorflow/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) file "/users/cc756/anaconda/envs/tensorflow/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0)....

android - zxing lib does not scan qrcode fast -

i'm using zxing library scan qr codes, find takes lots of time scan code. below can find code i've used implement scanner. dont know whether missing something? mainactivity.java: package com.nadhi.qrcodescanner; import android.app.activity; import android.app.alertdialog; import android.content.activitynotfoundexception; import android.content.dialoginterface; import android.content.intent; import android.net.uri; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.view.view; import android.widget.toast; import com.google.zxing.client.android.captureactivity; public class mainactivity extends appcompatactivity { static final string action_scan = "com.google.zxing.client.android.scan"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //set main content layout of activity setcontentview(r.layout.activity_main); } //product q...

c# - setup project with mysql database -

i have project have winform program written in c #, has been completed. use mysql if database. when install program customers not need install mysqli automatically, how can not install it? for saying need create connection string connection: https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-without-dsn.html just make sure installation includes odbc drivers mysql

python - How to calculate time between events in a pandas -

original question i'm stuck on following problem. i'm trying figure out @ moments in time , how long vehicle situated @ factory. have excel sheet in events stored either delivery routes or maintenance events. ultimate goal obtain dataframe in vehicle registration number given corresponding arrival @ factory , time spend there(including maintenance actions). people interested, because want able schedule non-critical maintenance actions on vehicles. an example of dataframe be: registration routid date dep loc arr loc dep time arr time days 0 xc66 a58 20/may/17 home loc 10:54 21:56 0 1 xc66 a59 21/may/17 loc home 00:12 10:36 0 2 xc66 a345 21/may/17 home loc b 12:41 19:16 0 3 xc66 a346 21/may/17 loc b loc c 20:50 03:49 1 4 xc66 a347 22/may/17 loc c home 06:10 07:40 0 5 xc66 #m1 22/may/17 home home 10:51 13:00 ...

php - Searching for a single in a SQL database -

i new mysql , php , i'm stuck performance problem. have database different unique ids , want extract several rows id (from array) out of on 5000. best solution came far use: select * `table` id in ($idarray); is there more efficient way this? 'id' in 'table' unique string. i have seen 70,000 numbers in in list "sluggish". part of issue indexing. table needs index(id) (or, better yet, primary key(id) ). part of issue caching. if table small enough fit in buffer_pool, , cache warm, more warm , wet stuff falling off shovel. but... if "array" already in table, join table. faster. otoh, building table purpose slower.

javascript - Rendering React Components based on array object id -

i have data called channels array containing objects: channels : [ { name:'tv100',number:'100'}, { name:'tv200',number:'200'} ] my components in react: channelcontainer: export default class channelcontainer extends react.component { constructor(props) { super(props) this.state = { channels: '', selectedchannel: '' } } componentdidmount() { let channel_data = [{ name: 'tv100', number: '100' }, { name: 'tv200', number: '200' }]; this.setstate = { channels: channel_data } } render(){ return ( <div classname="tv"> <tvguide channel={this.state.channels} /> <tvview channel_nr={this.state.selectedchannel} /> </div> ); } } tvguide component: const tvguide = (props) => { return ( <div ...

redux - Define selector dynamically based on result previous selection -

i have selector gets current filter type store (filterselector). , 3 more, filter entities store using different logic, let's imagine names smallentitiesselector, mediumentitiesselector, bigentititiesselector. what best way create selector, return filtered entities based on filter values in store? const filteredentities = createselector( filterselector, (filtertype) => { switch filtertype: case "small": ??? case "medium": ??? case "big": ??? } ) for particular example create 1 selector, accepts filter parameter, in real case have more complex logic inside selectors , don't want mix them. upd: due request in comments add more code. here way how make work: const filteredentities = createselector( filterselector, smallentitiesselector, mediumentitiesselector, bigentititiesselector, (filtertype, smallentities, mediumentities, bigentities) => { switch fil...

node.js - Error Handling with nested catch -

i encountered problem during error handling in presence of several catch nested, because object response called more times. objecta.create({}) .then(function (objecta) { objectb.create({ objectaid: objecta.id, name: objectadata.name, cropid: objectadata.crop }) .then(function (objectb) { objectadata.collection.foreach(function () { objectc.create({ objectbid: objectb.id, }) .catch(function (err) { console.log('# # # catch 1 # # #'); next({status: 500, data: err}); }) }) }) .catch(function (err) { console.log('# # # catch 2 # # #'); next({status: 500, data: err}); }); //response http 200 next({status: 200, data: objecta.id}); }) .catch(function (err) { console.log('# # # catch 3 # # #'); next({status: 500, data: err}); }) this happens when there's error inside catch (for example # catch 2 # ) , next({status: 500, data: err}); function cal...

php - ACF : How to get a random row in a repeater field? -

i'm using wordpress advanced custom fields plugin , trying output random image in repeater field. got far using acf documentation, code seems not work, $image[0] variable empty. ? :) <?php $rows = get_field('les_gifs' ); // rows $rand_row = $rows[ array_rand( $rows ) ]; // random row $rand_row_image = $rand_row['gif' ]; // sub field value // note // $first_row_image = 123 (image id) $image = wp_get_attachment_image_src( $rand_row_image, 'large' ); // url = $image[0]; // width = $image[1]; // height = $image[2]; echo 'image 0 : '.$image; ?> <?php if($image[0]) : $style= 'style="background-image:linear-gradient(135deg, rgba(0,89,167,0.65) 0%,rgba(23,208,233,0.65) 100%),url('.$image.');"'; else: $style = ''; endif; ?> turns out made rookie mistake. code works fine. i'm calling outside of loop , forgot add post id. $rows = get_field('les_gifs', 432 ); this bi...

Switching from pq to sqlite3 ruby on rails -

i'm getting error after trying change pg sqlite3. rake db:reset rake aborted! gem::loaderror: specified 'postgresql' database adapter, gem not loaded. add `gem 'pg'` gemfile (and ensure version @ minimum required activerecord). /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:50:in `establish_connection' /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/railtie.rb:120:in `block (2 levels) in <class:railtie>' /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.2.5/lib/active_sup...

MongoDB and PHP - Out of memory -

i know, there couple of articles mongodb , memory, non of these me. i have quite big database of around 40gb. server ubuntu 16.04 32gb ram , ssd disk. now, following messages when try insert new document: mongodb\driver\exception\bulkwriteexception [ error ]: file /var/lib/mongodb/databasename.35 open/create failed in createprivatemap (look in log more information) and in logfiles found this: 2017-07-25t18:20:58.154+0200 network [conn22] received client metadata 127.0.0.1:46124 conn22: { driver: { name: "mongoc / ext-mongodb:php", version: "1.5.5 / 1.2.9" }, os: { type: "linux", name: "ubuntu", version: "16.04", architecture: "x86_64" }, platform: "cfg=0x30c9 posix=200809 stdc=201112 cc=gcc 5.4.0 20160609 cflags="-g -o2" ldflags="" / php 5.6.30" } 2017-07-25t18:20:58.189+0200 e control [conn22] mmap private failed out of memory. (64 bit build) 2017-07-25t18:20:58.189+0200 - ...

mysql - New session entries are being created in database even when codeigniter session library is not loaded. Why? -

i having rather weird problem chris kacerguis’ codeigniter rest server. problems: 1) not loading codeigniter session library, new entries being created in ci_sessions database table, everytime making http request rest api. 2) brand new entry being created (and old entry not being updated) in db, on every http request, when ip address remaining same. this config.php file: $config['sess_driver'] = 'database'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 0; $config['sess_save_path'] = 'ci_sessions'; $config['sess_match_ip'] = true; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = true; $config['cookie_prefix'] = ''; $config['cookie_domain'] = ''; $config['cookie_path'] = '/'; $config['cookie_secure'] = false; $config['cookie_httponly'] = false; i tried, individu...

How to sort a multidimensional JSON array in PHP? -

this question has answer here: how sort multidimensional array in php [duplicate] 11 answers would please tell me how can sort kind of json array "name" in ascending alphabetical order ? { "response": { "game_count": 86, "games": [ "10": { "appid": 10, "name": "counter-strike", "playtime_forever": 7604, "img_icon_url": "6b0312cda02f5f777efa2f3318c307ff9acafbb5", "img_logo_url": "af890f848dd606ac2fd4415de3c3f5e7a66fcb9f", "has_community_visible_stats": true }, "80": { "appid": 80, "name": "counter-strike: condit...

sql - Mysql not updating the avg function of same table different column by trigger -

i trying update specific column column_2 taking average of rows of column_1 values column_3 = value but gives error my code error: can't update table 'moving_average' in stored function/trigger because used statement invoked stored function/trigger. delimiter $$ create trigger takeaverage after insert on moving_table each row begin update moving_table b, (select avg(price) avg_ moving_table ) v set b.moving_avg = v.avg_price; end; you can't that, per documentaion : a stored function or trigger cannot modify table being used (for reading or writing) statement invoked function or trigger. i rather write before insert trigger , update :new.moving_avg average of existing rows , new price .

javascript - Concatenate object property values -

i have javascript object. concatenate property values, say: tagsarray["1"] = "one"; tagsarray["2"] = "two"; tagsarray["z"] = "zed"; result = "one,two,zed" just background, have several checkboxes, , need update hidden selectedkeys field. example of server side (asp.net) code + angularjs <input hidden id="selectedkeys" value="1,5,8"> @foreach (var tag in tagsdictionary) { <input type="checkbox" ng-model="tagsarray['@tag.key']" ng-true-value ="'@tag.key'" ng-false-value ="" ng-change="change(tagsarray)" />@tag.value } so on each change need update #selectedkeys value one possible approach: var tagsarray = {}; tagsarray["1"] = "one"; tagsarray["2"] = "two"; tagsarray["z"] = "zed"; var result = obje...

http - How to use Netty to create a pipe to upload file to Amazon S3? -

i'm using netty 4 create server application acts proxy upload/download to/from s3. wonder if have use amazon java sdk connect , send data s3. i'd prefer use raw http(s) connection s3 use netty's low level network channel options have better control. idea or example appreicated.

zsh - Calling zmodload from a script -

i'm trying understand how zsh modules loaded. according docs: some optional parts of zsh in modules, separate core of shell. each of these modules may linked in shell @ build time, or can dynamically linked while shell running if installation supports feature. modules linked @ runtime zmodload command. if startup new shell , run command zmodload displays loaded modules (zsh/datetime is not loaded). i can load @ run time using zmodload zsh/datetime . if run zmodload again, can see it's listed. however, when execute script this, zmodload command can't found: %./testload.zsh #!/usr/bin/env zsh zmodload zsh/datetime echo "epochseconds: $epochseconds" ./testload.zsh: line 3: zmodload: command not found but, if execute script while invoking new zsh shell, runs successfully: % zsh testload.zsh #!/usr/bin/env zsh zmodload zsh/datetime echo "epochseconds: $epochseconds" epochseconds: 1501004101 any idea why behavior occurring? ...

sql - Only Perform Group By When Combo Box is Not Empty -

i've solved problem before. unfortunately, i'm having hardest time remembering solution. i have 3 combo boxes, 1 of (quarter) user can choose leave empty. 3 combo boxes attached fields in query. each field setup perform group (case manager, fiscal year, quarter). if combo box quarter not empty, query filters correctly. performs group case manager, fiscal year, , quarter. when combo box quarter left empty, query should group case manager , fiscal year. performs group on quarter well. this sql query: select tblcm.cm, tblfy.fiscalyear, tblqtr.quarter, count(tbldata.casenum) countofcasenum, avg(tbldata.[daystonotifysite-completecalc]) [avgofdaystonotifysite-completecalc], avg(tbldata.[days contact site]) [avgofdays contact site], avg(tbldata.daystoholdmedafterorder) avgofdaystoholdmedafterorder, avg(tbldata.daystoholdmed) avgofdaystoholdmed, avg(tbldata.daystoissuedgodec) avgofdaystoissuedgodec, avg(tbldata.daystocloseafterdecrecdbynrc) avgofdaystocloseafterdecrecdbynrc...

java - Android : Issue deleting last item from RecyclerView -

i using recyclerview in following manner show list of places items updated in sqlite db . the items deleted fine , updated swipe them . when swipe delete last item , comes in view . when close app , reopen app , item deleted though . but when item swiped delete , in instance of app running , item not deleted view after swiping multiple times . @override public void onswiped(recyclerview.viewholder viewholder, int swipedir) { int swipedposition = viewholder.getadapterposition(); placelistadapter adapter = (placelistadapter) mrecyclerview.getadapter(); int pos = viewholder.getadapterposition(); // build appropriate uri string row id appended string stringid = places.get(pos).getid(); log.d("testhro", stringid); uri uri = placecontract.placeentry.content_uri; uri = uri.buildupon().appendpath(stringid).build(); log.d("testhhd", uri.tostring()); // completed (2) delete single row of data using contentresol...

Angular 2/4: How do you reference path parameters in the route data? -

is there way reference path parameters in data of route? i have generic route looks this: { path: "servicing/:type/:id", component: basecomponent, data: { title: "servicing" } }, i use title property set title @ top of page (and <title> tags). rather have write special code title handling has know pages should prepend type path param, i'd this: { path: "servicing/:type/:id", component: basecomponent, data: { title: <type> + " servicing" } }, you should manipulating menu content within component resides within. router isn't "really" built handle logic outside of routing. said easiest thing update content within menu component upon route change. you need import router using activatedroute , tapping it's parameters this: basecomponent.component.ts import { activatedroute } '@angular/router'; constructor( private _activatedroute: activatedroute ) {} ngoninit() { // su...

android - How to update item of Model Class in ArrayList that goes into RecyclerAdapter -

i have model class store user chats info public class userchat { private string ownerid; private string ownername; private string receivername; private string message; private long time; private long oldtime; private string seentick; public userchat() { } public userchat(string ownerid, string ownername, string receivername, string message, long time, long oldtime, string seentick) { this.ownerid = ownerid; this.ownername = ownername; this.receivername = receivername; this.message = message; this.time = time; this.oldtime = oldtime; this.seentick = seentick; } public string getmessage() {return message;} public void setmessage(string message) { this.message = message; }.... initially, retrieving data onchildevenlistener , add arraylist. userchatlist = new arraylist<userchat>(); chatrecycleradapter = new chatrecycleradapter(userchatlist); mchatlist.setlayoutmanager(mlayoutmanager); mchatlist.setadapter(chatrecyclerada...

angular - Referencing SharedModule in AppModule -

that might silly question, thing i'm making harder is, have shared , core modules. have example spinnercomponent (spinner loading icon). means, every component in app should show spinner while loading, fine. spinnercomponent in hour sharedmodule . thing is, have component in app.component need show spinner. should reference sharedmodule in appmodule well? practice? yes should inject sharedmodule appmodule since spinnercomponent used. this suggested way well. @ngmodule({ imports: [ sharedmodule }) ]

laravel - Adding Email Attachments From Local Storage -

i using laravel/lumen. able save files using storage::disk("local")->put(); in storage directory. want attach few of files email , send, done job error lumen.error: exception 'swift_ioexception' message 'unable open file reading now read symbolic linking tried did not change result, still unable attach files n storage folder emails. this directory structure: /home/xxxxxx/: -example.app --storage ---app ----public -public_html --example.app ---storage attaching file this: foreach ($params["attachments"] $attachment) { $mail->attach($attachment["file"], [ 'as' => $attachment["name"], 'mime' => $attachment["mime"] ]); } okay apparently swift mailer fails when pass full url instead of real path file. didn't know this, don't know if it's bug or done design.