Posts

Showing posts from May, 2015

ios - Objective C Resize image as 2x image -

Image
i resizing image after resizing image not returning in quality here code - (uiimage*)imagewithimage:(uiimage*)image scaledtosize:(cgsize)newsize; { uigraphicsbeginimagecontext( newsize ); [image drawinrect:cgrectmake(0,0,newsize.width,newsize.height)]; uiimage* newimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); return newimage; } here code how call uiimage *image = [self imagewithimage:self.selectedimage scaledtosize:cgsizemake((self.imageview.image.size.width*self.slider.value), (self.imageview.image.size.height*self.slider.value))]; result of image here small image scaling. you should use uigraphicsbeginimagecontextwithoptions instead of uigraphicsbeginimagecontext . for example, uigraphicsbeginimagecontextwithoptions(signview.bounds.size, signview.opaque, 0.0); [signview.layer renderincontext: uigraphicsgetcurrentcontext()]; // uiimage *imgmysignature = uigraphicsgetimagefromcurrentimagecontext();

mybatis - how to get data for mysql query every 5min for sum(column) and last index value -

Image
this image file sample data first image query 2nd image want view time value 00sec ~00sec i mean 110000 ~110450 value" 04m:50s " this exam data for example sample data data insert every 10sec. ## time money amount date hhmmss 100000 500 30 2016-07-28 ------------------------ 100010 800 740 2016-07-28 ------------------------- 100450 300 80 2016-07-28 ------------------------ 100500 200 5 2016-07-28 ----------------------- 100510 900 9144 2016-07-28 -------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~ 110000 500 5 2016-07-28 ----------------------- 110500 233 5 2016-07-28 ======================= i want each 5min data sum , view this query every 1min data how change easy yo use select sum(amount), lpad(cast(time - 5 char),6,'0') dateval, substr(lpad(cast(time - 5 char),6,'0'),1,4), date, max(time) example date = '2016-07-28' group substr(dateval, 1, 4) order dateval asc; and want

go - How can I move between 2 gps points at a set speed? -

i'm trying create function let me give 2 arguments, new location , speed travel @ (in meters / second) it looks this: func (l *location) move(newloc *location, speed float64) { r := 6371.0 // kilometers lat1 := l.latitude * math.pi / 180 lat2 := l.longitude * math.pi / 180 difflat := (newloc.latitude - l.latitude) * math.pi / 180 difflon := (newloc.longitude - l.longitude) * math.pi / 180 := math.sin(difflat/2)*math.sin(difflat/2) + math.cos(lat1)*math.cos(lat2)*math.sin(difflon/2)*math.sin(difflon/2) c := 2 * math.atan2(math.sqrt(a), math.sqrt(1-a)) distancetomove := r * c // distance travel in straight line, in kilometers } the thing i'm having trouble thinking of formula make latitude, start @ current position, , end @ new position on set amount of time. so person changed latitude 56.65 58.12 , told travel @ 1.3m/s how can accomplish this. thanks. if understand question, goal compute intermediate points betw

javascript - screeps - can't make variable in source -

i new screeps (love it) , having hard time create variable sources in room. trying make sure 3 creeps work on same source, have following code-snippet harvester , main module main var sources = game.spawns.spawn1.room.find(find_sources); (var in sources) { var source = (sources[a]); source.memory.numpeopleat = 0; } module.exports.loop = function () { ... } harvester var sources = creep.room.find(find_sources); (var s in sources) { if (creep.harvest(sources[s]) == err_not_in_range && sources[s].memory.numpeopleat < 3) { creep.moveto(sources[s]); sources[s].memory.numpeopleat++; break; } } i know still have make function sources[s].memory.numpeopleatt-- thanks in advance, jari van melckebeke source doesn't have memory property creep does. however, can add main memory object. var sources = game.spawns.spawn1.room.find(find_sources); if (!memory.sources) { memory.sources = {}; } _.each(sources, function(s

Filter a Laravel collection by date -

in code given below $allzip["assigned_date"] has value 2016-07-27 18:12:26 . when try compare created_at field timestamp field well, result empty collection. $filtered_datas = $datas->filter(function ($data) use($allzip) { return $data->zip == $allzip["zip"] && $data->created_at < $allzip["assigned_date"]; }); there data in database zip field matching value $allzip["zip"] , created_at field value 2016-07-19 18:12:26 . should return 1 item in collection returns empty collection instead. why? make sure dates datetime or carbon instances, not strings. otherwise, comparison operator shouldn't working expected.

