Posts

anypoint studio - Mule Dataweave format :number -

i'm having issue trying parse string double sample code, it's returning integer instead of type :double ideas? { "data": "22" :number { format: "##.##" } } this, , this, works me; %dw 1.0 %output application/json --- { data: "22" :number :string {format: ".00"} :number } format seems add zeros when converting number string. if "22" have been number wouldn't need first :number conversion; data: 22 :string {format: ".00"} :number the latter number conversion makes output float. otherwise string, formatted according hosts locale. and beware. when using %output text/json instead, above code in cases produces 22.0 instead of 22.00 .

c# - Call a non-default constructor in from a generic list instantiation -

i have class called fred constructor takes parameter parma want pass initialisation of generic list of type multictorclass called mylist. the default constructor multictorclass passes parmb base; want call other constructor of multictorclass passing in parma initialisation of fred. public class fred { public fred(parmtype parma) { mylist = new list<multictorclass>(); } public ienumerable<multictorclass> mylist { get; set; } } public class multictorclass : mybase { public multictorclass() : this(parmb) { } public multictorclass(parmtype parm) : base(parm) { } } i trying following: public fred(parmtype parma) { mylist = new list<multictorclass(parma)>(); } how can achieved? you're not calling constructor in either case - list empty. call constructor when creating new item, e.g. mylist.add(new multictorclass(...)); and can pick constructor @ there :) ...

Deleting elements in Python list using user input -

name=input("enter name: ") message=input("enter message:") namefinal=list(name) namefinal in message: del(namefinal) print(message) i need creating program gets message user , removes of letters in user’s name. made user input(name) list don't know how delete letters. example if type in charan , message lebron james delete r,a,and n lebron james, making lebo jmes . you can this: name=input("enter name: ") message=input("enter message:") namefinal = '' letter in name: if letter not in message: namefinal += letter print namefinal

html - CSS: Issue with the third inline-block element -

below can see code has 3 lines of inline-block elements. these lines absolutely same. behavior of third line strange. see @ code snippet. what's wrong third line? why displayed weird? thank you. .partners { width: 940px; text-align: center; margin: 95px auto 0 auto; } .partners__h2 { color: #333; font-weight: bold; font-size: 22px; text-align: center; margin-bottom: 32px; } .wrap { background: #a1a1a1; } .partners li { display: inline-block; vertical-align: text-top; } .partner__wrap { bottom: 0; width: 100%; text-align: center; } .partner__name { display: block; float: left; width: 100%; font-weight: bold; color: #333; font-size: 14px; margin-bottom: 0px; } .partner__description { font-family: roboto; font-weight: 300; color: #666; font-size: 14px; text-align: center; float: left; margin-top: 10px; } .partner__1 { width: 220px; height: 100%; float: left; } .part...

widget - Tcl/Tk: how to trigger bind function inside script instead of GUI operation -

in tcl/tk script, there combobox widget, , bind event it, if user change selection of combobox, bind function triggered. want trigger bind function inside script, instead of gui operation, how this? code goes following: ttk::combobox .combo_select_tag -background white; .combo_select_tag configure -value "1 2 3"; pack .combo_select_tag bind .combo_select_tag <<comboboxselected>> { puts "trigger\n" } tl;dr use event generate . the bind command associates binding script event on binding tag. each widget typically has 4 binding tags: name of widget, name of widget's class, name of widget's toplevel, , all binding tag. (the aim put customizations on individual widgets, or on toplevel have them apply whole window — which great hotkey sequences — while tk focuses on class level. global all level not used has few backstop things.) to activate binding script, need event sent widget. event generate command precisely that....

java - Android Studio - Why does the ActionBar always show, even when fully disabled? -

i started android application development , have come across issue actionbar. aware question has been asked few times, , have made changes necessary can see other articles. currently, main activity looks this: image as can see, there blue bar @ top of screen directly under notification bar actionbar supposed be. of app themes (i believe) set noactionbar. rid of blue bar can use entire screen put contents. my code follows: main_activity.java package ryanpx2016.golftracker; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.view; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.content.intent; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.o...

javascript - Instantiate ViewModel from array items within an existing ViewModel. -

i've started messing knockout (tech requirement) , i'm trying build gallery custom functionality. the data coming json response represents 1 gallery (title, description, etc) , within gallery object, array of slides. to try , separate concerns i'd love have gallery-based viewmodel , separate slide viewmodel. but i'm not sure how instantiate slide viewmodel on array within object. in earlier version tried loop on array of slides not sure how i'd physical execute i'm trying set new instance of slideviewmodel on each slide object in slides array any appreciate. codepen here: http://codepen.io/pbj/pen/maolmb code here: js var testgallery = { "title" : "anna's gallery title", "slides" : [ { "title": "slide image #1", "image" : "http://google.com/image/goes/here" }, { "title": "slide image #1", "image" :...