This file contains 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 <iostream> | |
#include <stdio.h> | |
class L | |
{ | |
private: | |
int a1=1; | |
public: | |
L():a1(2), a2(a1) //Don't use like this, a2 result depends on compiler | |
{} |
This file contains 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
class AA | |
{ | |
public: | |
AA() | |
{ | |
printf("1"); | |
} | |
virtual void F1() | |
{ | |
printf("2"); |
This file contains 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 <iostream> | |
#include <stdio.h> | |
#define FOO_Def | |
#define FOO_Def2 5 | |
int main(int argc, const char * argv[]) | |
{ | |
This file contains 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 <iostream> | |
#include <stdio.h> | |
#define FOO_Def | |
#define FOO_Def2 5 | |
inline int foo1(int x) | |
{ | |
return x*5+8; | |
} | |
#define macro(x) x* 5 + 8 |
This file contains 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 <iostream> | |
class AA | |
{ | |
public: | |
static int i; | |
//static int i = 0; // compile error | |
static const int KKKK= 10;//OKAY | |
int k = 0; //warning, just allow after c++/11 to initialize value in class | |
void fool(){printf("the value of i is %d\n", i);}//static function only can use "static const", can't use "static" variables |
This file contains 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
private async void LoadImage_Click_1(object sender, RoutedEventArgs e) | |
{ | |
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Image/Tulips.jpg")); | |
using (IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read)) | |
{ | |
BitmapImage image = new BitmapImage(); | |
image.SetSource(fileStream); | |
Scenario4Image.Source = image; | |
} | |
} |
This file contains 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 <iostream> | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) | |
{ | |
#define PRINTX(x) std::cout << #x << " = " <<x <<"\n" | |
// ANSI C 比 K&R C 功能多了 # 及 ## ,這部份其實是 #2 的續篇 | |
// 在 #2 中說到 ANSI 及 K&R 差異,現在再加上此部份,ANSI C 又 |
This file contains 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
-(NSString*) transferGMT2TST: (NSDate*)inGMT :( NSString*) newTZ | |
{ | |
NSDateFormatter *dateFormatter = [[NSDateFormatteralloc] init]; | |
dateFormatter.dateFormat = @"yyyy-MM-dd’T'HH:mm"; | |
NSTimeZone *nTZ = [NSTimeZonetimeZoneWithAbbreviation:newTZ]; | |
[dateFormatter setTimeZone:nTZ]; | |
return [dateFormatter stringFromDate:inGMT]; | |
} |
This file contains 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
-(IBAction)startScaleTransform:(id)sender | |
{ | |
self.view.transform = CGAffineTransformMakeScale(2,2); | |
[UIViewbeginAnimations:nilcontext:NULL]; | |
[UIViewsetAnimationDuration:1]; | |
self.view.transform = CGAffineTransformMakeScale(1,1); | |
self.view.alpha = 1.0; | |
[UIViewcommitAnimations]; | |
} |
This file contains 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
// ConsoleApplication2.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <opencv2\objdetect\objdetect.hpp> | |
#include <opencv2\highgui\highgui.hpp> | |
#include <opencv2\imgproc\imgproc.hpp> | |
#include <opencv2\opencv.hpp> | |
#include <iostream> |