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
| class Subject | |
| { | |
| public: | |
| virtual void execute() = 0; | |
| }; | |
| class RealSubject: public Subject | |
| { | |
| string str; | |
| public: |
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 <iostream> | |
| using namespace std; | |
| // 1. "lowest common denom" | |
| class Widget | |
| { | |
| public: | |
| virtual void draw() = 0; | |
| }; |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define ALIAS_QUANTITY 10 | |
| struct aliasID | |
| { | |
| char* alias; /* '\0'-terminated C string */ | |
| int specific_id; |
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
| Queries for create all needed tables: | |
| create table if not exists customers(customer_id integer primary key, customer_login text, customer_name text, unique(customer_login)) | |
| create table if not exists goods(good_id integer, good_description text, unique(good_id)) | |
| create table if not exists orders(order_id integer primary key, customer_id integer, good_id integer, unique(order_id, customer_id, good_id)) | |
| Queries to populate tables: | |
| insert into customers(customer_login, customer_name) values("user_login1", "customer_name1") | |
| insert into customers(customer_login, customer_name) values("user_login2", "customer_name2") |
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 <stdio.h> | |
| typedef void (*func_handler)(int *p_arr_item); //typedef for user defined function | |
| void func_for_processing_array(int arr[], size_t arr_size, func_handler h); | |
| void do_something_with_item(int *p_item); | |
| int main(int argc, char **argv) | |
| { | |
| int test_arr[] = {23, 32, 43, 54, 2, 86, 90}; |
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 <stdio.h> | |
| #include <stdlib.h> | |
| struct DoubleLinkedListItem //item of linked list | |
| { | |
| int field; | |
| struct DoubleLinkedListItem *p_prev; | |
| struct DoubleLinkedListItem *p_next; | |
| }; |
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
| //Reverse characters in a string: | |
| void reverse(char* s) | |
| { | |
| int i; | |
| char temp; | |
| size_t l = strlen(s); | |
| for (i = 0; i < (l/2); ++i) { | |
| temp = s[i]; | |
| s[i] = s[l - i]; |
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
| /** | |
| Handle multiple socket connections with select and fd_set on Linux | |
| Silver Moon ( [email protected]) | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> //strlen | |
| #include <stdlib.h> | |
| #include <errno.h> |
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
| Title : Revisiting Mac OS X Kernel Rootkits | |
| Author : fG! | |
| Date : April 18, 2014 | |
| |=----------------------------------------------------------------------------=| | |
| |=----------------=[ Revisiting Mac OS X Kernel Rootkits ]=-------------------=| | |
| |=----------------------------------------------------------------------------=| | |
| |=------------------------=[ fG! <[email protected]> ]=---------------------------=| | |
| |=----------------------------------------------------------------------------=| |
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
| DOCKER | |
| docker run -t -i ubuntu /bin/bash | |
| docker run -t -v /home/alex/local_work/SDK-16.4-work/:/broadcom_arm -i ubuntu /bin/bash | |
| docker rm `docker ps -aq` - remove all stopped containers | |
| sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm | |
| docker start -a -i $container_id - run last commant in exited container | |
| =========RUN stopped/exited container =========== | |
| http://stackoverflow.com/a/39329138 |