How to discover the machine location with Qt5 - c++

Windows has this feature where you can set the (physical) location of your machine.
Say you bought your computer in England and then moved to the United States. You can then go to "Region and Language" and change your location to match the physical one.
In a project I'm currently working on, there is the need of using this feature to show some different content.
First we tried using QLocale::country() for such. But then we realized that this method was fetching the information from the format (image below) rather than from the location.
Using Windows API's GetUserGeoID() we were able to achieve it. But since this application will be ported to Linux in the near future, I want to know: Is it possible to fetch this information using Qt only?

Related

Alter the appearance of NPC player entities to have a specific skin

I'm creating a bukkit plugin that's making a world in Minecraft outside the ordinary and that includes having NPCs (bots) entities that look like actually players and not villagers. I've already got the bots working programming wise but I want to have each bot have a different skin based upon it's name. Can I do this with maybe a resource pack or something? currently they take the names of Minecraft players with the same name but I'd like to override this.
TL;DR
Can I change the appearance of player entities by name with:
a Resourcepack?
a server side command?
playerConnection.sendPacket?
This is currently not possible without modifications to the client. If you want to, you can use Spoutcraft, but this requires users of the plugin to have the Spoutcraft launcher for the textures to show correctly.
There's no way to do this with the vanilla client, however, short of buying a bunch of Minecraft accounts and assigning them appropriate skins.
You should try out the DisguiseCraft plugin for a quick fix. DisguiseCraft is currently available on the Bukkit website. Do keep in mind that it also requires ProtocolLib to function properly, and you will need to have both installed on your server. You may find a link for ProtocolLib through the DisguiseCraft page. I currently use the two on my server and have had no issues with functionality.
If you would prefer a more direct approach however, since you are coding your own plugin, consider looking over the Lib's Disguises Developer API. Like DisguiseCraft, it too requires ProtocolLib, but the source for Lib's is publicly available and is intended to target developers. Just like DisguiseCraft, you may find a link for ProtocolLib through the Lib's page.

Running a C++ program (Visual Studio application) remotely through a web server

I have written a big piece of C++ code in Visual Studio 2010 that is basically an OpenCV project. Currently, it exists only on my laptop.
When you run it, it turns on your webcam, captures your photo, tracks your face, detects some facial features, and then saves some measurements and information about the detected facial landmarks.
So far, so good...
I now want to extend this application and perform an international study; i.e. through a web browser such as Internet Explorer, users sitting at home would be able to run this VS2010 application remotely and, using their own webcams, the obtained information by the program is sent back to us and stored on a web server. Presently, I am using WampServer to have a server on my own machine, etc...
I have developed a web page where I can acquire and store the participants details, but I have no idea how to get them to access the program and run it, in order for their facial measurements and information to be captured by the software (that exists only on my machine at the moment).
I am not too sure if I have explained well what I would like to do, so please feel free to ask for clarification. But if you understand what I would like to know and find out, please provide me with tips and guidance.
Thanks in advance,
.
.
.
EDIT:
I cannot email the participants my C++ application, because (firstly) it contains copyright code and material, and (secondly) it requires installing Visual Studio 2010 on their machines! I want to reach people from all walks of life with just a Windows machine and a regular webcam. So, it has to be done through a web-server and using only a web-page. So, I guess my question is this: Is it possible to run a C++ code (that exists only on one machine/server) through peoples' web-browsers?
Short answer. Yes, possible.
capture webcam data (java,flash,silverlight,activex,html5 or custom browser native plugin)
then you send back data to the server which does whatever processing required.

Is it possible to write a PSD file from ColdFusion

I would like to be able to take a number of separate image files, mostly JPGs and PNGs, and programatically write them into a PSD file in ColdFusion. The idea is that I can create an online tool that I could use to create wedding albums from my digital wedding photos. Considering the intended use, it is imperative that image quality and color reproduction remain as close to the original as possible. My thoughts on this would be to import each file into a separate layer, and then set the positioning of the imported image by pixel coordinates.
I came across this, which appears to be the only mention of this sort of thing on SO (that I could find). However, I'd rather not revert to writing this all out in CFExecute. It seems needlessly complicated to add another language every future developer will need familiarity with, and CFExecute doesn't provide much in the way of monitoring or debugging if problems occur. But I'll do this if I need to.
Server is currently running ColdFusion 9 on Windows 2000 Advanced Server. We will probably be upgraded to ColdFusion 10 on Windows 2008 (or newer) by the time this goes to production, but having the ability to test it in my current environment would be a real plus.

How does Google Maps know my position?

