Posts

selenium webdriver - I want to execute specific test cases say for Ex: TC5 and TC10 using TestNG? -

when have 10 automation test cases , want execute specific test case tc5 , tc10. how acheive using testng? from running tests in testng testng can invoked in different ways: command line ant eclipse intellij's idea with 4 links should able appropriate documentation whichever way want run. each 1 documents how run select methods, classes, packages, , groups. you can define testng.xml file includes/excludes methods/classes/packages/groups want run. e.g.: <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="partial-tc-suite"> <test name="tc5+tc10"> <classes> <class name="com.example.test.tc5"/> <class name="com.example.test.tc10"/> </classes> </test> </suite>

Javascript/Java - Webservice returning doubles for date.valueOf() -

i have javascript webservice returns array of timestamps using date.valueof(). but reason when android application gets results doubles! why happening? have confirmed array in webservice loaded non double values! valueof() returns primitive value of date object, double you're seeing date expressed in milliseconds since midnight 01 january, 1970 utc. known epoch time. if want date in other format, should @ documentation getfullyear, getmonth, , getdate, use construct string date. alternatively, java has calendar class has functions convert epoch time regular dates.

google chrome - Are GCM subscription IDs and instance IDs the same thing? (subscribe to topics via web) -

i'm trying set gcm html5 push notifications through chrome. want these subscriptions use topics, don't have maintain list of subscribed ids myself. however, of topic documentation can find refers subscribing through ios , android apis, not through web. i found documentation on relationship mapping makes seem can control topic subscriptions sending requests server, requires instance id. documentation i've been able find chrome web notifications talks subscription id. are same? i.e., send subscription id server, forward onto gcm server api? or instance id , subscription id 2 different things? don't same in examples provided (the instance id start xxxxxx:yyyyy) i'm concerned won't work. to answer own question: in fact 1 , same. unfortunately, seems topics not work chrome push notifications. api displays topic message being sent, browser never receives it.

python - Why does Pandas give me only one SettingWithCopyWarning? -

i have following code: import pandas pd import numpy np mydf = pd.dataframe({'uid':[1,2,3], 'price':[10,20,30], 'shipped':[2,4,6]}) grouped = mydf.groupby('uid').aggregate(np.sum) # call 1 mydf['price'].loc[:] = np.round(grouped['price'], 2) # call 2 mydf['shipped'].loc[:] = grouped['shipped'] the line have preceded call 1 executes no errors or warnings. line have preceded call 2 results in settingwithcopywarning error. why 1 result in error , not other? can in second call in order rid of error? my code executes fine, i'm tired on seeing 1 lone error every time run tests. no settingwithcopywarning error mydf['shipped'].values[:] = grouped['shipped']

rest - Defining an API with swagger: GET call that uses JSON in parameters -

i trying create proper, rest api, , document swagger (2.0). so, have api call query, ie, makes no changes , doesn't create (idempotent , safe). requires passing in complex json parameter (list of items, 2 or 3 sets of addresses, etc). i'm doing parameter thats url encoded json. seems proper way it. i see api's post reason, that's incorrect use of post verb. i'm seeing lots of swagger api's this... i can't figure out if there's way proper rest api swagger, using json parameter. can define parameter string, of course, , pass encoded json it, swagger tooling doesn't understand there's schema/definition it. is swagger not able document kind of call? i'm working on defining form parameters url-encoded json objects , facing same situation yours. thoroughly going through swagger specs tell not supported yet, required rest apis. also, can't define schema such object.

javascript - Method under test appearing in unit test other than in the action -

i wondering if give me pointers on designing unit tests, function being tested appears in test other in unit's action. i'm writing server side javascript node , using rsvp asynchronous calls restful backend. i structure unit tests follows. //setup //action //assertion //cleanup right now, i'm building function asynchronously deletes enteries in database unit test looks this. "deletingfunction_1entry_returns1entrydeleted": function() { return new rsvp.promise(function( resolve, reject ) { //setup var databaseentry = { "info": "info" }; setup( databaseentry ).then(function( xpostedentries ) { //if setup promise resolves then... //action xdelete( xpostedentries ).then(function( xdeletedenteries ) { //assertion if ( xpostedentries === xdeletedentries ) { //if posted enteries matched deleted enteries then... resolve(); ...

Removing repeated string in javascript -

i have problem 1 of string has repeated url inside , want remove it. what's best way in javascript? following example of string referring to. var str = " http://www.example.comhttp://www.example.com " one solution reassign str half of itself. str = str.substring(str.length/2) (this assumes string follow same format example gave.)

c++11 - C++ type erasure, capture multiple methods of a single class with std::function -

