Posts

Showing posts from February, 2015

c# - Why is ImageSource called twice in WPF? -

my app changes pictures button click. however, when watch breakpoint, imagesource's property referenced twice each time. other properties referenced once. why imagesource "get" running twice? specifically, line runs 2 times, back, right after propertychanged() : get { return picture; } this how update image in gui: public class applicationstate : inotifypropertychanged { public event propertychangedeventhandler propertychanged; private imagesource picture; public imagesource picture { { return picture; } set { picture = value; notifypropertychanged("picture"); } } private void notifypropertychanged(string propertyname) { if (propertychanged != null) { propertychanged(this, new propertychangedeventargs(propertyname)); } } } this xaml code image: <image source="{binding path=picture}"/> and picture change...

version control - Why does git-pull "repo location" take the working directory changes? -

i have local repo working copy in dir , clone parallel dir b. switch branch in a, make changes, , commit them. if go b , "git pull ../a" changes active branch applied master in b... not expecting. if "git pull" relying on configured origin not happen of course. is expected behavior of git-pull "repo location" when there working copy? can point me documentation describes this? edit: assumed must basic git behavior / use case didn't know far i'm not getting responses question. in case wondering why - work on own projects local git repos on multiple machines. thought git way pull changes between them needed , doing on ssh directly between folders... not expecting pulling changes affected working copy happened checked out in remote repo. i'm not sure how can avoid mistakes using technique in future. must commit changes bare repo in order share them? it seems git pull respects locally checked out branch fetching , merging ...

ruby - cucumber rake error in jenkins integration -

i seeing rake aborted! cannot load such file -- cucumber' error in jenkins while trying integrate cucumber ruby test jenkins. the rakefile has following code require 'cucumber' require 'cucumber/rake/task' task default: :cucumber cucumber::rake::task.new |t| t.cucumber_opts = %w{--format pretty} end i think need use bundle install in rakefile don't know how achieve this. pointers on how fix this? you can run bundle install using backticks. make sure run before need gems. `bundle install`

ios - Xcode Beta 4: Can't create a Bot - Crashes every time -

every time try create bot xcode beta 4, crash. process: xcode [4678] path: /applications/xcode-beta.app/contents/macos/xcode identifier: com.apple.dt.xcode version: 7.0 (8178.7) build info: ideframeworks-8178007000000000~3 code type: x86-64 (native) parent process: ??? [1] responsible: xcode [4678] user id: 501 date/time: 2015-07-22 10:42:20.647 -0700 os version: mac os x 10.10.4 (14e46) report version: 11 anonymous uuid: *** time awake since boot: 880 seconds crashed thread: 0 dispatch queue: com.apple.main-thread exception type: exc_crash (sigabrt) exception codes: 0x0000000000000000, 0x0000000000000000 application specific information: productbuildversion: 7a165t uncaught exception (nsinternalinconsistencyexception): view <nspopupbutton: 0x7ffaf0480970> not (and has be) in stack view <nsstackv...

c# - How to cancel autocomplete in Visual Studio 2015 by pressing "Space"? -

how cancel autocomplete in visual studio 2015 pressing "space"? looks there no such option. when see intellisense auto-complete list , press "space" vs automatically print highlighted item. want cancel it. vs 2013 doesn't behave that. plus when press "{" vs 2015 automatically print right "}" cancel too. language c#. if want fix vote https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/9319764-visual-studio-2015-cancel-intellisense-autocomple the escape key cancel intellisense , allow continue typing want without interferences. tried on vs2013 confirm. as "{" being closed "}", caused extension such resharper, ms powertools, or similar.

c# - Visual Studio 2015 XAML Resource Dictionary Error -

