Posts

networking - use wireshark for debugging http/https -

Image
i new on wireshark. want capture http or https requests on created bridge connection. fiddler don't captures requests on bridge connection. how can view http requests on wireshark? how can view response of http/https requests on wireshark? how can view requested query on wireshark? i want use wireshark fiddler. this wireshark window looks default (using version 1.12.3 in example): from top bottom have: menu toolbar main toolbar filter toolbar packet list packet details packet bytes status bar in filter toolbar (where input box named filter lies) can write filters keep packets want inspect: how can view http requests on wireshark? http.request how can view response of http/https requests on wireshark? http.response enhancing filter ip address of yor nic reduce amount of packets displayed: http.response , ip.addr == x.x.x.x you can view both request , responses @ same time (as can see in image) using filter: http....

javascript - Node and async/await, promises … which solution is best? -

working node , express babel , trying figure out best approach between async/await , promises. key requirements: to able pass own error not cause blocking to approach problem more es6/es7 way i came out these: promises: loadbyidpromises: function (req, res, next, _id) { console.log('loadbyidc: ', _id); artwork.loadbyid( { _id } ) .then( (artwork) => { req.artwork = artwork; next(); }) .catch( (err) => next(new nodataerror('cannot find id'))); } async/await: loadbyidasync: async function (req, res, next, _id) { console.log('loadbyidb: ', _id); try { req.artwork = await artwork.loadbyid( { _id } ); next(); } catch (err) { next(new nodataerror('cannot find id')); } } or async/await wrapper let wrap = fn => (...args) => fn(...args).catch(args[2]); loadbyidasyncwrap: wrap( async function (req, res, next, _id) { console.log('loadbyida: ', _id); req.artwork = await...

swift - Return items in an array one by one until all items have been returned then start again -

what want able return items array 1 one each time function called until of items in array have been returned, start again first item. the code below need feel there simpler way this, feels weird how did it. any improvements code below? var fruits = ["apple","banana","blue","orange"] func fruit() -> string { let removedfruit = fruits.removeatindex(0) fruits.insert(removedfruit, atindex:fruits.count) return removedfruit } // out put here need // return apple first time fruit function called // return banana second time function called , on... print(fruit()) // apple print(fruit()) // banana print(fruit()) // watermelon print(fruit()) // orange // once of items in array have been returned // start again first item print(fruit()) // apple print(fruit()) // banana print(fruit()) // watermelon print(fruit()) // orange don't mutate array, it's expensive. class fruitgenerator { let fruits = ["app...

smarty - Get categories in a Prestashop theme -

i'd categories in header ( header.tpl ) of prestashop theme seems not working well... my code header.tpl : {$childcategories= category::getchildren(0, 0, $active = true, $id_shop = false);} {printf($childcategories)} issue : error 500 the code have written not valid smarty. prestashop uses smarty render templates. please, take rules if want avoid troubles this. also, have lot of examples in default theme of prestashop learn more coding in smarty. the right code be: {assign var='childcategories' value=category::getchildren(1, 1, true, false)} arguments passed $id_parent : parent category id. root id category 1 , home id category 2. $id_lang: id language. can check in localization area id of language. if have enable multiple languages, use $language variable id. list of global variables in prestashop. $active: return active caregories. $id_shop: id of shop if have got multiple shops in instalation. printing variables debug if want debug ...

ios - Constraint animation issue -

Image
i'm building app whereas i'm facing strange issue constraints. i'm trying animate height constraint attached uiview in storyboard, simulator displays weird behaviour. debug, created new, ios 9.2 project , added uibutton , set horizontal pin , superview top constraint it, linked top constraint header file , button ibaction . when calling code alone: - (ibaction)myaction:(id)sender { self.topconstraint.constant += 150.0f; } the button snaps 150 points down, without calling [self.view layoutifneeded]; . however, when i'm using code: - (ibaction)myaction:(id)sender { self.topconstraint.constant += 150.0f; [self.view setneedsupdateconstraints]; [uiview animatewithduration:1 animations:^{ [self.view layoutifneeded]; }]; } the button slides down. how come snaps there without me calling layoutifneeded when there's no animation block? find strange. here's header file: #import <uikit/uikit.h> @interface viewcon...

excel - How do I remove duplicate values in a cell seperated with a /? -

i have multiple cells in excel have follows: b1= e4i8/e4i8/e4i8/e4i8 b2=d3b2/b30c1/d3b2/d3b2/d3b2/b30c1 multiple /xxxx/ how remove these duplicate text strings in same cell? thank you this function uses keys of dictionary build unique list of parts passed-in string (add reference microsoft scripting runtime ): public function uniqueparts(separator string, toparse string) string dim d new scripting.dictionary, part variant, integer each part in split(toparse, separator) d(part) = 1 next uniqueparts = join(d.keys, "/") end function you can use function in excel formula: =uniqueparts("/","e4i8/e4i8/e4i8/e4i8") or cell reference: =uniqueparts("/",b2) you can use inside macro iterates on range of cells.

ssas - How to sum next periods in MDX -

i've created calculated member sum next periods , it's quite slow. instead if same thing past previous periods lastperiods calculation, runs smoothly. ideas why it's happening? there other function next periods? with member [measures].[avg dmd bum 4months] avg( {([date].[calendar].currentmember,[measures].[dmd fcst bum]) ,([date].[calendar].currentmember.lead(1),[measures].[dmd fcst bum]) ,([date].[calendar].currentmember.lead(2),[measures].[dmd fcst bum]) ,([date].[calendar].currentmember.lead(3),[measures].[dmd fcst bum]) } ) maybe try more traditional format avg - second argument: avg( {[date].[calendar].currentmember ,[date].[calendar].currentmember.lead(1) ,[date].[calendar].currentmember.lead(2) ,[date].[calendar].currentmember.lead(3) } ,[measures].[dmd fcst bum] ) you use lag negative numbers , range operator ':' avg( [date].[calendar].currentmemb...