Skip to content

Instantly share code, notes, and snippets.

@dimitar9
dimitar9 / Find Minimum in Rotated Sorted Array II.cpp
Created October 21, 2014 16:00
Find Minimum in Rotated Sorted Array II [leetcode]
class Solution {
public:
int helper(vector<int> &num, int st, int end) {
if (st == end)
return num[st];
if (end - st == 1)
return (num[st] > num[end]) ? num[end] : num[st];
int mid = st + (end - st + 1) / 2;
// if ((num[mid] == num[st]) && (num[mid] == num[end]))
@dimitar9
dimitar9 / maximizeDigits.cpp
Created June 20, 2014 04:36
重新排序整数的digits使其最大化 (e.g. 3515 -> 5531) 要求O(1)
重新排序整数的digits使其最大化 (e.g. 3515 -> 5531) 要求O(1)
int largestSibling(int N) {
int digit;
int temp = 0;
int output = 0;
for (digit=9;digit>0;digit--)
for (temp=N;temp>0;temp/=10)
if (temp%10==digit) output = output + digit*10;
01net.com:443 - VULNERABLE
1001freefonts.com:443 - VULNERABLE
123contactform.com:443 - VULNERABLE
123rf.com:443 - VULNERABLE
18qt.com:443 - VULNERABLE
1fichier.com:443 - VULNERABLE
24tv.ua:443 - VULNERABLE
444.hu:443 - VULNERABLE
518.com.tw:443 - VULNERABLE
55188.com:443 - VULNERABLE
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/bin/sh
do_usage () {
cat << _EOF
Usage: populate-extfs.sh <source> <device>
Create an ext2/ext3/ext4 filesystem from a directory or file
source: The source directory or file
device: The target device