Skip to content

Instantly share code, notes, and snippets.

View lamhoangtung's full-sized avatar
👨‍💻
Working ...

Hoàng Tùng Lâm (Linus) lamhoangtung

👨‍💻
Working ...
View GitHub Profile
'#&()+-,.:;/ 0123456789AÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬBCDĐEÊẾỀỂỄỆFGHIÍÌỈĨỊJKLMNOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢPQRSTUÚÙỦŨỤƯỨỪỬỮỰVWXYÝỲỶỸỴZaáàảãạăắằẳẵặâấầẩẫậbcdđeéèẻẽẹêếềểễệfghiíìỉĩịjklmnoóòỏõọôốồổỗộơớờởỡợpqrstuúùủũụưứừửữựvwxyýỳỷỹỵz'́
@lamhoangtung
lamhoangtung / add_space_to_sentence.py
Created November 23, 2018 14:52
Python program to add space in sentence using a dictionary (eg: "Ilovesanwiches" to"I love sandwiches")
import time
#input_str = input()
input_str = 'Ilikesandwiches'
word_dict = ['I', 'like', 'sandwiches', 'sand', 'and', 'a', 'lot', 'a', 'ability', 'able', 'about', 'above', 'accept', 'according', 'account', 'across', 'act', 'action', 'activity', 'actually', 'add', 'address', 'administration', 'admit', 'adult', 'affect', 'after', 'again', 'against', 'age', 'agency', 'agent', 'ago', 'agree', 'agreement', 'ahead', 'air', 'all', 'allow', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'American', 'among', 'amount', 'analysis', 'and', 'animal', 'another', 'answer', 'any', 'anyone', 'anything', 'appear', 'apply', 'approach', 'area', 'argue', 'arm', 'around', 'arrive', 'art', 'article', 'artist', 'as', 'ask', 'assume', 'at', 'attack', 'attention', 'attorney', 'audience', 'author', 'authority', 'available', 'avoid', 'away', 'baby', 'back', 'bad', 'bag', 'ball', 'bank', 'bar', 'base', 'be', 'beat', 'beautiful', 'because', 'become', 'bed', 'before', 'begin', 'behavior', 'behind', 'believe', 'benefi
@lamhoangtung
lamhoangtung / TTA.py
Created November 29, 2018 08:30
Basic TTA
class TTA_ModelWrapper():
"""A simple TTA wrapper for keras computer vision models.
Args:
model (keras model): A fitted keras model with a predict method.
"""
def __init__(self, model):
self.model = model
def predict(self, X):
#!/usr/bin/env python3
import rospy
# ROS Image message
from sensor_msgs.msg import CompressedImage
# ROS Image message -> OpenCV2 image converter
from cv_bridge import CvBridge, CvBridgeError
# OpenCV2 for saving an image
import cv2
# Instantiate CvBridge
<launch>
<include ns="bridge1" file="$(find rosbridge_server)/launch/rosbridge_websocket.launch">
<arg name="port" value="9001" />
</include>
<node name="team705" pkg="object_detector" type="object_detector.py" output="screen"/>
<!-- Script của em nằm ở trong PATH ./src/object_detector/src/object_detector.py -->
</launch>
x1 x2 y
0.336493583877 -0.985950993354 0.0
-0.0110425297266 -0.10552856162 1.0
0.238159509297 -0.61741666482 1.0
-0.366782883496 -0.713818716912 1.0
1.22192307438 -1.03939898614 0.0
-1.30456799971 0.59261847015 0.0
-0.407809098981 -0.509110509763 1.0
0.893188941965 1.18285985648 0.0
-0.00546337259365 -0.589551228864 1.0
0.24539 0.81725 0
0.21774 0.76462 0
0.20161 0.69737 0
0.20161 0.58041 0
0.2477 0.49561 0
0.32834 0.44883 0
0.39516 0.48099 0
0.39286 0.57164 0
0.33525 0.62135 0
0.33986 0.71199 0
Company TV Radio News Units
Amazon 230.1 37.8 69.1 22.1
Google 44.5 39.3 23.1 10.4
Facebook 17.2 45.9 34.7 18.3
Apple 151.5 41.3 13.2 18.5
#!/usr/bin/env python
# coding: utf-8
# In[7]:
import random
def test_y(x):
return 4*x+5+random.uniform(0.1,0.2)
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int main()
{
for (int i = 0; i < 2; i++)
{