Finding positive numbers in an array:
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
v = Vela::DB.new | |
v.src_connection(user: 'root', password: 'pass', host: '127.0.0.1', database: 'testdb', adapter: 'mysql') | |
v.dst_connection(user: 'user', password: 'pass', host: '127.0.0.1', database: 'testpdb', adapter: 'postgresql') | |
v.dbsync("src_tbl", "dst_tbl") # destination table should already been exist | |
# if your destination tables' columns are different than the source table (e.g; clonse `col1` data to m_col1 column): | |
v.dbsync("your_src_tbl", "your_dst_tbl", {"col1" => "m_col1", "col2" => "m_col2"}) # you can add as much as column as you want |
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
v = Vela::DB.new | |
v.src_connection(user: 'user', password: 'pass', host: '127.0.0.1', database: 'testpdb', adapter: 'postgresql') | |
v.dst_connection(user: 'root', password: 'pass', host: '127.0.0.1', database: 'testdb', adapter: 'mysql') | |
v.dbsync("src_tbl", "dst_tbl") # destination table should already been exist | |
# if your destination tables' columns are different than the source table (e.g; clonse `col1` data to m_col1 column): | |
v.dbsync("your_src_tbl", "your_dst_tbl", {"col1" => "m_col1", "col2" => "m_col2"}) # you can add as much as column as you want |
Add and remove bootstrap custom fields by single clicks
index.html
file:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
<link rel="stylesheet" href="scripts/main.js"
آسمان رنگ تو آبی آبی
آسمان دریای پر ز آبی
چه بگویم ز ستاره گانت
که خودت کشور آفتابی
آسمان عاشق مهتابی تو و
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
[ | |
{ | |
"lead": { | |
"id": 299888, | |
"trade_id": 6, | |
"details": { | |
"project_deadline": "So schnell wie möglich" | |
}, | |
"closed_at": null, | |
"expiration_date": "2018-12-13T01:22:19.000+01:00", |
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 break_even(long_sp, short_sp, ndp) | |
if long_sp > short_sp # bear option | |
long_sp - ndp | |
else # bull option | |
long_sp + ndp | |
end | |
end | |
def max_profit(long_sp, short_sp, ndp) | |
if(long_sp > short_sp) # bear option |
Function type is useful:
- In the case of higher-order functions as we have seen in the above example. The argument and return type is specified using function type
- In the case of defining interfaces in go as in the interface, only the function type is specified. Whatever implements this interface has to define a function of the same type
Notice that the interface shape only defines the type of function
OlderNewer