This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Description: Parses expressions with two user-defined functions ("Max","Sum") and one operator ("+") acting upon three lists: | |
"l1", "l2", "l3" | |
Sample expression which can be parsed by this program: | |
Sum(Max(l1,l2),l3)+Max(l1,Sum(l1,l2)+l3) | |
To know more or to create your own parsers, visit: | |
http://www.artima.com/pins1ed/combinator-parsing.html | |
*/ | |
import scala.util.parsing.combinator._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This code implements Conway's game of life, the universe of which is a two dimensional grid of cells which can either be dead or alive. | |
The grid changes its state based on these rules: | |
1) Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. | |
2) Any live cell with two or three live neighbours lives on to the next generation. | |
3) Any live cell with more than three live neighbours dies, as if by overpopulation. | |
4) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. | |
In this case, color of a live cell is black and color of a dead cell is white. | |
Sample input 1: | |
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conky.config = { | |
--Various settings | |
background = false, | |
cpu_avg_samples = 2, | |
diskio_avg_samples = 10, | |
double_buffer = true, | |
if_up_strictness = 'address', | |
net_avg_samples = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conky.config = { | |
--Various settings | |
background = false, | |
cpu_avg_samples = 2, | |
diskio_avg_samples = 10, | |
double_buffer = true, | |
if_up_strictness = 'address', | |
net_avg_samples = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My device details: | |
Device Model Number: SM-T515NZKDINU | |
Linux Kernel Version: 4.4.111-17420370 | |
Instructions for SM-T515: | |
1) Download these files using the links given in the post: https://forum.xda-developers.com/galaxy-tab-a/development/ubports-ubuntu-touch-sm-t510-t515-t4146417: | |
a) Halium arm32 GSI file | |
b) Ubports Patched Kernel | |
c) (Optional) SamsungUSBTethering zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# In[1]: | |
from tensorflow.examples.tutorials.mnist import input_data | |
# In[2]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CustomTypeInference { | |
def main(args: Array[String]) = { | |
val input_string_list = List("22-12-2016","2.334e10","2.345","-1234","-1","1.e10","25/12/16","21-21-16","21/21/2016") | |
// Date format of the type can be detected: DD-MM-YYYY | DD-MM-YY | DD/MM/YYYY | DD/MM/YY | |
val dateRegex = """([0-9]{2}-[0-9]{2}-[0-9]{4}|[0-9]{2}-[0-9]{2}-[0-9]{2}|[0-9]{2}/[0-9]{2}/[0-9]{4}|[0-9]{2}/[0-9]{2}/[0-9]{2})""" | |
val timeRegex = """([0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3})""" |