(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/// This is the stateful widget that the main application instantiates. | |
class MyStatefulWidget extends StatefulWidget { | |
const MyStatefulWidget({Key key}) : super(key: key); | |
@override | |
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); | |
} | |
/// This is the private State class that goes with MyStatefulWidget. |
httpCall(url: 'http://worldtimeapi.org/api/timezone/Europe/Rome') { (result) in | |
print(result) | |
} | |
func httpCall(url: String, completion: @escaping (_: [String: Any]) -> Void) { | |
let url = URL(string: url)! | |
let task = URLSession.shared.dataTask(with: url) {(data, response, error) in | |
guard let data = data else { return } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
setOnScrollListener(new OnScrollListener(){ | |
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { | |
// TODO Auto-generated method stub | |
} | |
public void onScrollStateChanged(AbsListView view, int scrollState) { | |
// TODO Auto-generated method stub | |
final ListView lw = getListView(); | |
if(scrollState == 0) | |
Log.i("a", "scrolling stopped..."); |
[server:main] | |
use = gunicorn | |
host = 127.0.0.0 | |
port = 5000 | |
workers = 3 | |
proc_name = proc_name |
jQuery(document).on('keypress','[data-val="number"]',function(event){ | |
var key = event.charCode; | |
if( ( key == 0 || (key < 58 && key > 46) ) == false ) | |
return false; | |
}); |
var bindTemaplte = function(template,data) | |
{ | |
for(key in data) | |
{ | |
var reg = new RegExp('{{ ' + key + ' }}','g'); | |
template = template.replace(reg,data[key]); | |
} | |
return template; | |
} |
$('input[data-val=number]').on('keydown', function (event) { | |
var code = event.keyCode; | |
if ( (code < 48 || code > 57) && code !== 8 ) { | |
event.preventDefault(); | |
return false; | |
} | |
}); |
import requests | |
import json | |
def login(): | |
url = 'http://localhost/Service/service.svc/loginenduser/' | |
data = {'token': 'd8578edf8458ce06fbc5bb76a58c5ca4','email': 'mail@mail.com','password': '123456'} | |
headers = {'content-type': 'application/json'} | |
r = requests.post(url, data=json.dumps(data), headers=headers) |
chkconfig --levels 235 mysqld on | |
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak | |
sysv-rc-conf apache2 on ( for new versions of ubuntu ) |