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 main | |
import "fmt" | |
func sum(s []int,c chan int){ | |
sum := 0 | |
for _, v := range s{ | |
sum += v | |
} | |
c <- sum |
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 main | |
import ( | |
"fmt" | |
"time" | |
) | |
func say(s string){ | |
for i := 0; i < 5;i++{ | |
time.Sleep(100 * time.Millisecond) |
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
/* | |
* LedDriver.h | |
* | |
* Created on: 2016/07/17 | |
* Author: ken | |
*/ | |
#ifndef LEDDRIVER_H_ | |
#define LEDDRIVER_H_ |
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 "gtest/gtest.h" | |
class LedDriverTest : public ::testing::Test{ | |
protected: | |
virtual void SetUp(){ | |
printf("set_up\n"); | |
} | |
virtual void TearDown(){ | |
printf("tear_down\n"); |
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 <gtest/gtest.h> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char **argv) { | |
::testing::InitGoogleTest(&argc, argv); | |
return RUN_ALL_TESTS(); | |
} |
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 Television: | |
def __init__(self,size,weight): | |
self.size = size | |
self.weight = weight | |
def data(self): | |
print str(self.size)+"kg" | |
def name(self): | |
print "tv" |
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> | |
int main(){ | |
std::cout << "Hello world" << std:endl; | |
return 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
l1 = [(9,5),(8,4),(3,8),(2,0)] | |
l2 = sorted(l1,key=lambda x:x[1]) | |
print l2 |
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
myfunc = lambda x:x ** 2 | |
print(myfunc(6)) | |
print(myfunc(5)) | |
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
puts 'Hello, world!' |
NewerOlder