Skip to content

Instantly share code, notes, and snippets.

View ilyarudyak's full-sized avatar
💻
Data Science Retreat

ilyarudyak

💻
Data Science Retreat
View GitHub Profile
package com.ilyarudyak.android.portfel.ui;
import android.app.Fragment;
import android.app.LoaderManager;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
@ilyarudyak
ilyarudyak / gist:4f6ada945e6b6b750492627ead926ee7
Last active June 23, 2016 20:56
run java file with command-line arguments using Gradle
./gradlew -PmainClass=liang.IdentifyHostNameIP -'Pmyargs=www.whitehouse.gov,130.254.204.34' execute --daemon
// in gradle.build
task execute(type:JavaExec) {
if(project.hasProperty('myargs')){
args(myargs.split(','))
}
main = mainClass
classpath = sourceSets.main.runtimeClasspath
}
(1) integers, identifiers and special notations*
-------------------------------------------------
#define INT_CONST 276
#define LET_STMT 285
#define TYPEID 278
#define OBJECTID 279
#define ISVOID 274
Symbol tables and attributes
-----------------------------
lexical structure symbol table attribute
- integers inttable cool_yylval.symbol
- identifiers idtable cool_yylval.symbol
- special notation n/a n/a
- strings stringtable cool_yylval.symbol
- comments n/a n/a
- extern YYSTYPE cool_yylval. Its type is defined in the same file cool-parse.h. This is our global union where
we store attributes. We use cool_yylval.symbol for numbers, identifiers and strings, cool_yylval.boolean for booleans.
Defined in lextext.cc (contains the main function which will call your lexer and print out the tokens that it returns).
- extern int curr_lineno. "Your scanner should maintain the variable curr lineno that indicates which line in
the source text is currently being scanned. This feature will aid the parser in printing useful error messages."
(see 4.4 of PA1.pdf). Defined in lextext.cc.
You should advanced it when deal with \n - in comments, strings and catch all section:
import csv
from Datum import Datum
class Scorer(object):
@staticmethod
def score(data):
trueEntities = set()
guessEntities = set()
@ilyarudyak
ilyarudyak / data_processing.ipynb
Created May 21, 2019 11:27
Description of data processing for cs224n assignment2 word2vec 2019.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ilyarudyak
ilyarudyak / naive_bayes_example.ipynb
Created May 27, 2019 15:08
Naive Bayes example based on Coursera NLP course (and Information Extraction book).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.