Skip to content

Instantly share code, notes, and snippets.

View lenhhoxung86's full-sized avatar

Tiendh lenhhoxung86

View GitHub Profile
def compute_random_walk(A, walk_length):
'''Compute random walk based on transition probabilities
Params:
A: Adjacency matrix (numpy array)
walk_length: The length of the walk (int)
Returns:
A list of indices passed by the walk
'''
passed_node_indices = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lenhhoxung86
lenhhoxung86 / DeviceModel.swift
Created November 2, 2017 12:34 — forked from JonFir/DeviceModel.swift
Get device model in Swift
// Note: More information can be found here
// https://www.theiphonewiki.com/wiki/Models
import UIKit
public extension UIDevice {
var modelName: String {
var systemInfo = utsname()
uname(&systemInfo)
let machineMirror = Mirror(reflecting: systemInfo.machine)