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 "myudp.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); | |
| MyUDP server; | |
| MyUDP server; | |
| server.SayHello(); |
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 "mytimer.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); | |
| Mytimer mtimer; //Costructor will fire where the code is. That's it | |
| return a.exec(); | |
| } |
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
| //How to use qFind() | |
| #include "mytimer.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); | |
| QList<int> List; | |
| List << 1 << 5 << 15 << 23; | |
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 "dialog.h" | |
| #include "ui_dialog.h" | |
| Dialog::Dialog (QWidget *parent): | |
| QDialog(parent), | |
| ui(new UI::Dialog) | |
| { | |
| ui->setupUI(this); | |
| /***Set the autocompletion*****/ |
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 += 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
| 1. Register a new app at dev.twitter.com/apps/ | |
| 2. Fill in the fields for your site accordingly, just be sure to select Browser in Application Type, and set | |
| the Callback URL to something like http://blahblah.com/twitter_login.php (http://localhost/ won’t be accepted because it doesn’t have a domain name). | |
| 2. Select Read & Write. Fill in the captcha, click “Register Application,” and accept the Terms of Service. | |
| 3. You get a Consumer key and Consumer secret | |
| 4. Since we’re using Twitter to authenticate users, we’ll need a database table to store those users |
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 quickSort(int arr[], int left, int right) { | |
| int i = left, j = right; | |
| int tmp; | |
| int pivot = arr[(left + right) / 2]; | |
| /* partition */ | |
| while (i <= j) { | |
| while (arr[i] < pivot) | |
| i++; | |
| while (arr[j] > pivot) |
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://mobile.tutsplus.com/tutorials/iphone/learn-ios-sdk-development-from-scratch/ | |
| https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/ | |
| https://developer.apple.com/devcenter/ios/checklist/ | |
| https://developer.apple.com/devcenter/ios/index.action | |
| http://www.codeproject.com/Articles/88929/Getting-Started-with-iPhone-and-iOS-Development |
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
| //Import your root controller to the .h | |
| //And set your property of your controller | |
| //@property (strong, nonatomic) BIDViewController *switchViewController; | |
| @implementation BIDAppDelegate | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| //Create the main window screen |
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
| //When the iPhone changes rotation, this method is triggered. | |
| //Once you have 2 nibs on your controller with connected outlet collections (if necessary) | |
| //and actions of both portrait and landscape nibs to the same method | |
| //. | |
| //You need to create to seperate outlets of both VIEWS in the viewcontroler .h file. | |
| //@property (strong, nonatomic) IBOutlet UIView *portrait; | |
| //@property (strong, nonatomic) IBOutlet UIView *landscape; | |
| #define degreesToRadians(x) (M_PI * (x) / 180.0) |