Posts

Showing posts from May, 2015

regex - How to QRegExp "[propertyID="anything"] "? -

i parsing file contains following packets: [propertyid="123000"] { fillcolor : #f3f1ed; minsize : 5; linewidth : 3; } to scan [propertyid="123000"] fragment havre qregexp qregexp("^\b\[propertyid=\"c+\"\]\b"); but not work? here have example code parse file above: qregexp propertyidexp= qregexp("\\[propertyid=\".*\"]"); propertyidexp.setminimal(true); qfile inputfile(filename); if (inputfile.open(qiodevice::readonly)) { qtextstream in(&inputfile); while (!in.atend()) { qstring line = in.readline(); // if not catch if line instance // [propertyid="123000"] { if( line.contains(propertyidexp) ) { //.. further processing } } inputfile.close(); } qregexp("\\[propertyid=\".+?\"\\]") you can use . .it match character except newline .also use +? make non greedy or stop @ last instance of

Apply rule based grouping on Java enum -

(this question not require knowledge of xstream such) below request xml structure unmarshalled root java bean using xstream - <root> <entity> <action>...</action> <type>...</type> <data>...</data> </entity> </root> since data node polymorphic can map either of beans i.e. dataabc, datapqr, dataxyz , on : <data> <a>aaa</a> <b>bbb</b> <c>ccc</c> </data> or <data> <p>ppp</p> <q>qqq</q> <r>rrr</r> </data> or <data> <x>xxx</x> <y>yyy</y> <z>zzz</z> </data> xstream helps in umarshaling bean : root root = xstream.fromxml(rootxml) there configurer interface helps in configure xstream object mapping xml tags of section actual pojo bean : interface configurer<t> { public void configure(t t); } enum confi

javascript - Generating Canvas width and height attributes to be the same size as a rectangle of user inputted size -

the code below, on start up, generates rectangle same size canvas correct. problem when user clicks button new canvas generated rectangle not appear. please help. <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script> <script> $(document).ready(function(){ <!-- function change <canvas> attributes of "width" , "height" same size rectangle --> $("#btn").click(function(){ $("#mycanvas").attr("height", $("#height").val()); $("#mycanvas").attr("width", $("#width").val()); }); }); </script> </head> <body> &nbsp;rectangle width: <input type="number" id="width" value="400"> &nbsp;rectangle height: <input type="number" id="height" value="400"> &nbsp;

ember.js - How to get the changed Object in ember observer -

i want changed object in ember observer in view, watchstatus: ( -> console.log "i want changed object here???" map = @get('map') trucks = @get('controller.model.content') = 0 while < trucks.length @makemarker trucks[i], map i++ ).observes('controller.model.content.@each.status') you should use array observer then. http://emberjs.com/api/classes/ember.array.html#method_addarrayobserver

.net - How to include IrdaClient.dll in Visual Studio -

i want use irdaclient class detect irda devices. i have added following name spaces. using system.net.sockets; using system.io; but still there no such class available. am missing anything?? irda available on: platforms windows ce, windows mobile smartphone, windows mobile pocket pc source

How to merge fields of Excel when certain criteria meet -

Image
i need merge rows have matching data. criteria if column sales order having same value should merge values of purchase order related sale order before after i have tried this sub test() dim c long, stdesc string, sttype string, dt date dim withdrawn double, dpaidin double, dbal double c = 1 while range("a2").cells(c, 1) <> "" if range("a2").cells(c, 1) > 0 dt = range("a2").cells(c, 1) ' dt = range("a2").cells(c, 1) sttype = range("b2").cells(c, 1) stdesc = stdesc & " " & range("c2").cells(c, 1) c = c + 1 loop until range("a2").cells(c, 1) <> "" range("a" & rows.count).end(xlup).offset(1, 0) = dt range("a" & rows.count).end(xlup).offset(0, 1) = sttype range("a

c# - How to organise Views into folders in Asp.net visual studio? -

i have been forking on project while , ended having lot of view different models. wandering whether possible organise these views sub folders. clear want following: controllers: mycontrollers(folder)-> myfirstcontroller.cs mysubcontroller(folder)-> mysubcontroller.cs views: myfirst(folder)-> index.cshtml mysub(folder)-> index.cshtml you allowed put views , controllers wherever want. can customize view paths on app_start event. see tha answer in topic: can specify custom location "search views" in asp.net mvc? i though recommend using standard project structure , paths. makes life easier other developers work code in future eventually.

c# - XML get value of td cell using XPath expression -

im attempting td cell values within table cell without name/id table row using xpath expression haven't been able resolve it. readers let me know im wrong? xmldocument xmldoc = new xmldocument(); xmldoc.load("c:\\trial.html"); xmlnamespacemanager nsmgr = new xmlnamespacemanager(xmldoc.nametable); nsmgr.addnamespace("ns", "http://www.w3.org/1999/xhtml"); xmlnode root = xmldoc.documentelement; system.xml.xmlnodelist rownodes = root.selectnodes(@"ns:body/ns:div[@id='index']/ns:div[@class='container']/ns:div[@class='maintext']/ns:table[@class='a_table']/ns:tr[@class='a_table_row']", nsmgr); foreach (xmlnode xmlnode in rownodes) { // there way nodes td values(non-empty)? attempts // seem wrong //system.xml.xmlnodelist tds = xmlnode.selectnodes("//td[text()]", nsmgr); //system.xml.xmlnodelist tds = xmlnode.selectnodes("

javascript - Anchor doesn't work in chrome and safari browsers -

i have problem: html anchor doesn't work in chrome , safari. page goes down instead of up. have html: <a id="to-top"></a> <a class="button totop" href="#" onclick="document.getelementbyid('to-top').scrollintoview(true);return false;">Вверх</a> and javascript code: var topscreen = window.pageyoffset ? window.pageyoffset : document.body.scrolltop; var myscreen = screen.availheight; if(topscreen > (myscreen / 3)) { $(".totop").fadeto(0, 1.0); } else { $(".totop").fadeto(0, 0); scss: .totop { display: none; position: fixed; bottom: 20px; right: 20px; z-index: 999999; transition: opacity 1s ease-out; outline: none; &:hover { transition-delay:0s; } { color: #fff; text-decoration: none; &:hove

go - Why do these goroutines not scale their performance from more concurrent executions? -

Image
background i working on bachelor thesis , task optimise given code in go, i.e. make run fast possible. first, optimised serial function , tried introduce parallelism via goroutines. after researching on internet understand difference between concurrency , parallelism following slides talks.golang . visited parallel programming courses parallelised c/c++ code of pthread/openmp, tried apply these paradigms in go. said, in particular case optimising function computes moving average of slice length len:=n+(window_size-1) (it equals either 9393 or 10175), hence have n windows of compute corresponding arithmetic average , save in output slice. note task inherently embarrassing parallel. my optimisation attempts , results in moving_avg_concurrent2 split slice num_goroutines smaller pieces , ran each 1 goroutine. function performed 1 goroutine, out of reason (could not find out why yet, getting tangent here), better moving_avg_serial4 more 1 goroutine started perform worse

javascript - Add element to existing Canvas -

i have this canvas , using chartjs , make legend merge in graphic canvas . see code: var radarchartdata = { labels: ["item1", "item2", "item3", "item4"], datasets: [ { label: "linha1", fillcolor: "rgba(220,220,220,0)", strokecolor: "rgba(220,220,220,1)", pointcolor: "rgba(220,220,220,1)", pointstrokecolor: "#fff", pointhighlightfill: "#fff", pointhighlightstroke: "rgba(220,220,220,1)", data: [2,2,2,2] }, { label: "linha2", fillcolor: "rgba(151,187,205,0)", strokecolor: "rgba(151,187,205,1)", pointcolor: "rgba(151,187,205,1)", pointstrokecolor: "#fff", pointhighlightfill: "#fff", pointhighlightstroke: "rgba(151,187,205,1)", data: [8,8,8,8] } ] }; window.myradar = new chart(docume

r - Rainfall intensity from a tipping bucket -

in field of hydrology, common work rainfall data tipping bucket. registers every time bucket filled with, instance, 0.2 mm or 0.5 mm of water. i import kind of data r, not find smooth way it. got answers question creating regular 15-minute time-series irregular time-series , still miss 1 part of how process data: smoothing during low-intensity rainfall. this small part of data tipping bucket in malmö, sweden. 0.2 registered every 0.2 mm of rainfall: rainfall depth[millimeter]:instantaneous undefined[undefined]:instantaneous time m05_bulltofta_vippning flag 2014-08-31 04:09:22 0.2 0 2014-08-31 04:12:14 0.2 0 2014-08-31 04:17:49 0.2 0 2014-08-31 04:20:00 0.2 0 2014-08-31 04:22:10 0.2 0 2014-08-31 04:23:31 0.2 0 2014-08-31 04:24:49 0.2 0 2014-08-31 04:25:49 0.2 0 2014-08-31 04:28:14 0.2 0 2014-08-31 04:36:22 0.2 0 2014-08-31 04:41:06 0.2 0 2014-08-31 04:42:58 0.2 0 2014-08-31 04:43:33 0.2 0 2014-08-31 04:45:03 0.2 0 2014-08-31 04:47:47 0.2 0 2014-08-31 04:49:49 0.2 0 2014

angularjs - angular-translate not working on templates -

Image
i'm trying make use of angular-translate localization, i'm having issue works on home page. after clicking on link, next page isn't translated @ all. the weird thing navbar translations(located on index.html) still translate properly, content in ngview isn't translated. controller other page empty. -app.js var myapp = angular.module('myapp', ['ngroute', 'pascalprecht.translate']); myapp.config( function ($routeprovider) { $routeprovider. when('/signup', { templateurl: 'partials/signup.html', controller: 'signupcontrollers' }). otherwise({ templateurl: 'partials/home.html' }); }) .config(function ($translateprovider) { $translateprovider.usestaticfilesloader({ prefix: '/languages/', suffix: '.json' }); $translateprovider.preferredlanguage('en'); }); another thing noticed default page content on home.html translated properly, other p

go - Variable length two's complement to int64 -

i'm attempting write go program parse ans.1 ber two's complement integer encoding. however, integer can have either 1, 2, 3 or 4 byte length encoding (depending on size). according specification ( http://www.itu.int/itu-t/studygroups/com17/languages/x.690-0207.pdf ) leftmost bit complement. what's clean way this? func parseint(b []byte) (int64, error) { switch len(b) { case 1: // works return int64(b[0]&0x7f) - int64(b[0]&0x80), nil case 2: // left byte of b[0] -32768 case 3: // left byte of b[0] -8388608 case 4: // left byte of b[0] -2147483648 (and on 5, 6, 7, 8) case 5: case 6: case 7: case 8: default: return 0, errors.new("value not fit in int64") } } parseint([]byte{0xfe}) // should return (-2, nil) parseint([]byte{0xfe, 0xff}) // should return (-257, nil) parseint([]byte{0x01, 0x00}) // should return (256, nil) easier understand if r

python - Decorator NameError -

consider simple decorator demo: class decoratordemo(): def _decorator(f): def w( self ) : print( "now decorated") f( self ) return w @_decorator def bar( self ) : print ("the mundane") d = decoratordemo() d.bar() running gives expected output: now decorated mundane the type d.bar , d._decorator confirm <class 'method'> if add following 2 lines end of above code. print(type(d.bar)) print(type(d._decorator)) now if modify above code define bar method before defining _decorator method, error @_decorator nameerror: name '_decorator' not defined why ordering of methods relevant in above case ? because decorated method not 'method declaration' seems. decorator syntax suger hides this: def bar( self ) : print ("the mundane") bar = _decorator(bar) if put these lines before definition of _decorator , name error doesn't come

Linking Simpy simulation time to Python Calendar for week day specific actions -

i want build simulation model of production network simpy comprising following features regard time: plants work monday friday (with 2 shifts of 8 hours) heavy trucks drive on days of week except sunday light trucks drive on days of week, including sunday to purpose, want construct broadcastpipe given in docs combined timeouts make objects wait during days not working (for plants additional logic required model shifts). broadcastpipe count days (assuming 24*60 minutes each day) , "it's monday, everybody" . objects (plant, light , heavy trucks) process information individually , act accordingly. now, wonder whether there elegant method link simulation time regular python calender objects in order access days of week. useful clarity , enhancements bank holidays , varying starting days. have advise how this? (or general advice on how model better?). in advance! i set start date , define equal simulation time ( environment.now ) 0. since simpy’s simul

javascript - Get IP address from request object in Meteor -

i want retrieve client's ip address before redirect client external url. here code: router.route('/:_id', {name: 'urlredirect', where: 'server'}).get(function () { var url = urls.findone(this.params._id); if (url) { var request = this.request; var response = this.response; var headers = request.headers; console.log(headers['user-agent']); this.response.writehead(302, { 'location': url.url }); this.response.end(); } else { this.redirect('/'); } }); my question is: can ip address request object? according the iron-router guide , request this.request typical nodejs request object: router.route('/download/:file', function () { // nodejs request object var request = this.request; // nodejs response object var response = this.response; this.response.end('file download content\n'); }, {where: 'se

php - MYSQL natural sorting not behaving as expected -

natural sorting isn't behaving expected on query. don't understand why. having looked @ site http://www.copterlabs.com/blog/natural-sorting-in-mysql/ , method works part. however, alpha part of 'code' means sorting occurs in odd way. result m1 .. m3 p1 .. p3 m10 .. m19 p10 .. p19 expected m1 .. m3 m10 .. m19 p1 .. p3 p10 .. p19 code 'select * stock order length(code), code'; you sort first length of field. of course mixes result in wrong way. try splitting alphanumeric values , numbers select * stock order substr(code, 1, 1), substr(code, 2, 99) * 1 *1 converts string number. use cast(substr(code, 2, 99) signed)

ios - Customizations on UILocalNotification for Apple Watch -

i'm seeing lot of resources online talk customizing notifications apple watch. though fail find 1 mentions customization of sound , duration. is possible customize sound notification on watch? know can use localnotification.soundname = "audio.caf" , it's not playing/working on watch. if there working solution, direct me these resources? also, want make notification duration longer. workaround send multiple notifications using repeatinterval this. there cleaner way doing this? localnotification.repeatinterval = nscalendarunit.calendarunitsecond

php - Wordpress Using Ajax Jquery to reference custom post thumbnail -

ok, trying populate form featured image custom post type based on input of form field (in case - slug custom post type). can't seem around 500 internal server error when try access db external php script i'm using $wpdb class. here's javascript: function updateprevimage(did){ jquery("form .form-designdetails-front div#design-preview").html("put animated .gif here").show(); var thumbquery="/scripts/getdesignprev.php"; jquery.post(thumbquery,{designid:did},function(data){ jquery("form .form-designdetails-front div#design-preview").html(data).show(); }); } jquery("#field_g6zk24").change(function(did){ var did=jquery("#field_g6zk24").val(); updateprevimage(did); }); i'm quite have jquery written properly. it's php that's problem think. <?php // design slug form field //$designid=$_post['designid']; require_once('../wp-blog-header.php'

python - sklearn issue: Found arrays with inconsistent numbers of samples when doing regression -

this question seems have been asked before, can't seem comment further clarification on accepted answer , couldn't figure out solution provided. i trying learn how use sklearn own data. got annual % change in gdp 2 different countries on past 100 years. trying learn using single variable now. trying use sklearn predict gdp % change country given percentage change in country b's gdp. the problem receive error saying: valueerror: found arrays inconsistent numbers of samples: [ 1 107] here code: import sklearn.linear_model lm import numpy np import scipy.stats st import matplotlib.pyplot plt import matplotlib.dates mdates def bytespdate2num(fmt, encoding='utf-8'):#function convert bytes string dates. strconverter = mdates.strpdate2num(fmt) def bytesconverter(b): s = b.decode(encoding) return strconverter(s) return bytesconverter datacsv = open('combined_data.csv') comb_data = [] line in datacsv: comb_dat

php - Sonata throwing RuntimeException on add pages -

sonata throwing following exception when trying add elements using crudcontroller , doctrine: you using closure `inlineconstraint`, constraint cannot serialized. need re-attach `inlineconstraint` on each request. once done, can set `serializingwarning` option `true` avoid message. any idea , how deactivate , cause of exception? don't see in docs well. it thrown here: in vendor/sonata-project/core-bundle/validator/constraints/inlineconstraint.php @ line 34 this resolved when using version dev-master in composer.json: "sonata-project/admin-bundle": "dev-master" this pulls newest version 2.3.6 of sonatacore includes lastest changes rande: https://github.com/sonata-project/sonataadminbundle/pull/3179

ubuntu - Unable to install PHP 5.5 -

i had lamp server installed on ubuntu 12.10 php 5.3. had remove used this link . now trying install lamp php 5.4 or higher using ondrej ppa end installing 5.3.10 again , again. install using below commands : for 5.5 tried, sudo add-apt-repository ppa:ondrej/php5 and 5.4 tried, sudo add-apt-repository ppa:ondrej/php5-oldstable and regular update , install sudo apt-get update sudo apt-get upgrade sudo apt-get install php5 however in end when run php -v see version installed 5.3.10-1ubuntu3.19 i have tried restarting web server. still noting changes. dont know going wrong.

datepicker - aui date picker, calendar with maximumDate attribute -

when set aui datepicker calendar maximumdate attribute , not getting selected (it's kind of weird though). till noon working, later not. i using liferay 6.2 ee sp8. using hook trying change html\taglib\ui\input_date\page.jsp <% calendar calendarcurrentdate = calendarfactoryutil.getcalendar(); %> <% if((portalutil.getportletnamespace(portletkeys.journal)).equals(namespace) && name.equals("expirationdate")){ %> calendar: { maximumdate: new date(<%= calendarcurrentdate.get(calendar.year)+1 %>, <%= calendarcurrentdate.get(calendar.month) %>, <%= calendarcurrentdate.get(calendar.day_of_month) %>) }, <% } %> full datepicker code below <aui:script use='<%= "aui-datepicker" + (browsersnifferutil.ismobile(reque

php - apache 2.2 to 2.4 sporadic performance drop -

i updated apache 2.2 2.4 , php 5.3 5.4. reason experiencing huge performance drops in around 5% of requests server. on average, sites load in less 2 seconds in 5% of cases takes anywhere between 30 60 seconds of spinning before site loads. i copied old prefork settings startservers 8 minspareservers 5 maxspareservers 10 serverlimit 512 maxclients 512 maxrequestsperchild 4000: setup: 8 vcpu, 8gb ram, ssd cpu never goes on 30%, ram stays @ around 1.8gb. db on separate server , performs fast. debugged , never got slow query (nothing on minute). i performed 2.2 2.4 update steps here http://httpd.apache.org/docs/trunk/upgrading.html didnt help. there other way debug server , why slows down badly? not suspect php reason since codebase did not change. edit i need add when page spnning, can click on link, press enter , there big chnage load in under 2 seconds. have hit enter or refresh loading page 2 or 3 times , loads immediately.

cakephp difference between Router::scope and Router::prefix -

i know router's prefix method adds prefix routes still confused scope method routes.is alias prefix or has own use. router::prefix('api', function ($routes) { $routes->scope('/v1', function ($routes) { $routes->connect('/', ['action'=>'index']); $routes->connect('/:id', ['action'=>'view', ':id']); }); }); both allow sharing of common path segments. difference prefix controller within sub-namespace. from documentation : prefixes mapped sub-namespaces in application’s controller namespace ... using our users example, accessing url /admin/users/edit/5 call edit() method of our src/controller/admin/userscontroller.php passing 5 first parameter. view file used src/template/admin/users/edit.ctp in above case, scope controller @ src/controller/userscontroller.php .

Groovy Dynamically extend GStringImpl class to automatically invoke .toString() -

on this post @jalopaba explains in answer gstring can involve lazy evaluation it's not until tostring() method invoked gstring evaluated. can dynamically extend gstringimpl invoke tostring() on construction? wouldn't easier override put method of map check whether key gstring , if yes, invoke tostring method? after invoke original method new key. same get.

Inheritance in C# multiple properties for a single property -

how inherit 1 class , have multiples of single property example and here actual code (so far) class networkinterface { public double vlan; public string ip; } class port : networkinterface { public double portnumber; } public void test () { port newport = new port(); newport.portnumber = 7; newport.vlan = 100 } i want able add multiple interfaces 1 port i don't think should using inheritance here. if want port contain collection of networkinterfaces better definition of port might be: class port { public double portnumber; public networkinterface[] networkinterfaces; }

scala - Map.contains with a super-type of key type -

i have case where trait eventlike trait event extends eventlike trait api { private var map = map.empty[event, any] def contains(e: eventlike): boolean = map.contains(e) } this doesn't work because of invariance in map's key type: <console>:58: error: type mismatch; found : eventlike required: event def contains(e: eventlike): boolean = map.contains(e) ^ what work-around minimum performance penalty. is, don't want introduce terrible thing: def contains(e: eventlike): boolean = e match { case e1: event => map.contains(e1) case _ => false } is there different map implementation (may mutable thread local) use? you can declare map map[eventlike, any] : trait api { private var map = map.empty[eventlike, any] def contains(e: eventlike): boolean = map.contains(e) def add(e:event): unit = { map += (e -> ???) } } you can still p

How to merge multiples columns of a table into 1 in R -

i have data frame ( control.sub ) containing multiple columns ( t1,t2,t3,t4,t5,t6 ). want merge these columns one, na should removed. > control.sub t1 t2 t3 t4 29 5500024017802120306174.h01 5500024017802120306174.g02 5500024017802120306174.e03 5500024017802120306174.d04 810 5500024030401071707292.h01 5500024030401071707292.g02 5500024030401071707292.e03 5500024030401071707292.d04 4693 5500024035736031208612.g08 5500024035736031208612.e09 5500024035736031208612.d10 5500024035736031208612.b11 t5 t6 29 5500024017802120306174.b05 5500024017802120306174.a06 810 5500024030401071707292.b05 5500024030401071707292.a06 4693 5500024035736031208612.a12 <na> i want final outcome as: > control.sub t1 29 5500024017802120306174.h01 5500024017802120306174.g02 5500

JNA non-const String member of struct -

i have c function expects struct contains non-const string. typedef struct _a { char* str; } a; void myfunc(a* aptr) { ... } i've tried long time pass thing via jna didn't manage far. public class extends structure { public string str; protected list getfieldorder() { ... } doesn't work because string turned const char* instead of char* need. public class extends structure { public byte[] str; protected list getfieldorder() { ... } doesn't work because byte array inside struct gets turned contiguous memory , not pointer. i know can using memory , copying string over. can't imagine preferred way it. i tried like public class nonconststringmember extends structure { public static class byreference extends nonconststringmember implements structure.byreference {} public byte[] stringmember; protected list getfieldorder() { ... } public class extends structure { public nonconststringmember.byreference str; } but doesn&

visual studio - How can I know when a new version is available in source control? -

i've been relying on email alerts, don't doing that. there alert or notification or other clue within visual studio let me know need latest? if you're using tfvc, source control explorer show on file file basis whether have latest version. if you're using team rooms, team room can configured display notifications whenever user commits change. in general, shouldn't matter -- "get latest" few times day , resolve conflicts pop up.

php - Execute CRON 2 and 3 times per month? -

i have following issue. need run same script (with different args) in different 5 different dates. 1x per month 2x per month 3x per month 4x per month every day my current code: 1x month (run every month 1st day, 9:00) 0 9 1 * * php /script.php 1 2x month (need setup cron) ? php /script.php 2 3x month (need setup cron) ? php /script.php 3 4x month (run every monday, 9:00) 0 9 * * 1 php /script.php 4 every day (run every day, 9:00) 0 9 * * * php /script.php e crontab gives order of time values to define time can provide concrete values minute (m), hour (h), day of month (dom), month (mon), , day of week (dow) or use '*' you did not specify fixed day, i'll put sample data you. this cron run every 1st , 15th @ midnight 0 0 1,15 * * /script.php 2 this other every 1st,10th , 20th @ midnight 0 0 1,10,20 * * /script.php 3

javascript - Unable to track eyes using tracking.js -

i creating eye staring game. have used meteorjs, trackingjs tracking stuffs , peerjs streaming. in older version of trackingjs , eye detecting feature there in new version face detecting feature available. here demo app tracks face. http://sushantbaj.meteor.com/ , link github repo: https://github.com/sushant12/eye-staring in docs of trackingjs, said that in order use object tracker, need instantiate constructor passing classifier data detect: var objects = new tracking.objecttracker(['face', 'eye', 'mouth']); so passed 'eye' parameter did not track eye. var tracker = new tracking.objecttracker('eye'); tracker.setinitialscale(4); tracker.setstepsize(2); tracker.setedgesdensity(0.1); tracking.track('#video', tracker, { camera: true }); tracker.on('track', function(event) { context.clearrect(0, 0, canvas.width, canvas.height); event.data.foreach(function(rect) { conte