This file contains hidden or 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
@Grab(group='org.codehaus.jackson', module='jackson-mapper-asl', version='1.9.13') | |
@Controller | |
@RequestMapping("/chocolates") | |
class ChocolateController { | |
def chocolates = [ | |
[ id: 1, name: "Lindt", percentage: "70%" ], | |
[ id: 2, name: "Liedl", percentage: "15%" ] | |
] |
This file contains hidden or 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
module Main where | |
import Debug.Trace | |
threshold = 0.5 | |
learningRate = 0.1 | |
weights = [0, 0, 0] :: [Double] | |
trainingSet = [ | |
([1, 0, 0], 1), | |
([1, 0, 1], 1), |
This file contains hidden or 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
package sk.upjs.ics.novotnyr.taskr; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.List; | |
public class TaskDao { | |
public static final TaskDao INSTANCE = new TaskDao(); | |
private List<Task> tasks = new LinkedList<Task>(); |
This file contains hidden or 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
package sk.upjs.ics.novotnyr.taskr; | |
public class Task { | |
private Long id; | |
private String name; | |
private boolean isDone; | |
public Long getId() { |
This file contains hidden or 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
package sk.upjs.ics.novotnyr.taskr; | |
import java.util.Date; | |
public class Task { | |
private Long id; | |
private String name; | |
private Date deadline; |
This file contains hidden or 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
import android.database.ContentObserver; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase.CursorFactory; | |
public class Defaults { | |
public static final String[] NO_PROJECTION = null; | |
public static final String[] ALL_COLUMNS = null; | |
public static final String NO_SELECTION = null; |
This file contains hidden or 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
import android.provider.BaseColumns; | |
public class Database { | |
public static final String NAME = "daygrid"; | |
public static final int VERSION = 1; | |
public interface DayColor extends BaseColumns { | |
public static final String TABLE_NAME = "daycolor"; |
This file contains hidden or 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
public class DayGridDatabaseOpenHelper extends SQLiteOpenHelper { | |
public DayGridDatabaseOpenHelper(Context context) { | |
super(context, Database.NAME, DEFAULT_CURSOR_FACTORY, Database.VERSION); | |
} | |
@Override | |
public void onCreate(SQLiteDatabase db) { | |
String sql = "CREATE TABLE %s (" + | |
"%s INTEGER PRIMARY KEY AUTOINCREMENT, " + |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>sk.upjs.ics</groupId> | |
<artifactId>sql-migrations-demo</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<profiles> | |
<profile> | |
<id>db</id> |
This file contains hidden or 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
package sk.upjs.ics.android.util; | |
import android.content.DialogInterface; | |
import android.database.ContentObserver; | |
import android.database.Cursor; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.net.Uri; | |
public interface Defaults { | |
/** |
OlderNewer