Posts

webgl - three.js - how to replace a mesh geometry w/o recreating the mesh -

i'm loading several stl files (one one) same scene. files different lods of same model (from low-poly high-poly). i'd simulate continuous model update low high resolution. i tried create separate mesh each lod , add scene when removing previous one. unfortunately, lods bigger, there significant delay in rendering. see example , full code my questions: - if replace geometry in same mesh without recreating mesh? if so, how force rendering update? tried use mesh.setgeometry , doesn't seems work stl geometry - new geometry shown (perfectly works cube, reason). - possible speed update somehow sort of pre-calculations or caching? thanks lot in advance hints. simon

python - Tkinter: String variables not working -

i have made program science asks symbol of n element , must type in element problem can't tell if got answer wrong keeps saying correct!, here code, # import modules tkinter import * import random, time # window setup root = tk() root.title('element finder') root.state('zoomed') # elements """ = h, hydrogen b = he, helium c = o, oxygen d = c, carbon e = n, nitrogen f = ne, neon g = u, uranium h = na, sodium = ar, argon j = k, potassium k = mg, magnesium l = cl, chlorine m = b, boron n = au, gold o = pd, palladium p = kr, krypton q = ca, calcium r = pm, promethium s = ag, silver t = rb, rubidium u = y, yurium v = ir, iridium w = pt, platnium x = ti, titanium y = hg, mercury z = er, erbium """ # variables element = stringvar() guess = stringvar() answer = stringvar() def question(): guess.set('') element.set('') r = random.randint(1, 26) if r == 1: element.set...

ios - can't make tab bar hidden when using container views -

Image
my app uses view controllers each containing 2 container views intermediaries between tab bar controller , navigation controllers. purpose of managing menu embedded in 1 of container views in each intermediary. i need hide tab bar (aka bottom bar). i have tried sending sethidesbottombarwhenpushed:yes every view controller, , have tried selecting "hides bottom bar on push" in storyboard every vc. why aren't these things working? assume must architecture: can see, navigation controllers embedded within container views vcs linked tab bar controller. how can hide tab bar in situation? sethidesbottombarwhenpushed: has optional toolbar can added navigation controller, not tab bar. think if add line self.tabbarcontroller.tabbar.hidden = yes; initial controller in each tab (the 1 container view), hide tab bar. think though, leave space @ bottom tab bar was. i'm not sure best way fix be. perhaps, if you're hiding tab bar, shouldn't using tab ba...

html - Add a date picker to a JetStrap page (Twitter Bootstrap) -

just started using jetstrap tonight build basic entry forms. lots of cool tools , fields, no date picker. ( check out if haven't! ) other topics discuss being done twitter bootstrap, not directly... can extend libraries / controls available in jetstrap page pulling in other web sources (a google hosted library example) add in additional functionality? i'm new web front end work , work in jetstrap possible without having download code locally , set own local iis site. i 1 of creators of jetstrap. we adding easy external js/css feature soon, in mean time, can load script dynamically javascript in js editor: $(function() { $.getscript('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js', function() { $('.datepicker').datepicker(); }); }) and in markup can add: <input type="text" value="02-16-2012" class="datepicker">

JSON deserialization in C# sub array -

i'm trying desearialize following using newtonsoft.json { "max_id_str":"1234567", "results":[{ "created_at":"tue, 21 may 2013 03:06:23 +0000", "from_user":"name here", "from_user_id":33333, "text":"the text goes here" }], "results_per_page":1, "since_id":0, "since_id_str":"0" } i can retrieve max_id_str using desearialization cannot of data in "results" here's code have public class tweet { public string max_id_str { get; set; } public string text{ get; set; } public string results_per_page{ get; set; } public string since_id { get; set; } public string since_id_str { get; set; } } i create object of class , attempt desearlize object tweet t = new tweet(); t = jsonconvert.deserializeobject<tweet>(e.result);...

Linux Shell - String manipulation then calculating age of file in minutes -

i writing script calculates age of oldest file in directory. first commands run are: oldfile=`ls -lt $dir | grep "^-" | tail -1 ` echo $oldfile the output contains lot more filename. eg -rwxrwxr-- 1 abc abc 334 may 10 2011 abcd_xyz20110510113817046.abc.bak q1/. how obtain output after last space of above line? give me filename. realise sort of string manipulation required new shell scripting. q2/. how obtain age of file in minutes? to obtain oldest file's name, ls -lt | awk '/^-/{file=$nf}end{print file}' however, not robust if have files spaces in names, etc. generally, should try avoid parsing output ls . with stat can obtain file's creation date in machine-readable format, expressed seconds since jan 1, 1970; date +%s can obtain current time in same format. subtract , divide 60. (more awk skills come in handy arithmetic.) finally, alternate solution, @ options find ; in particular, printf format strings allow extract fi...

what is Querydsl 'Q' -

i saw example of querydsl didn't understand qemployee in that qemployee employee = qemployee.employee; qemployee e = new qemployee("e"); query.from(employee) .where(employee.weeklyhours.gt( new hibernatesubquery().from(employee.department.employees, e) .where(e.manager.eq(employee.manager)) .unique(e.weeklyhours.avg()) )).list(employee) someone please explain ' q ' the "q" classes auto-generated query types, based on entities, used querying in querydsl. see here (section 2.1.5): http://www.querydsl.com/static/querydsl/latest/reference/html/ch02.html#d0e184