Posts

ios - Can't insert object in the array, that I want add to User Defaults -

i have initialization of array var defaults = nsuserdefaults.standarduserdefaults() var initobject: [cpaymentinfo]? = defaults.objectforkey("paymentdata") as? [cpaymentinfo] if initobject == nil { initobject = [cpaymentinfo]() defaults.setvalue(initobject, forkey: "paymentdata") } defaults.synchronize() and have controller, contains 2 text labels , 2 buttons: save , cancel (both calling segue) if sender as? uibarbuttonitem == savebutton { var defaults = nsuserdefaults.standarduserdefaults() var payments: [cpaymentinfo]? = defaults.objectforkey("paymentdata") as? [cpaymentinfo] var newpaymentitem: cpaymentinfo? if discriptionfield.hastext() { newpaymentitem = cpaymentinfo(value: (valuefield.text nsstring).doublevalue, discription: discriptionfield.text) } else { newpaymentitem = cpaymentinfo(value: (valuefield.text nsstring).doublevalue) ...

android - Mockito AbstractMethodError on initMocks -

so i've been struggling pretty day trying mockito work android project. added gradle build file: androidtestcompile 'org.mockito:mockito-core:2.0.29-beta' androidtestcompile "junit:junit:4.12-beta-3" androidtestcompile 'com.google.dexmaker:dexmaker:1.2' androidtestcompile 'com.google.dexmaker:dexmaker-mockito:1.2' and have tried running test doesn't anything: @runwith(mockitojunitrunner.class) public class loginactivitytest extends activityinstrumentationtestcase2<loginactivity> { private loginactivity loginactivity; private edittext et_email; private edittext et_password; private button btn_login; @mock spicemanager manager; public loginactivitytest(){ super(loginactivity.class); } @override public void setup() throws exception { super.setup(); loginactivity = getactivity(); mockitoannotations.initmocks(this); //manager = mock(spicemanage...

reporting services - Adding from two different reportitems -

i trying add 2 separate text boxes different datasets had create code summarize (codes below) giving total. trying gaptotal + gaptotal2 separate dataset. unfortunately blank. can help? thank in advance public gaptotal integer = 0 public function sum(byval value integer) integer gaptotal = gaptotal + value return value end function public gaptotal2 integer = 0 public function sumit(byval value integer) integer gaptotal2 = gaptotal2 + value return value end function there 2 possible approaches l can think of here. first reference values in each dataset , add values see posting - stack overflow posting second place values each data control eg text box, add values in each text box see - sql server central posting

file processing - Handle Commas While Reading Text in Python -

my code trying read log files throughout specified directory in rootdir , write pieces of information log file outputfile the issue i'm having searchobj_archive_date.group() , fullpath , zdiscsvar , zcopiesvar , , searchobj_year_3or6.group() aren't being read file lines within log files. happens 10% of total outputted lines of text, i'm confused why it's happening of time, instead of e:\filepath\text.txt | 5/23/2015 12:00 | c:\anotherfilepath\text.txt | 23 | 23 | 5year , e:\filepath\text.txt | | | | | any insight why error occuring appreciated. code below: after doing researched, found what's causing error whenever line has comma , in it. stops reading line @ comma , skips next line, know workaround this? an example of input text that's giving me problems: 11/23/2015 12:34:58 adding file d:\fp\fp1\fp2\text, text, text.txt normally these lines don't have commas, know of way handle commas when reading in lines of text? import os imp...

jquery - Form validation error message not working -

i had custom code added shopping cart worked beautifly. @ point, error message displays when required field not filled out, stopped working. here code: (revised html included) {% assign choices = "other, affiliate, returning customer, practitioner, dr. ulan, dr. shallenberger, dr. dennis courtney, wbai - take charge of health radio, chek institue, bodyhealth newsletter, yasmine marca, ben greenfield, steve ilg, tawnee prazak, abc4u, natural awakenings, email advertisment, facebook, twitter, google, forum, friend, letter, optimum healt report, townsend letter, autism avenue" %} {% assign required = true %} <div class="form-vertical"> <p> <select style="margin-left: 0px;" class="six columns" id="how-did-you-hear-about-us" name="attributes[how-did-you-hear-about-us]" > <option value=""{% if cart.attributes.how-did-you-hear-about-us == "" %} selected{% endif %}>please make sele...

Powershell command prompt prints ^C when pressing Ctrl+C, why? -

my command shell of choice powershell, have couple of windows open run scripts. i have noticed @ point shell starts misbehaving in annoying way: press key - nothing output! press 1 - works fine , rest of keys processed expected until hit enter execute. command runs, new command prompt appears , again first key ignored! pressing ctrl+c displays ^c instead of cancelling current prompt , showing new one. the strangest thing shell starts fine, works time, gets botched in aforementioned way , after period of time returns working fine. this extremely confusing, had botched shell instance when started question, fine. has encountered similar thing? causing it? edit i use console shell exclusively, not ise. shortcut command is: %systemroot%\system32\windowspowershell\v1.0\powershell.exe the shell version is: ps c:\> $psversiontable name value ---- ----- psversion 3.0 wsmanstackversion ...

javascript - codeigniter calendar: how to get the selected date? -

Image
i trying modify codeigniter calendar in order give separate add button every cell. when add button clicked pop displayed particular date auto filled in pop up. want selected date when click add button. my calendar this. i used following model function create calendar function mycal_model() { $this->conf = array( 'show_next_prev' => true, 'next_prev_url' => base_url() . 'index.php/dashboard/index/' ); $this->conf['template'] = ' {table_open}<table cellpadding="1" cellspacing="2" class="calendar">{/table_open} {heading_row_start}<tr>{/heading_row_start} {heading_previous_cell}<th class="prev_sign"><a href="{previous_url}">&lt;&lt;</a></th>{/heading_previous_cell} {heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell} {he...