View NodeItemsRecyclerAdapter.java
@ColorInt
private int getColorForNode(Node node) {
//Set the color of the node item.
if(node.getEdges().getIn().length <= 1 && node.getEdges().getOut().length <= 1) {
//This is either a green process or a yes/no question answer.
//we need to check the previous node to see what we are.
Node[] previousNodes = mAlgorithmGraph.getPreviousNodes(node);
if(previousNodes.length == 0) {
//this is the first node, so it has to be a process at this point.
return 0x8BCCA5;
View motd.sh
#!/bin/bash
# This is a fork of https://github.com/gagle/raspberrypi-motd that addresses issue #6.
function color (){
echo "\e[$1m$2\e[0m"
}
function extend (){
local str="$1"
let spaces=60-${#1}
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
View gist:54c560f5b04be51e812b
#Non-recursive
def Main():
n=eval(input("n?")
fact = 1
for i in range(n,1,-1):
fact=fact*i
print("The factorial of",n,"is:", fact)
# Recursive
def fact(n):