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
;;; UI Tweaks | |
;; nice scrolling | |
(setq scroll-margin 0 | |
scroll-conservatively 1000 | |
scroll-preserve-screen-position t) | |
;; enable y/n answers | |
(fset 'yes-or-no-p 'y-or-n-p) | |
;; more useful frame title, that show either a file or a | |
;; buffer name (if the buffer isn't visiting a file) |
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
(define-alias FileInputStream java.io.FileInputStream) | |
(define-alias MessageDigest java.security.MessageDigest) | |
(define-alias Integer java.lang.Integer) | |
(require 'srfi-13) | |
;;-------------------------------------------------------------------- | |
(define (md5vector file-name ::java.lang.String) | |
(let ((md (MessageDigest:getInstance "MD5")) | |
(fis (FileInputStream file-name)) | |
(data-bytes ::byte[] ((primitive-array-new byte) 1024))) | |
(do ((nread 0 (*:read fis data-bytes))) |
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
":"; exec kawa -f $0 "$@" #-*- coding:utf-8 -*- | |
(define-alias Properties java.util.Properties) | |
(define-alias FileInputStream java.io.FileInputStream) | |
(let ((props (Properties))) | |
(props:load (FileInputStream "application.properties")) | |
(format #t "Nombre: ~A~%" (props:getProperty "app.name")) | |
(format #t "Version: ~A~%" (props:getProperty "app.version"))) |
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
":"; exec kawa -f $0 "$@" # -*- coding:utf-8; mode:Scheme -*- | |
(define-alias File java.io.File) | |
(define-alias Date java.util.Date) | |
(define-alias DateFormat java.text.SimpleDateFormat) | |
(let* ((this-dir (path-last (*:getCanonicalPath (File ".")))) | |
(backup-date (*:format (DateFormat "yyyyMMdd-HHmm") (Date))) | |
(nom-tar (format #f "~A_~A.tar" this-dir backup-date))) | |
(format #t "Generando respaldo ~A ...~%" nom-tar) |
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
;; -*- coding: utf-8; mode: Scheme -*- | |
;; Snippet de código utilizando Swing en Kawa | |
(define-alias JFrame javax.swing.JFrame) | |
(define-alias JLabel javax.swing.JLabel) | |
(let ((frame1 (JFrame "Ventana Hola"))) | |
(*:add frame1 (JLabel "Hola a todos desde Kawa")) | |
(*:pack frame1) | |
(*:setDefaultCloseOperation frame1 JFrame:EXIT_ON_CLOSE) | |
(*:setVisible frame1 #t)) |
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
//-*- coding:utf-8; -*- | |
def edad | |
def nombre | |
def brin = new BufferedReader(new InputStreamReader(System.in)) | |
def num | |
print("Hola, ¿Cuál es tu nombre? ") | |
nombre = new String(brin.readLine()) | |
print("¿En qué año naciste? ") |
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 java.io.*; | |
class nomedad { | |
public static void main (String[] args) throws IOException { | |
Integer edad; | |
String strnombre; | |
BufferedReader brin; | |
int n; | |
/* Inicialización */ | |
brin = new BufferedReader(new | |
InputStreamReader(System.in)); |
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/perl -w | |
print "Hola ¿Cual es tu nombre?: "; | |
chomp(my $nombre = readline); | |
print "¿En que año naciste?: "; | |
chomp(my $ann = readline); | |
print "Hola $nombre.\n"; | |
print "En el año 2014 tendrás ", (2014-$ann), " años.\n"; |
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
main = do | |
putStrLn "¡Hola!, ¿Cuál es tu nombre?" | |
nombre <- getLine | |
putStrLn "¿En qué año naciste?" | |
ann_nac <- getLine | |
let edad = 2014 - (read ann_nac)::Integer | |
putStrLn ("Hola " ++ nombre) |
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
; -*- coding: utf-8; mode: Scheme -*- Kawa | |
;; Coding Kata String Calculator (http://osherove.com/tdd-kata-1/) | |
(require 'srfi-1 ) ;; List Library | |
(require 'srfi-13) ;; String Library | |
(require 'srfi-14) ;; Character-set Library | |
(define-alias String java.lang.String) | |
(define-alias RuntimeException java.lang.RuntimeException) |
NewerOlder