Posts

python 3.x - How to get these tkinter scrollbars working? -

hi cant these scrollbars working though code comes advanced user on site have tried everything. no errors dont show up import tkinter tk #make window root = tk.tk() root.geometry("612x417") root.title("exchange rates") root.resizable(0,0) root.configure(background='lightgrey') #end #create listboxes currency selection listbox1 = tk.listbox(root, font="helvetica 11 bold", height=3, width=10) listbox2 = tk.listbox(root, font="helvetica 11 bold", height=3, width=10) #try create scroll bar scrollbar1 = tk.scrollbar(root, orient="vertical", command=listbox1.yview) listbox1.configure(yscrollcommand=scrollbar1.set) scrollbar2 = tk.scrollbar(root, orient="vertical", command=listbox2.yview) listbox2.configure(yscrollcommand=scrollbar2.set) listbox1.place(x=300,y=50) listbox2.place(x=300,y=125) scrollbar3 = scrollbar(root) scrollbar3.pack(side="right", fill="y") listbox = listbox(root, yscroll...

math - subtract two numbers in base 3 in java -

this question has answer here: how work other base numbers in java? 5 answers what's going on here? i'm trying subtract 2 integers in base 3 system. int x=222211; int y=112222; string result = integer.tostring(x-y,3); and result 109989 answer should 102212 it seems clear library doesn't think - result i'm getting base 10 result of subtraction. converting result base 3 gives me wildly incorrect result this embarrassing, figured out seconds after posting this... maybe else out. int x = integer.parseint("222211",n); int y = integer.parseint("112222",n); string result = integer.tostring(x-y,n); convert numbers beforehand appropriate base

jquery - How to trigger bootstrap collapse in Angular 2/Typescript -

let's i've panel . want able expend/collapse it, depending on selected value of dropdownlist. <div class="collapse" id="collapseexample"> <div class="well"> ... </div> </div> this dropdownlist . <select id="state" name="state" [(ngmodel)]="stateid" (change)="onchange($event.target.id, $event.target.value)" class="form-control"> <option *ngfor="let r of stateslist" value="{{ r.id }}">{{ r.name }} </option> </select> this event handler . and, if state selected, expends panel. otherwise, collapse panel. //events onchange(id: string, devicevalue: string) { if (id == "state") { if (devicevalue) { //expend panel... } else{ //collapse panel... } } } using jquery , like: $("...

Migrating web api authentication from .NET Core 1.1 to 2.0 -

i'm trying convert old authentication .net 2.0. had following code: app.usejwtbearerauthentication(new jwtbeareroptions { automaticauthenticate = true, includeerrordetails = true, authority = "https://securetoken.google.com/xxxxx", tokenvalidationparameters = new tokenvalidationparameters { validateissuer = true, validissuer = "https://securetoken.google.com/xxxxxx", validateaudience = true, validaudience = "xxxx", validatelifetime = true, }, }); my new code following: public void configure(...) { ... app.useauthentication(); ... } public void configureservices(iservicecollection services) { ... services.addauthentication(jwtbearerdefaults.authenticationscheme) .addjwtbearer(options => { options.requirehttpsmetadata = false; options.includeerrordetails = true; options.authority = "https://securetoken...

javascript - Target problems in JQuery -

i have problem. have similar divs same classes. when click on (toggle#1) .comments-toggle class need div below .toggle-container expand. code stands trigger .toggle-container div below (toggle#1) div expand. how click on toggle#1 , div below class toggle-container expand , not divs class toggle-container? *** edited html **** i need jquery changed, please don't change html solution. i hope make sense. html: <div> <div class="comments-toggle">toggle #1</div> </div> <div> <div class="comments-expanded-container toggle-container"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiumdod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation</p> </div> </div> <div> <div class="comments-toggle">toggle #2</div> </div> <div> <div class="comments-expanded-cont...

json - Finance data on alphavantage -

i trying json company calling api of alphavantage .for company data coming , company, it's failing. company data coming - tcs,infy,msft company data failing - tatamotors,rcom,sbin link tcs json https://www.alphavantage.co/query?function=time_series_daily_adjusted&symbol=tcs&outputsize=full&apikey=mcaf9b429i44328u link tatamotors https://www.alphavantage.co/query?function=time_series_daily_adjusted&symbol=tatamotors&outputsize=full&apikey=mcaf9b429i44328u can please me why happening? i've noticed alpha vantage when retrieving data list of stocks, response have empty body. are having error same stock tickers each time fetch data, or happening different tickers each time? what response body like? when did problem start? has been this, or intermittent? it seems bug on end, , seems follow period of 500 server errors effect of "heroku app: application error". doesn't happen every day, , doesn't happen same stock...

ios - Swift: Thread 1 signal SIGABRT in class AppDelegate: UIResponder, UIApplicationDelegate -

Image
i'm following tutorial , every time click button error in appdelegate.swift says thread 1 signal sigabrt . import uikit @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { //thread 1 signal sigabrt here's screenshot of storyboard. i have looked on , answers refer iboutlet connection doesn't exist can see in screenshot connections don't know problem is. here's viewcontroller.swift code : import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var input: uitextfield! @iboutlet weak var label: uilabel! @ibaction func button(_ sender: uibutton) { label.text = input.text userdefaults.standard.set(input, forkey: "myname") input.text = " " } override func viewdidload() { super.viewdidload() } override func didreceivememorywarning() { super.didreceivememorywarning() } override func viewdidappear(_ animated: bool) { if let x = userdefaults.standard.object(forkey: "myna...