Posts

Showing posts from February, 2014

How to import ActionBarSherlock in android SDK version 23 -

i trying implement sherlock actionbar in android studios, new android studios not understand need put build.gradle file dependencies section in android in order imported. i using lastest version of andriod studos sdk version 23. please help. someone has advised me no longer available in andriod studios how can below then. so how can then. public class menuactivity extends sherlockactivity implements public class menuactivity extends sherlockactivity implements actionbar.onnavigationlistener, since actionbarsherlock has been deprecated, can use toolbar class appcompat-v7 library. on gradle file, add: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.1.1' } for layout, can use this: <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" app:elevation="0dp" a

angularjs - Angular within Bootstrap remote tabs -

i have basic angular page, pulls records database , displays in table via ng-repeat - working fine standalone page. i'm using bootstrap remote tabs https://github.com/thecodeassassin/bootstrap-remote-data , calling above page 1 of tabs' content. angular page loaded angular not initialising though reason. nothing binding. i've tried putting angular scripts both inside / outside of tab, , putting ngapp inside of tab (remote page) , outside of tab (parent page) , doesn't make difference. there i'm missing? i not sure trying do, think problem angular finishes loop initializing content before pages loaded inside tabs. have tried use ng-include load content of tabs dynamically. also may need call angular apply re initiate binding. another note, if trying use tabs load data asynchronously, can use regular tabs , let angular handles loading of data using ng-include.

Run a series of tasks, but depending on progress start on task x in bash (continue switch case) -

i have series of tasks run 1 after other, depending on progress, saved in variable has start @ appropriate step. for instance, have 5 tasks. task 1 supposed start, followed task 2, task 3 , on. if variable progress contains value 2, should start @ task 2, continue task 3 , on. i thought achievable switch case, like: case $progress in 1) echo "task1" $progress=2;; 2) echo "task2" $progress=3;; 3) echo "task3";; *) echo "null";; esac the problem here switch case ends, after first match. how have switch case continue after first match? to complement boolean.is.null's own helpful answer , here's overview of case -branch terminators : ;; [the option bash 3.x] exit case statement right away (from matching branch). ;& [bash 4.0+] unconditionally fall through next branch - in c switch statement's case handler without break . note unc

How to read matrix of integers from file in C? -

