Posts

php - Upload image error in wordpress custom templete -

i trying code upload image in custom word-press template. working in php. when move on word-press template, shows warning , stop executing script. here code. assume table , folder created proper permission 777. <?php require('../../../wp-load.php'); require('../../../wp-config.php'); function getimageextension($imagetype) { if(empty($imagetype)) return false; switch($imagetype) { case 'image/bmp': return '.bmp'; case 'image/gif': return '.gif'; case 'image/jpeg': return '.jpg'; case 'image/png': return '.png'; default: return false; } } if (!empty($_files["uploadedimage"]["name"])) { $file_name=$_files["uploadedimage"]["name"]; $temp_name=bloginfo('template_directory').$_files["uploadedimage"]["tmp_name"]; $imgtype=$_files["uploadedimage"]["type"]; ...

android - Andriod:How to set lib path for aapt command? -

i trying compile android project using command line in windows. when use aapt generate r file, comes out error below: d:\sampleproject\myapplication>aapt package -f -m -j ./gen -s ./app/src/main/res -i "d:\programinstall\android\android sdk\platforms\android-21\android.jar" -m ./app/src/main/androidmanifest.xml .\app\src\main\res\values\styles.xml:4: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light.darkaction bar'. i've found theme.appcompact.light.darkactionbar related appcompat_v7 floder while floder under in libs floder, how can let complier know find lib need? i know late or may have found answer still posting: d:\sampleproject\myapplication>aapt package **--auto-add-overlay** -f -m -j ./gen -s ./app/src/main/res **-s "path_to_prebuilts\prebuilts\devtools\extras\android\support\v7\appcompat\res\"** -i "d:\programinstall\android\android sdk\platforms\android-21\and...

data structures - probabilistic skip list space complexity -

so have seen question probabilistic skip list space consumption: (answer) but think asker wasn't clear if wanted expected approach or worst case approach. so raise question debate again , explain why i'm confused. to clear - i'm looking space complexity of probabilistic skip list in the worst case . had in mind: on 1 hand, assume maximum levels number log(n) it's easy infer in worst case might have n nodes in each level give o(n logn). on other hand, assume there might more log(n) levels (e.g lists) , set bound n - n n => o(n^2) but! don't understand why have right limit levels, if new level depends on coin toss, let's assume in worst case infinte times heads (which means new level) , difer it's not bounded?! i'm confused. if don't set upper bound on height of skip list, there no upper-bound worst-case space usage. bound place, there's horribly unlucky , astronomically improbable execution of skiplist result in number of...

reading specific column of excel into java program -

i need read specific column of excel sheet , declare variables in java. program have done reads entire content of excel sheet. need read fixed column c. this have done: import java.io.file; import java.io.ioexception; import jxl.cell; import jxl.sheet; import jxl.workbook; import jxl.read.biff.biffexception; public class javaapplication4 { private string inputfile; string[][] data = null; public void setinputfile(string inputfile) { this.inputfile = inputfile; } public string[][] read() throws ioexception { file inputworkbook = new file(inputfile); workbook w; try { w = workbook.getworkbook(inputworkbook); // first sheet sheet sheet = w.getsheet(0); data = new string[sheet.getcolumns()][sheet.getrows()]; // loop on first 10 column , lines // system.out.println(sheet.getcolumns() + " " +sheet.getrows()); (int j = 0; j <sheet.getcolumns(); j++) { (int ...

ios - Needed help for complex core data query -

Image
i have table called userprofile mention below i need distinct location, count distinct location , count status value 0 @ distinct location user = user1. status value can between 0 t0 5(number) so output be abc 3 2 abd 1 1 where abc unique location, 3 total count abc in table , 2 total count status =0 @ location abc i can give inspiration, due assume, 'status' can 0 or 1. if that's not true, - think - have execute 2 separated fetch different predicated (one fetch count of location referring user1 , other count of status user = user1 , status = 1). nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; //create entity nsentitydescription *entity = [nsentitydescription entityforname:@"userprofile" inmanagedobjectcontext:self.managedobjectcontext]; [fetchrequest setentity:entity]; //filter user = user1 nspredicate *predicate = [nspredicate predicatewithformat:@"user == %@",user1]; [fetchrequest setpredicate:predicate]; ...

vim - Justify text in visual block -

is there way in vim justify text within visual block? p.e. partial example of file: text text |5 sm 23 | text text |1274 hc a4| text text | 33 rnd bc| text text | 28 yz 22 | text text |9808 yz 56| expected output: text text 5 sm 23 text text 1274 hc a4 text text 33 rnd bc text text 28 yz 22 text text 9808 yz 56 i enabled virtualedit: :set virtualedit=all . added column spaces (at right | in example) in order create 2 spaces after "23" , 1 space after "22". selected visual block , executed command :'<,'>ce without expected output. what describe commonly called justify (to left , right margins adding inner whitespace); whereas center adds whitespace left , right have equal amounts. there 2 plugins justifying entire lines : $vimruntime/macros/justify.vim ships vim justify plugin provides simple implementation as want applied blockwise selection , have delete blockwise selection, put them separ...

android - Gigya implementation , retype password dialog issue -

Image
i have implemented gigya in app, wherein logging gmail,facebook,twitter using gigya login apis. issue whenever logging in through gmail(which primary account on device), system's retype password dialog keeps appearing after few minutes. odd because not logging out gmail on device i 1 of engineers @ gigya , hope can out here. i'll start pointing out that, on android, gigya not ever trigger system password dialog that. method gigya uses log user not cross on system level account log in. i check password plugging in begin with. google chrome notification icon along 3 other warning icons indicates me either chrome or system trying log in , failing password. from personal experience can tell same google account, have 1 password log google services , password used syncing data , same account. @ point same password, after resetting new password, log in password reset sync password remained same before. i hope sheds light on why seeing dialog every often. best, c...