using GPS sensor on ultrabook - wpf

I am developing a WPF application on an Intel Ultrabook. As the Ultrabook already includes GPS sensors, how can I go about retrieving my current location inside my app using this sensor?
I am not able to find any sample code to get me started. Any guidance is appreciated.

See:
http://msdn.microsoft.com/en-us/library/system.device.location.geocoordinatewatcher(v=vs.100).aspx
especially the statement:
To begin accessing location data, create a GeoCoordinateWatcher and call Start or TryStart to initiate the acquisition of data from the current location provider.
The Status property can be checked to determine if data is available. If data is available, you can get the location one time from the Position property, or receive continuous location updates by handling the PositionChanged event.

Related

What is the best way to put back all entries in rte_mempool in one go

I am using a mempool in my dpdk app to store values that are periodically emitted to an external server. Everytime the values are emitted I want to replenish the complete mempool. What is the best wat to put back all elements as available to the mempool?

After the GPS location has changed, how to retreive the new gps coordiantes?

Using the npm package azure-maps-control. After the user drags around in the map. I would like to upgrade the points of intrest using a API call. For this i found multiple events. It looks like that the sourcedata event can be used. Unfortunately after dragging i need the new GPS locations. How do i retrieve those?
For your scenario you will most likely want to wait until the user has stopped moving the map before making a request to a service to retrieve custom data since doing this while the map moves would potentially generate tens of requests per second. What you will want to do is monitor the moveend event of the map by doing something like map.events.add('moveend', yourCallbackFunction). When this event fires, you can then retrieve the center position of the map using map.getCamera().center. Here is a code sample from the Azure Maps team that does all of this and a bit more: https://azuremapscodesamples.azurewebsites.net/?sample=Load%20POIs%20as%20the%20map%20moves This sample makes multiple requests when the moveend event fires as the service it calls returns a max of a 100 results at a time, and this sample steps through and pulls in additional results.

Flink reference data advice/best practice

Looking for some advice on where to store/access Flink reference data. Use case here is really simple - I have a single column text file with a list of countries. I am streaming twitter data and then matching the countries from the text file based on the (parsed) Location field of the tweet. In the IDE (Eclipse) its all good as I have a static ArrayList populated when the routine fires up via a static Build method in my Flink Mapper (ie implements Flinks MapFunction). This class is now inner static as it gets shirt on serialization otherwise. Point is, when the overridden map function is invoked at runtime from within the stream, the static array of country data is their waiting, fully populated and ready to be matched against. Works a charm. BUT, when deployed into a Flink cluster ( and it took me to hell and back last week to actually get the code to FIND the text file), the array is only populated as part of the Build method. When it comes to being used the data has mysteriously disappeared and I am left with an array size of 0. (ergo, not a lot of matches get found. Thus, 2 questions - why does it work in Eclipse and not on deploy (renders a lot of Eclipse unit tests pointless as well). Or possibly just more generally, what is the right way to cross reference this kind of static, fixed reference data within Flink? (and in a way that it is found in both Eclipse and the cluster...)
The standard way to handle static reference data is to load the data in the open method of a RichMapFunction or RichFlatMapFunction. Rich functions have open and close methods that are useful for creating and finalizing local state, and can access the runtime context.

Multiple identical I2C sensors with the vl53L0x API (ST Microelectronics)

In a professional context, I have to use the vl53L0x. This sensor was released recently, along with it's API, meaning that there's no help on the internet yet :
http://www.st.com/content/st_com/en/products/embedded-software/proximity-sensors-software/stsw-img005.html
This API contains some source and headers file, that I compiled with the gcc. It works fine, despite clearly lacking comments. I flash the memory of a stm32 (NUCLEO-F401RE), which controls a vl53L0x sensor via an I2C bus. I now want to add more vl53L0x sensors on the same I2C bus, and refer to this document (if you want to read it, go directly to the bottom half of the page 5, the wiring is already done) :
http://www.st.com/content/ccc/resource/technical/document/application_note/group0/0e/0a/96/1b/82/19/4f/c2/DM00280486/files/DM00280486.pdf/jcr:content/translations/en.DM00280486.pdf
The principle, that I already applied on other sensors, is that they all start with the same address. You then have to activate one, change it's address, then activate the next one, change it's address, etc.
Unfortunately, ST Microelectronics didn't publish the list of the I2C registers, so I have to use their API to control multiple sensors. The document linked above explains how to do so. Among other things, it specifies :
In vl53L0x_platform.h API file
• Set VL53L0x_SINGLE_DEVICE_DRIVER macro to 0 so that API implementation will
be automatically adapted to a multi-device context.
I looked everywhere in the API folder, I was not able to find any reference to a VL53L0x_SINGLE_DEVICE_DRIVER macro. Setting it to 0 won't change anything, as this string is not present anywhere in the API files. Did anyone run into a similar problem ?
I'm working on the same thing. It seems that you're further ahead than I am. However, putting this in my while(1) loop seems to make both the sensors work.
ResetAndDetectSensor(0);
TimeStamp_Reset();
The guide says that in order to use all the sensors simultaneously, you need to pull the XSHUT pin high for all the sensors, reset the timestamp and then pick up the sensor which actually detects something.

Using a custom DataAbortHandler in WindowsCE

We're developing an application based on Windows CE. At the moment we're fighting with numerous data abort exceptions that only occur with release builds. We only have a limited number of development devices, that actually output their debug stream onto the serial port. Now we're wondering if it is possible to use OemDataAbortHandler to access the content of the Exception (i.e. everything that is written to the debug stream) in order to gather the data for diagnostic purposes.
Ideally we'd be able to create a textfile containing data like this:
Exception 'Data Abort' (4): Thread-Id=05a70002(pth=8252169c),
Proc-Id=03cf000e(pprc=824f3d70) 'XXXX.exe', VM-active=03cf000e(pprc=824f3d70) 'XXXX.exe'
PC=400323cc(coredll.dll+0x000223cc) RA=4003361c(coredll.dll+0x0002361c) SP=0102f27c,
BVA=6464646c
Now, the signature of OemDataAbortHandler is:
void OEMDataAbortHandler(void);
Is there any way to get access to the data written to the debug stream?
You should be able to use Structured Exception Handling (__try/__except) to filter the data abort exception. The processor state at the time of the exception is returned in the CONTEXT argument of the GetExceptionInformation intrinsic function. See the documentation for try/except.

Resources