Posts

Showing posts from January, 2010

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...

grizzly - Jersey not triggering ContainerRequestFilter -

i'm trying use containerrequestfilter enforce authentication on grizzly based jersey application. i create own resource config extending packagesresourceconfig: public class mainresourceconfig extends packagesresourceconfig { public mainresourceconfig() { super("za.co.quinn.ws"); map<string, object> properties = getproperties(); properties.put( "com.sun.jersey.spi.container.containerrequestfilter", "com.sun.jersey.api.container.filter.loggingfilter;" + mainrequestfilter.class.getname() ); properties.put( "com.sun.jersey.spi.container.containerresponsefilters", "com.sun.jersey.api.container.filter.loggingfilter;" + mainresponsefilter.class.getname() ); } } the request filter authentication: @inject authorization authorization; @override public containerrequest filter(containerrequest request) { ...

active directory - Microsoft AD GUID Mismatch -

this has been answered before, can't find life of me. have different systems, , of older ones have different ad guids same person when compared newer systems. guids similar, different. causing big problem in new app doing reading sql database form , older , newer app. here example, , older 1 this: 147e2a1e-579e-a143-88b9-d3a8ee00e609 , newer 1 1e2a7e14-9e57-43a1-88b9-d3a8ee00e609 . if read ad .net gives me "newer" guid. cause of this, , can fix it? i have seen problem before. caused way different tools interpret bits in ad differently. bet can convert 1 other swapping things around. need figure out algorithm. wrote code fixed similar in 1 instance, may not fix yours, should on right path. private shared function symmetricconversion(source guid) guid dim sourcestr = source.tostring() dim sb = new system.text.stringbuilder() 'group 1 sb.append(sourcestr.substring(6, 2)) sb.append(sourcestr.substring(4, 2)) sb.append(so...

asp.net - Browser refresh corrupts bundled javascript -

i added asp.net javascript bundling , minfication our website, , have discovered if refresh website, bundled javascript file downloaded gzip never uncompressed browser, site of course doesn't work since javascript still compressed. if refresh again, site fine. refresh again, corrupt. , forth. happening in chrome , safari, not in ie. watching in fiddler, ie gets javascript first time, , subsequent refreshes return 304 not modified correct. chrome / safari refreshes continually return 200 each refresh. if run website locally hosting in iis express, problem not occur. it's in our other qa, staging , production environments website hosted iis 7.5. i did fiddler compare of chrome request , bad chrome request see what's different. identical except bad request has "if-modified-since" header. the response server when "if-modified-since" header there has content-type of "application/javascript", , think causing problem, browser doesn...

How do you create an extension to Chart.js? -

i have created new chart type: chart.types.line.extend({ name: "linewithrectangle", draw: function () { chart.types.line.prototype.draw.apply(this, arguments); var startpoint = this.datasets[0].points[this.options.startindex] var endpoint = this.datasets[0].points[this.options.endindex] var scale = this.scale this.chart.ctx.fillstyle = "#808080"; ctx.globalalpha = 0.2; this.chart.ctx.fillrect(startpoint.x, scale.startpoint, endpoint.x - startpoint.x, scale.endpoint - scale.startpoint); ctx.stroke(); ctx.globalalpha = 1; this.chart.ctx.textalign = 'center'; this.chart.ctx.filltext("event day", startpoint.x + (endpoint.x - startpoint.x) / 2, scale.startpoint + 20); } }); i placed co...

package.json - npm install dosen't install dev dependencies -

i have project use npm handling dependencies. project bundled webpack , run on client (it's built using gh-pages hosting) no production dependencies. therefore have devdependencies in package.json . however, when run npm install nothing gets installed. when run npm install --dev dependencies gets installed supposed to. since --dev deprecated tried npm install --only=dev well, nothing gets installed either! there broken in package.json (inserted below) or misunderstanding npm? { "name": "boilerplate", "version": "0.0.1", "description": "a boilerplate started offline first react/redux app", "repository": { "type": "git", "url": "https://github.com/oskarklintrot/offline-first-react-and-redux-boilerplate" }, "scripts": { "start": "webpack-dev-server", "build": "webpack --progress --colors --production...

C# WPF reset tab order of controls at runtime -

i'm developing wpf application have various controls (both out of box wpf controls , telerik controls). in 1 of sections of application grid various items can dragged around rearrange position of item on grid in relation other items. when loading application default tab order goes through various controls expected , once reaches grid section sequentially tabs through each control top left down bottom right - expected. then after drag 1 of items within grid location of items shuffle along when try tab through items not recognise new order of tiles. my question is, how able reset tabbing order on controls reflect latest position of them within grid? notes: the controls using built drag , drop. the control called radtileview (telerik control), sub-items dragging , dropping called radtileviewitems i don't believe within telerik documentation addresses specifically surely isn't telerik problem; possible create custom drag , drop functionality within wpf possibl...

java - Multithreading: Switching context -

i have written small sample code: public class button2 implements runnable{ jbutton jbutton = new jbutton(); static boolean changecontext = false; public button2(){ jbutton.settext("buttontwo"); jbutton.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { changecontext = true; ((jbutton)e.getsource()).setenabled(false); } }); } @override public void run() { system.out.println("buttontwo run..."); jbutton.setenabled(true); while(true){ if(changecontext) break; } changecontext = false; } } when run like: button2 threadtwo = new button2(); thread thread2; try{ thread2 = new thread(threadtwo); thread2.start(); thread2.join(); }catch(exception ex){ ...

php - Displaying clicked items in session array -

i'm learning mvc , symfony2 (version 2.7) creating super simple shopping cart test (i know symfony has doctrine want learn basics, go easy on me ;) ). all want able each item click, appears next other items clicked. isn't mvc or symfony2 problem as php, twig coding problem i'm flubbing on. i have form users can click buy, on users redirected form displays bought. below display other items buy button option again. once click button item, new item should appear next previous one. instead old item goes away , new item appears. how can make old ones stay along new ones? below controller class renders forms. take @ buyaction stores items in cart, 1 @ time...how can fix that? ////////////////// <?php namespace appbundle\controller; use symfony\component\httpfoundation\request; use symfony\component\httpfoundation\session\session; use symfony\bundle\frameworkbundle\controller\controller; use sensio\bundle\frameworkextrabundle\configuration\method; use sensi...

java - WindowEvent without specification? -

betrachterfxmlcontroller controller = loader<betrachterfxmlcontroller>getcontroller(); eventhandler<windowevent> h; h = (windowevent event) -> { event.consume(); controller.end(); }; i see type of eventhandler first time. supposed is, should tell controller close program (end() calls platform.exit) when x @ top clicked. due fact gui has multiple windows , windows should closed when main window closed. what don't why eventhandler waits random(?) windowevent. doesn't has specified windowevent handles?

How to get pinterest/peach like module in iOS -

Image
i new ios development , curious how achieved? overlaying module have in place here comments , boards , wondering if inform me how achieve this? couldn't find on so, youtube or cococacontrols if give me insider on appreciate it! i have achieved same showing simple modal window. there adjustment have achieve black overlay. create view controller change view color black opacity this make view bit transparent. ctrl+drag 1 view controller , choose segue kind "present modally" now click on segue create , choose presentation over current context you can modify modal view controller way wanted , way can same effect. hope guide in correct direction.

python - Function re.sub() refuses to work when I change an ANSI string to UNICODE one -

when use ansi characters works expected: >>> import re >>> r = ur'(\w+)\s+(\w+)\s+(\w+)\?' >>> s = 'what it?' >>> re.sub(r, ur'\1<br>\2<br>\3<br>', s, re.unicode) u'what<br>is<br>it<br>' but when change string s similar 1 contains of unicode characters - doesn't work want: >>> s = u'что это есть?' >>> re.sub(r, ur'\1<br>\2<br>\3<br>', s, re.unicode) u'\u0427\u0442\u043e \u044d\u0442\u043e \u0435\u0441\u0442\u044c?' it looks strange (the string stays unchanged) because use re.unicode in both cases... re.match matches groups unicode flag: >>> m = re.match(r, s, re.unicode) >>> m.group(1) u'\u0447\u0442\u043e' >>> m.group(2) u'\u044d\u0442\u043e' >>> m.group(3) u'\u0435\u0441\u0442\u044c' you have specify re.unicode flags parameter re...

kml - Google-earth timestamp slider from months and years -

i want use timestamp let users step through our monthly metadata, displaying different configurations of land stations @ each month. test examples (eg): <placemark> <timestamp> <when>1901-01</when> </timestamp> <styleurl>#emphasisedplacemark</styleurl> <point> <coordinates> -0.18, 51.15,0 </coordinates> </point> </placemark> <placemark> <timestamp> <when>1901-02</when> </timestamp> <styleurl>#emphasisedplacemark</styleurl> <point> <coordinates> -0.52, 53.17,0 </coordinates> </point> </placemark> this works, slider ge introduces includes days! have scroll through days in each month. that's going create confusion because it's monthly data set. how can time slider show years , months? thought default whatever timestamp format was? i don't see being addressed in existin...

Count Number of Values Passed Into a Haskell Constructor -

suppose have data type data foo = foo string bool | bar (string->bool) i want function f does: f (foo _ _) = [string, bool] f (bar _) = [string->bool] in particular, i'd function magically know foo , boo constructors, , not give me either of f (foo _ _) = [string -> bool] -- #don't want this!!!! f (boo _) = [string, bool] -- #don't want this!!!! how can this? know can print list of records of adt using data.data, can't figure out how print list of typenames. (if not possible, settle function f' takes in adts , outputs whether or not has 0 parameters. f'(foo _ _) = false f'(bar _) = false i want work if don't assign records adt f' operates on.)

Torch - repeat tensor like numpy repeat -

i trying repeat tensor in torch in 2 ways. example repeating tensor {1,2,3,4} 3 times both ways yield; {1,2,3,4,1,2,3,4,1,2,3,4} {1,1,1,2,2,2,3,3,3,4,4,4} there built in torch:repeattensor function generate first of 2 (like numpy.tile() ) can't find 1 latter (like numpy.repeat() ). i'm sure call sort on first give second think might computationally expensive larger arrays? thanks. a = torch.tensor{1,2,3,4} to {1,2,3,4,1,2,3,4,1,2,3,4} repeat tensor thrice in 1st dimension: a:repeattensor(3) to {1,1,1,2,2,2,3,3,3,4,4,4} add dimension tensor , repeat thrice in 2nd dimension 4 x 3 tensor, can flatten. b = a:reshape(4,1):repeattensor(1,3) b:view(b:nelement())

Convert IP or MAC address from string to byte array (Arduino or C) -

i convert mystring "100.200.300.400" byte array [4]. i'm "bit" confused, right or need use foreach reading single number? string mystring = "100.200.300.400"; byte mybytearray[4]; mystring.getbytes(mybytearray,4); finally want print array serial. should right. for (i=0; i<4; i++) { serial.print(mybytearray[i]); serial.print("."); //delimiter } were going wrong? got 49,48,48,0 ! if trying string "100.150.200.250" byte array { 100, 150, 200, 250 } , need extract string representation each number , convert (parse) them binary representation before storing them in byte array. the way trying this, converting first 4 bytes string, i.e. "100." , binary representation of each character, turns out { 49, 48, 48, 0 } . can in ascii table . also remember that, storing on byte array, support values 0 255. as programming on small microcontroller, advise against using string class. might run trouble wh...

php - LIKE function SQL -

i've been using function like in statement not doing expected do, user on site has subject looks hello welcome #room hows going #fun , im using like function select users subject containing #fun statement looks this; $search = 'fun'; $sql = "select * `usr_users` `subject` '%$search%'"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { echo $row['username']; } however when query runs selects users have fun @ begining of subject or not @ all. there different function can use select words within in subject not first word. you need % @ beginning of string search. $sql = "select * `usr_users` `subject` '%$search%'"; --- update --- it may failing because may need escape data. check errors mysql_error() against query. might throwing it. mysql_real_escape_string(). # culprit if it's part of actual query. or use htmlspecialchars() or echo out query.

Median of last top N hits in ElasticSearch -

given elasticsearch index objects like { "key": "string", "creation_date": "date", "metric":"number" } is possible calculate median of metric last n hits (ordered creation_date ) of each day? text steps of such query: group day using creation_date field group key take last n items (ordered creation_date ) calculate median between them thanks!

Neon-Animated-Pages Animation Size with Polymer -

i'm working on app using polymer. app uses neon-animated-pages move between views , tabs. have plunk here . relevant code can seen here: <div style="width:33%; background-color:lightgrey;"> <paper-button on-click="onitem1click">item 1</paper-button> <paper-button on-click="onitem2click">item 2</paper-button> <paper-button on-click="onitem3click">item 3</paper-button> <br /><br /><br /><br /> </div> <div id="contentarea" style="width:67%; padding:12px;"> <neon-animated-pages selected="[[ selectedindex ]]" entry-animation="slide-left-animation" exit-animation="slide-left-animation"> <section> <item-1></item-1> </section> <section> <item-2></item-2> </section> <section> <h4>item 3</h4> ...

javascript - Loading image in random position on page load -

i working on portfolio website design work , running small problem. i'm trying load images in random positions , use dragabilly make images draggable. at times images end in top corner if position not defined. dragging around still works. suspect not having images loaded before executing script, not sure. my site live here and here i'm using... $ -> $('#menu-button').on 'click', -> $('#menu').toggleclass 'closed' return if $(window).width() > 960 $img = $ '.work-imgs img' wdoh = $('.work-desc').outerheight() wl = ($(window).width() - 384) / $img.length wh = $(window).height() - wdoh $.each _.shuffle($img), (i, e) -> e.onload = -> rm = wh - $(e).height() $(e).css 'left': * wl + (math.random() - .75) * 96 'top': wdoh + math.random() * rm return return $d = $img.draggabil...

gwt - Using <collapse-all-properties /> in production? -

from understanding, collapse-all-properties in gwt.xml, compiler produces 1 permutation browsers. , resulting files 15% 20% larger. other increased file size, there other reasons why shouldn't use collapse-all-properties production? for example, strip browser-dependent logic , css, causing app potentially work and/or differently when compiled default permutations? in app, noticed 100kb size increase in cache.js , combined 50kb increase of deferredjs files collapse-all-properties . but when combined gzip, code splitting , caching, benefit of smaller file size seems trivial compared significant fast compilation time , general ease of use. got me wondering if use production. there no reason can't use in production, aside reasons you've stated, , if expect of users arrive populated caches (app doesn't change often, , users bring app frequently), correct size point less meaningful. there still cost loading large js app memory , building of requir...