angularjs - Cookie is still present after expiration date -

so i'm trying use ngcookie ($cookies) set boolean in angularjs. can see in example below, "someflag" should true, if cookie still present. cookie expiration set 30 seconds, after 30 seconds, "someflag" still true. so how manage find out wether cookie expired or not? var peekerhidecookie = $cookies.get('peekerhidecookie'); console.log(peekerhidecookie); if (peekerhidecookie == 'true'){ $scope.someflag = true; } $scope.test = function () { var d = new date(); d.setdate(d.getseconds() + 30); $cookies.put('peekerhidecookie', 'true', {expires: d}); $scope.someflag = true; } use d.setseconds(d.getseconds() + 30) insetead of d.setdate() $scope.test = function () { var d = new date(); d.setseconds(d.getseconds() + 30); $cookies.put('peekerhidecookie', 'true', {expires: d}); $scope.someflag = true; } var d = new date(); console.log(d); d.s

Python 3.4.4 - pip collection error -

i appreciate on below query - i've been trying pip work best of day , struggling. regardless of module try install keep getting "could not find version satisfies requirement openpyxl (from version s: ) no matching distribution found openpyxl please see screenshot below of error: enter image description here i've looked @ around website, including following posts, installing pip still unsure why isn't working. 'pip' not recognized internal or external command fatal error in launcher: unable create process using ""c:\program files (x86)\python33\python.exe" "c:\program files (x86)\python33\pip.exe"" any massively appreciated! have tried check internet connection? screenshot, seems cannot access url follow:. https://pypi.python.org/simple/openpyxl/

angularjs - How to set attributes dynamically using Angular? -

the problem is: receive json server, contains inputs description, like: {"name":"audio bitrate","description":"","type":"int","value":"128","validators":{"between":{"class":"zend\\validator\\between","parameters":{"min":"30","max":"500","inclusive":"1"}}}} . in ng-repeat go through json , create custom inputs (name, type, defaul value). inputs have validators, rewritten in angular derictives check inputs before sending. in case need add between derictive name, min="30" , max="500" , inclusive="1" input attributes, i.e. <input between type="number" class="form-control input-sm" placeholder="{{value.description|translate}}" ng-model="preset.parameters.common[parameter]" ng-init="preset.parameters.common[parameter

c# - Entity framework - queue async context -

task task1 = servicea.dosomething(); task task2 = serviceb.dosomethingelse(); await task.whenall(task1, task2); services have no idea operating on database, if both tasks end querying 1 database there concurrency exception. as described in does entity framework support parallel async queries? ef not support multiple async queries. is there pattern or way queue such queries/commands , execute them 1 after (but still speed execuition if hitting separate database)? maybe better solution change dbcontext per-request transient , new dbcontext separate connection each query? performance implications of this? first see separate transaction each dbcontext , commiting them instead of single transaction.

css - JavaScript, AngularJS: How do I know if element is larger than its container? -

let’s have title in h1 element (any element do). content dynamic (do not know length of title). supposed displayed in 1 line. h1 in div (let’s call container) of limited size. how know if element (h1) overflows container (div)? so if overflows apply css class deal situation. example scroll hidden content of h1 view. width of container defined relative screen size. example: #container { width: 60%; background-color: gray; height: 50px; // overflow: hidden; position: relative; } h1 { overflow: hidden; height: 100%; margin: 0; line-height: 50px; } <div id="container"> <h1>a soft white or grey mineral consisting of hydrated calcium sulphate. occurs chiefly in sedimentary deposits , used make plaster of paris , fertilizers, , in building industry.</h1> </div> best solution if used in: primary in ngif , secondary in ngclass directives, of following technologies good: java

angularjs - angular ui-router logout state doesn't redirect to login until refresh the page -

what need on click on logout link , we call logout method of authservice clear cookie data , user should redirected on login page. but seem's not working. page being stay on /logout page , user need refresh page goes /login page. why so? here relevant code .state("logout", { url: '/logout', data: { requiresauth: true }, controller:['$state', 'authservice', function($state, authservice) { authservice.logout(); $state.transitionto('login', null, { reload :true}); }] }) and here relevant authservice method app.factory('authservice', function($log, $http, $q, $cookies){ authservice.logout = function () { var deferred = $q.defer(); $http({ method: "get", url: '/app/logout.json' }).then(function(result) { $cookies.remove('currentuse

