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
public class Perc { | |
public static void main(String[] args) { | |
int m = 2000000000; | |
int blah = m / 10; | |
for (int i = 0; i < m; i++) { | |
if (i % blah == 0) { | |
System.out.printf("%d: %f %%\n", i, i/((float)m)*100); | |
} | |
} |
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
(make-face 'font-lock-number-face) | |
(set-face-attribute 'font-lock-number-face nil :inherit font-lock-constant-face) | |
(setq font-lock-number-face 'font-lock-number-face) | |
(defvar font-lock-number "[0-9-.]+\\([eE][+-]?[0-9]*\\)?") | |
(defvar font-lock-hexnumber "0[xX][0-9a-fA-F]+") | |
(defun add-font-lock-numbers (mode) | |
(font-lock-add-keywords mode `( | |
(,(concat "\\<\\(" font-lock-number "\\)\\>" ) 0 font-lock-number-face) | |
(,(concat "\\<\\(" font-lock-hexnumber "\\)\\>" ) 0 font-lock-number-face) | |
))) |
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
(defun package-update-all () | |
"Update all packages" | |
(interactive) | |
(dolist (elt package-alist) | |
(let* ((name (car elt)) | |
(file-name (symbol-name name)) | |
(available-pkg (assq name package-archive-contents)) | |
(available-version (and available-pkg | |
(package-desc-vers (cdr available-pkg)))) | |
(current-version (package-desc-vers (cdr elt))) |
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
;;; package.el --- Simple package system for Emacs | |
;; Copyright (C) 2007-2011 Free Software Foundation, Inc. | |
;; Author: Tom Tromey <tromey@redhat.com> | |
;; Created: 10 Mar 2007 | |
;; Version: 0.9 | |
;; Keywords: tools | |
;; This file is part of GNU Emacs. |
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
(defun marked () | |
"Open the current file (if visiting one) in Marked." | |
(interactive) | |
(when (buffer-file-name) | |
(shell-command (concat "open -a Marked.app " (shell-quote-argument buffer-file-name))))) |
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
-- Open in Marked | |
-- Attempts to open the currently-edited document in Marked for previewing | |
-- Based on ideas by Lri <https://gist.github.com/1077745> | |
on run {} | |
tell application "System Events" | |
set frontApp to (name of first process whose frontmost is true) | |
end tell | |
tell application frontApp to activate | |
set f to false |
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
(defun markdown-cleanup-list-numbers-level (&optional pfx) | |
"Update the numbering for pfx (as a string of spaces). | |
Assume that the previously found match was for a numbered item in a list." | |
(let ((m pfx) | |
(idx 0) | |
(success t)) | |
(while (and success | |
(not (string-prefix-p "#" (match-string-no-properties 1))) | |
(not (string< (setq m (match-string-no-properties 2)) pfx))) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>groupInfo</key> | |
<dict> | |
<key>expandAfterMode</key> | |
<integer>1</integer> | |
<key>groupName</key> | |
<string>Date Time</string> |
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
(defun shell-command-on-region-to-string (start end command) | |
(with-output-to-string | |
(shell-command-on-region start end command standard-output))) |
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
--- ./ghc/ghc.wrapper.old 2011-10-25 08:57:34.000000000 -0500 | |
+++ ./ghc/ghc.wrapper 2011-10-25 08:57:06.000000000 -0500 | |
@@ -1 +1 @@ | |
-exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"} | |
+exec "$executablename" -B"$topdir" -pgmc "$pgmgcc" -pgma "$pgmgcc" -optl "-Wl,-read_only_relocs,suppress" -pgml "$pgmgcc" -pgmP "$pgmgcc -E -undef -traditional" ${1+"$@"} |