Posts

Simple Android app Can't get a blank activity to use non AppCompat theme -

i've been going through android training tutorials , can't seem simple blank activity apply theme theme.holo.light. this i've done far: set minsdkversion 11 in gradle script , synced project. applied theme in androidmanifest.xml setting: android:theme="@android:style/theme.holo.light" tried applying @ application/activity level , creating custom theme , setting parent. when running app in emulator crashes error: java.lang.runtimeexception: unable start activity componentinfo{com.example.test.themetest3/com.example.test.themetest3.mainactivity}: java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity. according documentation default theme 11+ api levels theme.holo can't work , i'm missing something. activity insists on using appcompat themes only. need extend other class within activity? this activity code (generated creating blank activity). package com.example.test.themetest3; import android.os.b...

Error in Xcode 7: None of the input catalogs contained a matching launch image set -

Image
i have launchimage asset proper type (launch image), , has required sizes purpose of app. when building archive before submission app store, following error message: /the/path/to/media.xcassets: none of input catalogs contained matching launch image set named "launchimage". it working in xcode 6 , not working anymore in xcode 7, though have not changed anything. it appears in 'red' in build settings, if asset missing, in assets, see screenshot. when click on red name, option 'not use assets'. select image asset, open file inspector on right side, go target membership , deselect check marks , enable target app have added icons.

c++ - Mex for Opencv's groupRectangles -

i using mexopencv matlab, have noticed grouprectangles matlab wrapper there supports 3 input arguments while source has 3 different versions. i don't know c++ tried follow guidelines , written code not able compile it; gives peculiar error. i appreciate if can this, need return scores of final bounding boxes project. so ! have found similar question & answer online: in cascadedetect.cpp in opencv, there several variants of grouprectangles function: void grouprectangles(std::vector& rectlist, int groupthreshold, double eps); void grouprectangles(std::vector& rectlist, std::vector& weights, int groupthreshold, double eps); void grouprectangles(std::vector& rectlist, std::vector& rejectlevels, std::vector& levelweights, int groupthreshold, double eps); in opencv document, first variant documented clearly, second variant mentioned weights argument not explained. third isn't mentioned. we want scores of grouped rectangles, documented variant...

sublimetext3 - sublime symlink disappeared after upgrading to El Capitan -

i have upgraded os x el capitan , subl . command stopped working zsh: command not found: subl error message. i have run following command suggested in other posts: sudo ln -s /applications/sublime\ text.app/contents/sharedsupport/bin/subl /usr/local/bin/subl result: ln: /usr/local/bin/subl: file exists in ".bash_profile" ".zsh_profile" have following lines saved: export path=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$path export editor='subl -w' also tried: sudo ln -s /applications/sublime\ text.app/contents/sharedsupport/bin/subl /usr/bin/subl result: ln: /usr/bin/subl: operation not permitted update: seemed work after running following command: alias subl="'/applications/sublime text.app/contents/sharedsupport/bin/subl'" but restart terminal, subl . command stops working. update2: after pasting following line: alias subl="'/applications/sublime text.app/contents/sharedsupport/bin/subl...

flask - Dynamic routing from form data -

i new flask having issue creating dynamic url form data. value of selectfield of wtforms. code follows my form looks this from flask_wtf import form wtforms import selectfield wtforms.fields.html5 import datefield class selecteventform(form): sports = selectfield(u'select sport') start_after_date = datefield('starts after date') start_before_date = datefield('starts before date') my controller has following code @app.route('/event', methods=['get', 'post']) def event(): form = selecteventform(request.form) sports = betfair_client.call_rest_api('listeventtypes/', {"filter": {}}) form.sports.choices = [] sport in sports: key in sport: form.sports.choices.append((key, sport[key])) return render_template('events.html', form=form) @app.route('/event/<sports>', methods=['get', 'post']) def event_select(sports): #print req...

python - How to convert string series into integer -

one of columns of pandas data frame contains values such 0, 'a', 'b'. column parsed string. want convert integer 0, 1, 2. how can this? here's initial data: df = pd.dataframe({'col': [0, 'a', 'b', 'a']}) >>> df col 0 0 1 2 b 3 you can create dictionary of items you'd replace: d = {'a': 1, 'b': 2} then, apply get column, returning original value if not in dictionary: df['col'] = df.col.apply(lambda x: d.get(x, x)) >>> df df col 0 0 1 1 2 2 3 1 @edchum if of unique items contained in series in dictionary keys, .map(d) more 5 times fast. however, missing value appears nan . using lambda function get on dictionary appears have virtually identical performance. %%timeit df = pd.dataframe({'col': [0, 'a', 'b', 'a'] * 100000}) df['col'] = df.col.map(d) 10 loops, best of 3: 33.3 ms per loop >>...

R Conditional summing -

i've started adventure programming in r. need create program summing numbers divisible 3 , 5 in range of 1 1000, using '%%' operator. came idea create 2 matrices numbers 1 1000 in 1 column , remainders in second one. however, don't know how sum proper elements (kind of "sum if" function in excel). attach i've done below. in advance help! s1<-1:1000 in<-s1%%3 m1<-matrix(c(s1,in), 1000, 2, byrow=false) s2<-1:1000 in2<-s2%%5 m2<-matrix(c(s2,in2),1000,2,byrow=false) mathematically, best way find least common multiple of 2 numbers , check remainder vs that: # borrowed roland rau # http://r.789695.n4.nabble.com/greatest-common-divisor-of-two-numbers-td823047.html gcd <- function(a,b) if (b==0) else gcd(b, %% b) lcm <- function(a,b) abs(a*b)/gcd(a,b) s <- seq(1000) s[ (s %% lcm(3,5)) == 0 ] # [1] 15 30 45 60 75 90 105 120 135 150 165 180 195 210 # [15] 225 240 255 270 285 300 315 330 345 360 375 390 405 420 # [...