>>> s = [('yellow', 1), ('blue', 2), ('yellow', 3), ('blue', 4), ('red', 1)]
>>> d = defaultdict(list)
>>> for k, v in s:
... d[k].append(v)
...
>>> list(d.items())
[('blue', [2, 4]), ('red', [1]), ('yellow', [1, 3])]
2015年11月15日星期日
2015年11月12日星期四
2015年9月1日星期二
2015年4月11日星期六
Compiling an example shipped with CGAL
cmake -DCGAL_DIR=/usr/local/Cellar/cgal/4.4
Compiling an example shipped with CGAL is similar simple:
cd examples/Straight_skeleton_2 # go to an example directory cmake -DCGAL_DIR=$HOME/CGAL-4.6 . # configure the examples make # build the examples
Compiling an own non-shipped program is also close:
cd /path/to/program cgal_create_CMakeLists -s executable cmake -DCGAL_DIR=$HOME/CGAL-4.6 . make
where the second line creates a
CMakeLists.txt
file (check its options in Sectioncgal_create_CMakeLists for various details).
In a less ideal world, you probably have to install CMake, a makefile generator, and third party libraries. That is what this manual is about.
brew install qt5
4.8.6$brew install qt5
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/qt5-5.3.1.m
curl: (35) Server aborted the SSL handshake
Error: Failed to download resource "qt5"
Download failed: https://downloads.sf.net/project/machomebrew/Bottles/qt5-5.3.1.mavericks.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://download.qt-project.org/official_releases/qt/5.3/5.3.1/si
######################################################################## 100.0%
==> ./configure -prefix /usr/local/Cellar/qt5/5.3.1 -system-zlib -qt-libpng -qt-
==> make
==> make install
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
This formula is keg-only, so it was not symlinked into /usr/local.
Qt 5 conflicts Qt 4 (which is currently much more widely used).
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/qt5/lib
CPPFLAGS: -I/usr/local/opt/qt5/include
.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
==> Summary
🍺 /usr/local/Cellar/qt5/5.3.1: 5729 files, 177M, built in 28.1 minutes
4.8.6$
订阅:
博文 (Atom)