} <GithubCodeContainer /> "semicolon": [ '-': ['|', '^', 'v'],// resources are updated in the background. catch (IOException e) { return; // The URL constructor is available in all browsers that support SW. 'No internet connection found. App is running in offline mode.' } if (key === 'x') { componentWillMount() { <hr /> if (game.activeFlames[0]) { "always" game.status === 'pending' && game.players.map(p => p.userId).indexOf(userId) > -1 && "triple-equals": true (contentType != null && contentType.indexOf('javascript') === -1) } * A node of a network/graph.
); this.props.updateCurrentPlayerPosition(game.id, [currentPlayer.position[0]- 1, currentPlayer.position[1]], '^'); import java.io.*; } ReactGA.set({ anonymizeIp: true }); game.players.map(p => p.userId).indexOf(userId) === -1 && }# First evarrr websiteimport { CookiesProvider } from 'react-cookie'; if (key === 'z') { for (int i = 0; i < stringParts.length; ++i) { public boolean equals(Object obj) {
// Otherwise, (attempt to) process the characterimport './GameDetails.css'; authenticated: state.currentUser !== null, int startIndex = s.length(); joinGame = () => this.props.joinGame(this.props.game.id);const mapStateToProps = (state, props) => ({ *
} } }
"no-string-throw": true, public boolean isOctal(String str) { console.log( }); numberStack.operation(s); } this.props.placeBomb(game.id, currentPlayer.position, currentPlayer.id); } double d = Double.parseDouble(str); } "no-unused-expression": true, return false;
// Service worker found. Proceed as normal. getGames, getUsers, startGame, joinGame, updateGame, updateCurrentPlayerPosition, placeBomb, fireFlame .catch(error => { );}; true, else if ((kv[0] === '>' || kv[0] === '<') && explosionRef2[kv[0]].includes(initialCell)) formattedBoard[ex[0]][ex[1]] = '+'; game.activeBombs.forEach(bomb => formattedBoard[bomb.position[0]][bomb.position[1]] = '💣');const toUserId = require('../../jwt').userId; } String command = reader.readLine(); // service worker/PWA documentation. // Close on an End-of-file (EOF) (Ctrl-D on the terminal) <Redirect to="/login" /> IntegerStack numberStack = new IntegerStack(); 'v': ['>', '<'] } console.log( else if (isNumeric(s)) { /// return true; formattedBoard: formatBoard(state.games ? state.games[props.match.params.id] : null), window.addEventListener('load', () => { return; <div id="main"> }); } winner && return;/**
<p>Status: {game.status}</p> String stringParts[] = s.split("((?<=\\D)|(?=\\D))"); // Split method by NawaMan https://stackoverflow.com/questions/2206378/how-to-split-a-string-but-also-keep-the-delimiters }
'tabs for this page are closed. See http://bit.ly/CRA-PWA.' if (id == null) {
render() { return formattedBoard; else if (s.length() > 1) { config.onUpdate(registration); } return false;
// It's the perfect time to display a this.props.updateCurrentPlayerPosition(game.id, [currentPlayer.position[0] + 1, currentPlayer.position[1]], 'v'); return false; game.status === 'pending' && <ul><h2> Current players: </h2> {game.players.map(player => <li key={player.userId}>{ Object.values(users).find(user => user.id === player.userId).email}</li>)} </ul> numberStack.printStack(); startIndex = s.indexOf('9'); } ], this.id = id;
kv[1].forEach(ex => { '^': ['|', 'v'], if ((kv[0] === '-' && explosionRef['-'].includes(initialCell)) || (kv[0] === '|' && explosionRef['|'].includes(initialCell))) {// opt-in, read http://bit.ly/CRA-PWA } processCommand(stringParts[i]); System.err.println(e.getMessage()); 'This web app is being served cache-first by a service ' + </div> // 127.0.0.1/8 is considered localhost for IPv4.const isLocalhost = Boolean( checkValidServiceWorker(swUrl, config);import React, { Component } from 'react'; * @see {@link Graph.java}
.then(registration => { } </div>I did remove most of the social media links for privacy reasons. * @author vogella: released under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany
else if (s.equals("=")) {// it offline capabilities. However, it also means that developers (and users) } '<': ['-', '>'],public class SRPN { import {connect} from 'react-redux'; else { } }function registerValidSW(swUrl, config) { 'v': ['|', '^'] ); window.location.hostname.match(class GameDetails extends PureComponent {export default connect(mapStateToProps, mapDispatchToProps)(GameDetails); game.players.find(player => player.userId === toUserId(this.props.currentUser.jwt)).symbol === 'x' &&For the Codaisseur Code Academy, we were asked to make a web page introducing ourselves. This is what I came up with. if (navigator.serviceWorker.controller) { numberStack.peekPrint(); System.exit(1); else if (s.equals("+") || s.equals("-") || s.equals("*") || s.equals("/") || s.equals("%") || s.equals("^")) { return (<Paper className="outer-paper"> // Exit code 0 for a graceful exit '^': ['>', '<'], if (obj == null)
// Check which type of character(/number) is inputted and process it accordingly }
import ReactGA from 'react-ga'; if (command == null) { <Board board={formattedBoard} arrowMove={this.arrowMove} currentuserid={userId} game={game} dead={currentPlayer ? currentPlayer.dead : null} finished={game.status === 'finished'}/>import {getUsers} from '../../actions/users'; } <div className="App"> this.name = name;
</Provider>} } } if (key === 'down') { public void complexCommand(String s) { } navigator.serviceWorker <button onClick={this.startGame}>Start Game</button> if (s.contains("8") || s.contains("9")) { return true;
startGame = () => this.props.startGame(this.props.game.id); } } public static void main(String[] args) { <h1>Winner: {users[winner].firstName}</h1> "no-duplicate-variable": true, window.location.hostname === '[::1]' || } */
const explosionRef2 = { // existing tabs open on the page have been closed, since previously cached "rules": { } } if (isOctal(s.replace("-", "")) && s.charAt(0) == '-') { navigator.serviceWorker.ready.then(registration => { }); } console.error('Error during service worker registration:', error); // Split a command consisting of multiple commands into its parts and run all of those through processCommand() again individually "defaultSeverity": "warning" } }); // from what our page is served on. This might happen if a CDN is used to final private String id;
return true; else if ((kv[0] === '^' || kv[0] === 'v') && explosionRef[kv[0]].includes(initialCell)) formattedBoard[ex[0]][ex[1]] = '|'; else if (s.equals("r")) { const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; return false;
if (getClass() != obj.getClass())
// Execute callback config.onSuccess(registration); // content until all client tabs are closed. <LandscapeContainer /> /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ navigator.serviceWorker.ready.then(() => { }) }); { return ( window.location.reload(); game.activeFlames.forEach(flame => formattedBoard[flame.position[0]][flame.position[1]] = '@'); SRPN sprn = new SRPN(); else {} if (s.charAt(0) == '-') { Object.entries(explosion.position).forEach(kv => { public int hashCode() {
} // Keep on accepting input from the command-line // Is not localhost. Just register service worker if (isLocalhost) {function formatBoard(game) { if (endIndex == 1) {} catch(NumberFormatException nfe) { }); // "Content is cached for offline use." message. complexCommand(s); currentPlayer: state.games && state.currentUser && state.games[props.match.params.id].status !== 'pending' && state.games[props.match.params.id].players.find(player => player.userId === toUserId(state.currentUser.jwt)), currentUser: state.currentUser if (key === 'left') {}; public String getId() {
userId: state.currentUser && toUserId(state.currentUser.jwt), <h1>Game #{game.id}</h1>}); numberStack.push(parseDecimalToOctal(s)); }import {Provider} from 'react-redux'; { installingWorker.onstatechange = () => {
arrowMove = (key) => { let formattedBoard = game.board; '|': ['-', '>', '<'],class App extends Component { } else { '<': ['^', 'v'], const contentType = response.headers.get('content-type'); else if ((kv[0] === '^' || kv[0] === 'v') && explosionRef2[kv[0]].includes(initialCell)) formattedBoard[ex[0]][ex[1]] = '+'; if (key === 'right') { * @see {@link Edge.java}
// This is running on localhost. Let's check if a service worker still exists or not. render() { final private String name;
} const installingWorker = registration.installing; </CookiesProvider> if (installingWorker.state === 'installed') { int total = 0;// register() is not called by default. .register(swUrl)function checkValidServiceWorker(swUrl, config) {import {Redirect} from 'react-router-dom'; <button onClick={this.joinGame}>Join Game</button> // Check if the service worker can be found. If it can't reload the page. if ( endIndex = 1; if (config && config.onUpdate) { * https://github.com/vogellacompany/codeexamples-java/blob/master/de.vogella.algorithms.dijkstra/src/de/vogella/algorithms/dijkstra/model/Vertex.java
numberStack.push(parseDecimalToOctal(s)); const {currentPlayer, game} = this.props; .then(response => {
@Override
// but the previous service worker will still serve the older int endIndex = 0; // At this point, everything has been precached. }); ); console.log( } public Vertex(String id, String name) {
Though I wanted to make it spiffy and responsive, but then the whole thing started to die slowly as some small glitchings caused the whole page to look like crap ¯\\\_(ツ)\_/¯ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));export function register(config) { } formattedBoard[ex[0]][ex[1]] = '+'; ); '>': ['-', '<'], ) {public class Vertex { ////from http://www.vogella.com/tutorials/JavaAlgorithmsDijkstra/article.html#copyright-and-license
if (game === null) return null; componentDidMount() { try { registration.unregister(); }export function unregister() { if (s.isEmpty()) {import {getGames, joinGame, startGame, updateGame, placeBomb, fireFlame, updateCurrentPlayerPosition} from '../../actions/games'; } "curly": false,} if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { this.props.updateCurrentPlayerPosition(game.id, [currentPlayer.position[0], currentPlayer.position[1] + 1 ], '>'); } public String getName() {
// Used for telling which Strings to Parse to a number return id;
import './App.scss'; numberStack.pushRandom(); } // will only see deployed updates on subsequent visits to a page, after all the } registerValidSW(swUrl, config); return name;
I went with a *certain* aesthetic. Hahah. Not too unsatisfied with how it came out. // This lets the app load faster on subsequent visits in production, and givesimport React, {PureComponent} from 'react';// To learn more about the benefits of this model and instructions on how to for (int i = startIndex; i > endIndex; --i) { if (other.id != null)
else if ((kv[0] === '>' || kv[0] === '<') && explosionRef[kv[0]].includes(initialCell)) formattedBoard[ex[0]][ex[1]] = '-'; }; if (installingWorker == null) { } total *= -1; if ('serviceWorker' in navigator) { // serve assets; see https://github.com/facebook/create-react-app/issues/2374 }import store from './store'; return total; } if (publicUrl.origin !== window.location.origin) { while (true) { { } const winner = game.players); } if (game.activeExplosions[0]) { </Paper>) 'New content is available and will be used when all ' + if (!game) return 'Not found'; result = prime * result + ((id == null) ? 0 : id.hashCode());
const initialCell = formattedBoard[ex[0]][ex[1]] } else if (!id.equals(other.id))
}const explosionRef = { System.out.println("Unrecognised operator or operand \"" + s + "\"."); else if (s.equals("d")) { <CookiesProvider> if (key === 'up') { fetch(swUrl)import GithubCodeContainer from './components/GithubCodeContainer'; Vertex other = (Vertex) obj;
} game.players.forEach(player => {if(!player.dead) formattedBoard[player.position[0]][player.position[1]] = player.symbol + player.facing}); }
} else { final int prime = 31;
System.exit(0); * @release 30/08/2010
.filter(p => p.symbol === game.winner) registerValidSW(swUrl, config); return false;
}, // Execute callback // At this point, the updated precached content has been fetched,[Click here to see it in action](https://modest-ritchie-26c33d.netlify.com) // Our service worker won't work if PUBLIC_URL is on a different origin registration.onupdatefound = () => { } game.activeExplosions.forEach(explosion => { }import Board from './Board'; } } }; ReactGA.pageview(window.location.pathname);// This optional code is used to register a service worker. if (this.props.users === null) this.props.getUsers(); total += (double) (s.charAt(i - 1) - '0') * Math.pow(8, (startIndex - i)); } // Add some additional logging to localhost, pointing developers to the else formattedBoard[ex[0]][ex[1]] = kv[0]; } {/* /// Could do the showAboutOptions thing via redux */}const mapDispatchToProps = { } .map(p => p.userId)[0]; public boolean isNumeric(String str) { // Based on CraigTP's method https://stackoverflow.com/questions/1102891/how-to-check-if-a-string-is-numeric-in-java users: state.users, else if (initialCell === '+') formattedBoard[ex[0]][ex[1]] = '+'; public void processCommand(String s) { '>': ['^', 'v'], return false; { <Navbar showAboutOptions={false} /> ReactGA.initialize('UA-133506146-1', { anonymizeIp: true }); return name;
import Navbar from './components/Navbar'; game.status === 'pending' && console.log('Content is cached for offline use.'); if (!(currentPlayer.activeBombs >= currentPlayer.stats.bombs)) {
numberStack.push(Double.parseDouble(s)); }
response.status === 404 || } if (this.props.game === null) this.props.getGames();import LandscapeContainer from './components/LandscapeContainer'; <Provider store={store}> registration.unregister().then(() => { } }); * @see {@link DijkstraOperations.java}
} // [::1] is the IPv6 localhost address. // Ensure service worker exists, and that we really are getting a JS file. } } <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> return result;
@Override
} }); s = s.split("#")[0].trim(); }); .catch(() => { if (this.props.authenticated) { game.status !== 'pending' && <div> <h3> Players alive: {game.players.filter(player => player.dead === false).length} </h3>{ if (game === null || users === null) return 'Loading...'; int result = 1;
"class-name": true,
}) } } }/* SRPN RECODE */ @Override
</div> this.props.fireFlame(game.id, currentPlayer.position, this.props.currentPlayer.facing); { * @see {@link DijkstraAlgorithm.java}
else if (isOctal(s)) { return true;
startIndex = s.indexOf('8'); if (config && config.onSuccess) { ) } else { game: state.games && state.games[props.match.params.id],} window.location.hostname === 'localhost' || // No service worker found. Probably a different app. Reload the page.export default App;} if (this == obj)
'worker. To learn more, visit http://bit.ly/CRA-PWA' sprn.processCommand(command); const {game, formattedBoard, users, authenticated, userId, currentPlayer} = this.props; public double parseDecimalToOctal (String s) { if (str.charAt(0) == '0') { navigator.serviceWorker.ready.then(registration => { } if (((s.indexOf('9') < s.indexOf('8')) && s.indexOf('9') != -1) || (s.indexOf('8') == -1)) { const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);} this.props.updateCurrentPlayerPosition(game.id, [currentPlayer.position[0], currentPlayer.position[1] - 1 ], '<'); }
public String toString() {
try { if (!authenticated) return (import Paper from 'material-ui/Paper'; if (game.activeBombs[0]) {}


ABOUT




















osu! db manipulator