Posts

Wordpress admin menu not showing -

i'm building first worpess plugin. 'hammu dating' not showing in 'settings' panel in wp-admin. plugin activated in 'plugin' panel. followed instructions here . add_action( 'admin_menu', 'hammenu' ); function hammenu() { add_options_page( 'hammu dating opties', 'hammu dating opties', 'manage-options', 'hd_menu_1', 'hammu_options' ); } function hammu_options() { if ( !current_user_can( 'manage_options' ) ) { wp_die( __( 'no rights' ) ); } echo '<div class="wrap">'; echo '<p>nothing interesting here, yet</p>'; echo '</div>'; } note: part of plugin code the add_options_page(); function carries wrong capability slug: manage-options use manage_options instead. hope helps!

Knowing a google+ profile id, get number of circles for a user using the g+ API -

i tried searching google , stackoverflow, didn't found such way!! is there something, means in google+ api using can number of circles (public information) particular profile, have g+ id ? i went through that, found was, 1 can public information profile, when user has authenticated app. although in graph-api fb, afair can such public information (about posts, pages) without asking permission. i've updated question, if guys still think doesn't conform stackoverflow community, leave me comment , i'll delete it, instead of giving negative votes. (friendly request) [edit] the idea not number of circles particular user, number of circles in user. for e.g. https://plus.google.com/u/0/117907144223534027934 - in 353 circles https://plus.google.com/u/0/118337805761123404690 - in 15 circles the number of circles person has not public information. google+ not expose user's circle structure in way. however, if has been shared publicly, can retrieve ...

ClassNotFoundException: com.google.android.gms.maps.MapFragment with AndroidStudio -

i'm trying use google maps v2 on android app. i'm using android studio; followed steps indicated here: https://developers.google.com/maps/documentation/android/start#overview in androidmanifest.xml i've: <uses-sdk android:minsdkversion="12" android:targetsdkversion="16" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <!-- following 2 permissions not required use google maps android api v2, recommended. --> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-f...

Python syntax: mutating/reducing a defaultdict? -

i wasn't sure term is, have word_set in form of defaultdict [(word, value), ...] came function parsed raw data. i have other functions: reduceval(word_set, min_val) , reduceword(word_set, *args) , etc removes pairs that: have value less min_val, have (word) in [args], respectively. pretty follow same structure, e.g. def reduceval(word_set, value): "returns word_set (k, v) pairs v > value)" rtn_set = defaultdict() (k, v) in word_set.items(): if v > value: rtn_set.update({k:v}) return rtn_set i wondering if there more concise, or pythonic, way of expressing this, without building new rtn_set or maybe defining entire function if learn use dict comprehensions don't need have separate functions of these different filters. instance, reduceval , reduceword replaced with: # python 2.7+ {w: v w, v in word_set.items() if v > value} {w: v w, v in word_set.items() if w in args} # python 2.6 , earlier dict((w...

ios - UIImagePickerController is crashing on iOS5 but working fine on iOS6+ -

my following code working fine on ios6+ crashing on ios5 every 3rd time , yes working fine 2 time , crashing on 3rd. not doing fancy tapping same button again , again. button call method contains following line of code. self.imagepopover = nil; uiimagepickercontroller* imagepicker = [[uiimagepickercontroller alloc] init]; imagepicker.delegate = self; imagepicker.sourcetype = uiimagepickercontrollersourcetypesavedphotosalbum; uipopovercontroller *imagepop = [[uipopovercontroller alloc] initwithcontentviewcontroller:imagepicker]; [imagepop presentpopoverfromrect:self.profileimagebutton.frame inview:self.profileimagebutton permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; self.imagepopover = imagepop; and , in - (void)imagepickercontrollerdidcancel:(uiimagepickercontroller *)picker { picker.delegate = nil; [self.imagepopover dismisspopoveranimated:yes]; } and following says in consol crash *** -[pluisavedphotosalbumviewcontroller hash]: message sen...

javascript - How to make a form-filling google chrome extension -

i wondering if provide me links tutorials or explain (with example code), how go making simple google chrome extension (or in programming language or browser if impossible), how make extension can visit specific site, fill login form on site, click links , same sort of thing on linked site. thanks personally, not use chrome extension, maybe perl script. there extension called www::mechanize designed kind of stuff. you can find plenty of tutorials , examples, google it.

carrierwave - How to Create One Form Only in Rails to Submit two things Simple Form Carrier Wave -

i building rails platform reddit style type of community international students in boston area. still testing reception of idea. using simple form , carrierwave. got @student = student.new instance in signup method. got @uploader = student.new.picture in signup method (using carrierwave). idea every student has picture associated him or her. got carrierwave's picture feature mounted on student model. using carrierwave_direct gem directly upload pictures s3 storage on amazon. my signup.html.erb looks <div class = "signupform"> <%= simple_form_for @student, :html => {:multipart => true} |f| %> <%= f.input :last_name, label: '姓'%> <%= f.input :first_name, label: '名' %> <%= f.input :email, label: '电子邮件' %> <%= f.input :password, label: '密码' %> <%= f.input :college, label: '大学' %> <%= f.input :budget, label: '房间租金预算 (optional)' %> ...