i writing function in c that, given dimension d of square matrix stored in filepath f , reads integers 1-dimensional array m of size d*d . a sample file sample.dat may be: 10 20 30 12 24 36 1 2 3 my function is: void readmatrix(int d, char *f, int *m) { file *fp; int = 0; fp = fopen(f, "r"); while (i<d*d) { fscanf(fp, "%d ", &m[i]); i++; printf("%d\n", m[i]); } } however when run function, outputs 0: dimension: 3 filename: sample.dat 0 0 0 0 0 0 0 0 0 what doing wrong here? many problems in little code you never check whether file did open. you never check whether fscanf() succeeded. you increment i before printf() printing next element instead of current. you never fclose() open file. correct way of maybe doing this void readmatrix(int dimension, char *path, int *data) { file *file;

php - PHP7 Code now doesn't work anymore -

this question has answer here: replace deprecated preg_replace /e preg_replace_callback [duplicate] 1 answer this code used remove bad words text entered users on forum. somehow code not correctly interpreted , remove string empty. know what's wrong. worked fine until php5.6 $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?' . '>([^><]+|(?r)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1)); that's not code can't understand procedure behind str_replace substr , 2 preg_replace. if transform code callback function or @ least working 1 make me happy. you can replace with: $message = preg_replace_callback('~(?<=>|^)[^<>]*+(?=<|$)~',

python - Unpickle namedtuple with backwards compatibility (ignoring additional attributes) -

here's scenario simulates running older version of python program against shelve database written newer version. ideally, user object still parsed , read in; favouritepet attribute ignored. understandably, throws error complaining tuple doesn't match. is there way of making scenario work namedtuples, or better switch storing dictionary or class if sort of flexibility required? import shelve collections import namedtuple shelf = shelve.open("objectshelf", flag='n') user = namedtuple("user", ("username", "password", "firstname", "surname", "favouritepet")) shelf["namedtupleandrew"] = user("andrew@example.com", "mypassword", "andrew", "smith", "cat") # redefine user simulate previous version of user object didn't record favouritepet; # using old version of program against database written new version user = namedtuple("user&q

css - HTML form input text not showing -

my page not showing input text form. whenever select text box, glows not accept text. i know there's wrong css, can't seem figure out problem. html: <div class="container" id="signin"> <h2>sign in</h2> <form method="post" action="index.html"> <!-- <input style="display:none" type="password" name="fakepasswordremembered"/> --> <input type="text" name="password" placeholder="password" > <br /> <input class="button" type="submit" name="commit" value="login" /> </form> </div> css: a { text-decoration: none; position: absolute; right: 0; text-align: right; color: #fff; } a:hover { text-decoration: underline; } .container { position: fixed; top: 50%; left: 50%; width: 55%; paddin

c - How many times will each print statement be executed? -

if following code fragment run on 4 processors, how many times each print statement executed ? prinf("print # 1\n"); #pargma omp parallel { printf("print #2\n"); #pragma omp (i = 0 ; < 40 ; i++) { printf(“print #\n); } printf(“print #4\n”); } smells homework , of course code pasted wouldn't compile, but print #1 - once print #2 & #4 - 4 times , block run once on each cpu "print #" (in for ) - 40 times , if have 40 cpus, once on each, if have 4 , 10 times on each is tricky homework?

javascript - Diff between two dates (datetime) in minutes -

this question has answer here: compare 2 dates javascript 33 answers i need check difference between 2 dates - db , actual, in minutes in js/jquery (i need run function check ajax). format of date: 19-01-2016 22:18 i need this: if ( (date_actual - date_db) < 1 minute ) { //do } how can this? edit : created this, getting same log, it's not change - http://jsbin.com/xinaki/edit?js,console edit 2 : here it's working code, but it's checking in same hour/minute, ex. 12:50:50 , 12:50:58 show log 2 seconds, need 'stay' log on 1 minute http://jsbin.com/laruro/edit?js,console assuming dates in same format, , strings, use helper function convert 1 or both of strings real date() object: var makedate = function(datestring) { var d = datestring.split(/[\s:-]+/); return new date(d[2],d[1] - 1,d[0],d[3],d[4]); } and

assembly - How do I load the Address of an array in MIPS -

.data stra: .asciiz "original array:\n" strb: .asciiz "second array:\n:" newline: .asciiz "\n" space : .asciiz " " # start of original array. original: .word 200, 270, 250, 100 .word 205, 230, 105, 235 .word 190, 95, 90, 205 .word 80, 205, 110, 215 # next statement allocates room other array. # array takes 4*16=64 bytes. # second: .space 64 .align 2 .globl main .text main: la $t0, original #load address of original array li $v0, 4 #system call code printing la $a0, stra syscall addi $t1, $zero,0 sll $t2, $t1, 2 add $t3, $t2, $t1 li $v0, 4 lw $a0, 0($t3) syscall i trying make program transposes matrix. keep getting error saying bad address read: 0x00000000. tried loading addresses of matrix , loading 0 $t1 beginning index , multiplying 4 , adding base address of array. as can see have loaded address of array , added i*4 amount sll. why getting error? system call 4 prints string . if want print array of integers you'll ha

c# - Create dynamic Linq queries for XML -

i want build query builder user has opportunity input different conditions "id > 10" "and id < 40". also user can select different xml elements wants display. example can select display id element , code element. i have 2 lists 1 filters user selects , 1 elements wants show. problem don't know how add logical operator "&&" , "||" linq clause. also not know how dynamically generate select statement include fields user selected. here have far : xdocument doc = xdocument.load(xmlfile); var query = doc.descendants("student"); // iterate through conditions , add them linq query foreach(whereconditions wcon in whereconditions) { query = query.where(x => (int)x.element(wcon.selectedfield) > int32.parse(wcon.comparisonvalue)); } foreach(string selectedcolumns in selectedfields) { xelement x; x = doc.root.element("students").element("student"); query = query.select(x

javascript - jQuery .prev() not working well -

i coding front-end of shopping website , scenario is: if have sale offer first previous price must line-through , beside price € inserted. so jquery : $(document).ready(function () { if ($('.price span.price-new').text().length != '') { this.prev('.price span.price-new').before("€").text(); this.prev("span").css({"text-decoration": "line-through"}); } }); and html: <?php foreach( $this->products() $products) { echo '<div class="price"><span class="price-old">€&nbsp;'.$products['price'].'</span>'. '<span class="price-new">'.$products['special_price'].'</span></div>'.'</div>';}?> both of them didn't work. tried $(this) didn't work , because of have many price-new class can't mentioned

java - Obtain matching contact email and phone from android phone -

i have managed extract contact details phone using contactcontract example found, noticed of people on phone has unique id key associated emails , phone numbers separately. example, alan's contact detail split following when extract out database though same person: key name email phone 20121 alan alan@gmail.com null 20133 alan null 04xxxxxxxx so how phone manage association these different keys in contact (i assume there must separate table it)? there way obtain association? because can not try match name people can have same name, have keep them separated how stored on phone contact. (or messed situation due apps able save contact related details same database on phone?) my code looks following (i forgot code from, getdetailedcontactlist function returning list of contact of above problem): public static string contact_id_uri = contactscontract.contacts._id; public static string data_contact_id_uri = contactscontract.data.contac

Reverse an input using tuples Python -

i want able write function reverse phrase such 'hello world' 'world hello'. far can to: def reverser(): print('please input phrase') inputphrase=input() if ' ' in inputphrase: after i'm assuming need slice string , slice gets stored in tuple, , @ end variables print out. it stored in list , not tuple . here's how in 2 lines: my_input = input('your phrase: ') print(*reversed(my_input.split())) # python 3 or print ' '.join(reversed(a.split())) # python 2 so function be: func = lambda x: reversed(x.split()) which return list of reversed words phrase if called follows: arg = input('enter phrase :') splitted = func(arg) print(*splitted) # or in python 2: print ' '.join(splitted)

node.js - Accessing the session on socket requests with sails.js -

when making client request using io.socket such as; io.socket.post('activity/subscribe') there no session information appended request object in sails causing authentication policies fail. this not cross-domain request , sails.sid cookie has been set. i'm using redis session store , xhr requests session populated correctly. my understanding sails handles integration of sockets when requests reached app's routes can treated other request? i've had @ answer in sails.js authorization socket requests fails req.socket.manager not defined. maybe that's older version of sails? in v0.11.0. after sending post request, see following in console: verbose: receiving incoming message socket.io: { method: 'post', headers: {}, data: {}, url: 'activity/subscribe' } verbose: interpreting socket.io message virtual request "post activity/subscribe"... error: policy error here no session.. we figured out eventually... &

backbone.js - Make backbone wait to render view -

i'm new backbone , have collection of objects , view displays them list. set every time object added collection view re-rendered. inefficient because if add 20 things collection @ once, rendered 20 times when needs rendered 1 time after last item has been added. how make backbone hold off on rendering until i'm done adding things collection? here code: <html> <head> <meta charset="utf-8" /> <title>looking @ underscore.js templates</title> </head> <body> <script type="text/template" class="template"> <ul id="petlist"> <% _.each(model.pets, function(pet) { %> <li><%- pet.name %> (<%- pet.type %>)</li> <% }); %> </ul> </script> <div id="container"/> <script type="text/javasc

ios - After embedding a navigationController into a tabBarController, the tabBarItem area disappears in interface builder -

Image
i'm using xcode 7.0.1. after embedding uinavigationcontroller uitabbarcontroller in storyboard, area tabbaritem s gets replaced big bottom bar , not editable after add connection tabbarcontroller second uiviewcontroller . so, can let me know how fix tabbaritem area make visible. see image below: i tried playing around simulated metrics after checking around here similar issues, without luck. i able click , change tabbaritems now, selecting dropdown option in storyboard of navigation controller.

PHP / MySQL foreach not working correctly for me -

im rather new php / mysql , addon im trying fix on cs-cart software keeps failing , ive been trying hours hoping can me: php in question: $acid = $_request['id']; $productsget = db_get_field("select cart ?:abandoned_cart user_id = ?i", $acid); fn_print_die($productsget); $products = unserialize($productsget); $shippingcost = db_get_field("select shipping ?:abandoned_cart user_id = ?s", $acid); $tax = db_get_field("select tax ?:abandoned_cart user_id = ?s", $acid); $ordertotal = db_get_field("select order_total ?:abandoned_cart user_id = ?s", $acid); $email = db_get_field("select email ?:abandoned_cart user_id = ?s", $acid); $sum=0; //echo $products; if (!empty($products)) { foreach($products $product){ $text .=' <tr> <td><a href="http://'.$_server['server_name'].'?dispatch=products.view&product_id='.$product['product_id'].'"> <

javascript - React Router Cannot Get / depending on onEnter function -

i new react , hoping can shed light on why happening , how debug it. i have following routes defined: export default (withhistory, onupdate) => { const history = withhistory? (modernizr.history ? new browserhistory : new hashhistory) : null; return ( <router history={history}> <route path='/login' component={login} /> <route path='/' component={home} onenter={requireauth} /> </router> ); }; requireauth supposed check if user logged in , redirect them login page if not: function requireauth(nextstate, transition) { transition.to("/login"); } if leave transtion.to call in , browse root url see message says, "cannot /" no error messages in debugger. putting breakpoint on line doesn't seem anything. what's odd if replace transition.to(...) debugger; statement, method called , routing works fine. i must have misunder

tensorflow - Efficient way to extract pool_3 for large number of images? -

i'd use pool_3 features extracted set of images. have loop on each image extract pool_3 features: # x_input.shape = (40000, 32, 32, 3) def batch_pool3_features(x_input): sess = tf.interactivesession() n_train = x_input.shape[0] print 'extracting features %i rows' % n_train pool3 = sess.graph.get_tensor_by_name('pool_3:0') x_pool3 = [] in range(n_train): print 'iteration %i' % pool3_features = sess.run(pool3,{'decodejpeg:0': x_input[i,:]}) x_pool3.append(np.squeeze(pool3_features)) return np.array(x_pool3) this quite slow though. there faster batch implementation this? thanks it doesn't - yet. i've opened a ticket feature request on github in response question.

email - cfmailparam disposition filename does not work in outlook -

i have simple example sending image attachment using coldfusion 11 cfmail tag. <cfmail to="example@domain.com" from="example@domain.com" subject="test" type="html"> <cfmailparam file="www.example.com/image.png" disposition="attachment; filename=""test.png"""> </cfmail> i want attachment called "test.png" when viewed in recipients email client. it works fine when receive email in gmail, outlook 2013 (and office 365 web client) retains "image.png" attachment name. have correctly made use of "disposition" attribute? if disposition not working you, try combining file , content instead. <cfmailparam file="test.png" content="#fileread( 'image.png' )#" > more details here .

c++ - Problems with strcmp() -

i'm not sure if it's strcmp or function isn't working. here's code in main function. double findlow(const char* date, const weather *data, int datasize) { int i, o; (i = 0; < datasize; i++) { o = strcmp(data[i].date(), date); //testing cout << o << ' ' << data[i].date() << date << endl; //testing if (strcmp(data[i].date(),date) == 0) return data[i].low(); } return 0.0; } here's code date() function(public member function). const char* weather::date() const { return _datedescription; } for reason strcmp function return 1 if strings match. datedescription c-style string of 7 characters , data[i].date() attempts find date in same format datedescription. also cout not show data[i].date() edit: when run full code looks this: days of weather: 3 enter date: oct/1 enter high: 15 enter low : 10 enter date: nov/13 enter high: 10 enter low : 1.1 enter date

android - Cardview is all going into one card -

i trying create card view checklist going app school. of items in arraylist going 1 card , cant figure out why. have looked @ every tutorial can find no luck. here relevant code. , appreciated. activity recyclerview = (recyclerview) findviewbyid(r.id.masterlistrecview); recyclerview.sethasfixedsize(true); layoutmanager = new linearlayoutmanager(this); recyclerview.setlayoutmanager(layoutmanager); recyclerview.setitemanimator(new defaultitemanimator()); thelist = new arraylist<masterlistitem>(); thelist.add(new masterlistitem("test item1",new date(),new date(),"here notes",false)); thelist.add(new masterlistitem("test item2",new date(),new date(),"here notes",false)); thelist.add(new masterlistitem("test item3",new date(),new date(),"here notes",false)); thelist.add(new masterlistitem("test item4",new date(),new date(),"here notes",false)); thelist.add(new masterlistitem("test item

Python: some pygame objects do not appear -

i'm building game have dodge bricks on road. blocks appear little white lines in center of window (the lane separators blocks can move) won't , crashes game when load up! this code: import pygame import time import random pygame.init() #colour acronym chart #| black = blck | grey = gry | dark = drk | white = wht #| deep = dp | metal = mtl | light = lht | cyan = cyn #| blue = bl | baby = bby | maroon = mrn | #| red = rd | fire = fr | orange = orng | # window colour index wht = (255, 255, 255) blck = (0, 0, 0) dp_gry = (32, 32, 32) mtl_gry = (96, 96, 96) lht_gry = (160, 160, 160) dp_bl = (0, 0, 102) lht_bby_bl = (0, 128, 255) cyn = (0, 153, 153) drk_mrn = (102, 0, 0) fr_rd = (255, 0, 0) lht_orng = (255, 128, 0) #end of colour module display_width = 800 display_height = 600 gamedisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('hard drive') cl

validation - How to validate JSON with schema in Haskell? -

i want validate json schema. hjsonschema seemed choice new , supports latest draft. plotly json schema gives me valid responses. i may misunderstanding here should not valid json bad.json { "fjsdklj" : 5 } even though considered valid following code module main import control.applicative import data.aeson import data.hashmap.strict (hashmap) import qualified data.hashmap.strict h import data.monoid import qualified data.bytestring.lazy b import qualified data.jsonschema js import data.maybe main :: io () main = schemajson <- (fromjust . decode) <$> b.readfile "simple-schema.json" bad <- (fromjust . decode) <$> b.readfile "bad.json" let schemadata = js.rawschema { js._rsuri = nothing, js._rsdata = schemajson } schema <- compileschema (js.schemagraph schemadata h.empty) schemadata check

python 3.x - summing up certain rows in a panda dataframe -

i have pandas dataframe 1000 rows , 10 columns. looking aggregate rows 100-1000 , replace them 1 row indexvalue '>100' , column values sum of rows 100-1000 of each column. ideas on simple way of doing this? in advance say have below b c 0 1 10 100 1 2 20 100 2 3 60 100 3 5 80 100 and want replaced with b c 0 1 10 100 1 2 20 100 >1 8 140 200 you use ix or loc shows settingwithcopywarning : ind = 1 mask = df.index > ind df1 = df[~mask] df1.ix['>1', :] = df[mask].sum() in [69]: df1 out[69]: b c 0 1 10 100 1 2 20 100 >1 8 140 200 to set without warning pd.concat . may not elegant due 2 transposing worked: ind = 1 mask = df.index > ind df1 = pd.concat([df[~mask].t, df[mask].sum()], axis=1).t df1.index = df1.index.tolist()[:-1] + ['>{}'.format(ind)] in [36]: df1 out[36]: b c 0 1 10 100 1 2 20 100 >

performance - How to speed up a C++ sparse matrix manipulation? -

i have small script manipulating sparse matrix in c++. works fine except taking time. since i'm doing manipulation on , over, critical speed up. appreciate idea.thanks #include <stdio.h> /* printf, scanf, puts, null */ #include <stdlib.h> /* srand, rand */ #include <time.h> /* time */ #include <iostream> /* cout, fixed, scientific */ #include <string> #include <cmath> #include <vector> #include <list> #include <string> #include <sstream> /* sjw 08/09/2010 */ #include <fstream> #include <eigen/dense> #include <eigen/sparse> using namespace eigen; using namespace std; sparsematrix<double> matmaker (int n1, int n2, double prob) { matrixxd = (matrixxd::random(n1, n2) + matrixxd::ones(n1, n2))/2; = (a.array() > prob).select(0, a); return a.sparseview(); } ////////////////this needs optimized///////////////////// int sd_func(sparsematrix<double> &w, v

python - Selenium does not locate element -

i newbie python. have written code automatically login website, https://www.quora.com . issue is, selenium loads firefox perfectly, program not proceed further. is, not go on enter email , password. from selenium import webdriver selenium.webdriver.common.keys import keys browser = webdriver.firefox() browser.get('https://www.quora.com') browser.implicitly_wait(30) email = browser.find_element_by_class_name('email') pw = browser.find_element_by_class_name('password') email.send_keys('my_email') pw.send_keys('my_password') pw.send_keys(keys.enter) i have written similar program automate login gmail, works perfectly. code given below, although same above. from selenium import webdriver selenium.webdriver.common.keys import keys browser = webdriver.firefox() browser.get('https://www.gmail.com') browser.implicitly_wait(10) email = browser.find_element_by_id('email') email.send_keys('my_username') email.sen

Swagger-ui version 2.1.4 is not populating API list grouping on Controllers -

i moved swagger 1.x 2.x , swagger-ui not populating api's in controller group. example: suppose have 3 controllers ( using spring mvc) abccontroller base url mapping "abc/test1" , @api(value="abccontroller" ) xyzcontroller base url mapping "xyz/test2" , @api(value="xyzcontroller" ) abcxyzcontroller base url mapping "abc/test3" , @api(value="abcxyzcontroller" ) now , when start application it shows 4 api listing (but api url instead of @api tag value) , abc/ abc/test1 xyz/test2 abc/test3 but wanted have 3 listings ( grouping controller , @tag value property. xyzcontroller abccontroller abcxyzcontroller there concept of tags in swagger. when 1 not provided, deduced @api annotation. try setting annotation such: @api(value="abccontroller, tags = "abccontroller" )

How to set and get TestStep properties in SoapUI using Java -

Image
i trying set properties of soapui teststep inside soapui project in java shown in below screenshot. when debug below code, getting null when getproperty or setpropertyvalue . point want set property variable java function couldn't able it. getting in groovy when google problem. can 1 me how in java public class soapuitest { public final static void main(string [] args) throws exception { wsdlproject project = new wsdlproject("c:\\users\\vikram\\webservice\\webservicetest\\src\\main\\java\\weather.xml"); wsdltestsuite wsdltestsuite = project.gettestsuitebyname("weatherzip"); wsdltestcase wsdltestcase = wsdltestsuite.gettestcasebyname("weatherbyzip"); wsdlteststep wsdlteststep = wsdltestcase.getteststepbyname("getcityforecastbyzip"); wsdlteststep.setpropertyvalue("city","21001");// problem: unable set property value wsdltestcaserunner wsdltestcaserunner = new wsdltestcaserunner(wsdltest

c# - How to destory instance of class when finished Action -

i use mvvm in project . first @ see edit action: [httpget] public async virtual task<actionresult> edit(int code) { var attributemodel = await _attributeservice.getasync(code); editattributeviewmodel attributeviewmodel = mapper.map(attributemodel, new editattributeviewmodel()); return view(attributeviewmodel); } in viewmodel count instance : public class editattributeviewmodel { private static int counter = 0; public editattributeviewmodel() { interlocked.increment(ref counter); } ~editattributeviewmodel() { interlocked.decrement(ref counter); } } when finished edit action , change controller , comeback again edit action , when see counter increase , while moving between pages.i not want use memory, override dispose method in controller : protected override void dispose(bool disposing) { base.dispose(disposing); } but doest chnage , counter increase . how

ios - setPropertiesToFetch returns 'Invalid keypath expression' error -

i trying use group-by core data functionality in basic form: - (nsfetchedresultscontroller *)fetchedresultscontroller { nsmanagedobjectcontext *managedobjectcontext = [self managedobjectcontext]; if (_fetchedresultscontroller != nil) { return _fetchedresultscontroller; } nsexpression *reviewnumkeyexpression = [nsexpression expressionforkeypath:@"review_num"]; nsexpression *reviewmaxexpression = [nsexpression expressionforfunction:@"max:" arguments:[nsarray arraywithobject:reviewnumkeyexpression]]; nsexpressiondescription *maxreviewed = [[nsexpressiondescription alloc] init]; [maxreviewed setname:@"maxreview"]; [maxreviewed setexpression:reviewmaxexpression]; [maxreviewed setexpressionresulttype:nsinteger32attributetype]; nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"group&q

ios - Geting NSURLConnection error while calling HTTPS Soap service -

Image
i trying data soap request getting app crashed error: 2016-02-08 11:12:11.524 example[567:128898] nsurlsession/nsurlconnection http load failed (kcfstreamerrordomainssl, -9843) response: nil fatal error: unexpectedly found nil while unwrapping optional value i have enabled security settings in plist , calling other services successfully. note: service on https, getting error because of this? required certificate? i calling soap service first time, please guide me on how add email parameter in service: ( https://[ip]:9897/jlipolicyinfo.asmx?op=getemail_poldetail ) here code here: ( ios swift call web service using soap ) let is_soapmessage: string = "<soapenv:envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:cgs=\"http://www.cgsapi.com/\"><soapenv:header/><soapenv:body><cgs:getsystemstatus/></soapenv:body></soapenv:envelope>" let is_url: string = "https://58.2

android - OutofMemory Error when loading Images in Gridview -

i'm implementing following code in adapter when faced problem of outofmemory error .but problem here able load first enter code here image 0th position in gridview . below code, please suggest changes. public class gridadapter extends baseadapter { string[] names; int[] images; context context; private static layoutinflater inflater=null; //private lrucache<string bitmap="",> memorucache; private lrucache<string, bitmap> mmemorycache; public gridadapter(context mainactivity,string[] _names,int[] _images){ names=_names; images=_images; context=mainactivity; inflater= (layoutinflater) context.getsystemservice(context.layout_inflater_service); final int maxmemory= (int) (runtime.getruntime().maxmemory() / 1024); final int cachesize=maxmemory/8; mmemorycache = new lrucache<string, bitmap>(cachesize) { @override protected int sizeof(strin