Posts

Showing posts from May, 2015

android - is it possible to inject my javascript to disable javascript inside any webpage using webview? -

i working on disconnect or ghosty addon in firefox custom browser stop tracking scripts inside various webpages, failed find disable tracking inside webpage loads in webview. after search found way stop track remove sctript webpages load. failed find solution remove scripts loading inside webview, please help.. i think there's way that. but easier , simple way be: mywebview.getsettings().setjavascriptenabled(false);

Android app overridePendingTransition not shown -

i have app main activity using webview load webpage. i trying set animation when user wants go previous webpage using button on device (not button on screen) animation not shown @ all. the code below outside of oncreate() . note: notice tried overridependingtransition in each line commented out no effect. here code: @override public boolean onkeydown(int keycode, keyevent event) { log.i("back", " pressed!"); //overridependingtransition(r.anim.slide_in_right, r.anim.slide_out_left); if ((keycode == keyevent.keycode_back) && this.webview.cangoback()) { //overridependingtransition(r.anim.slide_in_right, r.anim.slide_out_left); this.webview.goback(); return true; } else{ return super.onkeydown(keycode, event); } } @override public void onbackpressed(){ super.onbackpressed(); //overridependingtransition(r.anim.slide_in_r

sql - Counting amount of values in joined table with multiple corresponding entries -

trying figure out following sql command: you have 2 tables, maintable , subtable. maintable consists of pkmaintable column , subtable consists of pksubtable, fkmaintable, bitval1, bitval2 i want figure out every entry in maintable, in corresponding (-> m.pkmaintable = s.fkmaintable) subtable entries none have (bitval1 = true or bitval2 = true) my current attempt (in pseudo-sql code, doesn't work): select * maintable m inner join subtable s on m.pkmaintable = s.fkmaintable sum(case when s.bitval1 = 1 1 else 0 end) = 0 or sum(case when s.bitval2 = 1 1 else 0 end) = 0 example tables: maintable pkmaintable<br> 1<br> 2<br> 3<br> 4<br> subtable pksubtable | fkmaintable | bitval1 | bitval2<br> 1 | 1 | 1 | 1<br> 2 | 1 | 0 | 0<br> 3 | 1 | 0 | 1<br> 4 | 2 | 0 | 0<br> 5 | 2 | 0 |

sprite kit - userDefaults reset / wiped after iOS 10.3 update -

in spritekit game use userdefaults save high scores etc. works fine, working smoothly. however - updated devices ios 10.3 (release, not beta) , noticed saved data wiped... new data preserved - eg - new high score recorded, userdefaults still being set once created.. wouldn't have expected 10.3 wipe old data ?? i imagine new apfs ? i have not tested in other apps yet - has else seen issue ? idea how prevent happening in future ? thanks. example of setting default: (swift 3) if (userdefaults.standard.value(forkey: "highscorelife") == nil) { highscorelife = 0 userdefaults.standard.set(highscorelife, forkey: "highscorelife") } else { highscorelife = int32(userdefaults.standard.integer(forkey: "highscorelife") int) }

python - xlwt on ubuntu installs but does not import -

xlwt installs in following path: /usr/local/lib/python2.7/dist-packages successfully pip or apt-get or easy_install . however, when try import, gives error no module named xlwt . all relevant answers on site pip install , xlwt installed. workaround, added dist packages python path. why not searching in dist packages? i'm using ubuntu 16.04 , python 2.7 for python , django related projects preferred use virtualenv! sudo pip install virtualenv to create virtualenv: virtualenv my_env to activate virtual env: source my_env/bin/activate pip install xlwt ref: http://pythoncentral.io/how-to-install-virtualenv-python/

ios - Ionic cordova-facebook-plugin4 fails api graph call -

i've got application i'm building , code i've got works absolutely fine on android devices gives me graph api error on ios. here code i'm using facebook login. constructor(private menuctrl: menucontroller, private nav: navcontroller, private playerservice: players, private userservice: users, private packservice: packs, private modalctrl: modalcontroller, private loadingctrl: loadingcontroller) { facebook.browserinit(this.fb_app_id, "v2.8"); menuctrl.enable(false, 'navmenu'); } ionviewloaded() { } dofblogin() { var permissions = new array(); let nav = this.nav; let userservice = this.userservice; let playerservice = this.playerservice; let packservice = this.packservice; var menuctrl = this.menuctrl; //the permissions facebook app needs user permissions = ["public_profile", "email", "user_friends"]; facebo

c# - Console.ReadKey() looping by itself in while loop -

i have loop , inside switch case basicly user interface lets people choose yes , continue game left , right arrows. i added console.beep() give feedback user. reason once game ends(the game uses arrows(its snake)) option yes , no keep switching , hear beeping 10 20 times , stops. know reason? code : while (true) { console.clear(); console.writeline("~~~~~~~~~~~~~~~~~~~~~~~~~\n\n~~~~~~~~you lost!~~~~~~~~\n\n~~~~~~~~~~~~~~~~~~~~~~~~~\nyour score was: " + snakebody.count); console.writeline("\ndo want continue?\n\n " + (continue ? ">yes / no" : " yes / >no")); switch (console.readkey().key) { case consolekey.leftarrow: if (!continue) { console.beep(soundfrequency, soundlength); continue = true; } continue; case consolekey.rightarrow: if (continue) { console.beep(soundfrequen

ecmascript 6 - React Router v4 + Regex don't like Template Literals -

react router 4.0.0 comes regex validate querystring parameters. however, not seem compatible es6 template literals. here simple example : <browserrouter> <switch> <route route path={routeconstant} component={mycomponent} /> </switch> </browserrouter> if try following values, you'll see first 2 constants work, third not. const root = 'folder' const routeconstant1 = '/folder/:id(\d+)' // <= /folder/21 matches const routeconstant2 = `/${root}/:id` // <= /folder/21 matches const routeconstant3 = `/${root}/:id(\d+)` // <= /folder/21 not match there explanation (there is), i'd appreciate few pointers because feels bit confusing. in advance. ok, posted question fast guess. the answer in way template literals work : ecmascript 6 - template literals => "backslashes not interpreted" so solution have routeconstant3 work write : const routeconstant3 = `/${root}/:id(\\d+)`

node.js - How to redirect subdomain to a special port? -

in case, host 1 of instances @ digital ocean, using cloudflare dns sever. i tried redirect domain , subdomain special port, not work. domain rsv setting(not working): type: rsv name: _http._tcp.mydomain.life value: srv 0 0 8080 mydomain.life <- ip 128.99.12.34 ttl: auto subdomain rsv setting(not working): type: rsv name: _http._tcp.mysub. value: srv 0 0 8080 othersubdomain.mydomain.life <- ip 128.99.12.34 ttl: auto i have created record mydomain.life , mysub.mydomain.life. the result is, both of them don't redirect 128.99.12.34:8080(netdata), but connect 128.99.12.34(ghost) am missing something? or other solution can me redirect domain/subdomain special port?

c - How to generate note without library? -

i'm trying generate note example , do's frequency 523. wrote codes but, did not work systick 8 mhz void note1(void){ // note (int = 0; < 523; i++){ gpioe->odr = 0x4000; delay_ms(1); gpioe->odr = 0x0000; delay_ms(1); } } how can solve problem ? easymx pro v7 i'm calling function that void button_handler(void) { note1(); // clear pending bit depending on 1 pending if (exti->pr & (1 << 0)){ exti->pr = (1 << 0); } else if (exti->pr & (1 << 1)){ exti->pr = (1 << 1); } } 523 times sending 1 , 0 , delay_ms 1 = 1 ms 1000 = 1 sec on stm32 (as can see have it) have timers can configured pwm output. use timer, set period , prescaler values according needed frequency , set duty cycle on channel 50%. if need 523hz pwm output, set timer pwm 523hz using prescaler , period value: timer_overflow_frequency = tim

Add a new product in dynamic 365 -

Image
i'm using dynamic 365 trial version. learning purpose, want create new product. for navigated follow. sales => collateral => products but can't find option add new product or product family. is options not available in trail version? make sure have 1 of following security roles or equivalent permissions: system administrator, system customizer, sales manager, vice president of sales, vice president of marketing, or ceo-business manager. if office 365 global admin not system administrator in crm go settings - security - users - open user , click promote admin button on ribbon hope helps.

javascript - variable defined in settimeout function returns as undefined outside the function -

please find code below: settimeout(function() { var objtextareatext = objtextarea.innertext; var normalizedtext = objtextareatext; if (!countspacesaschars) { normalizedtext = objtextareatext.replace(/\s/g,"").replace(/&nbsp;/g, "");} strtext = normalizedtext.replace(/(\r\n|\n|\r)/gm, "").replace(/&nbsp;/gi, " "); //strip html tags strtext = normalizedtext.replace(/(<([^>]+)>)/ig,"").replace(/^([\t\r\n]*)$/, ""); }, 50); if (strtext.length >= maxlength) { } from above if statement strtext returning undefined. also if include if statement inside settimeout function below: settimeout(function() { var objtextareatext = objtextarea.innertext; var normalizedtext = objtextareatext; if (!countspacesaschars) {

c++ - Acado toolkit matlab installation -

i'm trying install acado toolkit use matlab , have troubles. in user manual (page:8) (can seen here ), says install visual c++ compiler , restart computer. did part. second step, says write mex -setup on matlab , when did gives errors: error using mex no supported compiler or sdk found. can install freely available mingw-w64 c/c++ compiler; see install mingw-w64 compiler. more options, visit http://www.mathworks.com/support/compilers/r2016b/win64.html. i tried install mingw-w64 compiler , wasn't installed , give installation error , said: "there problem installing third-party software". what should fix it?

python - STM32F4 USB CDC, can't use Data with pyserial -

i have problem combination of stm32f4 usb cdc , pyserial. if code in stm32 wants work received data in main.c can't open port. if not, can send , receive no problem, information stored in userrxbufferfs. i following error: >>> ser.open() traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\program files\anaconda2\lib\site-packages\serial\serialwin32.py", line 78, in open self._reconfigure_port() file "c:\program files\anaconda2\lib\site-packages\serial\serialwin32.py", line 222, in _reconfigure_port 'original message: {!r}'.format(ctypes.winerror())) serial.serialutil.serialexception: cannot configure port, went wrong. original message: windowserror(87, 'falscher parameter.') i tried store data in global variable declared in usbd_cdc_if.h: usbd_cdc_if.h: extern int my_buf[8]; usbd_cdc_if.c: my_buf[0]=userrxbufferfs[0]; --> error tried call function in call

javascript - when iOS keyboard close button stays up on the web -

i have app login page , form. guess of know layout of page might change or not fit form when keyboard opens. added special css page when input focused , keyboard opens. normally can see on picture button aligned bottom using margins, when keyboard opens add class container change layout of page , button aligned form , margin top 0, when keyboard closes on android , computer layout return it's normal form but, on ios reason seems button doesn't aligned bottom again aligned invisible. does know how can fix reflection problem? painting describing problem button.loginbtn{ //normal state css -ms-flex-item-align: center; -ms-grid-row-align: center; align-self: center; margin: auto 0 2.5em 0; background: transparent; border: 2px solid #e8e8ea; border-radius: 50px; font-size: 142.85%; opacity: 1; width: 82%; min-height: 45px; padding: 1em 0; } .loginbtn{ //when keyboard open margin-top: 0; }

JQuery. how do I create nested buttons with well defined onclick action (MODIFIED) -

for little project (which involves nested forms), seems need below. not sure how pass parameters x , y have nested buttons. need nested button 'knows' under outer button is. how achieve that? there way write $(".add_field_button_sub_"+x+"") ? <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html> <head> <title> test </title> <script src="jquery-3.2.0.js" type="text/javascript"> </script> <script type="text/javascript"> $(document).ready(function() { var wrapper = $(".input_fields_wrap"); var x = 0; //initial text box count $(".add_field_button").click(function(e){ if(x < 10){ $( "<div><div>hello! ("+x+")</div><div><button class=\"add_field_button_sub_"+x+"\">sub button &q

Angular 2: Existing solution for discussion implementations -

i have angular 2 app. impl discussion. there already existing solution ? there several npm packages adding components such disqus: ng2-awesome-disqus ng2-disqus angular2-disqus i haven't used of these, sounds looking for.

Crystal Reports - Getting the SUM of 3 fields in the detail section -

all, i relatively new crystal reporting , part self taught via of google , resources such site. i have report developing track change orders on projects. in report have 4 fields same table in database trying add in detail section come 1 lump number. the fields trying add overall cost of co ({estimate_item.aggprice}) , 3 different tax types may or may not relevant cost ({estimate_item.aggtaxamt1},{estimate_item.aggtaxamt2},{estimate_item.aggtaxamt3}). if put individual fields report populate accurate costs. wrote below formula {@totalcost} thought trick of adding them when insert formula detail section of report shows blank. whilereadingrecords; tonumber({estimate_item.aggprice}) + tonumber({estimate_item.aggtaxamt1}) + tonumber({estimate_item.aggtaxamt2}) + tonumber({estimate_item.aggtaxamt3}) thanks in advance assistance can provide, think missing pretty basic.

javascript - Setting react-router link prop with a condition statement returns a syntax error -

i trying write render function sets onlyactiveonindex={true} on react-route component when passed correct argument. so instead of repeating whole link tried writing code: render() { return ( <div classname={`navbar navbar-${this.props.linksdata.length}`}> {this.props.linksdata.map((linkdata) => { return( <div classname="navbar-link-container" key={linkdata.to}> <link activeclassname="navbar-active-link" {linkdata.to === '/' ? onlyactiveonindex={true} : null} to={linkdata.to}> <i classname="navbar-icon material-icons">{linkdata.icon}</i> <span classname="navbar-link-text">{linkdata.text}</span> </link> </div> ) })} </div> ) } but following syntax error: syntax error: unexpected t

angularjs - Ionic - Typescript error - Type is not an array or a string -

i starting ionic , angular , facing issue variable type. querying api ouput array of elements. import { component } '@angular/core'; import { navcontroller } 'ionic-angular'; import {postservice } '../_providers/post-service'; @component({ selector: 'page-home', templateurl: 'home.html', providers:[postservice] }) export class homepage { public posts: any; private start:number=0; constructor(public navctrl: navcontroller, public postservice: postservice) { this.getpost(); } getpost(){ return new promise( resolve => { this.postservice.load(this.start) .then(data => { console.log(data); for(let post of data) { this.posts.push(post); } resolve(true); }); }); } doinfinite(infinitescroll:any) { console.log(this.start); this.start+=10; this.getpost().then(()=>{ infinitescroll.complete(); }); } li

rest - Avoid Run (Compile+Run) web service -

i'm having webapi project in visual studio query using fiddler restful services. when run project iis express launched site , works. i don't want run project every time after code change. i want build project. i know debugging not work, rest services updated , give results. how can ?

node.js - Cursor is not sending the updated data from mongoDB's Capped Collection? -

i trying read data "message" capped collection, what trying insert new data in collection through mongo console(or tool) want data shown @ node console not working. i tried iterate .foreach loop on collections showing .foreach not function.*i know stream deprecated using cursor having same problem. thanks lot in advance :) app.js var message=mongoose.model("message",messageschema); var cursor=message.find({}, {tailable:true, await_data:true, numberofretries:-1}, function(err,data){ if(err){console.log("error");} else{ console.log(data);} }); //iterating on collection cursor.cursor() .on('data', function(doc){ console.log(doc); }) .on('error', function(err){ // handle error }) .on('end', function(){ // final callback });

angularjs - How can we concat angular js variable with ng-model -

<div class="row" data-ng-repeat="i in [1,2,3,4]"> <div asterick class="form-group" ng-class="{'form-group has-success': !error['resource_type'] && (submitted), 'form-group has-error': (error['resource_type']) && (submitted)}"> <label for="resourcetype">resource type</label> <select name="resourcetype" id="resourcetype" ng-model="data.resource_type+{{ }}" ng-required="true" > <option ng-repeat="option in resourcetypejson" value="{{option}}">{{option}}</option> </select> </div> </div> i trying access i (loop variable) ng-model. need resource_type1, resource_type2 , on. how can please help. make resource type array instead of separate properties. { data: {

codeigniter - (:any) routing blocks 404_override routing -

i have these routes : $route['default_controller'] = 'pages/view/$1'; $route['product/(:any)'] = 'pages/product/$1'; $route['category/(:any)'] = 'pages/category/$1'; $route['(:any)'] = 'pages/view/$1'; but when want add $route['404_override'] = 'my404' any routing stops working , i'm not able homepage base_url('home')... you need define route home controller. problem have defined $route['(:any)'] = 'pages/view/$1'; override undefined routes. either need change $route['(:any)'] = 'pages/view/$1'; else or need define route home like: $route['home'] = 'home_controller';

debugging - Unable to debug app on android for Mi Note 4 -

i have been trying attach xiomi note 4 has android marshmellow, miui 8.2. have turned on usb debegginng option on device not able debug application on phone. not sure why happening. can me out on ? try restarting adb: adb kill-server , adb start-server in terminal

android - Mockito unit test BaseObserver and static method with context -

i facing unit testing first time , know best approach following scenario. using mockito tests. following test logic(presenter) layer , trying verify behaviors of view. app classes the method of presenter need include in test : public void loadweather() { citydetailsmodel selectedcity = getdbhelper().getselectedcitymodel(); if (selectedcity != null) { getcompositedisposablehelper().execute( getapihelper().weatherapirequest(selectedcity.getlatitude(), selectedcity.getlongitude()), new weatherobserver(getmvpview())); } else { getmvpview().showemptyview(); } } weatherobserver : public class weatherobserver extends baseviewsubscriber<daymvpview, weatherresponsemodel> { public weatherobserver(daymvpview view) { super(view); } @override public void onnext(weatherresponsemodel weatherresponsemodel) { super.onnext(weatherresponsemodel); if (weatherresponsemodel.getdata().isempty()) { getmvpview().showemptyview();

unity3d - Photon or Smartfox for a quiz game with Unity -

i'm starting new project , it's quiz, written unity . right now, have make choice between smartfox , photon . 1 of requirements contain database questions , answers quiz. ask share experience, , make right decision)). which of 2 tools recommend? i use photon, have more experience it. comes example on how make turn based games, , relatively easy use. everything, can't go wrong.

Facebook sdk php login error -

this question has answer here: facebook graph api not work 2.2 2.3 1 answer from today have problem facebook login on web site. error an active access token must used query information current user i didn't changed anything. use open graph v2.6 , call is: https://graph.facebook.com/me?fields=email,name i'm using php 5.6 codeigniter 2 thank help you need add access token in call. example: https://graph.facebook.com/me?fields=email,name&access_token= {access_token} you can access token visiting: https://developers.facebook.com/tools/explorer/

c# - .Net 4.0 WebApp deployment picking latest GAC version of dlls instead in bin folder -

Image
working environment 1. windows 10 2. visual studio 2010 3. .net 4.0 4. outlook 2013 5. dll microsoft.office.interop.outlook version showed in pic below yes question have added microsoft.office.interop.outlook access outlook mail. working fine @ development environment. when publish on virtual machine, , user press button use outlook feature, crashes error message shown in picture below i checked exact version defined in gac while using version 14 in development , coming folder c:\program files (x86)\microsoft visual studio 10.0\visual studio tools office\pia\office14 i spent 2 full days on , cannot solve. please me fix either gac or use correct version of interop dlls using in project. how get/use ver. 15 dlls in project. here pictures thanks qz

printing - Python: Issue with string concatenation -

i trying construct sort of sum pyramid in code, not able print after end= ( in python 2.7) from __future__ import print_function import time year_str= time.strftime('%y') month_str=time.strftime('%m') num = 1 in range(0, 5): num = 1 j in range(0, i+1): print("(abc_"+year_str+month_str+str(num), end="+") num = num + 1 print() the output : (abc_2017031+ (abc_2017031+(abc_2017032+ (abc_2017031+(abc_2017032+(abc_2017033+ (abc_2017031+(abc_2017032+(abc_2017033+(abc_2017034+ (abc_2017031+(abc_2017032+(abc_2017033+(abc_2017034+(abc_2017035+ but expected output : (abc_2017031)/1 (abc_2017031+abc_2017032)/2 (abc_2017031+abc_2017032+abc_2017033)/3 (abc_2017031+abc_2017032+abc_2017033+abc_2017034)4 and on .... i not able add last )/num in print statement. can done? you can this: you concatenate the output in temporary variable you adding '+' if it's not last character in line being printe

node.js pg-promise how to make general queries -

in app have many duplicate queries , in 1 transaction turns out large nesting. whether possible make general queries reduce amount of duplication , improve readability of code ? yes, can general queries. can add stored procedures postgres or can create functions , methods in node. it's hard answer question in more depth because it's question answer yes. it's not clear have tried far , not working it's hard answer in more details.

ios - OpenGL ES 3.0 - Jagged Edges When Rendering Into Retained Color Attachment -

Image
using openggl es 3.0 on ios , want use 1 framebuffer object (fbo) 2 color attachments ( a0 , a1 ) render object(s) a0 a0 , a1 a1 . texture a1 retained , reused in next frame(s) while a0 invalidated (and cleared). the problem when rendering a1 jagged artefacts (mostly along object edges) created, c.f. attached image ( color attachment 1 = a0 , color attachment 2 = a1 ). i inspected gl state , made sure correct fbo bound , there no gl_errors , gl_max_color_attachments 4. create fbo 2 color attachments follows: // assuming fbo , 2 requried textures correctly generated glbindframebuffer(gl_framebuffer, _fbo); glframebuffertexture2d(gl_draw_framebuffer, gl_color_attachment0, gl_texture_2d, _fbo_tex[0], 0); glframebuffertexture2d(gl_draw_framebuffer, gl_color_attachment1, gl_texture_2d, _fbo_tex[1], 0); // glcheckframebufferstatus(gl_framebuffer) returns gl_framebuffer_complete the vertex shader: #version 300 es uniform mat4 modelviewprojectionmatrix; in vec4 positio

build - Building a docker image from inside a docker container -

i have docker container builds executable , exposes on shared volume. have docker container create docker image , push local repository. i have been doing reading , possible exposing docker socket container. have read bad idea , security issue. issue solution compounded problem im using docker-machine on virtualbox , have yet found way connect docker socket (in virtualbox) container. i have looked @ running docker in docker , allowing push local repository in parent docker wary of approach have read testing docker rather im attempting. thanks in advance

SQL Server : script automation help needed -

i using sql server 2012, , have automate task (scripts). task weekly task doing every friday. it consist of executing manually (pressing f5) bunch of truncates , select + inserts. can not show code because sensitive , fired if that. the idea had either stored procedure on , put stored procedure in sql job or maybe ssis package? could please give me ideas? many thanks

reactjs - React : Get value of table to edit it -

i've form fields. when submit form, complete bootstrap table fields values i want call form each row, , values table on form edit its. i call form empty, without values. how can call form values reference ? <bootstraptable data={this.props.items} celledit={this.celledit}> <tableheadercolumn datafield='reference' dataformat={this.editformatter.bind(this)}>edit</tableheadercolumn</bootstraptable> editformatter(cell, row) { return ( <button onclick={() => this.editformatterclick = (reference: string) => { }}>{cell}</button> ); } editformatterclick = (reference:string) => { this.props.ondocumentselected(reference) } ondocumentselected: (documentreference: string) => void this property ondocumentselected call form. how can call form values list ? thank you

networking - Open .inf file to add a network adapter driver in Windows 7 -

Image
basically cannot open inf file install driver, look: when find file, ok, nothing happens. i had set file before adding .inf file.

javascript - Multiple intervals in columnrange chart Highcharts -

im trying create columnrange chart several categories displaying interval during year. works fine, however, im stuck problem 1 of categories, need 2 intervals on same row. so, example, in fiddle attached below, have each category from-to months. eg: category 1: mar->jun category 2: july->aug etc. but im stuck eg this: categoty 3: mar->jun, sep->oct here fiddle: http://jsfiddle.net/t9rsf6n7/1/ series: [ { name: '', color: '#795548', data: [ { low:date.utc(2017,1,1), high:date.utc(2017,3,31), color:'#ffae3d' }, { low:date.utc(2017,2,1), high:date.utc(2017,4,30), color:'#ff3d3d' } ] } ] any appreciated. set x value each data point, , 2 points in category 3, they'l

android - Circular image: alternative to setClipToOutline for pre 21 -

i seeking way create circular images without 3rd party libraries. i found this post asked same had 0 answers. in apis post/equal 21 (5.1), use setcliptooutline method on view ( because there bug android:cliptooutline isn't working in xml ) , add circular shaped drawable background imageview , app must support version 19 (4.4) onwards. is there feature allows me achieve this? maybe, in support library? thanks.

ios - Rotate ImageView using CGAffineTransform and PanGestureRecognizer -

i'm trying rotate imageview have using cgaffinetransform . basically, want happen every time x-coordinate increases, want imageview rotate little more. i did math , want imageview rotate 1.6º every 1 x-coordinate . have far in gesture recognizer function: @objc func persondragrecognizer(recognizer: uipangesturerecognizer) { let rotationangle: cgfloat = 1.6 let translation = recognizer.translation(in: rview) if let view = recognizer.view { view.center = cgpoint(x:view.center.x + translation.x, y:view.center.y + translation.y) view.transform = cgaffinetransform(rotationangle: rotationangle) } recognizer.settranslation(cgpoint.zero, in: rview) if recognizer.view?.center == cgpoint(x: 197.5, y: 232.5) { playgroundpage.current.liveview = eeview } the problem rotates 576º bc that's 1.6 times 360 . , doesn't keep on rotating once. want continually rotate. if help immensely appreciated. so in advance!! cheer

Workflow conditions on a choice field type (Checkboxes (allow multiple selections)) in SharePoint 2010 -

i want check value of choice column type allows multiple selections. basically; if current item: sports equals hockey something..... if current item: sports equals baseball something..... if current item: sports equals football something..... if current item: sports equals basketball something..... based on each item checked, when condition met code execute each item selected. tried obvious looks code posted above. thank you answered own question experimenting little more. if have options selected, hockey, baseball, football, , basketball, current item value "sports" this string: ;#hockey;#baseball;#basketball;#football;# choices, comma delimitted: hockey, baseball, football, basketball so if write workflow way; if current item: sports contains hockey something..... if current item: sports contains baseball something..... if current item: sports contains football something..... if current item: sports contains ba

Running a small WMI Powershell Script -

i'm trying have few scripts can map run keyboard changing monitor/screen brightness. after searching on internet, found script works when enter powershell. $monitor=@(gwmi wmimonitorbrightnessmethods -ns root/wmi)[0] $monitor.wmisetbrightness(50,0) after saved .ps1 file , tried running file, powershell tells me: term "path of file" not recognized name of cmdlet, function... , on. i'm not familiar powershell @ all, can need add in order script run properly? by default can't run powershell script in current directory without putting .\ in front of script name, or calling full path of script. this security feature. if in directory contains script, run executing in powershell window: .\yourscript.ps1 where yourscript name of script. see here more information: https://ss64.com/ps/syntax-run.html you may see error if script has spaces in name. if case, enclose path in quotes: .\'your script.ps1'

c++ - make[1] Error 1 when building Library -

i use following script build c++ library. i386 architecture works fine, arm64 error message. the error: make[1]: *** [base/low/cl_low_div.lo] error 1 make: *** [install-recursive] error 1 the script : #!/bin/bash platformpath="/applications/xcode.app/contents/developer/platforms" toolspath="/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin" export iphoneos_deployment_target="10.1" pwd=`pwd` findlatestsdkversion() { sdks=`ls $platformpath/$1.platform/developer/sdks` arr=() sdk in $sdks arr[${#arr[@]}]=$sdk done # last item current sdk, since alpha ordered count=${#arr[@]} if [ $count -gt 0 ]; sdk=${arr[$count-1]:${#1}} num=`expr ${#sdk}-4` sdkversion=${sdk:0:$num} else sdkversion="10.1" fi } buildit() { target=$1 hosttarget=$1 platform=$2 if [[ $hosttarget == "x86_64" ]]; hostarget="i386" elif [[ $hosttarget == "arm64" ]]; hosttarget="ar

ruby - Where do i have to start the service 'rackup' for sinatra while using rvm on ubuntu -

i developoing webapp in ide rubymine on ubuntu , installed gem sinatra gemsets write rest-api webapp. have little start problem because dont know should write 'rackup' command after created app.rb , config.ru. ubuntu doesn't know rackup because of rvm. tells me should install ruby-rack isn't sinatra supposed have on board? problem if gem rack 2.0.1 installed in same gemset? i have tried start rackup system terminal. did not work. you can start sinatra rack loading sinatra app ruby in command line: =>ruby app.rb a config.ru file necessary if you're trying weird rack or deploying app heroku or other service handles own rack.

Transposing a matrix using python numpy -

this current matrix: [[0, 1, 2, 4], [0, 3, 1, 3], [0, 2, 3, 2], [0, 2, 4, 1], [0, 4, 1, 2], [0, 3, 2, 2], [1, 2, 2, 2]] i want transpose , output: [[0, 0, 0, 0, 1], [2, 2, 4, 3, 2], [3, 4, 1, 2, 2], [2, 1, 2, 2, 2]] i used inverse = np.swapaxes(ate,0,7) not sure axis2 value be. here axis2 7. i think you're looking np.transpose()

vuejs2 - Vue js : _this.$emit is not a function -

i have created vue component call imageupload , pass property v-model <image-upload v-model="form.image"></image-upload> and within imgeupload component have code <input type="file" accept="images/*" class="file-input" @change="upload"> upload:(e)=>{ const files = e.target.files; if(files && files.length > 0){ console.log(files[0]) this.$emit('input',files[0]) } } and received uncaught typeerror: _this.$emit not function thanks do not define method fat arrow. use: upload: function(e){ const files = e.target.files; if(files && files.length > 0){ console.log(files[0]) this.$emit('input',files[0]) } } when define method fat arrow, capture lexical scope, means this pointing window , , not vue.

Accessing Swift dictionary using variable as key -

using skspritekit's userdata property, have used following line attach x , y co-ordinates on grid, node. node.userdata = ["x": x, "y": y] i using touchesbegan send data function. func touched(userdata: nsdictionary) { print(userdata) } the console prints data required. using dictionary... var dictionary: [anyhashable : any] = [1: "test1", 2: "test2", 3: "test3", 4: "test4", 5: "test5", 6: "test6", 7: "test7" ] i want retrieve relevant key-pair using: dictionary[userdata["x"]] however, following error: cannot subscript value of type 'nsdictionary' index of type 'string' this classic case of misleading diagnostic due any casting. just simplify problem (and rid of sp

java - Wiremock Stand alone - How to manipulate response with request data -

i trying implement mocking of post rest call using wiremock standalone server. faced challenge this, suppose post body contains "name" field , value, same value should returned in response of post call. json file looks this: { "priority": 1, "request": { "method": "post", "urlpath": "/primeslots", "bodypatterns" : [ { "matchesjsonpath" : "{ \"things\": [ { \"name\": \"794363\" }] }" } ] }, "response": { "status": 200, "body": "{{$.things.name.value}}", "transformers": ["response-template"] } } so, need value , 794363,but using above approach not able in post response body. i tried too: { "request": { "method": "post", "urlpath": "/transform", "bodypatterns": [ {

ios - How to pass values out of reusable PickerView.xib in swift -

Image
i created reusable uipickerview : pickerview.swift : class pickerview: uiview, uipickerviewdelegate, uipickerviewdatasource { @iboutlet weak var pickerview: uipickerview! var labels: [string] = [] { didset { self.pickerview.reloadallcomponents() } } required init?(coder adecoder: nscoder) { super.init(coder: adecoder) bundle.main.loadnibnamed("pickerview", owner: self, options: nil) self.addsubview(pickerview) } func numberofcomponents(in pickerview: uipickerview) -> int { return 1 } func pickerview(_ pickerview: uipickerview, numberofrowsincomponent component: int) -> int { return labels.count } func pickerview(_ pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string? { return labels[row] } } this code makes can initialize uipickerview setting class of uiview pickerview : and add data ui

.net - C# Method parameter incorrectly updates -

i have following c# simple code : public class error { public string errordescription { get; set; } public string errorcode { get; set; } } public class request { public error requesterror { get; set; } } public class response { public error responseerror { get; set; } } public response process(request request) { var r = new response { responseerror = request.requesterror }; r.responseerror.errordescription = "new response description"; return r; } i call process through console app : var request = new request { requesterror = new error() { errorcode = "request error code", errordescription = "request error description" } }; var service = new service(); var response = service.process(request); debug.writeline("request errordescription = " + request.requesterror.errordescription); why request.responseerror.errordescription equa

python - Pandas Google Distance Matrix API - Pass coordinates into URL -

i working google distance matrix api, want feed coordinates dataframe api , return duration , distance between 2 points. here dataframe: import pandas pd import simplejson import urllib import numpy np record orig_lat orig_lng dest_lat dest_lng 1 40.7484405 -74.0073127 40.7115242 -74.0145492 2 40.7421218 -73.9878531 40.7727216 -73.9863531 first, need combine orig_lat & orig_lng , dest_lat & dest_lng strings, pass url. i've tried creating variables orig_coord & dest_coord passing them url , returning values: orig_coord = df[['orig_lat','orig_lng']].apply(lambda x: '{},{}'.format(x[0],x[1]), axis=1) dest_coord = df[['dest_lat','dest_lng']].apply(lambda x: '{},{}'.format(x[0],x[1]), axis=1) row in df.itertuples(): url = "http://maps.googleapis.com/maps/api/distancematrix/json?origins={0}&destinations={1}&units=imperial&mygoogleapikey&

Display firebase notification data-message on Android tray -

i need use non-collapsible notification firebase. using data-message this: { "to" : "bk3rnwte3h0:ci2k_hhwgipodkcizvvdmexudfq3p1...", "data" : { "nick" : "mario", "body" : "great match!", "room" : "portugalvsdenmark" }, } this message interpreted in onmessagereceived() method. still want display data-message in tray notification-messages displayed system automatically. how achieve this? cannot find documentation on this. thanks! you can retrieve values data payload in onmessagereceived() calling remotemessage.getdata() , .get("<key_here>") . so: public void onmessagereceived(remotemessage remotemessage) { super.onmessagereceived(remotemessage); log.d(tag, "onmessagereceived()"); // check if message contains data payload. if (remotemessage.getdata().size() > 0) { log.d(tag, "message da

drupal - How to specify rel property for a css file in a libraries.yml file? -

so i'd specify custom rel property css (well, less) file in libraries.yml file in drupal 8. would possible? base: version: version css: theme: css/styles.less: { rel: stylesheet/less } the resulting html be: <link rel="stylesheet/less" href="css/styles.less" media="all" /> thank you! i'm not shure can try : base: version: version css: theme: css/styles.less: attributes: rel: stylesheet/less seen on : https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme#attributes edit or try base: version: version css: theme: css/styles.less: { rel: stylesheet/less } or : base: version: version css: theme: css/styles.less: attributes : { rel : stylesheet/less }

better approach for FrameLayout in android? -

i'm using framelayout in project.. totally confused in android developement if use xml file static approach whereas on other side i'm using java code run time behaviour framelayout( or android feature ) approach project user-experience point of view.. please provide straight forward sight of view reason.. thanx in advance. it's similiar earliar asked question. declare ui elements in xml . android provides straightforward xml vocabulary corresponds view classes , subclasses, such widgets , layouts. instantiate layout elements @ runtime . application can create view , viewgroup objects (and manipulate properties) programmatically. advantage declaring ui in xml enables better separate presentation of application code controls behavior. ui descriptions external application code, means can modify or adapt without having modify source code , recompile. example, can create xml layouts different screen orientations, different device screen sizes, , different lan

C Loop Patterns -

i've got code half way working can't other half work. what pattern needs like: 1sssss s2ssss ss3sss sss4ss ssss5s sssss6 what pattern looks like: 1 s2 ss3 sss4 ssss5 sssss6 here code #include <stdio.h> int main() { int i, j, k, num; printf("enter number "); scanf("%d", &num); (i = 1; <= num; ++i) { (j = 1; j <= i; ++j) { if (j != i) { printf("s"); } } printf("%d ", j-1); printf("\n"); } return 0; } i guess made mistake in one. for(int j=1; j<=i ; ++j) i should until num variable, because need print num times. hope helps

java - Active directory search filter for users from specific domain -

i have ad setup follows: domain.local -> global catalog child.domain.local -> domain controller i'm trying write query global catalog server search users specific domain have text. domain should variable query. i tried search filter search users domain.local start "c": (&(samaccounttype=805306368)(&(mail=*)(givenname=*)(sn=*))(objectcategory=cn=person,cn=schema,cn=configuration,dc=domain,dc=local)(|(anr=c)(mail=c*))) but finds users both domains. i tried 1 too: (&(samaccounttype=805306368)(&(mail=*)(givenname=*)(sn=*))(dc=domain,dc=local)(|(anr=c)(mail=c*))) but doesn't find anything. what missing?

ios - How to set tableview cell separator to 100% width in Swift 3.0? -

i'm developing first app, , have got working except have discovered display issue on ipad, separator of cell limited in width (see screenshot) screen shot on ipad i've tried can find on how set margins 0, etc, including: override func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { let mycell = tableview.dequeuereusablecell(withidentifier: "cellid", for: indexpath) as! mycell mycell.preservessuperviewlayoutmargins = false mycell.separatorinset = uiedgeinsets.zero mycell.layoutmargins = uiedgeinsets.zero return mycell } i'm not using storyboard , doing programmatically, any ideas appreciated, thanks i believe it's caused readable content guide . can disable setting tableview.celllayoutmarginsfollowreadablewidth = false

rose diagram - Rotating and reflecting Polarhistogram in MATLAB -

Image
the default orientation polarhistogram plots in matlab 90degrees @ top , 270degrees @ bottom. example: i orientate plot such north (0degrees) @ top, 90degrees on right, 180degrees on bottom , 270 degrees on left i.e. normal compass. rose (now outdated?) have been possible with: set(gca,'view',[-90 90],'ydir','reverse'); however, produces errors polarhistogram: error using matlab.graphics.axis.polaraxes/set polaraxes view property must [0 90]. error in untitled5 (line 77) set(gca,'view',[-90 90],'ydir','reverse'); how can reorientate polarhiostogram? all modifications can done within polaraxes class set(gca,'thetazerolocation','top',... 'thetadir','counterclockwise');