id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
f5a94e33-b24f-41a3-a47b-72a9bacfd509 | public Network(Network old) {
this.numInputs = old.numInputs;
this.numOutputs = old.numOutputs;
this.numHiddenLayers = old.numHiddenLayers;
this.sizeHiddenLayers = old.sizeHiddenLayers;
this.bias = old.bias;
build();
} |
ea02921c-04e0-4325-99d0-0bc46ec079ee | public void build() {
if (numHiddenLayers > 0) {
layers = new Layer[2 + numHiddenLayers]; // 1 input + 1 output + number of inners hidden layers
layers[0] = new Layer(sizeHiddenLayers, numInputs, bias); // first input layer
for (int i = 1; i < numHiddenLayers + 1; i++) {
... |
e709b88d-5f5a-4fe7-98f7-78d11d4d287e | public int[] fire(int[] inputs) {
for (int i = 0; i < layers.length; i++) {
inputs = layers[i].input(inputs);
}
return inputs;
} |
ef4d99a0-47d3-4012-839e-223462a60137 | public void mutate(double chance) {
Random rand = new SecureRandom();
for (int i = 0; i < layers.length; i++) {
for (int n = 0; n < layers[i].getNeurons().length; n++) {
double[] weights = layers[i].getNeurons()[n].getWeights();
for (int w = 0; w < weights.len... |
eb73c875-6fc4-4375-a7b0-9bb167c0732f | public Network child(Network parent) {
Network child = new Network(this);
Layer[] childLayers = child.getLayers();
Layer[] parentLayers = parent.getLayers();
Random rand = new SecureRandom();
double percent = rand.nextDouble();
for (int i = 0; i < layers.length; i++) {
... |
bcfc9e11-bb86-4020-ba68-dd766ded7f61 | public int fitness(int[] inputs, int[] outputs) {
int[] result = fire(inputs);
int fitness = 0;
for (int i = 0; i < result.length; i++) {
if (result[i] == outputs[i]) {
fitness++;
}
}
return fitness;
} |
e20f0ed4-0161-46a0-bd0e-32115d7a63db | public Layer[] getLayers() {
return layers;
} |
7e64099e-708c-4682-9db9-496958222a6d | public ObjForm(Triangle[] polygon, Vector position, double rotation) {
polys = polygon;
pos = position;
rot = rotation;
len = polys.length;
} |
9165e0c6-957a-4f6a-84b6-c29bf0c34713 | public void SizeInc(double scale) {
for(int i = 0; i < len; i++) {
polys[i].IncVec(scale);
}
} |
c1e35d33-e386-4330-8c19-4a02fc421452 | public Camera(Vector position, Vector rotation) {
pos = position;
ypr = rotation;
imgplane = new Vector(-3.2,-2.4,0.50);
} |
d24f00d2-e9b4-4653-b142-c7a060137fc3 | public ObjectLib() {
} |
365bc787-665b-40ee-a0c3-ac40dc56cc5b | public ObjForm FlatSurf() {
Vector base = new Vector(0.0, 0.0, 0.0);
Triangle[] result = {new Triangle(base, base, base), new Triangle(base, base, base)};
//Surface Half 1
result[0].p1 = new Vector(0.0, 0.0, 0.0);
result[0].p2 = new Vector(1.0, 0.0, 0.0);
result[0].p3 = new Vector(0.0, 0.0, 1.0);
//Surfac... |
990e6e75-e8e1-41ff-9df7-b5a3c6e054fc | public ObjForm Box() {
Vector base = new Vector(0.0, 0.0, 0.0);
Triangle[] result = createTriarray();
for(int i = 0; i < 11; i++) {
//Point 1
//Triangle 1
result[0].p1 = new Vector(0.0, 0.0, 0.0);
result[0].p2 = new Vector(1.0, 0.0, 0.0);
result[0].p3 = new Vector(0.0, 0.0, 1.0);
//Triangle 2
result... |
39defe8b-06c0-41b3-8e88-f685bc3825d3 | public Triangle[] createTriarray() {
Vector base = new Vector(0.0, 0.0, 0.0);
Triangle[] result = {new Triangle(base, base, base),
new Triangle(base, base, base),
new Triangle(base, base, base),
new Triangle(base, base, base),
new Triangle(base, base, base),
new Triangle(base, base, base),
n... |
c0f6bcc0-8219-4e07-9e61-c0d253e2615b | public void objprint(ObjForm objtop) {
int lenobj = objtop.polys.length;
//Prints the number of triangles
System.out.println(lenobj);
//Prints out Each Triangles information
for(int i = 0; i < lenobj; i++) {
System.out.println("Triangle #" + i);
System.out.println("Vector 1");
System.out.println(objt... |
7148496c-644d-4bde-8575-5f8dcfb27245 | public Scene(ObjForm terrset) {
terrain = terrset;
inuse = new boolean[objindex];
objlist = new ObjForm[objindex];
} |
97a4a957-3398-4ca2-8c58-f42604af0f53 | public int addobj(ObjForm addto, Vector position) {
//Changes object's position than adds it to the object list and returns it's index
addto.pos = position;
objlist[findfree()] = addto;
return findfree();
} |
58a0153a-4def-405d-857a-1b80741949f3 | public void killobj(int index) {
inuse[index] = false;
} |
95a5c034-f024-44fd-a26c-28c42e37bd9c | public int findfree() {
int found;
for(int i = 0; i < objindex; i++) {
if(inuse[i]==false) {
found = i;
return found;
}
}
found = 0;
return found;
} |
27ccf141-35f1-4ac8-9803-c0bacfde9c44 | public Render() {
window = new JFrame("Testing Renders");
window.setSize(640,480);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setLayout(new GridLayout());
window.add(this);
window.setVisible(true);
backbuffer = createImage(640,480);
Flash = createImage(640,480);
backg = backbuffer.g... |
39cd57bd-032e-48b0-922d-7bf04d45d4de | public void appLoop(double mult) {
//Loads a flat surface as the base terrain
baseScene = new Scene(objLib.FlatSurf());
//Increases the terrains size by a multiple of 5
//Initializes an array of objects equal to the size the scene allows
actors = new int[baseScene.objindex];
//Adds a prebuilt box object fr... |
622fa7ae-9c54-4ad5-b7d5-702d6e5e64df | public void drawScene(Camera eyepers, int[] actors, double mult) {
//First Draw the terrain, it's the simplest pretty much
int terTricnt = baseScene.terrain.polys.length;
for(int i = 0; i < terTricnt; i++) {
int[] xpntarr = new int[3];
int[] ypntarr = new int[3];
Vector[] vecsplit = {baseScene.terrain... |
e6471019-435d-43e2-b394-8bc31577c1b3 | public void backrend(int[] p1, int[] p2, Color use) {
backg.setColor(use);
backg.drawLine(p1[0], p2[0], p1[1], p2[1]);
backg.drawLine(p1[0], p2[0], p1[2], p2[2]);
backg.drawLine(p1[1], p2[1], p1[2], p2[2]);
} |
e537d8ef-94da-49c2-b121-118f28abd396 | public int[] pixget(Camera eyespy, Vector input, double mult) {
int[] xny = new int[2];
double holder = 0.0;
//BEWARE OF MATH
double[] rxyz = eyespy.ypr.getlist();
//Jibbery Joo
//X sine cosine
double sinx = Math.cos(rxyz[0]);
double cosx = Math.cos(rxyz[0]);
//Y sine cosine
double siny = Math.co... |
2dfb8ddb-ad38-4760-88da-49bed163f067 | public void update(Graphics g) {
backg.drawImage(Flash, 0, 0, this);
g.drawImage(backbuffer, 0, 0, this);
} |
22cf829f-6ba5-4a6a-b9b9-7f02553f91c9 | public void paint(Graphics g) {
update(g);
} |
47323bb0-3818-467c-b985-45b7dfbbb88a | @Override
public void mouseDragged(MouseEvent e) {
// TODO Auto-generated method stub
e.consume();
} |
e45c69fe-5159-4450-88a6-348d28752922 | @Override
public void mouseMoved(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
bec973d9-8afb-40df-ae65-4f2b08383565 | @Override
public void mouseClicked(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
cbb43fef-bc47-4110-9990-9c34a51c6cd5 | @Override
public void mouseEntered(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
1a877bad-86fc-4f1a-ada5-e3bc74ce6914 | @Override
public void mouseExited(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
197a8e85-604d-40af-b840-cc6e7c7609e0 | @Override
public void mousePressed(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
ca61d972-7660-4933-9fd6-2d510e7ba58e | @Override
public void mouseReleased(MouseEvent arg0) {
// TODO Auto-generated method stub
} |
9b7d2075-348e-4c29-8d18-7aa0d59bee18 | public Triangle(Vector point1, Vector point2, Vector point3) {
p1 = point1;
p2 = point2;
p3 = point3;
} |
178c40dc-bdb3-4beb-96db-0cb0cccadd4e | public void assignlist(Vector[] vvv) {
p1 = vvv[0];
p2 = vvv[1];
p3 = vvv[2];
} |
938d24f8-dc36-447d-86d0-7139a87e0160 | public Vector[] getlist() {
Vector[] veclis = {this.p1, this.p2, this.p3};
return veclis;
} |
61bbd97e-9f8d-4491-a7fa-c35d7bd0455b | public void IncVec(double scale) {
p1.Scalar(scale);
p2.Scalar(scale);
p3.Scalar(scale);
} |
4cad16ad-49c4-4cd5-bddb-aac9302df957 | public static void main(String[] args) {
//Now to start the RENDERING
Render mainf = new Render();
mainf.appLoop(mult);
//Testing phase try catch to keep program open
try {
System.in.read();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
7006e9b6-d5f1-43a7-8556-67704cafa218 | public Vector(double x, double y, double z) {
this.xV = x;
this.yV = y;
this.zV = z;
} |
d723d65e-cdb5-4c47-ac22-b73451fcafbf | public void Scalar(double scale) {
xV = xV*scale;
yV = yV*scale;
zV = zV*scale;
} |
a95ba7c9-f709-4e6c-bbd1-56ddc2d77cb6 | public void assignlist(double[] xyz) {
xV = xyz[0];
yV = xyz[1];
zV = xyz[2];
} |
5bc89b44-e18e-4a76-87ea-211696c04690 | public double[] getlist() {
double[] result = new double[3];
result[0] = this.xV;
result[1] = this.yV;
result[2] = this.zV;
return result;
} |
6de74149-800d-4c4c-b5d3-f4bd49b630a6 | protected void doPut(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory factory = Hibernate1.getSessionFactory();
... |
2552fed6-4fb0-4852-9fc2-78a7545f6e1b | protected void doget(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory factory = Hibernate1.getSessionFactory();
... |
952c85ee-bfb5-432c-bec7-c85320c6d6af | protected void doDelate(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory factory = Hibernate1.getSessionFactory();
... |
97c5f5b1-554c-49ff-aece-5d80a553ce53 | public Trabajador() {
} |
d13d1e3c-9c3f-431b-92b8-d60678d52bac | public Trabajador(int id, String nombre, String materno, String paterno) {
this.id = id;
this.nombre = nombre;
this.materno = materno;
this.paterno = paterno;
} |
3f810809-9d99-43eb-bfec-2101b0d7648d | public String getPaterno() {
return paterno;
} |
6c3da7d7-cc27-417a-9259-7feaacd48ef6 | public void setPaterno(String paterno) {
this.paterno = paterno;
} |
f03c83dd-9d69-410d-be0b-2d93a26d3be4 | public int getId() {
return id;
} |
80d143fe-81ef-4343-a36e-3ef53caf6aea | public void setId(int id) {
this.id = id;
} |
7c13b241-c5cb-4b57-9db1-d21707aa113f | public String getNombre() {
return nombre;
} |
b725f7b6-5183-4282-a3d3-4ecad3cf9aa4 | public void setNombre(String nombre) {
this.nombre = nombre;
} |
339d69c1-c763-410a-810c-c373299ad381 | public String getMaterno() {
return materno;
} |
607d659f-21b5-4eb8-af2c-75fabeae5eac | public void setMaterno(String materno) {
this.materno = materno;
} |
5cedf6d7-0ad3-4536-a0eb-53a239f6de14 | @Override
public String toString() {
return "Trabajador{" + "id=" + id + ", nombre=" + nombre + ", materno=" + materno + ", paterno=" + paterno + '}';
} |
1b6d6d48-278c-4150-a63b-8bde8b79ed52 | public static SessionFactory getSessionFactory() {
return sessionFactory;
} |
dde322a8-5097-4d3d-8012-679e657388e8 | protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory factory = Hibernate1.getSessionFactory();
... |
edcb371e-c5b4-4156-b81c-2d35b1a694f5 | protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
SessionFactory factory = Hibernate1.getSessionFactory();
S... |
34d18158-19b2-4c4f-be2e-64ebddf71b05 | public static void main(String[] args) throws Exception {
BasicConfigurator.configure();
String FetchedWorkPath = args[0];
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
envConfig.setLocking(true);
//File envHome = new ... |
a97a33df-0ceb-4058-ad02-aac120448a21 | public static ArrayList<String> loadFileToList(String FileName)
{
//Scanner s;
ArrayList<String> list = new ArrayList<String>();
try {
BufferedReader in = new BufferedReader(new FileReader(FileName));
String zeile = null;
while ((zeile = in.readLine()) != null) {
list.add(zeile.toLowerCase().trim())... |
e2288168-bcbb-402c-8ea2-2c21830b2a5c | public static void saveFileFromList(String FileName,ArrayList<String>WordList)
{
PrintWriter printWriter = null;
try {
printWriter = new PrintWriter(new FileWriter(FileName));
Iterator<String> iter = WordList.iterator();
while(iter.hasNext() ) {
O... |
0a64e776-79aa-4633-8aa9-e60deaedfb10 | public static ArrayList<String> WordlistCleanup(ArrayList<String> WordList)
{
for(int i=0;i<WordList.size();i++)
{
String aWord = WordList.get(i).trim();
if(aWord.isEmpty()==false&&aWord.length()>1)
{
WordList.set(i, aWord.toLowerCase());
}
else
{
WordList... |
05b31610-85b3-4b21-883e-9ce1ff6af360 | public static boolean getMatching(List<String> list, String regex) {
//ArrayList<String> matches = new ArrayList<String>();
boolean erg = false;
Pattern p;
for (String s:list) {
p = Pattern.compile(s);
if (p.matcher(regex).matches()) {
erg=true;
break;
... |
a3689cd0-9bb7-4d69-ab6f-74d46254b2cd | public KeyWordAnalyser()
{
defaultlist = WordlistTools.loadFileToList(".\\settings\\keywords_default.txt");
prio1list = WordlistTools.loadFileToList(".\\settings\\keywords_prio1.txt");
prio2list = WordlistTools.loadFileToList(".\\settings\\keywords_prio2.txt");
prio3list = WordlistTools.loadFileToList(".\\sett... |
f1b354ed-1621-4d52-bd0e-673ffa14ac3d | public void setWords(Hashtable<String,Integer> words) {
Words = words;
} |
fa3c9241-0830-4c7c-aedf-2f2a045a8717 | public long scoreWords(Hashtable<String,Integer> words)
{
setWords(words);
return scoreWords();
} |
d232314e-e0ab-4a18-974e-34d26e9feb8f | public long scoreWords()
{
long erg = -1;
if(Words!=null)
{
if(Words.size()>0)
{
Object[] obj = Words.keySet().toArray();
for(int i=0;i<obj.length;i++){
String word = obj[i].toString();
System.out.print("word: " + word);
if (WordlistTools.getMatch... |
75705efe-b4b8-4c15-8035-c7bc365bd8c0 | public Tokenizer(String Content)
{
// glacier-bay-nationalpark
// nordwest-florida
// triviale Wörter löschen
// Doppelnamen schützen
List<String> doublewords = WordlistTools.loadFileToList(".\\settings\\doublewords.txt");
List<String> trivialwords = WordlistTools.loadFileToList(".\\settings\\tri... |
b6fd3142-85bf-4479-9e26-e12d63a83cc1 | public long getDiffwords() {
return this.count_diffword;
} |
53e9e079-87a0-45a8-ad61-9e8f7157240a | public long getRawwords() {
return this.count_rawword;
} |
66cb5983-f8f4-4416-8908-517814c50b0e | public long getWordcount() {
return this.count_words;
} |
b3e9e1ae-7492-47ac-bfaa-9a3c47d0c406 | public Hashtable<String,Integer> getWords() {
return Words;
} |
f5c1a103-0441-44d2-ac7d-29a890c14ed3 | public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Needed parameters: ");
System.out.println("\t rootFolder (it will contain intermediate crawl data)");
System.out.println("\t numberOfCralwers (number of concurrent threads)");
return;
}
BasicConfigura... |
d16607ed-ec88-410f-84f3-1f2bec08a9e5 | BadDomains()
{
DomainList = WordlistTools.loadFileToList(".\\settings\\baddomains.txt");
} |
399b768e-2562-437f-b5f2-03439ed0b589 | public boolean isBad(WebURL url)
{
Boolean erg = false;
if(url!=null)
{
String URL = url.getDomain().toLowerCase();
if(URL.startsWith("www.")) URL = URL.replace("www.", "");
erg = DomainList.contains(URL);
}
System.out.println("URL isBad Domain: " + erg);
return erg;
} |
6e58e28f-b537-4ea4-8c11-68263a4d2b43 | public static String MD5(String str) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
return hexStringFromBytes(md.digest());
} catch (Exception e) {
e.printStackTrace();
return "";
}
} |
3df19e76-bd39-4b97-9906-fd10a83fd5ec | private static String hexStringFromBytes(byte[] b) {
String hex = "";
int msb;
int lsb;
int i;
// MSB maps to idx 0
for (i = 0; i < b.length; i++) {
msb = (b[i] & 0x000000FF) / 16;
lsb = (b[i] & 0x000000FF) % 16;
hex = hex + hexChars[msb] + hexChars[lsb];
}
return (hex);
} |
a9561b2d-3ea3-464b-9438-e7a3ea2eb416 | public FetchedWorkQueue(Environment env, String dbName, boolean resumable) throws DatabaseException {
this.env = env;
this.resumable = resumable;
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setTransactional(resumable);
dbConfig.setDeferredWrite(!resumable);
urls... |
c5a44bbf-85d9-40ec-a68d-881cde7cecf1 | public List<PageData> get(int max) throws DatabaseException {
synchronized (mutex) {
int matches = 0;
List<PageData> results = new ArrayList<>(max);
Cursor cursor = null;
OperationStatus result;
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
Transaction txn;
... |
b6aba469-6109-4636-b9bc-b18be2933397 | public void delete(int count) throws DatabaseException {
synchronized (mutex) {
int matches = 0;
Cursor cursor = null;
OperationStatus result;
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
Transaction txn;
if (resumable) {
txn = env.beginTransaction(null... |
44a00ba6-7e02-4e72-8a95-eadeb1592756 | protected DatabaseEntry getDatabaseEntryKey(WebURL url) {
byte[] keyData = new byte[6];
keyData[0] = url.getPriority();
keyData[1] = (url.getDepth() > Byte.MAX_VALUE ? Byte.MAX_VALUE : (byte) url.getDepth());
Util.putIntInByteArray(url.getDocid(), keyData, 2);
return new DatabaseEntry(keyData);
} |
b93d162a-d635-43de-85c0-a15236f9d24b | public void put(PageData pageData) throws DatabaseException {
DatabaseEntry value = new DatabaseEntry();
pageTupleBinding.objectToEntry(pageData, value);
Transaction txn;
if (resumable) {
txn = env.beginTransaction(null, null);
} else {
txn = null;
}
DatabaseEntry key = new DatabaseEntry(Crypt... |
6368eda4-3130-472b-bc2f-6ea966076ba4 | public long getLength() {
try {
return urlsDB.count();
} catch (Exception e) {
e.printStackTrace();
}
return -1;
} |
319c0065-94d3-4ba0-a6bb-3b7651b855d9 | public void sync() {
if (resumable) {
return;
}
if (urlsDB == null) {
return;
}
try {
urlsDB.sync();
} catch (DatabaseException e) {
e.printStackTrace();
}
} |
e33030b2-41e5-4dfe-889d-1f1368645182 | public void close() {
try {
urlsDB.close();
} catch (DatabaseException e) {
e.printStackTrace();
}
} |
bfcb24da-97e4-443a-afe4-5b3ab96d96b8 | @Override
public PageData entryToObject(TupleInput input) {
PageData pageData = new PageData();
pageData.setDomain(input.readString());
pageData.setUrl(input.readString());
pageData.setHash(input.readString());
pageData.setContent(input.readString());
pageData.setContentHash(input.readString());
pageD... |
09acd14d-05ee-456f-9e26-8c8feb4b0d7f | @Override
public void objectToEntry(PageData pageData, TupleOutput output) {
output.writeString(pageData.getDomain());
output.writeString(pageData.getUrl());
output.writeString(pageData.getHash());
output.writeString(pageData.getContent());
output.writeString(pageData.getContentHash());
output.writeStrin... |
bfa70d2e-4cf9-4eeb-934f-99d7a68b4b68 | public String getDomain() {
return Domain;
} |
47538c34-5697-4faa-9416-1455b67fde3f | public void setDomain(String domain) {
Domain = domain;
} |
01989f92-fc05-4df3-a220-209254fd53b7 | public String getUrl() {
return Url;
} |
187bf544-e2b3-483c-8fde-20c08fb74d0c | public void setUrl(String url) {
Url = url;
} |
64edcf5e-db34-4a07-ac0e-02c7004db910 | public String getHash() {
return Hash;
} |
fb28e853-42ac-4489-b947-3fe1ca137e1f | public void setHash(String hash) {
Hash = hash;
} |
069d7b6b-1f00-48e8-95f5-861d541eef0b | public String getContent() {
return Content;
} |
d55101c6-d6e7-475e-b161-7ce8c3ef5197 | public void setContent(String content) {
Content = content;
} |
01c3f6a9-ab46-414f-bc37-f21db68016e8 | public String getContentHash() {
return ContentHash;
} |
aa64cfb4-7d63-43ac-877c-7bc166960c37 | public void setContentHash(String contentHash) {
ContentHash = contentHash;
} |
8b0ae59b-4eec-4931-a9a7-1ac117bb41ed | public String getHtml() {
return Html;
} |
fd0721b1-17be-42a9-a659-27dda546ded5 | public void setHtml(String contentHtml) {
Html = contentHtml;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.