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
.section .data | |
hello: | |
.ascii "Diving into Great Assembly World" | |
hello_end: | |
.set HELLO_SIZE, hello_end-hello | |
.section .text | |
.global _start |
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
;; Compilation for gcc / g++ | |
(defun ramz/code-compile () | |
(interactive) | |
(unless (file-exists-p "Makefile") | |
(set (make-local-variable 'compile-command) | |
(let ((file (file-name-nondirectory buffer-file-name))) | |
(format "%s -o %s %s" | |
(if (equal (file-name-extension file) "cpp") "g++" "gcc" ) | |
(file-name-sans-extension file) | |
file))) |
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
# can you spot the bug? | |
# | |
# if so, boundary is hiring: jobs@boundary.com | |
# | |
c03bc00c <atomic64_add_return_cx8>: | |
c03bc00c: 55 push %ebp | |
c03bc00d: 53 push %ebx | |
c03bc00e: 56 push %esi | |
c03bc00f: 57 push %edi |
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 the X86 instruction bswap and gcc inline assembly | |
inline unsigned int ntohl(unsigned int x) | |
{ | |
asm("bswapl %1" : "=a" (x) : "a"(x)); | |
} | |
inline unsigned int htonl(unsigned int x) | |
{ |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
void printChess(vector<vector<int> > &board) | |
{ | |
static int i = 1; |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
int denom[] = { 1, 5, 10, 25 }; | |
int ncents(int val, vector<unsigned int> &numCoins) |
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
;; Shift F8 will highlight all the words that match underlying word in the buffer | |
(defun is-word-highlighted () | |
(interactive) | |
(let ((face (or (get-char-property (point) 'read-face-name) | |
(get-char-property (point) 'face)))) | |
(if (facep face) (if (face-equal face "hi-yellow") t nil) nil))) | |
(defun toggle-highlight-word () | |
(interactive) | |
(setq sym (concat "\\<" (current-word) "\\>")) |
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
;;============EDIT THESE LINES with your path========== | |
(add-to-list 'load-path "<path_to_cedet-1.0.1>") | |
(load-file "<path_to_cedet-1.0.1>/common/cedet.el") | |
(add-to-list 'load-path "<path_to_ecb_folder>") | |
(require 'ecb) | |
(semantic-load-enable-excessive-code-helpers) | |
(require 'semantic-ia) |
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
def reverse_word str | |
str.reverse.split(" ").map { |n| n.reverse }.join(" ") | |
end | |
reverse_word "This is really awesome" |
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
require 'rubygems' | |
require 'mechanize' | |
require 'nokogiri' | |
@filename = "bookslist.txt" | |
@book_list = {} | |
@a = Mechanize.new { |agent| | |
agent.user_agent_alias = 'Mac Safari' | |
OlderNewer