Posts

Showing posts from September, 2014

android - Should Asynctask be paused when the user clicks home button -

had situation while asyctask running. user clicks home button while asynctask running . should asynctask allowed run when app in background or should paused , resumed when app comes foreground . it depends. asynctask doing? if synchronizing data server, should left alone. async task doing have redone in onresume()? cancel it. if loading data, go either way. activity/fragment force reload of data in onresume() or allow loader (you using async loaders hope) fill in data loaded in background when user temporarily switched background? you have ask yourself, task running expensive (resource-wise) won't helpful when not in foreground? also keep in mind, os cancel task on own too. long you're cleaning resources appropriately, handling cancellations , null activities in callbacks appropriately, leaving running won't end of world.

asp.net - Getting checkboxList values as per selected category from parent checkboxList -

i trying fetch checkboxlist database (working). there 2 checkboxlist on page: first gets fetch when page loads, second gets fetched selected values first checkboxlist. working when select first time first checkboxlist. when select second value first checkboxlist string gets structured ('value1','value2 " & vblf & "') it should make string this ('value1','value2') now don't understand & vblf & . dim joiner string = "" dim whereclause string = string.empty dim categorycondition string = string.empty = 0 categoryfilter.items.count - 1 if categoryfilter.items(i).selected dim category string = categoryfilter.items(i).tostring categorycondition = string.concat(categorycondition, joiner, string.format("'{0}'", category)) if joiner = "" joiner = "," end if next use built-in functionality checked items , concatenate string ...

html - Can't make the bootstrap collapsed nav fixed -

i need 2 navs in website: 1 fixed, other show-hide on click. when click show de first nav, can't above second nav , did it. when scroll , click show first nav, can't fixed, , not working position:fixed. i'm using bootstrap collapse ( http://www.w3schools.com/bootstrap/bootstrap_collapse.asp ) i need first nav fixed when scroll. obs: sorry if english not perfect =p https://jsfiddle.net/8o8hr8qb/1/ .panel { width: 100%; z-index: 999; background: #000; border: none; border-radius: 0; color: #fff; margin-bottom: 0; top: 0} .teste-menu { width: 100%; background: #ccc; position: fixed; z-index: 99; top: auto;} .collapse.menu-visivel { display: block; visibility: visible;} .btn-info { float: right; right: 45px; border-radius: 0; background: #000; border-color: #000; position: fixed; z-index: 999;} <div class="panel panel-default"> <div id="collapse1" class="panel-collapse collapse"> <div class="panel-b...

ios - Initialization Errors with React Native Tutorials -

i installed react native, , attempting follow tutorials on react native website accustomed it. every tutorial end doing gives me big red error screen in ios simulator. as example, followed "hello world" tutorial on react native website import react, { component } 'react'; import { appregistry, text } 'react-native'; class helloworldapp extends component { render() { return ( <text>hello world!</text> ); } } appregistry.registercomponent('helloworldapp', () => helloworldapp); but met error after compiling , running in simulator" "application testproject has not been registered. either due require() error during initialization or failure call appregistry.registercomponent" i'm confused because know nothing yet rn, following tutorials letter, , getting errors. please advise? there might 2 possibilities know of: when run react-native run-ios packager didn't start automa...

vba - Invalid Use of Property error on Shape.OnAction -

