Skip to content

Instantly share code, notes, and snippets.

View kkdai's full-sized avatar

Evan Lin kkdai

View GitHub Profile
#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
{}
class AA
{
public:
AA()
{
printf("1");
}
virtual void F1()
{
printf("2");
#include <iostream>
#include <stdio.h>
#define FOO_Def
#define FOO_Def2 5
int main(int argc, const char * argv[])
{
#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
#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
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;
}
}
#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 又
-(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];
}
@kkdai
kkdai / SimpleScaleTrasnform.m
Created March 13, 2014 07:54
Using default transform to make whole UI scale from out side to UI
-(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];
}
// 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>