Posts

Showing posts from September, 2011

java - onDraw Method not Called? -

i creating custom view ondraw method never being called. tried doing - setwillnotdraw(false) still doesn't work. in fact, doesn't work after calling invalidate() . here's code - public class box extends view { public box (context context) { super (context); init(); } private void init() { // initialize paint object paint = new paint(); paint.setstyle(paint.style.fill); paint.setcolor(mboxcolor); setmeasureddimension(200, 200); } @override protected void ondraw(canvas canvas) { super.ondraw(canvas); canvas.drawrect(100, 100, 200, 200, paint); } } my activity code - box box = new box(this); please help in mainactivity.java use setcontentview(box);

google maps - Is API Key Required for Direction Apis Android -

i using below code directions particular lat & lng using google api. have not used api key. app making pushed playstore. want make sure doing here correct or cause problem me ? thanks in advance :) if (pc.getlatitude() != null && pc.getlongitude() != null) { double latitude = double.parsedouble(pc.getlatitude()); double longitude = double.parsedouble(pc.getlongitude()); string uri = string.format(locale.english, "http://maps.google.com/maps?daddr=%f,%f (%s)", latitude, longitude, "location"); intent intent = new intent(intent.action_view, uri.parse(uri)); intent.setclassname("com.google.android.apps.maps", "com.google.android.maps.mapsactivity"); if (intent.resolveactivity(mcontext.getpackagemanager()) != null) { toast.maketext(mcontext, r.string.toast_opening_google_maps, toast.length_short).show(); mcontext.startactivity(intent); } else { ...

xslt - I get expected output only if I remove the strip-spaces -

Image
i'm writing xslt in below xml <?xml version="1.0" encoding="utf-8"?> <body> <para> <page num="794"/>20 july 2009 </para> <para> cont1<case> <casename> <content-style font-style="italic">cont1</content-style> &#x0026; <content-style font-style="italic">drs</content-style> </casename> <content-style font-style="italic">cont1</content-style> </case> cont1 <case> <casename> <content-style font-style="italic">cont1</content-style> &#x0026; <content-style font-style="italic">cont1</content-style> &#x0026; <content-style font-style="italic">mergcont</content-style> </casename> <content-style font-style="italic">[2004] 3 ...

C# performance: construct new collection with existing items using constructor or loop? -

i've searched not found answer, maybe because question not easy describe. example in wpf, have model test , , list<test> lst , have construct observablecollection<testviewmodel> obstests . there maybe 2 ways: var obstests = new observablecollection<testviewmodel>(lst .select(t = > new testviewmodel(t)); var obstests = new observablecollection<testviewmodel>(); foreach(var test in lst) { obstests.add(new testviewmodel(test)); } please tell me better in performance, , tell me best solution if asparallel available(such is observablecollection threadsafe ? i'm using .net 4.5 ) there no difference. ctor uses add method base class collection : reffer: click ! public observablecollection(list<t> list) : base((list != null) ? new list<t>(list.count) : list) { copyfrom(list); } private void copyfrom(ienumerable<t> collection) { ilist<t> items = items; if (collection != null && ite...

xunit.net - Why doesn't .NET Core and xUnit recognise my imported namespaces? -

i have project compiles want test using xunit. although project lets me add references , builds, add using statement test class red squiggly lines , error "type or namespace not found." even though xproj of project want test has been added references, , namespaces exist. has have done, can't see what. using earlier versions of .net, have added references test projects hundreds of times without issue. so different in way .net works, , why not recognize namespaces in referenced assemblies? update : have removed xunit , got mstest working, have same issue. may feature of way have dotnetcore set up, , references in json files more else. this structure works me in .net core 1.0: global.json { "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-preview2-003121" } } src/mylibrary/project.json { "dependencies": { }, "frameworks": { "netstandard1...

Android Studio 1.5.1 Setup -

Image
hi guys i'm trying install android studio 1.5.1 following standard setup phases having following error. i've jdk version 1.7 : it looks if failed stop adb service @ 1 point during installation. try running installation second time, , should skim on already-installed components , install missing one. similar post on stackoverflow: error: stopping adb server failed (code -1) {installing api's - android sdk}

php - Radio button text area -

i have survey form works fine. need 1 question changed. there's 2 radio buttons answers "yes" , "no" , text area under them. want text area locked unless user selects "yes" radio button can type in text area reason "yes". i did looking around , attempting function doesn't seem working. <script> function validate() { var radioyes = document.getelementbyid('radioyes'); var textarea = document.getelementbyid('question5comment'); if (radioyes.checked && question5comment.value.length < 1) { alert('please enter reason question 5.'); question5comment.focus(); return false; } } function toggle(value) { document.getelementbyid('question5comment').disabled = value; } </script> 5. using other non-franchise service centres? <br> *if yes there other reason other price <br> <input type="radio...

html - How to change in jquery date picker 'Set Date' into 'Choose date' -

i use in form jquery date picker. use customers can choose date book something. on mobile phones shows "set date" instead of "choose date" (i got complaints customers thought set date of there phones) <td><label for="entry_134909635">datum </label></td> <td><input type="date" name="datum" value="" id="entry_134909635" ></td> how can change on smartphones datepicker ask choose date? (or rather dutch version should 'kies datum'

node.js - How the get "Manager" property from ActiveDirectory with NodeJS? -

i using "activedirectory" package user's information active directory need more user's manager information too... the code use is: var activedirectory = require('activedirectory'); var ad = new activedirectory('ldap://mydomain.com', 'dc=mydomain, dc=com', 'dragon@mydomain.com', 'dragon'); var query = 'cn=johns'; ad.findusers(query, true, function(err, users) { if (err) { console.log('error: ' +json.stringify(err)); return; } if ((! users) || (users.length == 0)) console.log('no users found.'); else { console.log('findusers: '+json.stringify(users)); } }); and in return is: [ { "dn": "cn=johns,ou=northwall,dc=mydomain,dc=com", "userprincipalname": "johns@mydomain.com", "samaccountname": "johns", "whencreated": "20160315093421.0z", "pwdlastset"...

How to set value to declared variable in SQL Server -

how set value declared variable in sql server. declare @v_sequence int, @v_sequencename nvarchar(max); set @v_sequencename = 'dbo.myseq'; exec('select @v_sequence = next value ' + @v_sequencename) select @v_sequence here getting error: must declare scalar variable "@v_sequence"' please tell me how result of @v_sequence . you want pass value out of execute. recommend use sp_executesql : declare @v_sequence int, @v_sequencename nvarchar(max), @sql nvarchar(max); set @v_sequencename = 'dbo.myseq'; select @sql = 'select @v_sequence = next value ' + @v_sequencename; exec sp_executesql @sql, n'@v_sequence int output', @v_sequence = @v_sequence output; select @v_sequence;

angularjs - Select row doesn't work correctly on mobile -

i run issue when test ui-grid on mobile. when select row, select 2 rows @ same time time select 1. happens on mobile please see in plunker

javascript - How to stop one column from being sortable while Using JQuery UI sortable function -

i have table in jsp page starts <table class="table table-bordered table-striped table-highlight" id="tab_logic"></table> i adding rows table in manner through ajax call function loaddata(data){ var htm = "<tr><th style='width: 20%'>index order</th><th style='width: 20%'>category name</th><th style='width: 20%'>category key</th><th style='width: 20%'>category id</th></tr>"; for(var = 0; < data.length; i++) { htm += "<tr><td>" + data[i].indexorder + "</td><td>" + data[i].name + "</td><td>" + data[i].catkey + "</td><td>" + data[i].id + "</td></tr>"; } $("#tab_logic").html(htm); } now make table sortable using jquery ui plugin , using these lines $("#tab_logic").sortable({ ...

java - Why this code have performance issue even without synchronized keyword? -

why following code have performance issue, frame camera not smooth. public class videocaptureandroid implements previewcallback, callback{ private integer devicerotation = integer.max_value; public videocaptureandroid(context context, int id, long native_capturer) { devicerotationnotifier = new orientationeventlistener(context, sensormanager.sensor_delay_normal) { public void onorientationchanged(int orientation) { if (orientation == orientation_unknown) { log.d(tag, "the device rotation angle unknown."); return; } synchronized(devicerotation) { if (devicerotation != orientation) { devicerotation = orientation; } } } }; exchanger<handler> handlerexchanger = new exchanger<handler>(); camerathread = new camerathread(handlerexchanger); camerathread.start(); } public synchronized void onpreviewframe(byte[] data, camera callbackcamera) {...

String to variable name MATLAB -

if instance have variable xa=2, , construct string joining 'x' , 'a', how can make new string have value 2? xa=2; var=strcat('x','a'); the result of var=xa, want var=2. thank you use eval() : var = eval(strcat('x','a')); it "evaluate" string 'xa' , translate value of variable xa . source : matlab documentation

grouping - Linq return unique records with count of duplicates -

i have collection of printed documents: orderdetailid,submitteddate,printedcount 1,1 jan 2106,1 1,1 jan 2106,1 2,3 jan 2106,1 3,5 jan 2106,1 4,6 jan 2106,1 i can unique records with: private static iqueryable<orderfields> getuniquejobs(iqueryable<orderfields> jobs) { iqueryable<orderfields> uniquejobs = jobs.groupby(x => x.orderdetailid).select(group => group.first());<br/> return uniquejobs.orderby(x => x.submitteddate); } but field printedcount have number of times each document printed: 1,1 jan 2106,2 2,3 jan 2106,1 3,5 jan 2106,1 4,6 jan 2106,1 i grateful help thanks previous swift answers, did not question correctly. can illustrate want slow ugly code, not work ;-) private static list<orderfields> getuniquejobs(iqueryable<orderfields> jobs) { guid lastorderdetailid = guid.empty; list<orderfields> uniquejobs = new list<orderfields>(); jobs = jobs.ord...

system verilog - SystemVerilog [Virtual interface instantiating] -

can instantiate virtual interface? syntax? example : if i've following interface: interface if ( input in1, in2, output out1, out2 ); endinterface virtual interface if vif; can instantiate vif ? virtual interfaces can have , virtual interface or instance of interface or null assigned . ifs m_ifs () ; vifs = m_ifs ; // valid vifs = vifs1 ; // valid vifs = null ( default value if unassigned) if mean vifs = new () or new (if ) ; something statement above not allowed . you instead class interface_container { virtual interface ifs vifs ; } ; interface_container m_interface_container[2] ; m_interface_container[0] = new () ; m_interface_container[1] = new () ; so have 2 instances of vif within instances of 2 class you still have assign interface instance them . interface instance cannot dynamic represent physical connections. m_interface_container[0].vifs = m_ifs ; m_interface_container[1].vifs = m_ifs ; so there can many virtua...

ssis - Flat file reset column -

Image
what reset column in flat file connecion manager editor of flat file source ,df of ssis package equivalent refresh metadata. silly question , silly answer :) remove columns more detail msdn link below https://msdn.microsoft.com/en-us/library/ms180239.aspx

javascript - How to get the span text content within template -

i have problem using jquery retrieve span element within template. here code: template.item.events({ 'click .remove':function(event,tpl){ meteor.call('tasks.remove',this._id); var docemail=tpl.find('#docname'); alert(docemail.text()); meteor.call('doc.removeauthorization', docemail, this._id); },}); my definition of template: <template name="item"> <li class="{{#if ischecked}}mychecked{{/if}}"> <input type="checkbox" checked="{{ischecked}}" class="check-box"/> <strong><span name="docemail" id="docname">{{content}}></span></strong> <span> {{creattime}}</span> <button class="remove">&times;</button> </li></template> here how template placed in body: <ul> {{#each tasks}} <li>{{> item}}</li> {{/each}}...

ios - Is there need for mapping in Swift -

i'm beginner swift coding, , i'm trying send post request json. there need use objectmapper convert model object mapping objects json, or enough use next code: @ibaction func submitaction(sender: anyobject) { //declare parameter dictionary contains string key , value combination. var parameters = ["name": nametextfield.text, "password": passwordtextfield.text] dictionary<string, string> //create url nsurl let url = nsurl(string: "http://myservername.com/api") //change url //create session object var session = nsurlsession.sharedsession() //now create nsmutablerequest object using url object let request = nsmutableurlrequest(url: url!) request.httpmethod = "post" //set http method post var err: nserror? request.httpbody = nsjsonserialization.datawithjsonobject(parameters, options: nil, error: &err) // pass dictionary nsdata o...

java - How to get input value by using class? -

i using code below webelement inputele = driver.findelement(by.classname("class_name")); string inputeleval = inputele.getattribute("value"); system.out.println(inputeleval); but value empty . html below. <div id="main"> <div id="hiddenresult"> <div class="tech-blog-list"> <label for="question">1st question</label> <input id="txt60" class="form-control" type="text" value="sddf sd sdfsdf sdf sdfsdf sdfsdfsd fsd" /> </div> </div> <div class="pagination_main pull-left"> <div id="pagination"> <div class="pagination"> <a class="previous" onclick="previousbtnclickevent();" href="javascript:void(0)">previous</a> <a id="pg59" class="ep" onclick="...

Extract data from string in python -

i have .csv file data constructed [datetime, "(data1, data2)"] in rows , have managed import data python time , temp , problem facing how seperate temp string 2 new_temp columns in float format use plotting later on? my code far is: import csv import matplotlib.dates dates def getcolumn(filename, column): results = csv.reader(open('logfile.csv'), delimiter = ",") return [result[column] result in results] time = getcolumn("logfile.csv",0) temp = getcolumn("logfile.csv",1) new_time = dates.datestr2num(time) new_temp = [???] when print temp ['(0.0, 0.0)', '(64.4164, 66.2503)', '(63.4768, 65.4108)', '(62.7148, 64.6278)', '(62.0408, 63.9625)', '(61.456, 63.2638)', '(61.0234, 62.837)', '(60.6823, 62.317)',...etc] if can me in advance. you may use code: import re string = "['(0.0, 0.0)', '(64.4164, 66.2503)', '(63.4768, 6...

javascript - How to Map the data that I am getting from ajax React js? -

Image
i new react js. how map through data getting json response ajax.i know did wrong place don't know where.this error getting uncaught typeerror: this.state.data.map not function code /** * created arfo on 6/26/2016. */ var react =require('react'); var api = require('../utils'); var bulkmail = react.createclass({ getinitialstate:function () { return{ default:10, data:'', color:'#58fa58' } }, componentdidmount:function () { api.getemail(this.state.default).then(function (response) { this.setstate({ data:response }) }.bind(this)) }, onsubmit:function (e) { e.preventdefault(); console.log(this.refs.text.value.trim()); }, onchange:function (e) { e.preventdefault(); //console.log(this.refs.text.value.trim()) var data = this.refs.text.value.trim(); if(isnan(data)){ ...

swift - Type 'Battle' does not conform to protocol 'GKMatchmakerViewControllerDelegate' -

Image
i have code: import gamekit class battle: uiviewcontroller, gkmatchmakerviewcontrollerdelegate { func hostmatch(sender: anyobject) { var request: gkmatchrequest = gkmatchrequest() request.minplayers = 2 request.maxplayers = 2 var mmvc: gkmatchmakerviewcontroller = gkmatchmakerviewcontroller(matchrequest: request)! mmvc.matchmakerdelegate = self self.presentviewcontroller(mmvc, animated: true, completion: { _ in }) } } which should show game center standard user interface searching players, reason keeps giving me error: type 'battle' not conform protocol 'gkmatchmakerviewcontrollerdelegate' that whole error , have no idea how fix it. if have answer, please explain can understand it. you getting error because class doesn't have functions (or variables) protocol gkmatchkmakerviewcontrollerdelegate wants class have. to find out functions or variables need include, command-click on protocol name. see protocol declarati...

php - Add line numbers to TCPDF -

is possible set linenumbers document using tcpdf?. in case i'm using multicell() method , want set linenumbering. possible? i found answer myself. extended tcpdf , copied writer() method. added $nl in each cell() call. $this->cell($w, $h, $nl.' '.$tmpstr, 0, $ln, $align, $fill, $link, $stretch); best regards

java - Searching related stories based on tag on priority basis -

i need search related stories based on tags of story.. say have story 4 tags related story logic be step 1 : search 4 tags under story >> display story step 2 : search 3 tags creating different permutation & combination related tags >> display story step 3 : search 2 tags creating different permutation & combination related tags >> display story step 4 : search tag 1 after other, if found display same in “more this” field. how can achieve this. newbee in solr please guide me... thomas' suggestion in comments idea, can give wrong result - example if have 2 common tags , 2 that's unique 2 stories in question. i.e.: story 1 (foo, bar, the, is) story 2 (foo, bar, ask, barf) story 3 (baz, bar, the, is) .. repeat thousands of other stories "the" , "is" tags if search tag:(foo or bar or or is) when displaying first entry, might story 2 instead - has "valuable" tags (and default calculat...

android - How to save data and re-open the last used Activity -

i've made majority of game's mechanics, need able to: save data of current activity , retrieve when coming (i'd appreciate example of sharedpreferences if that's need) open back same activity left and in same time when left it. just clearer: i want not restart main activity each time app gets closed or killed. edit: alright, i've used google article in order save activity , recreate later. the code in 1 of activities following: oncreate() @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_player_selection); // check whether we're recreating destroyed instance if (savedinstancestate != null) { // restore value of members saved state village = savedinstancestate.getstring(village); seekbarprogress = savedinstancestate.getint(progress); } else { // initialize members default values new instance ...

php - show custom plugin menu for custom user role user in wordpress -

i creating new user role "test_client" , it's working problem want show custom plugin page menu in dashboard in code "manage_options" 'true' plugin menu showing , if "manage_options" 'false' not showing plugin menu.. $result = add_role('test_client', 'test_client', array( // dashboard 'read' => true, // true allows capability 'edit_posts' => true, // allows user edit own posts 'edit_pages' => true, // allows user edit pages 'edit_others_posts' => false, // allows user edit others posts not own 'create_posts' => false, // allows user create new posts 'manage_categories' => false, // allows user manage post categories 'publish_posts' => false, // allows user publish, otherwise posts stays in draft mode 'manage_options' => true, ) ); so how showing custom plugin menu in wordpress...

Swift Tuple index using a variable as the index? -

swift tuple index using variable index? know if possible use variable index swift tuple index. wish select , item tuple using random number. have random number variable cannot see how use index tuple. have searched various places already make sure you've chosen correct data structure if you've reached point need access tuple members if "indexed", should on data structure see if tuple right choice in case. martinr mentions in comment, perhaps array more appropriate choice, or, mentioned simplebob, dictionary. technically: yes, tuple members can accessed index-style you can make use of runtime introspection access children of mirror representation of tuple, , choose child value given supplied index. e.g., 5-tuples elements of same type: func getmemberoffivetuple<t>(tuple: (t, t, t, t, t), atindex: int) -> t? { let children = mirror(reflecting: tup).children guard case let idx = intmax(atindex) idx < children.count else ...

excel - How to extract parsed data from once cell to another -

given spreadsheet cell containing string consists of hyphenated series of character segments, need extract last segment. for example, consider column containing data strings xx-xxx-x-xx-xx-g10 , x denotes character. formula need place in column b g10 result? b 1 xx-xxx-x-xx-xx-g10 g10 i'm looking formula work in in libre office calc, open office calc, ms excel, or google sheets. another possibility in lo calc use general purpose regular expression macro shown here: https://superuser.com/a/1072196/541756 . cell formula similar jpv's answer: =refind(a1,"([^-]+$)")

javascript - Redirect to url with auth header -

i'm trying redirect protected resource. when press login button posts unprotected login api , returns token. the other routes expect header "authorisation: bearer token" kind of deal, don't know how set header when redirect protected resource: console.log("success logging in, token retrieved.."); window.localstorage.setitem('token', data.token); window.location.href = '/admin/'; // + '?token='+ data.token; i pass token in query, that's bit ugly in opinion have handle endpoint differently how others handled... don't want have use cookies. is there way add header? maybe i'm going wrong... the short answer is, can't this. have use query param.

macros - Haxe: add @:build metadata to all classes in project -

is possible apply type building macro classes in project without modifying code? i'm trying implement debugger based on haxe macros: inject calls function between every expression in every function of class. have interface idebuggable , code in classes implement interface can stopped @ breakpoints. you can use haxe.macro.compiler.addglobalmetadata() this. can either done initialization macro or on command line: --macro addglobalmetadata('', '@:build(build.build())')

Regex to check password validation -

this question has answer here: regex validate password strength 5 answers i have refered, srinivas 's answer make password validation. regex minimum 8 character, 1 number, 1 alphabet , 1 special character "^(?=.*[a-za-z])(?=.*\d)(?=.*[$@$!%*#?&])[a-za-z\d$@$!%*#?&]{8,}$" with regex, can use following special characters. $@$!%*#?& . if use dheepan~123 or dheepan.123 vaildation fails. how can allow special characters? you can allow special char using \w i'm not sure want this... anyway: ^(?=.*[a-za-z])(?=.*\d)(?=.*[\w])[\w\w]{8,}$

jquery - Datatable searching is not working -

i using datatable in project robust searching , many more advantages of datatable when need value of search box searching of datatable not working. need searching value of search box deleting data when apply code of getting value of search box searching not working in datable. below code. <html> <title>example 1 - apply datatable()</title> <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.datatables/1.9.0/css/jquery.datatables.css"> <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.datatables/1.9.0/css/jquery.datatables_themeroller.css"> <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.1.min.js"></script> <script type="text/javascript" charset="utf8" src="http://ajax.aspn...

c++ - What debugging technique for a karma generator with runtime error -

not easy sate programming question don't see problem is. indeed, have runtime error lost somewhere in boost spirit karma library. guess miss debugging technique here. i have seen macro boost_spirit_debug_node(s) helps parsers, although couldn't find reference in manual. generators, seems not working , (honestly) don't have courage (should ?) dig code of library understand issue is. i have tried generate 3 types of union-like structure alone in grammar without issue. assume error comes cast of u structure boost variant, again (see casting attribute boost::variant ) have no proof. for solve simple code inspection, here minimal example of issue: #include <iostream> #include <fstream> #include <vector> #include <iterator> //#define boost_spirit_debug #include <boost/spirit/include/karma.hpp> #include <boost/variant/variant.hpp> namespace ka = boost::spirit::karma; typedef std::back_insert_iterator<std::string> iterator; ...

c# - Azure Mobile App service exception "The item does not exist" while InsertAsync -

i have interested situation. have class , table on azure: public class inmeitem { public string id { get; set; } [jsonproperty(propertyname = "heartrate")] public string heartrate { get; set; } [jsonproperty(propertyname = "pulsewave")] public string pulsewave { get; set; } } i have follow code insert new item table: public static async task insertinmeitem(inmeitem inmeitem) { try { await app.mobileservice.gettable<inmeitem>().insertasync(inmeitem); } catch (microsoft.windowsazure.mobileservices.mobileserviceinvalidoperationexception ex) { debug.writeline("this f***** situation post data generate exception: " + ex.tostring()); } catch (exception ex) { debug.writeline(ex); } } but have interested situation - running throw exception "the item not exist" data inserted in table on azure without exceptions exception info: t...

How to get full query text in mysql funtrion -

i want make logs simple application. tell me how full query text launched trigger? ex. in app i'm changing user surname , want insert query (update) trigger table logs. how text od update query? create trigger updatee after update on users each row delimiter $$ insert logs values(null,now(),"update",?query?) delimiter ;

java - Fixed fortify scan Locale changes are reappearing -

i have 1 j2ee application , application, fortify scan shows locale dependent issues. i have fixed issues using locale.english in touppercase(locale.english) , tolowercase(locale.english) functions while comparing strings, earlier, firstname.trim().tolowercase(); now firstname.trim().tolowercase(locale.english); and again run fortify scan on application. however, second time, fortify scan shows locale error @ same place. does knows, how can fix these kind of issues? thanks, jay the issue category "portability flaw: locale dependent comparison" (ruleguid=d8e9ed3b-22ec-4cba-98c8-7c67f73ccf4c) belongs "code quality" kingdom , low risk issue. leave un-remediated. rationale when "java.lang.string.touppercase()/tolowercase()" used without setting locale, use default locale. may cause security checking being bypassed. example, want exclude "script" user input; if default language turkish, tag.touppercase() returns "t\u...

git - difftool - Only loading 1 version of gitfile instead of 2 -

i'm trying use inet pdfc difftool comparing different versions of pdf file. config file ... [diff] tool = pdfc [difftool "pdfc"] cmd = 'c:/program files (x86)/i-net pdfc/pdfc.exe' $local $remote when run git difftool head head^ <filename> see 1 file. how can load 2 versions tool? or should use .bat file? , how? try git difftool -t=pdfc head head^ <filename> specify tool.

python - Matplotlib/Pandas: How to plot multiple scatterplots within different locations in the same plot? -

Image
i have 2 pandas dataframes, plot within same plot. these 2 samples, , contrast properties, example: the x axis has 2 locations, left first dataset, , right second dataset. in matplotlib, 1 can plot multiple datasets within same plot: import matplotlib.pyplot plt x = range(100) y = range(100,200) fig = plt.figure() ax1 = fig.add_subplot(111) ax1.scatter(x[:4], y[:4], s=10, c='b', marker="s", label='first') ax1.scatter(x[40:],y[40:], s=10, c='r', marker="o", label='second') plt.show() however, (1) how separate datasets 2 compartmentalized locations first example? (2) how accomplish 2 pandas dataframes? merge them , specify 2 locations plotting? use return_type='axes' data1.boxplot return matplotlib axes object. pass axes second call boxplot using ax=ax . cause both boxplots drawn on same axes. ax = df1.plot() df2.plot(ax=ax) a1=a[['a','time']] ax = a1.boxplot(by='time...

playframework - How to get monthly data using scala & play with month parameter? -

i new scala , play , going make api using them. have made method take month parameter , return data month. date instant . val querybymonth = compiled((month: rep[int]) => table.filter(_.date.getmonth === month)) def getmonthlydata(month: int) = db.run(querybymonth(month).result) n.b: _.date.getmonth === month psudo checking. don't know how month instant query. should do?

ios - Car travel time between two points swift -

i looking in swift can give me travel time (by car) of 2 coordinates. on other threads, have seen suggestions use external sources, question is, apple have built in feature this? similarily, if there not can please link few external sources, have not found (probably because don't know looking for? thanks lot. i don't know of swift api solutions. google has great solution though. check out google's distance matrix api. lets calculate travel time 2 coordinates al sorts of options.

make a visting card image and attach it to a email android -

Image
i have make printable business card shown in attached image , attach email in form of .png image. have no idea how making image in android , attach email in .png format on button click.for reference have attached image of card on here. viewing post.. one way can make card layout , fill in or let user fill in (whichever). , can use following piece of code turn view bitmap public bitmap viewtobitmap(view view) { bitmap bitmap = bitmap.createbitmap(view.getwidth(), view.getheight(), bitmap.config.argb_8888); canvas canvas = new canvas(bitmap); view.draw(canvas); return bitmap; } code question here, convert frame layout image , save it

javascript - Object has been destroyed when open secondary/child window in electron js -

in main window, when button clicked, second/child window popped via ipc call. works when open pop window on first time. if closed pop window , reopen again, error: uncaught exception: error: object has been destroyed @ error (native) @ eventemitter. (/home/xxxx/electron/fin/main.js:36:21) @ emitone (events.js:96:13) @ eventemitter.emit (events.js:188:7) @ eventemitter. (/home/xxxx/electron/fin/node_modules/electron-prebuilt/dist/resources/electron.asar/browser/api/web-contents.js:156:13) @ emittwo (events.js:106:13) @ eventemitter.emit (events.js:191:7) #main.js on app ready: mainwindow = new browserwindow({width: 800, height: 600}) mainwindow.loadurl(`file://${__dirname}/index.html`) mainwindow.webcontents.opendevtools() mainwindow.on('closed', function () { mainwindow = null }) let popwindow = new browserwindow({parent: mainwindow, width: 450, height: 450, show: false}); popwindow.loadurl(`file://${__dirname}/app/pop.html`); po...

haskell - llvm-general-pure fail at compilation -

i want install "llvm-general" package cabal. "llvm-general-pure" (dependencies) fail @ compilation : [19 of 28] compiling llvm.general.internal.prettyprint ( src/llvm/general/internal/prettyprint.hs, dist/build/llvm/general/internal/prettyprint.o ) src/llvm/general/internal/prettyprint.hs:166:19: error: • constructor ‘datad’ should have 6 arguments, has been given 5 • in pattern: datad _ _ tvb cons _ in pattern: tyconi (datad _ _ tvb cons _) in case alternative: tyconi (datad _ _ tvb cons _) -> (tvb, cons) and other error. my configuration: ghc -> 8.0.1 cabal-install -> 1.24.0.0 any idea fix ? although llvm-general-pure claims work base < 5 , not support ghc 8.0 changes template haskell. in particular, datad constuctor used take 5 arguments , now takes 6 . have created ticket on project's github page bring issue maintainer's attention.

How to integrate simplecov with a Ruby gem using RSpec (no rails)? -

when adding simplecov rails project using rspec, i'd place @ top of rails_helper.rb require 'simplecov' simplecov.start 'rails' add_filter '/spec/' add_group 'controllers', 'app/controllers' add_group 'models', 'app/models' end what expected location , code needed have simplecov document code coverage of vanilla ruby gem? as engineersmnky mentioned, code pretty same regardless of framework. include simplecov start @ top of spec helper before require files.

.NET SOAP Client Using :Array -

i'm attempting add soap endpoint located here: http://ds.hitpromo.net/product however following error: scaffolding code ... error:error: cannot import wsdl:porttype detail: exception thrown while running wsdl import extension: system.servicemodel.description.xmlserializermessagecontractimporter error: datatype ' http://schemas.xmlsoap.org/soap/encoding/:array ' missing. xpath error source: //wsdl:definitions[@targetnamespace='urn:productcontrollerwsdl']/wsdl:porttype[@name='productcontrollerporttype'] error: cannot import wsdl:binding detail: there error importing wsdl:porttype wsdl:binding dependent on. xpath wsdl:porttype: //wsdl:definitions[@targetnamespace='urn:productcontrollerwsdl']/wsdl:porttype[@name='productcontrollerporttype'] xpath error source: //wsdl:definitions[@targetnamespace='urn:productcontrollerwsdl']/wsdl:binding[@name='productcontrollerbinding'] error: cannot import wsdl:...

php - How can I parse this json schema in Objective-c -

i have ios app seek station , , add fuel price. i found opendata database, can't parse array "fields" , "price_e10", array "records". here's example of json schema (i think it's multidimensional-array): "records":[ { "datasetid":"prix_des_carburants_j_7", "recordid":"fa74ca1fdf6938333d2bc1013623b66771557b31", "fields":{ "price_e10":1.389, here example of code in objective-c : nserror *e; nsdictionary *dict = [nsjsonserialization jsonobjectwithdata:responsedata options: nsjsonreadingmutablecontainers error: &e]; nsarray *arrayresult =[dict objectforkey:@"records"]; arraysmpl = [nsmutablearray arraywitharray:arrayresult]; nslog(@" multiple array : %@ ",arrayresult); rowsinsection = [arraysmpl count] + 1; thanks help i considered data coming server. nsdictionary *globaldict = [nsjsonserialization jsonobjec...

stata - Reducing code when creating prior year test score in opposite subject -

i have data looks , variable i'm trying create math_score : year id subject score math_score 2011 1 m 30 30 2011 1 r 40 30 2012 2 m 50 50 2012 2 r 60 50 my colleague , have come following way of doing this: bys id year: egen math = mode(score) if subject=="m" id year: egen math_score = max(math) or: bys id year: gen math_score = score[_n-1] replace math_score = math_score[_n+1] if math_score==. ultimately going used in lagged variable denote prior year test score in subject , in opposite subject. we're sure there's more elegant way of doing less code can't seem think of one. ideas? it's lot easier in one: clear input year id str1 subject score 2011 1 m 30 2011 1 r 40 2012 2 m 50 2012 2 ...

vsts - Change name of NuGet package in Visual Studio Team Services -

i need way set or change name of nuget package created in visual studio team services. i've tried changing name of assembly title of project being turned nuget package. you'll need change asssemblyname in .csproj file of project.

Android Studio - jump back and forth between matching braces using a single key sequence -

i had move eclipse android studio android development. many features better, several worse. in particular miss jump between matching braces (opening -> closing brace , v.v.) means of single key sequence. i managed find ctrl ] takes opening brace closing one, ctrl [ takes closing opening brace. if wrong [ or ] symbol used when ara @ opening or closing brace, editor jumps next brace of type. is there key sequence jumps between matching braces, eclipse does? i think want ctrl + } ctrl + { these move open , close brackets. you want single combination both? use ctrl + shift + m reference

jbpm - Project build error: Unknown packaging: kjar -

Image
using jbpm 6.4.0 full installer here: http://www.jbpm.org/download/download.html 1) start demo: ant start.demo 2) using eclipse, create new jbpm project jbpm playground 6.3 , select translations project 3) add maven nature project 4) try install/compile can see following error on problems tab: project build error: unknown packaging: kjar question is : kjar packaging ? how project working in demo enviroment ? my eclipse is: edit: i've found definition on kjar , in particular part on official documentation: version 6, on other hand moves away proprietary packages in favor of, known , mature, apache maven based packaging - known knowledge archives - kjar. processes, rules etc (aka business assets) part of simple jar file built , managed maven. along business assets, java classes , other file types stored in jar file too. moreover, other maven artifact, kjar can have defined dependencies on other artifacts including other kjars. makes ...

javascript - pass a prop from a v-link in vue.js with vue-router -

i have prototype i'm using vue.js, , vue-router in. import vue 'vue' import vuerouter 'vue-router' vue.use(vuerouter) let router = new vuerouter import app './app.vue' import details './details.vue' import pics './pics.vue' router.map({ '/details':{ name: 'details', component: details }, '/pictures':{ name: 'pics', component: pics } }) router.start(app, '#app') app.vue contains router-view mounting point. app contains list of location components based on location data stored in shared state: app.vue: <script> import state './state.js' import location './location.vue' module.exports = { components: {location}, data: () => { return { name: 'app', locations: state.locations } } } </script> <template> <div class="app-container"> ...