Posts

Showing posts from February, 2013

php - how to usort an array which is already sorted with another key -

my first array sorted name,but want usort position, have tried here, array before usort array ( [0] => array ( [name] => admin [designation] => admin [email] => admin@admin [phone] => 999777788 [ext] => 67767 [position] => 1 [image] => ) [1] => array ( [name] => ateam [designation] => manager [email] => service@mail.com [phone] => [ext] => 777 [position] => 3 [image] => ) [2] => array ( [name] => bteam [designation] => manager [email] =>g@mail.co.in [phone] => [ext] => [position] => 4 [image] => ) [3] => array ( [name] => hi team [designation] =>

cordova - App crashes on iOS 10.0.2 but not on iOS 10.1.1 -

my problem app (generated using ionic) crashes on ios 10.0.2 not on ios 10.1.1. each time, did same thing on 2 devices. searched on google , didn't find similar problem. the crash comes after post request server have self-signed certificate. error in logs, on xcode, : assertion failed: (isforproxy(authconfig.getconnectiontype())), function updatewithresponse, file /buildroot/library/caches/com.apple.xbs/sources/cfnetwork/cfnetwork-808.0.2/http/httpauthentication/authenticationhelpers.cpp, line 1168. just before crash, xcode stopped if put breakpoint. concerned thread named "com.apple.nsurlconnectionloader". after crash, have remove (or rebuild/run xcode) app because, if not, crashes directly when launch device. the concerned post request (it seems me basic) : $http.post(url, { data: data } , { headers: {'content-type': 'text/plain'}}) .success(function (data, status, headers, cfgapp) { // code }.erro

python 2.7 - ValueError: Shape of passed values is (6, 251), indices imply (6, 1) -

Image
i getting error , i'm not sure how fix it. here code: from matplotlib.finance import quotes_historical_yahoo_ochl datetime import date datetime import datetime import pandas pd today = date.today() start = (today.year-1, today.month, today.day) quotes = quotes_historical_yahoo_ochl('axp', start, today) fields = ['date', 'open', 'close', 'high', 'low', 'volume'] list1 = [] in range(len(quotes)): x = date.fromordinal(int(quotes[i][0])) y = datetime.strftime(x, '%y-%m-%d') list1.append(y) quotesdf = pd.dataframe(quotes, index = list1, columns = fields) quotesdf = quotesdf.drop(['date'], axis = 1) print quotesdf how can change code achieve goal, change dateform , delete original one? in principle code should work, need indent correctly, is, need append value of y list1 inside loop. for in range(len(quotes)): x = date.fromordinal(int(quotes[i][0])) y = datetime.strftime(x, &#

c - Unhandled exception at 0x0f6cf9c4 in server.exe: 0xC0000005: Access violation reading location 0x00000001 -

here code have written in visual studio 2008. data in receive array & using data, preparing response it. error "unhandled exception @ 0x0f6cf9c4 in server.exe: 0xc0000005: access violation reading location 0x00000001." every time @ "strcat" function when code runs. byte receive[50]; unsigned char result[50]; int index = 0; char *type; char *s = "ff ff ff 1d 00 01 01 0b 00 01"; char *s1 = "03 00 98 ac 06 36 6f 92"; int i; if (receive[i] == 0x18) { if ((receive[i+1] == 0x20) || (receive[i+1] == 0x21) || (receive[i+1] == 0x22) || (receive[i+1] == 0x23) || (receive[i+1] == 0x24) || (receive[i+1] == 0x25)) { if (receive[i+2] == 0x00) { result[index] = receive[i-4];`enter code here` result[index+1] = receive[i-3]; index = index+2; type = "report"; } } } } index = 0; i

Gerrit changes present in db but not shown in UI -

recently migrated gerrit on new machine. part of migration, took mysqldump , restored on new gerrit machine. ran reindex operation after restore problem not able see reviews on gerrit ui if see them in database table called changes as @stephenking mentioned, there error in reindexing. error got fixed when rsynced managed git repositories old new gerrit. once reindex successful, changes appeared on ui

php - codeignitor's anchor() method fails to hit method name specified in controller -

i want link anchor method "newinvoice()" specified in controller <?php $this->load->helper('url'); ?> <li><?php echo anchor('new_invoice_c/newinvoice', 'new invoice'); ?></a> </li> controller class new_invoice_c extends ci_controller { public function newinvoice() { $this->load->view('new_invoice'); } } the problem anchor() not returning full string (when check via "view page source) upto first paraemeter i.e. method name follows. <a href="http://localhost/cibs/index.php/new_invoice_c"> when renamed mehtod index() view loaded successfully. it may seem naive here tried echo anchor(site_url('new_invoice_c.php/newinvoice'), 'new invoice'); echo anchor('new_invoice_c.php/newinvoice', 'new invoice'); beside refresh page after clearing chache still unable figure out. change <li><?php echo an

json - Declare function inside another function in angularjs -

i have first function: $scope.loaddatafromtomonth= function (from,to,year) { // $scope.loaddatafromtomontharrivee(from,to,2016); var url = servername+'admin/dashboard/getincidentdepartbymonthfromto/'+from+'/'+to+'/'+year; // alert(url); function onsuccess(response) { console.log("+++++getincidentdepartbymonthfromto success++++++"); if (response.data.success != false) { $scope.payloadgetincidentdepartbymonthfromto = response.data.data; var getincidentdepartbymonthfromto= $scope.payloadgetincidentdepartbymonthfromto; console.log(json.stringify(getincidentdepartbymonthfromto)); $scope.data = {}; // new object $scope.data.datasets = []; // new array in data object .. $scope.data.labels =[]; var thewholeob={}; var datasetobj = {}; //temp object push dataset array.. var datasetobjtwo = {}; /////////////

MySQL: Count Columns Per Row -

i want know if counting columns possible you're counting rows without calling each column name. example: select count(found columns) counted table a_value exists in columns /* same specified one. working i'm looking approach without calling each column name. select (if(col1="y",1,0) + if(col2="y",1,0)) counted table */ which wish throw results per row like: | counted | |-----------| | 2 | | 1 | | 0 | is possible? if yes, how? select count(column_name) information_schema.columns table_catalog = 'database' , table_schema = 'dbo' , table_name = 'table' try work.

python - How to name dataframe with variables in pandas -

is there way generate multiple dataframes in pandas? want name dataframes variables like: for in range 1 100 dfi in dfs df1= df2= df3= : : : df99= df100= i think can use dict comprehension : n = 101 # 5 in sample dfs = {'name' + str(i):df in range(1,n)} print (dfs) sample: df = pd.dataframe({'a':[1,2,3], 'b':[4,5,6], 'c':[7,8,9], 'd':[1,3,5], 'e':[5,3,6], 'f':[7,4,3]}) print (df) b c d e f 0 1 4 7 1 5 7 1 2 5 8 3 3 4 2 3 6 9 5 6 3 n = 5 dfs = {'name' + str(i):df in range(1,n)} print (dfs) {'name3': b c d e f 0 1 4 7 1 5 7 1 2 5 8 3 3 4 2 3 6 9 5 6 3, 'name4': b c d e f 0 1 4 7 1 5 7 1 2 5 8 3 3 4 2 3 6 9 5 6 3, 'name2': b c d e f 0 1 4 7 1 5 7 1 2 5 8 3 3 4 2 3 6 9 5 6 3, 

the Model filed can't named 'model' in peewee? -

i use peewee-async based on peewee create model has field named 'model' class test(peewee.model): model = peewee.charfield(max_length=255) class meta: database = database db_table = 'test' schema = 'opr'` when create object,it happens error: file "/home/mwh/py3workplace/workplace/ad_tornado/handlers/opr.py", line 78, in post yield self.db.create(taskreqeven,**insert_sql) typeerror: create() got multiple values argument 'model' i tried use other name replace 'model',it submitted correctly database,so douted if model name can't name 'model'? looks error in override you've created? @ code. whatever "db.create()" doing problem.

java - Unable to view tab names in tab layout with viewpager in android studio -

i have designed page consist of toolbar tablayout , viewpager. pages uses style theme.appcompat.light.noactionbar app amin theme. working fine, can view pages slide pages except unable view tab names in tablayout. please 1 me using android studio 2.2.1 xml design code of page is: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".mainactivity"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="35dp" android:layout_alignparenttop="true" android:background="?attr/colorprimary" andro

360* image stitching quality metric -

i working 360 degree image stitching, have taken few images , stitched using available software. problem not finding parameter evaluate image stitching quality (in figures) performance. can suggest image quality metric such psnr, mse etc. evaluate stitched images.

javascript - Multitenancy - design pattern -

i have requirement design following: there 1 main domain there on application runs , servers all multitenancy, different databases. user per database (special users share many databases) using auth0 user logs in, system recognizes belong , application uses appropriate database. i have made prototype relies on subdomain name, , in theory should have worked. in prototype, system relies on host. requirements changed, , cant use subdomain asset differentiate. i cant begin think how organize of this, in mind redis rings bell. dont know :( i appreciate pointers, if has done already? i using react / hapi.js / sequalize (mysql) / auth0 if haven't done should check: using auth0 multi-tenant apps it has few different examples , provides guidelines on how model type of architectures in auth0.

f# - How do I define a Json Schema containing definitions, in code -

i attempting replicate following json schema example, defining schema in code using newtonsoft.json.schema : { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "address": { "type": "object", "properties": { "street_address": { "type": "string" }, "city": { "type": "string" }, "state": { "type": "string" } }, "required": ["street_address", "city", "state"] } }, "type": "object", "properties": { "billing_address": { "$ref": "#/definitions/address" }, "shipping_address": { "$ref": "#/definitions/address" } } this close i've got far. (example in f# might in c#.) code: o

java - Automate Testing of OData webservice with Bearer authetication and 17 input Paramenters -

i have odata web service pulls data database. here steps, following parameters passed retrieve token g rant_type=password&username=biobookuser&password=ddsf8jcx&client_id=iefqc44 once token received, have pass token along url an 'bearer +token received' normally query /proteinchemistry/adccellbioinvitro?$filter=(labdefinition_id eq 80) , ((date(requestdate) ge 2016-06-14) , (date(requestdate) le 2016-06-23)) , (contains(containervolume,'2.00 ml') or contains(containervolume,'0.10 ml')) , (contains(containerconcentration,'1.00 mm') or contains(containerconcentration,'1.00 mm')) , (materialdef eq 'linker payload' or materialdef eq 'payload') , (assaytype eq 'tritum assay, atp assay' or assaytype eq 'atp assay') , (classofpayload eq 'pbd') , (potencyrange eq 'pico molar' or potencyrange eq 'nano molar') it has 17 input parameters.. no question is, i need

PostgreSQL - inserting string of 30,000 characters doesn't change size? -

via command select relname "table", pg_size_pretty(pg_total_relation_size(relid)) "size", pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) "external size" pg_catalog.pg_statio_user_tables order pg_total_relation_size(relid) desc; i can retrieve size of tables. (according this article ) works. came weird conclusion. inserting multiple values contain approx 30,000 characters each, doesn't change size. when executing before inserting tablename | size text |external size text ------------------------------------------- participant | 264kb | 256kb after inserting ( btw base64 encoded images ) , executing select command, exact same sizes returned. i figured couldn't correct wondering, command wrong? or postgresql special large strings? (in pgadminiii strings not show in 'view data' view shown when executing select base64image participant ). and next wondering (not main question nice

c# - How To Download Zip folder using web api? -

i creating 2 projects: mvc web api i make request mvc controller action method web api controller action method.on web api method i'm create zip folder i don't know how download zip folder .

javascript - Failed to load resource: the server responded with a status of 500 using Ajax -

i knew question asked . cannot find out exact problem code.please me sort out issue function viewcalldetails(obj) { alert("clicked"); var id = $(obj).attr("id"); $(".style-table-tab input[type='text']").val(''); settimeout(function () { $('.preloader-circle').show();// or fade, css display you'd like. }, 1000); $.ajax({ type: 'post', url: pageurl+"/loadcalldetails", data: '{leadid: "' + id + '"}', contenttype: "application/json; charset=utf-8", datatype: 'json', success: onvaluecall, failure: function (response) { alert(response.d); } });

json - PHP Fatal Error from json_decode inside try-catch -

the following code throws me exception: $return = json_decode($result); fatal error: cannot access property started '\0' in file.php on line 36 i've read php documentation , questions here, i've tried code: try{ $return = json_decode($result); } catch(exception $e) { $json_error_code = json_last_error(); echo $json_error_code . ","; $err.= 'json parse error'; switch ($json_error_code) { case json_error_none: $err = "none"; break; case json_error_depth: $err.= ' - maximum stack depth exceeded'; break; case json_error_state_mismatch: $err.= ' - underflow or modes mismatch'; break; case json_error_ctrl_char: $err.= ' - unexpected control character found'; break; case json_error_syntax: $err.= ' - syntax error, malformed json'; break; case json_error_utf8: $err.= ' - malformed utf-8 character

linux - compile the kernel with crda -

i have built xilinx kernel , using wifi interface communication outside world. moment call command: iw wlan0 connect ssid it starts showing message:- wlan0: associated cfg80211: calling crda update world regulatory domain so above message remove downloaded crda git repository not know put before calling make command build kernel. illustrate on this? regards aditya

prototype printing undefined in console with setInterval function in javascript -

this question has answer here: how “this” keyword work? 19 answers i trying print in prototype function using setinterval it's showing undefined in console. function newfunc(){ this.name = "this person name"; this.age = "16 years"; } newfunc.prototype.init = function(){ setinterval(function(){newfunc.prototype.xyz()}, 1000); } newfunc.prototype.xyz = function(){ console.log(this.age); } var abc = new newfunc(); abc.init(); its inside function.so apply this.xyz() . this declare variable , apply setinterval(copy.xyz()) why use this this.xyz() applicable on newfunc.prototype.init .not ah setinteval(function (){}) .th

c# - Textbox looses forecolor on disabling it -

Image
this question has answer here: how change font color of disabled textbox? 8 answers i dynamically create multiple textboxes showing information user. want set back- , forecolor of textboxes if statement true. all works fine, untill disable textbox, forecolor "resets" standart color instead of showing desired one. datatable dt = [some data] //col 0: id //col 1: text //col 2: date (int = 0; < dt.rows.count; i++) { datetime d = (datetime) dt.rows[i].itemarray[2]; textbox txt = new textbox(); txt.multiline = true; txt.font = tb_aufloesung.font; txt.text = dt.rows[i].itemarray[1].tostring() + "\n" + d.tostring(@"dd.mm.yyyy"); txt.size = new size((textrenderer.measuretext(dt.rows[i].itemarray[1].tostring(), txt.font).width) + 10, 34); txt.location = new point(43, 3 + split.panel2.controls.count / 2 * 40);

ios - How to connect viewcontroller to NSObject class file? -

i want connect , pass action viewcontroller nsobject class file. in viewcontroller, there uiswitch button , if switch want work in nsobject class file. when switch on viewcontroller (uiview) action have work in nsobject class file. i'm coding objective-c. here viewcontroller.m , did in viewcontroller file. not connected nsobject class file. - (void)viewdidload{ [super viewdidload]; //uiswitch work @ viewdidload [self.myswitch addtarget:self action:@selector(statechanged:) forcontrolevents:uicontroleventvaluechanged]; } - (void)statechanged:(uiswitch *)switchstate{ nslog(@"current calendar: %@", [[nscalendar currentcalendar] calendaridentifier]); //get date today nsdateformatter *formatter = [[nsdateformatter alloc] init]; [formatter setdatestyle:nsdateformattermediumstyle]; [formatter setcalendar:[nscalendar currentcalendar]]; nsstring *datetoday = [formatter stringfromdate:[nsdate date]]; nslog(@"today date is: %@", [nsdate

java - how to connect a remote desktop program running in localhost to connect a remote desktop in another lan? -

i had built java program access remote desktop of machine working in lan. want make online such should able connect system in work , system in home. 1.i found out several ways same. a.we shall use server static ip connect client program. b.by using port forwarding method. i not sure how same. think option 1 correct if correct can please explain me how achieve same. to specific how remote access using client--server--client architecture.

java - Way to know what was the last line executed before entering a catch block with Intellij? -

a recurring issue when debugging i'm going through line line in code , suddenly, out of nowhere, jump catch block. going through many lines can't remember line caused catch-block executed. does intellij provide kind of facility allows me check last line executed in given try-block? ps: if i'm dealing pure function, things not terrible. can drop frame , go again through code, paying particular care see 1 last line executed try-block before getting catch-block. tedious if method long enough.. thanks sometimes had requirement well. there 2 options can try: plain intellij without installing plugin when stop in catch block, use expression evaluation (alt-f8) , execute e (or ex whatever exception var named) .printstacktrace() , in console see stacktrace, pointed out line caused exception. in way, can know line number stacktrace, if want go there , check problem, have drop frame/re-start debug. install chronon plugin in intellij this plugin supports

azure - App Service Certificate - Can't verify domain -

i trying set ssl certificate root domain , sub domains. the key vault configuration done unable verify domain; far did put html file has same name domain verification token created txt record same value on root domain. the first verification option seems working not in correct way, it's not listing custom domain in list though it's added already. sub domains have standart or premium pricing options. could body me issue? thank you.

Repository Pattern with Fluent Nhibernate -

hello i've implemented repository pattern fluentnhibernate have 1 concern abount exposeconfiguration when removed methods works fine when adds ,it resets tables in database. need take , give me notes implementation here unit of work class public class unitofwork { public static isession nhibernatehelper() { isessionfactory _sessionfactory = fluently.configure() .database(mssqlconfiguration.mssql2012.connectionstring(@"data source=waail-pc\computerengineer;initial catalog=tsql2012;user id=sa;password=12345678ce").showsql()) .mappings(x => x.fluentmappings.addfromassemblyof<usersmap>()) //.exposeconfiguration(cfg => new schemaexport(cfg).create(false, true)) //when removed line doesn't //remove elements db .buildsessionfactory(); return _sessionfactory.opensession(); }} and here repository pattern : public class repository<t> :irepository<t> t :ba

ios - Swift 3.0 Couldn't get required object pointer (substituting NULL): Couldn't load 'self' because its value couldn't be evaluated -

when executing code: public enum month : string { case january = "jan" case february = "feb" case march = "mar" case april = "apr" case may = "may" case june = "jun" case july = "jul" case august = "aug" case september = "sep" case october = "oct" case november = "nov" case december = "dec" func todate() -> date { let dateformatter = dateformatter() dateformatter.dateformat = "dd.mmm.yyyy hh:mm a" let datestring = "01.\(self.rawvalue).2016 12:00 pm" return dateformatter.date(from: datestring)! } } i'm getting: fatal error: unexpectedly found nil while unwrapping optional value when try printing "po dateformatter.date(from: datestring)!" crash happening: fatal error: unexpectedly found nil while unwrapping optional value

skip yii2 unique validation on update action if new value equals to prev value -

because of unique validator error on update action ('this username taken') wanna validate username on update action when new username value not equals prev value, it's rule: [['username'], 'unique', 'on'=>'update', 'when' => function($model){ return static::getoldusername($model->id) !== $model->username; } ], and it's function prev username value: public static function getoldusername($id) { return static::findidentity($id)->username; } but doesn't work, think $model->getid() return nothing because of static id (e.g: 23) work. [['username'], 'unique', 'on'=>'update', 'when' => function($model){ return static::getoldusername(23) !== $model->username; } ], how can model id? or if have other ways skip yii2 unique validation on update action if new value equ

web - Using <base> tag in html does not work when calling an api -

i want run calls outside of web service through website proxy. call proxy http://localhost/proxy?url=http://www.somewebsite.com/ . my problem lies when want route resources through proxy. add base tag html page so, <base href = "http://localhost/proxy?url=http://www.somewebsite.com" /> in order call image @ http://www.somewebsite.com/someimage.jpeg so, <img src = "someimage.jpeg" > this doesn't work , tries image http:localhost/someimage.jpeg is there way make base tag work or have other technique.

java - What should be done in Activity/Fragment and ViewModel in MVVM -

Image
our company has been developing android application using mvp pattern while. mvp, put business logic inside presenter , activity/fragment responsible view update when receiving event callback presenter. now, decided try mvvm using android databinding. seems mvvm, can put business logic in viewmodel (just presenter in mvp) , notify view(s) of changes data model, in 1 object. but then, raise question in our mind, should left handle activity/fragment? since adopted mvp pattern avoid fat-activity/fragment . don't want have slim-activity/fragment , fat-viewmodel . what think can left handle activity/fragment far request/check permission access context access resources every correction, comment or suggestion welcome since i'm new mvvm, if seems similar mvp. thank you. a bit more question is possible , practice combine mvvm listener (like mvp)? example public class mainactivityviewmodel extends baseobservable { mainactivityviewmodellistener listener;

c# - Regarding Frame extraction from the HD Video with the help of time(in the form of seconds as shown below) of the Video position -

i using emgucv 3.1.0 library, using fetching frames shown below... _capture.setcaptureproperty(emgu.cv.cvenum.capprop.posmsec, 17.567); image"<"bgr, byte">" frame = capturedata.queryframe().toimage"<"bgr, byte">"(); picturebox1.image = frame.tobitmap(); in above piece of code 17.567 time of video frame. fetching video frame of time , displaying on picturebox control. here setcaptureproperty function taking long time fetch frame hd video. due performance got reduced.... please ignore double quotes in source code... can please in this... in advance...

Book index layout style with bottom line in HTML and CSS -

Image
how can achieve layout in html & css ? maybe table, need center column fill blank space border-bottom (or else) here codepen <table class="table"> <tbody> <tr> <td> <h5>index 1</h5></td> <td> <span class="line">&nbsp;</span> </td> <td> content </td> </tr> <tr> <td> <h5>index 2</h5></td> <td> <span class="line"></span> </td> <td> content </td> </tr> </tbody> </table> try this <table class="table"> <tbody> <tr> <td class="index"> <h5>index 1</h5> </td> <td> content </td> </tr> <tr> <td class=

javascript - Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery -

is there way select/manipulate css pseudo-elements such ::before , ::after (and old version 1 semi-colon) using jquery? for example, stylesheet has following rule: .span::after{ content:'foo' } how can change 'foo' 'bar' using jquery? you pass content pseudo element data attribute , use jquery manipulate that: in html: <span>foo</span> in jquery: $('span').hover(function(){ $(this).attr('data-content','bar'); }); in css: span:after { content: attr(data-content) ' other text may want'; } if want prevent 'other text' showing up, combine seucolega's solution this: in html: <span>foo</span> in jquery: $('span').hover(function(){ $(this).addclass('change').attr('data-content','bar'); }); in css: span.change:after { content: attr(data-content) ' other text may want'; }

javascript - Remove timepicker effect from textbox -

i have seen previous question asked problem. don't want replace textbox same id. when timepicker selected in dropdown timepicker should enable in textbox(which run expected) when dropdown value changes textbox textbox should treated simple text function changetype(control){ if(control.value == "time"){ $("#txtinput").timepicker(); } else { $("#txtinput").val(''); // want remove timepicker textbox } } .input-group-addon:after{ content:'\0777' } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-timepicker/0.5.2/css/bootstrap-timepicker.min.css" rel="stylesheet"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-timepicker/0.5.2/js/bootstrap-timepicker.min.js">

If I have multiple apps installed in a single iOS device, can I send a single non-duplicate notification for all of them? -

i have requirement of sending notifications devices have apps installed. i need send notification, of apps. no single device must show notification twice. i want user see notification if app not running. can use apple push notification services send 1 notification single device regardless of how many of apps installed in device? if not other solutions can use?

php - How to add Cash on Delivery fee to opencart? -

i'm trying add fee "cash on delivery" module (within payments). have added fields cost , tax_class_id in database , in form. the cost appears in checkout form, how add cost total of cart? i have controllers , found totals of checkout calculated piece of code: $totals = array(); $taxes = $this->cart->gettaxes(); $total = 0; $total_data = array( 'totals' => &$totals, 'taxes' => &$taxes, 'total' => &$total ); by output result of $total_data this: array ( [totals] => array ( [0] => array ( [code] => sub_total [title] => sub-total [value] => 25 [sort_order] => 1 ) [1] => array ( [code] => shipping [title] => lift on store [value] => 0

javascript - How to Exclude files from jest watch? -

i'm doing bizarre stuff using jest testing i'm writing stuff disk. if use watch flag in jest i'm finding (quite obviously) each time write disk tests re-fire again. i don't have sort of configuration, , i've taken @ documentation it's not clear me option need using suppress watching particular files. believe can see options exclude code code-coverage, test execution not actual watcher. in case i've got setup , want suppress results directory: __tests__ __snapshots__ (created jest) results (created me , directory exclude) testfile1.js can shed light on doing this? from documentation need add modulepathignorepatterns array of string values matched against modulepathignorepatterns [array] # (default: []) array of regexp pattern strings matched against module paths before paths considered 'visible' module loader. if given module's path matches of patterns, not require()-able in test environment. th

javascript - Posting entire model back to controller using ajax -

i beginner in asp.net mvc , web technologies. stuck @ point. have create user page. when admin user wants add new user, redirected create user page empty data class. in page, data class filled up. want return model's data controller using post method. what trying achieve directly post entire model json object controller , null. on create new user click : [httpget] public actionresult createuser() { var newuser = new user(); return view(newuser); } my createuser view code : @model webapplication7.models.user @{ layout = null; } <!doctype html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>createuser</title> <h2>create new user</h2> </head> <body> <div> <table> <tr> <td>username : </td> <td> @html.textboxfor(model => model

html - How to put filter on a field in QWEB -

i want put filter on field in qweb such that,when select city "pune" , corresponding pincodes should displayed , not all. here code city , zip <label class="control-label" for="city">city</label> <select name="city_id" class="form-control"> <option value="">city...</option> <t t-foreach="cities or []" t-as="city"> <option t-att-value="city.id" t-att-selected="city.id == checkout.get('city')"><t t-esc="city.city_id"/></option> </t> </select> <label class="control-label label-optional" for="zip">zip / postal code</label> <select name="zip_id" class="form-control"> <option value="">zip...</option> <t t-foreach="zips or []" t-as="zip_id"> <option t-att-value="zip_id.

python - Theano: mixing CPU and GPU? -

i built neural network needs use cholesky decomposition , solve triangular systems part of computation. means need compute gradients of whole computation, of course. when try compile code error "no cula available". unfortunately, can't download cula website . i wondering if it's possible mix cpu , gpu theano. matrices need use cholesky , solve on small (100x100) part on cpu. so, though, i'd need transfer matrices cpu right after they've been computed gpu , send result gpu. possible transparently enough? this transfer transparent. no need special. recommand profile theano graph, sure: http://deeplearning.net/software/theano/tutorial/profiling.html#tut-profiling for cula, there pr give solve op based on cusolver provided nvidia. not needed anymore. try pr: https://github.com/theano/theano/pull/4917

ubuntu - CNTLM doesn't work with cURL -

in virtual server use cntlm local proxy accessing ntlm authentication. when execute command: sudo curl -x "http://google.com" it's work fine, when specify port, this: sudo curl -x "http://google.com:443" i got error - %bla-bla-bla% network unreachable %bla-bla-bla%. maybe wrong configured /etc/cntlm.conf? please, me. p.s. use ubuntu 14.04 under virtualbox(with vagrant). you missed "secure" in protocol: http://google.com:443 not exist.

C++ calculate distance between structure of inputed and saved points and the origin, print out list according on distance -

in task simplified version of obstacles shall modeled points detected imaginary sensor system placed in origin of 2 dimensional local cartesian coordinate system. arbitrary many of such obstacles /points in front of vehicle shall possible store in list. list shall sorted euclidian distance origin (see examples below). (hint: write function calculate euclidian distance d of 2 obstacles/points p1 , p2 coordinates (x1,y1) , (x2,y2) formula: d=√(x1−x2)2+(y1−y2)2 identify them each obstacle/point shall store string ("a", "b", ... in example above), distance , coordinates (xi,yi). (hint: give type definition structure these 4 data components/variables of structure.) in loop in function main arbitrary many of such obstacles/points shall possible inputted , stored in list. afterwards sorted distance list shall outputted. beside string, distance , coordinates in each output string of nearest obstacle/point shall computed , outputted additionaly (see example below). (hin