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
def caesar_cipher(message, key) | |
alphabet = [*"a".."z"] | |
alphabet_cifred = alphabet[key..26] + alphabet[0..key] | |
c_array = message.split('') | |
c_lambda = lambda { | |
|c| | |
upper = c == c.upcase |
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
```java | |
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); | |
logging.setLevel(HttpLoggingInterceptor.Level.BODY); | |
OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); | |
httpClient.addInterceptor(logging); // <-- this is the important line! | |
retrofit = new Retrofit.Builder() | |
.baseUrl(getResources().getString(R.string.serverUrl)) | |
.addConverterFactory(GsonConverterFactory.create(gson)) |
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
@echo off | |
set /p start=Insira o valor inicial de saida: | |
setlocal enableDelayedExpansion | |
for /r %%g in (*.JPG) do (call :RenameIt %%g) | |
goto :eof | |
goto :exit | |
:RenameIt |
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
/* | |
Estrutura célula contendo os seguintes campos: | |
- valor | |
- linha e coluna (posição da célula) | |
- ponteiro para o próximo elemento | |
- ponteiro para o elemento anterior | |
*/ | |
typedef struct celula | |
{ | |
int valor; |
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
/* | |
Implementação de matriz esparsa usando lista duplamente ligada | |
www.GeeksBR.com | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX 10 // máximo do vetor de células (ver na função main) | |
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
Empresa.create({ | |
'nome' : 'La Femi Níssima', | |
'end' : 'Av Rio Branco 2230', | |
'hra' : '8 as 22 horas', | |
'tel' : ['11 5423-2342','11 99837-2342'] | |
},{ | |
'nome' : 'Sushi House', | |
'end' : 'Av Paulista 1024', | |
'hra' : 'A partir das 18:30', | |
'tel' : ['11 5423-2342','11 99837-2342'] |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <locale.h> | |
enum { | |
SUM = '+', | |
MULT = '*', | |
SUB = '-', | |
DIVISION = '/' | |
} ; |
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
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
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
set nocompatible | |
filetype off | |
" Vundle | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' " Required | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'vim-scripts/closetag.vim' |
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
/* | |
This code should be pasted within the files where this function is needed. | |
This function will not create any code conflicts. | |
The function call is similar to printf: ardprintf("Test %d %s", 25, "string"); | |
To print the '%' character, use '%%' | |
This code was first posted on http://arduino.stackexchange.com/a/201 | |
*/ |