Posts

html - onclick to forward request to other URL -

i want open page on click of link. below link. <a href='#' onclick=window.open('\\122.96.212.765\spread\form\5.0\tx1\na\show\spread_show_ _33_pm\index_vin_test_zasf91a.htm','_self') >click here</a>. but when click above link 404 error displayed on page url changing below: http://localhost:8080/122.96.212.765spreadform%05.spread_show_ _33_pmindex_vin_test_zasf91a.htm please suggest, need add ay code onclick work. can try changing \'s /'s

Make haar feature scale -

this code import java.awt.image.bufferedimage; public class haarfeature { public static void getfeature(bufferedimage image){ int width = image.getwidth(); int height = image.getheight(); //int feature_width=1*scale_width; //int feature_height=1*scale_height; int[][] ii = integralimage.convintegralimage(image); int white=0; int black=0; int feature=0; for(int i=0;i<height;i++){ for(int j=0;j<width;j++){ if(i<(height-1) && j<(width-3)){ if(i==0 && j==0){ black=ii[i][j+3]; white=ii[i+1][j+3]-ii[i][j+3]; feature=black-white; system.out.print(feature+" "); } else if(i==0){ black=ii[i][j+3]-ii[i][j-1]; white=ii[i+1][j+3]+ii[i][j-1]-ii[i][j+3]-...

jquery - How to extract substring between specific characters in javascript -

how extract "51.50431" , "-0.1133" latlng(51.50431, -0.1133) using jquery. tried using substring() not helpful numbers in latlng(51.50431, -0.1133) keep on changes in different ranges. time can come latlng(51.50, -0.1). help? regular expressions rescue: 'latlng(51.50, -0.1)'.match(/latlng\(([^,]+),\s*([^)]+)\)/) // ["latlng(51.50, -0.1)", "51.50", "-0.1"]

algorithm - segment tree with lazy propagation in large range -

can please tell me how lazy propagation works in segment tree if want update values in range? also, how problem using segment tree , lazy propagation? suppose there 15 boys in row, standing facing east, , after 3 moves range [3,6] facing north, , after 2 moves facing west. how update range if our row size around 10 6 ? clockwise direction [east-->south-->west-->north-->east] for example: suppose there n students standing facing east, , have move students 3 6 2 moves in clockwise direction. thus, after move, students "e e w w w w e e e e". then, want find max number of students in range standing facing same direction. in example, if find answer in range [1,6], there 2 students facing east , 4 facing west, answer 4. http://wcipeg.com/wiki/segment_tree#lazy_propagation to problem: suppose have n people. create segment tree addition n leafs value 0 initially. if want turn people indices j clockwise, update [i..j] range +1, if counterclockwise --...

Circular Type References in TypeScript -

i new typescript , trying understand how can setup circular reference between 2 types. reference need not full code reference, interfaces, interfaces defined in separate files. example, let's have 2 interfaces: parent , child. doubly-linked such parent has collection of children , each child has reference parent (as seen below). how setup imports or dependencies these can defined in separate files? interface parent { children: child[] } interface child { parent: parent } two solutions below. prefer latter since offers clean interfacing node js modules, unfortunately ide doesn't (yet) as do... use references create definitions.d.ts file contain references classes/interfaces /// <reference path="parent.ts" /> /// <reference path="child.ts" /> in parent.ts , child.ts , point single reference, definitions.d.ts file /// <reference path="definitions.d.ts" /> use import...require pass --module com...

ios - NSMutableArray in Custom cell implementation issue -

Image
so had code on specialoffercell.h #import <uikit/uikit.h> #import "afimagepager.h" @interface specialoffercell : uitableviewcell<afimagepagerdatasource,afimagepagerdelegate> @property (nonatomic, retain) nsmutablearray *arrayimages; @property (nonatomic) nsinteger offer_id; -(void)loadimages; @property (weak, nonatomic) iboutlet afimagepager *imageicons; @property (weak, nonatomic) iboutlet uilabel *titlelabel; @property (weak, nonatomic) iboutlet uilabel *desclabel; @end and implementation file #import "specialoffercell.h" @implementation specialoffercell @synthesize arrayimages; - (id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier { self = [super initwithstyle:style reuseidentifier:reuseidentifier]; if (self) { } return self; } - (void)awakefromnib { // initialization code self.imageicons.delegate=self; self.imageicons.datasource=self; } -(nsarray*)getarrayimages{ return [nsarray arraywithar...

python - Elementtree and counter - finding corresponding value -

this question exact duplicate of: loop inside loop - python 1 answer i have element tree python code counter. need specific name (product name, supplier name , supplier id) . below code me product id highest quantity sold. need product name, supplier name , supplier id corresponding product id orders = root.findall("./orders") total ={} order in orders: orderdetails = order.findall("./orderdetails") detail in orderdetails: productid = detail.findall("./products/productid")[0].text quantity = detail.findall("./quantity") if productid in total.keys(): total[productid]+=float(quantity[0].text) else: print productid,float(quantity[0].text) print total total[productid ]=float(quantity[0].text) print counter(total).most_common(1)[0][0] ...