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
[vincent@freebsd ~]$ sudo diskinfo -t /dev/ada0 | |
ada0 | |
512 # sectorsize | |
60022480896 # mediasize in bytes (55G) | |
117231408 # mediasize in sectors | |
0 # stripesize | |
0 # stripeoffset | |
116301 # Cylinders according to firmware. | |
16 # Heads according to firmware. | |
63 # Sectors according to firmware. |
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
[vincent@freebsd ~]$ sudo diskinfo -t /dev/ada1 | |
/dev/ada1 | |
512 # sectorsize | |
82348277760 # mediasize in bytes (76G) | |
160836480 # mediasize in sectors | |
0 # stripesize | |
0 # stripeoffset | |
159560 # Cylinders according to firmware. | |
16 # Heads according to firmware. | |
63 # Sectors according to firmware. |
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
[vincent@freebsd ~]$ sudo diskinfo -t /dev/ada1 | |
/dev/ada1 | |
512 # sectorsize | |
82348277760 # mediasize in bytes (76G) | |
160836480 # mediasize in sectors | |
0 # stripesize | |
0 # stripeoffset | |
159560 # Cylinders according to firmware. | |
16 # Heads according to firmware. | |
63 # Sectors according to firmware. |
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
# To default value | |
$ defaults delete com.apple.dock springboard-columns | |
# Arranging Launchpad (http://macnews.tistory.com/633) | |
$ defaults write com.apple.dock springboard-columns -int 7 | |
$ defaults write com.apple.dock springboard-rows -int 9 | |
$ killall Dock | |
# Reset Launchpad | |
$ rm ~/Library/Application\ Support/Dock/*.db |
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
# Delete a remote branch (or a tag) | |
$ git push origin --delete branch | |
# Or a syntactic sugar | |
$ git push origin :branch | |
# Delete a remote-tracking branch | |
$ git branch -r -d origin/branch | |
# Squash the last 4 commits |
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
# Source: http://stackoverflow.com/questions/148570/using-pre-compiled-headers-with-cmake/2956392#2956392 | |
MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) | |
IF(MSVC) | |
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE) | |
SET(PrecompiledBinary "$(IntDir)/${PrecompiledBasename}.pch") | |
SET(Sources ${${SourcesVar}}) | |
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource} | |
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\"" |
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 T> class X { }; | |
template <class T> void f(T t) { } | |
struct {} unnamed_obj; | |
void f() | |
{ | |
struct A { }; | |
enum { e1 }; | |
typedef struct {} B; | |
B b; | |
X<A> x1; // OK |
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
using namespace std; | |
list<int> my_list; | |
... | |
// Range-based for-loop (C++11) | |
for_each (int x : my_list) { | |
cout << x << endl; | |
} |