Posts

Showing posts from August, 2014

How to stop Android navigation drawer from opening automatically? -

how stop navigation drawer in android app opening automatically? it used work fine. out of sight @ first , able swiped visibility. needed title it. @ first listview. after modifying drawer xml (see below) give title above list view, began opening automatically. didn't add code my_nav_drawer.openonstartup(). <!-- navigation drawer --> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- main content view --> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/a

html - Login php code not doing anything? -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 22 answers i'm using simple text document holds password in site directory public_html/users/matt/password.txt issue i'm having code when submit button pressed nothing seems happening. i'm sure it's silly mistake, have ideas here? <?php ob_clean();session_start(); if (isset($_get['logout'])){ session_destroy(); } $username = $_post['username']; $enteredpassword = $_post['password']; if (isset($_post['submit'])){ if (is_dir("users/".$username) === true){ $myfile=fopen("users/".$username."/password.txt","r") or exit("can't open file!"); $correctpassword = fgets($myfile); fclose($myfile); echo 'u

ios - Any ideas for a sorted array that is easily indexed by key value range? -

scenaro: ios/objective-c application. have anywhere few dozen few thousand entries must collect , place in order timestamp. easy -- nsarray sorted descriptor. however, need able access array , select multiple entries time range (where start/end times may not correspond entry). , modestly performance sensitive, both setup time , access time. best can come sort array , binary search start/end points. doable , sufficiently fast. however, doesn't quite "feel" right (though can't articulate why). any other ideas? 1) sort array (optional, said needed) 2) instead of binary search, use nspredicate find entries interested in. here sample code 1 of projects have adapt own class, 1 has timestamp. // property wher store data @property nsarray *data; // custom struct hold timestamp values, min , max typedef struct cmttimestamprange { uint64 min, max; } cmttimestamprange; // return sub array objects between 2 time stamps - (nsarray *)samplesintime

r caret - LOOCV in R returns error -

in past days began getting familiar r (i come matlab , python). wanted try out caret package (pretty awesome) , keep getting following error message when try train loocv error in `[.data.frame`(tuneacc, , params, drop = false) : undefined columns selected now, @ beginning thought "ok, i'm doing wrong here". used code http://machinelearningmastery.com/ : library(caret) # load iris dataset data(iris) # define training control train_control <- traincontrol(method="loocv") # train model model <- train(species~., data=iris, trcontrol=train_control, method="nb") # summarize results print(model) which returns same error. full code can found @ following address http://machinelearningmastery.com/how-to-estimate-model-accuracy-in-r-using-the-caret-package/ . did mess installation of r? doing wrong? it bug in print.train function. see issue 435 on github. should fixed next update of caret (version 6.0-70 or higher). btw there no

Python Regex Date -

i'm trying create regex looks dates in format mm-dd-yyyy, , came far: dateregex = re.compile(r''' (0[1-9]|1[0-2]) # month - (10|20|[0-2][1-9]|3[01]) # day: not [0-2][0-9]|3[01] avoid 00 matching - ((198[0-9]|20(0[0-9]|1[0-6])''' # year: matches 1980 - 2016 , re.verbose) is there easier way allows me create range of numbers? , wanted create 1 allows legal dates (for example, june shouldn't have 31 days), easiest way match months different days, like: ((01|03|05|07|08|10|12)-(31 day regex pattern)-(year regex) # 31-day months | (04|06|09|11)-(30 day regex pattern)-(year regex) # 30-day months | 02-(regex depending on leap year)) # 28 or 29 days not sure how february besides putting leaps years , 29 days together, , remaining years 28 days. i agree jonrsharpe way combine regex dateti

javascript - CSS transition of a div does not animate -