i'm trying put macro shape vba received error "invalid use of property", why? class ccontainer code: option explicit sub createcontainer() dim s shape ' shape container dim t shape 'text container dim sr variant 'container grouping dim w worksheet set w = activeworkbook.worksheets(1) set s = w.shapes.addshape(msoshaperectangle, 10, 10, 100, 100) s s.fill.forecolor.rgb = rgb(255, 255, 255) s.line.forecolor.rgb = rgb(100, 100, 100) s.line.dashstyle = msolinedash s.line.style = msolinesingle s.line.weight = 0.5 s.name = "shapeexample" end set t = w.shapes.addtextbox(msotextorientationhorizontal, s.left + 10, s.top + 10, s.width - 20, 20) t t.line.forecolor.rgb = rgb(100, 100, 100) t.line.dashstyle = msolinedash t.textframe.characters.text = "connector" t.textframe.characters.font.size = 10 t.textframe.horizontalalignment = xlhaligncenter t.name = "textshapeexample" end set sr = w.shapes.range(array("shapeexample", ...

angularjs - ui-router change url after $state.go -

i have route: $stateprovider.state('keeper.telepay.category', { url: '/category-{id}/country-{cid}/region-{rid}' } in cases when use $state.go route, want change rid 'all' if it's value '0', url'll /category-1/country-195/region-all i've tried in $rootscope.$on('$statechangestart'), no luck. suggestions || directions appreciated. update here i've tried on $statechange: $rootscope.$on('$statechangestart', function(event, tostate, toparams, fromstate, fromparams){ if(tostate.name == 'keeper.telepay.category' && tostate.params.rid == 0) { tostate.params.rid = 'all'; } } accidently i've stumbled link http://angular-ui.github.io/ui-router/feature-1.0/interfaces/params.paramdeclaration.html#squash so pure solution is: $stateprovider.state('keeper.telepay.category', { url: '/category-{id}/country-{cid}/region-{rid}', params: { ...

Selected messages in a JSF dataTable don't get updated as selected in Java -

so have problem: have datatable being generated in jsf using list bean of corresponding xhtml page. datatable , column checkboxes select messages looks this: <t:datatable binding="#{table}" rendered="#{searcharhivauibean.rendertable}" value="#{searcharhivauibean.nonediabstractlist}" var="dataitem" border="0" cellspacing="2" width="100%" id="tdtbl" rows="#{searcharhivauibean.numberofrows}" headerclass="tableheader" rowclasses="rowodd,roweven" columnclasses="column"> <h:column> <f:facet name="header"> <h:selectbooleancheckbox id="selectallcheckbox" onclick="togglecheckbox(this.id,'form2:tdtbl')" value="#{searcharhivauibean.selectallcheckbox}"/> </f:facet> <t:panelgroup> <h:selectbooleancheckbox value="#{dataitem.selectat}"/> ...

python - Advice on structuring a growing Django project (Models & API) -

i’m working on improving django project used internally @ company. project growing i’m trying make design choices before it’s unmanageable refactor. right project has 2 important models rest of data in database supports each application in project added database through various separate etl processes. because of majority of data used in application queried in each view via sqlalchemy using straight multiline string , passing data through view via context param when rendering rather using django orm. would there distinct advantage in building models tables populated via etl processes can start using django orm vs using sqlalchemy , query strings? i think makes sense start building api rather passing gigantic amount of information through single view via context param, i’m unsure of how structure api. i’ve read people create entirely separate app named api , make views in return jsonresponse. i’ve read others same view based api include api.py file in each application in django p...

java - Find first matching string in two lists in less than O(n^2) time using a Java8 one-liner -

simple question, have 2 arrays / lists, i'm looking efficient one-liner in java8 match first argument against long list of possible arguments. arguments public static void main(string... args) , other 1 list of predefined strings i'll call secondarray, ["a", "b", "cc", "de", ...] . want match 2 incoming arrays against each other , find first matching arg ument against secondarray list. example: args = arrays.aslist("r", "b", "c", "d", ...) secondlist = arrays.aslist("q", "z", "x", "c", "d", ...) the first matching argument "c" the java7 (inefficient) way of doing have been: string profile = "default"; (string arg : args){ if (secondarray.contains(arg)){ profile = arg; break; } } dosomethingwith(profile); in java8, i've done far, wondering if there's better way (more efficient, f...

c# - timespan to datetime conversion format issue to display datetime chart -

i developing windows forms application , has display datetime line chart real time data every 1 second. i have display time on x-axis in format of (days:hours:min:sec). time should 00:00:00:00, 00:00:00:01, 00:00:00:02 etc. i taking first response time(system time) reference time date1. again after 1 sec, sending request, getting response, capturing system time date2 , continuously doing this. getting response timespan subtracting date2 , date1. but datetime chart x-axis accepts datetime type variable , has convert double using tooadate() . problem: while converting timespan 00:00:06.2867597 datetime variable converting 7/25/2016 12:00:06 am . need fomat 00:00:06 instead of 12:00:06 am . then using tooadate() , correct double value. please solve problem. here code: datetime date1 = datetime.now; // {7/25/2016 8:13:29 pm} datetime date2 = datetime.now; // {7/25/2016 8:13:30 pm} timespan time = date2 .subtract(date1); // {00:00:01.3922821} dateti...

postgresql - How to remove {} and [] from json column postgresSQL -

i have column in postgressql json data type. until today there not row contained {} or []. however, start see {} , [] due new implementation. want remove it. example: following table looks like. json json data type id | json ----+------------------ | {"st":[{"state": "tx", "value":"0.02"}, {"state": "ca", "value":"0.2" ... ----+------------------ b | {"st":[{"state": "tx", "value":"0.32"}, {"state": "ca", "value":"0.47" ... ----+------------------ d | {} ----+------------------ e | [] where want following: id | json ----+------------------ | {"st":[{"state": "tx", "value":"0.02"}, {"state": "ca", "value":"0.2" ... ----+------------------ b | {"st":[{"s...

maven - Trouble Importing Neo4j in Java -

Image
i doing maven project intellj idea in trying use neo4j. i have error of "unable resolve symbol neo4j" on (import org.neo4j.driver.v1.*;). i have brought in neo4j jar files project , believe have correctly set pom file. post both though question below. pom: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.example</groupid> <artifactid>neoimport</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>neoimport</name> <description>import</description> <dependencies> <dependency> <groupid>org.neo4j.driver</groupi...

java - How to calculate total directions in multiple markers eclipse -

Image
i need total distance in multiple directions, when run show current distance. shown in image, when click third marker calculate second direction (it should first , second). thank :) // fetching i-th route list<hashmap<string, string>> path = result.get(i); // fetching points in i-th route for(int j=0;j<path.size();j++){ hashmap<string,string> point = path.get(j); if(j==0){ // distance list distance = (string)point.get("distance"); continue; }else if(j==1){ // duration list duration = (string)point.get("duration"); continue; } double lat = double.parsedouble(point.get("lat")); double lng = double.parsedouble(point.get("lng")); latlng position = new latlng(lat, lng); ...

javascript - how to animate CSS "clip" property in loop-jQuery-animation? -

i want animate slider of twenty-twenty plugin zurb. ( http://zurb.com/playground/twentytwenty ) github: https://github.com/zurb/twentytwenty this have currently: $(".twentytwenty-container").twentytwenty({ default_offset_pct: 0.15, // how far left slider should move_slider_on_hover: true // move slider on mouse hover? }); var leftoffset = parseint($(".twentytwenty-handle").css("left"), 10); function animation() { var options = { duration: 650, easing: 'swing' }; $('.twentytwenty-container') .find('.twentytwenty-handle') .animate({ left: leftoffset + 5 + "px" }, options) .animate({ left: leftoffset - 5 + "px" }, $.extend(true, {}, options, { complete: function() { animation(); } }) ); } function animationimg() { var options = { duration: 650, easing: 'swing' }; $('.twentytwenty-contai...

html - use local gif file on a web page insted of an intenet based gif -

i want use local file destination path instead of url in code dont have connected internet fetch gif. i've tried few things across stack nothing works. <img src="gif url"alt=""style="width:12px;height:18px;"> i think this should answer question. need path local copy.

JNA concurrency issues -

i'm trying access native (fortran) library ( mylib.so ) loaded jna. library accessed in parallal spark-job. far have not synchronized method calls (nor library) call shared library bottleneck in computations , must run in parallel. i following error: # fatal error has been detected java runtime environment: # # sigsegv (0xb) @ pc=0x00007ffbcb5f8dcd, pid=58569, tid=140708155152128 # # jre version: java(tm) se runtime environment (8.0_60-b27) (build 1.8.0_60-b27) *** error in `/usr/java/jdk1.8.0_60/jre/bin/java': double free or corruption (!prev): 0x0000000001b756d0 *** *** error in `/usr/java/jdk1.8.0_60/jre/bin/java': free(): corrupted unsorted chunks: 0x0000000001b75010 *** *** error in `/usr/java/jdk1.8.0_60/jre/bin/java': double free or corruption (!prev): 0x0000000001b756d0 *** # java vm: java hotspot(tm) 64-bit server vm (25.60-b23 mixed mode linux-amd64 compressed oops) # problematic frame: # c [libc.so.6+0x38dcd]======= backtrace: ========= ======= back...

c# - Call Website resource through Windows Service -

i have 1 scenario in have call website windows service schedule @ specific time. need html resources , send email using windows service. possibility call web resource through windows service ? open implementation in .net framework. regards have 1 scenario in have call website windows service schedule @ specific time. need html resources , send email using windows service. this harder sounds. components render html viewable web page expect desktop, windows service doesn't have. then still need render html pdf, else there no native support in .net. need 3rd party library ghostscript or 1 adobe (don't remember name, it's expensive). when desktop, adobe acrobat doing heavy lifting, that's not available service because acrobat requires desktop. if can find way render html without having desktop or interactive session, can render html pdf ghostscript.net , system.net.mail. if doesn't need service, afternoon's work in vb.net or c#, if need ...

Difference between Kinesis Stream and DynamoDB streams -

Image
they seem doing same thing me. can explain me difference? high level difference between two: kinesis streams allows produce , consume large volumes of data(logs, web data, etc), dynamodb streams feature local dynamodb allows see granular changes dynamodb table items. more details: amazon kinesis streams amazon kinesis streams part of big data suite of services @ aws. developer documentation : you can use streams rapid , continuous data intake , aggregation. type of data used includes infrastructure log data, application logs, social media, market data feeds, , web clickstream data. following typical scenarios using streams: accelerated log , data feed intake , processing ... real-time metrics , reporting ... real-time data analytics ... complex stream processing ... dynamodb streams dynamodb nosql option @ aws , basic unit tables store items . dynamodb streams feature can turn on produce changes items stream in real time...

How do I get R to calculate a negative IRR scenario? -

i have been doing stochastic cash flow modeling. in of these scenarios, irr negative (cash flows out exceed cash flows in on time). r seems hate this. uniroot error. have used fincal package irr function, , tried write own uniroot irr formula. it's important formula solves both positive , negative irr scenarios. any suggestions or ideas? there r package handles this, or simple uniroot formula? thank you! i ended writing own code (based upon irr fincal) errors ignored. changed range incorporate negative numbers when uniroot looking solution. fyi - errors happen because value out of range or because there 2 solutions. use irr4 solve. irr3<-function (cf) { n <- length(cf) subcf <- cf[2:n] uniroot(function(r) -1 * pv.uneven(r, subcf) + cf[1], lower = -.2, upper = .2, tol = .000001)$root} irr4<-function (x) { out<-trycatch(irr3(x),error= function(e) null) return(out)}

ios - How to show navigation bar top and tool bar below when showing uiimage in full screen? -

Image
-(void)imagefullscreen:(uitapgesturerecognizer*)sender{ modalcon = [[uiviewcontroller alloc] init]; modalcon.view.backgroundcolor=[uicolor blackcolor]; modalcon.view.userinteractionenabled=yes; uiimageview *imageview = [[uiimageview alloc] initwithframe:modalcon.view.frame]; imageview.contentmode = uiviewcontentmodescaleaspectfit; imageview.image = self.mimageview.image; [modalcon.view addsubview:imageview]; uitapgesturerecognizer *modaltap =[[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(dismissmodalview:)]; [modalcon.view addgesturerecognizer:modaltap]; [self.delegate showfullscreen:modalcon]; return; } the method showfullscreen:modalcon show modalviewcontroller(modalcon) , on touch of image shown, dismiss. when image full screen, navigation bar not shown (black bars come both above , below image) this: but want same behaviour ios photos app on click of photo ...

sql server - How to find MS SQL Port without admin access? -

im setting ubuntu server in office going used automatic reporting. ive set lamp stack. ubuntu 16.04 server edition. im getting error when im trying connect 1 of companies mssql servers through php on new server: failed db handle: sqlstate[hy000] unable connect: adaptive server unavailable or not exist (severity 9) ive set connection default port mssql 1433. not working. i have read rights sql database. are there ways find out port sql server listening on? without contacting dept. (they on vacation) ? nmap great port scanner. sudo at-get install nmap nmap -p- 192.168.1.1 if target not 192.168.1.1 should change ip. read this .

javascript - I can populate ServiceType but can't get the right values for ServiceName(dependent drop down list) -

Image
how can have right servicename dropdown values based on servicetype dropdown selected values. $scope.servicetypeandname = [ { "id":0, "type":"", "list":"" }, { "id":1, "type":"in-person", "list":["adl functional assessment", "community functional assessment", "future care cost analysis"] }, { "id":2, "type":"paper review", "list":["ot - in home assessment - abi", "ot - in home assessment attendant care form 1", "ot - occupational therapy assessment"] }, { "id":3, "type":"administration", "list":["situational assessment", "situational assessment (ot) - day 1", "situational assessment (ot...

android - Getting GPS co-ordinates via SMS and show on google map -

i trying show gps co-ordinates on google map. getting gps co-ordinates via sms. building , app generation done correctly after launching app on real device(android kitkat), google map don't show , once receive gps co-ordinates via sms app crashes displaying "unfortunately map has stopped".here code: import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.os.build; import android.support.v4.app.fragmentactivity; import android.os.bundle; import android.telephony.smsmanager; import android.widget.toast; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.supportmapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; public class mapsactivity extends fragmentactivity implements onmapreadycallback { s...

Most efficient way to convert datetime string (Jul 25, 2016 11:51:32 PM) into another string (YYYYMMDD) in python -

i have string representing datetime such : "jul 19, 2016 4:45:57 pm" i convert following string: "20160725" what efficient way in python? thanks :) note : need in order input date csv file later on, used show line chart. you can use strptime , strftime methods of datetime module. following want: from datetime import datetime dt s = "july 25, 2016 - 11:51:32 pm" old_format = '%b %d, %y - %h:%m:%s %p' new_format = '%y%m%d' r = dt.strptime(s, old_format).strftime(new_format) print(r) # '20160725'

c# - MapControl map size (pixels) -

this article describes how total map size in pixels depending on actual zoom level. the formula should be: map width = map height = 256 * 2^level pixels unfortunately doesn't seem work mapcontrol universal apps. first thing is, zoomlevel property of type double not integer (as needed in sample in article). whole number zoomlevel of i.e. 4.0 (int --> 4) formula doesn't work. now, tried map size in pixel of mapcontrol.getoffsetfromlocation method: private double getmapsize() { point pw, pe; mymap.getoffsetfromlocation(new geopoint(new basicgeoposition() { longitude = -90, latitude = 0 }), out pw); mymap.getoffsetfromlocation(new geopoint(new basicgeoposition() { longitude = 90, latitude = 0 }), out pe); return (pe.x - pw.x) * 2; } this works discrepancy of pixels, issue not important. i on surface pro 3 following results (zoomlevel 4.0): surface screen (scale 1.5): 3654px surface ...

Ordering properties in MS SQL Server - including flats -

i have been given cag , i'm trying sort address postcode , building number. problem face building number not integer, it's nvarchar- because of flat properties. you can see 79b appears after 143: 131 133a 133b 135 137 139 141 143 79b <-- 87 89 91 i have found similar question: sql-for-ordering-by-number-1-2-3-4-etc-instead-of-1-10-11-12 and tried this sql += "order buildno * 1 asc "; but predictably conversion error conversion failed when converting nvarchar value '133a' data type int. is possible order type of nvarchar in sql? thanks update i know have working, @paya select * [" + tblname + "] postcode + @postcode + '%' order cast(left([buildno], case when patindex(n'%[^0-9]%', [buildno]) < 1 len([buildno]) else patindex(n'%[^0-9]%', [buildno]) - 1 end) int), right([buildno], len([buildno]) - patindex(n'%[^0-9]%', [buildno]) + 1) returns correct order: 79b 87 89 91 133b ...

css - How to remove the border-bottom from bootstrap navbar -

Image
i realize question has answers have worked try may, cannot remove annoying border. i have tried following css: .nav-container{ border-width:0; box-shadow:none; background-color: aliceblue; } .navbar { background-color: #99ccff; border: 0; } although background-color set, border remains. here site . index.html: html, body { background-color: aliceblue; } .nav-container { border-width: 0; box-shadow: none; background-color: aliceblue; } .navbar { background-color: #99ccff; border: 0; } <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap-theme.css"> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4...

java - How would I avoid using Thread.sleep()? -

i have below snippet of code, designed check if message sent phone number: public static boolean checkmessages(long sendtime, string phone) { boolean gotmessage = false; while (!gotmessage) { try { thread.sleep(5000); } catch (interruptedexception ex) { thread.currentthread().interrupt(); } gotmessage = messagehandler.getresponse(sendtime, phone); } return gotmessage; } this code called through completablefuture , can run in parallel check. if neither check satisfied within amount of time, both expire. now, according ide , site, using thread.sleep() bad number of reasons, i'd remove code somehow. is there way such method ever return true, is? messagehandler.getresponse() handler wrote check if received text message containing specific (hardcoded) string of text specific phone number. block execution until finishes checking, api i'm using has aggressive rate limits. api offers no callback...

javascript - PubNub webrtc only working on local network -

Image
ive asked question before without luck.. im having problems following tutorial https://www.pubnub.com/blog/2014-10-21-building-a-webrtc-video-and-voice-chat-application/ . ive written code , works flawlessly on local network, when try connect remote client(i.e. not on same network) code doesnt work anymore. shows black screen video client should be. phone.receive(function(session){ session.connected(function(session){ $("#vid-box").append(session.video); //outputs black screen }); session.ended(function(session) {alert("call ended: "+session.number}); }); ive contacted pubnub unable help. has ideas? webrtc double nat oh no! ⚠️ turn server not provided ⚠️ make sure not on nat network forwarding. otherwise you'll need turn servers (not provided). turn servers broker network traffic , allow constrained network video conversations. mobile providers basic open routing (non-nat). corporate firewalls have @ least 1 n...

database - Should connection pool size be same as max_connections? -

i wondering if in read world scenarios, make sense have connection pool size != max_connections ? the connection pool size size of available connections whereas max connections maximum of connections. thoroughly, makes sense when max connections bigger connection pool size . standard case. for example if have non regular peak in application , need more connections regular. these connections have initial overhead creation not strain system after not needed anymore. generally, these settings decision how many resources should occupied permanently therefor available , limit of occupied resources. what makes no sense have bigger connection pool max connections .

objective c - Update AFNetworking from version 1.2.1 to 3.1.0 -

iam update our post project in objective c meet new apple requirement support ipv6 only. afnetworking libray 1.2.1. doubt problem. want update latest version support ipv6 when running pod install error [!] unable satisfy following requirements: afnetworking (~> 3.1.0) required podfile afnetworking (= 3.1.0) required podfile.lock afnetworking (~> 1.2.1) required afrapturexmlrequestoperation (1.0.2) here complete pod file platform :ios, '7.0' def shared_pods pod 'rapturexml' pod 'realm' end def ios_pods pod 'afrapturexmlrequestoperation' pod 'googleanalytics-ios-sdk', '~> 3.0.9' pod 'kgmodal', '~> 0.0.1' pod 'magicalrecord' pod 'mhnatgeoviewcontrollertransition', '~> 1.0' pod 'svprogresshud', '~> 1.0' pod 'ualogger', '~> 0.2.3' pod 'reachability', '~> 3.1.1' pod ...

ios - AVPlayer layer showing blank screen when application running or idle for 15 minutes -

i create custom video player using avplayer() , avplayerlayer() classes. code working fine application fresh start goes wrong , showing blank screen when application running or idle more 15 minutes. when occurrences issue classes of application having avplayerlayer showing blank screen. don't know why happens. avplayer() , avplayerlayer() instances initialized below. override func viewdidload() { super.viewdidload() // additional setup after loading view. dispatch_async(dispatch_get_main_queue(), { let playeritem = avplayeritem(url: self.itemurl) self.avplayer = avplayer(playeritem: playeritem) nsnotificationcenter.defaultcenter().addobserver(self, selector: #selector(videopreviewview.restartvideofrombeginning), name: avplayeritemdidplaytoendtimenotification, object: self.avplayer.currentitem) self.avplayerlayer = avplayerlayer(player: self.avplayer) ...

statistics - Running many multiple OLS regressions at once in R -

i want run time series regressions (fama-french 3 factor new factor). have following tables. table01 date port_01 port_02 --------- port_18 01/1965 0.85 0.97 1.86 02/1965 8.96 7.2 0.98 03/1965 8.98 7.9 8.86 table 02 date market smb hml wxo 01/1965 0.85 0.97 0.86 0.87 02/1965 8.96 7.2 0.98 0.79 03/1965 8.98 7.9 8.86 0.86 i have run 18 regressions , store intercepts in vector. this port_1=inter(1)+beta1(market)+beta2(smb)+beta3(hml)+beta3(wxo)+e port_2=inter(2)+beta1(market)+beta2(smb)+beta3(hml)+beta3(wxo)+e port_18=inter(18)+beta1(market)+beta2(smb)+beta3(hml)+beta3(wxo)+e i want these 18 intercepts stored in vector. can individually. if there way coding me lot of time. consider vapply() , variant of lapply() allows specification of output here being atomic numeric vector (length of...

machine learning - Tensorflow How to convert words(Strings) from a csv file to proper vectors -

hi im trying make small classifier in tensorflow. want read data csv file , use training phase, problem content of file looks this: object,categorie blue balon,toy white plastic ship,toy big book,other wild cat,animal wet dolphin,animal ... so want read sentences , convert them vector use in tensorflow model. information readed numerical data no idea how use data this. the turorials oficial site use numeric data, best option far has been use dictionary think there should exist better option. another option make own method imprecise. have ideas how can that? alternative mi method or how can process words in tensorflow? sorry if english not good. edit try convert sentences multidimensional arrays results not good, estimate poor results due statements can short , others long, affects final free space on each array , free space affects results probabilistic model. recommendation? luckily, solution pretty simple using pandas module! first, let's cre...

ios - How to change ImageView dinamically in UiTableViewCell? -

Image
i'm trying create screen android screen below in ios my problem, in ios circles. in ios, use imageview circles 2 png files: red_circle , green_circle. need use red circle positive values , green circle negative values, don't know how check condition in code. can me? i'm using xamarin.ios mvvmcross. this uiviewcontroller: public partial class myprojectsview : mvxviewcontroller<myprojectsviewmodel> { public myprojectsview() : base("myprojectsview", null) { } public override void didreceivememorywarning() { base.didreceivememorywarning(); // release cached data, images, etc aren't in use. } public async override void viewdidload() { base.viewdidload(); if (respondstoselector(new selector("edgesforextendedlayout"))) { edgesforextendedlayout = uirectedge.none; } var source = new mvxsimpletableviewsource(tblprojects, myprojectsitem.key,...

javascript - How do I pass arguments to a self-executing module.exported anonymous node function? -

i'm trying call self-executing anonymous function exported module.exports parameters object nodejs file requiring file anonymous function , passing parameters object this: filethatcallstheanonymousselfexecutingfunction: ` var parameters = { filename: "usernamesandqueues", headers: ["username", "password", "queue"], columns: ["ascii", "ascii", "ascii"], wordlength: 25, count: 100 }; var generatedata = require("../scripts/generatedata.js")(parameters); generatedata.js: // if function not call in file, can pass // arguments normally, , prints out expected options. module.exports = (function (options) { console.log("hello %s", json.stringify(options)); options = options || { "headers": ["username", "password", "queuename"], "columns": ["asci...

sapui5 - intellisense for openui project in visual studio code 1.3 -

i have openui project setup in visual studio code 1.2/1.3 , required libraries (openui runtime files) inside /resources directory , in .js format. not getting intellisense these libraries. have setup jsconfig.json follows. can me on how intellisense same. jsconfig.json: { "compileroptions": { "target": "es6" }, "files": [ "/resources/sap/m/*", "resources/sap/ui/*" ] } in example worked added "@types/openui5": "^1.40.1" dev dependency package.json. vscode auto detects when installed via npm or yarn , provides auto completion. i'm using vscode 1.17 btw. example: vscode ui5 auto completion example

hadoop - Sqoop export to SQL Server: schemas? -

i export data in hdfs sql server table in schema my_schema . i tried --schema import command: sqoop export \ --libjars /opt/mapr/sqoop/sqoop-1.4.6/lib/sqljdbc4.jar \ --connect "jdbc:sqlserver://my-server-dns;database=my_db;" \ --schema "myschema" \ --table "my_table" \ --export-dir /path/to/my/hdfs/dir error tool.basesqooptool: unrecognized argument: --schema and --table "schema.table" sqoop export \ --libjars /opt/mapr/sqoop/sqoop-1.4.6/lib/sqljdbc4.jar \ --connect "jdbc:sqlserver://my-server-dns;database=my_db;" \ --table "my_schema.my_table" \ --export-dir /path/to/my/hdfs/dir info manager.sqlmanager: executing sql statement: select t.* [my_schema.my_table] t 1=0 error manager.sqlmanager: error executing statement: com.microsoft.sqlserver.jdbc.sqlserverexception: invalid object name 'my_schema.my_table'. is there way sqoop? or technology? edit: sqoop export \ --libjars /opt/mapr/sqoop/sqoop-...