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
| //add new item to filter | |
| var filterTemplate = new sap.m.ViewSettingsItem({key: "releaseName___EQ___{externalName}", text: "{externalName}"}); | |
| var filterItem = new sap.m.ViewSettingsFilterItem("F7", {text: "Release"}); | |
| filterItem.bindAggregation("items", {path: "/Releases_EV" , template: filterTemplate}); | |
| this._oFilterDialog.addFilterItem(filterItem); | |
| //fix bug where filters are not being reset | |
| this.oldFunction = this.onFilterPressed; | |
| var newFunction = function(oEvent){ this.oldFunction(oEvent);this.getList().getBinding('items').aFilters = []; }; | |
| this.onFilterPressed = newFunction; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="XML View"> | |
| <script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.m"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| <!-- XML-based view definition --> |
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
| /** | |
| * Solution for day1 of http://adventofcode.com/ | |
| */ | |
| var fs = require('fs'); | |
| fs.readFile('day1input.txt', 'utf8', function (err,data) { | |
| if (err) { | |
| return console.log(err); | |
| } |
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
| var app = require('express')(); | |
| var request = require('request'); | |
| app.get('/', function (req, res) { | |
| res.send('Hello World'); | |
| }); | |
| app.get('/nw*', function(req, res){ | |
| //get request url and strip off the /nw/ |
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
| hello |
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
| pragma solidity ^0.4.0; | |
| contract Piggy { | |
| uint target = 1000000000000000000; | |
| event Msg( string msg); | |
| mapping(address => uint) balances; | |
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
| defmodule Aoc.Day24 do | |
| def read_input(file) do | |
| # File.read!("./input/day24_sample.txt") | |
| File.read!(file) | |
| |> String.split("\r\n", trim: true) | |
| |> Enum.map(fn x -> | |
| [a, b] = String.split(x, "/") | |
| {String.to_integer(a), String.to_integer(b)} | |
| end) | |
| end |
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
| defmodule Aoc.Day24 do | |
| def go do | |
| g = read_input() |> create_graph() | |
| dfs([{0,30}], [], g, []) | |
| end | |
| def read_input(file \\ "./input/day24.txt") do | |
| File.read!(file) | |
| |> String.split("\r\n", trim: true) |
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
| defmodule Day8 do | |
| def part1 do | |
| {tree, _} = | |
| File.read!("./lib/input.txt") | |
| # "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2" example input | |
| |> String.split() | |
| |> Enum.map(&String.to_integer(&1)) | |
| |> create_tree | |
| sum_metadata(tree) + Enum.sum(tree.metadata) |