.examples

git-svn-id: svn://ultimatepp.org/upp/trunk@9284 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-12-12 12:57:39 +00:00
parent a308202095
commit fe02f0d952
5 changed files with 10 additions and 30 deletions

View file

@ -106,7 +106,7 @@ String FormatDegree(double d, int decimals)
char sign = (d < 0 ? '-' : '+');
if(d < 0) d = -d;
int deg = ffloor(d);
String cd = ToCharset(CHARSET_DEFAULT, "%c%d°", CHARSET_UTF8);
String cd = ToCharset(CHARSET_DEFAULT, "%c%d°", CHARSET_UTF8);
if(decimals <= -2)
return NFormat(cd, sign, deg);
d = (d - deg) * 60;

View file

@ -1,10 +1,6 @@
#include "GoogleMaps.h"
GUI_APP_MAIN {
// Following key was obtained for U++ project, please get your owen key if you want to use
// GoogleMaps API here (it is free): http://code.google.com/intl/cs/apis/maps/signup.html
SetGoogleMapsKey("ABQIAAAAXHmSFgmVIbMZDJ5RhfPINBSBetkRueiarolywVmVT7jJWZRGvBQFIvrtty50ivBLt4YApjpEVXW8Hw");
Pointf p(0, 51.477222);
if(MapDlg(p))
Exclamation("Marker position " + FormatGPS(p));

View file

@ -1,4 +1,4 @@
description "U++ containers demonstration - prints the map of words in the file";
description "U++ containers demonstration - prints the map of words in the file\377";
optimize_speed;
@ -10,3 +10,4 @@ file
mainconfig
"" = "";

4
examples/idmap/init Normal file
View file

@ -0,0 +1,4 @@
#ifndef _idmap_icpp_init_stub
#define _idmap_icpp_init_stub
#include "Core/init"
#endif

View file

@ -12,18 +12,7 @@
#include <map>
#include <deque>
#include <string>
#define TEST_HASHMAP
#ifdef TEST_HASHMAP
#ifdef COMPILER_GCC
#include <tr1/unordered_map>
#else
#include <hash_map>
#endif
#endif
#include <unordered_map>
using namespace std;
using namespace Upp;
@ -126,13 +115,7 @@ void BenchMap(const char *file)
#endif
}
#ifdef TEST_HASHMAP
#ifdef COMPILER_GCC
typedef std::tr1::unordered_map< string, vector<int> > HashMap;
#else
typedef stdext::hash_map< string, vector<int> > HashMap;
#endif
typedef std::unordered_map< string, vector<int> > HashMap;
inline bool h_less(const HashMap::value_type *a, const HashMap::value_type *b)
{
@ -163,9 +146,7 @@ void BenchHashMap(const char *file)
#endif
}
#endif
#define N 100
#define N 10000
CONSOLE_APP_MAIN
{
@ -179,7 +160,6 @@ CONSOLE_APP_MAIN
BenchNTL(fn); // first run to cache the file
#ifdef TEST_HASHMAP
{
BenchHashMap(fn);
TimeStop tm;
@ -187,7 +167,6 @@ CONSOLE_APP_MAIN
BenchHashMap(fn);
cout << "STL hash_map time: " << tm.Elapsed() << " ms \n";
}
#endif
{
BenchMap(fn);