Posts

javascript - how to isolate scope using directive call a method from directive to controller and method using arguments -

here sample angularjs code .currently can't item name clicked . passed argument name attribute inside method directive template. method used in parent controller. <!doctype html > <html> <head> <style> .onoffswitch { position: relative; width: 90px; -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; } .onoffswitch-checkbox { display: none; } .onoffswitch-label { display: block; overflow: hidden; cursor: pointer; border: 2px solid #999999; border-radius: 20px; } .onoffswitch-inner { display: block; width: 200%; margin-left: -100%; -moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s; -o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s; } .onoffswitch-inner:before, .onoffswitch-inner:after { display: block; float: left; width: 50%; height: 20px; padding: 0; line-height: 20px; font-size: 8px; color: white; font-family:...

html - Non-breaking space between span content and text -

Image
can make non-breaking space between span content , text? read it, don't see same situation. <span style="some_style"> <span number="1">1</span>"some big text" </span> i need add non-breaking space between span content ( number="1" ) , first word after only. thank on seeing example image, i'm not sure asking need. i suspect 'number' span should outside containing block involve absolute positioning. like so. .some_style { display: block; width: 50%; margin: 1em auto; position: relative; text-align: justify; } span[number] { position: absolute; top: 0; left: -1em; } <span class="some_style"> <span number="1">1</span> lorem ipsum dolor sit amet, consectetur adipisicing elit. est incidunt ducimus facilis quae magnam vel sit alias consequatur voluptate modi repellat enim eaque soluta accusantium. </sp...

git - Gitolite support "public repository" authority? -

recent research in git, encounter problem : if want repository open public (no ssh key, can clone), gitolite can it? yes , no. yes, can add gitolite access rule allow read access everyone. r @all (using special group @all) but, independently of gitolite, if access git repo ssh url, need ssh key. without ssh key, means git hosting server should support http access (and call gitolite httpd configuration file)

How to put a new column after a "sort" in a google sheets doc? -

i have following issue: create column pulling data columns of dfferent sheets ctreate single column created unique values. i use column via transpose(sort(range)) create column headings on third sheet. my problem how can add "total" column without knowing how many columns there going be? easy enough via "if" statement check columns there , build queries, how add last column has me stumped. thanks the best way me create custom function though google script , use formula. can use following script //do not edit function addtotal(range) { return range+",total"; } and in sheet type range =split(addtotal(sort('report lookup'!f:f)),",") you don't need transpose in case

c++ - Qt4 to Qt5: QPainter::drawPixmapFragments() with 5 arguments - how to solve? (Updated) -

qt 4.8 (4.8.6) has qpainter::drawpixmapfragments() overloaded function 5 arguments: void drawpixmapfragments(const qrectf *targetrects, const qrectf *sourcerects, int fragmentcount, const qpixmap &pixmap, pixmapfragmenthints hints = 0); qt 5 (5.4.1) has no such function, has 1 (same in qt 4.8) 4 arguments: void drawpixmapfragments(const pixmapfragment *fragments, int fragmentcount, const qpixmap &pixmap, pixmapfragmenthints hints = 0); i've searched in wiki.qt.io , here on stackoverflow , several other places, there no answer how port qt 4.8 qt 5. does know how it? upd i've taken realization qt 4.8.6 source ( qpainter.cpp ) , transform take pointer qpainter first parameter: namespace oldqt { void drawpixmapfragments(qpainter *painter, const qrectf *targetrects, const qrectf *sourcerects, int fragmentcount, const qpixmap &pixmap, qpainter::pixmapfragmenthints hints) { // q_d(...

matplotlib - Python: how to plot points with little overlapping -

Image
i using python plot points. plot shows relationship between area , # of points of interest (pois) in area. have 3000 area values , 3000 # of poi values. now plot looks this: the problem that, @ lower left side, points severely overlapping each other hard enough information. areas not big , don't have many pois. i want make plot little overlapping. wondering whether can use unevenly distributed axis or use histogram make beautiful plot. can me? i suggest using logarithmic scale y axis. can either use pyplot.semilogy(...) or pyplot.yscale('log') ( http://matplotlib.org/api/pyplot_api.html ). note points area <= 0 not rendered.

c++ saving object allocation and deletion -

i'm working on little game, , need somes class/struct allocated , deleted often. i'm wondering way save deletion, maybe putting delete object in container, , try pick in container when want allocate instance of class. i'm thinkin overload of new , delete operator. have little problem, if overload delete operator (to put "deleted" object in container), how delete it? should pass throught proper function that? there 2 ways go that 1) pool of objects. when "allocate" take object pool , when deallocate return pool. not transparent implementation not hard. 2) create custom allocator classes/structs. preallocate memory in big buffer , when need allocate take memory there , when need deallocate return memory (the actual mechanism you). bit harder implement can more transparent. check following links ideas http://www.drdobbs.com/policy-based-memory-allocation/184402039 http://www.boost.org/doc/libs/1_57_0/doc/html/interprocess/allocators...