I'm playing with the Windows Phone 8 API, specifically with the accelerometer. I don't have a device to publish to, so I'm using the emulator to test my app.
I'd like to simulate knocking the phone, to simulate an acceleration greater than 1G.
I'm calculating the total acceleration like this:
private static double CalculateGForce(double x, double y, double z)
{
return Math.Sqrt(x*x + y*y + z*z);
}
Can I achieve this using the emulator? When I drag the red ball around, I never get G > 1.
The Windows Phone emulator comes with a single set of 'recorded data' called Shake. One idea might be to create your own set of recorded that gives the desired g-force.
Here is a post on how to find the original code for the Shake data, make a copy, then edit/delete/add the values to get the desired motion.
For Windows Phone 7.1
C:\Program Files (x86)\Microsoft XDE\1.0\sensordata\acc
For Windows Phone 8
C:\Program Files (x86)\Microsoft XDE.0\sensordata\acc
And as the post mentions, 'offset' is the time between changes so you'll want small offsets and larger changes between sets of X,Y,Z values.
<AccData offset="1" x="-00.08400000" y="-01.02100003" z="-00.41700000" />
<AccData offset="5" x="-00.14200000" y="-00.95099998" z="-00.39700001" />
Related
The result of PEView and HxD is different. Is it possible?
I thought it should be same because it is raw data.
In PEveiw:
In HxD:
The correct value is `F8' according to all my tools on Windows 10, including PEView 0.9.9. Are you running both tools in the exact same environment? In a VM?
F8 is part of the e_lfanew field value in the DOS header, i.e. offset to the new executable header. In layman's terms, it points to the actual NT header (IMAGE_NT_HEADERS in PEView). lfa means long file address. It is a 32-bit (DWORD) relative virtual address (RVA) value. IMAGE_NT_HEADERS is located after the DOS stub and the Rich Signature header if one exists (it does in notepad.exe).
Of interest, using PEView and notepad.exe on a Windows 7 32-bit VN, the value displayed is D8 due to a different Rich Signature header.
Does anyone know if there's a way to set the default font size for the Access 2016 Query Zoom window?
I often use the Zoom window when editing lengthy/complex expressions. I can set the zoom window font size but it only "sticks" for the current session. Next time I start Access, it's back to Tahoma 8pt.
I have no issue with the "Query Design Font" (File → Options → Object Designers → Query Design Font) as it [properly] stays where I set it (Sergoe UI 11) between sessions, but the Zoom window seems to insist upon a smaller font than the query designer.
Maybe I'm missing something but I couldn't find anything applicable online, nor in/around registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\Access
It's a minor issue but years of frustration with it is starting to add up! Surely there's a setting somewhere so I don't have to change it every time I use Access... Any ideas? Thanks!
[I'm running Access 2016 (local install Version 1711 via Office 365 ProPlus subscription) on Windows 7 Home Premium SP1 64-bit.]
The Zoom box is part of (Office installation path)\ACCWIZ\UTILITY.ACCDA. You can open this file and see the form ZoomForm, but you can't edit it.
Note that the Zoom box is not restricted (or specific) to the query designer - you can use Shift+F2 wherever you can edit (or see) a value.
With help from https://access-programmers.co.uk/forums/showthread.php?t=238660 and https://bytes.com/topic/access/answers/739912-change-default-font-zoom-box :
Set a reference to UTILITY.ACCDA.
In your startup code (called from an AutoExec macro), call this function:
Public Function ZoomBoxSetParams()
' adapt to your preferences
utility.zoom_stFontName = "Consolas"
utility.zoom_iFontSize = 16
End Function
It is not necessary to overwrite the Shift+F2 action with an AutoKeys macro as proposed in the linked threads. You only need to set these variables, and the Zoom box will always use this font.
Note:
This is mainly useful for your development computer. If any of your users use a different version of Access, or the runtime version, the reference to UTILITY.ACCDA will break.
If you are in this situation, you will either have to remove the reference and code before distribution, or perhaps set the reference at runtime if UTILITY.ACCDA is available.
Edit:
An alternative Zoom box is here: http://www.accessmvp.com/TomVanStiphout/ZoomBox.htm
(I haven't tried it)
I have three RaspBerry pi2 running windows 10 IoT.
On two of them I'm able to access drive d: as removable device from my code.
One of them when I run the following code
StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
StorageFolder sdCard = (await externalDevices.GetFoldersAsync()).FirstOrDefault();
if (sdCard == null)
{
I get null for the sdCard - but this happens just for one of three.
And on all devices I can access d: via \myip\d$
Is this a "bug" or did I forget a step when configuring my third device?
I found the source of the problem.
The SD card was created from an existing one using win32diskimager. It looked good except the problem here. After checking bit by bit I found out that the card has a lot of partitions - one with ID 1 and several others with ID 0.
The first partition (ID 1) holds a drive (EFI...) and is marked as active on the original (working) SD card.
On the clone it was not active - Windows 10 IoT booted but drive D: was not included as removable device.
After setting the partition active everything works as expected.
I create universal project type in vs 2013 for 8.1.
In windows phone project i added reference to WriteableBitmapEx via nuget. In references i see WriteableBitmapEx.WinRT. I write code which creates WriteableBitmap from content (use image in project with Content and Dont copy properties). Next i create Image and set source to WriteableBitmap and add image in LayoutRoot grid. In emulator i see this image, thats ok!
Next i call DrawLine method from WriteableBitmap and call WriteableBitmap.Invalidate().
I dont see my line...why?
1) Why reference name ends with .WinRT, is this normal?
2) Why invalidate method not work?
NOTE: in windows phone 8 project (not universal) all works properly! And reference name not ends with .WinRT.
Help me please!
As already said in my comment, I had the same problem. After hours of confused searching, I finally found this trivial reason:
For universal apps, there are actually two projects: MyProject.Windows and MyProject.WindowsPhone. You need to add the nuget package for both of them (they have separate references) and everything will work.
I'm new to windows phone 8, and I was wondering if there is a way to have control over the calling function. For example, I'd like to be able to stop a call when it is a certain number, and be able to save a list of "spam" numbers in a list. Code isn't necessary, I was just wondering what namespaces to start from.
You cannot do that in the windows phone.