id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
4062adea-daff-4787-9fbe-801d7335c303 | public void mouseMoved(MouseEvent e) {} |
28f43c9f-c77e-421d-899c-d90d03f2a1d6 | public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {} |
091c201d-fa3e-42a2-be0c-b13798c7abae | public Raypath(Point A, Point B, Point C) {
this.A = A;
this.B = B;
this.C = C;
} |
a414963b-8584-442a-b557-c2722ec71fc4 | public void setA(Point A) {
this.A = A;
} |
1b95e68d-dde3-49fe-ad57-56d847c207e4 | public void setB(Point B) {
this.B = B;
} |
8e87a89a-29c6-4a1d-a0bb-a2aa4b69059a | public void setC(Point C) {
this.C = C;
} |
ba3e3937-c0b8-4f0f-a5f9-c8e9ec3029ce | public Point getA() {
return A;
} |
f9d34926-f8c9-4d8c-8f0c-65af4e03a62f | public Point getB() {
return B;
} |
3cf742b9-b3dc-4261-8a8c-743ba53483bc | public Point getC() {
return C;
} |
9a44a821-ea94-4ae2-a383-d8c007289de0 | public Point getReceiver() {
return Receiver;
} |
db4a2dd5-c79e-491d-b985-4f43abe8ffb4 | public Point getSource() {
return Source;
} |
fc48d429-f888-48d7-beeb-3f33aabf27b8 | public FresnelVolume (MatriksKecepatan _MK) {
// TO DO : bikin MK, Source, Receiver supaya jadi array
MK = _MK;
FMK = new MatriksKecepatan[10];
for (int i=0; i<FMK.length; i++) {
// FMK[i] = new MatriksKecepatan(96,96);
FMK[i] = _MK;
}
// FMK[0] = _M... |
ae556cd7-16b9-4547-adb9-1b03a3c1765e | private void makeEllipse (int iFMK, Point p1, Point p2) {
Source = new Point(p1);
Receiver = new Point(p2);
// int r = MK.getP()/2;
// double sdt = Math.toRadians(90.0);
// int dx = (int)((float)r*Math.cos(sdt));
// int dy = (int)((float)r*Math.sin(sdt));
/... |
e290c321-32a5-4820-8043-501d69a95a1b | private float hitungArrayTCal (float SP, float RP) {
return SP + RP;
} |
fd94338c-b8b9-469f-8dc2-eb782e28f9e3 | private float hitungDeltaT (float TCal, float tobs) {
return Math.abs(tobs - TCal);
} |
9eeb8687-4e6c-49e1-8363-3de6e675ebfe | private float hitungBobotij (float deltaT) {
if (deltaT >= (f/2))
return 0;
else
return 1-2*f*deltaT;
} |
38a4206f-c777-46c5-b867-51326413fd2b | private boolean isDalamEllips (int i, int j, Point P, Point Q) {
Point pusat = new Point(Math.abs(P.y+Q.y)/2, Math.abs(P.x+Q.x)/2);
float tinggiEllips = 40f;
float PQ = distance(P,Q);
float a = PQ/2;
float b = tinggiEllips/2;
float sina = (Q.y-P.y) / PQ;
float cos... |
082bbc10-19ae-461c-8d95-698e920754a2 | private float distance(Point P, Point Q) {
return (float)Math.sqrt((P.x-Q.x)*(P.x-Q.x) + (P.y-Q.y)*(P.y-Q.y));
} |
e53698c0-8e85-4433-a28e-8443da3a978b | private boolean IsIntersecting(Point a, Point b, Point c, Point d) {
float denominator = ((b.x - a.x) * (d.y - c.y)) - ((b.y - a.y) * (d.x - c.x));
float numerator1 = ((a.y - c.y) * (d.x - c.x)) - ((a.x - c.x) * (d.y - c.y));
float numerator2 = ((a.y - c.y) * (b.x - a.x)) - ((a.x - c.x)... |
a16a9c64-6ff2-4e0d-b659-0a41b516e140 | private boolean IsKotakIntersect(Point O, Point O2, Point Persegi) {
Point P = new Point(Persegi.x,Persegi.y);
Point P2 = new Point(Persegi.x,Persegi.y+1);
Point P3 = new Point(Persegi.x+1,Persegi.y);
Point P4 = new Point(Persegi.x+1,Persegi.y+1);
return (IsIntersecting... |
f7a2a34e-6a9d-4966-8906-0b6bda05a8c2 | public void hitungLSR(){
// lSR = 1/velo;
} |
4180b6d4-d776-4d79-94e6-184613a9a0b8 | public void hitungDeltaSi(){
// bobotRata[]
//
// for int(i=1;i<MK.getL()*MK.getP();i++){
// deltaSi[i]= (1/jmlRayPerSel[i-1]) + jmlRayPerSel[i-1] * (deltaT[i-1]/arrayTCal) * (bobotRata[i-1]/bobotij[i-1]);
// }//end for
} |
6d83414c-a974-40a2-91cc-03fc1d4336c0 | public void hitungBobotRata(){
} |
799221ca-6535-49d8-a76a-85d10581c4f3 | public void hitungRataMK () {
RataMK = new MatriksKecepatan(FMK[0]);
for (int i=0;i<MK.getP();i++){
for(int j=0;j<MK.getL();j++){
float total = 0f;
for (int k=0; k<FMK.length; k++) {
total += Float.valueOf(... |
317b4e34-62d3-419c-962e-ad68e84cfd21 | public Penggambar () {
MatriksKecepatan MK = new MatriksKecepatan();
O = new Point(0,0);
} |
3f4de5fe-f2ef-4034-bc39-36467add9290 | public Penggambar (MatriksKecepatan _mk) {
MK = new MatriksKecepatan();
MK = _mk;
MK.setMaxMinVal();
O = new Point(0,0);
} |
9c3e9e3c-0636-4bb1-9bb6-92938838b186 | public void seto (int x, int y) {O.setLocation(x, y);} |
2e2029ab-fe9a-4257-9970-109eb6a73a62 | public int getox () {return (int)O.getX();} |
1ed45826-82c8-4f76-b53f-4b77fe653a79 | public int getoy () {return (int)O.getY();} |
acce9b7f-8c0a-4d63-9adf-99aa6997131f | public void gesero (int x, int y) {O.setLocation(x+getox(), y+getoy());} |
504f1176-2642-4161-9a08-71058c737b5e | public int getnx() {
return MK.getP();
} |
cc0990d3-c7c0-4782-afa8-cfda8d478fa7 | public int getny() {
return MK.getL();
} |
514ced3f-d286-409a-9e53-daa1e06d6795 | public void gambar_garis(GL gl, Point P, Point Q, Color C) {
gl.glBegin (GL.GL_LINES);
gl.glColor3f(C.getRed(), C.getGreen(), C.getBlue());
gl.glVertex3f( (float)P.getX(), (float)P.getY(), 0);
gl.glVertex3f( (float)Q.getX(), (float)Q.getY(), 0);
gl.glEnd();
} |
83e55ff8-b30a-46af-8225-8891d2ea519a | private void gambar_kotakborder(GL gl, Point P, Color C, int lebarkotak) {
gl.glBegin (GL.GL_LINES);
Point Q = new Point(P); // kanan bawah
Point R = new Point(P); // kanan atas
Point S = new Point(P); // kiri atas
Q.translate(0, lebarkotak);
R.transla... |
a97c731d-636e-422c-9866-b537ac92ff69 | private void gambar_kotakwarna(GL gl, Point P) {
gl.glBegin(GL.GL_QUADS);
Point Q = new Point(P); // kanan bawah
Point R = new Point(P); // kanan atas
Point S = new Point(P); // kiri atas
Q.translate(0, 1);
R.translate(1, 1);
S.translate(1... |
98609608-1910-4b2e-9793-3ec1d210a91f | private void gambar_kotakrandom(GL gl, Point P) {
gl.glBegin(GL.GL_QUADS);
Point Q = new Point(P); // kanan bawah
Point R = new Point(P); // kanan atas
Point S = new Point(P); // kiri atas
Q.translate(0, 1);
R.translate(1, 1);
S.translate(... |
f8c6c7a8-4257-4b0f-9ddd-5b13c72e1cdd | private void gambar_kotak(GL gl, Point P, float val) {
float pv = ((float)val-(float)MK.getminv()+1f)/((float)MK.getmaxv()-(float)MK.getminv()+1f);
Color c = new Color ((int)((float)pv*(float)255));
// cr = c.getRed()/(float)255;
// cg = c.getGreen()/(float)255;
// cb = c.getBlue... |
e6d22d25-3f24-4cc4-bcfc-3ab8b2798701 | public void gambar_mk_kotakwarna(GL gl) {
for (int i= getox(); i<MK.getP()+getox(); i++) {
for (int j= getoy(); j<MK.getL()+getoy(); j++) {
Point T = new Point(i,j);
gambar_kotak(gl, T, MK.getFloatData(j-getoy(),i-getox()));
}
}
} |
2650334e-38d5-4b95-980b-a681f178ae7d | public void gambar_mk_border(GL gl, int lebarkotak) {
Color CBorder = new Color((float)0, (float)0, (float)0);
for (int i= getox(); i<(MK.getP()+getox())/lebarkotak; i++) {
for (int j= getoy(); j<(MK.getL()+getoy())/lebarkotak; j++) {
Point T = new Point(i*lebarkotak, j*l... |
a8d62ff9-7f11-48d2-88d3-dabee2ab7c44 | public void gambar_mk_kotakrandom(GL gl) {
Color CBorder = new Color((float)0, (float)0, (float)0);
for (int i= getox(); i<MK.getP()+getox(); i++) {
for (int j= getoy(); j<MK.getL()+getoy(); j++) {
Point T = new Point(i,j);
gambar_kotakrandom(gl, T);
... |
aaca1cef-365a-49be-8eb6-21eacb802673 | public void gambar_axor(GL gl, GLUT glut, Camera K) {
Point P = new Point(0,150);
Point Q = new Point(150,0);
Point R = new Point(0,-30);
Point S = new Point(-30,0);
Color CBorder = new Color((float)0, (float)0, (float)0);
gambar_garis(gl,P,R,CBorder);
gambar_gari... |
96cc3ec2-1ac8-4117-b3d9-761ba4e85dd9 | public void gambarTeks( GL gl, GLUT glut, String teks, Color C, Point P) {
gl.glColor3f(C.getRed(), C.getGreen(), C.getBlue());
gl.glRasterPos3d(P.getX(), P.getY(), 0);
glut.glutBitmapString(glut.BITMAP_HELVETICA_12, teks );
} |
783bf46e-7e4b-4af2-9bf1-6a51bcedc6f3 | public void test_pelangi () {
for (int i=0;i<MK.getP();i++){
for(int j=0;j<MK.getL();j++){
MK.data[i][j]=Integer.toString(i+j);
}
}
MK.setMaxMinVal();
} |
b30e33de-b3cc-4f1f-8db9-d63f387de12e | public void tes() {
FresnelVolume F = new FresnelVolume(MK);
OMK = F.MK;
MK = F.RataMK;
// garis = F.garis;
//Raypath(F.getReceiver(), new Point(40,40), F.getSource());
} |
438cce8b-2385-4be8-aa96-6316ce3d9c41 | public void gambar_ray(GL gl) {
for (int i=0; i<garis.size(); i++) {
Raypath temp = garis.get(i);
gambar_garis(gl,temp.getA(),temp.getB(), Color.BLACK);
gambar_garis(gl,temp.getB(),temp.getC(), Color.BLACK);
}
} |
7f69b97a-c132-45da-8632-29afda16bf1e | public void identify()
{
System.out.println("SB Daniel (RamaDSB Creada)");
} |
faed5c4b-f8f4-4373-8a22-5e34a3f96c31 | public void identify()
{
System.out.println("MA Alvaro");
} |
ace24519-8cc4-4178-9b9b-e9503e983101 | public void identify()
{
System.out.println("Empresa AMA2");
} |
43045467-2f80-4dbe-84a1-98adcf9fd922 | public static void main(String[] args) {
// AccessControl guardian = new AccessControl();
// if (guardian.hasAccess()) {
// Right workerAtRight = new Right();
// Left workerAtLeft = new Left();
Company company = new Company();
DSB dsb = new DSB();
AMA ama=new AMA();
System.out.pri... |
cccbe50f-56be-4bbe-a0cd-5d579d016fb9 | public static void main(String[] args) throws IOException {
if (args.length < 1) {
System.err.println("Usage: java " + TestMMSeg.class.getSimpleName() + " <input> [output]");
System.exit(1);
}
InputStream inputStream = new FileInputStream(args[0]);
OutputStream outputStream;
if (args.le... |
53851e20-6096-4cca-8c47-77db9be9fb65 | public MMSegData() throws IOException {
dictionary = new MMSegDictionary();
} |
40ac8d8d-492a-4add-9c83-429a8e7af670 | public List<Rule> getRules() {
return rules;
} |
76bfa162-d955-4156-8603-f3fe7abfd936 | public MMSegDictionary getDictionary() {
return dictionary;
} |
a72433f4-dcfd-41d0-86d9-10b0d8aa74cf | @Override
protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
StandardTokenizer t = new StandardTokenizer(Version.LUCENE_43, reader);
return new TokenStreamComponents(t, new LowerCaseFilter(Version.LUCENE_43, t));
} |
7c5c7fe5-6e00-4e25-ab98-39600619042d | public void reset(MMSegData mmSegData, Part part) {
rules = mmSegData.getRules();
dictionary = mmSegData.getDictionary();
this.part = part;
text = part.getText();
maxWordCache.clear();
tokens.clear();
currentIndex = 0;
seg();
} |
c02a1abe-f4cb-45d0-b747-6d355869cd38 | public boolean hasMoreTokens() {
return tokens != null && !tokens.isEmpty() && tokens.size() > currentIndex;
} |
9bb220f8-2e96-45eb-a09e-d22d372ace1c | public Token takeNextToken() {
if (hasMoreTokens()) {
return tokens.get(currentIndex++);
} else {
return null;
}
} |
d5a81d0f-ba2e-4e00-9aa5-8336304242a8 | private void seg() {
if (part.getType() == PartType.NON_CHINESE) {
try {
TokenStream tokenStream = analyzer.tokenStream(null, new CharArrayReader(text));
tokenStream.reset();
CharTermAttribute termAttribute = tokenStream.getAttribute(CharTermAttribute.class);
OffsetAttribute of... |
62101373-a5cf-463a-bf35-50b842a6ac4b | private String maxNWords(int start, int n) {
Node[] ends = new Node[n];
MaxNResult result = new MaxNResult(start, n);
maxNWordsRec(start, ends, 0, n, result);
return String.valueOf(text, start, result.ends[0].wordLength());
} |
48a6f48a-2d4b-4fd1-a586-a577e40939fa | private void maxNWordsRec(int start, Node[] ends, int i, int n, MaxNResult result) {
if (start == text.length) {
for (int j = i; j < n; j++) {
ends[j] = null;
}
setResult(start, ends, result);
} else if (i == n - 1) {
Node end = maxWord(start);
ends[i] = end;
setResul... |
f324fdf3-5fcc-42bd-97a4-2e61979fd45a | private Node maxWord(int start) {
Node result = maxWordCache.get(start);
if (result != null) {
return result;
}
Node node = dictionary.newNode(text[start]);
Node maxNode = node;
for (int i = start; node != null && i < text.length; i++) {
Node next = node.get(text[i]);
if (next ... |
151dd675-6f42-4bbb-b7e9-1c122b9dde99 | private void setResult(int start, Node[] ends, MaxNResult result) {
int chunkLength = totalLength(ends);
if (chunkLength > result.maxChunkLength
|| chunkLength == result.maxChunkLength && checkRules(start, ends, result.ends)) {
result.maxChunkLength = chunkLength;
System.arraycopy(ends, 0, r... |
8f6149b2-dd08-4071-9235-91c63c1baa35 | private int totalLength(Node[] ends) {
int length = 0;
for (Node end : ends) {
if (end == null) {
break;
}
length += end.wordLength();
}
return length;
} |
1b8e1f2b-b9d0-48b8-9f62-df6a30a65715 | private boolean checkRules(int start, Node[] ends1, Node[] ends2) {
if (rules != null) {
for (Rule rule : rules) {
int result = rule.compare(dictionary, text, start, ends1, ends2);
if (result < 0) {
return true;
} else if (result > 0) {
return false;
}
... |
27152977-343d-45e0-afbb-ce3874d48844 | public MaxNResult(int start, int n) {
ends = new Node[n];
} |
94ac1b27-97b9-43fb-97fe-3c06bb4439fe | public MMSeg() throws IOException {
this(new MMSegData());
} |
b4411604-67f5-448f-8d4b-f3254957e704 | public MMSeg(MMSegData mmSegData) {
this.mmSegData = mmSegData;
} |
ce438efe-8b45-49c4-8c50-00ba4aa91792 | public void reset(Reader reader) {
this.reader = new PushbackReader(reader);
} |
3234f78e-fa34-4d31-b812-8aff7f9ae91b | public Token next() throws IOException {
if (chunks == null || !chunks.hasMoreTokens()) {
Part part = nextPart();
if (part == null) {
return null;
}
chunks.reset(mmSegData, part);
}
return chunks.takeNextToken();
} |
523b0e71-4047-4d96-aec5-1f017fc11134 | public Part nextPart() throws IOException {
int nextChar = reader.read();
if (nextChar < 0) {
return null;
}
Part part = new Part(currentIndex);
do {
if (!part.append(nextChar)) {
reader.unread(nextChar);
break;
}
currentIndex++;
nextChar = reader.read()... |
9ab45039-3ebc-4bb7-9651-b5fc749e5cb0 | public MMSegDictionary() throws IOException {
this(new InputStreamReader(MMSegDictionary.class.getClassLoader().getResourceAsStream(DEFAULT_WORDS_FILE)),
new InputStreamReader(MMSegDictionary.class.getClassLoader().getResourceAsStream(WORD_FREQYENCY_FILE)),
true);
} |
0ec11350-d5d1-4889-8a24-0e99dd18eaf3 | private MMSegDictionary(Reader wordsReader, Reader wordFrequencyReader,
boolean close) throws IOException {
try {
loadDictionary(wordsReader);
loadDictionary(wordFrequencyReader);
} finally {
if (close) {
wordsReader.close();
wordFrequencyReader.close();
}
}
} |
97e896ea-5349-41a9-bb0b-f2e4035451b4 | public Node newNode(char ch) {
return tree.seek(ch, true);
} |
f721a684-b0de-4033-b105-89026d8955ad | public Node newNode(char[] word) {
return tree.seek(word, 0, -1, true);
} |
97d6d74a-9f16-4d3c-8224-38e0c17ec086 | public void loadDictionary(Reader reader) throws IOException {
BufferedReader bufferedReader = new BufferedReader(reader);
String line = bufferedReader.readLine();
while (line != null) {
int commentStart = line.indexOf(COMMENT_PREFIX);
if (commentStart >= 0) {
line = line.substring(0, co... |
0cf34cb1-f9cd-4965-a0cd-6ac306215d26 | public Node getTree() {
return tree;
} |
63dce873-a8c4-4be7-85d8-28c14fdc7708 | private Node(Node parent, char ch, int depth) {
this.parent = parent;
this.ch = ch;
this.depth = depth;
} |
a02393c6-55c1-4747-a80c-19d7f478f2b5 | public Node get(char ch) {
return children.get(ch);
} |
13870a7c-115f-4e5f-89e3-40c2d9b0dd71 | public Node parent() {
return parent;
} |
6d1ccd8c-0595-486a-af39-92e4c6cb57b6 | public char getChar() {
return ch;
} |
80366826-d77d-40b9-af42-91736b63a0e7 | public double weight() {
return weight;
} |
20714f84-1d20-44aa-abc6-8e05f596a63e | public long frequency() {
return frequency;
} |
ca9e912d-e194-40f9-a16e-94e5277249c2 | public boolean exists() {
return exists;
} |
909d0ee5-bd5e-4f5b-b19b-d4d67aee3a3e | public int wordLength() {
return exists ? depth : -1;
} |
a78a2e79-31af-492e-8d5c-d767f3442421 | public Node seek(char ch, boolean createNew) {
Node child = children.get(ch);
if (createNew) {
if (child == null) {
child = new Node(this, ch, depth + 1);
children.put(ch, child);
}
child.exists = true;
}
return child;
} |
bc43bbe8-a0ec-454c-b62f-858c9ae023a7 | public Node seek(char[] word, int start, int end, boolean createNew) {
if (end >= 0 && start == end || end < 0 && start == word.length) {
if (createNew) {
exists = true;
}
return this;
}
char ch = word[start];
Node child = children.get(ch);
if (child == nu... |
44eb8c3e-c2c6-474f-abc5-4f7b6544c12e | public String getWord() {
StringBuffer buffer = new StringBuffer(depth);
Node node = this;
while (node.parent != null) {
buffer.append(node.ch);
node = node.parent;
}
return buffer.reverse().toString();
} |
6c851609-2a29-42b9-8495-a40d5601dcab | @Override
public String toString() {
return getWord();
} |
59212d07-c239-407a-84c8-e9dc3d80e6d1 | @Override
public int compare(MMSegDictionary dictionary, char[] text, int start, Node[] ends1,
Node[] ends2) {
return Long.compare(getTotalFrequency(dictionary, ends2), getTotalFrequency(dictionary, ends1));
} |
fe371901-229a-43ea-aaee-75e5adc91b05 | private long getTotalFrequency(MMSegDictionary dictionary, Node[] ends) {
long totalFrequency = 0;
for (Node end : ends) {
if (end == null) {
break;
}
totalFrequency += end.frequency();
}
return totalFrequency;
} |
0447b4d6-b4b6-48a5-b870-5caf975f778f | public int compare(MMSegDictionary dictionary, char[] text, int start, Node[] ends1,
Node[] ends2); |
2c4b05cd-6a6a-41c8-969b-8144cce2e3d5 | @Override
public int compare(MMSegDictionary dictionary, char[] text, int start, Node[] ends1,
Node[] ends2) {
return Double.compare(variance(ends1), variance(ends2));
} |
99d0f5d3-70dd-447c-8489-1be307591ce5 | private double variance(Node[] ends) {
int words = 0;
int maxLength = 0;
for (; words < ends.length && ends[words] != null;
maxLength += ends[words].wordLength(), words++);
double avgLength = (double) maxLength / words;
double variance2 = 0.0;
for (Node end : ends) {
if (end == nul... |
5a415ef0-c7d3-4a7e-86dd-0e8d8c601a77 | @Override
public int compare(MMSegDictionary dictionary, char[] text, int start, Node[] ends1,
Node[] ends2) {
return Integer.compare(getWordCount(ends1), getWordCount(ends2));
} |
d0fd303b-6194-4e8e-96d4-60bad4564ed9 | private int getWordCount(Node[] ends) {
int size = ends.length;
while (size > 0 && ends[size - 1] == null) {
size--;
}
return size;
} |
5b18df5e-5f14-4865-89a2-9a917ebc51e4 | public static CharType getCharType(int ch) {
if (ch == '.') {
return DOT;
}
if (Character.isWhitespace(ch)) {
return WHITESPACE;
}
switch (Character.getType(ch)) {
case Character.UPPERCASE_LETTER:
case Character.LOWERCASE_LETTER:
case Character.TITLECASE_LETTER:
case Char... |
69255134-3b98-47bd-a03f-52661abce398 | public Token(String text, int start, int end) {
this.text = text;
this.start = start;
this.end = end;
} |
bedc3bfa-79ef-45a5-93d6-71ee273de5de | public String getText() {
return text;
} |
13866d70-e208-41e3-8141-8368d23b8e51 | public int getStart() {
return start;
} |
08a37521-9fe4-4d94-a977-5c997362ab98 | public int getEnd() {
return end;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.