Posts

vb.net - Accessing Location on Windows 10 in .net desktop application -

the company work has application used our field staff registers gps location periodically, wrote application windows 8 x86 using system.device.location geocoordinatewatcher class. in windows 10 same code ceases function properly, geocoordinatewatcher.permission returns granted, yet continue receive unknown position each call. windows 8 , windows 10 tablets both have lte. public function getlocation() geocoordinate dim geocoordinate geocoordinate dim watcher geocoordinatewatcher watcher = new geocoordinatewatcher(geopositionaccuracy.high) watcher.trystart(false, timespan.frommilliseconds(15000)) logtofile("position permission: " & watcher.permission.tostring) logtofile("watcher status: " & watcher.status.tostring) geocoordinate = watcher.position.location if geocoordinate.isunknown logtofile("unknown") else logtofile(string.form...

html5 - How can I animate a line drawing using SVG? -

i'm trying run https://jsfiddle.net/kfbzhy9p/ 1 continuous line breaks 2 , doesn't seem connect. if stop animation it's partly drawn. i'm saving path using illustrator , object >> compound path >> make stroke-miterlimit attribute? your path approximately 1908 units long, that's why treating 1000 units long makes things odd.

c# - Kinect 2.0 polling frames -

i'm working on c# .net project using kinect device , official sdk 2.0. right i'm processing frames via events i'd try via polling method i've read in documentation of 1.0 version of sdk i've found nothing specific 2.0 version has microsoft dropped support polling frames or missing something? polling restricted kinect sdk 1.5 1.8 check - https://msdn.microsoft.com/en-us/library/hh973076.aspx for kinect sdk 2.0 should use multisourceframeready check - https://msdn.microsoft.com/en-us/library/microsoft.kinect.multisourceframereader.aspx and - http://kinect.github.io/tutorial/

imagemagick - Is this GIF a still image or an animation? (in Ruby) -

Image
how can use rmagick determine how many frames remote gif has? you can use magick::imagelist#length : returns number of images in imagelist. for example, remote gif: has 12 frames: require 'rmagick' magick::imagelist.new('https://i.giphy.com/zllydol7ndm7c.gif').length #=> 12

python - How can I change the orientation of a buttons in a stack layout in Kivy -

from kivy.app import app kivy.uix.button import button kivy.uix.stacklayout import stacklayout class mylayout(stacklayout): def __init__(self, **kwargs): super(mylayout, self).__init__(**kwargs) in range(10): btn = button(text=str(i), width=40, size_hint=(none, 0.15), orientation= 'lr-bt') self.add_widget(btn) class nameapp(app): def build(self): ml = mylayout() return ml if __name__ == "__main__": nameapp().run() i have attempted change orientation here, orientation displayed on app still if default orientation property of layout, not of widgets contains. can use self.orientation = "lr-bt" in __init__ function assign property layout. assign in appropriate .kv file if use that.

operating system - Polling vs. Interrupts with slow/fast I/O devices -

i'm learning differences between polling , interrupts i/o in os class , 1 of things teacher mentioned speed of i/o device can make difference in method better. didn't follow on i've been wracking brain , can't figure out why. feel using interrupts better , don't see how speed of i/o device has it. the advantage of polling comes when don't care every change occurs. assume have real-time system measures temperature of vat of molten plastic used molding. let's device can measure resolution of 1/1000 of degree , can take new temperature every 1/10,000 of second. however, need temperature every second , need know temperature within 1/10 of degree. in kind of environment, polling device might preferable. make 1 polling request every second. if used interrupts, 10,000 interrupts second temperature moved +/- 1/1000 of degree. polling used common i/o devices, such joysticks , pointing devices. that said, there little need polling , has pretty g...

objective c - How do I check if an object is being @synchronized -

sometimes wrote following code synchronized routine: @synchronized(objtobesync){ .... } when 2 threads try access sync block @ same time, 1 block others, until 1 exits sync block. however, don't want 1 blocks other, others check if object being synchronized, , other thing have sth this: @synchronized(objtobesync){ _isbeingsync = yes; ... _isbeingsync = no; } _isbeingsync additional var on checking if objtobesync being sync. other threads check _isbeingsync before continue work. , question objc provide sth check objtobesync directly not introduce additional var mark down status. the compiler translates @synchronized(objtobesync) { ... } into callq _objc_sync_enter ... callq _objc_sync_exit and objective-c runtime source code (objc-sync.mm, objc-os.mm, objc-lockdebug.mm, objc-os.h) 1 can see these functions pthread_mutex_lock(m->mutex); ... pthread_mutex_unlock(m->mutex); where m->mutex pthread_mutex_t pthread_mutex_recur...