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
| .directive('materialImg', function () { | |
| return { | |
| restrict: 'EA', | |
| scope: { | |
| img: '=image' | |
| }, | |
| replace: true, | |
| template: '\n <div class="div-flex" ui-sref="app.detail( {imgObj:img} )" \n\t\t\t\tstyle="width:{{img.width*130/img.height}}px;flex-grow:{{img.width*200/img.height}}">\n <i class="i-flex" style="padding-bottom:{{img.height/img.width*100}}%"></i>\n <img class="img-flex" src="{{img.url}}" alt="">\n </div>\n \n ' | |
| /* ES6 VERSION: |
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
| // ORIGINAL POST AND CREDITS: | |
| // https://keathmilligan.net/create-a-reusable-chart-component-with-angular-and-d3-js/ | |
| // I just added a few changes to make it responsive | |
| import { Component, OnInit, OnChanges, ViewChild, ElementRef, Input, ViewEncapsulation } from '@angular/core'; | |
| import * as d3 from 'd3'; | |
| @Component({ | |
| selector: 'app-bar-chart', |
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
| /* Compile with: g++ -Wall –Werror -o shell shell.c */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/wait.h> |
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
| /* Have the function ClosestNeighbour(strArr) read the matrix of numbers stored in strArr which | |
| will be a 2D matrix that contains only the integers 1, 0, or 2. | |
| Then from the position in the matrix where a 1 is, return the number of spaces either left, | |
| right, down, or up you must move to reach an enemy which is represented by a 2. | |
| You are able to wrap around one side of the matrix to the other as well. | |
| For example: if strArr is ["0000", "1000", "0002", "0002"] then this looks like the following: | |
| 0 0 0 0 | |
| 1 0 0 0 |