Skip to content

Instantly share code, notes, and snippets.

Quake3 Reports

Introduction

First of all, we need to make some assumptions about the whole scenario. Considering that Quake3 is a popular game that serves hundreds or maybe thousands of users, we can assume that a log file can reach Giga or Tera size. Create a CLI tool based on a simple personal computer to solve this problem may lead to an unstable solution. In order to solve this issue I decided that our log file will be present on a Hadoop Distributed File System (HDFS) instance, i.e. a cluster of computers which main function is store big amounts of data in a scalable and stable way. However, we need to manage our log data in order to solve the essay requirements.

Despite the fact Apache Hadoop MapReduce have been historically chosen as a Big Data processor, a few other apache distributions seems to outperform the latter one. A famous choice would be Apache Spark, which process data 10x faster on disk and 100x faster on memory compared to MapReduce. Bear in mind that we’ll handle HDFS to store our

@NilsonLima
NilsonLima / customeditor.js
Created June 10, 2019 22:01
basic configuration for a draft-js editor component
import React from "react";
import { Editor, EditorState } from "draft-js";
export default class CustomEditor extends React.Component {
state = { editorState: EditorState.createEmpty() };
onChangeEditor = editorState => this.setState({ editorState });
render() {
const { editorState } = this.state;
// @flow
import * as React from "react";
import { Editor, EditorState } from "draft-js";
type Props = {
onChangeText?: (text: string) => void
};
type State = {
editorState: EditorState
// @flow
import * as React from "react";
import { Editor, EditorState } from "draft-js";
type Props = {
onChangeText?: (text: string) => void,
onSubmit?: void => void
};
type State = {
handleReturn = (event: SyntheticKeyboardEvent<*>) => {
const { onSubmit } = this.props;
if (event.shiftKey) return "not-handled";
if (onSubmit) onSubmit();
return "handled";
};
clear = () => {
const { editorState: oldEditorState } = this.state;
// @flow
import * as React from "react";
import Editor from "./components/editor";
// svg icons
import Microphone from "./microphone.svg";
import Smiley from "./smiley.svg";
import Send from "./send.svg";
// css module
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #e2e2e2;
}
.footer {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@NilsonLima
NilsonLima / machine.js
Last active April 5, 2020 13:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
require "test_helper"
class Smartphone::Contract::ChangeTest < ActiveSupport::TestCase
setup do
@smartphone_contract = smartphone_contracts(:base_contract)
@params = { id: @smartphone_contract[:id], ... }
end
subject { Smartphone::Contract::Change }