Posts

utf 8 - PHP remove special characters to make sure a string is utf-8 encoded -

i @ lost of how remove special characters string make sure chars supported uft-8 + french chars included. below base64 string has special chars , sanitizing function has failed remove them , causing text not print when using fpdf cells etc. if decode string @ https://www.base64decode.org/ see special chars. // sanitizing function static function remove_none_word_chars($string) { return preg_replace('/[^a-za-z0-9`_.,;@#%~\’\'\"+*\?\^\[\]\$\(\)\{\}\=!\<\>\|\-:\s\/\\sàâçéèêëîïôûùüÿñæœ]/ui', '', $string); } 74knifn1cgvydmlzzxigbgugdhjhdmfpbcbkzsbs4oczzw5zzw1ibgugzhugcgvyc29ubmvsigrlihbyb2r1y3rpb24sigrligzigjllbnryzxrpzw4gzxqgzgugbgegbwfpbnrlbmfuy2ugc3vyigxlihf1yxj0igrlig51axqgzw4gdgvuyw50ignvbxb0zsbkzsbsysbjb252zw50aw9uignvbgxly3rpdmu7cu+cpybbc3n1cmvyihvuzsbib25uzsbnzxn0aw9uigrligzigjllbnnlbwjszsbkzxmgb3ddqxjhdglvbnmgzgugbokamxvzaw5lowrvgqcgugxhbmlmawvyigrlcybvcmopcmf0aw9ucyblbibmb25jdglvbibkzxmgym9ucybkzsbjb21tyw5kztsk74kniefwcg9ydgvyigxl...

python - Building a dataframe in an efficient way from dictionary -

Image
i have large set of data have process , generated dictionary. want create dataframe dictionary. vales of dictionary list of tuples. values need find out unique values build columns of dataframe: d = {'0001': [('skiing',0.789),('snow',0.65),('winter',0.56)],'0002': [('drama', 0.89),('comedy', 0.678),('action',-0.42) ('winter',-0.12),('kids',0.12)],'0003': [('action', 0.89),('funny', 0.58),('sports',0.12)],'0004': [('dark', 0.89),('mystery', 0.678),('crime',0.12), ('adult',-0.423)],'0005': [('cartoon', -0.89),('comedy', 0.678),('action',0.12)],'0006': [('drama', -0.49),('funny', 0.378),('suspense',0.12), ('thriller',0.78)],'0007': [('dark', 0.79),('mystery', 0.88),('crime',0.32), ('adult',-0.423)]} (size of dictionary cl...

SAS EG: SAS Dataset is locked by opening it from EG. Need a resolution -

one of critical sas dataset left open sas enterprise guide, our offshore associate. depending on dataset many updates through various jobs. tried searching option various sites unlock dataset, of no use. kindly provide suggestion. thanks. depending on of specifics of situation, option prevent anyone locking in first place using pw= dataset option like: data myimportanttable(pw=pass123); x=1;output; run; then create view allows eg users click , see underlying data, not lock original dataset: proc sql; create view myimportanttable_view select * myimportanttable(read=pass123) ;quit; now inserts, updates etc work if view opened user in eg: *this work if view opened in eg; proc sql; insert myimportanttable(pw=pass123) values(101) ;quit; note not option if you've got lot of different insert/update statements spread throughout program - each of them need (pw=...) dataset option added them in order work.

javascript - Three.js - How to link/add a light to the camera since r69? -

since r69 pattern no longer supported (*) : directionallight.position = camera.position; so have tried this answer : var pointlight = new three.pointlight( 0xffffff, 1, 100 ); camera.add( pointlight ); but light doesn't work (black out), , it's same thing directionallight what problem ? note : of course if light doesn't follow camera : var directionallight = new three.directionallight( 0xffffff, 1 ); directionallight.position.set( camera.position.x, camera.position.y, camera.position.z ); scene.add( directionallight ); thanks in advance if add light child of camera, need add camera scene, light part of scene graph. var pointlight = new three.pointlight( 0xffffff ); camera.add( pointlight ); scene.add( camera ); three.js r.71

javascript - Change elements height React Angular -

i'm working angular , react (with ng-react) , i'm trying change height of 1 element match height of element. have react component both of elements inside, this: render: function() { return ( <div> <div classname="absolute" ref="absolutecell">foo</div> <th ref="emptycell" style={this.state.style}></th> </div> ) } so want set height of empty cell match 1 of absolute cell. i've tried componentdidmount this: getinitialstate: function() { return { style: { height: '30px' } } }, componentdidmount: function() { var absolutecellheight = this.refs.absolutecell.getdomnode().offsetheight; this.setstate({ style: { height: absolutecellheight } }); this.refs.emptycell.forceupdate(); } but keep getting nasty error cannot read property 'getdomnode' of undefined . there other way can achieve...

ios - Update CoreData Object -

i'd update coredata object. backgrund: made app includes uitableview. in textlabel of uitableviewcell name. in detailtextlabel of cell date can changed/updated. i'd change date. i wrote following code: var people = [nsmanagedobject]() func savedate(date: nsdate) { //1 let appdelegate = uiapplication.sharedapplication().delegate appdelegate let managedcontext = appdelegate.managedobjectcontext! //2 let entity = nsentitydescription.entityforname("person", inmanagedobjectcontext:managedcontext) let person = people[dateindexpath.row] //3 person.setvalue(date, forkey: "datum") //4 var error: nserror? if !managedcontext.save(&error) { println("could not save \(error), \(error?.userinfo)") } //5 people.append(person) tableview.reloaddata() } now, if run code: date updated cell in date has been updated displayed 2 times. example if ...

ios - App Content not filling simulator window -

just having xcode issue i'm sure tied setting can't find. im storyboard, content fills entire view (i.e background image), when run app in iphone 6 simulator, background image , content don't fill entire screen. there white space right of , below content on simulated "screen". when run app in iphone 5 simulator, isn't issue , fills entire simulated view. so, did miss? want make app work on models of iphone. thanks help! there several ways solve this, , guess using view size inferred or iphone4 inch in attribute inspector. first way use autolayout @ storyboard add constraint. if don't want use this, should @ least set autoresizing @ size inspector.