As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
#!/bin/bash | |
########################################################## | |
# Fix Symlinks | |
# | |
# Usage : Copy this file into the Framework directory, | |
# Execute it passing the Framework Name in argument. | |
# | |
########################################################## | |
if [ -z $1 ] ; then |
public static float convertPixelsToDp(float px){ | |
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); | |
float dp = px / (metrics.densityDpi / 160f); | |
return Math.round(dp); | |
} | |
public static float convertDpToPixel(float dp){ | |
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); | |
float px = dp * (metrics.densityDpi / 160f); | |
return Math.round(px); |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
########--------Retrofit + RxJava--------######### | |
-dontwarn retrofit.** | |
-keep class retrofit.** { *; } | |
-dontwarn sun.misc.Unsafe | |
-dontwarn com.octo.android.robospice.retrofit.RetrofitJackson** | |
-dontwarn retrofit.appengine.UrlFetchClient | |
-keepattributes Signature | |
-keepattributes Exceptions | |
-keepclasseswithmembers class * { | |
@retrofit.http.* <methods>; |
An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
import android.support.v7.widget.RecyclerView; | |
public class RecyclerViewSwipeListener extends RecyclerView.OnFlingListener { | |
private static final int SWIPE_VELOCITY_THRESHOLD = 2000; | |
boolean mIsScrollingVertically; | |
// change swipe listener depending on whether we are scanning items horizontally or vertically | |
RecyclerViewSwipeListener(boolean vertical) { |
The fundamental unit in PyTorch is the Tensor. This post will serve as an overview for how we implement Tensors in PyTorch, such that the user can interact with it from the Python shell. In particular, we want to answer four main questions:
PyTorch defines a new package torch
. In this post we will consider the ._C
module. This module is known as an "extension module" - a Python module written in C. Such modules allow us to define new built-in object types (e.g. the Tensor
) and to call C/C++ functions.