when click div, want second div expand/collapse. done using js, html, , css. want css transition animate. right jumping expansion , either scroll (edge) or jump after wait (chrome, opera, firefox). i've tried set height 1px instead of 0px, doesn't change anything. function growdiv(id) { var ele = document.getelementbyid(id); if (ele.style.height == '100%') { ele.style.height = '0px'; } else { ele.style.height = '100%'; } } .main { font-weight: 700; overflow: hidden; cursor: pointer; } .secondary { -webkit-transition: height .5s ease; -moz-transition: height .5s ease; -ms-transition: height .5s ease; -o-transition: height .5s ease; transition: height .5s ease; overflow: hidden; padding-left: 20px; height: 0px; cursor: pointer; } <div class="main" onclick="growdiv('expandable')"> expand </div> <div class="secondary" id=&

linux - Why clearing entropy count requires root privileges? -

in order clear entropy count when using linux's /dev/random through system call ioctl (rndclearpool), caller must have root privilege (according this: http://lxr.free-electrons.com/source/drivers/char/random.c ). why necessary prevent user space applications being able clear entropy count? clearing entropy count can cause significant reductions in performance affect processes run users of system.

c++ - Swapping a stringstream for cout -

with glibc's stdio, can swap memstream stdout, thereby capturing output of piece of code compiled output stdout: #include <stdio.h> void swapfiles(file* f0, file* f1){ file tmp; tmp = *f0; *f0 = *f1; *f1 = tmp; } void hw_c(){ puts("hello c world"); } int c_capt(){ file* my_memstream; char* buf = null; size_t bufsiz = 0; if( (my_memstream = open_memstream(&buf, &bufsiz)) == null) return 1; file * oldstdout = stdout; swapfiles(stdout, my_memstream); hw_c(); swapfiles(stdout, my_memstream); fclose(my_memstream); printf("captured: %s\n", buf); } i'm curious if same possible iostreams . naive attempt won't compile: #include <iostream> #include <string> #include <sstream> void hw_cc(){ std::cout<<"hello c++ world\n"; } int cc_capt(){ using namespace std; stringstream ss; string capt; //std::swap(ss,cout); //<- compiler doesn't hw_cc(); //std::swap(ss,cou

javascript - Duplicate array items using recursion instead of for loop -

//this function duplicates array elements(arr) , add them newarr //and returns newarr , works using loop , want make //version of function using recursion instead of loop function dubarr(arr){ newarr=[]; for(var i=0 ; i<arr.length ; i++){ newarr.push(2*arr[i]); } return newarr; } // code uses recursion function dubarr(arr){ newarr=[]; if(arr.length===0){ return newarr; } newarr.push(2*arr[0]); arr.shift(); dubarr(arr); return newarr; } here recursive version of function : function dubarr(arr, index, newarr){ if (!newarr) newarr = new array(); if (index < arr.length) { newarr.push(2*arr[index]); index++; return dubarr(arr, index, newarr); } return newarr; } var tab = [12, 2, 36, 14]; var newtab = dubarr(tab, 0); console.log(newtab);

node.js - Why is mongoosastic populate / elastic search not populating one of my references? I'm getting an empty object -

i have 2 models i'm attempting reference. style , brand. brand populates needed object, style empty. i've tried clearing cache / deleting indexes. , without include_in_parent , type: 'nested'. i feel may have specified es_type, etc.. not sure. product schema: var mongoose = require('mongoose'); var schema = mongoose.schema; var style = require('./style'); var brand = require('./brand'); var mongoosastic = require('mongoosastic'); var productschema = new mongoose.schema({ name: { type: string, lowercase: true , required: true}, brand: {type: mongoose.schema.types.objectid, ref: 'brand', es_type:'nested', es_include_in_parent:true}, style: {type: mongoose.schema.types.objectid, ref: 'style', es_schema: style, es_type:'nested', es_include_in_parent: true}, year: { type: number } }); productschema.plu

angularjs - ng-change trigger event when ng pattern condition changes from true to false -

