- When using Cygwin and Codeblocks, the
gdb.exe
complains thatcannot open /cygdrive/c/.../yourfile.cpp
. [Refer to this stackoverflow page] (http://stackoverflow.com/questions/18559506/codeblocks-gdb-cannot-open-file-error). - You can fix this porblem by: Create a registry key path at
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\
using theNew->Key
. 3. The underHKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
create a string value - Name: cygdrive prefix
- Value: /cygdrive
This file contains hidden or 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 <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
void printVector(vector<int> & data) | |
{ | |
cout << "["; | |
for (int j = 0; j < data.size(); j++) |
This file contains hidden or 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
require 'open-uri' | |
require 'open_uri_redirections' | |
require 'certified' | |
require 'json' | |
require 'pp' | |
USERNAME = 'gwang' | |
query = ARGV.first.downcase |
-
Refer to this tutorial
-
Commands:
grub> set pager=1 grub> ls (hd0) (hd0,msdos2) (hd0,msdos1) grub> ls (hd0,1)/ lost+found/ bin/ boot/ cdrom/ dev/ etc/ home/ lib/ lib64/ media/ mnt/ opt/ proc/ root/ run/ sbin/
-
Refer to this link
gvm pkgset create learning
gvm pkgset use learning
gvm pkgset list
- edit env
gvm pkgenv learning
# original line
export GOPATH; GOPATH="/Users/james/.gvm/pkgsets/go1.2/learning:$GOPATH"
# new edited line
This file contains hidden or 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" | |
// Method inheritance in GoLang is particularly interesting: | |
// 1. If a struct A has an anonymous field of struct B, then an object of A has all the methods from B. | |
// Yes, that means you can call those methods of B directly without referring the field name, | |
// just as if those methods are native to A. (Refer to the struct Student in the example below.) | |
// 2. This does not work if the field is named though. (Refer to the struct Employee case in the | |
// example below. ) | |
// 3. Then what happens if A has a method whose name overlaps with one of B's methods? |
This file contains hidden or 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
// refer to: http://mikespook.com/2012/07/function-call-by-name-in-golang/ | |
func foo() { | |
// does something | |
} | |
func bar(int i1, int i2, int i3) { | |
// does something else. | |
} | |
func Call(m map[string]interface{}, name string, params ... interface{}) (result []reflect.Value, err error) { |
- Remove a file/directory in the repo but not locally:
git rm --cached filepath
git rm --cached -r directory_path
- To undo adding a file or directory:
- Start a bitbucket repo with existing project in local directory
- create a repo with ${repo_name} in bitbucket web
cd your_project_path
git init
git remote add origin [email protected]:${user_name}/${repo_name}.git
This file contains hidden or 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" | |
"runtime" | |
) | |
func main() { | |
runtime.GOMAXPROCS(4) | |
ch := make(chan int) | |
go generate(ch) | |
for { |
This file contains hidden or 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
Problem: after upgrading the Ubuntu guest (running on Windows 7 host) to 15.10, | |
1. The full screen mode stopped working; | |
2. The shared folder with windows host stopped working; | |
Fixes: | |
1. Upgraded to virtual box version 5.0.10 (the latest version at the time). | |
2. Install VirtualBox Guest Additional as usual | |
# sudo mount /dev/sr0 /media/cdrom | |
# cd /media/cdrom | |
# sudo ./VBoxLinuxAddtionRun |
NewerOlder