consider following code, in std::function used 3 times capture methods of 1 class: struct some_expensive_to_copy_class { void foo1(int) const { std::cout<<"foo1"<<std::endl; } void foo2(int) const { std::cout<<"foo2"<<std::endl; } void foo3(int) const { std::cout<<"foo3"<<std::endl; } }; struct my_class { template<typename c> auto getfunctions(c const& c) { f1 = [c](int i) { return c.foo1(i);}; f2 = [c](int i) { return c.foo2(i);}; f3 = [c](int i) { return c.foo3(i);}; } std::function<void(int)> f1; std::function<void(int)> f2; std::function<void(int)> f3; }; this, however, perform 3 copies of class some_expensive_to_copy_class , inefficient 1 have guessed name. is there workaround such 1 copy made? to emphasize it, i'm interested here in approach using std::function , not void -pointers , not corresponding i...

javascript - Converting color through library doesn't work correctly -

i'm trying make simple conversion color.js this library . able implement it, output shows wrong values. here's did: var mycolor = new colors(); var hslcolor = mycolor.convertcolor({ h: 100, s: 100, v: 100 }, 'hsv2hsl'); output object {h: 100, s: -1.0204081632653061, l: -4900} it's doable see in convertiontest function @ line 517 did same thing i. doing wrong, , how can fix it? jsfiddle var mycolor = new colors(); var hslcolor = mycolor.convertcolor({ h: 100, s: 100, v: 100 }, 'hsv2hsl'); console.log(hslcolor); <script src="https://rawgit.com/pitpik/colorpicker/master/colors.js"></script> looks names should in caps: var mycolor = new colors(); var hslcolor = mycolor.convertcolor({ h: 100, s: 100, v: 100 }, 'hsv2hsl'); console.log(hslcolor); <script src="https://rawgit.com/pitpik/colorpicker/master/colors.js"></script> ...

Publish an Android App on Google Play only for smartphone -

for day i've looked way pubblish android app on google play store smartphone. i found way http://developer.android.com/guide/practices/screens-distribution.html#filteringhansetapps : <compatible-screens> <!-- small size screens --> <screen android:screensize="small" android:screendensity="ldpi" /> <screen android:screensize="small" android:screendensity="mdpi" /> <screen android:screensize="small" android:screendensity="hdpi" /> <screen android:screensize="small" android:screendensity="xhdpi" /> <screen android:screensize="small" android:screendensity="480" /> <screen android:screensize="small" android:screendensity="560" /> <!-- normal size screens --> <screen android:screensize="normal" android:screendensity="ldp...

magento - magmi configurable items are not grouped with their simple ones and images aren't imported -

assistance appreciated. did import magmi in magento , items imported . configurable items not grouped simple ones! this import csv: download magmi.csv screen capture of import settings: http://awesomecowboy.com/capture.jpg i fixed problem editing attribute in magento simple in list of product types size attribute applied to.

java - Controller doesn't call internal function -

i'm trying make java crud mvc application. uses sqlite database. 1 of functions doesn't want work. in function want prepare pdf document contain strings. work when try run function separated class, when put mvc app doesn't work. the console doesn't show errors, think function doesn't start. suppose parameter problem? here controller.java : public void generuj(){ akcja = new actionlistener() { public void actionperformed(actionevent event) { string[] args = null; pdf.main(args); interfejs.getguzikgeneruj().addactionlistener(akcja); } }; } here functions.java: public static void generuj() throws documentexception{ document dokument = new document(); try { pdfwriter.getinstance(dokument, new fileoutputstream("arkusz inwentaryzacyjny.pdf")); dokument.open(); paragraph paragraf = new paragraph(); paragraf.add("arkusz inwentary...

css - Autoprefixer error on Sublime Text 2 -

