Posts

How to inherit views porperly in openerp 7.0 -

hi view inheritance code , following error while using code . " valueerror: many values unpack " please me resolve issue <record model="ir.ui.view" id="inherit_form_view1"> <field name="name">inherit form</field> <field name="model">student.info.student</field> <field name="type">form</field> <field name="inherit_id" ref="student.info.student.form_view1" /> <field name="arch" type="xml"> <!-- <xpath expr="/sheet/notebook/page/field[@name='mname']" position="after"> <field name="m_tongue" /> </xpath -->> <field name="mname" positon="after"> <field name="m_tongue" /> </field> </fiel...

Add event to google calendar from ios -

i have followed following tutorial fetch events google calendar working fine. https://developers.google.com/google-apps/calendar/quickstart/ios now stuck in insert event ios app can synced web well. please guide me in right direction or post sample code. i using code authorization in viewdidload // initialize google calendar api service & load existing credentials keychain if available. self.service = [[gtlservicecalendar alloc] init]; self.service.authorizer = [gtmoauth2viewcontrollertouch authforgooglefromkeychainforname:kkeychainitemname clientid:kclientid clientsecret:kclientsecret]; authorization seems fine because fetch events working fine. using following code add event - (void)addanevent { // make new event, , show user edit gtlcalendarevent *newevent = [gtlcalendarevent object]; newevent.summary = @"sample added event"; newevent.de...

ruby on rails - Is RoR 'routes' file an alternative for Apache 'mod_rewrite' module? -

i'm starting web developer , following question sake of connecting several new things in brain: ror 'routes' file alternative apache 'mod_rewrite' module? thanks in advance participating. it's similar in list of url patterns, each pattern having rules associated it. the main difference routes internal rails: mod_rewrite come decision route, , serve file, or pass request on proxy handle, can thought of standalone process in request pipeline. routes.rb on other hand can thought of runs inside rails , decides object (where objects controllers) should have method called on it, passing through request object. maybe isn't happens it's this. rails black box request comes in , response comes out, , routes inside box. so, guess it's alternative mod_rewrite, because instead of using mod_rewrite apache pass requests rails , let rails (using routes.rb code) figure out. it's kind of different thing. edit: re-read , realised it...

Ordered associative arrays in bash -

i can following in bash : declare -a data data[a]="aaa" data[c]="ccc" data[b]="bbb" in "${!data[@]}" ; printf "%-20s ---> %s\n" "$i" "${data[$i]}" done which outputs: a ---> aaa b ---> bbb c ---> ccc that is, associative array reordered (i assume using lexicographic ordering on keys, not sure), , loses original order in created data. wanted instead: a ---> aaa c ---> ccc b ---> bbb in python use ordereddict instead of plain dict that. there similar concept in bash? as answered, associative arrays not ordered. if want ordering in array, use below work-around. declare -a data data_indices=() data[a]="aaa"; data_indices+=(a) data[c]="ccc"; data_indices+=(c) data[b]="bbb"; data_indices+=(b) in "${data_indices[@]}"...

IFERROR function in MySQL -

is there function iferror in mysql. example: iferror(25/0,9) i tried on phpmyadmin said such function iferror not exist. appreciate help you can reach similar results ifnull: if answer not valid, defaults null. ifnull give alternative answer: your example (in case): select ifnull(25/0,9); gives result: 9

android - Starting Map Activity from Nav Drawer -

i trying develop map activity initiated navigation drawer. have read this query . my code :- mainactivity.java package com.tadrish.last; import android.graphics.bitmapfactory; import android.os.bundle; import android.support.v4.widget.drawerlayout; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.menu; import android.view.menuitem; import android.widget.toast; import android.content.intent; public class mainactivity extends appcompatactivity implements navigationdrawercallbacks { /** * fragment managing behaviors, interactions , presentation of navigation drawer. */ private navigationdrawerfragment mnavigationdrawerfragment; private toolbar mtoolbar; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mtoolbar = (toolbar) findviewbyid(r.id.toolbar_actionbar); setsupportactionbar(mtoolbar); mnaviga...

python - How to fit SGDRegressor with two numpy arrays? -

i'm trying learn sgdregressor . generate own data don't know how fit algorithm. error. x = np.random.randint(100, size=1000) y = x * 0.10 clf = linear_model.sgdregressor() clf.fit(x, y, coef_init=0, intercept_init=0) found arrays inconsistent numbers of samples: [ 1 1000] i'm new python , machine learning. miss? >>> np.random.randint(100, size=1000) will give 1 x 1000 array. features , target variables need in column. try >>> x = x.reshape(1000,)