Posts

How can I change only one letter of .mp3 in python? -

so have change letter "ı" because not english character example should change "sanmayın.mp3" "sanmayin.mp3". how can this? from os import rename, listdir fnames = listdir('.') fname in fnames: print fname fname.replace('ý','i') okay got why didn't work listdir gives of names in english python thinks ı i, how can work in utf-8 use str.replace() : s = 'sanmayın.mp3' s.replace('ı','i') result : sanmayin.mp3 if needed replace characters within list: l = ['sanmayın.mp3', 'ın', 'hı'] l = [i.replace('ı','i') in l] result : ['sanmayin.mp3', 'in', 'hi']

reactjs - How to make onMouseLeave in React include the child context? -

i building dropdown button learn react. have made 2 onmouseenter , onmouseleave events in parent div make visible when hovering disappear when not. problem events stick parent. how make onmouseleave in react include child context? or, how can keep state expand true when hovering on children? class dropdownbutton extends react.component { constructor(){ super(); this.handlehoveron = this.handlehoveron.bind(this); this.handlehoveroff = this.handlehoveroff.bind(this); this.state = {expand: false}; } handlehoveron(){ if(this.props.hover){ this.setstate({expand: true}); } } handlehoveroff(){ if(this.props.hover){ this.setstate({expand: false}); } } render() { return ( <div> <div classname={styles.listtitle} onmouseenter={this.handlehoveron} onmouseleave={this.handlehoveroff}> {this.props.name} </div> <div> {react.c...

java - Uploading a File fails with Vaadin Spring PLupload-Addon -

if want upload file specific widget/addon of vaadin, im getting warnings , files not uploaded. i don't have idea, why warning occurres. checking whole addon , saw javascript usage, using post don't why throwing warnings , doesn't work @ all. i checked addon without spring integration , worked well. this warnings: 2015-08-16_15:44:53.777 warn o.s.web.servlet.pagenotfound - request method 'post' not supported 2015-08-16_15:44:53.777 warn o.s.w.s.m.s.defaulthandlerexceptionresolver - handler execution resulted in exception: request method 'post' not supported 2015-08-16_15:44:54.937 warn o.s.web.servlet.pagenotfound - request method 'post' not supported 2015-08-16_15:44:54.938 warn o.s.w.s.m.s.defaulthandlerexceptionresolver - handler execution resulted in exception: request method 'post' not supported 2015-08-16_15:44:55.977 warn o.s.web.servlet.pagenotfound - request method 'post' not supported 2015-08-16_15:44:55.977 ...

ios - How can I change the initial ViewController in LaunchScreen with Swift? -

i want check whether user logged in or not, if user logged in, bring him main screen, or show welcome screen. you can't in launch screen, can achieve same in appdelegate's method didfinishlauchingwithoption , there can check if user logged in or not , set root view controller , don't set initialviewcontroller in storyboard. should nsstring *identifier = isloggedin ? @"identifierforvc1" : @"identifierforvc2"; uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle:nil]; uiviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier: identifier]; self.window.rootviewcontroller = vc; code not tested in editor may have swift code should this let storyboard = uistoryboard(name: "main", bundle: nil) let vc = storyboard.instantiateviewcontrollerwithidentifier(identifier) as! uiviewcontroller self.window?.rootviewcontroller = vc

java - Get Full Path for uploaded Image -

i trying full path of uploaded image access in servlet , store in mysql database, have tried several methods everytime null value, need examples. thanks here doing ----- in jsp ----- <div class="fileupload fileupload-new" data-provides="fileupload"> <div class="fileupload-preview thumbnail" style="width: 50px; height: 20px;"></div> <div> <span class="btn btn-file"><span class="fileupload-new">select image</span> <span class="fileupload-exists">change</span><span></span><input id="myfile" onchange="showfilename()" runat="server" type="file" /></span> </div> </div> <script type="text/javascript"> function showfilename() { var fil = document.getelementbyid("myfile"); var file = fil.value; fil.set...

c# - How to cover all chart area in winform application -

Image
who can me expand plot vertically cover chart area in winforms application? see screenshot. thank answers. the real question is: did create large blank area @ bottom? it looks if have added chartarea ..? there 1 chartarea , 1 series , 1 legend there default. either use these or clear them! i create series myself , short name reference chartareas[0] default area..

Move javascript files into inline html -

i have application allows use of inline javascript, not javascript source files. i'm trying modify webpage open on browser, , need know how put javascript files webpage inline. use <script> tags in html. can go anywhere - prefer inside <head> tag: <head> <script type="text/javascript"> // put here - type of valid javascript works // if import jquery, can use jquery here too! </script> </head>