Android Asynchronous Http Client

Gradle Dependency dependencies { … implementation ‘com.loopj.android:android-async-http:1.4.9’ } AsyncClient AsyncHttpClient client = new AsyncHttpClient(); client.get(URL, params, new JsonHttpResponseHandler(){ @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { super.onSuccess(statusCode, headers, response); } }); Build Request Params RequestParams params = new RequestParams(); params.put(“lat”, latitude); params.put(“lon”, longitude); params.put(“appid”, APP_ID);

k-fold crossvalidation with sklearn

from sklearn.model_selection import KFold kf = KFold(n_splits=2) kf.split(df_train) step = 0 # set counter to 0 for train_index, val_index in kf.split(df_train): # for each fold step = step + 1 # update counter print(‘Step ‘, step) features_fold_train = df_train.iloc[train_index, [4, 5]] # features matrix of training data (of this step) features_fold_val = df_train.iloc[val_index, [4, 5]]…

pytest Tutorial – Part 3

Having your tests in place after reading pytest Tutorial – Part 1 and pytest Tutorial – Part 2 you certainly want to know how much of your code is actually tested by your tests. This is called coverage. Installation pip install pytest-cov Checking the coverage

pytest Tutorial – Part 2

In my last article pytest Tutorial Part 1  I showed some basic concepts of testing with pytest. Here are two additional concepts Parameterize Test parameterization follows the concept of DRY – Don’t repeat yourself Instead of writing a new testcase for every different value you annotate your test function and handover the different values. The…

Pandas Cheat Sheet

If you are new to Pandas feel free to read Introduction to Pandas I’ve assembled some pandas code snippets Reading Data Reading CSV import pandas as pd # read from csv df = pd.read_csv(“path_to_file”) Can also be textfiles. file suffix is ignored

Delegation Poker – Management 3.0 Practice

Why do we have to delegate in the first place? In chapter 7 of his book Management 3.0 Jurgen Apello writes about empowerment. The real use for empowerment is the manageability of the complex system itself 1. Acquire acceptance for decisions 2. Decentralize decision in a complex adaptive system