Skip to content

Instantly share code, notes, and snippets.

View jen6's full-sized avatar
πŸ”
Growing Faster

SonGeon jen6

πŸ”
Growing Faster
View GitHub Profile
@jen6
jen6 / tasks.json
Last active January 16, 2017 01:59
vscode vhdl build and problem matcher
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "cmd",
"isShellCommand": true,
"args": ["/c"],
"showOutput": "silent",
"tasks" : [
{
@jen6
jen6 / hap.cpp
Last active April 25, 2016 12:34
였늘의 λ»˜μ§“ ν•œμ€„λ‘œ 1λΆ€ν„° argcκΉŒμ§€μ˜ ν•© κ΅¬ν•˜κΈ°
#include <iostream>
int main(int n) {return (n == 0) ? 0 : n + main(n - 1);}
class thread_pool
{
std::atomic_bool done;
thread_safe_queue<std::function<void()> > work_queue;
std::vector<std::thread> threads;
join_threads joiner;
void worker_thread()
{
while(!done)
template <class _Ty>
struct _Tuple_val
{
constexpr _Tuple_val()
: _Val()
{ //default construct
}
template<class _Other>
@jen6
jen6 / twoqueue_onestack.cpp
Created November 3, 2015 03:06
λ‘κ°œ 큐둜 μŠ€νƒ κ΅¬ν˜„ν•˜κΈ°
#include <iostream>
#include <queue>
#include <string>
#include <exception>
using namespace std;
queue<int> qu1, qu2;
enum : int { QUEUE_MIN = 0 ,QUEUE_MAX = 10};
void client::connect(const boost::system::error_code& error)
{
boost::system::error_code ec;
boost::asio::socket_base::keep_alive option(true);
//ν˜Ήμ‹œ νƒ€μž„μ•„μ›ƒ λ•Œλ¬Έμ— κ·ΈλŸ°κ°€ ν•˜κ³  λ„£μ–΄μ€¬μŠ΅λ‹ˆλ‹€
_socket.set_option(option, ec);
if (ec) {
std::cerr << ec.value() << std::endl;
exit(0);
#include <stdio.h>
#include <Windows.h>
#include <tchar.h>
#define MAX_SIZE 1024
TCHAR file_name[] = _T("test");
char buf[MAX_SIZE] = { 0, };
int test_fopen()
while (true)
{
if (!fgets(buf, MAX_SIZE, file_read)
|| ferror(file_read)
|| feof(file_read))
break;
fwrite(buf, sizeof(char), MAX_SIZE, file_write);
}
while (!feof(file_read))
#pragma
#include <iostream>
#include <thread>
#include <mutex>
#include <future>
#include <condition_variable>
#include <deque>
namespace Jen
{
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.section_1,container,false);
ListView mListView = (ListView) view.findViewById(R.id.mList);
BusListGetter get = new BusListGetter();
BusList[] bus_arr = get.Get(1);
mAdapter = new ListViewAdapter(getActivity());
mListView.setAdapter(mAdapter);
int signal_index = R.drawable.signal0;
for(int i = 0; i < bus_arr.length; i++) {