Skip to content

Instantly share code, notes, and snippets.

View msjyoo's full-sized avatar

Michael Yoo msjyoo

View GitHub Profile
<?php
/**
* Mimics the behaviour of javascript's charCodeAt.
*
* @param string $x
* @param int $index
*
* @return int
*/

Hello all. We must choose an extraction library for our new Goliath system to provide default values when no rules have been set. The choice has been narrowed down to Boilerpipe and Goose. They both have sub-par documenation (Boilerpipe, Goose), so I've dug around in the code to find the exact process by which they pull out data. Here I will compare them so we can choose one.

#Boilerpipe

This bad mamba jamba was developed by a Ph.D-having guy who, along with some other folks, wrote a big fat academic paper around the algorithm it uses, which you can find in our Dropbox if you really want to read it. Basically, they use link density, text density, and number of words on a block-by-block basis to distinguish boilerplate blocks from content blocks. A block is simply a contiguous piece of text terminated by the start

@msjyoo
msjyoo / sql-constraints-vs-indexes.md
Last active August 26, 2016 07:06
SQL Constraints vs Indexes
title date headline taxonomy
SQL Constraints vs Indexes
26-08-2016
Confusion for a newbie SQL learner.
category tag
blog
programming
sql

For a while I've been wondering what the diffrences were between SQL constraints and indexes.

Move to char
f - move ON next char
t - move BEFORE next char
CAPS - move backwards
Macros
q <macro a..z> - Start Recording
q - Stop recording
@ a - Use macro
<num> @ a - Use macro for next <num> lines
How to completely reset XCOM
Delete feral_interactive
Delete workshop/<xcom2 steam id>
Verify integrity in steam to re-donwload workshop
Debian jessie with cinnamon, graphical environment variables should be set in .xsessionrc
<?php
class Test
{
protected $x = "success";
}
$a = new Test;
($_ = function () { echo $this->x."\n"; })->call($a); // Valid, but "Expected: semicolon"
  1. Run the Indexer
  2. The Indexer is a general fast-pass scanner that picks up low-hanging fruits like functions with PHPDoc or scalar expressions (addition of 2 numbers always return int etc.)
  3. The Indexer deals with the entire project
  4. And also the PHP stubs since that consists of PHPDoc only.
  5. Since most PHP code is documented with PHPDoc, this should pick up most things
  6. Then we get that data, and pass it onto the Interpreter
  7. The Interpreter only runs on a single file, and returns Lazy Types on unknown things that must be resolved later when we get more info
  8. But, since we have already indexed the codebase some information will be available e.g. return types from class functions etc.
  9. After that, we try to link all the results from the interpreter on individual files by linking them with each other.
  10. We have a complete graph!
Also make sure anti alias is set to subpixel
PHPStorm Debian / Ubuntu font weirdness issue troubleshoot
1. In the Font screen, change `Darcula System Font` to `Darcula` (!!!)
2. Rename the `jre` folder