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
def generator(): | |
n = 1 | |
print("Essa uma função Generator") | |
yield n | |
n += 1 | |
yield n | |
n += 1 | |
yield n |
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
>>> # 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 |
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
>>> for item in generator(): | |
... print(item) | |
... | |
Essa é uma função Generator | |
1 | |
2 | |
3 | |
>> |
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
list_comprehension = [1,2,3,4,5,6,7,8] |
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
generator_expression = (1,2,3,4,5,6,7,8) |
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
>>> 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] | |
>>> |
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 os | |
import glob | |
import sys | |
import cx_Oracle | |
row_id = raw_input("Enter ROW_ID: ") | |
row_id = str(row_id) | |
SQL = ''' |
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
#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. |
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
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 { |
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
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; |
OlderNewer