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
//Range Based For Loop Example (Run on VS2012) | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
template <typename T> | |
void printElement1(const T& collection) | |
{ | |
std::cout<<"printElement using traditional for loop"<<std::endl; |
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 <vector> | |
#include <algorithm> | |
#include <iostream> | |
#include <string> | |
using std::cout; | |
using std::endl; | |
using std::vector; | |
using std::string; |
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
// ConsoleApplication1.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <thread> | |
#include <atomic> | |
using namespace std; |
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
//Compiled with G++(GCC) 4.6.2 | |
/* | |
* std::vector::emplace_back (since C++11) | |
* | |
* Appends a new element to the end of the container. | |
* The element is constructed in-place, i.e. no copy or move operations are performed. | |
* The constructor of the element is called with exactly the same arguments, | |
* as supplied to the function. | |
* */ |
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
//... | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
File root = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); | |
ListDir(root); | |
isPlaying = false; | |
c = getApplicationContext(); | |
index = 0; |
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
package com.audroid.music; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.media.MediaPlayer; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; |
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
''' | |
Created on 2012. 2. 19. | |
This module is for playing mp3 (limited) and wav formatted audio file | |
@author: John | |
''' | |
import pygame | |
def playsound(soundfile): | |
"""Play sound through default mixer channel in blocking manner. | |
This will load the whole sound into memory before playback |
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
''' | |
module to get Sydney/Australia's local time. | |
This module is not portable as time.tzset() is not supported at Windows Environment but only at *nix. | |
Will be useful if deployment system is in different time zone to application's target time zone. | |
''' | |
import os | |
import time | |
from time import strftime, localtime |
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 <thread> | |
#include <iostream> | |
int main() | |
{ | |
auto t1 = new std::thread([] | |
{ | |
for(int i=0; i < 10; i++) | |
std::cout<<"Thread 1 ------>"<<std::endl; | |
}); |
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
#Example: ....asdasfasBBBbCCClhasdheku.... | |
#[a-z][A-Z]{3}([a-z])[A-Z]{3}[a-z] | |
import re | |
regex= "[a-z][A-Z]{3}([a-z])[A-Z]{3}[a-z]" | |
filename = "pythonchallenge3.txt" | |
try: | |
f = open(filename, "r") | |
readed = f.read() |