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 <memory> | |
#include <string> | |
#include <iostream> | |
//Example class | |
class Dog | |
{ | |
public: | |
explicit Dog(std::string& name) : m_name(name), m_age(1){} |
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 <ctime> | |
#include <iostream> | |
class X | |
{ | |
private: | |
std::vector<int> m_vec; | |
public: | |
X() : m_vec(100000) |
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
from string import maketrans | |
intab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
outtab = "CDEFGHIJKLMNOPQRSTUVWXYZAB" | |
transtab = maketrans(intab, outtab) | |
mystr = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | |
mystrUpper = mystr.upper() | |
print mystrUpper.translate(transtab).lower() |
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
f = open("pythonchallenge2.txt", "r") | |
l = [] | |
try: | |
for line in f: | |
for c in line: | |
if c.isalpha(): | |
l.append(c) | |
finally: | |
f.close() |
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() |
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
''' | |
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
''' | |
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
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
//... | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
File root = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); | |
ListDir(root); | |
isPlaying = false; | |
c = getApplicationContext(); | |
index = 0; |
OlderNewer