android - Overriding ImageView minHeight dynamically -

i have imageview populated url. when image comes in scale using "centerinside" policy, nice , adjust imageview bounds using "adjustviewbounds". before download image don't know would-be size of imageview. however, need display placeholder of reasonable size. put in "minheight=150dp" color background. <imageview android:id="@+id/leadimageview" android:layout_width="match_parent" android:layout_height="wrap_content" android:minheight="150dp" android:background="@color/color_primary" android:adjustviewbounds="true" android:scaletype="centerinside" /> now, has consequence if downloaded image smaller 150 dp imageview still occupy 150dp, don't want. so have tried build derived imageview class overrides minheight if drawable pre

AngularJS uses eval in chrome extension -

the lates angularjs (1.3 beta 19) uses eval . prohibited in chrome extionsion. how fix issue without allowing evals ? error message: refused evaluate string javascript because 'unsafe-eval' not allowed source of script in following content security policy directive: "script-src 'self' chrome-extension-resource:". stack trace: angular.js:1011 csp angular.js:1011 (anonymous function) angular.js:23556 update: see documentation of ng-csp https://docs.angularjs.org/api/ng/directive/ngcsp outdated: looks angularjs fails detect csp in chrome extension. use explicit ng-csp . link angularjs issue: https://github.com/angular/angular.js/issues/8777 to quote documentation dmitry linked: angular tries autodetect if csp active , automatically turn on csp-safe mode. autodetection triggers csp error logged in console: refused evaluate string javascript because 'unsafe-eval' not allowed source of script in fo

php - Assets return 404 (Not Found) error in production Yii2 framework -

Image
i working on project in yii framework, have faced issue loading of js , css files. returns error 404, sure path files correct. happens in production, on local works fine. please me out on have checked possible threads on forum, , nothing helped me far. i can post screenshots whatever may need me out on one. edit: works fine in opera, not on chrome , mozilla makes more confusing. should check file permission first, see baseurl of file path

javascript - How do I reinitialise a Datatable? -