i'm trying install autoprefixer sublime text 2 , i'm getting following error: autoprefixer error: /users/labedzde/library/application support/sublime text 2/packages/autoprefixer/node_modules/get-stdin/index.js:7 return new promise(function (resolve) { ^ referenceerror: promise not defined @ module.exports (/users/labedzde/library/application support/sublime text 2/packages/autoprefixer/node_modules/get-stdin/index.js:7:13) @ object. (/users/labedzde/library/application support/sublime text 2/packages/autoprefixer/autoprefixer.js:7:1) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:906:3 i have node.js installed , it's version 0.10.32. what error mean , how can install ...

html5 - How to make double navbar responsive -

Image
i redesigning website has 2 row responsive navbar , stuck. @media (min-width: 767px) { .nav.navbar-nav { float: right; } } <div class="navbar navbar-default navbar-fixed-top"> <div class="collapse navbar-collapse "> <ul class="nav navbar-nav"> <li class="community"><a href="#"><strong>community</strong></a></li> <li class="global"><a href="#"><strong>global</strong></a></li> </ul> </div> <div class="navbar-header"> <div id="button" type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar...

matlab - mcc producing an unresponsive executable -

i trying compile matlab function using mcc function. function writes line of text file. function hello() ofid = fopen('hello.txt','w'); fprintf(ofid, 'hello there, matlab.\n'); fclose(ofid); end it runs expected when called matlab console. however, when compile file executable using mcc /opt/matlab/matlab2008a/bin/mcc -m hello.m and run as ./hello it seems run forever , produces no hello.txt file. both executable matlab function files in matlab working directory. i unable see can possibly wrong in use of mcc . please help. typically, need setup matlab runtime environment when executing mcc compiled applications. you'll more mileage first time using deploytool (from command line) compile hello.m program here. matlab's application builder produce run_hello.sh file can peruse through see how setup libraries. then, execute program call this: ./run_hello.sh /applications/matlab/matlab_runtime/v90/ note: have ...

django - Add context to head of ListAPIView -

i add {'user': self.request.user} header of listapiview. for example, json response like: [ 'user': testing_user, { id: 67, slug: "slugy", }, ] is possible this view? class bookarchiveapiview(generics.listapiview): cache_timeout = 60 * 7 serializer_class = bookserializer queryset = book.objects.all() i know late needed same thing , found on documentation easily. you don't need pass "request.user" view because drf gives you. here example: class show_activities(generics.listapiview): serializer_class = activityserializer def get_queryset(self): username = self.request.user.username return activity.objects.filter(owner=username) it's easy find on documentation i'm answering ones couldn't see it.

java - android spell checker - can it be improved? -

i have been looking @ android spellchecker example in sdk samples. hellospellchecker working seems utterly useless. most strings return no suggestions , others unhelpful. e.g. "tihs" returns 1 suggestion "this" "helo" returns 3 suggestions "he'll" "help "believe" "tabble" returns no suggestions the samplespellchecker example appears absolutely nothing. is there way make checker better? how else can 1 provide spell checker (i want list of words returned when word entered)? i have seen spellchecker framework ment provide same used when sending text on android phone not working well. http://developer.android.com/guide/topics/text/spell-checker-framework.html describes framework don't find helpful , quite hard understand have been @ day, appreciated

facebook - Permissions for application -

i set user & friend permissions on application, user email on website. info when click preview login dialog : this app receive: your basic info email address (xyz@xyz.com) birthday relationship details photos when tried log in on website, application needs information: this app receive: your basic info why? why doesn't main application have same permissions preview? regards edit: i'm using auth tutorial: http://www.asp.net/mvc/tutorials/mvc-4/using-oauth-providers-with-mvc - , code has not changed in project. honestly, don't want change authorization methods, because want provide twitter login, , mechanism perfect me. i want add facebook "scope=email,publish_stream". i discovered, when put query manually when website redirect me facebook application ( &scope=email,publish_stream ), works perfect. there solution on back-code? the app detail page in app center displays permissions required new users. can consi...

Mysql Group by counting issue -

database structure table 'applicants' id org_id team_id 1 1 1 table 'teams' id name 1 test table 'teams_members' id team_id user_id 1 1 1 2 1 2 table 'users_playeraccounts' id user_id summoner_id rank_solo 1 1 1 5 2 1 2 8 3 2 3 7 select sum(rank_solo) rank_sum, max(rank_solo) highest_rank, count(tt.id) members, t.name, o.team_id applicants o join teams t on o.team_id = t.id join teams_members tt on t.id = tt.team_id join users_playeraccounts p on tt.user_id = p.user_id org_id = :org group team_id this offcourse gives me result like r...

javascript - How can I access the tag-name of a jsf composite whitin the composite? -

i have composite (as in xmlns:composite="http://java.sun.com/jsf/composite"). call via <comps:cimgx imgid="ima" flav="r" /> (for example) on page. there way reference html-objects generated composite, client-side via javascript? something like window.document.getelementsby_magic_jsf_tagtype("comps.cimagx"); edit: or within composite like #{cc.jsf_tag_type_name} ?? edit2: background why i'm asking this, see is possible add javascript function h:form in jsf2? js knows nothing server side code responsible producing html output on html document object model based. information has end in html in way. abstraction, make use of css classes. <cc:implementation> <div id="#{cc.clientid}" class="comp-cimgx"> ... </div> </cc:implementation> var cimgxs = document.getelementsbyclassname("comp-cimgx"); (note: getelementsbyclassname() not support...