I have a nokia 5500 sport mobile phone, and I found after i installed google map, it can automatically locate to my current position.
and I want to know how google map get my position and mark it on the map ?
How can I programming implement this feature with symbian C++(nokia 5500 's operate system is Symbian 3rd).
This is one of those questions where you need to know the jargon in order to find the answer. The magic word is "Location API".
Using it, I found this: http://wiki.forum.nokia.com/index.php/Google_Maps_using_Location_Api_in_Symbian
For mobile devices, a location API sometimes more or less hides the details of how the location is actually discovered, and just tells the app where you are. If the phone has GPS, it will use that. Otherwise, the phone network will help it out - it might calculate based on distance and/or direction to one or more base stations, or it might just say "sorry, I can't be very accurate, but I know you're in this cell, so you must be with a few hundred yards of the base station (city cells), or a few of miles of it (rural cells)".
The API used on the page I link to seems to be specifically GPS. Not sure whether it exists on non-GPS handsets, but if you poke around the Symbian docs long enough you can probably find an alternate location API.
The Nokia 5500 does not have GPS, and the location API does not support network positioning on S60 3rd edition fp1 (at least I'm pretty certain of that - and I should be as I was working with LBS applications on Symbian when the 5500 was released.) Also network positioning require operator/carrier support and very few operators have that enabled in their network.
What Google maps does on every device without GPS is that it sends the ID of the current cell tower to a server that knows where all(?) cell towers are, and does and educated guess at how far from that tower you are. This is both on Symbian and on Java ME devices.
Better positioning in google maps is possible with a built in GPS. The Nokia Location API also supports external BT GPSes which was all that was available when the API was released.
It doesn't have GPS, so my guess is it communicates with different antennas of your GSM provider and triangulates its position using the coordinates of these antennas.
It's possible your phone has GPS - even if it doesn't, it can triangulate based upon cell towers. Programmatically, you'll have to register # Nokia (free, IIRC), get the symbian docs and have at it.
Good luck, GPS is fun (and maddening)
See this post for symbian queries, answers and complaints Should I learn how to develop on Symbian OS?
The W3C have a draft standard for geolocation in JavaScript, which would mean one piece of geolocation code would make your website geolocation work with all mobiles. So far it's supported by Safari on iPhone and Google Android phones. We should all petition Nokia to support it in Symbian phones.

Map plugin for an MFC application

I want to display a map in a MFC application (Visual Studo 2008 with MFC Feature Pack).
Off the top of my head I have the following requirements:
I have to be able to add my own markers (plain lat/lon positions), preferrably with different colors/icons so one can distinguish between different types of markers.
If the map data is fetched from an online source, it has to be cache-able, i.e. I can pre-load maps for an area at a certain (or several) zoom-level(s) and then switch to "offline mode". Alternatively all map data is installed together with the application.
The standard operations like zoom in/out and pan should be possible for the user.
The user has to be able to select my markers, preferably by dragging a rectangle around them.
Since the whole app is written in C++/MFC I don't want to have to use the .NET runtime for this plugin.
It shouldn't cost a fortune.
I am currently using an ActiveX plugin called "ESRI MapObjects LT2" which can do all that in some way but it's very tedious to implement, the development seems to have stopped around the time when Visual Studio 6 was available and map material is either very basic or very expensive.
I thought about using Google Maps or Google Earth but I think they don't really support being used by non-web based applications.
I found ArcView to be some sort of successor of the plugin I use currently but I don't think I belong to the target audience since the functionality it offers is way more than what I need. Also I didn't find any information on pricing.
I have written an open-source Geocaching app ( it's in c++ ) that renders maps, the source is at:
http://code.google.com/p/gpsturbo/
It uses my own custom rendering but you could rip out the map parsing if you want. It renders map using google tiles ( and caches the tiles for offline use), as well as Garmin format GPS maps, there is also an Openstreetmap format renderer as well.
Reconsider google if you have internet access. You can make an instance of the IE browser appear in a frame within your application. I believe you can use an ActiveX control. Also Google Earth has a way to embed itself into a web page, and possibly an application as well.
Another option is Global Mapper which is not anywhere near as nice as Google Maps or Google Earth.
We used ESRI for a long time before abandoning it due to a lack of performance and lack of support. It was such a big pain to pay $10k for a license, and then be told they need $2k more so that we can actually use the thing. Oh, and then $2k more to add some extra functionality. Even when it didn't work, their support was dismal to lack-luster.
If you are not bound to Google Maps, you could choose OpenStreetMap.
There are couple of known applications for rendering OSM maps:
http://wiki.openstreetmap.org/wiki/Cobra
Kosmos
osmclient (on SourceForge)
First two render map directly, last one uses OpenStreetMap.org tiles.
You can cache as many tiles or data as you want, you are not restricted to do so.