i have page notifications on want refresh every 10 seconds, don't want reload entire page, reload div contains notifications. notifications in datatable, initialised when page loaded, i've been unable reinitialise datatable when div reloaded. div reloads fine normal table. here code: $(document).ready(function () { loadnotificationstable(); }); setinterval(reloadnotificationstable, 10000); function reloadnotificationstable() { $('#notificationstable').datatable().fndestroy(); $("#notificationsplaceholder").load(location.href + " #notificationsplaceholder>*", ""); $("#notificationsplaceholder").ready(function () { loadnotificationstable(); }); }; function loadnotificationstable() { $('#notificationstable').datatable({ ajax: "data.json", "blengthchange": false, 'idisplaylength': 1000, "bsort": false,

html - Flexbox: Layout with rowspan without wrappers -

Image
my html similar following example: <div class="wrapper"> <div class="wrapper_item">1</div> <div class="wrapper_item">2</div> <div class="wrapper_item">3</div> <div class="wrapper_item">4</div> <div class="wrapper_item">5</div> <div class="wrapper_item">6</div> <div class="wrapper_item">7</div> </div> and need layout this: the height of blocks can different. how can flexbox without other wrappers? you can use tables. easy implement. <html> <head> <style> table{ width:100px; height:100px; border:solid 3px black; border-collapse: collapse; } td{ background:grey; border:solid 3px black; padding:0px; } </style> </head> <body> <table> <tr> <td rowspan=&

vb.net - how to kill tabtip process after starting it -

i can start tabtip (virtual keyboad) in program reason can't kill it. this code: private tabtipprocess process private sub t_enter(sender object, e eventargs) tabtipprocess = process.start("tabtip") end sub private sub t_leave(sender object, e eventargs) tabtipprocess.kill() end sub on line tabtipprocess.kill() error: cannot process request because process (5312) has exited. i'v got it: for each pkiller process in process.getprocesses if string.compare(pkiller.processname, "tabtip", true) = 0 pkiller.kill() end if next

c++ - How to store point co-ordinates in vector data type in opencv? -

i have mat object (cv_8uc1) binary map 1's on positions , zeros otherwise.i want create vector stores co-ordinates of points mat 1.any suggestions on how go it. know can loop around image , check points following code for( int p = 1; p <= img.rows; p++ ) { for( int q = 1; q <= img.cols; q++ ) { if( img.at<uchar>(p,q) == 1 ) { //what here ? } } } also, need co-ordinates single precision floating point numbers.this use input function requires vectors. please gimme hint.i not familiar vector data types , stl. if want find non-zero coordinates in binary map opencv, th ebest use findnonzero . here example of how use (with dummy matrix idea): cv::mat img(100, 100, cv_8u, cv::scalar(0)); img.at<uchar>(50, 50) = 255; img.at<uchar>(70, 50) = 255; img.at<uchar>(58, 30) = 255; cv::mat nonzeroes; cv::findnonzero(img, nonzeroes); std::vector<cv::point2f> coor

php - Wordpress - ACF field rewrite slug issue -

so having issue have spent way long on. getting error: fatal error: call undefined function get_current_screen() in /home1/teamv/public_html/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php on line 3252 when run code in functions.php // hidden fieldss function acf_review_before_save_post($post_id) { if (empty($_post['acf'])) return; $current_user = wp_get_current_user(); $value = $_post['acf']['field_578b7b3470e26']; // address $_post['acf']['_post_title'] = '( '.$_post['acf']['field_578ce02b9f472'].' ) - ' . $value['address']; $_post['acf']['_post_content'] = $value['address']; $_post['acf']['field_578f32d3ff97e'] = $value['lat']; $_post['acf']['field_578f32e8ff97f'] = $value['lng']; $_post['acf']['field_578e1d7b97981'] = $current_user->display_name;

c# - Submitting a form using a second button to call another method -

so have form: @using (html.beginform("sendmailasacompany", "contract", formmethod.post, new { id = "cvr" })) { <input type="hidden" value=@model name="studentid" /> <input type="hidden" value=@model.project.userid name="companyid" /> <input type="hidden" value=@model.applicationid name="applicationid"/> <input type="text" name="companycvr" placeholder="indsæt cvr-nr." required/> } then @ bottom of page have submit button: <button form="cvr" class="btn btn-success">submit</button> i want add second button submit same data call method instead of "sendmailasacompany". there way modify button/form accommodate change? yes, can change html form attribute dynamically jqyery/javascript this 1st button: <button form="cvr" class=&

email - Cannot send mail in Jenkins when Running it from war file -

i using jenkins version 2.7.1 in windows server 2008. running jenkins in java environment java -jar jenkins.war command. i trying send mail smtp.office365.com -- getting error "com.sun.mail.smtp.smtpsendfailedexception: xxx.x.x.xx smtp; client not authenticated send anonymous mail during mail from" i read need enable tls in jenkins.xml but couldn't find jenkins.xml file present ?? if install msi file , run jenkins windows service can jenkins.xml file in c:\program files (x86)\jenkins but running war file - have no jenkins folder in program files could please me enable tls jenkins.war if have deployed jenkins on tocat can set tls flag in setenv.bat file in tomcat conf folder.

jQuery: How can I set css with own width? -

i'm trying set labels right property can change on mouse over. the reason i'm doing via jquery because each 1 has different size doesn't allow via css. this have: $('#vertical-navigation .label').css('right', $(this).width()); which, of course, doesn't work, because $(this) returning believe window width. how can set right position element own width, each one? you can use function parameter this: $('#vertical-navigation .label').css('right', function(){ return $(this).width() + 'px'; }); now depending html markup, enough: $('#vertical-navigation .label').css('right', '100%');

wrong (same) django template returned for every url -

for url type browser, same template returned. template in question index.html . if send request 172.0.0.1:8000/login or 172.0.0.1:8000/sign-up , same html. if try 172.0.0.1:8000/sadsajdpojsapfpojpa same template rendered. so if has idea problem is, please help! this urls.py: django.conf.urls import url django.contrib import admin adventureapp import views urlpatterns = [ url(r'^sign-up/$', views.signup), url(r'^sign-up-2/$', views.signup2), url(r'^sign-up-3/$', views.signup3), url(r'^$', views.home), url(r'^admin/', admin.site.urls), url(r'^login/$', views.login), ] this views.py file: def home(request): return render(request, "index.html") def login(request): return render(request, "login.html") def signup(request): return render(request, "sign-up.html") def signup2(request): return render(request,

typescript - Create component from a string -

i have components i'd add page dynamically. i have name in config file config.json , typescript classname mysupercomponent . can put want in config file class name not suited. i've tried code component resolver, can't pass string it. this works: this.resolver.resolvecomponent(mysupercomponent) this doesn't: this.resolver.resolvecomponent("mysupercomponent") how can instanciate (and inject) component string ? you can set map , provide service translates string type import {mysupercomponent} './mysupercomponent'; @injectable() class componenttypes { types = { mysupercomponent: mysupercomponent }; totype(name:string) { return types[name]; } } where use it @component({ ... providers: [componenttypes], }) class somecomponent { constructor(private componenttypes:componenttypes) {} adddynamiccomponent() { ... this.resolver.resolvecomponent(this.componenttypes.totype("mysupercomponent&quo

three.js - Apply effect to only one mesh in a three js scene -

is there way include 2 meshes in scene, 1 effects applied , 1 without. for example, replicate colored lines example 1 of meshes has shader effects applied, while has none of shader effects applied (in case three.bloompass effect).

POST two arrays in JSON to ASP.NET Core MVC 6 -

foreword: have application mvc 4 , .net v4.6.1 , working charm. 1 editor template sends ajax request controller list of things: function showeffectiverights(e) { $.ajax({ contenttype: "application/json", data: json.stringify({ privileges: $("#assignedprivileges").getkendomultiselect().value(), privilegegroups: $("#assignedgroups").getkendomultiselect().value() }), datatype: "json", success: function (data) { // stuff }, error: function (data) { showresponsemessages(data); }, type: "post", url: '@url.action("effectiverights", "user")' }); } the controller looks this: [acceptverbs(httpverbs.post)] public jsonresult effectiverights([datasourcerequest] datasourcerequest request, guid[] privileges, guid[] privilegegroups) { // stuff } the payload of post request fo

linux - replace every nth occurrence of a pattern using awk -

this question has answer here: printing sed or awk line following matching pattern 7 answers i'm trying replace every nth occurrence of string in text file. background: have huge bibtex file (called in.bib) containing hundreds of entries beginning "@". every entry has different amount of lines. want write string (e.g. "#") right before every (let's say) 6th occurrence of "@" so, in second step, can use csplit split huge file @ "#" files containing 5 entries each. the problem find , replace every fifth "@". since need repeatedly , suggested answer in printing sed or awk line following matching pattern won't job. again, not looking 1 matching place many of it. what have far: awk '/^@/ && v++%5 {sub(/^@/, "\n#\n@")} {print > "out.bib"}' in.bib replaces 2nd

sql - Order rows by values -

i trying order table rank, rows have position value - have have position according value in position field. possible without additional tables, views etc? i have table this: rank | position | name 999 | 10 | txt1 200 | 4 | txt2 32 | 1 | txt3 1200 | 2 | txt4 123 | null | txt5 234 | null | txt6 567 | null | txt7 234 | null | txt8 432 | null | txt9 877 | null | txt10 desired output have this: rank | position | name 32 | 1 | txt3 1200 | 2 | txt4 877 | null | txt10 200 | 4 | txt2 567 | null | txt7 432 | null | txt9 345 | null | txt8 234 | null | txt6 123 | null | txt5 999 | 10 | txt1 here idea. assign proper ordering each row. then, if position available use instead. when there ties, put position value first: select t.* (select t.*, row_number() on (order rank desc) seqnum t ) t order (case when position not null position else se

C# Characters changed when returning zip folder and file names -

i writing script loop on range of dates, check whether each date valid trading day , check there corresponding folder , file name each date. quantconnect/lean githib repo classes the issue having file.exists(datafile) method coming false each time. reason seems folder names being stored in formattedfoldername having characters changed. the target folders zipped, wonder if issue maybe? intended file path: c:\users\richa_000\desktop\exporter\forex\fxcm\minute\audjpy\20070401_quote\20070401_audjpy_minute_quote actual file path: c:\users\richa_000\desktop\exporter\forex\fxcm\minute\audjpy\20070401_quoae\20070401_au1jp7_0inuae_quoae i think zip folder, 20070401_quote messing this, i'm not sure. program.cs using system; using system.io; using quantconnect; using quantconnect.securities; using quantconnect.securities.forex; namespace tradingdaysfilechecker { class program { static void main(string[] args) { var startdate = new d

python - How can I speed up my program created in Jupyter Notebook? -

i have python program created in jupter notebook. due datasize , optimization algo used, 4-fold custom cross validation within range takes 30 minutes finish. my computer's environment: cpu i5 3.3 ghz, 8 gb ddr3 ram, ssd. i'm wondering if possible deploy server , may make speed little bit quicker? (the data file 30mb, think possible both upload data , program). , may others want use program. can speed cross validation? it's kind manual process. use sklearn.cross_validation.kfold extract train , test set. loop through each fold build model , test result. i'm not sure if possible encapsulate model building method , perform cross validation in parrallel? 1: there couple paid hpc servers such amazon, off topic so. 2: iteration of cross validation can done in parallel. as cross validations not connected, suggest this: import multiprocessing def validation_function(args): do_validation ... ... p = multiprocessing.pool(processes=multip

c# - Error with e.PaintCells() not painting cells when overriding DataGridViewRow.OnRowPrePaint -

i'm trying control painting of datagridviewrows in derived datagridview overriding onrowprepaint method. test approach trying paint cells contents , background using eventargs paint methods e.g. e.paintcells() or e.paintcellsbackground() , setting eventargs.handled = true prevent of other paint methods firing. my code far is: protected override void onrowprepaint(datagridviewrowprepainteventargs e) { using (solidbrush brush = new solidbrush(color.blue)) { e.graphics.fillrectangle(brush, e.rowbounds); } e.paintcellsbackground(e.rowbounds, true); e.paintcells(e.rowbounds, e.paintparts); e.handled = true; } i expecting colour row blue , e.paintcellsbackground() , e.paintcells() methods paint cells ontop of blue background presented blue rows nothing else painted. remarks on msdn article on paintcellsbackground reads use paintcellsbackground method when draw datagridviewrow , ce

ios - "No matching provisioning profiles" when Submitting App to App Store in XCode 7.3 -

Image
i have been trying submit update app in app store , past 12 hours. keep encountering message in xcode 7.3. i have deleted distribution provisioning profiles, recreated them, remade app ids, removed them xcode, re-downloaded them xcode etc... keep getting message. app in app store. suggestions on can try? building app easier submitting app. assistance i have error before , solved simple steps:- 1-xcode->preferences->accounts choose apple developer account-> view details> right click on provision profiles , choose show in finder , delete provision profiles. 2-remove developer account. 3-remove certification key chain access. 4-restart mac. 5-check certifications , provision profiles in apple developer account , sure working correct. 6-open xcode , add developer account , sure download provision profiles. 7-restart mac , open xcode again , push app itunes connect. i hope you.

c++ - Cast derived virtual override to base pure virtual member -

i understand why cannot cast derived class member function pointer base class member function pointer explained here . but, given snippet: struct base { virtual void foo() = 0; }; struct derived : base { void foo() override {}; }; struct invoker { typedef void(base::*target)(); invoker(base* b, target t) { (b->*t)(); } }; template<typename b, typename d> void (b::*cast(void (d::*method)()))() { return static_cast<void(b::*)()>(method); } derived d; invoker bad(&d, &derived::foo); //c2664 invoker good(&d, cast<base>(&derived::foo)); i wanted ask possible decorate base function signature compiler understands pure virtual method , and implemented somewhere across hierarchy (otherwise not construct object of type b )? understand why can't normal functions, imho in case of pure virtual function compiler has guarantee implemented (in case not done error class b not cast). there's no need

How to add python support for vim without destroying up all the plugins? -

i started using vim earlier summer , have started add plugins. todays challenge install youcompleteme. problem: during installation process noticed vim version (7.4) doesn't have support python/python3. question: how can fix without messing plugins/.vimrc file? will clean install affect plugins/.vimrc? read should install 'vim-nox'.. should i? my setup: ubuntu 16.04. vim 7.4. plugins installed via pathogen. thanks in advance replies! kind regards, edvin as long plugins installed in $home/.vim (or mswindows equivalent), , not /etc/vim or /usr/share/vim , there should no problem: can upgrade vim version without impacting have installed. see :h 'rtp' , :h startup .

android - Not receiving GCM notifications with app in background and content-available=1 -

i developing ionic 2 app , testing on android emulator. when app in background , notification has no title, no message , content-available=1 notification should sent directly app notification handler. not happening. i can receive notifications app in foreground. if have title , message receive notification in notification area. need send notification directly app in silent mode, without pass notification area. here code send push notifications: { "delay_while_idle": true, "priority": "high", "sound": "default", "color": "ffff00", //payload "data": { "content-available": "1", "some_var": "some_value", "ohter_var": "other_value", } } how sent silent notifications android app? android gcm , fcm both work when app background. for need add below service classes @ manifest int

php - Is there a way to display database values based on user input values using HTML form? If yes, how can I do that? -

so trying call value based on user input. have written code for form need call value server based on user type on form. this have written until now: @$conn = new mysqli($host, $user, $pass, $db_name); $resault = $conn->query("select * field_data_field_paint_efficeincy_"); $rows=$resault->fetch_all(mysqli_assoc); echo '<pre>',print_r($rows),'</pre>';foreach($rows $row){ echo $row['field_paint_efficeincy__value'], '<br>'; } ?> <form action="" method="post"> variable: <input type="number" name="p" value="0" /> <br/> something this: <?php if(isset($_get["p"])) { $conn = new mysqli($host, $user, $pass, $db_name); $resault = $conn->query("select * field_data_field_paint_efficeincy_ field_paint_efficeincy__value = '" . $_get["p"] . "'"); //assuming field_paint_efficeincy__va

java - Failed to serialize enum value by predefined value -

i have following enum: public enum changemode { none(1), add(2), update(3), delete(4); // string value public string getstringvalue() { return name(); } public static changemode getenumvalue(string v) { return valueof(v); } public static changemode getenumvalue(int intvalue) { (changemode x : values()) if (objects.equals(x.intvalue, intvalue)) return x; return null; } // int value private int intvalue; private changemode(int intvalue) { this.intvalue = intvalue; } public int getintvalue() { return this.intvalue; } } notice enum values start 1-4 , not 0-3. i'm using wildfly , jackson. when i'm getting value 4 client json (using http post) i'm getting following error: can not construct instance of com.ta9.enums.changemode number value (4): index value outside legal index range [0..3] @ [source: org.glassfish.jersey.m

pdf - Print on envelopes using Ghostscript with VB.NET Windows Form Application -

i need print 2 page pdf. 1st page needs envelope , 2nd page need print regular piece of paper normal. can in 2 separate pdf's question is: how can set printer use envelope using ghostscript? has ever done this? couldnt find exact parameter needed in order accomplish this. have tried several different things , still prints regular sheet of paper , wont use envelope tray holds envelopes. looks need change mediatype not know parameter that. ideas? suggestions on how accomplish using vb.net/c#? heres code have without parameters dealing envelopes. envelope size 9.5 x 4.15 inches. standard envelope. have tried setting -spapersize=c6 in hopes close enough trigger envelope tray still no luck. dim psinfo new processstartinfo() psinfo.arguments = string.format(" -dprinted -dnocancel=true -dbatch -dnopause -dnosafer -noquery -all -dnumcopies=1 -sdevice=mswinpr2 -soutputfile=""%printer%{0}"" ""{1}""", printername, pdffile

javascript - AngularJs Bootstrap carousel does not work -

i trying use bootstrap carousel create slideshow of images on mobile application, not work , have no errors. html <ion-content ng-controller="valuescontroller" style="margin-top: 25px" id="controls"> <div> <carousel interval="carouseltimer"> <slide ng-repeat="slide in slides" active="slide.active"> <img ng-src="{{slide.image}}"> <div class="carousel-caption"> <h4>{{slide.cap}}</h4> </div> </slide> </carousel> </div> js angular.module('starter.valuescontroller', ['ui.bootstrap']) .controller("valuescontroller", function ($scope) { $scope.carouseltimer = 5000; $scope.slides = [ { image: 'http://www.halston.com/files/6514/5150/2738/hh-slider-001-saleonsale-20160101.jpg', cap: 'caption goes here' }, { image: &#

import - Use values from Stata to R data.frame but show labels instead of values -

i quite new r , more used stata . i managed read database stata r data.frame using library(foreign) . data=read.dta("mydata.dta", convert.dates = true, convert.factors = true, missing.type = false, convert.underscore = false, warn.missing.labels = true) values (in sens of stata language) not imported, labels imported. let me explain little more. assume want manipulate education variable called "edu". in stata language, use numeric values instead of labels manipulate variable , data editor shows labels, long have defined labels. assume instance variable "edu" takes values 10 40, following code associates label each value: label define lib_edu 10 "less high-school degree" 20 "12th grade or higher, no college degree" 30 "undergraduate level (2 4 years of college)" 40 "graduate level (5 years of college or more)", add; label values edu lib_edu; then, when want manip

c# - ASP.NET application performing full page reload on each request -

i expected web application behave "single page app", in entire screen not turn white between each page load, rather render new section of page per: <div id="mainsection"> <!-- render individual pages --> @renderbody() </div> and links on _layout.cshtml page: <li>@html.actionlink("some page", "index", "page")</li> now 1 other point application appears behave correctly in firefox only. application not perform full page reload in firefox, in chrome or ie does. application running on iis. @html.actionlink helper method creates link url particular controller , action (so don't have hard-code urls everywhere.) it produces link that's pretty other: <a href="/page/index">some page</a> so it's expected clicking on should load page in browser, if it's page you're on. (like if click on stackoverflow logo on , on - it's going keep reload

java - Installing PyDev onto Eclipse issue -

so trying pydev working on eclipse. running eclipse version 4.5.2. trying install pydev version 5.1.2. i have looked on multiple forums , have tried doing people have been saying try. problem encountering, when install pydev, seems work, can't find anywhere in preferences, meaning cant use pydev. still says installed, under installed category of eclipse market place. i think problem has version of java running. in java installed jres says have both java 8 jdk , jre7. default set jdk8. understand version of java need run version of pydev java 8, should fine that. have seen others post go help>about>installation details> configuration. , when says: -vm c:/program files/java/jre7/bin\server\jvm.dll which assume mean using jre7.... dont understand how. feel main problem experiencing, dont know sure, , if problem, dont know how fix it. thank in advance help. when edited eclipse.ini file, looks like: --launcher.library plugins/org.eclipse.equinox.launcher.win32

html - How to make this table created with <div> tag responsive? -

Image
the table shown in picture created using <div> tag. used <div> tag because placing information in table undesirable. although have tried create exact same table using <table> tag remain unsuccessful. the picture of table for table, below code: @charset "utf-8"; /* global styles */ body { color: #575c7a; line-height: 1.5em; font-family: arial; font-size: 14px; background: #515673 url(../images/background_gradient.jpg) repeat-x 0px 0px; } .page { max-width: 980px; margin: 0px auto; position: relative; background-color: #fff; } { color: #de9000; } a:hover { color: #009eff; } a.cta { text-transform: uppercase; font-size: .9em; font-weight: bold; text-decoration: none; margin: .5em 0 0 0; padding: 0px 12px 0px 0px; background: url(../images/cta_arrow.png) no-repeat right 0px; } a.cta:hover { background-position: right -50px; } nav { color: #f5a06e; text-transform: uppercase;

html5 - Bootstrap 3 navbar layout -

Image
i'm beginner , started learn bootstrap please me noob question of mine. have problem layout in navbar. wanted navigation area on right , user information , picture. wanted layout like. so far i've done is: <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="na

office365 - Unable to add site column with jslink on SharePoint online with CSOM -

i'm facing weird issue today, have sharepoint provider hosted add-in used work last year , half. in spph add-in use jslink on fields. when try add new site column jslink property specified unknown error back. if try create field , update jslink value, same issue. tried updating csom latest version too. facing same issue? idea on subject? help! web.fields.addfieldasxml("<field type=\"note\" name=\"myfield\" staticname=\"myfieldsn\" displayname=\"my field\" " + "required=\"false\" hidden=\"false\" readonly=\"false\" unlimitedlengthindocumentlibrary=\"true\" " + "showindisplayform=\"true\" showineditform=\"false\" showinlistsettings=\"true\" showinnewform=\"false\" " +

node.js - mongoosastic fire "TypeError: doc.execPopulate(...).then is not a function" -

i've updated packages npm update . after made test of project, error: typeerror: doc.execpopulate(...).then not function @ model.postsave (/myhome/mynodejsserver/node_modules/mongoosastic/lib/mongoosastic.js:620:28) was fired. the error in mymodel.save(); triggered. what can now? update: my real code: global.dbmodel.store.findone({email: data.email}, function (err, store) { if (err) return cb({err: {status: 500, error: err}}); if (!store) { delete data.isconfirm; delete data.isblocked; if (data.geo_with_lat_lon && data.geo_with_lat_lon.lat && data.geo_with_lat_lon.lon) { var lat = parsefloat(data.geo_with_lat_lon.lat); var lon = parsefloat(data.geo_with_lat_lon.lon); data.geo_with_lat_lon = {lon: lon, lat: lat}; } var store = new global.dbmodel.store(data);