This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| session_start(); | |
| define("MAPS_HOST", "maps.google.com"); | |
| define("KEY", "YOURGOOGLEMAPSAPIKEY"); //Personal Google Maps API key | |
| //Get address from which we will geocode the coordinates | |
| $address=$_GET['address']; | |
| if( $address!=NULL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://www.netmagazine.com/tutorials/create-mobile-website-jquery-mobile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="map_code.js"></script> <!-- My map code --> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
| <script src="http://maps.googleapis.com/maps/api/js?sensor=false&key=YOURKEY"></script> <!-- Map API --> | |
| <!-- No GPS sensor --> | |
| <body onLoad="initialize()"> | |
| div id="map_canvas"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QT += core gui | |
| QT += network |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Create a default connection | |
| QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL"); //Or whatever database in use | |
| /*We could add a second argument which is the connection name** | |
| Example: | |
| QSqlDatabase firstDB = QSqlDatabase::addDatabase("QMYSQL", "first"); | |
| */ | |
| //Set connection information | |
| db.setHostName("xxx.xxx.xxx.xxx"); //localhost if it's local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void SomeClass::showDialog() //Show dialog if not showing | |
| { | |
| if ( dialog ) | |
| delete dialog; | |
| dialog = new DialogClass(this); | |
| dialog->show(); | |
| dialog->raise(); //Raise in front of the parent window | |
| //dialog->activateWindow(); //Active window | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <QThread> | |
| #include "mythread.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); | |
| QThread thread; //Thread object | |
| MyThread cObject; //My class object | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int main() | |
| { | |
| //Let's say we have a listof integers | |
| QList<int> List; | |
| //insert some numbers | |
| List << 2 << 3 << 1 << 0; //Yes you could use List.append | |
| qSort(List) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Create 2 classes. | |
| One class for the server: | |
| We call it ex. MyServer, with Base class QTcpServer | |
| Second class, every connection will have a new thread: | |
| We call it MyThread, with Base class QThread |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Classes: | |
| MyServer, with Base class QTcpServer | |
| MyRunnable (this is a QRunnable task), with Base class QRunnable. (With no QObject, cause it's not a QObject) |