javascript - Datatables responsive doesn't work with ajax call -

Image
i'm using datatables plugin , have problem responsive table. used responsive table , ajax call success in new page doesn't work , don't know why. javascript code, simplified compared actual code still not working: $(document).ready(function() { usertable = $('#userstable').datatable({ responsive: true, "ajax": "table", "columns": [ { "data": "username" }, { "data": "enabled"}, { "data": "role.role"}, { "data": "clientversion.name" }, { "data": "username" } ], }); }); and html code: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-...

jquery - JqGrid local filter not working -

the below piece of code not working filter toolbar local data. please me resolve . new jqgrid. trying make grid filter locally. below piece of code took 1 of example given in fiddle. i same thing, happens ,i have 2 filters in grid. if select 2 filters grid filters data correctly. if select 1 filter grid not getting filter. eventhough value second filter "no filter" var serverresponse = [ {id: 10, label: 10, value: "abc"}, {id: 20, label: 20, value: "xyz"}, {id: 30, label: 30, value: "abc"}, {id: 40, label: 40, value: "xyz"}, {id: 50, label: 50, value: "abc"}, {id: 60, label: 60, value: "abc"}, {id: 70, label: 70, value: "xyz"}, {id: 80, label: 90, value: "abc"}, {id: 90, label: 10, value: "xyz"}, {id: 100, label: 20, value: "abc"}, {id: 110, label: 10, value: "abc"}, {id: 120, label: 30, value: "x...

android - Can I affect the color of ripple touch feedback while targeting API 16? -

is there way make ripple have darkening effect instead of lightening one? i can set background of cardview darker color , see ripple feedback. however, card has white background. ripple invisible because noticeable on top of dark text within card. backgroundtint (a common response) api 21+. build compilesdkversion 23 minsdkversion 16 targetsdkversion 23 compile 'com.android.support:recyclerview-v7:23.1.1' compile 'com.android.support:cardview-v7:23.1.+' xml <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/my_card" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardbackgroundcolor="@color/colorgraydark" android:foreground="?android:attr/selectableitembackground" card_view:cardcornerradius="2...

VMWare Workstation won't suspend from command line -

i'm trying automate vmware desktop on windows 7 suspend vm's before backup job each night. used have script did i've noticed won't suspend anymore same command used work. if vmrun list list of running vms no issue. if vmrun suspend "v:\virtual machines\richard-dev\richard-dev.vmx" hangs , have kill command ctrl+c. i've tried newer command using -t specify it's workstation, ie vmrun -t ws suspend "v:\virtual machines\richard-dev\richard-dev.vmx" , still no love. if have vm stopped, can issue vmrun start "v:\virtual machines\richard-dev\richard-dev.vmx" , starts fine. as suspend command, stop command not work. i'm running vmware workstation 11.1.3 build-3206955 on windows 7. any ideas? update: i installed latest vmware tools on guest, latest vix on host should date. i can start vm using vmrun no problem using vmrun -t ws start <path vmx> command doesn't come command prompt, i'm assuming it...

MySQL aggregate function to find closest value -

in mysql, there aggregate function (or other method) find closest value specific value? for example, i'm looking addresses, house number 15. or, when streets doesn't have house no 15, closest house number (like 14 or 16) should returned: select closest(house_no, 15), street_name addresses group street_name since there's need aggregate, can't see order abs(house_no - 15) limit 1 used single result. drop table if exists my_table; create table my_table (street varchar(12) not null ,house_no int not null ,primary key(street,house_no) ); insert my_table values ('street_1',11), ('street_1',12), ('street_1',13), ('street_1',14), ('street_2',12), ('street_2',13), ('street_2',14), ('street_2',15), ('street_3',13), ('street_3',14), ('street_3',16), ('street_4',16), ('street_4',17), ('street_4',18), ('street_4',19); select x.* my_table...

Retrofit 2 beta-4. Android 6. Unable to create convertor -

how fix it? process: www.palchiki.com.palchiki, pid: 2047 java.lang.illegalargumentexception: unable create converter class www.palchiki.com.palchiki.model.serviceresponse method apiwebservice.getservices @ retrofit2.utils.methoderror(utils.java:154) @ retrofit2.methodhandler.createresponseconverter(methodhandler.java:62) @ retrofit2.methodhandler.create(methodhandler.java:33) @ retrofit2.retrofit.loadmethodhandler(retrofit.java:164) @ retrofit2.retrofit$1.invoke(retrofit.java:145) @ java.lang.reflect.proxy.invoke(proxy.java:393) @ $proxy2.getservices(unknown source) @ www.palchiki.com.palchiki.fragment.servicefragment.oncreateview(servicefragment.java:94) @ android.support.v4.app.fragment.performcreateview(fragment.java:1962) i use com.squareup.retrofit2:retrofit:2.0.0-beta4 , com.squareup.retrofit2:converter-gson:2.0.0-beta4 adapter retrofit retrofit = new retrofit.builder() .baseurl(urlwebservice) .addconverterfactory(gsonconverterfactory.create()...

javascript - highcharts dynamic categories not working -

Image
i using below method populate categories in highcharts dynamically not working me var weeklyindicators; var cats = ''; $.when( $.getjson('weeklyindicators', function(data) { weeklyindicators = data; }) ).then(function() { $.each(weeklyindicators, function(i, item) { if (cats.indexof(item.indicatortimestamp) == -1){ cats += "'" + item.indicatortimestamp + "'" + ','; } }); cats = cats.substring(0, cats.length - 1); console.log(cats); // here output: '2016-01-30','2016-01-31','2016-02-01','2016-02-02','2016-02-03','2016-02-04','2016-02-05' $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'monthly average rainfall' }, subtitle: { text: 'source: worldclimate.com' }, ...

c# - How to set up MS Visual Studio to warn me about class instance comparison with operator ==? -

regular condition looks this: if (number == 5) ... but if comparing class instances need use equals method. let's have instances a, b of class, this: if (a.equals(b)) ... what need set visual studio 2015 warn/error me if this: if (a == b) in other words if use equal operator class instances. thanks lot. hard way create custom rule here bit difficult. the easy way use resharper , create custom rule commercial tool. another thing overloading == operator in every class throws exception, works if using own classes , bit tiresome.

If statements based on another column within a dataframe: in R -

for simple dataframe: df <- structure(list(id = 1:9, sex = structure(c(2l, 2l, 1l, 2l, 1l, 1l, 2l, 2l, 1l), .label = c("f", "m"), class = "factor"), score = c(55l, 60l, 62l, 47l, 45l, 52l, 41l, 46l, 57l)), .names = c("id", "sex", "score"), class = "data.frame", row.names = c(na, -9l)) i want write if statements based on score males , females. basic if function go this: df$score3<-ifelse(df$score <45,"low", ifelse(df$score>=45 & df$score<55,"normal", ifelse(df$score >=55,"high...

Dealing with Download Listener in Android -

hello i'm new android studio , i'm dealing downloadlistener in webview in order download files has been uploaded on web page, can file in pdf format,however tried level best find error couldn't found one.the error lies in moment click on downloadable link on webpage shows error goes that: 02-05 22:47:29.425 3531-3531/myapp.hp.com.abhivyakti e/androidruntime: fatal exception: main process: myapp.hp.com.abhivyakti, pid: 3531 java.lang.securityexception: no permission write /storage/emulated/0/download/download: neither user 10059 nor current process has android.permission.write_external_storage. @ android.os.parcel.readexception(parcel.java:1599) @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:183) @ android.database.databaseutils.readexceptionfromparcel(databaseutils.java:135) @ android.content.contentproviderproxy.insert(contentprovidernative.java:476) @ android.content.contentresolver.insert(content...

google cloud messaging - How to get registered into GCM topics from javascript (for Chrome) -

here nice documentation on how implement google cloud messaging (gcm) in chrome. not found reference here or anywhere how subscribe topic using javascript (for chrome). here have found reference how task android: https://developers.google.com/cloud-messaging/topic-messaging#subscribe-to-a-topic java code(android) subscribe topic in gcm: private void subscribetopics(string token) throws ioexception { gcmpubsub pubsub = gcmpubsub.getinstance(this); (string topic : topics) { pubsub.subscribe(token, "/topics/" + topic, null); } } what not looking for i not looking ways chrome app/extension. what want i want send push notification users. far know can achievable in 2 ways: push message topic or have to: "you need send list of reg id of devices , list should not exceed 1000 limitation of gcm if want send message more 1000 devices need break list in chunks of 1000." i want avoid point number 2. my question so, question is ...

c# - manipulate parameters from http post request with a webservice -

i have remote service, sends http post request, url of application http://www.mywebsite.it/testsms/mywebservice.asmx in iso-8859-1 following parameters: type=post&sender=393471234567&receiver=393477654321&text=ciao+mario+come+stai&encoding=iso-8859-1&date=2011-05-20&time=10%3a32%3a32&timestamp=1305880352&smstype=standard how can , manipulate parameters webservice? in alternative remote service send parameters soap (wsdl). in case, how can parameters in c#? thanks in advance...

r - Is there a simple way to subset unique values and their associated datum? -

this question has answer here: split data.frame based on levels of factor new data.frames 1 answer i have large data set contains ~300,000 rows , 60 columns. if want subset unique characteristics within 1 variable use unique() function create data.frame list of unique values in variable. match master data frame associated data master file. this process little cumbersome, wondering if there faster way same thing? example, there function use select unique fields , associated data connected values? for example: make new data frame contains unique surveyid_block id , associated island code , abundances. structure(list(surveyid_block = c("62003713_2", "62003087_2", "62003713_2", "62003713_2", "62003713_1", "62003713_2", "62003713_1", "62003713_2", "62003713_2", "6200...