This file contains hidden or 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 java.lang.StringBuilder; | |
class ReverseWords { | |
public static String reverse_words(String str) { | |
StringBuilder reversed = new StringBuilder(); | |
int last = 0; | |
for (int i=0;i<str.length(); i++) { | |
if (str.charAt(i) == ' ') { |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define HEAP_SIZE 10 | |
typedef struct { | |
int elements[HEAP_SIZE]; | |
int nel; | |
} heap; |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
typedef struct node { | |
int level; | |
} node; | |
int compare_nodes(const void * a, const void * b) { | |
int a_lvl = (*(node **)a)->level; | |
int b_lvl = (*(node **)b)->level; |
This file contains hidden or 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
(ns vboxtray.core | |
(:import [java.awt Toolkit] | |
[java.awt.datatransfer StringSelection] | |
[java.net URLClassLoader URL] | |
[java.awt PopupMenu]) | |
(:require [clojure.java.shell :refer [sh]] | |
[clojure.string :only (split)]) | |
(:gen-class)) | |
(defn vm-output->map [vm-str] |
This file contains hidden or 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
(setq hippie-expand-try-functions-list | |
'(yas/hippie-try-expand | |
php-complete-function))) ;; fails because php-complete-function takes 0 arguments | |
(setq hippie-expand-try-functions-list | |
'(yas/hippie-try-expand | |
(lambda(&rest args) (php-complete-function)))) ;; works |
This file contains hidden or 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
- name: set vagrant as the apache run user | |
lineinfile: | |
state=present | |
dest=/etc/apache2/envvars | |
regexp="^export APACHE_RUN_USER=www-data" | |
line="export APACHE_RUN_USER=vagrant" |
This file contains hidden or 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
;; [M-a] aligns all words at the left edge of the rectangle | |
;; [M-b] fills the rectangle with blanks (tabs and spaces) | |
;; [M-c] closes the rectangle by removing all blanks at the left edge | |
;; of the rectangle | |
;; [M-f] fills the rectangle with a single character (prompt) | |
;; [M-i] increases the first number found on each line of the rectangle | |
;; by the amount given by the numeric prefix argument (default 1) | |
;; It recognizes 0x... as hexadecimal numbers | |
;; [M-k] kills the rectangle as normal multi-line text (for paste) | |
;; [M-l] downcases the rectangle |
This file contains hidden or 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
{ | |
"body":"International Parental Child Abduction victimizes thousands of American children each year. Many kidnapped children are never returned and are lost forever. Preventing IPCA requires efficient prevention programs because once a child is illegally removed from the U.S. it is extremely difficult to have them returned.\r\n\r\nWe support the GAO recommendation for the DHS (concurred) to create a security screening policy preventing U.S. citizens considered high-risk child abductors from leaving the U.S. with their child in violation of court orders. We urge the WHTI policy to be modified and require all U.S. child-citizens traveling abroad to present a valid American passport.\r\n\r\nCreated by advocates Peter Thomas Senese, Carolyn Vlk, Joel Walter, Patrica Lee, Pamela Michell, Eric Kalmus, David Bokel", | |
"status":"closed", | |
"isPublic":true, | |
"title":"Create International Child Abduction Prevention Programs Including A Departure Screening Lists For Potential Abductors", | |
"url":"https://peti |
This file contains hidden or 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
{ | |
"body":"On April 16, 2014 over 200 girls were kidnapped from their school in Nigeria by Boko Haram. Their families are so desperate they are willing to risk entering the forest where they believe the girls are located in an effort to plead with their captors for their return. As Boko Haram has grown more bold in their attacks on students and other civilians, the Nigerian government & military have not been able to stop them. They are now threatening to kill all of the kidnapped school girls. We are asking the international community including the US government to step in and use their combined resources to help save these girls and others like them from this terrorism. ", | |
"status":"closed", | |
"isPublic":true, | |
"title":"work with the UN and the Nigerian government to bring home the girls kidnapped by Boko Haram.", | |
"url":"https://petitions.whitehouse.gov/petition/work-un-and-nigerian-government-bring-home-girls-kidnapped-boko-haram/fFcLj7s2", | |
"signaturesNeeded":72353, | |
"created":1398435 |
This file contains hidden or 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 fabric.api import * | |
env.use_ssh_config = True | |
env.hosts = ["athos"] | |
env.user = "root" | |
env.key_filename = "/home/dan/.ssh/id_rsa" | |
env.password = "" | |
env.port = 7491 | |
def testlive(): |