Posts

Showing posts from May, 2012

vba excel: how to copy worksheet with images but without buttons -

i have worksheet image , 2 buttons. (invoice) copy worksheet image without 2 buttons new sheet of new workbook , wanna vba macro. in moment usual copy command , use delete command 2 buttons. i sure there easier way it. tried this... application.copyobjectswithcells = false sheets("invoice").select sheets("invoice").move after:=workbooks("invoices").sheets(1) application.copyobjectswithcells = true these looses buttons image gone. keep image. i hope guys can me this. thanks in advance. the explanations in comments in code below: option explicit sub copysheet_wo_btn() dim newwb workbook dim shtorig worksheet dim obj oleobject dim picshape shape dim picleft double dim pictop double set shtorig = thisworkbook.sheets("invoice") ' loop through objects in "invoice" sheet each obj in s

javascript - How do i read multiple json objects in django using POST method -

i sending multiple json object server , django views how multiple json objects , extracting each key value. <html> <head> <link rel="stylesheet" href='/static/js/file.txt' type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function() { $.get('static/js/file.txt', function (data) { var lines = data.split("\n"); var dict = {}; $.each(lines, function (n, elem) { var fields = elem.split("\t"); var service_id = fields[0]; dict[fields[0]] = {'owner':fields[1],'email':fields[2],'phone':fields[3], 'model':fields[4],'date':fields[5],'problem':fields[6]}; }); var jsonobj = json.stringify(dict); //console.log(dict); $.ajax({ type: &

apache - Too many redirects error and browser shows -

with reference htaccess rewriterule redirecting parent directory? thank francesco casula, answer helpful, application redirects 1 document root other. facing infinite redirects issue. i have following repositories different version. /var/www/portal/version/1.1.1/public/ binded (api.somedomain.com) /var/www/portal/version/1.1.2/public/ /var/www/portal/version/1.1.3/public/ /var/www/portal/version/1.1.4/public/ i want execute api in following order (by version) api.somedomain.com/qr ---> /var/www/portal/version/1.1.1/public/ api.somedomain.com/v2/qr ---> /var/www/portal/version/1.1.2/public/ api.somedomain.com/v3/qr ---> /var/www/portal/version/1.1.3/public/ api.somedomain.com/v4/qr ---> /var/www/portal/version/1.1.4/public/ my httpd.conf is aliasmatch ^/v2/(.*)$ "/var/www/portal/version/1.1.2/public/" <directory "/var/www/portal/version/1.1.2/public"> options indexes followsymlinks multiviews allowoverride

sql server - SQL Like operator return null -

when use like operator on column string type, return 0 result there data matches criteria. even interesting 'ga' return 0 shown in example below. create table #temppersons ( firstname varchar(255) ); insert #temppersons (firstname) values ('anne daugaard') insert #temppersons (firstname) values ('jenne neergaard') insert #temppersons (firstname) values ('mark daugaard') insert #temppersons (firstname) values ('hans daugaard') insert #temppersons (firstname) values ('alle daugaard') insert #temppersons (firstname) values ('kent daugaard') insert #temppersons (firstname) values ('mavi gilbeert') select * #temppersons firstname '%ga%' if object_id(n'tempdb..#temppersons', n'u') not null drop table #temppersons; no result when firstname 'ga', when firstname 'gaa' or 'daugaa' there hits. is 'ga' special?

ios - How to call REST service in Swift 3.0 -

i need call simle rest client https://httpbin.org/ip , paste json result label field in ios device. i'm writing in xcode 8.0, , swift version 3.0. found many tutorials, of them written older versions of swift. compiler failing , cannot fix it. seems newer version have significant changes. can please provide working example. appreciated lot. thanks. in example expecting see rest invocation , reading result. you can try this, works well. @iboutlet weak var iplabel: uilabel! override func viewdidload() { super.viewdidload() let parsedata = parsejson(getjson("https://httpbin.org/ip")) let ipvalue = parsedata.valueforkey("origin") self.performselectoronmainthread(#selector(viewcontroller.updateiplbl(_:)), withobject: ipvalue, waituntildone: false) } func getjson(urltorequest:string) -> nsdata { return nsdata(contentsofurl: nsurl(string: urltorequest)!)! }

ruby - How to get path name of a file in Rails 5.0? -

i working on rails script, , need path name of file uploaded, did same in laravel recently, quite easy, here code used @ time: $img->getpathname(); but don't have idea how same in rails. this guide having various ways pathname, may helps you: https://ruby-doc.org/stdlib-1.9.3/libdoc/pathname/rdoc/pathname.html

caching - How java.uitl.zip.ZipFile caches files in java -

when run following code first time, running 25000ms(i.e. 25 sec) second time onward taking 24ms(i.e. 0.024 sec) closed eclipse , reopen run. till restart machine again, takes 24ms only. article http://www.oracle.com/technetwork/articles/java/compress-1565076.html says java.uitl.zip.zipfile caches. how? caches? how can clear cache? public class sample { public static void main(string[] args) throws zipexception, ioexception { long st = system.currenttimemillis(); file dir = new file("c:/temp/packages"); file[] files = dir.listfiles(); for(file file : files) { zipfile zfile = new zipfile(file); } long et = system.currenttimemillis(); system.out.println(et - st); } } close zipfile using zipfile.close .

c# - How to overlay items in StackPanel or ListView? -

Image
i making card game , want display cards in player's hand half-covered each other. how can using listview or stackpanel? here example how display player hand. <grid background="green" > <image x:name="one" width="100" height="100" margin="10,10,250,210"/> <image x:name="two" width="100" height="100" margin="10,10,210,210"/> </grid> update i set margins listview's itemcontainerstyle , worked, have problem. width of listview items doesn't fit image , there spacing. how remove that. see image below xaml code. <listview grid.row="0" grid.column="0"> <listview.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal" /> </itemspaneltemplate> </listview.itemspanel> <listview.itemcontainerstyle>

javascript - Highcharts SVG element not updating. Custom Freeform Drawing inside Highchats? -

Image
i using highchart rendering graphs , using renderer in order draw custom line inside chart. want path recalculated , repainted whenever there data change. using highcharts-ng , angular same. code mentioned below:- { options: { chart: { type: 'line', margintop: 80, style: { fontfamily: 'serif', fontsize:14 }, events:{ redraw:function(e){ console.log(e) var elem=e.target.renderer.element() console.log(elem) console.log('i reloaded') } } //backgroundcolor:'rgba(255, 255, 255, 0.1)' }, exporting: { enabled: false },

java - Update counter in DB using JPA, avoiding manual synchronization -

i have counter entity below : each prefix (current year , month), maintaining counter need increment. @entity @table(name = "t_counter") @sequencegenerator(allocationsize = 1, name = "s_counter", sequencename = "s_counter") public class codecounter implements serializable { private static final long serialversionuid = 6431190800245592165l; @id @generatedvalue(strategy = sequence, generator = "s_counter") @column(name = "id") private long id; @column(name = "prefix", nullable = false,unique = true) private string prefix; @column(name = "counter", nullable = false) private integer counter; this simple jpa repository, using spring data : public interface codecounterrepository extends jparepository<codecounter, long> { @transactional codecounter findbyprefix(string prefix); } now, whenever service called, need right counter prefix (and create if doesn't exist yet, first time of month), increme

javascript - expoting big data to csv file - carshes -

im trying export big data csv files. (above 20000 lines... can on 100000 lines easily). after try download file, crashes - download failed due network failures. (managed download 18000 lines file, weighs 1.7mb, code worked perfectly. above 20000 download crashes) heres code... thanks! edit- works on ie, doesnt work in chrome var data2 = [[data12]]; var csvcontent2 = ""; data2.foreach(function (infoarray, index) { datastring = array.prototype.join.call(infoarray, ""); csvcontent2 += index < data2.length ? datastring + '\n' : datastring; }); var download = function(content, filename, mimetype) { var = document.createelement('a'); mimetype = mimetype || 'application/octet-stream'; if (navigator.mssaveblob) { // ie10 return navigator.mssaveblob(new blob([content], { type: mimetype }), filename); } else if ('download' in a) { //html5 a[download] a.href = 'data:' + mimetype +

javascript - Want to create a new instance of the component -

what want want create new ad should have title , desc user input when run code below create , [object object] , , why showing object instead of ad please explain var validatepost = react.createclass({ checkingpost: function() { var product_title = document.forms["post"]["pro_title"].value; var product_desc = document.forms["post"]["pro_desc"].value; var clearform = document.forms["post"]; var returnad = <newad title={product_title} desc={product_desc} /> var newproduct = document.getelementbyid("newproduct"); newproduct.innerhtml += returnad; clearform.reset(); }, render: function(){ return( <div> <button type="button" classname="btn btn-default" data-dismiss="modal">cancel</button> <button type="button" classna

Creating a loop statement to recieve a value based on a letter -

is recommended use for-each loop statement print out values (things) based on first letter? example "a" = apple, airplane. can continue statement used? package class_inclass0920a; public class main { public static void main(string[] args) { //declare array of strings string[] things; things = new string[] {"apple", "airplane", "car", "football","house", "aluminum"}; (int i=0; < things.length; i++) {} } } there simple way handle this: public class running { public static void main(string[] args) { // declare array of strings string[] things; things = new string[] { "apple", "airplane", "car", "football", "house", "aluminum" }; (int = 0; < things.length; i++) { if(things[i].startswith("a")) { system.out.println(things[i]); }

canvas - Wrap text to a new line once maxWidth is reached in EaselJS -

i new easeljs. set maxwidth property of text 200px , after maximum width reached, text starts getting compressed. how ensure text wraps new line after max width reached? var text = new createjs.text(); text.set({ text: "lorem ipsum dolor sit amet, consectetur adipiscing elit. nam elementum elit vitae nisl elementum, et aliquet quam malesuada. pellentesque porta consequat pellentesque. quisque vel molestie quam. aliquam in vehicula magna. integer ac congue sem, et tempor libero. etiam pharetra, quam et posuere porta, lectus odio iaculis nibh, eget porttitor magna elit id felis. mauris luctus lobortis tincidunt." x: 0, y: 0, font: "16px arial black", maxwidth: 200 }) you want linewidth instead of maxwidth . maxwidth mirrors default html canvas behaviour of shrinking text fit, whereas linewidth wrap text new line. var text = new createjs.text().set({ text: "lorem ipsum dolor sit amet, consectetur adipiscing elit. nam elementum elit vitae ni

uicollectionview - Implement layoutAttributesClass() in Swift 3 -

i writing custom collection view layout in swift , xcode 8. tried implementing custom collection view layout attributes following function override class func layoutattributesclass() -> anyclass { return circularcollectionviewlayoutattributes.self } but error 'method not override method superclass'. appreciated. you should use var instead of func in swift 3 : override class var layoutattributesclass: anyclass { // ... }

angularjs - Displaying the elements in an array twice using single ng-repeat -

i have code in below link. http://jsfiddle.net/96dgl1ga/ as can see, have used below code 2 times display output. <tbody> <tr ng-repeat="track in machine.notematrix2"> <td ng-repeat="step in track"> <div ng-model="step.value"> {{step.value}} </div> </td> </tr> </tbody> how can achieve same output coding once.

javascript - Reading Local File with Jquery Ajax -

i tried reading local text file javascript(jquery). following code. $.ajax({ type: 'get', url: 'file:///c:/users/kola/desktop/b/data_file_text', error: function(e) { console.log(e); }, success: function(e) { console.log(e.responsetext); } }); at end of execution, error method triggered. accessing argument(e) returned. got following jquery object. readystate: 4 responsetext: "my expected data" status: 200 statustext: "ok" .... why triggered error , seems ok. missing something? thank you.

java - JUnit Test import works, but IntelliJ doesn't see it beforehand -

Image
when creating tests, intellij doesn't seem see junit itself. however, if manually write import, recognized without problem. works fine, it's not big deal, strange behaviour. when type @test, autocomplete shows: after writing, , alt+enter: after manually writing import: since maven , intellij work after manually writing import, seems minor configuration problem. have deleted *.iml files in project, it's global configuration?

Android MediaPlayer play file while growing (downloading or recording file) -

android mediaplayer plays growing file (from local storage /sdcard) considering duration whatever duration on start. example if downloaded 1 minute considered total duration , if file continues grow, mediaplayer stop (oncompletion) after 1 minute. how can make continue playing? tried setvideopath again repeats beginning. help?

excel - Password protect without unprotecting -

i have workbook distributed multiple departments. each department has own sheet within workbook, have input notes in cells. i've password protected each sheet except cells they'll inputting notes (lots of formulas referencing other sheets, can't touched except me). on top of password protection, added vba code prompts user password before can add notes (to discourage other departments inputting notes wrong sheet.) each department has own password sheet. problem is, code unprotects entire sheet when correct departmental password entered, exposing locked cells other users. need code prompt user when sheet selected, , when password enetered correctly, unprotect unlocked cells. have far: sub worksheet_activate() const passwrd string = "abc123" dim sinput variant dim attempt integer me.protect password:=passwrd attempt = 1 sinput = inputbox("please enter password sheet", "password required attempt:" & atte

Problems with implementation of chunked upload using ng-file-upload -

i looking solution how implement chunked upload ng-file-upload i read in documentation can set chunk size resumechunksize: 10000 or '10kb' or '10mb' but have implement following promise: resumesize: function() {return promise;} but there no example, how can implement it. i googled quite long not able found solution. i grateful help!

Set values on image build for a Docker container -

let's logged in reynierpm in fedora , build docker image dockerfile. image contain lamp environment. have apache virtual host(vh) default file looks follow: <virtualhost *:80> #servername www.example.com serveradmin webmaster@localhost documentroot /var/www <directory /var/www> allowoverride require granted </directory> errorlog /dev/stdout customlog /dev/stdout combined </virtualhost> as part of built process file copied proper location on image. can logged in username host , set dynamically vh? @ end following result: <virtualhost *:80> servername reynierpm.dev serveradmin webmaster@localhost documentroot /var/www <directory /var/www> allowoverride require granted </directory> errorlog /dev/stdout customlog /dev/stdout combined </virtualhost> i know can value current user using $(whoami) bash how can insert/set vh file on do

signals - "sc_signal<T> cannot have more than one driver" error, SystemC -

i tried test environment 1 of examples found on website systemc ( this one ). here code of example: #include "scv.h" const unsigned ram_size = 256; class rw_task_if : virtual public sc_interface { public: typedef sc_uint<8> addr_t; typedef sc_uint<8> data_t; struct write_t { addr_t addr; data_t data; }; virtual data_t read(const addr_t*) = 0; virtual void write(const write_t*) = 0; }; scv_extensions(rw_task_if::write_t) { public: scv_extensions<rw_task_if::addr_t> addr; scv_extensions<rw_task_if::data_t> data; scv_extensions_ctor(rw_task_if::write_t) { scv_field(addr); scv_field(data); } }; class pipelined_bus_ports : public sc_module { public: sc_in< bool > clk; sc_inout< bool > rw; sc_inout< bool > addr_req; sc_inout< bool > addr_ack; sc_inout< sc_uint<8> > bus_addr; sc_inout< bool > data_rdy; sc_inout< sc_uint<8> >

pointers - References in go - attribute doesn't change -

i'm having hard time understanding how references in go work. want write simple in-memory publish-subscribe mechanism. here's code: package sockets import ( "fmt" "github.com/gorilla/websocket" ) type hubsingleton struct { clients map[string][]*websocket.conn } var instance *hubsingleton func hub() *hubsingleton { if instance == nil { fmt.println("new instance created") instance = &hubsingleton{} } instance.clients = make(map[string][]*websocket.conn, 6) return instance } func (hub *hubsingleton) subscribe(channel string, socket *websocket.conn) error { if _, ok := hub.clients[channel]; !ok { hub.clients[channel] = make([]*websocket.conn, 0) } hub.clients[channel] = append(hub.clients[channel], socket) fmt.println("subscribe: ", hub.clients) return nil } func (hub *hubsingleton) publish(channel string, message interface{}) { fmt.println("pu

mysql - How to search with comma separated values -

i have 5 check boxes, <label class="checkbox-inline"><input type="checkbox" name="manhattan" value="manhattan" >manhattan</label> <label class="checkbox-inline"><input type="checkbox" name="bronx" value="bronx" >bronx</label> <label class="checkbox-inline"><input type="checkbox" name="brooklyn" value="brooklyn" >brooklyn</label> <label class="checkbox-inline"><input type="checkbox" name="queen" value="queen" >queen</label> i want search --------------------------------- id | location --------------------------------- 1 | manhattan,brooklyn,queen 2 | queen,brooklyn --------------------------------- here query extract($_post); $locprefervals = $manhattan.",".$bronx.",".$brooklyn.",".$

html - Image at background button -

i have little problem css file. create hmtl file , css file style , idea put in background of button form image. when use css file doesn't work use style parameter of button working fine, not understand. my html/css code this: @charset "utf-8"; /* css document */ body { text-align: center; } .btn-image { width: 300px; background-image: url('/images/ok/login-login-on.png'); background-repeat: no-repeat; background-position: center; } <!doctype html> <html> <head> <meta charset="utf-8"> <title>test - log in</title> <!-- bootstrap --> <link href="assets/css/style.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-6 col-md-4 col-md-offset-4"> <img src="images/ok/logo.png" width="200"

azure - what is the supported Model for multi-level Document search? -

i have created few documents in documentdb , looking how search multi-level or parent child objects in single document using azure search services. can 1 me out/any links. azure search requires documents flattened, need create query in documentdb this. started, there document here , give information on how model these more complex data types in azure search. also, prefer flattening right in documentdb. this, user defined functions (udf) great way this. here example allows pass in array , take items of type "child" , pass array. function converttoarray (data, child) { var resultarray = []; (var = 0; < data.length; i++) { resultarray.push(data[i][child]); } return resultarray; } then within documentdb, query this: select c.username, udf.converttoarray(c.addresses, "city") city c so if c.addresses looked this: [ { "city": "toronto", "country": "canada

ios - How do I know when generateCGImagesAsynchronously has completely finished? -

i have requirement take video, convert each frame , image , save these images disk. i'd use avassetimagegenerator efficiency's sake, , have code similar following: the issue don't know when all image generation complete, need take action once frames written disk. example: assetgenerator.generatecgimagesasynchronously(fortimes: frametimes, completionhandler: { (requestedtime, image, actualtime, result, error) in // 1. keep reference each image // 2. wait until images generated // 3. process images set }) it's step 2 above that's tripping me up. imagine can try count number of times completion handler gets called, , trigger appropriate method when count equals number of frames. but i'm wondering if there's way use api know when every frame has been processed? maybe i've missed? guidance or advice appreciated. i progressively process images, won't able fit them in memory @ once anyway. sample video @ times using assetg

events - How to "query" the aggregate to see if a command can be executed -

i have email draft aggregate root following commands: addtorecipient , addccrecipient , addbccrecipient , updatebodytext , uploadattachment , removeattachment , in ui want disable send button if draft not ready sent (i.e. there @ least on recipient , body has text). know i'm not allowed query aggregate 1 can tell me can or can't send email. if apply know event sourcing , cqrs, aggregate emit emailisreadytobesent event , useremaildrafts read model pick , update ui somehow then, have check after every command , send canceling event i.e. emailisnotreadytobesent . this feels complicated, think? the fact email cannot sent unless there recipient , body bordering on applicative logic, because @ end of day it's more matter of fields being filled in on form complex domain invariants. rather relying on full cross-tier round trip querying read model each time changes on screen, inject knowledge of these basic rules in ui button instantaneously re-enabled when rec

php - Rename multiple file upload codeigniter -

i want rename files during uploading process. i'm uploading 3 files @ single time. frontend code <form> <input type="file" class="form-control" name="photo_1"> <input type="file" class="form-control" name="pan_1"> <input type="file" class="form-control" name="add_1"> </form> my code in controller following function upload(){ $this->upload_file('photo_1'); $this->upload_file('pan_1'); $this->upload_file('add_1'); } function upload_file($field_name) { //$ext = substr( strrchr($_files[$field_name]['name'], '.'), 1); //$new_name = $types.'_'.$numb.'_dev_.'.$ext; $config['file_name'] = $_files[$field_name]['name']; $config['upload_path'] = './uploads/'; $config['allowed_types']

sql - mysql 5.5.50 Calculate one day multiple events to one -

i have problem thinking , must ask help. create working time tracking system , can manage other things code, cannot figure out how can calculate following data. fist, have couple tables , 1 store 4 things. index | | timestamp | 1 | 1 | 2016-09-21 08:00:00 | work 2 | 2 | 2016-09-21 08:01:00 | work 3 | 1 | 2016-09-21 10:00:00 | bin 4 | 2 | 2016-09-21 10:00:00 | bin 5 | 1 | 2016-09-21 10:15:00 | bout 6 | 2 | 2016-09-21 10:17:00 | bout 7 | 2 | 2016-09-21 13:00:00 | bin 8 | 1 | 2016-09-21 13:00:00 | bin 9 | 1 | 2016-09-21 13:30:00 | bout 10 | 2 | 2016-09-21 13:30:00 | bout 11 | 2 | 2016-09-21 15:58:00 | home 12 | 1 | 2016-09-21 16:05:00 | home i can nicely calculate times between work , home , got right value right person. but i'm stuck break times. i need calculate possible breaks per person , way total time spend breaks per person. so need following answer when ask person 1 info: who | tim

java - Spark : Best way to Broadcast KafkaProducer to Spark streaming -

to broadcast kafkaproducer spark executors have created wrapper below : public class kafkasink implements serializable { private static kafkaproducer<string, string> producer = null; public kafkaproducer<string, string> getinstance(final properties properties) { if(producer == null) { producer = new kafkaproducer<>(properties); } return producer; } public void close() { producer.close(); } } and using below javasparkcontext jsc = new javasparkcontext(sc); broadcast<kafkasink> kafkasinkbroadcast = jsc.broadcast(new kafkasink())); dataset.tojavardd().foreach(row -> kafkasinkbroadcast.getvalue().getinstance(kafkaproducerprops()).send(new producerrecord<string, string>(topic, row.mkstring(", ")))) i wanted know whether right way it, or best way it i can recommend blog post . in short, should create serializable sink each partition passing 'recipe' cre

android - How can I reset PublisherAdView layout? -

i using publisheradview in our app show banner advertisements. requirement reload ad every 5 minutes , show each ad 20 seconds. now using loadad method whenever second ad load's shows previous ad , populates new ad. there way can reset adview after 20 seconds can reload ad freshly. know destroy() method there according documentation should call on activity's destroy method. does know how reset publisheradview?? thanks there's no way clear content of publisheradview before loading second ad, i'm afraid. you can, however, use adlistener determine when second ad has finished loading , show publisheradview afterwards. use onadloaded callback.

javascript - Use module in Node js and reassign values -

i have javascript module simplified eye pose. var pose = {}; var eye = {}; var left = {}; left.pitchpos = 37; left.yawpos = 47; exports.init = function () { eye.left = left; pose.eye = eye; return this; }; exports.eye = function (e) { if(typeof(e) !== "undefined"){ pose.eye = e; } return pose; }; exports.pose = pose; this how use it: var pose = require('./pose').init(); console.log(json.stringify(pose)); pose.eye.left = { yawpos: 99, pitchpos: 11 }; console.log(json.stringify(pose)); why same output twice? potentially have not understood modules , scopes yet, hint on doc welcome the "problem" wrong usage of this keyword in function: exports.init = function () { eye.left = left; pose.eye = eye; return this; }; returning this in context means "return module itself". means assignment ( pose.eye.left = ... ) (in context of pose.js file): exports.eye.left = ... exp

javascript - JQuery ONLY works in compatibility mode -

i working on creating web application displayed on local intranet site nb using ie11 takes information xml file , cycles through it, displaying each section in turn. have had use old version of jquery in order make work on system it'll running on, using 1.12.4 . problem page pulls in information in first instance, after nothing. quick check in debugging console tells me page unable property 'childnodes' of undefined or null reference - seems strange me works in first instance. if run page in compatibility view , script works properly, destroys of styling etc. there way fix or going have deal awful compatibility view styled page? my code below html <div id="mainnews"> <div class="panel panel-default" id="mainnewsstory"> <h1 id="storyheadline"></h1> <p id="storybody"></p> </div> <img id="storyimage" src=""/> </div>

how to have many wpf custom controls in the same library? -

i have wpf custom control project in want have many custom controls. default, vs2015 cummunity creates theme folder generic.xaml file , .cs file interaction logic. i want have many user controls, have tried create mycontrol1 folder, inside folder, have created theme folder , add new item, wpf custom control. doesn't create generic.xaml control. copy root folder default generic.xaml , create style, when use control in wpf application, don't see control. i have seen post: custom control lib multiple controls , generic.xaml don't understand solution. i have problem, in mycontrol1.generic.xaml y have code: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:customcontrols.calendario2"> <style targettype="{x:type local:calendariomes2}"> <setter property="template&quo

Display Currency with all decimals intact in AngularJS -

i need display currency format decimal places intact. if value amount is: 123456.789 output should 1,23,456.789 $ if write {{amount | currency:$}} output is: 1,23,456.78 $ [removes last digit] if write {{amount | currency:$:3}} , output is: 1,23,456.78 $ [it displays expected] but problem can not fix number of decimals keeps changing. got resolution. implemented following custom filter(currency symbol not mandatory :) ) myapp.filter('customnumber', function($filter) { var standardnumfilterfn = $filter('number'); return function(num) { if(num){ var numsplit = (''+num).split('.'); if(numsplit && numsplit[1]){ return standardnumfilterfn(num, (''+numsplit[1]).length); } return standardnumfilterfn(num, 0); } }; }); and then: {{amount | customnumber}}

python pandas how to drop duplicates selectively -

i need @ rows in column ['b'] , if row non-empty go corresponding column ['c'] , drop duplicates of particular index against other rows in third column ['c'] while preserving particular index. came across drop_duplicates, unable find way duplicates of highlighted row opposed duplicates in column. can't use drop_duplicates on whole column because want retain duplicates in column may correspond empty values in column ['b']. so possible scenarios be: if in ['b'] find non empty value, may go current index in ['c'] , find duplicates of 1 index , drop those. these duplicates correspond empty or non-empty values in ['b']. if in ['b'] find empty value skip next index. way possible empty value indices in ['b'] removed indirectly because duplicates of index in ['c'] corresponding non empty ['b'] value. edited sample data: preprocessed: df1 = pd.dataframe([['','ccch'], ['ch