problem: ng-change getting triggered when pattern changing true false. example: pattern valid value minimum 10 digits when digits count changing 9 10 ,event fired correct. if 1 digit deleted again event fired. should not happen or might missing here. my code like: input id="id1" class="ng-pristine ng-invalid ng-invalid-required ng-valid-pattern" type="text" ng-focus="" ng-pattern="/^[0-9]{10,19}$/" required="" ng-change="event1(method1.id1)" ng-model="method1.id1" placeholder="1234123412341*" ng-class="{'active': !method21.id1.$pristine}" name="id1" does 1 have solution this? try this, problem ng-change function triger before value change var jimapp = angular.module("mainapp", []); jimapp.controller('mainctrl', function($scope){ $scope.method1 = {}; $scope.event1 = function(id){ if(angular.is

indexing - excel - dynamic summing of columns -

Image
i able pair index-match (or vlookup) functionality of sumifs. in example linked below, data table if matches name reference (for row) , sum expenses individual given month. output 1): allows me dynamic name reference , month reference not sum rather stops on first "jan" sees. output 2: sums months not dynamic when change name. has run before? not find answers online. proof of concept in cell c9 use following: =sumproduct(($b$3:$b$5=$b8)*($c$2:$h$2=c$7)*$c$3:$h$5)

matlab - why the numerical result is different (RK45)? -

Image
this test equation differential using runge-kutta45: f(x,y)= (-5*x - y/5)^1/8 + 10 why numerical result different? used : function rk_jl() f(x,y)= (-5*x - y/5)^1/8 + 10 tspan = 0:0.001:n y0 = [0.0, 1.0] return ode.ode45(f, y0,tspan); end and function [x1,y1] = rk_m() f = @(x,y) (-5*x - y/5)^1/8 + 10; tspan = 0:0.001:n; y0 = 1 [x1,y1]= ode45(f,tspan,1); end the programs have different default settings, such default tolerances , stepping/rejection behavior. such, shouldn't expect them "exactly" same. to add this, ode.jl doesn't use stepsize stabilization (which optimized library differentialequations.jl , odeinterface.jl , or matlab's library uses), expect have vastly worse stepsize choices (according hairer's book, 2x-4x less efficient stepping behavior). if use same tolerances, ode.jl produce different results since it's not using standard optimized algorithm.

Compiling CUDA PTX to binary for an older target -

from question known ptx portable across various architectures. believe allows migration going forward ex: sm_20 sm_30. have special use case go sm_20 sm_10. possible generate binary such cubin sm_10 target ptx compiled sm_20 target. ptx forward compatible when compiled against specific architecture (i.e., using sm_* flag), not backward compatible. 1 way on specifying particular virtual architecture , generating binary images real architectures want target. example, nvcc -arch=compute_20 -code=sm_20,sm_30,sm_35 generates ptx compute 2.0 virtual architecture , generates binary images 2.0, 3.0, , 3.5 devices. please note compute 1.0 deprecated of cuda 7.0. known fat binary approach. see code generation options difference between real , virtual architectures. edit : actually, it's bit redundant specify -arch=compute_35 , -code=sm_35 because jit compiler have intervened , built you. long don't mind little fat in fat binary, suppose doesn't matter mu

javascript - How to align content on a banner if there's a HTML5 video involved -

i may need re-title post. have html5 video i'm having hard time styling way want to. html <header> <div class="video-holder full-img"> <video autoplay loop muted> <source src="<?php bloginfo('template_url'); ?>/img/syau.webm" type="video/webm"> <source src="<?php bloginfo('template_url'); ?>/img/syau.mp4" type="video/mp4"> </video> </div> <div class="container" style="height:100%"> <div class="row" style="height:100%"> <div class="banner-text col-sm-12 col-md-6 col-md-offset-2"> <h1>step<br>your<br><span id="type-selector" class="typed-element"></span><br>up</h1> </div>

ios - How can I make a swift multiple questions quiz so the questions do not repeat themselves? -

i not have experience programing. have done looking @ youtube videos couple of months. appreciate if can please me. when run code simulator repeats questions several time before next new question presented. run presents 1 question without repeating same question on , over. below please find code. import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var questionlabel: uilabel! @iboutlet weak var button1: uibutton! @iboutlet weak var button2: uibutton! @iboutlet weak var button3: uibutton! @iboutlet weak var button4: uibutton! @iboutlet weak var next: uibutton! @iboutlet weak var labelend: uilabel! var correctanswer = string() override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. hide() ramdomquestions() } func ramdomquestions () { var randomnumber = arc4random() % 4 randomnumber += 1 switch (randomnu

c# - concatenate data bind in dropdown using linq -

i have table select data , there 3 columns merge or concatenate these columns.. query , data select (region+' '+cast(startdate+''+enddate varchar)) data,id tblregion_uni data data id uk mar 31 2128 11:59pm 1 mar 31 2128 11:59pm 2 paris mar 31 2128 11:59pm 3 now try bind data in dropdown using linq want above sql query in linq .. below linq query simple select data want concatenate in linq private list<tblregion_uni> getregion() { using(trackdataentities1 tee=new trackdataentities1()) { return (from ta in tee.tblreg select new { ta.region, ta.startdate, ta.enddate }).tolist(); } } protected void page_load(object sender, eventargs e) { if(!page.ispostback) { regiondrop.datasource = getregion(); regiondrop.datatextfield = "data"; regiondrop.datavaluefield = "id"; reg

java - HIbernate JPA caused by incompatible with javassist.util.proxy.Proxy -

hibernate jpa caused incompatible javassist.util.proxy.proxy . code public class entitya { @id private string id; @onetoone(fetch = fetchtype.lazy) @joincolumn(name = "entityb_id") private entityb entityb; @manytoone(fetch = fetchtype.lazy) @joincolumn(name = "entityc_id") private entityc entityc; } string sql = "select o entitya o " + "left outer join o.entityb o1 "; final typedquery<entitya> query = getem().createquery(sql, entitya.class); final list<entitya> result = query.getresultlist(); questions when ran above query below exception, did have idea? my query didn't involved "entityc", why exception throw regarding entityc @ getresultlist() method? exception caused by: java.lang.classcastexception: xxx.xx.xx.entityc_$$_javassist_105 incompatible javassist.util.proxy.proxy @ org.hibernate.proxy.pojo.javassist.javassistlazyinitializer.getproxy(javassistlazy

How to set many "not contains" condition on Firebase RemoteConfig? -

Image
i try set "app version" condition not contains "2.0.2" , "2.1.0". however, can not set multiple "app version" while click "and" button. next, try use "regular expression" , fail. however, fail. try set "all contains", still fail. how can condition not contains 2 strings? just enter both strings separated comma: "app version not contain 2.0.2,2.1.0" (documented in https://firebase.google.com/docs/remote-config/parameters )

routes - Rails change root-path -

i have thingspeak server working on http://portail.lyc-st-exupery-bellegarde.ac-lyon.fr/srv3 , witch behind proxy server. how can tell rails add "srv3/" url ? /srv3 should root. thanks put routes in scope block , this: rails.application.routes.draw scope "/srv3" root to: "root#index" ... end end then routes have /srv3 prefix: $ rake routes prefix verb uri pattern controller#action root /srv3(.:format) root#index ... see the docs more info.

SQL - Get data for yesterday and day before -

i running query: select member, customerinfo.customerid -- ...other irrelevant columns... customerinfo, addressinfo customerinfo.customerid = addressinfo.customerid , member = (date(getdate()-1)) , addressinfo.addresstype = 's' i giving me data if member = yesterday. my question is, how structure query give me data if member = last 2 days (yesterday , day before)? member between (getdate() -2) , (getdate() -1) in sql server can try: member between dateadd(day, -2, getdate()) , dateadd(day, -1, getdate())

json - Golang check if interface type is nil -

when unmarshaling string of json using golang's json.unmarshal() function, unmarshal string map[string]interface{}. i not sure weather there more optimal way of decoding json. to point, json unmarshal's type nil, not string (or int etc.). throws panic saying "interface conversion: interface nil, not int". how can avoid panic or check if interface's type nil or not? here example of problem in action: https://play.golang.org/p/0atzxbbdos check key exist instead of letting panic. func keyexists(decoded map[string]interface{}, key string) { val, ok := decoded[key] return ok && val != nil } func main() { jsontext := `{ "name": "jimmy", "age": 23 }` var decoded map[string]interface{} if err := json.unmarshal([]byte(jsontext), &decoded); err != nil { fmt.println(err) os.exit(0) } if keyexists(decoded, "name") { fmt.println(decod

javascript - Is there a way to do dynamic key/value parameters in url route in express.js -

i looking way (and hoping there 1 available already) read dynamically routed parameters in nodejs. (like way zend framework 1 default router did). so want have this: app.get('/resource/:key/:value/:anotherkey/:differentvalue', function(req, res) { return res.send('this print :differentvalue: '+req.params.anotherkey); }); but without having define different keys , values i use querystring particular usecase. so given url this: myapp.com/search/?filter_one=param&filter_two=param2 and use url module in node. var url = require('url'); var parsed_url = url.parse(request.url, true); var querystring_object = parsed_url.query //{filter_one: "param", filter_two: "param2"} //and object quite easier hand off elastic search

How can Send Notification to IOS in Tamil Language Using C# -

i'm developing application using c# have send notification both ios , android.in android notification send in tamil. send notification ios in english working good. but, how can send other languages hindi, french, german , on. below code used: string devicetocken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";// iphone device token int port = 2195; string hostname = "gateway.sandbox.push.apple.com"; string certificatepath = @"certificates.pfx"; string certificatepassword = ""; x509certificate2 clientcertificate = new x509certificate2(certificatepath, certificatepassword, x509keystorageflags.machinekeyset); x509certificate2collection certificatescollection = new x509certificate2collection(clientcertificate); tcpclient client = new tcpclient(hostname, port); sslstream sslstream = new sslstream(client.getstream(),false,new remotecertificatevalidationcallback(validateservercertificate),null); try { sslstream.authenticateasclient(ho

google spreadsheet - comparing 65 possible scores with 4225 possible combinations to come up with 4 possible answers -

d28 = blue team score f28 = red team score a score has 65 possible outcomes (0-16 in .25 increments) so: 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.25, 5.5, 5.75, 6, 6.25, 6.5, 6.75, 7, 7.25, 7.5, 7.75, 8, 8.25, 8.5, 8.75, 9, 9.25, 9.5, 9.75, 10, 10.25, 10.5, 10.75, 11, 11.25, 11.5, 11.75, 12, 12.25, 12.5, 12.75, 13, 13.25, 13.5, 13.75, 14, 14.25, 14.5, 14.75, 15, 15.25, 15.5, 15.75 , 16 what compare every possible combination between blue team score , red team score , , based on combination, formula display 4 possible placeholder texts: "0-2", "2-0", "2-1" , "1-2" 0 being lowest score , 16 being highest score out of 65 possible scores. place holder texts show based on this: if blue team score between 16 - 12 , red team between 4 - 0, answer "2 - 0&qu

Separating elements of a Pandas DataFrame in Python -

i have pandas dataframe looks following: time measurement 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 0 2 6 1 3 7 2 4 8 3 5 9 4 6 10 0 3 11 1 4 12 2 5 13 3 6 14 4 7 15 0 1 16 1 2 17 2 3 18 3 4 19 4 5 20 0 2 21 1 3 22 2 4 23 3 5 24 4 6 25 0 3 26 1 4 27 2 5 28 3 6 29 4 7 which can generated following code: import pandas time=[0,1,2,3,4] repeat_1_conc_1=[1,2,3,4,5] repeat_1_conc_2=[2,3,4,5,6] repeat_1_conc_3=[3,4,5,6,7] d1=pandas.dataframe([time,repeat_1_conc_1]).transpose() d2=pandas.dataframe([time,repeat_1_conc_2]).transpose() d3=p

javascript - Jquery check checkbox value then set checked -

i had checkbox <input type="checkbox" name="paid" id="paid-change"> which have value = "1" or "0".i want check if checkbox value = "1" checkbox add checked status on it. tks help! try this. code using pure javascript var chkbox = document.getelementbyid("paid-change"); if (chkbox.value == 0) chkbox.checked = false; else if (chkbox.value == 1) chkbox.checked = true;

debugging - Android Studio Debugger : Stop when an variable gets a specific value -

Image
scenario : have variable , want find out , when variable gets example value 4. when happens debugger should stop @ line. is possible android studio ? if understand correctly you're wanting set called "watchpoint" in android studio, , here's link intellij documentation discusses them: https://www.jetbrains.com/help/idea/2016.3/creating-field-watchpoints.html in particular, want set break-point on member variable itself, right-click break-point , set watch on "field modification" , set condition when variable becomes specific value you're trying find. so, in simple bit of code: public class mainactivity extends appcompatactivity { int mwatchme = -10; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); (int i=0 ; i<20 ; i++) { mwatchme++; } } } you set break-point on line: i

pandas - Looping through a python pivot table -

i have pivot table have created (pivottable) using: pivottable= daydata.pivot_table(index=['sector'], aggfunc='count') which has produced following pivot table: sector id broad_sector communications 2 2 utilities 3 3 media 3 3 could let me know if there way loop through pivot table assigning index value , sector total respective variables sectorname , sectorcount i have tried: i=0 while <= lenpivottable: sectorname = sectorpivot.index.get_level_values(0) sectornumber = sectorpivot.index.get_level_values(1) i=i+1 to return first loop iteration: sectorname = 'communications' sectorcount = 2 for second loop iteration: sectorname = 'utilities' sectorcount = 3 for third loop iteration: sectorname = 'media' sectorcount = 3 but can't work. assistance appreciated well, don't understand why need (be

ios - How to Set InputView with ViewController -

self.view = [[[nsbundle mainbundle] loadnibnamed:@"keyboardview" owner:self options:nil] objectatindex:0]; self.inputview = (uiinputview*)self.view; above code setting nib file inputview, working, below code not working ... newviewcontroller * myviewcontroller = [[uistoryboard storyboardwithname:@"keyboard" bundle:nil] instantiateviewcontrollerwithidentifier:@"newview"]; self.view = myviewcontroller.view; self.inputview = (uiinputview*)self.view; please check storyboard name. it's "keyboard" or different. have write bundle nil should [nsbundle mainbundle] . newviewcontroller * myviewcontroller = [[uistoryboard storyboardwithname:@"keyboard" bundle:nil] instantiateviewcontrollerwithidentifier:@"newview"]; check this: newviewcontroller *vc =[[uistoryboard storyboardwithname:@"mainstoryboard" bundle:[nsbundle mainbundle]] instantiateviewcontrollerwithidentifi

c - Problems with deallocation of double pointer and pointer -

hi have problems in code: this matrix allocation function: matrix_type** matrix_allocation(matrix* matrix, int* rows_size, int* cols_size) //this function allocates dynamically matrix , verify allocation { int i; matrix->n_rows=0; matrix->n_cols=0; matrix->pp_matrix=(matrix_type**)calloc(*rows_size,sizeof(matrix_type*)); i=0; while(i<*rows_size) { matrix->pp_matrix[i]=calloc(*cols_size,sizeof(matrix_type)); i++; } matrix->n_rows=*rows_size; matrix->n_cols=*cols_size; return matrix->pp_matrix; } this deallocation function: void matrix_deallocation(matrix* matrix) //this function deallocates matrix { int i; i=0; while(i<matrix->n_cols) { free(matrix->pp_matrix[i]); i++; } free(matrix->pp_matrix); } where matrix struct is typedef int matrix_type; typedef struct{ int n_rows; int n_cols; matrix_type** pp_matrix; }matrix; how c

how to remove tomcat port number 8080 from localhost url using java code in web aplication -

when run web aplication on server have default port http://localhost:8080/demo/ want hide or remove 8080 port number our aplication using java code http://localhost/demo/ whole application you don't have change using java code. change port "80" instead default "8080" in server.xml file in tomcat conf folder. more info: https://tomcat.apache.org/tomcat-8.0-doc/config/server.html you can use reverse proxy. if use apache: https://httpd.apache.org/docs/current/mod/mod_proxy.html

ios - Memory Leak: AVplayerViewController -

Image
i facing memory leaks when play video , return parent window. see screenshot below of readings allocations tool. every time, when pop view controller (showing video) there objects related avfoundation holding memory. interestingly responsible library of these objects avfoundation. none of increase in memory due objects created in app. highly unlikely there problem such popular framework. saw few examples of avplayerviewcontroller on web seem have same problem. does have idea what/where problem? if wants replicate can download of 2 projects given above. have make minor changes in storyboard creating root view controller navigation controller. http://www.modejong.com/blog/post13_ios8_sunspot/index.html https://github.com/coolioxlr/pageview-avplayer this how clearing memory: -(void) dealloc{ [self clearcurrentvideo]; } -(void)clearcurrentvideo { [_playeritem removeobserver:self forkeypath:@"status"]; [_currentv

Word VBA: Find and replace with ref code -

i trying find , replace brackets , text in field code http://office.microsoft.com/en-us/word-help/field-codes-ref-field-hp005186139.aspx sub replacereftag() replacementtext "<test>", "ref test.test1 " end sub private sub replacementtext(findtext string, replacetext string) selection.find.clearformatting selection.find.replacement.clearformatting selection.find .text = findtext .myrange.field = replacetext .wrap = wdfindcontinue .matchwildcards = true end selection.find.execute replace:=wdreplaceall end sub in opinion need use different kind of logic in code. main difference need find text first , select it. next step need add field in range of selection. following subroutines improved ones doing these things. hope it's looking for. (see comments inside code) sub replacereftag() replacementtext "<test>", "ref test.test1 " 'if keep .matchwildcards

html - How to get META keywords content with VBA from source code in an EXCEL file -

i have download source code of several hundred websites excel file (for example cells(1, 1) in worksheets 1) , extract content of of meta tag keywords in let's cells(1, 2). for downloading use following code in vba: dim htm object set htm = createobject("htmlfile") url = "https://www.insolvenzbekanntmachungen.de/cgi-bin/bl_aufruf.pl?phpsessid=8ecbeb942c887974468b9010531fc7ab&datei=gerichte/nw/agkoeln/16/0071_in00181_16/2016_06_10__11_53_26_anordnung_sicherungsmassnahmen.htm" createobject("msxml2.xmlhttp") .open "get", url, false .send htm.body.innerhtml = .responsetext cells(1, 1) = .responsetext end i've found following code on website but, unfortunately, i'm unable adapt solve problem: sub getdata() dim ie new internetexplorer dim str string dim wk worksheet dim webpage new htmldocument dim item htmlhtmlelement set wk = worksheets(1) str = "https://www.insolvenzbekanntmachungen.de/cgi-bin/bl_auf

xcode - Custom Unwind Segue in UINavigationController -

i have searched many posts not answer question. have uitabbarcontroller present uinavigationcontroller using custom segue. presents issue there no way unwind same way when press button. have created custom unwind segue class well, there no way @ programmatically or through storyboards create unwind action , assign custom unwind segue class in uinavigationcontroller. ?

java - have trouble with my 2d android game -

hey guys im kind of noob dont hard me. i'm working on 2d game android have trouble it. finished, want collectible coins in game, , want them spawn randomly on obstacles. finished main code of coins, hovering on obstacles , can collect them, have no idea how can let them randomly spawn: hope can me here code: coin class: enter code herepublic class coin extends gameobject{ private bitmap spritesheet; private double dya; private boolean playing; private long starttime; private animation animation = new animation(); private int num = 0; private obsticals obsticals; public coin(bitmap res, int w, int h, int numframes) { x = gamepanel.width + 20; y = gamepanel.height - gamepanel.height / 4 - 200; dy = 0; dx = +gamepanel.movespeed; height = h; width = w; bitmap[] image = new bitmap[numframes]; spritesheet = res; (int = 0; < image.length; i++) { image[i] = bitmap.createbitmap(spritesheet, i*width, 0, width, height); } a