part 1 (solved) the following xaml works fine in visual studio 2013 (premium, update 5): <window.resources> <resourcedictionary source="resources/dictionaries/main.xaml" /> </window.resources> however, when working same project in visual studio 2015 (enterprise), complains following error: exception: error occurred while finding resource dictionary "resources/dictionaries/main.xaml". a different topic concerns similar error visual studio 2012, , apparently resolved installing update 1 vs2012. part 2 using pack uri makes visual studio 2015 happy, unfortunately still not applying inhertied styles. interestingly, in visual studio 2013 designer style applied correctly, not in visual studio 2015, , not when application runs! any ideas? part 2 : update a further (side issue), confusing main issue "static resources main window loaded after main window definition processed". means default styles (in specific, win...

Simple calculation using apache spark -

i have javapairrdd (string, tuple2) out of join operation. below data detail - [userid, [(name, rating)]] output: [(user2,[(john,5)]), (user3,[(mac,3), (mac,2)]), (user1,[(phil,3), (phil,4)])] i want calculate min, max , average each user. not sure transformation/action can me here. there multiple ways achieve this, easiest use aggregatebykey method. here example shows how it public static void main(string[] args) { sparkconf conf = new sparkconf().setappname("simple application").setmaster("local[4]"); javasparkcontext sc = new javasparkcontext(conf); string[] values = {"user2:john", "user1:phil", "user3:mac"}; string[] ratingvalues = {"user2:5", "user3:3", "user3:2", "user1:3", "user1:4"}; javardd<string> users = sc.parallelize(arrays.aslist(values)); javardd<string> ratings = sc.parallelize(arrays.aslist(ratingvalues)); ...

scala - How can I use SBT to help my library get around transitive dependency conflicts -

let's i'm writing scala library l depends on dependency d , consumed program p , program q. p depends on version 3.2 of d directly while q depends on version 3.3 directly. between 2 versions d's api shuffled same function use in l, must write different import statements in l. likewise p relies on 3.2-specific behavior whereas q relies on 3.3-specific behavior. now, happen recent version of d chosen when compiling p , q, cause either p break if l depends on version 3.3 of library or l break when compiling q if l depends on version 3.2 of d. i ideally same version of l used both p , q since l's public api not change. possible? the general method comes mind conditional compilation of l based on dependency resolution. seems unachievable though in jvm world since don't transitively compile project's dependencies , instead rely on precompiled artifacts. i can right sbt if d scala (i.e. cross-compiling different scala versions , having version specific co...

visual studio 2015 - VS2015RTM Cordova Tools configuration for ios remote build agent no longer valid - taco-remote package not found -

updated vs2015rc rtm - cordova tools configuration ios remote build agent no longer valid. vs2015rtm cannot find taco-remote package installed on remote mac (but vs2015rc could). this how looks build remote agent command prompt (note 404 response not found): remote build server listening on [http] port 3000 ios-sim installed on path at: /users/admin/node-v0.12.4-darwin-x64/lib/node_modules/vs-mda-remote/node_modules/ios-sim/build/release/ios-sim /modules/taco-remote 404 12ms npm taco-remote --version outputs 2.10.1 from microsoft - visual studio 2015 has updated remote agent called remotebuild. vs-mda-remote, previous agent, use visual studio 2015 rc , earlier versions. following instructions link above, getting /modules/taco-remote 200 21.968 ms (note 200 response ok), expected

javascript - How to diff two immutable objects -

is there way diff objects in immutable ? example: let = immutable.fromjs({ a: 10 }); let b = immutable.fromjs({ b: 10 }); let d = immutable.diff(a, b); // { a: 10 } console.log(d.tojs()); this useful when testing see how objects differ. it doesn't have show what's added/removed explicitly. want see properties a differs b can make them equal again. for example this: console.log(a.tojs()); console.log(b.tojs()); and check logs see differs b. in other thought might show both added , removed properties in same output. main point see not equal. so be: // { a: 10, b: 10 } console.log(d.tojs()); or maybe: // { added: { a: 10 }, removed: { b: 10 } } // console.log(d.tojs());

javascript - The 3 different equals -

what difference between = , == , , === ? i think using 1 equal sign declare variable while 2 equal signs comparison condition , lastly 3 equal signs comparing values of declared variables. you have = assignment operator , == 'equal' comparison operator , === 'identical' comparison operator . $a = $b assign sets $a equal $b. $a == $b equal true if $a equal $b. $a === $b identical true if $a equal $b, , of same type. (introduced in php 4) for more info on need == , === , , situations use each, @ the docs .

hdfs - Get hadoop configuration in Java util -

i'm writing java utility needs access dfs, need configuration object. when create 1 using configuration conf = new configuration() it doesn't seem find dfs, , uses local file system; printing fs.gethomedirectory() gives local home directory. i've tried adding core-site.xml,mapred-site.xml,yarn-site.xml,and hdfs-site.xml configuration resources, doesn't change anything. need pick hdfs settings? thanks reading the reason why it's pointing local file system core-site.xml , hdfs-site.xml not added properly. below code snippet you. configuration conf = new configuration(); conf.addresource(new path("file:///etc/hadoop/conf/core-site.xml")); // replace actual path conf.addresource(new path("file:///etc/hadoop/conf/hdfs-site.xml")); // replace actual path path pt = new path("."); // hdfs path filesystem fs = pt.getfilesystem(conf); system.out.println("home directory :"+fs.gethomedirectory()); update...

asp classic - How do you allow parent paths in Visual Studio 2015? -

i've opened existing web application project visual studio 2013 (which runs fine), in visual studio 2015. when run within visual studio 2015 get: active server pages error 'asp 0131' disallowed parent path /blah/login.asp, line 1 include file '../includes/security.asp' cannot contain '..' indicate parent directory. my iisexpress applicationhost.config file contains entry: <asp appallowclientdebug="false" appallowdebugging="false" errorstontlog="false" enableparentpaths="true" scripterrorsenttobrowser="true" bufferingon="true"> <session allowsessionstate="true" /> <cache disktemplatecachedirectory="%systemdrive%\inetpub\temp\asp compiled templates" /> <limits maxrequestentityallowed="1073741824" /> </asp> my web application properties set use iisexpress. what missing? ...

go - How to find a package name from given call in runtime? -

for logging purpose want write function print package name. can directory name: // file full file name // 4 - how many calls want go in stack trace. _, file, line, ok := runtime.caller(4) ... can't find way package name (package name can different directory name). i came across similar problem - package path how package name. best solution found exec "go list" command. not ideal came blank elsewhere. in case had problem package empty directory. no source files, "go list" throws error, added function create sensible package name path. here's code: func getpackagename(path string) string { output, err := exec.command("go", "list", "-f", "{{.name}}", path).combinedoutput() if err != nil { return guesspackagename(path) } return strings.trimspace(string(output)) } func guesspackagename(path string) string { preferred := path if strings.hassuffix(preferred, "/...

sql - Postgresql trigger to calculate total score -

i trying learn how create trigger in postgresql. have table thread_user - table name thread_id user_id points thread - table name thread_id total_points i want on update of thread_user row update total points in thread table. need select * thread_user thread_id = thread_id of inserted item , add points update thread_points in threads table. believe done in triggers maybe stored procedure better. first step make function calculates sum of points , updates row in calculated_points table. thereafter you'll ahve create trigger called upon inserting row in user_points table. drop table if exists user_points cascade; create table user_points ( id serial primary key, user_id int not null, points int not null ); drop table if exists calculated_points cascade; create table calculated_points ( id serial primary key, user_id int not null unique, points int not null ); insert calculated_points (user_id, p...

java - Setting object in http get request -

i writing client side java program pageable spring data resource repository api of format: public page<person> findbycountry(..., pageable pageable); i have created pageable request of format pageable pageable = new pagerequest(1, 40, new sort("name")); however, know how can set pageable http client . using httpget , httppost . i googled bit , found links using spring rest controller. can not using apache http client? springs hateoas seems option. mean adding jar client project. question of how set payload on request? additionally, if there better approaches let me know. want loop through pages till data exhausted. thanks. i not sure if going suggest best approach how go it. since cannot have reference spring dependent object i.e pageable in lean client without adding spring dependency client may want send pagerequest details http query parameters http api , loop on technology independent pagewrapper results shown below. api signature pub...

javascript - Angular directive to set background color of a div -

let's have div element: <div id="wrapper"> text </div> how write angular directive such background depends on input? for example tried: <div id="wrapper" color temperature="51"> text </div> with directive: .directive('color', function() { return { restrict: 'a', replace: true, scope: { temperature: '=' }, template: '<div ng-class="temperaturecss">test</div>', link: function($scope) { $scope.$watch('temperature', function(v) { if(!v) { return; } var temperature = v; console.log("temperature", v) if(temperature > 31) { $scope.temperaturecss = "redcss" // redcss works , defined } }); } } }) but not work. think issue somewhere in template. you should check out angular documentation on directives . looks part of pr...

java - Jersey client using an authenticated session -

in given moment in time authenticated session created. i need create jersey client (post method) using authenticated session. i've tried set jsessionid in jersey client doesn't recognize session. client client = client.create(); final string url = "http://localhost:8080/api/send"; webresource wr = client.resource(url); javax.ws.rs.core.cookie cookie=new javax.ws.rs.core.cookie("jsessionid", "521448844j5we54d"); wr.cookie(cookie); // set post parameters formdatamultipart multipart = new formdatamultipart(); formdatabodypart fdp = new formdatabodypart("file", uploadedinputstream, mediatype.multipart_form_data_type); multipart.bodypart(fdp); string response = wr.type(mediatype.multipart_form_data_type).post(string.class, multipart); system.out.println(response); i've tried code below, in jersey client call first api authenticate session , try use same client object call api re...

Returning Max date in SQL Server -

i'm trying return max dates of input dates. create procedure [dbo].[getmaxmonthdate] @from datetime, @to datetime begin set nocount on; select max(day(ds.datum)) daymax, month(ds.datum) monthmax, year(ds.datum) yearmax, cast(convert(varchar, year(ds.datum)) + '-' + convert(varchar, month(ds.datum)) + '-' + convert(varchar, max(day(ds.datum))) datetime) datemax qr_ds022s ds ds.datum >= @from , ds.datum <= @to group month(ds.datum), year(ds.datum), ds.datum end for example when i'm typing @from='2014-01-01' , @to='2014-04-01' result of query follows: daymax | monthmax | yearmax | datemax ======================================== 31 | 1 | 2014 | 2014-01-31 28 | 2 | 2014 | 2014-02-28 31 | 3 | 2014 | 2014-03-31 01 | 4 | 2014 | 2014-04-01 currently i'm getting dates want last date of month. how can resolve this...

c - How to structure source code for embedded software -

in trying improve embedded software skills (in procedural c, using c++11 features), learn optimal ways structure/package source code embedded systems. i working on building small scale systems (on single microcontollers 1-k4k ram memory) without rtos. in order able debug software outside target environment, emulate system on host computer. i found out standard store information processor , internal devices (ram, rom, timers, etc.) in board support package . but in embedded project use other external devices (push buttons, leds, lcd, servos, io multiplexer, etc.) connected using pcb microcontroller. what standard way/standard name source code abstraction layer on application specific pcb? i have searched in books on real-time system engineering (david simon's an embedded software primer , jim cooling's software engineering real-time systems , laplante's real-time systems: design , analysis ), unable find reference code structuring in embedded systems. ...

c# - PTVS no intellisense in IronPython project -

i'm using vs2013 ptvs , have problem, have no intellisense support self written c#/.net assemblies. assemblies referenced in project. i'm using .net framework 4.5.1. referenced system dlls available via intellisense (like system or system.data ). intellisense works custom dlls, if use clr.addreference @ top of script. no solution. doing wrong? maybe 1 has solution, thank you!

javascript - how to stop youtube video playing when container closed -

i have seen few posts , answers find 1 video , not multiple videos on same page. i have around 10 videos on web page. when click button each want overlay pop does. video played. once user clicks exit button want video stop playing. at minute if user no click pause of youtube video , exits out keeps playing in background. i show 2 video sections example: <div class="play-button"> <i class="fa fa-play"></i> </div> <div class="youtube-frame"> <div class="exit-youtube-frame"> <i class="fa fa-times"></i> </div> <iframe width="520" height="345" src="<?= $video ?>"></iframe> </div> <div class="play-button"> <i class="fa fa-play"></i> </div> <div class="youtube-frame"> <div class="exit-youtube-fra...

service - Restrict 3rd party apps to access Internet except one app in Android -

i developing android application examination purpose. app used students , professors. student may attempt verify answer other apps using internet during exam. client want's restrict other android apps use internet service when exam app open. possible disable internet access of other apps when particular app open? no, can't. in 'exame app' can check when activities in foreground or not. if app goes in background, can assume student trying else. about?

c# - Sending emails (Gmail) -

this code worked few weeks ago, when try doesn't work. here's code: smtpclient client = new smtpclient(); client.port = 587; client.host = "smtp.gmail.com"; client.enablessl = true; client.timeout = 10000; client.deliverymethod = smtpdeliverymethod.network; client.usedefaultcredentials = false; client.credentials = new system.net.networkcredential("mail@gmail.com", "password"); mailmessage mail = new mailmessage("mail@domain.com", "mail2@gmail.com", "subject", "body"); mail.bodyencoding = utf8encoding.utf8; mail.deliverynotificationoptions = deliverynotificationoptions.onfailure; client.send(mail); error is: smtpexception unhandled: unhandled exception of type 'system.net.mail.smtpexception' occurred in system.dll additional information: operation has timed out.

node.js - node karma fs object empty -

i'm trying run tests on node using karma. i'm running using both phantom , real browsers. whichever way run error on fs read file functions. 'undefined' not object (evaluating 'fs.existssync') this if have simple file like: var fs = require('fs'); console.error(fs); var text = fs.readfile('data.txt', 'utf8'); the first console writes out object {}. second 1 gives me above error. i'm assuming object empty. i'm using latest version of karma , dependencies. can point me in right direction why fs object empty/not working. karma client side js test runner cannot use node file system on it. test server side js suggest use different test runner mocha. if use mocha server js namely nodejs able use node filesystem. there way read file client using xmlhttprequest() . refer question javascript - read local text file

java - Difference between int[] array and int array[] -

i have been thinking difference between 2 ways of defining array: int[] array int array[] is there difference? they semantically identical. int array[] syntax added c programmers used java. int[] array preferable, , less confusing.

laravel 5 - 'auth' middleware in lumen throwing error -

i testing out lumen first time. trying out auth middleware throws error. want know whether such middleware shipped lumen or need implement our own? routes file $app->group(['middleware' => 'auth'], function ($app) { $app->get('/', ['as' => 'api', 'uses' => 'apicontroller@index']); }); and error when trying access route errorexception in manager.php line 137: call_user_func_array() expects parameter 1 valid callback, class 'illuminate\auth\guard' not have method 'handle' as see, auth in lumen container bound illuminate\support\manager\authmanager . so, yeah, have create own middleware. example case. make own middleware in app/http/middleware <?php namespace app\http\middleware; use closure; use illuminate\contracts\auth\guard; class authenticate { /** * guard implementation. * * @var guard */ protected $auth; /** * create new fi...

php - Continue query execution if one query in batch fails in codeigniter -

i trying insert around 3000 rows using codeigniter batch insert problem , if 1 row in batch fails stops execution of other rows , prints query error. is possible continue execution ,even if there failed query in batch , log failed query ? i don't want use $this>db->query since takes lot more time , connections $this->db->insert_batch(); insert operation cron script runs every 5 min using fastest way more preferable since insert operations carried on transactional database. not sure ci, i'd use exception class something : <?php try{ // php code } catch(exception $e){ // if error occurs, print, log, etc... print_r($e); } ?>

php - Explanation with doctrine -

i asking result of query. have not same result when use mysql , doctrine... have field change when it's executed (package ->id). my query in mysql : "select * packages_dates_prices inner join packages on packages_dates_prices.id = packages.id , packages_dates_prices.package ='.$id.'" my query in repository , in dql : "select backbundle:packagesdatesprices inner join backbundle:packages b a.id = b.id , a.package = :id " the query in debug toolbar : select e0_.id id0, e0_.date_start date_start1, e0_.date_end date_end2, e0_.price price3, e0_.id id4 packages_dates_prices e0_ inner join packages e1_ on ( e0_.id = e1_.id , e0_.id = ? ) parameters: [1] entity packages : <?php namespace back\bundle\entity; use doctrine\orm\mapping orm; use gedmo\mapping\annotation gedmo; /** * packages * * @orm\table(name="packages") * @orm\entity(repositoryclass="back\bundle\entity\packagesrep...

Java/Android NavDrawer troubles (Newbiee) -

hi i'm new @ programming. i followed great tutorial , works fine. now i'am trying 2 things: create picture in top of navdrawer(want call profilepicture , name here , make button @ same time) and add buttons top menu. i tried lot of different approaches without success. do have tips how ? i'm using android studio. in advance. strings.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">rider</string> <string name="action_settings">settings</string> <string name="hello_world">hello world!</string> <string name="drawer_open">rider menu opened</string> <string name="drawer_close">rider menu closed</string> <!-- nav drawer menu items --> <string-array name="nav_drawer_items"> <item >profile</item> <item >club</item> <item ...

javascript - Parsing t=1h2m3s(h - hour, m-minutes, s-seconds ) into seconds if order of hours, minutes and seconds are valid -

i need parse valid timestamp formats below hours followed minutes followed seconds ex:t=1h2m3s minutes followed seconds ex:t=2m3s only hours ex: t =3h only minutes ex: t =4m only seconds ex: t =5s and escape other timestamp formats t=2m1h or t=3s2m or t=3s1h2m. i tried below unable escape invalid formats.i trying regular expression find. function calculateinseconds(timestamp) { var timeinseconds=0; console.log("calculateinseconds timestamp:"+timestamp); timestamp.replace(/([0-9]+)[h|m|s]/g, function(match, value) { if (match.indexof("h") > -1) { timeinseconds += value * 60 * 60; } else if (match.indexof("m") > -1) { timeinseconds += value * 60; } else if (match.indexof("s") > -1) { timeinseconds += value * 1; } }); console.log("timeinseconds"+timeinseconds); } calcu...

Replacing a string having double slash using sed or awk in linux -

i wish replace <property name="sourceurl" value="file://d:/uploaded files?move=../../backup&amp;include=.*.ok"/> with <property name="sourceurl" value="file:///tmp/etl-files?move=../../backup&amp;include=.*.ok"/> i following approach first find line number , replace line desired text, not happening because of < present @ start of line. grep -n ^<property name="sourceurl" value= etl-job-context.xml how can solve this, or there better approach? you may use sed. sed 's~\(<property *name="sourceurl" *value="\)[^?]*~\1file:///tmp/etl-files~g' file basic sed uses basic regular expression engine matching. in bre \(..\) called capturing group. capture chars exist property tag value parameter. , remaining chars ? matched [^?]* , means match char ? , 0 or more times. sed uses special chars delimiters. here used ~ because replacement string contains / slashes...

javascript - Using wfs-t in OpenLayers 3? -

i'm using openlayers-3.6.0 in web application. have wfs layer follow: var url="http://localhost:8080/geoserver/wfs?&" + "service=wfs&version=1.1.0&request=getfeature&typenames=usa:states"; var format = new ol.format.wfs({}); var source = new ol.source.vector({ url: 'proxy.cgi?url='+ encodeuricomponent(url), format: format }); layer wfs = new ol.layer.vector({ title: 'states', source: source }); i edit point layer follow: draw = new ol.interaction.draw({ source: source, type: 'point' }); now want save layer in server side. in openlayers-2 defined savestrategy , call save method of it. shown follows: var savestrategy = new openlayers.strategy.save(); /* * change layer's features */ savestratefy.save(); how can in openlayers-3.6.0 ? this application code handle. boundless sdk has code this. see: http://boundlessgeo.com/2014/06/openlayers-editing-wfs-t/ , code i...

Passing Python functions to Gnuplot -

Image
plotting python function in gnuplot not straightforward although there solutions. example, 1 either cast values array or manually translate expression gnuplot’s syntax. here example uses module gnuplot.py interface: #!/usr/bin/env python import gnuplot import numpy np ## define function ## func = lambda x, x0, y0, w: y0 * np.exp( -4*np.log(2) * ( (x-x0) / w )**2 ) # works regular function: # def func(x, x0, y0, w): # return y0 * np.exp( -4*np.log(2) * ( (x-x0) / w )**2 ) popt = (10.1, 5, 2) ## linspace ## x = np.linspace(0, 20, num=1000) # (x min, x max, number of points) y = func(x, *popt) func_linspace = gnuplot.data(x, y, with_='lines', title='linspace') ## expression “translation” (lambda only) ## func_translation = gnuplot.func( '{y0} * exp( -4*log(2) * ( (x-{x0}) / {w} )**2 )'.format( x0=popt[0], y0=popt[1], w=popt[2], ), title='expression translation') ## plot ## g = gnuplot.gnuplot() g.plot(...

node.js - Deep associations in sails mongo using populate method? -

i new sails.js , using "sails.js mongodb" . having problem deep associations using populate in sails app. i have relationship this: category has many many relationship article. city has 1 many relationship areas. article has 1 one relationship city , areas. category.js module.exports = { schema: true, attributes: { //add referecnce other article articles: { collection: 'article', via:'ref_category_id' }, category_name: { type:'string', required: true, unique: true }, } }; article.js module.exports = { schema: true, attributes: { //adding reference category ref_category_id: { collection:'category', via:'articles' }, //adding reference city ref_city_id: { model:'city' }, //add reference area ref_area_id: { ...

corruption - Issue on loading corrupted excel file with R -

i'm trying import multiple excel files r encounter problem when try load corrupt one. my excel files (.xlsm) in different folders : machine -- >years --> months --> many excel files --> load file --> actions on each file i use multiple sapply function make loop , perform actions file datas. due corrupt file, process stops. tried r functions file.access() , file_test() doesn't fix problem. what i'm looking function or embedded shell command allow me know if actual file corrupt , avoid it. thanks, thomas.

objective c - Transforming Pitch and Roll values in iOS -

Image
i have been trying compare pitch , roll pattern (2 second recording) readings. what have done record pitch , roll values 10 seconds. in 10 seconds similar motion applied device. when plot these on graph, values same. this happens when providing motion device same orientation/position. example, device lying down on table , motion provided device. readings same. but if device rotate 180 deg. ccw, readings inverted. is there way can achieve same reading every position? via applying transformation formula? have done acceleration values using pitch roll , yaw. but, don't know how achieve pitch , roll itself. basically, want achieve pitch , roll values should independent of yaw. here plot pitch values.. readings same expect 2 starting 1.5 in graph. these 2 times when device rotated 180 deg. ccw update: i tried store cmattitude in nsuserdefaults , applied multiplybyinverseofattitude. still graph plot inverse. cmattitude *currentatt = motion.attitude; ...