Apuntes de Programación Concurrente, Facultad de Informatica, UNLP. Promoción teorica 2015 - febrero.
##Qué es la concurrencia?
| from sklearn.datasets import * | |
| from sklearn import tree | |
| from sklearn.metrics import roc_curve, auc | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.preprocessing import label_binarize | |
| n_classes = 3 | |
| wine = load_wine() | |
| clf = tree.DecisionTreeClassifier() |
| from sklearn.datasets import * | |
| from sklearn import tree | |
| import graphviz | |
| wine = load_wine() | |
| clf = tree.DecisionTreeClassifier() # init the tree | |
| clf = clf.fit(wine.data, wine.target) # train the tree | |
| # export the learned decision tree | |
| dot_data = tree.export_graphviz(clf, out_file=None, | |
| feature_names=wine.feature_names, |
| function getPaginatedItems(items, page, pageSize) { | |
| var pg = page || 1, | |
| pgSize = pageSize || 100, | |
| offset = (pg - 1) * pgSize, | |
| pagedItems = _.drop(items, offset).slice(0, pgSize); | |
| return { | |
| page: pg, | |
| pageSize: pgSize, | |
| total: items.length, | |
| total_pages: Math.ceil(items.length / pgSize), |
/var/lib/lxc/mycontainer/config$HOME/.local/share/lxc/mycontainer/configlxc.mount directive, that follows the format below. Substitute proper paths as necessary:
lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0| async function orderItems() { | |
| const items = await getCartItems() // async call | |
| const noOfItems = items.length | |
| const promises = [] | |
| for(var i = 0; i < noOfItems; i++) { | |
| const orderPromise = sendRequest(items[i]) // async call | |
| promises.push(orderPromise) // sync call | |
| } | |
| await Promise.all(promises) // async call | |
| } |
| using System; | |
| class DateTimeRange : ValueObject<DateTimeRange> | |
| { | |
| public DateTime Start { get; } | |
| public DateTime End { get; } | |
| public DateTimeRange(DateTime start, DateTime end) | |
| { | |
| Start = start; |
Often referred to as the "swiss army of knife" for TCP/IP networking, [Netcat][1] is an extremely versatile Linux utility that allows you to do anything under the sun using TCP/UDP sockets. It is one of the most favorite tools for system admins when they need to do networking related troubleshooting and experimentation.
In this tutorial, I am sharing a few useful netcat examples, although the sky is the limit when it comes to possible netcat use cases. If you are using netcat regularly, feel free to share your use case.
Note that when you are binding to well-known ports (0-1023) with nc, you need root privilege. Otherwise, run nc as a normal user.
$ nc -vn 192.168.233.208 5000
| // Ordinary | |
| public class SimpleDto : ValueObject<SimpleDto> | |
| { | |
| public string Value { get; set; } | |
| } | |
| // With base class | |
| public abstract class BaseDto<T> : ValueObject<T> | |
| { | |
| public string BaseValue { get; set; } |