Skip to content

Instantly share code, notes, and snippets.

@ksjgh
ksjgh / docker_remove.sh
Created March 22, 2018 09:05
docker , remove all container , remove all images
#!/bin/bash
# Delete all containers
sudo docker rm $(sudo docker ps -a -q)
# Delete all images
sudo docker rmi $(sudo docker images -q)
@ksjgh
ksjgh / clipgrab.txt
Created March 15, 2018 00:49
youtube downloader , clipgrab install , remove
https://itsfoss.com/download-youtube-videos-ubuntu/
//install
sudo add-apt-repository ppa:clipgrab-team/ppa
sudo apt-get update
sudo apt-get install clipgrab
@ksjgh
ksjgh / opencv_cmake.cpp
Created March 6, 2018 08:07
opencv, caffe, path, cmake find_pakage setting
// Caffe
find_package(Caffe PATHS /opt/caffe/share/Caffe)
include_directories(${Caffe_INCLUDE_DIRS})
// OpenCV
@ksjgh
ksjgh / fail_to_fetch.txt
Created March 6, 2018 00:07
fail to fetch error , archive server change
- change archive server , to kr.archive.ubuntu --> ftp.daumkakao
- nameserver change - did but no effect
http://let-me-know.tistory.com/6
해결 방법은
$ sudo vim /etc/resolvconf/resolv.conf.d/base
Then put your nameserver list in like so:
@ksjgh
ksjgh / error_ambiguous.cpp
Created February 7, 2018 02:13
error , 'x' is abmiguous, namespace collision, confilict,
//main.cpp:32:13: error: reference to ‘x’ is ambiguous
// cout << x << '\n';
// namespace namespace collision, confilict,
#include <iostream>
using namespace std;
@ksjgh
ksjgh / binary_print.cpp
Created February 4, 2018 21:19
binary printing, formatting, btiwise, bitset
// conditional operator
#include <iostream>
#include <bitset>
using namespace std;
int main ()
{
int a=1;
int b=3;
int c=1;
@ksjgh
ksjgh / function_pointer.cpp
Created January 28, 2018 15:25
function pointer
/*Student Playground*/
#include "main.hpp"
#include <iostream>
int add(int a, int b)
{
return a+b;
}
@ksjgh
ksjgh / break_continue.cpp
Created January 28, 2018 09:31
loop, break, continue
/*Goal: understand the break and conitnue statements*/
#include<iostream>
int main()
{
int a = 0;
while(a < 5)
{
@ksjgh
ksjgh / random.cpp
Created January 28, 2018 09:28
random number generation
#include <time.h> //added for the random number generator seed
#include <cstdlib>//added to use the rand function
int main()
{
int target;
std::string userString;
int guess = -1;
srand(time(NULL)); //set the seed for the random number generator
@ksjgh
ksjgh / do_while.cpp
Created January 28, 2018 05:06
do while
/*Goal: understand the do..while loop*/
#include <iostream>
int main()
{
int count = 0;
//This do..while loop will execute until count =5