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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| const char * | |
| getfield (char *line, int num) | |
| { | |
| const char *tok; | |
| for (tok = strtok (line, ",;\t"); | |
| tok && *tok; tok = strtok (NULL, ",\t;\n")) |
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
| #include <stdio.h> | |
| int main (int argc, char *argv[]){ | |
| char str[1024]; | |
| FILE *f; | |
| f =fopen(argv[1],"r"); | |
| if(f){ | |
| while (fscanf(f, "%s", str)!=EOF) | |
| printf("%s\n",str); |
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
| HeapTuple CreateTuple(Relation r, int x, double y) | |
| { | |
| int i; | |
| int yy = (int )y; | |
| int natts = RelationGetDescr(r)->natts; | |
| Datum* values = (Datum *) palloc(natts * sizeof(Datum)); | |
| bool* isnull = (bool *) palloc(natts * sizeof(bool)); | |
| values[0]=x; |
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
| import java.awt.Color; | |
| import java.awt.Dimension; | |
| import java.awt.GridLayout; | |
| import java.awt.Window; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.MouseAdapter; | |
| import java.awt.event.MouseEvent; | |
| import java.io.BufferedReader; | |
| import java.io.File; |
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
| import java.awt.Color; | |
| import java.awt.Dimension; | |
| import java.awt.GridLayout; | |
| import java.awt.Window; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.KeyEvent; | |
| import java.awt.event.MouseAdapter; | |
| import java.awt.event.MouseEvent; | |
| import java.io.BufferedReader; | |
| import java.io.File; |
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
| # coding=UTF-8 | |
| from __future__ import division | |
| import re | |
| # This is a naive text summarization algorithm | |
| # Created by Shlomi Babluki | |
| # April, 2013 | |
| class SummaryTool(object): |
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
| from itertools import combinations | |
| from nltk.tokenize import sent_tokenize, RegexpTokenizer | |
| from nltk.stem.snowball import RussianStemmer | |
| import networkx as nx | |
| def similarity(s1, s2): | |
| if not len(s1) or not len(s2): | |
| return 0.0 | |
| return len(s1.intersection(s2))/(1.0 * (len(s1) + len(s2))) |
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
| package eg.edu.alexu.ehr; | |
| public class Range { | |
| int min; | |
| int max; | |
| public Range(int min, int max) { | |
| this.min = Math.min(min, max); | |
| this.max = Math.max(min, max); |
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
| import java.io.File; | |
| import java.io.FileWriter; | |
| import java.io.IOException; | |
| import java.io.Writer; | |
| import org.coode.owlapi.owlxml.renderer.OWLXMLRenderer;//works | |
| import org.coode.owlapi.rdf.rdfxml.RDFXMLRenderer; | |
| import org.semanticweb.owlapi.apibinding.OWLManager; | |
| import org.semanticweb.owlapi.io.OWLObjectRenderer; | |
| import org.semanticweb.owlapi.model.OWLObject; |
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
| rm(list=ls()) | |
| removeXQuantile<-function(data, x){ | |
| tmp<-sort(abs(data$b)); | |
| v<-tmp[x*length(tmp)/100]; | |
| data$b[abs(data$b)<=v]=0; | |
| data<-data[data$b!=0,]; | |
| return(data); | |
| } |