Skip to content

Instantly share code, notes, and snippets.

View andrealmar's full-sized avatar
🏠
Working from home

Andre Almar andrealmar

🏠
Working from home
View GitHub Profile
def generator():
n = 1
print("Essa uma função Generator")
yield n
n += 1
yield n
n += 1
yield n
>>> # Quando a função termina, a exceção StopIteration é levantada automaticamente.
>>> next(a)
Traceback (most recent call last):
...
StopIteration
>>> next(a)
Traceback (most recent call last):
...
StopIteration
>>> for item in generator():
... print(item)
...
Essa é uma função Generator
1
2
3
>>
list_comprehension = [1,2,3,4,5,6,7,8]
generator_expression = (1,2,3,4,5,6,7,8)
>>> x = [1, 2, 3, 4, 5, 6, 6, 8]
>>> x
[1, 2, 3, 4, 5, 6, 6, 8]
>>> generator_expression = (i for i in x)
>>> generator_expression
<generator object <genexpr> at 0x101812af0>
>>> list_comprehension = [i for i in x]
>>> list_comprehension
[1, 2, 3, 4, 5, 6, 6, 8]
>>>
import os
import glob
import sys
import cx_Oracle
row_id = raw_input("Enter ROW_ID: ")
row_id = str(row_id)
SQL = '''
#This are the proxy settings we use for activator
# Multiple proxy hosts can be used by separating them with a '|' sign
# Do not enclose the proxy host(s) in quotes
-Dhttp.proxyHost=99.99.99.99 - your proxy IP/host
-Dhttp.proxyPort=82 - your proxy PORT
-Dhttps.proxyHost=99.99.99.99 - your proxy IP/host
-Dhttps.proxyPort=82 - your proxy PORT
# Here we configure the hosts which should not go through the proxy. You should include your private network, if applicable.
package controllers;
import oi.siebel.Control; //that's the Class I created to send the SSH commands to an UNIX shell
import play.mvc.Controller;
import play.mvc.Result;
import java.util.*;
import java.lang.*;
public class Application extends Controller {
package controllers;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.util.HashMap;