- Compile the program in gcc with debug symbols enabled (
-g
) - Do NOT strip the binary
- To generate assembly code using gcc use the -S option:
gcc -S hello.c
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
import Tkinter | |
def make_textmenu(root): | |
global the_menu | |
the_menu = Tkinter.Menu(root, tearoff=0) | |
the_menu.add_command(label="Cut") | |
the_menu.add_command(label="Copy") | |
the_menu.add_command(label="Paste") | |
the_menu.add_separator() | |
the_menu.add_command(label="Select all") |
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
x86-64 (also known as just x64 and/or AMD64) is the 64-bit version of the x86/IA32 instruction set. Below is our overview of its features that are relevant to CS107. There is more extensive coverage on these topics in Chapter 3 of the B&O textbook. See also our x86-64 sheet for a compact one-page reference. | |
Registers | |
The table below lists the commonly used registers (sixteen general-purpose plus two special). Each register is 64 bits wide; the lower 32-, 16- and 8-bit portions are selectable by a pseudo-register name. Some registers are designated for a certain purpose, such as %rsp being used as the stack pointer or %rax for the return value from a function. Other registers are all-purpose, but have a conventional use depending on whether caller-saved or callee-saved. If the function binky calls winky, we refer to binky as the caller and winky as the callee. For example, the registers used for the first 6 arguments and return value are all caller-saved. The callee can freely use those registers, overwriting |
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
<html> | |
<head> | |
<meta http-equiv=refresh content='3600'> | |
<title>It's Koyaanisqatsi, baby!</title> | |
<!----------------------------------------------------------------------------- | |
BigInt.prototype.PADD = function(n, mask) { | |
return (((this & mask) + (n & mask))) ^ ((this ^ n) & ~mask); | |
} | |
BigInt.prototype.PADD = function(n, mask) { | |
var m = BigInt(this); |
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
import requests | |
from bs4 import BeautifulSoup | |
import csv | |
page = requests.get('https://github.com/trending') | |
# Create a BeautifulSoup object | |
soup = BeautifulSoup(page.text, 'html.parser') | |
# get the repo list |
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
#!/usr/bin/env python | |
import os | |
import xml.parsers.expat | |
from xml.sax.saxutils import escape | |
from optparse import OptionParser | |
from math import log10 | |
# How much data we process at a time |
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
import os | |
import sys | |
from xml.sax import parse | |
from xml.sax.saxutils import XMLGenerator | |
class CycleFile(object): | |
def __init__(self, filename): | |
self.basename, self.ext = os.path.splitext(filename) | |
self.index = 0 |
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
from xml.sax.saxutils import XMLGenerator | |
from defusedxml.sax import make_parser | |
from io import BytesIO | |
class XmlTextShrinker(XMLGenerator): | |
""" | |
An extended xml.sax.saxutils.XMLGenerator | |
""" |
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
// What system are we connected to? | |
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" | |
// Get the hostname and username (if available) | |
hostname | |
echo %username% | |
// Get users | |
net users | |
net user [username] |
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
#!/usr/bin/env python3 | |
# encoding=utf-8 | |
# vim: set nobomb: | |
from tkinter import * | |
from threading import Thread, Lock, Event | |
from queue import SimpleQueue | |
from time import sleep | |
from typing import List | |
import random |
NewerOlder