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
{ | |
// 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" : [ | |
{ |
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(int n) {return (n == 0) ? 0 : n + main(n - 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
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) |
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
template <class _Ty> | |
struct _Tuple_val | |
{ | |
constexpr _Tuple_val() | |
: _Val() | |
{ //default construct | |
} | |
template<class _Other> |
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> | |
#include <queue> | |
#include <string> | |
#include <exception> | |
using namespace std; | |
queue<int> qu1, qu2; | |
enum : int { QUEUE_MIN = 0 ,QUEUE_MAX = 10}; |
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
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); |
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 <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() |
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
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)) |
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
#pragma | |
#include <iostream> | |
#include <thread> | |
#include <mutex> | |
#include <future> | |
#include <condition_variable> | |
#include <deque> | |
namespace Jen | |
{ |
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 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++) { |