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
| # Just an example of specialization in Elixir. | |
| # | |
| # I'm not sure if this pattern is a good practice in Elixir or | |
| # it's too much "OOP-like" and it would be more Elixirific to | |
| # use protocols. But using protocols to do the same thing would | |
| # probably lead to more boilerplate code (explicitly define all | |
| # funX in every protocol implementation). | |
| # | |
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
| # | |
| # Another example of specialization in Elixir. This time using | |
| # a protocol. | |
| # | |
| # I think it's a cleaner implementation. | |
| # | |
| defprotocol MyProto do | |
| def base_data(state) |
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
| ### prvni priklad: a++ jako VYRAZ | |
| $ cat >test1.c <<EOF | |
| #include<stdio.h> | |
| int main() { | |
| int a = 5; | |
| printf("%d\n",a++); | |
| return 0; | |
| } | |
| EOF |
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
| /usr/local/bin/g++48 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc48 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc48 -fstack-protector -Wl,-rpath=/usr/local/lib/gcc48 -L/usr/local/lib/gcc48 -Wl,-z,relro,-z,now CMakeFiles/rpostback.dir/PostbackMain.cpp.o CMakeFiles/rpostback.dir/PostbackOptions.cpp.o -o rpostback ../../core/librstudio-core.a -lboost_date_time -lboost_filesystem -lboost_iostreams -lboost_regex -lboost_signals -lboost_system -lboost_thread -lboost_chrono -lpthread -lutil /usr/local/lib/libuuid.so -lrt -lz /usr/local/lib/libinotify.so /usr/local/lib/libssl.so /usr/local/lib/libcrypto.so -lpam -Wl,-rpath,/usr/local/lib -lboost_program_options | |
| CMakeFiles/rpostback.dir/PostbackOptions.cpp.o: In function `session::postback::Options::read(int, char* const*)': | |
| PostbackOptions.cpp:(.text+0x105): undefined reference to `boost::program_options::options_description::op |
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
| Symbol table '.dynsym' contains 1116 entries: | |
| Num: Value Size Type Bind Vis Ndx Name | |
| 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND | |
| 1: 000000000002c858 0 SECTION LOCAL DEFAULT 9 | |
| 2: 0000000000000000 115 FUNC GLOBAL DEFAULT UND std::logic_error::logic_error(char const*) | |
| 3: 0000000000000000 476 FUNC WEAK DEFAULT UND __cxa_finalize@FBSD_1.0 (2) | |
| 4: 0000000000000000 163 FUNC GLOBAL DEFAULT UND std::__1::codecvt<wchar_t, char, __mbstate_t>::do_length(__mbstate_t&, char const*, char const*, unsigned long) const | |
| 5: 0000000000000000 24 OBJECT GLOBAL DEFAULT UND typeinfo for std::logic_error | |
| 6: 0000000000000000 10 FUNC GLOBAL DEFAULT UND std::logic_error::what() const | |
| 7: 0000000000000000 10 FUNC GLOBAL DEFAULT UND operator delete[](void*) |
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
| In file included from /usr/ports/local/rstudio/work/rstudio-rstudio-1c6c7bd/src/cpp/core/r_util/RSessionLaunchProfile.cpp:16: | |
| In file included from /usr/ports/local/rstudio/work/rstudio-rstudio-1c6c7bd/src/cpp/core/include/core/r_util/RSessionLaunchProfile.hpp:19: | |
| In file included from /usr/include/c++/v1/string:439: | |
| /usr/include/c++/v1/algorithm:1720:19: error: no viable overloaded '=' | |
| *__result = *__first; | |
| ~~~~~~~~~ ^ ~~~~~~~~ | |
| /usr/include/c++/v1/algorithm:1744:19: note: in instantiation of function template specialization 'std::__1::__copy<std::__1::__bit_iterator<std::__1::vector<bool, std::__1::allocator<bool> >, true, 0>, std::__1::back_insert_iterator<std::__1::vector<json_spirit::Value_impl<json_spirit::Config_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, std::__1::allocator<json_spirit::Value_impl<json_spirit::Config_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > > > >' requested here |
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
| --- src/cpp/core/CMakeFiles/rstudio-core.dir/r_util/RSessionLaunchProfile.cpp.o --- | |
| /usr/local/bin/cmake -E cmake_progress_report /usr/ports/local/rstudio/work/.build/CMakeFiles | |
| [ 30%] Building CXX object src/cpp/core/CMakeFiles/rstudio-core.dir/r_util/RSessionLaunchProfile.cpp.o | |
| cd /usr/ports/local/rstudio/work/.build/src/cpp/core && /usr/bin/c++ -DBOOST_ASIO_DISABLE_KQUEUE -DBOOST_ENABLE_ASSERT_HANDLER -D_FORTIFY_SOURCE=2 -O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -pipe -fstack-protector -fno-strict-aliasing -isystem /usr/local/include -I/usr/ports/local/rstudio/work/rstudio-rstudio-1c6c7bd/src/cpp/core/include -I/usr/ports/local/rstudio/work/.build/src/cpp/core -Wall -pthread -Wformat -Wformat-security -fstack-protector --param ssp-buffer-size=4 -pie -fPIE -o CMakeFiles/rstudio-core.dir/r_util/RSessionLaunchProfile.cpp.o -c /usr/ports/local/rstudio/work/rstudio-rstudio-1c6c7bd/src/cpp/core/r_util/RSessionLaunchProfile.cpp | |
| c++: warning: argument unused during compilation: '-pie' | |
| In file inclu |
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
| $ gcc48 -I /usr/local/include -L/usr/local/lib -lboost_program_options boost_test.cpp | |
| /usr/local/bin/ld: /tmp//ccauzjzJ.o: undefined reference to symbol '_ZSt17__throw_bad_allocv' | |
| //usr/lib/libc++.so.1: error adding symbols: DSO missing from command line | |
| collect2: error: ld returned 1 exit status | |
| $ /usr/bin/c++ -I /usr/local/include -L/usr/local/lib -lboost_program_options boost_test.cpp | |
| $ ./a.out --help | |
| Basic Command Line Parameter App | |
| Options: |
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
| ## This is a quickstart tutorial for PureScript. Unlike with other tutorials, you don't need | |
| ## any build-manager (Grunt etc.) installed globally. We will use locally-installed Gulp. | |
| ## | |
| ## Prerequisites: | |
| ## - cabal (Haskell package manager) | |
| ## - npm (Node package manager) | |
| ## You will find both of them in your OS' repository. | |
| ## install PureScript compiller |
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
| defmodule SafeCode do | |
| def compile code do | |
| # we can use [existing_atoms_only: true] here | |
| {:ok, qcode} = code |> Code.string_to_quoted() | |
| unless safe? qcode do | |
| raise "Code is unsafe" | |
| else | |
| qcode |> Code.compile_quoted | |
| end |