Metadata in PDF files can be stored in at least two places:
- the Info Dictionary, a limited set of key/value pairs
- XMP packets, which contain RDF statements expressed as XML
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Mathology</title> | |
<style> | |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
} |
#!/usr/bin/python | |
import socket, ssl, select, time, re | |
from thread import start_new_thread | |
from struct import pack | |
TYPE_ENUM = 0 | |
TYPE_STRING = 2 | |
TYPE_BYTES = TYPE_STRING | |
def clean(s): |
/** Extra rules by IBBoard to get nicer GTK3 header bars **/ | |
/* Also requires https://gist.github.com/Dvad/9210763 */ | |
.header-bar .button, .header-bar .button:last-child { | |
background-image: linear-gradient(to bottom, | |
shade(@theme_bg_dark_color, 1.40), | |
shade(@theme_bg_dark_color, 1.10)); | |
color: @theme_text_dark_color; | |
box-shadow: inset 0px 4px alpha(#000, 0.02), | |
inset 0px 3px alpha(#000, 0.02), |
/*************** | |
* Header bars * | |
***************/ | |
.header-bar { | |
border-width: 0 0 1px; | |
border-style: solid; | |
border-color: shade(@borders, 0.90); | |
border-radius: 15px 15px 0px 0px; | |
box-shadow: inset 0 -1px shade(@borders, 1.30); | |
background-color: @theme_bg_dark_color; |
When John was a little kid he didn't have much to do. There was no internet, no Facebook, and no programs to hack on. So he did the only thing he could... he evaluated the beauty of strings in a quest to discover the most beautiful string in the world.
Given a string s
, little Johnny defined the beauty of the string as the sum of the beauty of the letters in it.
The beauty of each letter is an integer between 1 and 26, inclusive, and no two letters have the same beauty. Johnny doesn't care about whether letters are uppercase or lowercase, so that doesn't affect the beauty of a letter. (Uppercase 'F' is exactly as beautiful as lowercase 'f', for example.)
You're a student writing a report on the youth of this famous hacker. You found the string that Johnny considered most beautiful. What is the maximum possible beauty of this string?
Disclaimer: I have no idea if this are indeed the correct answers. I just solved the exercises like this. I think that they are right though.
I have added my own code to this gist. It is ugly as hell, just like you can expect from code created in a contest like this.
Difficulty: easy
It is simple to see that a greedy solution is good enough.
im=Image.open("1.jpg") | |
#im=im.rotate(1) | |
im.save("e.jpg") | |
im2=im.convert("L") | |
im2.save("b.jpg") | |
threshold = 100 | |
im = im2.point(lambda p: p > threshold and 255) | |
im.save("d.jpg") | |
img="d.jpg" | |
result = tesseract.ProcessPagesWrapper(img,api) |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
diff -rupN src-old/command_download.cc src/command_download.cc | |
--- src-old/command_download.cc 2011-06-04 07:01:19.000000000 +0300 | |
+++ src/command_download.cc 2011-10-29 11:10:41.258332501 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, |