query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
TODO Autogenerated method stub
@Override public void mousePressed(MouseEvent arg0) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66713095", "0.6567948", "0.652319", "0.648097", "0.64770466", "0.64586824", "0.64132667", "0.6376419", "0.62759", "0.62545097", "0.62371093", "0.62237984", "0.6201738", "0.619477", "0.619477", "0.61924416", "0.61872935", "0.6173417", "0.613289", "0.6127952", "0.6080854", "0.6076905", "0.6041205", "0.6024897", "0.60200036", "0.59985113", "0.5967729", "0.5967729", "0.5965808", "0.5949083", "0.5941002", "0.59236866", "0.5909713", "0.59030116", "0.589475", "0.58857024", "0.58837134", "0.586915", "0.58575684", "0.5850424", "0.5847001", "0.5824116", "0.5810248", "0.5809659", "0.58069366", "0.58069366", "0.5800507", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.57900196", "0.5790005", "0.578691", "0.578416", "0.578416", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5761079", "0.57592577", "0.57592577", "0.5749888", "0.5749888", "0.5749888", "0.5748457", "0.5733414", "0.5733414", "0.5733414", "0.57209575", "0.57154554", "0.57149583", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.571194", "0.57043016", "0.56993437", "0.5696782", "0.5687825", "0.5677794", "0.5673577", "0.5672046", "0.5669512", "0.5661156", "0.56579345", "0.5655569", "0.5655569", "0.5655569", "0.56546396", "0.56543446", "0.5653163", "0.56502634" ]
0.0
-1
TODO Autogenerated method stub
@Override public void mouseReleased(MouseEvent arg0) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
what happens when item is selected
private void selectItem(int position) { if(position==0){ Intent myIntent= new Intent(this, ConnectActivity.class); startActivity(myIntent);} if(position==1){ Intent myIntent= new Intent(this, ShowActivity.class); startActivity(myIntent);} if(position==2){ Intent myIntent= new Intent(this, DiagnosisActivity.class); startActivity(myIntent);} if(position==3){ Intent myIntent= new Intent(this, RemoteActivity.class); startActivity(myIntent);} if(position==4){ Intent myIntent= new Intent(this, CommandActivity.class); startActivity(myIntent);} // update selected item and title, then close the drawer mDrawerList.setItemChecked(position, true); setTitle(mPlanetTitles[position]); mDrawerLayout.closeDrawer(mDrawerList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void itemSelected(boolean selected);", "@Override\r\n\tpublic void itemSelectedAtIndexPath(IndexPath path) {\n\r\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}", "@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}", "public void onSelectionChanged();", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "void onItemSelected();", "void onItemSelected();", "@Override\n public void onItemSelected(AdapterView<?> parent, View v, int position, long id)\n {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id)\n {\n }", "public void selectionChanged(Action item);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n\n }", "protected void onSelectionPerformed(boolean success) {\n }", "public void invSelected()\n {\n\t\t//informaPreUpdate();\n \tisSelected = !isSelected;\n\t\t//informaPostUpdate();\n }", "@Override\r\n\tpublic void onMenuItemSelected(MenuItem item) {\n\r\n\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void selectItem(String selection) {\n vendingMachine.setSelectedItem(selection);\n vendingMachine.changeToHasSelectionState();\n }", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\tpublic void seleccionar() {\n\r\n\t\t\t}", "public void selected(String action);", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View v, int pos, long id) {\n\t\t\t\tSystem.out.println(\"Selected \" + pos);\n\t\t\t}", "@Override\n\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos,\n\t\t\tlong id) {\n\t\t\n\t\t\n\t}", "@FXML\n\tpublic void setSelectedItem(MouseEvent event) {\n\t\ttry {\n\t\t\tString s=inventoryList.getSelectionModel().getSelectedItem();\t// Get selected item\n\t\t\tItem i=Item.getItem(ItemList, s);\n\t\t\titemselect.setText(s);\t// Set selected item information\n\t\t\tif(i.getStat().equals(\"HP\"))\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Health\");\n\t\t\telse if(i.getStat().equals(\"DMG\"))\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Damage\");\n\t\t\telse\n\t\t\t\titemStats.setText(\"+\"+i.getChange()+\" Evasion\");\n\t\t} catch(Exception e) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t}", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n\t\t}", "public void onItemStateChanged(String id, boolean selected);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n choice=pos;\n }", "void onItemSelected(Bundle args);", "void itemSelected(OutlineItem item);", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif(e.getStateChange() == ItemEvent.SELECTED)\r\n\t\t\t\t\tcodigoResponsavel = responsaveis.get(jcResponsavel.getSelectedIndex() -1 ).getCodigo();\r\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n long arg3) {\n\n }", "public void onItemSelected(int position);", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1, int position,long id) {\n\n\n\n\n }", "@Override\n public void onItemSelected(View view, int position) {\n }", "@Override\n public void onClick(View view)\n {\n if(selectedStructure != null) //checks if object is selected and if prev object is same object\n {\n //if object is the same, then deselect the structure\n if (selectedStructure.equals(structureList.get(getAdapterPosition())))\n selected = false;\n else\n selected = true;\n }\n\n // if selected, get object otherwise let no object is selected\n if (selected)\n {\n selectedStructure = structureList.get(getAdapterPosition());\n }\n else\n {\n selectedStructure = null;\n }\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tif(e.getStateChange()== ItemEvent.SELECTED){\r\n\t\t\tcargarCantidades();\r\n\t\t\tactivarBoton();\r\n\t\t}\r\n\t}", "public boolean isSelected() { return selected; }", "public void onItemSelecting(AdapterView<?> parent, View view, int oldPosition, int newPosition);", "public void onItemSelected(int id);", "public void showSelection () {\n checkWidget();\n if( selectedIndex != -1 ) {\n showItem( getSelection() );\n }\n }", "@Override\r\n protected TreeItem getSelectedItem() {\r\n return getSelectionModel().getSelectedItem();\r\n }", "void onItemSelected(int index, T item) throws RemoteException;", "@Override\r\n\t\t\t\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\n\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\tlong arg3) {\n\n\t}", "@Override\n\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\tlong arg3) {\n\n\t}", "@Override\n public void menuSelected(MenuEvent e) {\n \n }", "@Override\n\tpublic void menuSelected(MenuEvent e) {\n\n\t}", "void stateSelected(State state);", "protected void onSelect() {\n\n }", "private void ComboUserActionPerformed(java.awt.event.ActionEvent evt) {\n if(ComboUser.getSelectedItem().equals(\"title\")){\n \n selected=1;\n }\n else if(ComboUser.getSelectedItem().equals(\"author\"))\n {\n selected=2;\n }\n else if(ComboUser.getSelectedItem().equals(\"subject\"))\n {\n selected=3;\n }\n }", "public void onItemSelected(Long id);", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n\n }", "@Override\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tString res = jc.getSelectedItem().toString();\n\t\tjt.setText(res);\n\n\t}", "public boolean isSelected(){\r\n return selected;\r\n }", "public boolean isSelected() \n {\n return selected;\n }", "public void onItemSelected(AdapterView<?> parent, View view,\n int pos, long id) {\n }", "protected void onSelectedItemChanged() {\n if (selectedItem == null) {\n anchorLabel();\n getInputWidget().setText(\"\");\n } else {\n String playerName = ((Player)selectedItem).getName();\n getInputWidget().setText(playerName);\n floatLabel();\n }\n\n if (itemChooserListener != null) itemChooserListener.onSelectionChanged(this, selectedItem);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n selectItem(position);\n }", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public abstract boolean isSelected();", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\t\t\tListView listView = (ListView) parent;\n\t\t\tString item = (String) listView.getSelectedItem();\n//\t\t\tToast.makeText(SearchGroupActivity.this, \"onItemSelected = \" + item, Toast.LENGTH_LONG).show();\n\t\t}", "public void onIndividualSelected(Individual individual) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void itemStateChanged(ItemEvent e) {\n\t\t\t\tif (e.getStateChange() == ItemEvent.SELECTED) { \r\n\t\t\t\t\tselectSource(e.getItem());\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent3, View view3, int position3, long id3) {\n }", "public void onItemSelected(AdapterView<?> parent, View v, \n\t int pos, long id) {\n\t }", "@Override\n public void valueChanged(javax.swing.event.ListSelectionEvent e)\n {\n this.choice = e.getFirstIndex();\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tListSelectionModel lsm = list.getSelectionModel();\r\n\t\t\tint selected = lsm.getMinSelectionIndex();\r\n\r\n\t\t\tItemView itemView = (ItemView) list.getModel().getElementAt(selected);\r\n\r\n\t\t\t// change item\r\n\t\t\tJOptionPane options = new JOptionPane();\r\n\t\t\tObject[] addFields = { \"Name: \", nameTextField, \"Price: \", priceTextField, \"URL: \", urlTextField, };\r\n\t\t\tint option = JOptionPane.showConfirmDialog(null, addFields, \"Edit item\", JOptionPane.OK_CANCEL_OPTION);\r\n\t\t\tif (option == JOptionPane.OK_OPTION) {\r\n\t\t\t\tString name = nameTextField.getText();\r\n\t\t\t\tString price = priceTextField.getText();\r\n\t\t\t\tString url = urlTextField.getText();\r\n\r\n\t\t\t\tdouble doublePrice = Double.parseDouble(price);\r\n\r\n\t\t\t\titemView.getItem().setName(name);\r\n\t\t\t\titemView.getItem().setCurrentPrice(doublePrice);\r\n\t\t\t\titemView.getItem().setUrl(url);\r\n\t\t\t\t// clear text fields\r\n\t\t\t\tnameTextField.setText(\"\");\r\n\t\t\t\tpriceTextField.setText(\"\");\r\n\t\t\t\turlTextField.setText(\"\");\r\n\t\t\t}\r\n\t\t}", "public void itemStateChanged (ItemEvent event)\n {\n ((GroupItem)gbox.getSelectedItem()).activate();\n }", "@Override\r\n public void valueChanged(ListSelectionEvent e) {\n selectionChanged();\r\n }", "public void onComidaSelected(int comidaId);", "public boolean isSelected() { \n \treturn selection != null; \n }", "public void itemStateChanged(ItemEvent ie) {\n JCheckBox check = (JCheckBox)ie.getSource();\n cb_selection = check.getText(); \n }", "public void onComponentSelection(){\r\n\r\n }", "public boolean isSelected();", "public boolean isSelected();", "@Override\n public void onItemSelected(AdapterView<?> parent2, View view2, int position2, long id2) {\n }", "private void optionSelected(MenuActionDataItem action){\n \t\tString systemAction = action.getSystemAction();\n \t\tif(!systemAction.equals(\"\")){\n \t\t\t\n \t\t\tif(systemAction.equals(\"back\")){\n \t\t\t\tonBackPressed();\n \t\t\t}else if(systemAction.equals(\"home\")){\n \t\t\t\tIntent launchHome = new Intent(this, CoverActivity.class);\t\n \t\t\t\tstartActivity(launchHome);\n \t\t\t}else if(systemAction.equals(\"tts\")){\n \t\t\t\ttextToSearch();\n \t\t\t}else if(systemAction.equals(\"search\")){\n \t\t\t\tshowSearch();\n \t\t\t}else if(systemAction.equals(\"share\")){\n \t\t\t\tshowShare();\n \t\t\t}else if(systemAction.equals(\"map\")){\n \t\t\t\tshowMap();\n \t\t\t}else\n \t\t\t\tLog.e(\"CreateMenus\", \"No se encuentra el el tipo de menu: \" + systemAction);\n \t\t\t\n \t\t}else{\n \t\t\tNextLevel nextLevel = action.getNextLevel();\n \t\t\tshowNextLevel(this, nextLevel);\n \t\t\t\n \t\t}\n \t\t\n \t}", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n expertise_selected = adapterView.getItemAtPosition(i).toString();\n }", "@Override\r\n\tpublic void itemStateChanged(ItemEvent e) {\n\t\tint a=c1.getSelectedIndex();\r\n\t\tString b=c1.getItemAt(a).toString();\r\n\t\tl1.setText(\"\"+b);\r\n\t}", "public void updateSelection() {\n\t\t\n\t}", "public boolean isSelected()\n {\n return selected;\n }", "public void onEventSelected(int position);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n item = parent.getItemAtPosition(position).toString();\n isSelected = true;\n\n // Showing selected spinner item\n //Toast.makeText(parent.getContext(), \"Selected: \" + item, Toast.LENGTH_LONG).show();\n }", "@Override\n\tpublic void onSelectionChanged(ListSelectionEvent e, List<ShoppingListObject> values) {\n\n\t}", "@Override\n\tpublic void widgetSelected(SelectionEvent e) {\n\t\t\n\t}", "boolean isSelected();", "boolean isSelected();", "boolean isSelected();" ]
[ "0.77156514", "0.73974776", "0.7318584", "0.7318584", "0.7269051", "0.7269051", "0.72131974", "0.72092694", "0.72092694", "0.71961886", "0.71961886", "0.7181738", "0.7160741", "0.7137329", "0.71307284", "0.7096378", "0.7089037", "0.70865774", "0.7084864", "0.70826834", "0.70656073", "0.7058519", "0.70577776", "0.70577776", "0.70577776", "0.70567775", "0.7054477", "0.7050208", "0.7049587", "0.70484954", "0.7044303", "0.703276", "0.70298946", "0.7029636", "0.70075905", "0.69864315", "0.6976707", "0.6974037", "0.69725585", "0.69724387", "0.6964959", "0.6963067", "0.6956734", "0.6946481", "0.6944138", "0.6937759", "0.69106627", "0.69105667", "0.6908545", "0.6888458", "0.6887994", "0.6869365", "0.6869268", "0.6869268", "0.6868015", "0.68599904", "0.6858772", "0.68561864", "0.6841247", "0.68399376", "0.6835663", "0.68318313", "0.6831403", "0.6820571", "0.68158996", "0.6804101", "0.67995876", "0.67953277", "0.67953277", "0.67953277", "0.67953277", "0.67953277", "0.67934847", "0.67822754", "0.67779434", "0.6759744", "0.67490673", "0.67392546", "0.6739221", "0.67341095", "0.6729126", "0.6714489", "0.6714166", "0.67128986", "0.67125976", "0.67022526", "0.669993", "0.669993", "0.6684429", "0.66806024", "0.6666644", "0.66596365", "0.6654896", "0.6651187", "0.6649171", "0.66415614", "0.6640413", "0.66395193", "0.6638351", "0.6638351", "0.6638351" ]
0.0
-1
/ JADX WARNING: type inference failed for: r3v0, types: [io.reactivex.functions.Function, io.reactivex.functions.Function, io.reactivex.Scheduler>] / JADX WARNING: Unknown variable types count: 1 / Code decompiled incorrectly, please refer to instructions dump.
static io.reactivex.Scheduler applyRequireNonNull(io.reactivex.functions.Function<java.util.concurrent.Callable<io.reactivex.Scheduler>, io.reactivex.Scheduler> r3, java.util.concurrent.Callable<io.reactivex.Scheduler> r4) { /* java.lang.Object r0 = apply(r3, r4) io.reactivex.Scheduler r0 = (io.reactivex.Scheduler) r0 if (r0 != 0) goto L_0x0011 java.lang.NullPointerException r1 = new java.lang.NullPointerException java.lang.String r2 = "Scheduler Callable returned null" r1.<init>(r2) throw r1 L_0x0011: return r0 */ throw new UnsupportedOperationException("Method not decompiled: com.taobao.plugins.RxAndroidPlugins.applyRequireNonNull(io.reactivex.functions.Function, java.util.concurrent.Callable):io.reactivex.Scheduler"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void m55608a(@org.jetbrains.annotations.NotNull com.tinder.pushnotifications.usecase.NotifyPushServer.NotifyReason r3) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = \"request\";\n kotlin.jvm.internal.C2668g.b(r3, r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.NotifyReason.APP_OPENED;\n if (r3 != r0) goto L_0x000e;\n L_0x0009:\n r3 = r2.f46002b;\t Catch:{ SecurityException -> 0x000e }\n r3.cancelAll();\t Catch:{ SecurityException -> 0x000e }\n L_0x000e:\n r3 = r2.f46003c;\n r3 = r3.d();\n if (r3 == 0) goto L_0x005f;\n L_0x0016:\n r3 = r2.f46005e;\n r3 = r3.a();\n r3 = r3.getLanguage();\n r3 = rx.Single.a(r3);\n r0 = new com.tinder.pushnotifications.usecase.NotifyPushServer$a;\n r0.<init>(r2);\n r0 = (rx.functions.Func1) r0;\n r3 = r3.d(r0);\n r0 = new com.tinder.pushnotifications.usecase.NotifyPushServer$b;\n r0.<init>(r2);\n r0 = (rx.functions.Func1) r0;\n r3 = r3.c(r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.C17888c.f55780a;\n r0 = (rx.functions.Func1) r0;\n r3 = r3.a(r0);\n r0 = r2.f46001a;\n r0 = r0.notifyPushServerAppOpen();\n r3 = r3.b(r0);\n r0 = rx.schedulers.Schedulers.io();\n r3 = r3.b(r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.C18651d.f58120a;\n r0 = (rx.functions.Action0) r0;\n r1 = com.tinder.pushnotifications.usecase.NotifyPushServer.C18652e.f58121a;\n r1 = (rx.functions.Action1) r1;\n r3.a(r0, r1);\n L_0x005f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tinder.pushnotifications.usecase.NotifyPushServer.a(com.tinder.pushnotifications.usecase.NotifyPushServer$NotifyReason):void\");\n }", "@io.reactivex.annotations.CheckReturnValue\n @io.reactivex.annotations.BackpressureSupport(io.reactivex.annotations.BackpressureKind.FULL)\n @org.jetbrains.annotations.NotNull\n @io.reactivex.annotations.SchedulerSupport(\"none\")\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static final <T, R, U> io.reactivex.Flowable<kotlin.Triple<T, R, U>> combineLatest(@org.jetbrains.annotations.NotNull io.reactivex.Flowable<T> r2, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<R> r3, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<U> r4) {\n /*\n java.lang.String r0 = \"$receiver\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r2, r0)\n java.lang.String r0 = \"flowable1\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r0)\n java.lang.String r0 = \"flowable2\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r0)\n org.a.b r2 = (org.a.b) r2\n org.a.b r3 = (org.a.b) r3\n org.a.b r4 = (org.a.b) r4\n io.reactivex.rxkotlin.FlowableKt$combineLatest$3 r0 = io.reactivex.rxkotlin.FlowableKt$combineLatest$3.INSTANCE\n kotlin.jvm.functions.Function3 r0 = (kotlin.jvm.functions.Function3) r0\n if (r0 == 0) goto L_0x0021\n io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_Function3$0 r1 = new io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_Function3$0\n r1.<init>(r0)\n r0 = r1\n L_0x0021:\n io.reactivex.functions.Function3 r0 = (io.reactivex.functions.Function3) r0\n io.reactivex.Flowable r2 = io.reactivex.Flowable.combineLatest(r2, r3, r4, r0)\n java.lang.String r3 = \"Flowable.combineLatest(t…le2, Function3(::Triple))\"\n kotlin.jvm.internal.Intrinsics.checkExpressionValueIsNotNull(r2, r3)\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.rxkotlin.FlowableKt.combineLatest(io.reactivex.Flowable, io.reactivex.Flowable, io.reactivex.Flowable):io.reactivex.Flowable\");\n }", "@io.reactivex.annotations.CheckReturnValue\n @io.reactivex.annotations.BackpressureSupport(io.reactivex.annotations.BackpressureKind.FULL)\n @org.jetbrains.annotations.NotNull\n @io.reactivex.annotations.SchedulerSupport(\"none\")\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static final <T, R> io.reactivex.Flowable<kotlin.Pair<T, R>> combineLatest(@org.jetbrains.annotations.NotNull io.reactivex.Flowable<T> r2, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<R> r3) {\n /*\n java.lang.String r0 = \"$receiver\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r2, r0)\n java.lang.String r0 = \"flowable\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r0)\n org.a.b r2 = (org.a.b) r2\n org.a.b r3 = (org.a.b) r3\n io.reactivex.rxkotlin.FlowableKt$combineLatest$2 r0 = io.reactivex.rxkotlin.FlowableKt$combineLatest$2.INSTANCE\n kotlin.jvm.functions.Function2 r0 = (kotlin.jvm.functions.Function2) r0\n if (r0 == 0) goto L_0x001a\n io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_BiFunction$0 r1 = new io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_BiFunction$0\n r1.<init>(r0)\n r0 = r1\n L_0x001a:\n io.reactivex.functions.BiFunction r0 = (io.reactivex.functions.BiFunction) r0\n io.reactivex.Flowable r2 = io.reactivex.Flowable.combineLatest((org.a.b<? extends T1>) r2, (org.a.b<? extends T2>) r3, (io.reactivex.functions.BiFunction<? super T1, ? super T2, ? extends R>) r0)\n java.lang.String r3 = \"Flowable.combineLatest(t…able, BiFunction(::Pair))\"\n kotlin.jvm.internal.Intrinsics.checkExpressionValueIsNotNull(r2, r3)\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.rxkotlin.FlowableKt.combineLatest(io.reactivex.Flowable, io.reactivex.Flowable):io.reactivex.Flowable\");\n }", "public final void m18179a(java.lang.Throwable r4) {\n /*\n r3 = this;\n r0 = 0\n java.lang.Object[] r0 = new java.lang.Object[r0]\n java.lang.String r1 = \"Refresh Account failed\"\n p686n.p687a.Timber.m44528b(r4, r1, r0)\n g.e.b.d.r$b r4 = new g.e.b.d.r$b\n r4.<init>(r3)\n r3.updateState(r4)\n com.bamtechmedia.dominguez.core.d r4 = r3.f12932d\n boolean r4 = r4.mo13695j()\n if (r4 != 0) goto L_0x0051\n io.reactivex.disposables.Disposable r4 = r3.f12929a\n if (r4 != 0) goto L_0x0051\n com.bamtechmedia.dominguez.core.d r4 = r3.f12932d\n io.reactivex.Completable r4 = r4.mo13697n()\n g.n.a.c0 r0 = r3.getViewModelScope()\n g.n.a.h r0 = p163g.p503n.p504a.C11793e.m37930a(r0)\n java.lang.Object r4 = r4.mo30048a(r0)\n java.lang.String r0 = \"this.`as`(AutoDispose.au…isposable<Any>(provider))\"\n kotlin.jvm.internal.Intrinsics.checkReturnedValueIsNotNull(r4, r0)\n g.n.a.v r4 = (p163g.p503n.p504a.C11839v) r4\n g.e.b.d.r$c r0 = new g.e.b.d.r$c\n r0.<init>(r3)\n g.e.b.d.s r1 = new g.e.b.d.s\n r1.<init>(r0)\n g.e.b.d.r$d r0 = p163g.p201e.p203b.p204d.C5419r.C5423d.f12939c\n if (r0 == 0) goto L_0x0049\n g.e.b.d.t r2 = new g.e.b.d.t\n r2.<init>(r0)\n r0 = r2\n L_0x0049:\n io.reactivex.functions.Consumer r0 = (p520io.reactivex.functions.Consumer) r0\n io.reactivex.disposables.Disposable r4 = r4.mo29926a(r1, r0)\n r3.f12929a = r4\n L_0x0051:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p163g.p201e.p203b.p204d.C5419r.m18179a(java.lang.Throwable):void\");\n }", "public void subscribe(p019io.reactivex.Observer<? super T> r6) {\n /*\n r5 = this;\n L_0x0000:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r0 = r5.curr\n java.lang.Object r0 = r0.get()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r0 = (p019io.reactivex.internal.operators.observable.ObservableReplay.ReplayObserver) r0\n if (r0 != 0) goto L_0x0020\n io.reactivex.internal.operators.observable.ObservableReplay$BufferSupplier<T> r1 = r5.bufferFactory\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer r1 = r1.call()\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver r2 = new io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver\n r2.<init>(r1)\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.observable.ObservableReplay$ReplayObserver<T>> r3 = r5.curr\n r4 = 0\n boolean r3 = r3.compareAndSet(r4, r2)\n if (r3 != 0) goto L_0x001f\n goto L_0x0000\n L_0x001f:\n r0 = r2\n L_0x0020:\n io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable r1 = new io.reactivex.internal.operators.observable.ObservableReplay$InnerDisposable\n r1.<init>(r0, r6)\n r6.onSubscribe(r1)\n r0.add(r1)\n boolean r2 = r1.isDisposed()\n if (r2 == 0) goto L_0x0035\n r0.remove(r1)\n return\n L_0x0035:\n io.reactivex.internal.operators.observable.ObservableReplay$ReplayBuffer<T> r2 = r0.buffer\n r2.replay(r1)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p019io.reactivex.internal.operators.observable.ObservableReplay.ReplaySource.subscribe(io.reactivex.Observer):void\");\n }", "public final R mo2484a(long r4, java.util.concurrent.TimeUnit r6) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r3 = this;\n r0 = 0;\n r2 = (r4 > r0 ? 1 : (r4 == r0 ? 0 : -1));\n if (r2 <= 0) goto L_0x000b;\n L_0x0006:\n r0 = \"await must not be called on the UI thread when time is greater than zero.\";\n com.google.android.gms.common.internal.ad.m9057c(r0);\n L_0x000b:\n r0 = r3.f11872k;\n r1 = 1;\n r0 = r0 ^ r1;\n r2 = \"Result has already been consumed.\";\n com.google.android.gms.common.internal.ad.m9051a(r0, r2);\n r0 = r3.f11876o;\n if (r0 != 0) goto L_0x0019;\n L_0x0018:\n goto L_0x001a;\n L_0x0019:\n r1 = 0;\n L_0x001a:\n r0 = \"Cannot await if then() has been called.\";\n com.google.android.gms.common.internal.ad.m9051a(r1, r0);\n r0 = r3.f11866e;\t Catch:{ InterruptedException -> 0x002d }\n r4 = r0.await(r4, r6);\t Catch:{ InterruptedException -> 0x002d }\n if (r4 != 0) goto L_0x0032;\t Catch:{ InterruptedException -> 0x002d }\n L_0x0027:\n r4 = com.google.android.gms.common.api.Status.zzfnl;\t Catch:{ InterruptedException -> 0x002d }\n r3.m14226b(r4);\t Catch:{ InterruptedException -> 0x002d }\n goto L_0x0032;\n L_0x002d:\n r4 = com.google.android.gms.common.api.Status.zzfnj;\n r3.m14226b(r4);\n L_0x0032:\n r4 = r3.m14229d();\n r5 = \"Result is not ready.\";\n com.google.android.gms.common.internal.ad.m9051a(r4, r5);\n r4 = r3.mo3575g();\n return r4;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.api.internal.BasePendingResult.a(long, java.util.concurrent.TimeUnit):R\");\n }", "public static void m57033b(final Context context) {\n if (context != null && !C6969H.m41409d(\"G798FD403\").equalsIgnoreCase(AppBuildConfig.CHANNEL())) {\n Observable.create(new ObservableOnSubscribe(context) {\n /* class com.zhihu.android.app.accounts.$$Lambda$f$506_47BAIsbLM4juZrBQ3lbQ */\n private final /* synthetic */ Context f$0;\n\n {\n this.f$0 = r1;\n }\n\n @Override // p2189io.reactivex.ObservableOnSubscribe\n public final void subscribe(ObservableEmitter sVar) {\n AppListUitls.m155969lambda$506_47BAIsbLM4juZrBQ3lbQ(this.f$0, sVar);\n }\n }).flatMap(new AbstractC31736h(context, m57037f(context) ? 1 : 0) {\n /* class com.zhihu.android.app.accounts.$$Lambda$f$VNOj8p4mpSRr_W2aqLm5QFe6TA */\n private final /* synthetic */ Context f$0;\n private final /* synthetic */ int f$1;\n\n {\n this.f$0 = r1;\n this.f$1 = r2;\n }\n\n @Override // p2189io.reactivex.p2209c.AbstractC31736h\n public final Object apply(Object obj) {\n return AppListUitls.m155970lambda$VNOj8p4mpSRr_W2aqLm5QFe6TA(this.f$0, this.f$1, obj);\n }\n }).subscribeOn(Schedulers.m148537b()).observeOn(AndroidSchedulers.m147557a()).subscribe(new EmptyObserver<Response>() {\n /* class com.zhihu.android.app.accounts.AppListUitls.C104651 */\n\n @Override // p2189io.reactivex.AbstractC32175x, com.zhihu.android.app.util.EmptyObserver\n public void onError(Throwable th) {\n }\n\n @Override // p2189io.reactivex.AbstractC32175x, com.zhihu.android.app.util.EmptyObserver\n public void onComplete() {\n super.onComplete();\n }\n\n /* renamed from: a */\n public void onNext(Response response) {\n if (response.mo134996e()) {\n AppListUitls.m57038g(context);\n }\n }\n });\n }\n }", "private final void m39625d() {\n this.f31769b.add(this.f31770c.execute().subscribeOn(this.f31771d).observeOn(this.f31772e).subscribe(new C11696a(this), new C11697b(this)));\n }", "private void m125715i() {\n RxBus.m86979a().mo84365a(TopicReviewClickEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$ilStsapfhY6AmqXsirZvIVpDyM */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125688a((TopicFragment) ((TopicReviewClickEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n RxBus.m86979a().mo84365a(TopicActiveAnswererShareEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$BjK9qQqNBfZ6wBlmaowQpTV4GyQ */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125687a((TopicFragment) ((TopicActiveAnswererShareEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n RxBus.m86979a().mo84365a(TopicActiveAnswererJumpEvent.class, this).compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW)).observeOn(AndroidSchedulers.m147557a()).subscribe(new AbstractC31735g() {\n /* class com.zhihu.android.topic.platfrom.$$Lambda$TopicFragment$_g34FcL5FmfymiORzp8CR0wVoH8 */\n\n @Override // p2189io.reactivex.p2209c.AbstractC31735g\n public final void accept(Object obj) {\n TopicFragment.this.m125686a((TopicFragment) ((TopicActiveAnswererJumpEvent) obj));\n }\n }, $$Lambda$9kS41GgiqU3yr14QLLPITIizPGM.INSTANCE);\n }", "@Override\n public Comparator<Object> thenComparingDouble(final ToDoubleFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "private Completable m147567a(AbstractC31735g<? super Disposable> gVar, AbstractC31735g<? super Throwable> gVar2, AbstractC31733a aVar, AbstractC31733a aVar2, AbstractC31733a aVar3, AbstractC31733a aVar4) {\n ObjectHelper.m147684a((Object) gVar, \"onSubscribe is null\");\n ObjectHelper.m147684a((Object) gVar2, \"onError is null\");\n ObjectHelper.m147684a((Object) aVar, \"onComplete is null\");\n ObjectHelper.m147684a((Object) aVar2, \"onTerminate is null\");\n ObjectHelper.m147684a((Object) aVar3, \"onAfterTerminate is null\");\n ObjectHelper.m147684a((Object) aVar4, \"onDispose is null\");\n return RxJavaPlugins.m148466a(new CompletablePeek(this, gVar, gVar2, aVar, aVar2, aVar3, aVar4));\n }", "@Override\n public Comparator<Object> thenComparingInt(final ToIntFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "@Override\n public <U> Comparator<Object> thenComparing(final Function<?, ? extends U> p0, final Comparator<? super U> p1) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1793)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1790)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper.getLowerBound(MetadataHelper.java:1240)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2278)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2256)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2233)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2246)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.adapt(MetadataHelper.java:1312)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2708)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2692)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visitParameterizedType(DefaultTypeVisitor.java:65)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.asSubType(MetadataHelper.java:720)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:926)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:770)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:766)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2515)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "public static void m5813a(java.lang.String r2, java.lang.String r3, java.lang.String r4, boolean r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = new com.crashlytics.android.answers.PurchaseEvent;\n r0.<init>();\n r1 = java.util.Locale.getDefault();\n r1 = java.util.Currency.getInstance(r1);\n r0.putCurrency(r1);\n r0.putItemId(r2);\n r0.putItemType(r3);\n r2 = java.lang.Long.parseLong(r4);\t Catch:{ Exception -> 0x0021 }\n r2 = java.math.BigDecimal.valueOf(r2);\t Catch:{ Exception -> 0x0021 }\n r0.putItemPrice(r2);\t Catch:{ Exception -> 0x0021 }\n L_0x0021:\n r0.putSuccess(r5);\n r2 = com.crashlytics.android.answers.Answers.getInstance();\n r2.logPurchase(r0);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.a(java.lang.String, java.lang.String, java.lang.String, boolean):void\");\n }", "public final void a() {\n /*\n r25 = this;\n r1 = r25\n int r0 = r25.getAndIncrement()\n if (r0 == 0) goto L_0x0009\n return\n L_0x0009:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.flowable.cq$b<T>[]> r2 = r1.e\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n r3 = 1\n r4 = r0\n r5 = 1\n L_0x0014:\n java.lang.Object r0 = r1.h\n io.reactivex.internal.b.j<T> r6 = r1.j\n if (r6 == 0) goto L_0x0023\n boolean r8 = r6.isEmpty()\n if (r8 == 0) goto L_0x0021\n goto L_0x0023\n L_0x0021:\n r8 = 0\n goto L_0x0024\n L_0x0023:\n r8 = 1\n L_0x0024:\n boolean r0 = r1.a(r0, r8)\n if (r0 == 0) goto L_0x002b\n return\n L_0x002b:\n if (r8 != 0) goto L_0x0156\n int r0 = r4.length\n int r9 = r4.length\n r12 = 0\n r13 = 0\n r14 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n L_0x0036:\n r16 = -9223372036854775808\n if (r12 >= r9) goto L_0x0053\n r7 = r4[r12]\n long r18 = r7.get()\n int r20 = (r18 > r16 ? 1 : (r18 == r16 ? 0 : -1))\n if (r20 == 0) goto L_0x004e\n long r10 = r7.c\n long r10 = r18 - r10\n long r10 = java.lang.Math.min(r14, r10)\n r14 = r10\n goto L_0x0050\n L_0x004e:\n int r13 = r13 + 1\n L_0x0050:\n int r12 = r12 + 1\n goto L_0x0036\n L_0x0053:\n r9 = 1\n if (r0 != r13) goto L_0x0093\n java.lang.Object r0 = r1.h\n java.lang.Object r7 = r6.poll() // Catch:{ all -> 0x005e }\n goto L_0x0075\n L_0x005e:\n r0 = move-exception\n r6 = r0\n io.reactivex.c.b.throwIfFatal(r6)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r6)\n r1.h = r0\n r7 = 0\n L_0x0075:\n if (r7 != 0) goto L_0x0079\n r6 = 1\n goto L_0x007a\n L_0x0079:\n r6 = 0\n L_0x007a:\n boolean r0 = r1.a(r0, r6)\n if (r0 == 0) goto L_0x0081\n return\n L_0x0081:\n int r0 = r1.i\n if (r0 == r3) goto L_0x0090\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.request(r9)\n L_0x0090:\n r6 = 1\n goto L_0x0165\n L_0x0093:\n r0 = r8\n r8 = 0\n L_0x0095:\n long r11 = (long) r8\n int r13 = (r11 > r14 ? 1 : (r11 == r14 ? 0 : -1))\n if (r13 >= 0) goto L_0x0139\n java.lang.Object r0 = r1.h\n java.lang.Object r13 = r6.poll() // Catch:{ all -> 0x00a1 }\n goto L_0x00b8\n L_0x00a1:\n r0 = move-exception\n r13 = r0\n io.reactivex.c.b.throwIfFatal(r13)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r13)\n r1.h = r0\n r13 = 0\n L_0x00b8:\n if (r13 != 0) goto L_0x00bc\n r7 = 1\n goto L_0x00bd\n L_0x00bc:\n r7 = 0\n L_0x00bd:\n boolean r0 = r1.a(r0, r7)\n if (r0 == 0) goto L_0x00c4\n return\n L_0x00c4:\n if (r7 != 0) goto L_0x0135\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.getValue(r13)\n int r11 = r4.length\n r12 = 0\n r13 = 0\n L_0x00cd:\n if (r12 >= r11) goto L_0x0103\n r3 = r4[r12]\n long r22 = r3.get()\n int r24 = (r22 > r16 ? 1 : (r22 == r16 ? 0 : -1))\n if (r24 == 0) goto L_0x00f1\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r24 = (r22 > r20 ? 1 : (r22 == r20 ? 0 : -1))\n r22 = r6\n r23 = r7\n if (r24 == 0) goto L_0x00eb\n long r6 = r3.c\n long r6 = r6 + r9\n r3.c = r6\n L_0x00eb:\n org.b.c<? super T> r3 = r3.f8109a\n r3.onNext(r0)\n goto L_0x00fb\n L_0x00f1:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n r13 = 1\n L_0x00fb:\n int r12 = r12 + 1\n r6 = r22\n r7 = r23\n r3 = 1\n goto L_0x00cd\n L_0x0103:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r8 = r8 + 1\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n if (r13 != 0) goto L_0x0120\n if (r0 == r4) goto L_0x0119\n goto L_0x0120\n L_0x0119:\n r6 = r22\n r0 = r23\n r3 = 1\n goto L_0x0095\n L_0x0120:\n if (r8 == 0) goto L_0x0133\n int r3 = r1.i\n r4 = 1\n if (r3 == r4) goto L_0x0133\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n long r6 = (long) r8\n r3.request(r6)\n L_0x0133:\n r4 = r0\n goto L_0x0165\n L_0x0135:\n r23 = r7\n r0 = r23\n L_0x0139:\n if (r8 == 0) goto L_0x014c\n int r3 = r1.i\n r6 = 1\n if (r3 == r6) goto L_0x014d\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n r3.request(r11)\n goto L_0x014d\n L_0x014c:\n r6 = 1\n L_0x014d:\n r7 = 0\n int r3 = (r14 > r7 ? 1 : (r14 == r7 ? 0 : -1))\n if (r3 == 0) goto L_0x0157\n if (r0 == 0) goto L_0x0165\n goto L_0x0157\n L_0x0156:\n r6 = 1\n L_0x0157:\n int r0 = -r5\n int r5 = r1.addAndGet(r0)\n if (r5 == 0) goto L_0x0168\n java.lang.Object r0 = r2.get()\n r4 = r0\n io.reactivex.internal.operators.flowable.cq$b[] r4 = (io.reactivex.internal.operators.flowable.cq.b[]) r4\n L_0x0165:\n r3 = 1\n goto L_0x0014\n L_0x0168:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.internal.operators.flowable.cq.c.a():void\");\n }", "private static void m13381a(long r3, float r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\n r0.beginTransaction();\t Catch:{ Exception -> 0x001f }\n r1 = \"INSERT INTO battery_watcher (timestamp, level) VALUES (?, ?)\";\t Catch:{ Exception -> 0x001f }\n r1 = r0.compileStatement(r1);\t Catch:{ Exception -> 0x001f }\n r2 = 1;\t Catch:{ Exception -> 0x001f }\n r1.bindLong(r2, r3);\t Catch:{ Exception -> 0x001f }\n r3 = 2;\t Catch:{ Exception -> 0x001f }\n r4 = (double) r5;\t Catch:{ Exception -> 0x001f }\n r1.bindDouble(r3, r4);\t Catch:{ Exception -> 0x001f }\n r1.execute();\t Catch:{ Exception -> 0x001f }\n r0.setTransactionSuccessful();\t Catch:{ Exception -> 0x001f }\n goto L_0x0026;\n L_0x001d:\n r3 = move-exception;\n goto L_0x002a;\n L_0x001f:\n r3 = f10646a;\t Catch:{ all -> 0x001d }\n r4 = \"Issue adding location to battery history\";\t Catch:{ all -> 0x001d }\n com.foursquare.internal.util.FsLog.m6807d(r3, r4);\t Catch:{ all -> 0x001d }\n L_0x0026:\n r0.endTransaction();\n return;\n L_0x002a:\n r0.endTransaction();\n throw r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.a(long, float):void\");\n }", "@Test\n public void example() {\n Func1<Integer, Observable<Integer>> db1 = param -> Observable.range(1, param);\n\n // ws-kald som funktion der returner en Observable\n Func1<Integer, Observable<Integer>> ws1 = param -> Observable.just(param);\n\n // ws-kald som funktion der returner en Observable\n Func1<Integer, Observable<Integer>> ws2 = param -> Observable.just(param);\n\n // ws-kald som funktion der returner en Observable\n Func1<List<Integer>, Observable<Object>> ws3 = param -> Observable.empty();\n\n db1.call(5)\n .flatMap(row -> {\n if (row % 2 == 0) {\n // ws2 kaldes kun, hvis ws1 ikke var tom\n return Observable.concat(ws1.call(row), ws2.call(row)).first();\n } else {\n // ws1 og ws2 udføres parallelt\n return Observable.zip(ws1.call(10), ws2.call(20), (e1, e2) -> e1 + e2);\n }\n })\n .onErrorResumeNext(err -> {\n log.error(\"error - resume next \", err);\n return Observable.empty();\n })\n .doOnNext(n -> log.info(\"element {}\", n))\n // samle/batche 2 elementer i en liste (men højst vente 1 sekund)\n .buffer(2, 1, TimeUnit.SECONDS)\n // output sendes til en ws3\n .flatMap(ws3)\n // subscribe starter kæden\n .subscribe();\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public static void enable() {\n if (lock.compareAndSet(false, true)) {\n\n RxJavaPlugins.setOnFlowableAssembly(new Function<Flowable, Flowable>() {\n @Override\n public Flowable apply(Flowable f) throws Exception {\n if (f instanceof Supplier) {\n if (f instanceof ScalarSupplier) {\n return new FlowableOnAssemblyScalarSupplier(f);\n }\n return new FlowableOnAssemblySupplier(f);\n }\n return new FlowableOnAssembly(f);\n }\n });\n\n RxJavaPlugins.setOnConnectableFlowableAssembly(new Function<ConnectableFlowable, ConnectableFlowable>() {\n @Override\n public ConnectableFlowable apply(ConnectableFlowable f) throws Exception {\n return new FlowableOnAssemblyConnectable(f);\n }\n });\n\n RxJavaPlugins.setOnObservableAssembly(new Function<Observable, Observable>() {\n @Override\n public Observable apply(Observable f) throws Exception {\n if (f instanceof Supplier) {\n if (f instanceof ScalarSupplier) {\n return new ObservableOnAssemblyScalarSupplier(f);\n }\n return new ObservableOnAssemblySupplier(f);\n }\n return new ObservableOnAssembly(f);\n }\n });\n\n RxJavaPlugins.setOnConnectableObservableAssembly(new Function<ConnectableObservable, ConnectableObservable>() {\n @Override\n public ConnectableObservable apply(ConnectableObservable f) throws Exception {\n return new ObservableOnAssemblyConnectable(f);\n }\n });\n\n RxJavaPlugins.setOnSingleAssembly(new Function<Single, Single>() {\n @Override\n public Single apply(Single f) throws Exception {\n if (f instanceof Supplier) {\n if (f instanceof ScalarSupplier) {\n return new SingleOnAssemblyScalarSupplier(f);\n }\n return new SingleOnAssemblySupplier(f);\n }\n return new SingleOnAssembly(f);\n }\n });\n\n RxJavaPlugins.setOnCompletableAssembly(new Function<Completable, Completable>() {\n @Override\n public Completable apply(Completable f) throws Exception {\n if (f instanceof Supplier) {\n if (f instanceof ScalarSupplier) {\n return new CompletableOnAssemblyScalarSupplier(f);\n }\n return new CompletableOnAssemblySupplier(f);\n }\n return new CompletableOnAssembly(f);\n }\n });\n\n RxJavaPlugins.setOnMaybeAssembly(new Function<Maybe, Maybe>() {\n @Override\n public Maybe apply(Maybe f) throws Exception {\n if (f instanceof Supplier) {\n if (f instanceof ScalarSupplier) {\n return new MaybeOnAssemblyScalarSupplier(f);\n }\n return new MaybeOnAssemblySupplier(f);\n }\n return new MaybeOnAssembly(f);\n }\n });\n\n RxJavaPlugins.setOnParallelAssembly(new Function<ParallelFlowable, ParallelFlowable>() {\n @Override\n public ParallelFlowable apply(ParallelFlowable t) throws Exception {\n return new ParallelFlowableOnAssembly(t);\n }\n });\n\n lock.set(false);\n }\n }", "public static void test016()\r\n {\r\n System.out.println(\"RxJavaTest04::test016\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries rxGroceries = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .fromIterable(Arrays.asList(\"bread\", \"butter\", \"milk\", \"tomato\", \"cheese\"))\r\n .subscribeOn(schedulerA)\r\n .flatMap(prod -> rxGroceries\r\n .purchase(prod, 1)\r\n .subscribeOn(schedulerA)\r\n )\r\n .reduce(BigDecimal::add);\r\n totalPrice\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n myWait(2000); // We have to wait before shutting down the pool,\r\n // otherwise it will throw exception \r\n // [java] io.reactivex.exceptions.UndeliverableException:\r\n // java.util.concurrent.RejectedExecutionException:\r\n // Task java.util.concurrent.FutureTask@38d8f9d0 rejected\r\n // from java.util.concurrent.ThreadPoolExecutor@6a724a6c\r\n // [Shutting down, pool size = 1, active threads = 1, queued\r\n // tasks = 0, completed tasks = 0]\r\n poolA.shutdown();\r\n }", "void mo9337a(C2177n<?> nVar, UnobservedTaskException unobservedTaskException);", "private static int m69982c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r0 = \"android.os.Build$VERSION\";\t Catch:{ Exception -> 0x0018 }\n r0 = java.lang.Class.forName(r0);\t Catch:{ Exception -> 0x0018 }\n r1 = \"SDK_INT\";\t Catch:{ Exception -> 0x0018 }\n r0 = r0.getField(r1);\t Catch:{ Exception -> 0x0018 }\n r1 = 0;\t Catch:{ Exception -> 0x0018 }\n r0 = r0.get(r1);\t Catch:{ Exception -> 0x0018 }\n r0 = (java.lang.Integer) r0;\t Catch:{ Exception -> 0x0018 }\n r0 = r0.intValue();\t Catch:{ Exception -> 0x0018 }\n return r0;\n L_0x0018:\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.util.f.c():int\");\n }", "public void emitAndComplete(rx.Subscriber<T> r5, rx.Subscriber<?> r6) {\n /*\n r4 = this;\n monitor-enter(r4);\n r3 = r4.emitting;\t Catch:{ all -> 0x0021 }\n if (r3 == 0) goto L_0x000a;\n L_0x0005:\n r3 = 1;\n r4.terminate = r3;\t Catch:{ all -> 0x0021 }\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n L_0x0009:\n return;\n L_0x000a:\n r2 = r4.value;\t Catch:{ all -> 0x0021 }\n r1 = r4.hasValue;\t Catch:{ all -> 0x0021 }\n r3 = 0;\n r4.value = r3;\t Catch:{ all -> 0x0021 }\n r3 = 0;\n r4.hasValue = r3;\t Catch:{ all -> 0x0021 }\n r3 = 1;\n r4.emitting = r3;\t Catch:{ all -> 0x0021 }\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n if (r1 == 0) goto L_0x001d;\n L_0x001a:\n r5.onNext(r2);\t Catch:{ Throwable -> 0x0024 }\n L_0x001d:\n r5.onCompleted();\n goto L_0x0009;\n L_0x0021:\n r3 = move-exception;\n monitor-exit(r4);\t Catch:{ all -> 0x0021 }\n throw r3;\n L_0x0024:\n r0 = move-exception;\n rx.exceptions.Exceptions.throwOrReport(r0, r6, r2);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.operators.OperatorDebounceWithTime.DebounceState.emitAndComplete(rx.Subscriber, rx.Subscriber):void\");\n }", "private void test() {\n Observable<String> observable = Observable.create(new ObservableOnSubscribe<String>() {\n\n @Override\n public void subscribe(ObservableEmitter<String> e) throws Exception {\n e.onNext(\"hello\");\n e.onNext(\"RXJAVA\");\n e.onComplete();\n }\n }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());\n\n Observer<String> observer = new Observer<String>() {\n @Override\n public void onSubscribe(Disposable d) {\n Log.d(TAG, \"onSubscribe\");\n }\n\n @Override\n public void onNext(String s) {\n Log.d(TAG, \"onNext:\" + s);\n }\n\n @Override\n public void onError(Throwable e) {\n Log.d(TAG, \"onError\");\n }\n\n @Override\n public void onComplete() {\n Log.d(TAG, \"onComplete\");\n }\n };\n observable.subscribe(observer);\n }", "public static void main(String[] args) {\n System.out.println(\"Example of Observable.just()****\");\n Observable<String> justObs = Observable.just(\"one\", \"two\", \"three\", \"four\");\n justObs.subscribe(v -> System.out.println(\"Received:\" + v), e -> System.out.println(e), () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nExample of Observable.create()****\");\n Observable<String> createdObs = Observable.create(o -> {\n o.onNext(\"Hello\");\n o.onCompleted();\n });\n createdObs.subscribe(System.out::println, e -> System.out.println(e), () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nConverting FutureTask into Observable****\");\n FutureTask<Integer> task = new FutureTask<>(() -> {\n Thread.sleep(3000);\n return 28;\n });\n new Thread(task).start();\n\n Observable<Integer> futureObs = Observable.from(task);\n Subscription subscription = futureObs.subscribe(v -> System.out.println(\"Received :\" + v), e -> System.out.println(\"Error :\" + e),\n () -> System.out.println(\"Completed\"));\n\n System.out.println(\"\\nConverting Integer array into Observable****\");\n Integer[] in = new Integer[] { 1, 2, 3 };\n\n Observable<Integer> integerObs = Observable.from(in);\n Subscription arraySub = integerObs.subscribe(v -> System.out.println(\"Received :\" + v), e -> System.out.println(\"Error :\" + e),\n () -> System.out.println(\"Completed\"));\n }", "public static void test019()\r\n {\r\n System.out.println(\"RxJavaTest04::test019\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n ExecutorService poolB = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-B-%d\"));\r\n Scheduler schedulerB = Schedulers.from(poolB);\r\n ExecutorService poolC = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-C-%d\"));\r\n Scheduler schedulerC = Schedulers.from(poolC);\r\n\r\n log(\"Starting\");\r\n Observable<String> obs = Observable.create(subscriber -> {\r\n log(\"Subscribed\");\r\n subscriber.onNext(\"A\");\r\n subscriber.onNext(\"B\");\r\n subscriber.onNext(\"C\");\r\n subscriber.onNext(\"D\");\r\n subscriber.onComplete();\r\n });\r\n log(\"Created\");\r\n obs\r\n .subscribeOn(schedulerA)\r\n .flatMap(record -> myStore(record).subscribeOn(schedulerB))\r\n .observeOn(schedulerC)\r\n .subscribe(\r\n x -> log(\"Got: \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n log(\"Exiting\");\r\n \r\n myWait(5000);\r\n poolA.shutdown();\r\n poolB.shutdown();\r\n poolC.shutdown();\r\n }", "public static void m5820b(java.lang.String r3, java.lang.String r4, java.lang.String r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = new com.crashlytics.android.answers.StartCheckoutEvent;\n r0.<init>();\n r1 = java.util.Locale.getDefault();\n r1 = java.util.Currency.getInstance(r1);\n r0.putCurrency(r1);\n r1 = 1;\n r0.putItemCount(r1);\n r1 = java.lang.Long.parseLong(r3);\t Catch:{ Exception -> 0x001f }\n r3 = java.math.BigDecimal.valueOf(r1);\t Catch:{ Exception -> 0x001f }\n r0.putTotalPrice(r3);\t Catch:{ Exception -> 0x001f }\n L_0x001f:\n r3 = \"type\";\n r0.putCustomAttribute(r3, r4);\n r3 = \"cta\";\n r0.putCustomAttribute(r3, r5);\n r3 = com.crashlytics.android.answers.Answers.getInstance();\n r3.logStartCheckout(r0);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.b(java.lang.String, java.lang.String, java.lang.String):void\");\n }", "public static void main(String[] args) throws Exception {\n\t\tFlowable<String> obs4 = Flowable.just(\"un\", \"deux\", \"trois\", \"quatre\", \"sank\", \"six\", \"sept\", \"huit\", \"neuf\", \"deese\");\n//\t\tobs4.map(mapper -> {\n//\t\t\tif (\"deux\".equals(mapper))\n//\t\t\t\tThread.sleep(2000);\n//\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t})\t\n//\t\t.subscribe(System.out::println);\n\t\t\n\t\tObserver<String> observer1 = new Observer<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"Completed...\");\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\targ0.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onSubscribe(Disposable arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"on next -- \"+arg0);\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\t\tList<String> list1 = Arrays.asList(\"un\",\"deux\",\"trois\",\"quatre\",\"sank\");\n\t\t\n\t\tObservable obs5 = Observable.fromIterable(list1);\n\t\t\n\t\t//obs5.subscribe(observer1);\n\t\t\n\t\t//Flowable.range(3, 10).subscribe(System.out::println);\n\t\t\n\t\tnew Thread(\n\t\t()->{\n\t\t\tobs4\n\t\t\t.map(mapper ->{\n\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n\t\t\t\t\tThread.sleep(2000);\n\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n\t\t\t})\n\t\t\t.subscribe(System.out::println);\n\t\t\t\n\t\t}).start();\n\t\t\n//\t\tnew Thread() {\n//\t\t\tpublic void run() {\n//\t\t\t\tobs4\n//\t\t\t\t\t.map(mapper ->{\n//\t\t\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n//\t\t\t\t\t\t\tThread.sleep(2000);\n//\t\t\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t\t\t\t})\n//\t\t\t\t\t.subscribe(System.out::println);\n//\t\t\t}\n//\t\t}.start();\n\t\t\n//\t\tExecutor exe = Executors.newCachedThreadPool();\n//\t\t\n//\t\texe.execute(()->{\n//\t\t\t\n//\t\t\tobs4\n//\t\t\t.map(mapper ->{\n//\t\t\t\tif (\"deux\".equals(mapper) || \"quatre\".equals(mapper))\n//\t\t\t\t\tThread.sleep(2000);\n//\t\t\t\treturn mapper+\" -- \"+Thread.currentThread().getName();\n//\t\t\t})\n//\t\t\t.subscribe(System.out::println);\n\t\t\t\n//\t\t\tobs4.subscribe();\n//\t\t\tFlowable.zip(obs4, Flowable.interval(2, TimeUnit.SECONDS),(k,v)->k)\n//\t\t\t.subscribe((data)->{\n//\t\t\t\tSystem.out.println(\" \"+data+\" -- \"+Thread.currentThread().getName());\n//\t\t\t});\n//\t\t\tFlowable.interval(1, TimeUnit.SECONDS)\n//\t\t\t.map(mapper -> {\n//\t\t\t\tif (mapper == 3)\n//\t\t\t\t\tthrow new Exception(\" Time is Over !!! \");\n//\t\t\t\treturn mapper;\n//\t\t\t})\n//\t\t\t.subscribe((data)->{\n//\t\t\t\tSystem.out.println(data +\" -- \"+Thread.currentThread().getName());\n//\t\t\t},(e)->{\n//\t\t\t\te.printStackTrace();\n//\t\t\t});\n\t\t\t\n\t\t//});\n\t\t\n//\t\t//Thread.sleep(5000);\t\n//\t\tFlowable<String> flw1 = Flowable.just(\"un\",\"deux\",\"trois\",\"quatre\",\"sank\",\"six\",\"sept\");\n//\t\tflw1\n//\t\t//.subscribeOn(Schedulers.from(Executors.newFixedThreadPool(4)))\n//\t\t.map(mapper ->{\n//\t\t\tif (\"deux\".equals(mapper))\n//\t\t\t\tThread.sleep(1000);\n//\t\t\tif (\"quatre\".equals(mapper))\n//\t\t\t\tThread.sleep(500);\n//\t\t\treturn mapper +\" -- \"+Thread.currentThread().getName();\n//\t\t})\n//\t\t.subscribe(System.out::println);\n//\t\t\n//\t\tThread.sleep(2000);\n\t}", "public static void stackTrace() {\n Observable<String> myObservable = Observable.fromCallable(() -> {\n Object value = null;\n return value.toString();\n });\n myObservable.subscribe(item -> System.out.println(\"output = \" + item));\n }", "public static void main(String[] args) {\n\t\tObservable<String> mObservable = Observable.create(new Observable.OnSubscribe<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(Subscriber<? super String> subscriber) {\n\t\t\t\tsubscriber.onNext(\"hello world\");\n\t\t\t\tsubscriber.onCompleted();\n\t\t\t}\n\t\t}) ;\n\n\t\tSubscriber<String> mSubscriber = new Subscriber<String>() {\n\t\t\t@Override\n\t\t\tpublic void onCompleted() {}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable e) {}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String s) {System.out.println(s);}\n\t\t} ;\n\n\t\tmObservable.subscribe(mSubscriber);\n\t\t//1.2 abbreviate\n\t\t// TODO: 7/2/15 myObservable.subscribe(onNextAction, onErrorAction, onCompleteAction);\n\t\tObservable<String> mObservable2 = Observable.just(\"Hello RxJava\") ;\n\t\tAction1<String> onNextAction = new Action1<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(String s) {\n\t\t\t\tSystem.out.println(s) ;\n\t\t\t}\n\t\t} ;\n\t\tmObservable2.subscribe(onNextAction);\n\t\t//1.3 simpler code\n\t\tObservable.just(\"simpler code\").subscribe(new Action1<String>() {\n\t\t\t@Override\n\t\t\tpublic void call(String s) {\n\t\t\t\tSystem.out.println(s) ;\n\t\t\t}\n\t\t});\n\t\t//1.4. Java8 lambda\n\t\tObservable.just(\"Hello Rx and lambda\").subscribe(s -> System.out.println(s)) ;\n\t\t//2. transformation\n\t\tObservable.just(\"Hello trans\").subscribe(s -> System.out.println(s+\"formation\")) ;\n\t\t//2.1 map()\n\t\tObservable.just(\"Hello trans\").map(new Func1<String, String>() {\n\t\t\t@Override\n\t\t\tpublic String call(String s) {\n\t\t\t\treturn s+\"formation\";\n\t\t\t}\n\t\t}).subscribe(s -> System.out.println(s));\n//\t\t}).subscribe(System.out::println);\n\t\t//2.2 trans + lambda\n\t\tObservable.just(\"Hello trans\").map(s -> s+\"fromation\").subscribe(s -> System.out.println(s));\n\t\t//or\n\t\tObservable.just(\"Hello trans\").map(s -> s+\"fromation\").subscribe(System.out::println);\n\t\t//2.3 trans String to Integer\n\t\tObservable.just(\"Hello trans!\").map(new Func1<String, Integer>() {\n\t\t\t@Override\n\t\t\tpublic Integer call(String s) {\n\t\t\t\treturn s.hashCode();\n\t\t\t}\n\t\t}).subscribe(i-> System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(s -> s.hashCode())\n\t\t\t\t.subscribe(i -> System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(String::hashCode)\n\t\t\t\t.subscribe(i->System.out.println(Integer.toString(i)));\n\t\tObservable.just(\"Hello trans!\").map(String::hashCode).map(i->Integer.toString(i))\n\t\t\t\t.subscribe(System.out::println);\n\t}", "private static void m13385d() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = java.lang.System.currentTimeMillis();\t Catch:{ Exception -> 0x0024 }\n r2 = java.util.concurrent.TimeUnit.DAYS;\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r2 = r2.toMillis(r3);\t Catch:{ Exception -> 0x0024 }\n r4 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = r0 - r2;\t Catch:{ Exception -> 0x0024 }\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x0024 }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x0024 }\n r2 = \"timestamp < ?\";\t Catch:{ Exception -> 0x0024 }\n r3 = 1;\t Catch:{ Exception -> 0x0024 }\n r3 = new java.lang.String[r3];\t Catch:{ Exception -> 0x0024 }\n r6 = 0;\t Catch:{ Exception -> 0x0024 }\n r4 = java.lang.String.valueOf(r4);\t Catch:{ Exception -> 0x0024 }\n r3[r6] = r4;\t Catch:{ Exception -> 0x0024 }\n r0.delete(r1, r2, r3);\t Catch:{ Exception -> 0x0024 }\n L_0x0024:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.d():void\");\n }", "public interface RxSchedulerProvider {\n\n\n Scheduler backgroundThread();\n\n Scheduler io();\n\n Scheduler compute();\n\n Scheduler androidThread();\n\n Scheduler internet();\n\n}", "public void emit(int r4, rx.Subscriber<T> r5, rx.Subscriber<?> r6) {\n /*\n r3 = this;\n monitor-enter(r3);\n r2 = r3.emitting;\t Catch:{ all -> 0x002b }\n if (r2 != 0) goto L_0x000d;\n L_0x0005:\n r2 = r3.hasValue;\t Catch:{ all -> 0x002b }\n if (r2 == 0) goto L_0x000d;\n L_0x0009:\n r2 = r3.index;\t Catch:{ all -> 0x002b }\n if (r4 == r2) goto L_0x000f;\n L_0x000d:\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n L_0x000e:\n return;\n L_0x000f:\n r1 = r3.value;\t Catch:{ all -> 0x002b }\n r2 = 0;\n r3.value = r2;\t Catch:{ all -> 0x002b }\n r2 = 0;\n r3.hasValue = r2;\t Catch:{ all -> 0x002b }\n r2 = 1;\n r3.emitting = r2;\t Catch:{ all -> 0x002b }\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n r5.onNext(r1);\t Catch:{ Throwable -> 0x002e }\n monitor-enter(r3);\n r2 = r3.terminate;\t Catch:{ all -> 0x0028 }\n if (r2 != 0) goto L_0x0033;\n L_0x0023:\n r2 = 0;\n r3.emitting = r2;\t Catch:{ all -> 0x0028 }\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n goto L_0x000e;\n L_0x0028:\n r2 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n throw r2;\n L_0x002b:\n r2 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x002b }\n throw r2;\n L_0x002e:\n r0 = move-exception;\n rx.exceptions.Exceptions.throwOrReport(r0, r6, r1);\n goto L_0x000e;\n L_0x0033:\n monitor-exit(r3);\t Catch:{ all -> 0x0028 }\n r5.onCompleted();\n goto L_0x000e;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.internal.operators.OperatorDebounceWithTime.DebounceState.emit(int, rx.Subscriber, rx.Subscriber):void\");\n }", "@androidx.annotation.WorkerThread\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final boolean zzc(com.google.firebase.iid.FirebaseInstanceId r5) {\n /*\n r4 = this;\n L_0x0000:\n monitor-enter(r4)\n java.lang.String r0 = r4.zzar() // Catch:{ all -> 0x0042 }\n r1 = 1\n if (r0 != 0) goto L_0x0017\n boolean r5 = com.google.firebase.iid.FirebaseInstanceId.zzm() // Catch:{ all -> 0x0042 }\n if (r5 == 0) goto L_0x0015\n java.lang.String r5 = \"FirebaseInstanceId\"\n java.lang.String r0 = \"topic sync succeeded\"\n android.util.Log.d(r5, r0) // Catch:{ all -> 0x0042 }\n L_0x0015:\n monitor-exit(r4) // Catch:{ all -> 0x0042 }\n return r1\n L_0x0017:\n monitor-exit(r4) // Catch:{ all -> 0x0042 }\n boolean r2 = zza(r5, r0)\n if (r2 != 0) goto L_0x0020\n r5 = 0\n return r5\n L_0x0020:\n monitor-enter(r4)\n java.util.Map<java.lang.Integer, com.google.android.gms.tasks.TaskCompletionSource<java.lang.Void>> r2 = r4.zzdx // Catch:{ all -> 0x003f }\n int r3 = r4.zzdw // Catch:{ all -> 0x003f }\n java.lang.Integer r3 = java.lang.Integer.valueOf(r3) // Catch:{ all -> 0x003f }\n java.lang.Object r2 = r2.remove(r3) // Catch:{ all -> 0x003f }\n com.google.android.gms.tasks.TaskCompletionSource r2 = (com.google.android.gms.tasks.TaskCompletionSource) r2 // Catch:{ all -> 0x003f }\n r4.zzn(r0) // Catch:{ all -> 0x003f }\n int r0 = r4.zzdw // Catch:{ all -> 0x003f }\n int r0 = r0 + r1\n r4.zzdw = r0 // Catch:{ all -> 0x003f }\n monitor-exit(r4) // Catch:{ all -> 0x003f }\n if (r2 == 0) goto L_0x0000\n r0 = 0\n r2.setResult(r0)\n goto L_0x0000\n L_0x003f:\n r5 = move-exception\n monitor-exit(r4) // Catch:{ all -> 0x003f }\n throw r5\n L_0x0042:\n r5 = move-exception\n monitor-exit(r4) // Catch:{ all -> 0x0042 }\n throw r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.firebase.iid.zzba.zzc(com.google.firebase.iid.FirebaseInstanceId):boolean\");\n }", "private Observable<R> buildUseCaseObservableWithSchedulers(P params) {\n return buildUseCaseObservable(params)\n .subscribeOn(threadExecutorScheduler)\n .observeOn(postExecutionThreadScheduler);\n }", "public static void test018()\r\n {\r\n System.out.println(\"RxJavaTest04::test018\");\r\n log(\"Starting\");\r\n final Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n ExecutorService poolB = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-B-%d\"));\r\n Scheduler schedulerB = Schedulers.from(poolB);\r\n\r\n obs\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '1')\r\n .observeOn(schedulerB)\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '2')\r\n .doOnNext(RxJavaTest04::log)\r\n .subscribeOn(schedulerA)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n myWait(2000);\r\n poolA.shutdown();\r\n poolB.shutdown();\r\n }", "@Override\n public Comparator<Object> thenComparingLong(final ToLongFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "@Override\n public <U extends Comparable<? super U>> Comparator<Object> thenComparing(final Function<?, ? extends U> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1793)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1790)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper.getLowerBound(MetadataHelper.java:1240)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2278)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2256)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2233)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2246)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.adapt(MetadataHelper.java:1312)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2708)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2692)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visitParameterizedType(DefaultTypeVisitor.java:65)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.asSubType(MetadataHelper.java:720)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:926)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:770)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:766)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2515)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "private void m76769g() {\n C1592h.m7855a((Callable<TResult>) new C23441a<TResult>(this), C1592h.f5958b);\n }", "private final Single<TabSource> m39398b() {\n Single<TabSource> d = RxJavaInteropExtKt.toV1Observable(this.f31574b.observe(), BackpressureStrategy.LATEST).c(1).a().d(new C13217b(this));\n C2668g.a(d, \"matchSubscreensTracker\\n …ubscreenToTabSource(it) }\");\n return d;\n }", "public static void test012()\r\n {\r\n System.out.println(\"RxJavaTest04::test012\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n log(\"Starting\");\r\n Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n obs\r\n .subscribeOn(schedulerA)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n log(\"After subscribe\");\r\n myWait(2000);\r\n log(\"Shutting down\");\r\n poolA.shutdown();\r\n }", "public static void test005()\r\n {\r\n System.out.println(\"RxJavaTest04::test005\");\r\n Observable<String> flight = myRxLookupFlight(\"Amsterdam\");\r\n Observable<String> passenger = myRxFindPassenger(1001);\r\n Observable<String> ticket =\r\n flight.zipWith(passenger, (f, p) -> myBookTicket(f, p));\r\n ticket.subscribe(RxJavaTest04::mySendEmail);\r\n }", "public interface RxSchedulers {\n\n Scheduler runOnBackground();\n\n Scheduler io();\n\n Scheduler compute();\n\n Scheduler androidThread();\n\n Scheduler internet();\n}", "public final boolean mo3330c(android.content.Intent r3) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = \"com.google.firebase.messaging.NOTIFICATION_OPEN\";\n r1 = r3.getAction();\n r0 = r0.equals(r1);\n if (r0 == 0) goto L_0x002c;\n L_0x000c:\n r0 = \"pending_intent\";\n r0 = r3.getParcelableExtra(r0);\n r0 = (android.app.PendingIntent) r0;\n if (r0 == 0) goto L_0x0021;\n L_0x0016:\n r0.send();\t Catch:{ CanceledException -> 0x001a }\n goto L_0x0021;\n L_0x001a:\n r0 = \"FirebaseMessaging\";\n r1 = \"Notification pending intent canceled\";\n android.util.Log.e(r0, r1);\n L_0x0021:\n r0 = com.google.firebase.messaging.C2609b.m12812e(r3);\n if (r0 == 0) goto L_0x002a;\n L_0x0027:\n com.google.firebase.messaging.C2609b.m12809b(r3);\n L_0x002a:\n r3 = 1;\n return r3;\n L_0x002c:\n r3 = 0;\n return r3;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.firebase.messaging.FirebaseMessagingService.c(android.content.Intent):boolean\");\n }", "public <T> Observable.Transformer<T, T> applySchedulers() {\n return observable -> observable.subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread());\n }", "@Override\n public Comparator<Object> thenComparing(final Comparator<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }", "@Override // kotlinx.coroutines.flow.FlowCollector\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public java.lang.Object emit(java.lang.Object r9, kotlin.coroutines.Continuation r10) {\n /*\n r8 = this;\n boolean r0 = r10 instanceof kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1\n if (r0 == 0) goto L_0x0013\n r0 = r10\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r0\n int r1 = r0.label\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r3 = r1 & r2\n if (r3 == 0) goto L_0x0013\n int r1 = r1 - r2\n r0.label = r1\n goto L_0x0018\n L_0x0013:\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = new kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1\n r0.<init>(r10)\n L_0x0018:\n java.lang.Object r10 = r0.result\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.label\n r3 = 2\n r4 = 1\n if (r2 == 0) goto L_0x005e\n if (r2 == r4) goto L_0x0044\n if (r2 != r3) goto L_0x003c\n java.lang.Object r8 = r0.L$6\n kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8\n java.lang.Object r8 = r0.L$4\n kotlin.coroutines.Continuation r8 = (kotlin.coroutines.Continuation) r8\n java.lang.Object r8 = r0.L$2\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r8\n java.lang.Object r8 = r0.L$0\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r8\n kotlin.ResultKt.throwOnFailure(r10)\n goto L_0x009b\n L_0x003c:\n java.lang.IllegalStateException r8 = new java.lang.IllegalStateException\n java.lang.String r9 = \"call to 'resume' before 'invoke' with coroutine\"\n r8.<init>(r9)\n throw r8\n L_0x0044:\n java.lang.Object r8 = r0.L$6\n kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8\n java.lang.Object r9 = r0.L$5\n java.lang.Object r2 = r0.L$4\n kotlin.coroutines.Continuation r2 = (kotlin.coroutines.Continuation) r2\n java.lang.Object r4 = r0.L$3\n java.lang.Object r5 = r0.L$2\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r5 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r5\n java.lang.Object r6 = r0.L$1\n java.lang.Object r7 = r0.L$0\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r7 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r7\n kotlin.ResultKt.throwOnFailure(r10)\n goto L_0x0084\n L_0x005e:\n kotlin.ResultKt.throwOnFailure(r10)\n kotlinx.coroutines.flow.FlowCollector r10 = kotlinx.coroutines.flow.FlowCollector.this\n kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1 r2 = r2\n kotlin.jvm.functions.Function2 r2 = r2.$action$inlined\n r0.L$0 = r8\n r0.L$1 = r9\n r0.L$2 = r0\n r0.L$3 = r9\n r0.L$4 = r0\n r0.L$5 = r9\n r0.L$6 = r10\n r0.label = r4\n java.lang.Object r2 = r2.invoke(r9, r0)\n if (r2 != r1) goto L_0x007e\n return r1\n L_0x007e:\n r7 = r8\n r4 = r9\n r6 = r4\n r8 = r10\n r2 = r0\n r5 = r2\n L_0x0084:\n r0.L$0 = r7\n r0.L$1 = r6\n r0.L$2 = r5\n r0.L$3 = r4\n r0.L$4 = r2\n r0.L$5 = r9\n r0.L$6 = r8\n r0.label = r3\n java.lang.Object r10 = r8.emit(r9, r0)\n if (r10 != r1) goto L_0x009b\n return r1\n L_0x009b:\n return r10\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object\");\n }", "public static void test013()\r\n {\r\n System.out.println(\"RxJavaTest04::test013\");\r\n log(\"Starting\");\r\n final Observable<String> obs = mySimple();\r\n log(\"Created\");\r\n\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n\r\n obs\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '1')\r\n .doOnNext(RxJavaTest04::log)\r\n .map(x -> x + '2')\r\n .subscribeOn(schedulerA)\r\n .doOnNext(RxJavaTest04::log)\r\n .subscribe(\r\n x -> log(\"Got \" + x),\r\n Throwable::printStackTrace,\r\n () -> log(\"Completed\")\r\n );\r\n poolA.shutdown();\r\n }", "public static void test015()\r\n {\r\n System.out.println(\"RxJavaTest04::test015\");\r\n ExecutorService poolA = Executors.newFixedThreadPool(10, newThreadFactory(\"Sched-A-%d\"));\r\n Scheduler schedulerA = Schedulers.from(poolA);\r\n RxGroceries rxGroceries = new RxGroceries();\r\n\r\n Maybe<BigDecimal> totalPrice = Observable\r\n .fromIterable(Arrays.asList(\"bread\", \"butter\", \"milk\", \"tomato\", \"cheese\"))\r\n .subscribeOn(schedulerA)\r\n .flatMap(prod -> rxGroceries.purchase(prod, 1))\r\n .reduce(BigDecimal::add);\r\n totalPrice\r\n .subscribe(System.out::println);\r\n poolA.shutdown();\r\n }", "@Test\n public void testDefer() throws InterruptedException {\n Observable<LocalTime> localTimeObservable =\n Observable.defer(\n () -> Observable\n .just(LocalTime.now()))\n .repeat(3);\n localTimeObservable.subscribe(System.out::println);\n Thread.sleep(3000);\n System.out.println(\"Next Subscriber\");\n localTimeObservable.subscribe(System.out::println);\n }", "public static void main(String[] args) {\n assert(sum((a -> a + 4), 5) == 9); // a is inferred to be an int\n assert(sum((int a) -> a + 5, 9) == 14); //a is explicit\n\n //Some other lambdas with one method interfaces\n Runnable r = () -> System.out.println(\"Run in a separate thread\");\n ActionListener al = (evt) -> evt.getActionCommand();\n\n //Multistatement lambda\n SampleInterface si2 = a -> {\n int total = 3 + 4;\n return total + 19;\n };\n }", "public interface FcmReceiverData {\n /**\n * @return return the new instance observable after applying doOnNext operator.\n */\n Observable<Message> onNotification(Observable<Message> oMessage);\n}", "@Test\n public void async_2() throws InterruptedException {\n Func1<Integer, Observable<String>> wsKald = param -> Observable.<String>create(s -> {\n s.onStart();\n s.onNext(\"called with \" + param);\n s.onCompleted();\n }).subscribeOn(Schedulers.io());\n\n Func1<Long, Observable<Integer>> multi = param -> Observable.<Integer>create(s -> {\n s.onStart();\n IntStream.range(1, param.intValue()).forEach(s::onNext);\n s.onCompleted();\n }).subscribeOn(Schedulers.io());\n\n // asynkron tæller, hvert ½ sekund\n Observable<Long> ticker = Observable.interval(500, TimeUnit.MILLISECONDS);\n\n ticker.take(10)\n .flatMap(multi)\n .flatMap(wsKald)\n .toBlocking()\n .subscribe(log::info);\n }", "public final void update(java.util.Observable r3, java.lang.Object r4) {\n /*\n r2 = this;\n com.tapjoy.internal.fs$a r3 = com.tapjoy.internal.C5096fs.f13949b\n r3.deleteObserver(r2)\n java.lang.Boolean r3 = java.lang.Boolean.TRUE\n boolean r3 = r3.equals(r4)\n java.lang.Boolean r3 = java.lang.Boolean.valueOf(r3)\n boolean r3 = r3.booleanValue()\n if (r3 != 0) goto L_0x0030\n com.tapjoy.internal.gb r3 = com.tapjoy.internal.C5108gb.this\n com.tapjoy.internal.gb$a r4 = r3.f13980e\n if (r4 == 0) goto L_0x0030\n android.content.Context r4 = r4.f13987a\n if (r4 == 0) goto L_0x0030\n com.tapjoy.internal.gb$b r4 = new com.tapjoy.internal.gb$b\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this\n r1 = 0\n r4.<init>(r0, r1)\n r3.f13978c = r4\n com.tapjoy.internal.gb r3 = com.tapjoy.internal.C5108gb.this\n com.tapjoy.internal.gb$b r3 = r3.f13978c\n r3.mo31467e()\n L_0x0030:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tapjoy.internal.C5108gb.C51091.update(java.util.Observable, java.lang.Object):void\");\n }", "private void test1() {\n Observable observable = Observable.create(new ObservableOnSubscribe<QuoteBean>() {\n @Override\n public void subscribe(ObservableEmitter<QuoteBean> e) throws Exception {\n e.onNext(Request.stringRequest(url, com.android.volley.Request.Method.GET, HomeActivity.class.getSimpleName()));\n }\n }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());\n\n Observer<QuoteBean> observer = new Observer<QuoteBean>() {\n @Override\n public void onSubscribe(Disposable d) {\n Log.d(TAG, \"test1 onSubscribe\");\n }\n\n @Override\n public void onNext(QuoteBean s) {\n Log.d(TAG, \"onNext:\" + s.toString());\n }\n\n @Override\n public void onError(Throwable e) {\n Log.d(TAG, \"onError\");\n }\n\n @Override\n public void onComplete() {\n Log.d(TAG, \"onComplete\");\n }\n };\n observable.subscribe(observer);\n }", "public static void m5812a(java.lang.String r0, java.lang.String r1, java.lang.String r2) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r2 = new com.crashlytics.android.answers.AddToCartEvent;\n r2.<init>();\n r2.putItemType(r0);\n r0 = java.lang.Long.parseLong(r1);\t Catch:{ Exception -> 0x0013 }\n r0 = java.math.BigDecimal.valueOf(r0);\t Catch:{ Exception -> 0x0013 }\n r2.putItemPrice(r0);\t Catch:{ Exception -> 0x0013 }\n L_0x0013:\n r0 = java.util.Locale.getDefault();\n r0 = java.util.Currency.getInstance(r0);\n r2.putCurrency(r0);\n r0 = com.crashlytics.android.answers.Answers.getInstance();\n r0.logAddToCart(r2);\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.cuvora.carinfo.helpers.d.a(java.lang.String, java.lang.String, java.lang.String):void\");\n }", "public static void main(String... args) {\n\n\t\tObservable<String[]> testObs = Observable.create(new Observable.OnSubscribe<String[]>() {\n\t\t\tpublic void call(Subscriber<? super String[]> sub) {\n\t\t\t\tString[] aString = new String[] { \"aaa\", \"bbb\", \"ccc\" };\n\t\t\t\tsub.onNext(aString);\n\t\t\t\tsub.onCompleted();\n\t\t\t}\n\t\t});\n\t\tObservable<String> testOb = Observable.just(\"abc just\");\n\t\t Subscriber<String> mySub = new Subscriber<String>(){\n\t\t public void onNext(String s){\n\t\t System.out.println(\"Test finish : \" + s);\n\t\t }\n\t\t\n\t\t public void onCompleted() {\n\t\t // TODO Auto-generated method stub\n\t\t\n\t\t }\n\t\t\n\t\t public void onError(Throwable arg0) {\n\t\t // TODO Auto-generated method stub\n\t\t\n\t\t }\n\t\t };\n\n\t\ttestObs.subscribe(s -> System.out.println(\"lambda : \" + s[0]));\n\t\tString[] bString = new String[] { \"aa\", \"bb\", \"cc\" };\n\t\tint i = 0;\n\t\tfor (String s : bString) {\n\t\t\ti++;\n\t\t\tSystem.out.println(\"Loop \" + Integer.toString(i) + \" \" + s);\n\t\t}\n\n\t\toperaterTest();\n\t\toperaterTestStringToHash();\n\n\t\tRunnable r = () -> System.out.println(\"test runnable lambda\");\n\t\tr.run();\n\n\t\tComparator<String> c = (a, b) -> a.compareTo(b);\n\t\tSystem.out.println(Integer.toString(c.compare(\"AAA\", \"AAA\")));\n\n\t\tHello h = new Hello();\n\t\th.r.run();\n\t\th.r2.run();\n\n\t\tString message = \"Test effective final\";\n\n\t\tRunnable r3 = () -> System.out.println(message);\n\n\t\tr3.run();\n\n\t\tStringBuilder messageB = new StringBuilder(\"aa\");\n\t\tmessageB.append(\"aa\");\n\t\tRunnable r4 = () -> System.out.println(messageB);\n\t\tr4.run();\n\t\tmessageB.append(\"AA\");\n\n\t\tPerson[] people = new Person[] { new Person(\"ted\", \"new\", 41), new Person(\"wayne\", \"wang\", 18),\n\t\t\t\tnew Person(\"adm\", \"zcho\", 22) };\n\t\tArrays.sort(people, Person.compareFirstName);\n\t\tArrays.sort(people, Person::compareLastName);\n\t\tfor( Person p : people)\n\t\t\tSystem.out.println(p);\n\t\t\n\t\tNamedCache<Long,String> cache = CacheFactory.getCache(\"st\");\n\t\tcache.put(3L, \"3\");\n\t\tcache.put(2L, \"2\");\n\t\tcache.put(1L, \"1\");\n\t\tcache.put(4L, \"4\");\n\t\tcache.put(5L, \"5\");\n\t\tRxNamedCache<Long,String> rxcache = RxNamedCache.rx(cache);\n//\t\trxcache.values().buffer(2).subscribe(productList -> System.out.println(\"List :\" + productList));\n\t\trxcache.values().subscribe(product -> System.out.println(\"rxCache : \" + product));\n\t\t\n\t\tObservableMapListener<Long,String> listener = ObservableMapListener.create();\n\t\tlistener.filter(evt -> evt.getId() == MapEvent.ENTRY_INSERTED).map(MapEvent::getNewValue)\n\t\t.subscribe(new Subscriber<String>(){\n\t\t\tpublic void onNext(String s){\n\t\t\t\tSystem.out.println(\"xxx\" + s);\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onCompleted() {\n\t\t\t\tSystem.out.println(\"completed\");\n\t\t\t\t\n\t\t\t}\n\t\t\tpublic void onError(Throwable e){\n\t\t\t\tSystem.out.println(\"aaaaahhhh\");\n\t\t\t}\n\t\t\t\n\t\t});\n//\t\tlistener.filter(evt -> evt.getId() == MapEvent.ENTRY_INSERTED).map(MapEvent::getNewValue).buffer(2,TimeUnit.SECONDS)\n//\t\t.subscribe(ppp -> System.out.println(\"Trades placed in the last 10 seconds: \" + ppp));\n\t\tcache.addMapListener(listener);\n\t\tcache.remove(3L);\n\t\t\n\t\tcache.put(6L, \"test6\");\n\t\tcache.put(7L, \"test7\");\n\t\ttry {\n\t\t\tThread.sleep(200);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface Transformer<T, R> extends Function<Observable<T>, Publisher<? extends R>> {\n \n }", "public static void error() {\n Observable<String> myObservable = Observable.error(\n () -> new Exception(\"Exception from error observable\"));\n myObservable.subscribe(genericObserver1);\n }", "private final Completable m55605a() {\n this.f46004d.i(this.f46005e.a().getLanguage());\n C3956a d = this.f46006f.a().d(new C16271f(this));\n C2668g.a(d, \"tokenProvider.token\\n …null).toV2Completable() }\");\n return RxJavaInteropExtKt.toV1Completable(d);\n }", "public final Completable mo129846b(Scheduler yVar) {\n ObjectHelper.m147684a((Object) yVar, \"scheduler is null\");\n return RxJavaPlugins.m148466a(new CompletableSubscribeOn(this, yVar));\n }", "void test() {\n @Source(CAMERA) @Sink(INTERNET) byte @Source(CAMERA) @Sink(INTERNET) [] invariant = notCompleted;\n\n // This line used to issue an error but was fixed when transitioning to better type variables\n // check version history for more information if this line is failing\n flowCompleted = notCompleted;\n\n @Source(CAMERA) @Sink({FILESYSTEM, INTERNET}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] a = null;\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] b = a;\n\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] aCorrect = null;\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] bCorrect = aCorrect;\n }", "public void mo42595b() {\n if (getAndIncrement() == 0) {\n Observer<? super R> a = this.f41312b;\n int missing = 1;\n while (!this.f41318h) {\n if (this.f41317g) {\n boolean empty = this.f41320j.get() == null;\n if (this.f41315e) {\n if (empty) {\n Throwable ex = (Throwable) this.f41316f.get();\n if (ex != null) {\n a.onError(ex);\n } else {\n a.onComplete();\n }\n return;\n }\n } else if (((Throwable) this.f41316f.get()) != null) {\n a.onError(this.f41316f.mo42732a());\n return;\n } else if (empty) {\n a.onComplete();\n return;\n }\n }\n SwitchMapInnerObserver<T, R> inner = (C13573a) this.f41320j.get();\n if (inner != null) {\n SpscLinkedArrayQueue<R> q = inner.f41309c;\n if (inner.f41310d) {\n boolean empty2 = q.isEmpty();\n if (this.f41315e) {\n if (empty2) {\n this.f41320j.compareAndSet(inner, null);\n }\n } else if (((Throwable) this.f41316f.get()) != null) {\n a.onError(this.f41316f.mo42732a());\n return;\n } else if (empty2) {\n this.f41320j.compareAndSet(inner, null);\n }\n }\n boolean retry = false;\n while (!this.f41318h) {\n if (inner != this.f41320j.get()) {\n retry = true;\n } else if (this.f41315e || ((Throwable) this.f41316f.get()) == null) {\n boolean d = inner.f41310d;\n R v = q.poll();\n boolean empty3 = v == null;\n if (d && empty3) {\n this.f41320j.compareAndSet(inner, null);\n retry = true;\n } else if (!empty3) {\n a.onNext(v);\n }\n } else {\n a.onError(this.f41316f.mo42732a());\n return;\n }\n if (retry) {\n continue;\n }\n }\n return;\n }\n missing = addAndGet(-missing);\n if (missing == 0) {\n return;\n }\n }\n }\n }", "public static void m54942a() {\n boolean b = LaunchAdPreferenceHelper.m122154b();\n String d = C6969H.m41409d(\"G6786C225B831A62CD90F8058FDECCDC36486DB0E\");\n ADLOG.m53914a(d, \"预约用户,冷启动是否请求静默下载信息: \" + b);\n if (b) {\n ((AppointmentDownloadService) C16943dj.m83996a(AppointmentDownloadService.class)).mo63209a().observeOn(Schedulers.m148539d()).subscribe($$Lambda$z$SxVRsdmHDkgjmvKylDopkLyi8k8.INSTANCE, $$Lambda$z$XfWUsg15ReXA2um_53fn8zYOvqI.INSTANCE);\n }\n }", "public static void fromCallable() {\n Observable<List<String>> myObservable = Observable.fromCallable(() -> {\n System.out.println(\"call, thread = \" + Thread.currentThread().getName());\n return Utils.getData();\n });\n myObservable.subscribeOn(Schedulers.io())\n //.observeOn(AndroidSchedulers.mainThread()) For ANDROID use Android Schedulers.\n .observeOn(Schedulers.newThread()) // For ease of unit test, this is used\n .subscribe(consumerList);\n }", "JavaFxScheduler() {\n }", "public static int m22557b(java.lang.String r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = com.google.android.gms.internal.measurement.dr.m11788a(r1);\t Catch:{ zzyn -> 0x0005 }\n goto L_0x000c;\n L_0x0005:\n r0 = com.google.android.gms.internal.measurement.zzvo.f10281a;\n r1 = r1.getBytes(r0);\n r0 = r1.length;\n L_0x000c:\n r1 = m22576g(r0);\n r1 = r1 + r0;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzut.b(java.lang.String):int\");\n }", "private boolean m2248a(java.lang.String r3, com.onesignal.La.C0596a r4) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/318857719.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = 0;\n r1 = 1;\n java.lang.Float.parseFloat(r3);\t Catch:{ Throwable -> 0x0007 }\n r3 = 1;\n goto L_0x0008;\n L_0x0007:\n r3 = 0;\n L_0x0008:\n if (r3 != 0) goto L_0x0017;\n L_0x000a:\n r3 = com.onesignal.sa.C0650i.ERROR;\n r1 = \"Missing Google Project number!\\nPlease enter a Google Project number / Sender ID on under App Settings > Android > Configuration on the OneSignal dashboard.\";\n com.onesignal.sa.m1656a(r3, r1);\n r3 = 0;\n r1 = -6;\n r4.mo1392a(r3, r1);\n return r0;\n L_0x0017:\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.onesignal.Pa.a(java.lang.String, com.onesignal.La$a):boolean\");\n }", "public final Completable mo129839a(Scheduler yVar) {\n ObjectHelper.m147684a((Object) yVar, \"scheduler is null\");\n return RxJavaPlugins.m148466a(new CompletableObserveOn(this, yVar));\n }", "public void m65928b() {\n this.f56360b.a(this.f56359a.m56680g().b(Schedulers.io()).a(C19397a.a()).a(new C181681(this)));\n }", "static Scheduler m34966e(Callable<Scheduler> callable) {\n try {\n return (Scheduler) ObjectHelper.m35048a(callable.call(), \"Scheduler Callable result can't be null\");\n } catch (Throwable th) {\n throw C8162d.m35182a(th);\n }\n }", "public static void test006()\r\n {\r\n System.out.println(\"RxJavaTest04::test006\");\r\n Observable<String> flight = myRxLookupFlight(\"Amsterdam\").subscribeOn(Schedulers.io());\r\n Observable<String> passenger = myRxFindPassenger(1001).subscribeOn(Schedulers.io());\r\n Observable<String> ticket =\r\n flight.zipWith(passenger, (f, p) -> myBookTicket(f, p));\r\n System.out.println(\"Observables created, subscribing\");\r\n ticket.subscribe(RxJavaTest04::mySendEmail);\r\n myWait(10000);\r\n }", "@Override\n public void onSubscribe(Disposable d) {\n }", "private void m14047a(@javax.annotation.Nullable okhttp3.internal.p155a.C2918d.C2915a r1) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r0 = this;\n if (r1 == 0) goto L_0x0005;\n L_0x0002:\n r1.m14100c();\t Catch:{ IOException -> 0x0005 }\n L_0x0005:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.a(okhttp3.internal.a.d$a):void\");\n }", "public void m63703d() {\n Throwable th;\n ZipCoordinator zipCoordinator = this;\n if (getAndIncrement() == 0) {\n C17455a[] c17455aArr = zipCoordinator.f53839c;\n Observer observer = zipCoordinator.f53837a;\n Object obj = zipCoordinator.f53840d;\n boolean z = zipCoordinator.f53841e;\n int i = 1;\n while (true) {\n int length = c17455aArr.length;\n int i2 = 0;\n int i3 = 0;\n int i4 = 0;\n while (i2 < length) {\n int i5;\n C17455a c17455a = c17455aArr[i2];\n if (obj[i3] == null) {\n boolean z2 = c17455a.f53845c;\n Object poll = c17455a.f53844b.poll();\n boolean z3 = poll == null;\n i5 = i2;\n if (!m63700a(z2, z3, observer, z, c17455a)) {\n if (z3) {\n i4++;\n } else {\n obj[i3] = poll;\n }\n } else {\n return;\n }\n }\n C17455a c17455a2 = c17455a;\n i5 = i2;\n if (c17455a2.f53845c && !z) {\n th = c17455a2.f53846d;\n if (th != null) {\n m63698a();\n observer.onError(th);\n return;\n }\n }\n i3++;\n i2 = i5 + 1;\n }\n if (i4 != 0) {\n i = addAndGet(-i);\n if (i == 0) {\n return;\n }\n } else {\n try {\n observer.onNext(C15684a.m58895a(zipCoordinator.f53838b.apply(obj.clone()), \"The zipper returned a null value\"));\n Arrays.fill(obj, null);\n } catch (Throwable th2) {\n th = th2;\n C15678a.m58850b(th);\n m63698a();\n observer.onError(th);\n return;\n }\n }\n }\n }\n }", "public void mo12598d() {\n this.f8649c.onNext(C13145v.f29587a);\n }", "private static void createColdObservable() {\n var observable = Observable.just(1, 2, 3, 4, 5);\n\n observable.subscribe(item -> LOG.info(\"Observer 1: {}\", item));\n\n pause(1000);\n\n observable.subscribe(item -> LOG.info(\"Observer 2: {}\", item));\n }", "private void threads()\n {\n {\n Observable myObservable = Observable.create\n (\n new Observable.OnSubscribe<GetArtistQuery>() \n {\n public void call(Subscriber<? super GetArtistQuery> sub) \n { \n //System.out.println(Thread.currentThread().getName());\n sub.onNext(getArtistQuery);\n sub.onCompleted();\n }\n } \n );\n \n Subscriber mySubscriber = new Subscriber<GetArtistQuery>() \n {\n public void onNext(GetArtistQuery s) \n { \n try { \n s.execute();\n } catch (SQLException ex) { System.out.println(ex); }\n }\n public void onCompleted() { \n }\n public void onError(Throwable e) {System.out.println(e); } \n };\n //myObservable.subscribe(mySubscriber); \n try {\n myObservable.\n subscribeOn(Schedulers.io()).\n //observeOn(Schedulers.from(executorService)).\n observeOn(Schedulers.trampoline()).\n subscribe(mySubscriber);\n Thread.sleep(2); \n //executorService.shutdown();\n } catch(InterruptedException ex) {Thread.currentThread().interrupt();}\n }\n \n }", "interface Step {\n void onStepResult(boolean isSuccess);\n\n\n @Subscribe(threadMode = ThreadMode.MAIN)\n void onStepTryEvent(TryToCompleteStep step);\n\n}", "static void m13383b() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r0 = com.foursquare.internal.data.db.C1916a.getDatabase();\t Catch:{ Exception -> 0x000a }\n r1 = \"battery_watcher\";\t Catch:{ Exception -> 0x000a }\n r2 = 0;\t Catch:{ Exception -> 0x000a }\n r0.delete(r1, r2, r2);\t Catch:{ Exception -> 0x000a }\n L_0x000a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.foursquare.pilgrim.e.b():void\");\n }", "public interface Task<C extends FlowContext> extends Func1<C, Completable> {\n}", "public final void mo17150y() {\n Timber.m44522a(\"refreshAccount\", new Object[0]);\n Single g = this.f12930b.getAccount().mo30134g();\n Intrinsics.checkReturnedValueIsNotNull((Object) g, \"accountApi.getAccount().toSingle()\");\n Single c = C11920c.m38475a(g, this.f12931c.getSubscriptions()).mo30222c((Consumer<? super Disposable>) new C5424e<Object>(this));\n Intrinsics.checkReturnedValueIsNotNull((Object) c, \"accountApi.getAccount().…opy(isLoading = true) } }\");\n Object a = c.mo30215a((C11974s<T, ? extends R>) C11793e.m37930a(getViewModelScope()));\n Intrinsics.checkReturnedValueIsNotNull(a, \"this.`as`(AutoDispose.autoDisposable(provider))\");\n ((C11792d0) a).mo29920a(new C5426f(this), new C5432t(new C5428g(this)));\n }", "public void onNext(T r10) {\n /*\n r9 = this;\n r1 = 0;\n r8 = 1;\n r0 = r9.terminated;\n if (r0 == 0) goto L_0x0007;\n L_0x0006:\n return;\n L_0x0007:\n monitor-enter(r9);\n r0 = r9.terminated;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x0011;\n L_0x000c:\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x000e:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n throw r0;\n L_0x0011:\n r0 = r9.emitting;\t Catch:{ all -> 0x000e }\n if (r0 == 0) goto L_0x002b;\n L_0x0015:\n r0 = r9.queue;\t Catch:{ all -> 0x000e }\n if (r0 != 0) goto L_0x0020;\n L_0x0019:\n r0 = new rx.observers.SerializedObserver$FastList;\t Catch:{ all -> 0x000e }\n r0.<init>();\t Catch:{ all -> 0x000e }\n r9.queue = r0;\t Catch:{ all -> 0x000e }\n L_0x0020:\n r1 = r9.nl;\t Catch:{ all -> 0x000e }\n r1 = r1.next(r10);\t Catch:{ all -> 0x000e }\n r0.add(r1);\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n goto L_0x0006;\n L_0x002b:\n r0 = 1;\n r9.emitting = r0;\t Catch:{ all -> 0x000e }\n monitor-exit(r9);\t Catch:{ all -> 0x000e }\n r0 = r9.actual;\t Catch:{ Throwable -> 0x0046 }\n r0.onNext(r10);\t Catch:{ Throwable -> 0x0046 }\n L_0x0034:\n r2 = r1;\n L_0x0035:\n r0 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;\n if (r2 >= r0) goto L_0x0034;\n L_0x0039:\n monitor-enter(r9);\n r0 = r9.queue;\t Catch:{ all -> 0x0043 }\n if (r0 != 0) goto L_0x004f;\n L_0x003e:\n r0 = 0;\n r9.emitting = r0;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n goto L_0x0006;\n L_0x0043:\n r0 = move-exception;\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n throw r0;\n L_0x0046:\n r0 = move-exception;\n r9.terminated = r8;\n r1 = r9.actual;\n rx.exceptions.Exceptions.throwOrReport(r0, r1, r10);\n goto L_0x0006;\n L_0x004f:\n r3 = 0;\n r9.queue = r3;\t Catch:{ all -> 0x0043 }\n monitor-exit(r9);\t Catch:{ all -> 0x0043 }\n r3 = r0.array;\n r4 = r3.length;\n r0 = r1;\n L_0x0057:\n if (r0 >= r4) goto L_0x007e;\n L_0x0059:\n r5 = r3[r0];\n if (r5 == 0) goto L_0x007e;\n L_0x005d:\n r6 = r9.nl;\t Catch:{ Throwable -> 0x006b }\n r7 = r9.actual;\t Catch:{ Throwable -> 0x006b }\n r5 = r6.accept(r7, r5);\t Catch:{ Throwable -> 0x006b }\n if (r5 == 0) goto L_0x007b;\n L_0x0067:\n r0 = 1;\n r9.terminated = r0;\t Catch:{ Throwable -> 0x006b }\n goto L_0x0006;\n L_0x006b:\n r0 = move-exception;\n r9.terminated = r8;\n rx.exceptions.Exceptions.throwIfFatal(r0);\n r1 = r9.actual;\n r0 = rx.exceptions.OnErrorThrowable.addValueAsLastCause(r0, r10);\n r1.onError(r0);\n goto L_0x0006;\n L_0x007b:\n r0 = r0 + 1;\n goto L_0x0057;\n L_0x007e:\n r0 = r2 + 1;\n r2 = r0;\n goto L_0x0035;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rx.observers.SerializedObserver.onNext(java.lang.Object):void\");\n }", "public void mo130020b() {\n if (getAndIncrement() == 0) {\n AbstractC32175x<? super R> xVar = this.f109109a;\n ErrorMode iVar = this.f109114f;\n SimplePlainQueue<T> iVar2 = this.f109113e;\n AtomicThrowable cVar = this.f109111c;\n int i = 1;\n while (true) {\n if (this.f109117i) {\n iVar2.clear();\n this.f109118j = null;\n } else {\n int i2 = this.f109119k;\n if (cVar.get() == null || !(iVar == ErrorMode.IMMEDIATE || (iVar == ErrorMode.BOUNDARY && i2 == 0))) {\n boolean z = false;\n if (i2 == 0) {\n boolean z2 = this.f109116h;\n T poll = iVar2.poll();\n if (poll == null) {\n z = true;\n }\n if (z2 && z) {\n Throwable a = cVar.mo130469a();\n if (a == null) {\n xVar.onComplete();\n return;\n } else {\n xVar.onError(a);\n return;\n }\n } else if (!z) {\n try {\n MaybeSource oVar = (MaybeSource) ObjectHelper.m147684a(this.f109110b.apply(poll), \"The mapper returned a null MaybeSource\");\n this.f109119k = 1;\n oVar.mo130568a(this.f109112d);\n } catch (Throwable th) {\n C31732b.m147608b(th);\n this.f109115g.dispose();\n iVar2.clear();\n cVar.mo130470a(th);\n xVar.onError(cVar.mo130469a());\n return;\n }\n }\n } else if (i2 == 2) {\n R r = this.f109118j;\n this.f109118j = null;\n xVar.onNext(r);\n this.f109119k = 0;\n }\n }\n }\n i = addAndGet(-i);\n if (i == 0) {\n return;\n }\n }\n iVar2.clear();\n this.f109118j = null;\n xVar.onError(cVar.mo130469a());\n }\n }", "public final void accept(final com.iqoption.core.microservices.tradingengine.response.active.a aVar) {\n this.dhu.dispose();\n this.dhu.dhq.postValue(l.listOf(com.iqoption.fragment.c.a.a.k.dgX));\n a aVar2 = this.dhu;\n kotlin.jvm.internal.i.e(aVar, ConditionalUserProperty.ACTIVE);\n io.reactivex.disposables.b a = aVar2.M(aVar).h(com.iqoption.core.rx.i.aki()).f(new io.reactivex.b.f<com.iqoption.fragment.c.a.a.j>(this) {\n final /* synthetic */ AnonymousClass1 dhv;\n\n @kotlin.i(bne = {1, 1, 15}, bnf = {\"\\u0000\\u0014\\n\\u0000\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0010 \\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\u0010\\u0000\\u001a\\u00020\\u00012\\u001a\\u0010\\u0002\\u001a\\u0016\\u0012\\u0004\\u0012\\u00020\\u0004 \\u0005*\\n\\u0012\\u0004\\u0012\\u00020\\u0004\\u0018\\u00010\\u00030\\u0003H\\n¢\\u0006\\u0002\\b\\u0006\"}, bng = {\"<anonymous>\", \"\", \"list\", \"\", \"Lcom/iqoption/fragment/infoasset/adapters/conditions/ConditionsAssetAdapterItem;\", \"kotlin.jvm.PlatformType\", \"accept\"})\n /* compiled from: ConditionsAssetViewModel.kt */\n /* renamed from: com.iqoption.fragment.c.b.a$1$1$1 */\n static final class AnonymousClass1<T> implements io.reactivex.b.f<List<? extends com.iqoption.fragment.c.a.a.j>> {\n final /* synthetic */ AnonymousClass1 dhx;\n\n AnonymousClass1(AnonymousClass1 anonymousClass1) {\n this.dhx = anonymousClass1;\n }\n\n /* renamed from: v */\n public final void accept(List<? extends com.iqoption.fragment.c.a.a.j> list) {\n a aVar = this.dhx.dhv.dhu;\n kotlin.jvm.internal.i.e(list, \"list\");\n aVar.aU(list);\n }\n }\n\n @kotlin.i(bne = {1, 1, 15}, bnf = {\"\\u0000\\u0014\\n\\u0000\\n\\u0002\\u0010\\u0002\\n\\u0000\\n\\u0002\\u0010 \\n\\u0002\\u0018\\u0002\\n\\u0002\\b\\u0002\\u0010\\u0000\\u001a\\u00020\\u00012\\u001a\\u0010\\u0002\\u001a\\u0016\\u0012\\u0004\\u0012\\u00020\\u0004 \\u0005*\\n\\u0012\\u0004\\u0012\\u00020\\u0004\\u0018\\u00010\\u00030\\u0003H\\n¢\\u0006\\u0002\\b\\u0006\"}, bng = {\"<anonymous>\", \"\", \"list\", \"\", \"Lcom/iqoption/fragment/infoasset/adapters/conditions/ConditionsAssetAdapterItem;\", \"kotlin.jvm.PlatformType\", \"accept\"})\n /* compiled from: ConditionsAssetViewModel.kt */\n /* renamed from: com.iqoption.fragment.c.b.a$1$1$2 */\n static final class AnonymousClass2<T> implements io.reactivex.b.f<List<? extends com.iqoption.fragment.c.a.a.j>> {\n final /* synthetic */ AnonymousClass1 dhx;\n\n AnonymousClass2(AnonymousClass1 anonymousClass1) {\n this.dhx = anonymousClass1;\n }\n\n /* renamed from: v */\n public final void accept(List<? extends com.iqoption.fragment.c.a.a.j> list) {\n kotlin.jvm.internal.i.e(list, \"list\");\n if ((list.isEmpty() ^ 1) != 0) {\n this.dhx.dhv.dhu.aU(list);\n }\n }\n }\n\n /* renamed from: a */\n public final void accept(com.iqoption.fragment.c.a.a.j jVar) {\n a aVar = this.dhv.dhu;\n a aVar2 = this.dhv.dhu;\n com.iqoption.core.microservices.tradingengine.response.active.a aVar3 = aVar;\n String str = ConditionalUserProperty.ACTIVE;\n kotlin.jvm.internal.i.e(aVar3, str);\n io.reactivex.disposables.b a = aVar2.O(aVar3).h(com.iqoption.core.rx.i.aki()).g(com.iqoption.core.rx.i.akj()).a((io.reactivex.b.f) new AnonymousClass1(this), a.aMn);\n kotlin.jvm.internal.i.e(a, \"getSchedule(active)\\n … }, LOGGING_CONSUMER)\");\n aVar.b(a);\n if (!aVar.getInstrumentType().isOption()) {\n aVar = this.dhv.dhu;\n aVar2 = this.dhv.dhu;\n aVar3 = aVar;\n kotlin.jvm.internal.i.e(aVar3, str);\n a = aVar2.N(aVar3).h(com.iqoption.core.rx.i.aki()).g(com.iqoption.core.rx.i.akj()).a((io.reactivex.b.f) new AnonymousClass2(this), a.aMn);\n kotlin.jvm.internal.i.e(a, \"getOvernight(active)\\n … }, LOGGING_CONSUMER)\");\n aVar.b(a);\n }\n }\n }).a((io.reactivex.b.f) new AnonymousClass2(this), a.aMn);\n kotlin.jvm.internal.i.e(a, \"getBaseItem(active)\\n … }, LOGGING_CONSUMER)\");\n aVar2.b(a);\n }", "public final void m57546a() {\n C3957b a = this.f47567c.observeState().a(this.f47571g);\n C2668g.a(a, \"keepAliveScarletApi.obse…rveOn(sendEventScheduler)\");\n a = m57535a(a, C16518d.f51186a).a(this.f47567c.observeWebSocketEvent(), C17209c.f52784a);\n C2668g.a(a, \"withLatestFrom(other, Bi…on{ t, u -> Pair(t,u) })\");\n Disposable a2 = a.a(C17212f.f52787a).a(new C17213g(this), C17214h.f52789a);\n Disposable a3 = this.f47567c.observeNudge().a(this.f47571g).a(new C17210d(this), C17211e.f52786a);\n this.f47566b.m63448a(a2, a3);\n }", "@androidx.annotation.Nullable\n /* renamed from: a */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static com.inmobi.media.C2336dl m4847a(@androidx.annotation.NonNull java.lang.String r3, @androidx.annotation.Nullable com.inmobi.media.C2600j r4, @androidx.annotation.Nullable java.lang.String r5, boolean r6) {\n /*\n com.iab.omid.library.inmobi.adsession.AdSessionContext r4 = m4846a(r4, r5)\n int r5 = r3.hashCode()\n r0 = -284840886(0xffffffffef05ac4a, float:-4.136979E28)\n r1 = 3\n r2 = 2\n if (r5 == r0) goto L_0x002e\n r0 = 112202875(0x6b0147b, float:6.6233935E-35)\n if (r5 == r0) goto L_0x0024\n r0 = 1425678798(0x54fa21ce, float:8.5944718E12)\n if (r5 == r0) goto L_0x001a\n goto L_0x0038\n L_0x001a:\n java.lang.String r5 = \"nonvideo\"\n boolean r3 = r3.equals(r5)\n if (r3 == 0) goto L_0x0038\n r3 = 2\n goto L_0x0039\n L_0x0024:\n java.lang.String r5 = \"video\"\n boolean r3 = r3.equals(r5)\n if (r3 == 0) goto L_0x0038\n r3 = 3\n goto L_0x0039\n L_0x002e:\n java.lang.String r5 = \"unknown\"\n boolean r3 = r3.equals(r5)\n if (r3 == 0) goto L_0x0038\n r3 = 1\n goto L_0x0039\n L_0x0038:\n r3 = -1\n L_0x0039:\n if (r3 == r2) goto L_0x0047\n if (r3 == r1) goto L_0x003f\n r3 = 0\n goto L_0x004e\n L_0x003f:\n com.inmobi.media.dm r3 = new com.inmobi.media.dm\n java.lang.String r5 = \"html_video_ad\"\n r3.<init>(r5, r4, r6)\n goto L_0x004e\n L_0x0047:\n com.inmobi.media.dm r3 = new com.inmobi.media.dm\n java.lang.String r5 = \"html_display_ad\"\n r3.<init>(r5, r4)\n L_0x004e:\n return r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.inmobi.media.C2341dp.m4847a(java.lang.String, com.inmobi.media.j, java.lang.String, boolean):com.inmobi.media.dl\");\n }", "public abstract void mo129841a(CompletableObserver dVar);", "public interface C3210f extends C11871b<DeletedProgramBroadcastReceiver> {\n\n /* renamed from: com.bamtechmedia.dominguez.channels.tv.f$a */\n /* compiled from: FeatureChannelModule_ProvidesWatchNextProgramBroadcastReceiver */\n public interface C3211a extends C11872a<DeletedProgramBroadcastReceiver> {\n }\n}", "static Scheduler m34951a(Function<? super Callable<Scheduler>, ? extends Scheduler> hVar, Callable<Scheduler> callable) {\n return (Scheduler) ObjectHelper.m35048a(m34956a(hVar, (T) callable), \"Scheduler Callable result can't be null\");\n }", "public final void mo31292d() {\n /*\n r7 = this;\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this\n com.tapjoy.internal.gb$a r0 = r0.mo31282a()\n android.content.Context r0 = r0.f13987a\n r7.f13994d = r0\n android.content.IntentFilter r0 = new android.content.IntentFilter\n java.lang.String r1 = \"android.net.conn.CONNECTIVITY_CHANGE\"\n r0.<init>(r1)\n android.content.Context r1 = r7.f13994d\n android.content.BroadcastReceiver r2 = r7.f13995e\n r1.registerReceiver(r2, r0)\n L_0x0018:\n boolean r0 = r7.f13992b // Catch:{ all -> 0x008b }\n if (r0 != 0) goto L_0x0087\n java.util.concurrent.CountDownLatch r0 = new java.util.concurrent.CountDownLatch // Catch:{ all -> 0x008b }\n r1 = 1\n r0.<init>(r1) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.fs$a r2 = com.tapjoy.internal.C5096fs.f13949b // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb$b$1 r3 = new com.tapjoy.internal.gb$b$1 // Catch:{ all -> 0x008b }\n r3.<init>(r0) // Catch:{ all -> 0x008b }\n r2.addObserver(r3) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb$a r2 = r2.mo31282a() // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r3 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n android.content.Context r4 = r2.f13987a // Catch:{ all -> 0x008b }\n java.lang.String r5 = r2.f13988b // Catch:{ all -> 0x008b }\n java.util.Hashtable r2 = r2.f13989c // Catch:{ all -> 0x008b }\n r6 = 0\n boolean r2 = r3.mo31194a(r4, r5, r2, r6) // Catch:{ all -> 0x008b }\n r3 = 0\n if (r2 != 0) goto L_0x004b\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r3) // Catch:{ all -> 0x008b }\n r7.m17251h()\n return\n L_0x004b:\n r0.await() // Catch:{ InterruptedException -> 0x004e }\n L_0x004e:\n boolean r0 = r7.f13993c // Catch:{ all -> 0x008b }\n if (r0 == 0) goto L_0x0064\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n int r2 = com.tapjoy.internal.C5108gb.C5116c.f14003e // Catch:{ all -> 0x008b }\n int r3 = com.tapjoy.internal.C5108gb.C5116c.f14001c // Catch:{ all -> 0x008b }\n r0.mo31283a((int) r2) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r1) // Catch:{ all -> 0x008b }\n r7.m17251h()\n return\n L_0x0064:\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r0.mo31284a((boolean) r3) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r0 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n long r0 = r0.f13979d // Catch:{ all -> 0x008b }\n r2 = 1000(0x3e8, double:4.94E-321)\n long r0 = java.lang.Math.max(r0, r2) // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r3 = 2\n long r3 = r0 << r3\n r5 = 3600000(0x36ee80, double:1.7786363E-317)\n long r3 = java.lang.Math.min(r3, r5) // Catch:{ all -> 0x008b }\n r2.f13979d = r3 // Catch:{ all -> 0x008b }\n com.tapjoy.internal.gb r2 = com.tapjoy.internal.C5108gb.this // Catch:{ all -> 0x008b }\n r2.mo31285a((long) r0) // Catch:{ all -> 0x008b }\n goto L_0x0018\n L_0x0087:\n r7.m17251h()\n return\n L_0x008b:\n r0 = move-exception\n r7.m17251h()\n goto L_0x0091\n L_0x0090:\n throw r0\n L_0x0091:\n goto L_0x0090\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tapjoy.internal.C5108gb.C5113b.mo31292d():void\");\n }", "@Override\n\t\t\t\t\tpublic void onSubscribe(Disposable p1) {\n\t\t\t\t\t}", "public CompletableOnSubscribeMerge(dji.thirdparty.rx.Observable<? extends dji.thirdparty.rx.Completable> r1, int r2, boolean r3) {\n /*\n r0 = this;\n r0.<init>()\n r0.source = r1\n r0.maxConcurrency = r2\n r0.delayErrors = r3\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: dji.thirdparty.rx.internal.operators.CompletableOnSubscribeMerge.<init>(dji.thirdparty.rx.Observable, int, boolean):void\");\n }", "@Test\n public void testClickOnBeaconScanFAB_scanResults() {\n TestScheduler testScheduler = new TestScheduler();\n RxJavaPlugins.reset();\n RxJavaPlugins.setComputationSchedulerHandler(scheduler -> testScheduler);\n RxJavaPlugins.setIoSchedulerHandler(scheduler -> testScheduler);\n\n when(mockPanelScanProvider.scanForNearbyPanel()).thenReturn(Observable.just(new PanelInfo(\"Nicks Solar Panels\", \"12345\")).delay(1, TimeUnit.SECONDS));\n\n // Creates, starts, resumes activity ...\n controller.setup();\n\n activity.findViewById(R.id.beaconScanFAB).performClick();\n\n // Because scan response is delayed above, we're in a 'finding' state for a bit ...\n assertEquals(activity.getText(R.string.finding_nearby_solar_panel),\n ((TextView) activity.findViewById(R.id.mainTextView)).getText());\n\n // Advance the 'computation' scheduler so the above delayed nearby panel even will finally\n // be emitted.\n testScheduler.advanceTimeBy(2, TimeUnit.SECONDS);\n\n // Confirm that bluetooth scan is finished...\n assertEquals(View.INVISIBLE,\n activity.findViewById(R.id.refreshProgressBar).getVisibility());\n\n assertEquals(View.VISIBLE,\n activity.findViewById(R.id.mainTextView).getVisibility());\n assertEquals(View.VISIBLE,\n activity.findViewById(R.id.detailTextView).getVisibility());\n assertEquals(View.VISIBLE,\n activity.findViewById(R.id.beaconScanFAB).getVisibility());\n assertEquals(View.VISIBLE,\n activity.findViewById(R.id.solarUpdateFAB).getVisibility());\n\n assertEquals(\"solar panel (12345)\",\n ((TextView) activity.findViewById(R.id.detailTextView)).getText());\n assertEquals(activity.getText(R.string.click_to_load_solar_output),\n ((TextView) activity.findViewById(R.id.mainTextView)).getText());\n\n }", "public static void main(String[] args) throws InterruptedException {\n\t\tObservable.just(\"hi\",\"hello\",\"okay\").subscribe(z -> System.out.print(z));\n\t\t\n\t\t// creating observable using create in lambda style[Sync]\n\t\tObservable.create( f ->{\n\t\t\t\t\t\t\tf.onNext(\"hello\");\n\t\t\t\t\t\t\tif( f.isUnsubscribed() ){\n\t\t\t\t\t\t\t\treturn; \n\t\t\t\t\t\t\t}}).subscribe( s -> System.out.println(s));\n\t\t\n\t\t\n\t\tExecutorService executor = Executors.newSingleThreadExecutor();\n\t\tSystem.out.println(\"----\"+Thread.currentThread().getName());\n\t\t\n\t\t// creating observable using create in lambda style[Async]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\t\t\n\t\t// creating observable using create in lambda style[Async + observerOn]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).observeOn(Schedulers.newThread()).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\n\t\t\n\t\t// creating observable using create in lambda style[Async + subscribeOn]\n\t\tObservable.create(f -> {executor.submit(() ->{\n\t\t\t f.onNext(Thread.currentThread().getName());\n\t \t});}).subscribeOn(Schedulers.newThread()).subscribe(s -> {System.out.println(Thread.currentThread().getName()); \n\t \t\t\t\t\t\t\tSystem.out.println(s);} );\n\n\t\t\n\t\tList<Integer> result = new ArrayList<Integer>();\n\t\t//bulk API simulation\n\t\tObservable<Integer> obs = Observable.just(1,2,3,4,5,6).map(userId ->{\n\t\t\t//make mysql call\n\t\t try { System.out.println(\"---\"+Thread.currentThread().getName());\n\t\t\treturn makeSqlCall(userId);\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn 0;\n\t\t});\n\t\t\t\t\n\t obs.subscribeOn(Schedulers.io()).subscribe(id ->{ result.add(id);System.out.println(Thread.currentThread().getName());});\n\t for(Integer x: result){System.out.print(x+\" - \");}\n\t\t\n\t}", "public interface ObservableOnSubcribe<T> {\n\n void subscribe(@NonNull ObservableEmitter<T> emitter) throws Exception;\n\n}", "public static void main(String[] args) {\n\t\tDisposableObserver<String> dobs = new DisposableObserver<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"onComplete via DisposableObserver\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\tSystem.out.println(\"onError==\" + arg0);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"onNext via DisposableObserver==\" + arg0);\n\t\t\t}\n\t\t};\n\t\tDisposableObserver<String> dobs2 = new DisposableObserver<String>() {\n\n\t\t\t@Override\n\t\t\tpublic void onComplete() {\n\t\t\t\tSystem.out.println(\"onComplete via DisposableObserver\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onError(Throwable arg0) {\n\t\t\t\tSystem.out.println(\"onError==\" + arg0);\n\t\t\t}\n\n\n\t\t\t@Override\n\t\t\tpublic void onNext(String arg0) {\n\t\t\t\tSystem.out.println(\"onNext via DisposableObserver==\" + arg0);\n\t\t\t}\n\t\t};\n\n\t\t\n\t\t\n\t\t\n\t\tList<String> al = Arrays.asList(\"first\", \"second\", \"third\");\n\t\tObservable<String> observable = Observable.fromIterable(al);\n\n\t\t/**\n\t\t * CompositeDisposable object helps to dispose multiple disposable observers at once\n\t\t */\n\t\tCompositeDisposable cdis=new CompositeDisposable();\n\t\t\n\t\tcdis.add(dobs);\n\n//\t\tbelow syntax is for adding schedular with composite disposables\n//\t\tcdis.add(\n//\t\t\t\tobservable.subscribeOn(Schedulers.io()).\n//\t\t\t\tobserveOn(Schedulers.io()).\n//\t\t\t\tsubscribeWith(dobs)\n//\t\t\t\t);\n//\t\t\n\t\t\n\t\t\n\t\tobservable.subscribe(dobs);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"cdis size after added dobs=\"+cdis.size());\n\n\t\t/**\n\t\t * cids clear method will clear the existing cdis and can accept\n\t\t * further disposables observers and show correct methods values\n\t\t * like disposable observers is disposed or not \n\t\t */\n\t\tSystem.out.println(\"before cdis clear\");\n//\t\tcdis.clear();\n\t\tSystem.out.println(\"cdis isDisposed==\"+cdis.isDisposed());\n\t\t\n\t\t\n\t\t/**\n\t\t * cdis dispose method dispose the cdis and \n\t\t * change the isDispose method to true\n\t\t * and it can not accept further disposable observers\n\t\t * and it will also show wrong method values like \n\t\t * disposable observers is disposed or not\n\t\t * for say in this example cdis dispose called after only \n\t\t * dobs subscribed , after that dobs2 is added to cids \n\t\t * but still dobs2.isDisposed giving true\n\t\t */\n//\t\tcdis.dispose();\n\n\t\t\n\t\t\n\t\tSystem.out.println(\"after cdis clear \");\n\t\tSystem.out.println(\"cdis size=\"+cdis.size());\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\tSystem.out.println();\n\n\t\t\n\t\t\n\t\tobservable.subscribe(dobs2);\n\n\t\tcdis.add(dobs2);\n\t\t\n\t\t\n//\t\tcdis.add(dobs2);\n//\t\tobservable.subscribe(dobs2);\n\t\t\n\t\t/**\n\t\t * do note if we added dobs2 into cids after cids dispose method\n\t\t * then in that cose even subscription itself will not called\n\t\t * so clear will be better options for clearing particular dobs \n\t\t * rather than dispose method of composite disposable\n\t\t */\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"cdis size after added dobs2=\"+cdis.size());\n\t\t\n\t\tSystem.out.println(\"dobs.isDisposed()==\"+dobs.isDisposed());\n\t\tSystem.out.println(\"dobs2.isDisposed()==\"+dobs2.isDisposed());\n\t\n\t\tcdis.clear();\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"after cdis clear\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"dobs.isDisposed()==\"+dobs.isDisposed());\n\t\tSystem.out.println(\"dobs2.isDisposed()==\"+dobs2.isDisposed());\n\t\n\t\t\n\t\t\n\n\t\t\n\t}", "@Test\n public void untypedLambdaError2() {\n DependentLink A = param(\"A\", Universe(0));\n DependentLink params = params(A, param(\"B\", Pi(Reference(A), Universe(0))), param(\"a\", Reference(A)));\n Expression type = Pi(params, Apps(Reference(params.getNext()), Reference(params.getNext().getNext())));\n List<Binding> context = new ArrayList<>();\n context.add(new TypedBinding(\"f\", type));\n\n typeCheckExpr(context, \"\\\\lam x1 x2 x3 => f x2 x1 x3\", null, 1);\n }", "public interface C2195q {\n /* renamed from: a */\n void mo9337a(C2177n<?> nVar, UnobservedTaskException unobservedTaskException);\n }", "public void mo42335f() {\n Object andSet = getAndSet(null);\n if (andSet == null) {\n return;\n }\n if (this.f36202N.get() != 0) {\n this.f36205a.mo41789a(andSet);\n C13747d.m58699c(this.f36202N, 1);\n return;\n }\n cancel();\n this.f36205a.onError(new MissingBackpressureException(\"Couldn't emit value due to lack of requests!\"));\n }", "public void mo442d() {\n long j;\n long j2;\n int i;\n long j3;\n boolean z;\n C0245a[] aVarArr;\n int i2;\n int i3;\n C3683c<? super U> cVar = this.f472a;\n int i4 = 1;\n while (!mo443e()) {\n C0211f<U> fVar = this.f477f;\n long j4 = this.f482m.get();\n boolean z2 = j4 == Long.MAX_VALUE;\n if (fVar != null) {\n j = 0;\n while (true) {\n long j5 = 0;\n Object obj = null;\n while (true) {\n if (j4 == 0) {\n break;\n }\n Object e_ = fVar.mo386e_();\n if (!mo443e()) {\n if (e_ == null) {\n obj = e_;\n break;\n }\n cVar.onNext(e_);\n j++;\n j5++;\n j4--;\n obj = e_;\n } else {\n return;\n }\n }\n if (j5 != 0) {\n if (z2) {\n j4 = Long.MAX_VALUE;\n } else {\n j4 = this.f482m.addAndGet(-j5);\n }\n }\n if (j4 == 0 || obj == null) {\n break;\n }\n }\n } else {\n j = 0;\n }\n boolean z3 = this.f478g;\n C0211f<U> fVar2 = this.f477f;\n C0245a[] aVarArr2 = (C0245a[]) this.f481j.get();\n int length = aVarArr2.length;\n if (!z3 || ((fVar2 != null && !fVar2.mo384b()) || length != 0)) {\n if (length != 0) {\n i = i4;\n long j6 = this.f485p;\n int i5 = this.f486q;\n if (length <= i5 || aVarArr2[i5].f462a != j6) {\n if (length <= i5) {\n i5 = 0;\n }\n int i6 = i5;\n for (int i7 = 0; i7 < length && aVarArr2[i6].f462a != j6; i7++) {\n i6++;\n if (i6 == length) {\n i6 = 0;\n }\n }\n this.f486q = i6;\n this.f485p = aVarArr2[i6].f462a;\n i5 = i6;\n }\n int i8 = i5;\n z = false;\n int i9 = 0;\n while (true) {\n if (i9 >= length) {\n aVarArr = aVarArr2;\n break;\n } else if (!mo443e()) {\n C0245a aVar = aVarArr2[i8];\n Object obj2 = null;\n while (!mo443e()) {\n C0212g<U> gVar = aVar.f467f;\n if (gVar == null) {\n aVarArr = aVarArr2;\n i2 = length;\n } else {\n aVarArr = aVarArr2;\n i2 = length;\n long j7 = 0;\n while (j2 != 0) {\n try {\n obj2 = gVar.mo386e_();\n if (obj2 == null) {\n break;\n }\n cVar.onNext(obj2);\n if (!mo443e()) {\n j2--;\n j7++;\n } else {\n return;\n }\n } catch (Throwable th) {\n Throwable th2 = th;\n C0171b.m584b(th2);\n aVar.dispose();\n this.f479h.mo516a(th2);\n if (!this.f474c) {\n this.f483n.mo407a();\n }\n if (!mo443e()) {\n mo439b(aVar);\n i9++;\n i3 = i2;\n z = true;\n } else {\n return;\n }\n }\n }\n if (j7 != 0) {\n j2 = !z2 ? this.f482m.addAndGet(-j7) : Long.MAX_VALUE;\n aVar.mo433a(j7);\n }\n if (!(j2 == 0 || obj2 == null)) {\n aVarArr2 = aVarArr;\n length = i2;\n }\n }\n boolean z4 = aVar.f466e;\n C0212g<U> gVar2 = aVar.f467f;\n if (z4 && (gVar2 == null || gVar2.mo384b())) {\n mo439b(aVar);\n if (!mo443e()) {\n j++;\n z = true;\n } else {\n return;\n }\n }\n if (j2 == 0) {\n break;\n }\n int i10 = i8 + 1;\n i3 = i2;\n i8 = i10 == i3 ? 0 : i10;\n i9++;\n length = i3;\n aVarArr2 = aVarArr;\n }\n return;\n } else {\n return;\n }\n }\n this.f486q = i8;\n this.f485p = aVarArr[i8].f462a;\n j3 = j;\n } else {\n i = i4;\n j3 = j;\n z = false;\n }\n if (j3 != 0 && !this.f480i) {\n this.f483n.mo408a(j3);\n }\n if (z) {\n i4 = i;\n } else {\n i4 = addAndGet(-i);\n if (i4 == 0) {\n return;\n }\n }\n } else {\n Throwable a = this.f479h.mo515a();\n if (a != C0315e.f669a) {\n if (a == null) {\n cVar.onComplete();\n } else {\n cVar.onError(a);\n }\n }\n return;\n }\n }\n }" ]
[ "0.6411002", "0.6239618", "0.60781354", "0.5783936", "0.5712291", "0.5612804", "0.5470487", "0.54524076", "0.54410267", "0.52607036", "0.52404547", "0.51889324", "0.5154098", "0.51410633", "0.5137739", "0.51298964", "0.5126723", "0.5120217", "0.5114673", "0.5112502", "0.5076396", "0.5070174", "0.50669324", "0.5065638", "0.50502723", "0.5032308", "0.5023588", "0.5017778", "0.50072", "0.49883696", "0.49716318", "0.4946448", "0.49434093", "0.49344507", "0.4909203", "0.49002814", "0.48994628", "0.4893561", "0.48720393", "0.486342", "0.48372462", "0.48354697", "0.48310462", "0.4821806", "0.4817742", "0.4812933", "0.48074406", "0.48001042", "0.4777487", "0.47752088", "0.47630745", "0.47589055", "0.475889", "0.47562733", "0.47556993", "0.47536674", "0.47295344", "0.4729202", "0.4721022", "0.47170964", "0.47101617", "0.4709039", "0.47052416", "0.4701391", "0.46952814", "0.46937227", "0.46747053", "0.4674006", "0.46712354", "0.46681467", "0.4663007", "0.46627858", "0.4658807", "0.464858", "0.46279007", "0.46183646", "0.46161434", "0.4615347", "0.4613376", "0.4612715", "0.46105817", "0.4591706", "0.45826608", "0.45750022", "0.4572467", "0.45722157", "0.45694166", "0.45614535", "0.45609048", "0.45602286", "0.45496526", "0.45484796", "0.45409402", "0.45379487", "0.45314828", "0.45218253", "0.4514933", "0.45031118", "0.4502407", "0.4492745" ]
0.63448024
1
/ this synchronized is very very important
public synchronized void printVal(int val) { while (true) System.out.println(3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void synchronize(){ \r\n }", "@Override\n public void sync(){\n }", "public boolean synchronize() {\n\t\treturn false;\n\t}", "void contentsSynchronized();", "@Override\r\n\tpublic boolean isSynchronized() {\n\t\treturn false;\r\n\t}", "@Override\n public void callSync() {\n\n }", "protected void synchronizationDone() {\n }", "void beforeContentsSynchronized();", "@Override\n\tpublic void sync() throws IOException {\n\t\t\n\t}", "public void lock() {\r\n super.lock();\r\n }", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "Boolean autoSync();", "public void lock() {\n\n }", "public boolean isSynchronizing() {\n\t\treturn false;\n\t}", "private SyncState() {}", "private void m33138b() {\n synchronized (this.f26017d) {\n TaskExecutor.m3867a().mo11809a(11);\n }\n }", "void sync()throws IOException;", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "public void lock() {\n super.lock();\n }", "@Override\n public void syncState() {\n scheduledCounter.check();\n }", "@Override\r\n\tpublic void uniqueUpdate() {\n\r\n\t}", "public boolean needsSync() {\n return myNeedsSync;\n }", "@Override\n public void run() {\n super.run();\n notAtomic.naIncreament();\n }", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f102361i;\n this.f102361i = 0;\n }\n }", "@Override\n\tpublic void sync() throws IOException\n\t{\n\n\t}", "public LockSync() {\n lock = new ReentrantLock();\n }", "public boolean sync() throws VlException \n\t{\n\t return false; \n\t}", "private static void m200a() {\r\n Object obj = AuthTask.f155a;\r\n synchronized (obj) {\r\n try {\r\n obj.notify();\r\n } catch (Exception e) {\r\n }\r\n }\r\n }", "public static void sync() {\n/* 72 */ if (theInstance != null) {\n/* */ \n/* */ \n/* */ \n/* 76 */ D3DScreenUpdateManager d3DScreenUpdateManager = (D3DScreenUpdateManager)ScreenUpdateManager.getInstance();\n/* 77 */ d3DScreenUpdateManager.runUpdateNow();\n/* */ \n/* 79 */ theInstance.lock();\n/* */ try {\n/* 81 */ theInstance.ensureCapacity(4);\n/* 82 */ theInstance.getBuffer().putInt(76);\n/* 83 */ theInstance.flushNow();\n/* */ } finally {\n/* 85 */ theInstance.unlock();\n/* */ } \n/* */ } \n/* */ }", "@Override\n\tpublic void race() {\n\n\t}", "void synchronizationDone();", "private SingletonSyncBlock() {}", "private synchronized void flushCache() {\n /*\n r6 = this;\n monitor-enter(r6)\n r0 = 0\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n boolean r1 = r1.isEmpty() // Catch:{ all -> 0x005a }\n if (r1 == 0) goto L_0x000c\n monitor-exit(r6)\n return\n L_0x000c:\n r1 = 4\n if (r0 >= r1) goto L_0x0058\n int r1 = r6.cdS // Catch:{ all -> 0x005a }\n r2 = 64\n if (r1 > r2) goto L_0x001e\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r1 = (long) r1 // Catch:{ all -> 0x005a }\n long r3 = r6.cdV // Catch:{ all -> 0x005a }\n int r1 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1))\n if (r1 <= 0) goto L_0x0058\n L_0x001e:\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n java.util.Set r1 = r1.entrySet() // Catch:{ all -> 0x005a }\n java.util.Iterator r1 = r1.iterator() // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.next() // Catch:{ all -> 0x005a }\n java.util.Map$Entry r1 = (java.util.Map.Entry) r1 // Catch:{ all -> 0x005a }\n java.io.File r2 = new java.io.File // Catch:{ all -> 0x005a }\n java.lang.Object r3 = r1.getValue() // Catch:{ all -> 0x005a }\n java.lang.String r3 = (java.lang.String) r3 // Catch:{ all -> 0x005a }\n r2.<init>(r3) // Catch:{ all -> 0x005a }\n long r2 = r2.length() // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r4 = r6.cdY // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.getKey() // Catch:{ all -> 0x005a }\n r4.remove(r1) // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n int r1 = r1.size() // Catch:{ all -> 0x005a }\n r6.cdS = r1 // Catch:{ all -> 0x005a }\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r4 = (long) r1 // Catch:{ all -> 0x005a }\n long r4 = r4 - r2\n int r1 = (int) r4 // Catch:{ all -> 0x005a }\n r6.cdT = r1 // Catch:{ all -> 0x005a }\n int r0 = r0 + 1\n goto L_0x000c\n L_0x0058:\n monitor-exit(r6)\n return\n L_0x005a:\n r0 = move-exception\n monitor-exit(r6)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.introvd.template.common.bitmapfun.util.DiskLruCache.flushCache():void\");\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "public void acquire() {\r\n return;\r\n }", "public void lock() {\n if (!locked) {\n locked = true;\n sortAndTruncate();\n }\n }", "public void syncHandle() {\n syncOldStream();\n }", "@Override\r\n\tpublic void freeze() {\n\t\t\r\n\t}", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f67002l;\n this.f67002l = 0;\n }\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ts.put();\n\t\t\t\t}", "@Override\n\tpublic void run() {\n\t\tSystem.out.println(\"inside run() method.....\");\n\n\t\tlock();\n\n\t}", "Shared shared();", "void lock();", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public final void mo34030a() {\n this.f590g.lock();\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void requestExtraSync()\n {\n executor.requestExtraSync();\n }", "public void insertInorderBarrier() {\n\t\t\n\t}", "private final void m11968d() {\n synchronized (this.f10173g) {\n for (zzsk a : this.f10174h) {\n a.m11971a();\n }\n }\n }", "public void lock() {\n\t\tlocked = true;\n\t}", "private void workOnQueue() {\n }", "static void synced () {\n\t\tList<Integer> linkedList = \n\t\t\t\tCollections.synchronizedList(new LinkedList<Integer>());\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tlinkedList.add(i);\n\t\t}\n\t\t// launch a thread to add numbers 100 to 200 to the list\n\t\tnew Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"starting adding numbers\");\n\t\t\t\tfor (int i = 100; i < 200; i++) {\n\t\t\t\t\tlinkedList.add(i);\n\t\t\t\t\ttry { Thread.sleep(1);} \n\t\t\t\t\tcatch (InterruptedException e) {e.printStackTrace();}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"end\");\n\t\t\t}\n\t\t}).start();\n\n\t\t// now run an iterator to go through the linked list that is \n\t\t// synchronized with the linked list object. \n\t\tsynchronized(linkedList) {\n\t\t\tIterator<Integer> iterator = linkedList.iterator();\n\t\t\tSystem.out.println(\"starting iteration\");\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\ttry {Thread.sleep(4);} \n\t\t\t\tcatch (InterruptedException e) {e.printStackTrace();}\n\t\t\t\tSystem.out.println(iterator.next());\n\t\t\t}\t\n\t\t\tSystem.out.println(\"finished iteration\");\n\t\t}\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public void smell() {\n\t\t\n\t}", "@Test\n\tpublic void test_synchronization() throws InterruptedException, ExecutionException {\n\t\t\n\t\tIkanowV1SyncService_LibraryJars s1 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\tIkanowV1SyncService_LibraryJars s2 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\tIkanowV1SyncService_LibraryJars s3 = new IkanowV1SyncService_LibraryJars(BeanTemplateUtils.clone(_service_config).with(\"v1_enabled\", true).done(), \n\t\t\t\t_service_context);\n\t\t\n\t\tint old = IkanowV1SyncService_LibraryJars._num_leader_changes;\n\t\t\n\t\ts1.start(); s2.start(); s3.start();\n\t\tfor (int i = 0; i < 4; ++i) {\n\t\t\ttry { Thread.sleep(1000); } catch (Exception e) {}\n\t\t}\n\t\ts1.stop(); s2.stop(); s3.stop();\n\t\t\n\t\tassertEquals(old + 1, IkanowV1SyncService_LibraryJars._num_leader_changes);\n\t\t\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal ICrudService<JsonNode> v1_config_db = _service_context.getCoreManagementDbService().getUnderlyingPlatformDriver(ICrudService.class, Optional.of(\"social.share\")).get();\t\t\t\t\n\t\t\n\t\tassertTrue(\"Query optimized\", v1_config_db.deregisterOptimizedQuery(Arrays.asList(\"title\")));\n\t\t\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public void synchronize(int change);", "public void method_9396() {\r\n super();\r\n this.field_8914 = Maps.newConcurrentMap();\r\n }", "boolean pullingOnce();", "@Override\n\tpublic void run() {\n\t\tStaticSynchronized.execute();\n\t\tStaticSynchronized.execute2();\n\t\tStaticSynchronized.execute3();\n\t}", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "public final void mo33701a() {\n this.f1706g.lock();\n }", "@Override\n public boolean isThreadSafe()\n {\n return false;\n }", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "public void run() {\n\t\t\t\t\t\t}", "public void checkReadLock() {\r\n return;\r\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "private void d() {\n Queue<c> queue;\n Queue<c> queue2 = queue = i;\n synchronized (queue2) {\n long l2 = System.currentTimeMillis();\n Iterator iterator = i.iterator();\n while (iterator.hasNext()) {\n if (l2 - ((c)iterator.next()).a < 60000L) continue;\n iterator.remove();\n }\n if (i.size() >= 15) {\n for (int i2 = 0; i2 < 5; ++i2) {\n i.remove();\n }\n }\n return;\n }\n }", "@Override\n\tpublic boolean isLocked() { return true; }", "@Override\n\tpublic boolean tryLock() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean tryLock() {\n\t\treturn false;\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "public void willbeUpdated() {\n\t\t\n\t}", "private static boolean zza() {\n Object object = zzc;\n synchronized (object) {\n return false;\n }\n }", "boolean scavengeSome()\r\n/* 472: */ {\r\n/* 473:505 */ Recycler.WeakOrderQueue cursor = this.cursor;\r\n/* 474: */ Recycler.WeakOrderQueue prev;\r\n/* 475:506 */ if (cursor == null)\r\n/* 476: */ {\r\n/* 477:507 */ Recycler.WeakOrderQueue prev = null;\r\n/* 478:508 */ cursor = this.head;\r\n/* 479:509 */ if (cursor == null) {\r\n/* 480:510 */ return false;\r\n/* 481: */ }\r\n/* 482: */ }\r\n/* 483: */ else\r\n/* 484: */ {\r\n/* 485:513 */ prev = this.prev;\r\n/* 486: */ }\r\n/* 487:516 */ boolean success = false;\r\n/* 488: */ do\r\n/* 489: */ {\r\n/* 490:518 */ if (cursor.transfer(this))\r\n/* 491: */ {\r\n/* 492:519 */ success = true;\r\n/* 493:520 */ break;\r\n/* 494: */ }\r\n/* 495:522 */ Recycler.WeakOrderQueue next = Recycler.WeakOrderQueue.access$1800(cursor);\r\n/* 496:523 */ if (Recycler.WeakOrderQueue.access$1900(cursor).get() == null)\r\n/* 497: */ {\r\n/* 498:527 */ if (cursor.hasFinalData()) {\r\n/* 499:529 */ while (cursor.transfer(this)) {\r\n/* 500:530 */ success = true;\r\n/* 501: */ }\r\n/* 502: */ }\r\n/* 503:537 */ if (prev != null) {\r\n/* 504:538 */ Recycler.WeakOrderQueue.access$1700(prev, next);\r\n/* 505: */ }\r\n/* 506: */ }\r\n/* 507: */ else\r\n/* 508: */ {\r\n/* 509:541 */ prev = cursor;\r\n/* 510: */ }\r\n/* 511:544 */ cursor = next;\r\n/* 512:546 */ } while ((cursor != null) && (!success));\r\n/* 513:548 */ this.prev = prev;\r\n/* 514:549 */ this.cursor = cursor;\r\n/* 515:550 */ return success;\r\n/* 516: */ }", "abstract protected void syncTuples() throws IOException;", "private synchronized void increment() {\n ++count;\n }", "public static synchronized void foo() {\n\n }", "protected boolean upgradeLocks() {\n \t\treturn false;\n \t}", "public synchronized void save() {\n/* 86 */ this.component.saveToDB();\n/* */ }" ]
[ "0.7060326", "0.7011418", "0.66289437", "0.6389787", "0.6317581", "0.6177943", "0.61424434", "0.6131885", "0.6026336", "0.5949302", "0.5920461", "0.5910247", "0.5904106", "0.5904106", "0.5903196", "0.5883641", "0.58795756", "0.58675575", "0.5864168", "0.58634365", "0.5862332", "0.5862332", "0.5862332", "0.58489364", "0.5847703", "0.584482", "0.58351475", "0.58315706", "0.5809307", "0.5785964", "0.57808316", "0.5774827", "0.57555866", "0.57444334", "0.5722337", "0.57164615", "0.5707143", "0.5706656", "0.5706656", "0.5691028", "0.56837565", "0.5670072", "0.56641054", "0.5662672", "0.56599426", "0.5659767", "0.5647366", "0.5645332", "0.5643653", "0.5628204", "0.56184894", "0.56175476", "0.5615954", "0.5613834", "0.5603599", "0.55981326", "0.5574527", "0.5573254", "0.5571196", "0.55600655", "0.55600655", "0.55600655", "0.5549688", "0.5546403", "0.55450225", "0.55390215", "0.55390215", "0.55246997", "0.552401", "0.55225915", "0.55203325", "0.55088204", "0.55047786", "0.5500256", "0.54986465", "0.54986465", "0.54969144", "0.5493716", "0.54842067", "0.54842067", "0.54842067", "0.54842067", "0.54842067", "0.54842067", "0.54842067", "0.5482998", "0.5482998", "0.5478885", "0.54750425", "0.5468044", "0.5468044", "0.54666376", "0.54666376", "0.5464809", "0.5461763", "0.5461642", "0.545113", "0.5448802", "0.54438996", "0.5442647", "0.5440499" ]
0.0
-1
TODO Autogenerated method stub
@Override public void run() { synchronized (this) { while (true) { System.out.println(1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Get administratively enables or disables this instance.
public Boolean isEnable() { return enable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean getEnabled();", "boolean getEnabled();", "boolean getEnabled();", "java.lang.String getEnabled();", "public Boolean getEnable() {\n return this.enable;\n }", "public Boolean getEnable() {\n return enable;\n }", "public Boolean getEnable() {\n\t\treturn enable;\n\t}", "public Boolean getEnable() {\n return enable;\n }", "public String getIsEnable() {\n return isEnable;\n }", "public String getEnable() {\r\n return enable;\r\n }", "public Boolean enable() {\n return this.enable;\n }", "public Boolean getIsEnable() {\n\t\treturn isEnable;\n\t}", "public Boolean isEnable() {\n return this.enable;\n }", "public java.lang.Boolean getEnabled() {\n return enabled;\n }", "public Boolean getEnabled() {\n return this.enabled;\n }", "public Boolean getEnabled() {\n return this.enabled;\n }", "@Updatable\n public Boolean getActionsEnabled() {\n if (actionsEnabled == null) {\n actionsEnabled = true;\n }\n\n return actionsEnabled;\n }", "public boolean getIsAdmin() {\n return isAdmin;\n }", "@Override\n\tpublic boolean getEnabled();", "public Boolean getEnabled() {\r\n return enabled;\r\n }", "public Boolean getEnabled() {\n return enabled;\n }", "public boolean isEnabled()\n {\n return mSettings.getBoolean(ENABLED, true);\n }", "public boolean isEnable() {\n return enable;\n }", "public boolean isEnable() {\n return _enabled;\n }", "public boolean isAdmin();", "public boolean getEnabled() {\n return enabled;\n }", "public String getIsAdmin() {\n return isAdmin;\n }", "@ApiModelProperty(value = \"User is enabled or disabled. Effect: Controls the value of the corresponding CfgPerson attribute \")\n public Boolean isEnabled() {\n return enabled;\n }", "public Boolean getbEnable() {\n return bEnable;\n }", "public boolean getEnabled() {\r\n \t\tif (status == AlternativeStatus.ADOPTED) {\r\n \t\t\treturn true;\r\n \t\t} else {\r\n \t\t\treturn false;\r\n \t\t}\r\n \t}", "public Integer getIsadmin() {\r\n return isadmin;\r\n }", "public boolean isIsAdmin() {\r\n return isAdmin;\r\n }", "public boolean getPowerState() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getBoolean(TOGGLE_KEY, true);\n\t}", "public String getEnabled() {\r\n\t\treturn enabled;\r\n\t}", "public Boolean enabled() {\n return this.enabled;\n }", "public boolean getEnabled(){\r\n\t\treturn enabled;\r\n\t}", "public Integer getAdminStatus() {\n return adminStatus;\n }", "public boolean asAdmin() {\n\t\treturn asAdmin;\n\t}", "public boolean asAdmin() {\n\t\t\treturn asAdmin;\n\t\t}", "public Boolean isEnabled() {\n return this.enabled;\n }", "public Boolean isEnabled() {\n return this.enabled;\n }", "public Boolean isEnabled() {\n return this.enabled;\n }", "public String isEnabled() {\n return this.isEnabled;\n }", "boolean getHardcoreEnabled();", "boolean isAdminDirect() {\n return isAdministrator;\n }", "java.lang.String getAdmin();", "public boolean getEnabled() {\n\t\treturn mCurrentState != STATE.DISABLED;\n\t}", "public boolean isAdmin() {\r\n return admin;\r\n }", "public boolean isAdmin()\n {\n return admin;\n }", "public boolean isAdmin()\n {\n return admin;\n }", "public Boolean isEnabled() {\n return this.isEnabled;\n }", "public boolean isAdmin() {\n return admin;\n }", "public boolean getEnabled () {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\treturn (OS.PtWidgetFlags (topHandle) & OS.Pt_BLOCKED) == 0;\r\n}", "public boolean isEnabled() {\n return myEnabled;\n }", "public String getPermissionAdmin() {\n return permissionAdmin;\n }", "final public int getEnabled() {\n return enabledType;\n }", "public boolean isEnabled() {\n return m_Enabled;\n }", "boolean isAdmin();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "public boolean isEnabled();", "boolean updateEnabling();", "public boolean isDashboardEditEnabled() {\n return dashboardEditEnabled;\n }", "public Boolean isModoAdmin() {\r\n\t\treturn this.modoAdmin;\r\n\t}", "public boolean enabled() {\n return m_enabled;\n }", "public boolean isEnabled() {\n return mEnabled;\n }", "public boolean isEnabled() {\n return mEnabled;\n }", "public int getAdmin() {\n return admin;\n }", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "boolean isEnabled();", "public boolean isEnabled() { return this.myEnabled; }", "public boolean isEnabled(){\n\t\treturn mEnabled;\n\t}", "public boolean isEnabled() { return _enabled; }", "public java.lang.String getAdministrator () {\n\t\treturn administrator;\n\t}", "public boolean isEnabled() {\n return isEnabled;\n }", "public Boolean isEnabled() {\r\r\n\t\treturn _isEnabled;\r\r\n\t}", "public Boolean getHasAdminSeen() {\n return hasAdminSeen;\n }", "public boolean isEnabled() {\n return mBundle.getBoolean(KEY_ENABLED, true);\n }", "public boolean isEnabled() {\r\n\t\treturn sensor.isEnabled();\r\n\t}", "public boolean enabled(){\n return enabled;\n }", "public boolean isEnabled() {\r\n return m_enabled;\r\n }", "public static boolean isEnabled()\n\t{\n\t\treturn App.getSPAPI().getBool(SPKey.ENABLED);\n\t}", "public boolean publicAdmin() {\n try {\n return getConfig().getPublicAdmin();\n } catch (Throwable t) {\n t.printStackTrace();\n return false;\n }\n }", "EDataType getActivePower();", "@ZAttr(id=743)\n public boolean isAdminConsoleDNSCheckEnabled() {\n return getBooleanAttr(Provisioning.A_zimbraAdminConsoleDNSCheckEnabled, false);\n }", "private boolean isEnabled() {\n return isEnabled;\n }", "public String getEnableFlag() {\n\t\treturn enableFlag;\n\t}", "public Boolean isSuperAdmin() {\n\t\tif (superAdmin == null) {\n\t\t\tsuperAdmin = Boolean.FALSE;\n\t\t}\n\t\treturn superAdmin;\n\t}", "public boolean isEnabled(){\n return enabled;\n }", "boolean hasEnabled();", "public java.lang.Boolean getPwrreserve() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((java.lang.Boolean) __getCache(\"pwrreserve\")));\n }", "public PanelAdminConfig getAdminConfig(){\n return adminConfig;\n }" ]
[ "0.6571398", "0.6571398", "0.6571398", "0.6391092", "0.6387205", "0.63211393", "0.6305413", "0.62925166", "0.6182009", "0.6171032", "0.61365646", "0.6111711", "0.6102252", "0.60314983", "0.60097855", "0.60097855", "0.60051507", "0.59925115", "0.5949388", "0.59305865", "0.5926316", "0.59192425", "0.5916751", "0.58849275", "0.5876439", "0.5866056", "0.5850463", "0.580808", "0.5807848", "0.57907367", "0.5784156", "0.57745975", "0.5749268", "0.573735", "0.57318795", "0.5728053", "0.571734", "0.5711342", "0.56804603", "0.56699574", "0.56699574", "0.56699574", "0.56698334", "0.5668199", "0.56665707", "0.56659865", "0.5660973", "0.5644205", "0.5637826", "0.5637826", "0.5620293", "0.56131923", "0.55913544", "0.55891323", "0.55491763", "0.5548325", "0.5540606", "0.55263466", "0.5518082", "0.5518082", "0.5518082", "0.5518082", "0.5518082", "0.5516801", "0.551334", "0.5474062", "0.546468", "0.5455439", "0.5455439", "0.5452849", "0.5446952", "0.5446952", "0.5446952", "0.5446952", "0.5446952", "0.5446952", "0.5446952", "0.5446952", "0.5426439", "0.5401392", "0.5391527", "0.53767455", "0.53756756", "0.53727514", "0.536906", "0.5364304", "0.5361693", "0.53542703", "0.53537774", "0.5342475", "0.533926", "0.5323203", "0.5319054", "0.5314119", "0.5306005", "0.53057367", "0.53031385", "0.5300684", "0.5290603", "0.5282997" ]
0.5779985
31
Set administratively enables or disables this instance.
public void setEnable(Boolean enable) { this.enable = enable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAdmin(boolean value) {\r\n this.admin = value;\r\n }", "public boolean setEnabled(boolean enable);", "protected void enableActionSetMute()\n {\n Action action = new Action(\"SetMute\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyMute));\n iDelegateSetMute = new DoSetMute();\n enableAction(action, iDelegateSetMute);\n }", "void setAdminStatus(User user, boolean adminStatus);", "public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }", "public void setEnable(String name,boolean value) {\n\t\tgetButtonPanel().getButton(name).setEnabled(value);\n\t\tgetGameMenuBar().getItem(name).setEnabled(value);\n\t}", "void setEnable(boolean b) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "public void enable(){\r\n\t\tthis.activ = true;\r\n\t}", "public void toggleEnable();", "public void setEnabled(boolean enabled);", "public void setEnabled(boolean enabled);", "public void enable() {\r\n m_enabled = true;\r\n }", "public void setEnable (boolean state) {\n impl.setEnable (state);\n }", "public void enable() {\n operating = true;\n }", "public void setIsModifier(java.lang.Boolean value);", "@Override\n public Users setEnable(Integer id) {\n Users u = userdao.findUserById(id);\n if (u.isEnabled()) {\n u.setEnabled(false);//if enable is true ,admin changes it to false so user can't login app\n } else {\n u.setEnabled(true);//if enable is false,admin changes it to true,so he gives access for login to user\n }\n userdao.save(u);\n\n return u;\n }", "public void setEnabled(boolean aFlag) { _enabled = aFlag; }", "public void setIsAdmin(boolean isAdmin) {\r\n this.isAdmin = isAdmin;\r\n }", "public void setEnabled(boolean isEnable) throws SQLException\r\n\t{\r\n\t\tString SQL_USER = \"UPDATE user SET enabled=? WHERE id=?;\";\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Prepare the statement\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\r\n\t\t\t//Bind the variables\r\n\t\t\tstatement.setInt(1, (isEnable ? 1 : 0));\r\n\t\t\tstatement.setInt(2, userId);\r\n\r\n\t\t\t//Execute the update\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in SQL: Student->setEnabled(boolean \"+ isEnable+ \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}", "private void setDishBtnUsability(boolean enable){\n dishBtn1.setEnabled(enable);\n dishBtn2.setEnabled(enable);\n dishBtn3.setEnabled(enable);\n dishBtn4.setEnabled(enable);\n dishBtn5.setEnabled(enable);\n }", "public void enablePropertyMute()\n {\n iPropertyMute = new PropertyBool(new ParameterBool(\"Mute\"));\n addProperty(iPropertyMute);\n }", "public void enable();", "public void setAchieved(Boolean newValue);", "public void enableSelfView(boolean val);", "@Override\n public void setEnabled(boolean val) {\n super.setEnabled(val);\n mEnabled = val;\n }", "public void setAdmin( boolean admin )\n {\n this.admin = admin;\n }", "private void enableSet(){\n addSubmit.setDisable(true);\n removeSubmit.setDisable(true);\n setSubmit.setDisable(false);\n addCS.setDisable(true);\n removeCS.setDisable(true);\n setCS.setDisable(false);\n addIT.setDisable(true);\n removeIT.setDisable(true);\n setIT.setDisable(false);\n addECE.setDisable(true);\n removeECE.setDisable(true);\n setECE.setDisable(false);\n partTime.setDisable(true);\n fullTime.setDisable(true);\n management.setDisable(true);\n dateAddText.setDisable(true);\n dateRemoveText.setDisable(true);\n dateSetText.setDisable(false);\n nameAddText.setDisable(true);\n nameRemoveText.setDisable(true);\n nameSetText.setDisable(false);\n hourlyAddText.setDisable(true);\n annualAddText.setDisable(true);\n managerRadio.setDisable(true);\n dHeadRadio.setDisable(true);\n directorRadio.setDisable(true);\n //codeAddText.setDisable(true);\n hoursSetText.setDisable(false);\n }", "protected void enableActionMute()\n {\n Action action = new Action(\"Mute\");\n action.addOutputParameter(new ParameterRelated(\"Value\", iPropertyMute));\n iDelegateMute = new DoMute();\n enableAction(action, iDelegateMute);\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}", "@Override\r\n public void setEnabled(final boolean b) {\r\n _enabled = b;\r\n }", "public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}", "protected void setMemberActionsEnabled(boolean b) {\r\n\t\tfor (Enumeration<Action> en = this.memberActions.elements(); en.hasMoreElements();) {\r\n\t\t\ten.nextElement().setEnabled(b);\r\n\t\t}\r\n\t}", "void setGodPower(boolean b);", "public void setEnable(boolean b) { this.editText.setEnabled(b); }", "public void setEnabled(UIEvent.Type aType, boolean aValue) { getEventAdapter(true).setEnabled(aType, aValue); }", "public void setEnabled (boolean enabled) {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\tint flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;\r\n\tOS.PtSetResource (topHandle, OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST);\r\n}", "public void enable() {\n \t\t\tsetEnabled(true);\n \t\t}", "public void setEnabled(boolean value) {\n m_Enabled = value;\n }", "boolean updateEnabling();", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnabled(boolean value) {\n this.enabled = value;\n }", "void set(boolean on);", "public void toggleMod(){\r\n this.enabled = !this.enabled;\r\n this.onToggle();\r\n if(this.enabled)\r\n this.onEnable();\r\n else\r\n this.onDisable();\r\n }", "public abstract void setEnabled(Context context, boolean enabled);", "@Override\n\tpublic void setEnabled(boolean flag) {\n\t\t\n\t}", "public void setEnabled(boolean b) {\n setFocusable(b);\n other.setEnabled(b);\n }", "public void acivatePlayer() {\n\t\tthis.setEnabled(true);\n\t}", "public void setEnabled(boolean b) {\n // Not supported for MenuComponents\n }", "public void setAdmin(boolean admin) {\n this.admin = admin;\n }", "private void setScreenProperty(boolean on) throws DeviceNotAvailableException {\n CLog.d(\"set svc power stay on \" + on);\n mTestDevice.executeShellCommand(\"svc power stayon \" + on);\n }", "protected void enableActionSetVolume()\n {\n Action action = new Action(\"SetVolume\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyVolume));\n iDelegateSetVolume = new DoSetVolume();\n enableAction(action, iDelegateSetVolume);\n }", "public void enable() {\n\t\tenabled = true;\n\t\t//System.out.println(\"Enabled Controller\");\n\t}", "void setProtection(boolean value);", "public static void ToggleEnabled()\n {\n \t\tEnabled = !Enabled;\n \t\tConfigHandler.configFile.save();\n \t \t\n }", "public void setEnabled(final boolean enabled);", "boolean setSiteRights(SiteAdminRights r, boolean b);", "void setEditButtonEnabled(boolean isEnabled);", "public void setProtection(boolean value);", "public void setEnable(boolean enable) {\n this.enable = enable;\n }", "private void setEnabled(JButton a, boolean b) {\n\t\ta.setEnabled(b);\r\n\t}", "public void editEnabled(boolean enabled){\n }", "public void enableUpdates(boolean state) {\n sEnableUpdate = state;\n }", "public void setRestricted( boolean val ) {\n this.restricted = val;\n if ( !val && getFlow().getRestriction() != null ) {\n doCommand( new UpdateSegmentObject( getUser().getUsername(), getFlow(), \"restriction\", null ) );\n }\n }", "public void setbEnable(Boolean bEnable) {\n this.bEnable = bEnable;\n }", "private void actionChangedEstimatorSettingsManual ()\r\n\t{\r\n\t\tmainFormLink.getComponentPanelLeft().getCombobobxEstimatorBacteriaType().setEnabled(true);\r\n\t\tmainFormLink.getComponentPanelLeft().getComboboxEstimatorDrugType().setEnabled(true);\r\n\t}", "void setShowUnlockOption(boolean b);", "protected void enableActionSetDACConfig()\n {\n Action action = new Action(\"SetDACConfig\");\n action.addInputParameter(new ParameterRelated(\"DACConfig\", iPropertyDACConfig));\n iDelegateSetDACConfig = new DoSetDACConfig();\n enableAction(action, iDelegateSetDACConfig);\n }", "public void setIsadmin(Integer isadmin) {\r\n this.isadmin = isadmin;\r\n }", "public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}", "protected abstract void enable();", "public void enableSetRight(boolean state) {\r\n \t\tactionSetRight.setEnabled(state);\r\n \t}", "public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }", "public boolean Admin(int admin) {\n this.flag = admin;\n if (admin == 1) {\n flag = 1;\n return true;\n } else {\n flag = 0;\n return false;\n }\n }", "public boolean setPropertyMute(boolean aValue);", "public void setEnabled(boolean arg){\r\n\t\tenabled = arg;\r\n\t\tif(!arg){\r\n\t\t\tstop(0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsonido = new Sonido(path,true);\r\n\t\t}\r\n\t}", "public abstract void Enabled();", "protected void setEnabled(boolean state) {\n enabled = state;\n log.warn(\"{} command has been {}.\", name, state ? \"enabled\" : \"disabled\");\n }", "public void invertAdminStatus() {\n this.isAdmin = !(this.isAdmin);\n }", "void setPowerBox(boolean powerBox);", "public void setVmAttachedToPool(boolean value) {\n if (value) {\n // ==General Tab==\n getDataCenterWithClustersList().setIsChangeable(!value);\n getQuota().setIsChangeable(false);\n getCpuProfiles().setIsChangeable(false);\n\n getVmId().setIsChangeable(false);\n\n getNumOfDesktops().setIsChangeable(false);\n getPrestartedVms().setIsChangeable(false);\n getMaxAssignedVmsPerUser().setIsChangeable(false);\n\n getBaseTemplate().setIsChangeable(false);\n getTemplateWithVersion().setIsChangeable(false);\n getInstanceTypes().setIsChangeable(false);\n getMemSize().setIsChangeable(false);\n getTotalCPUCores().setIsChangeable(false);\n\n getCustomCpu().setIsChangeable(false);\n getEmulatedMachine().setIsChangeable(false);\n\n getCoresPerSocket().setIsChangeable(false);\n getNumOfSockets().setIsChangeable(false);\n getThreadsPerCore().setIsChangeable(false);\n getSerialNumberPolicy().setIsChangeable(false);\n\n getOSType().setIsChangeable(false);\n getIsStateless().setIsChangeable(false);\n getIsRunAndPause().setIsChangeable(false);\n getIsDeleteProtected().setIsChangeable(false);\n\n // ==Initial run Tab==\n getTimeZone().setIsChangeable(false);\n\n // ==Console Tab==\n getDisplayType().setIsChangeable(false);\n getGraphicsType().setIsChangeable(false);\n getUsbPolicy().setIsChangeable(false);\n getConsoleDisconnectAction().setIsChangeable(false);\n getNumOfMonitors().setIsChangeable(false);\n getIsSingleQxlEnabled().setIsChangeable(false);\n getIsSmartcardEnabled().setIsChangeable(false);\n getAllowConsoleReconnect().setIsChangeable(false);\n getVncKeyboardLayout().setIsChangeable(false);\n getSsoMethodNone().setIsChangeable(false);\n getSsoMethodGuestAgent().setIsChangeable(false);\n\n // ==Host Tab==\n getIsAutoAssign().setIsChangeable(false);\n getDefaultHost().setIsChangeable(false);\n getHostCpu().setIsChangeable(false);\n getMigrationMode().setIsChangeable(false);\n getCpuPinning().setIsChangeable(false);\n getMigrationDowntime().setIsChangeable(false);\n\n // ==Resource Allocation Tab==\n getMinAllocatedMemory().setIsChangeable(false);\n getProvisioning().setIsChangeable(false);\n getProvisioningThin_IsSelected().setIsChangeable(false);\n getProvisioningClone_IsSelected().setIsChangeable(false);\n getDisksAllocationModel().setIsChangeable(false);\n getIoThreadsEnabled().setIsChangeable(false);\n getNumOfIoThreads().setIsChangeable(false);\n\n // ==Boot Options Tab==\n getFirstBootDevice().setIsChangeable(false);\n getSecondBootDevice().setIsChangeable(false);\n getCdAttached().setIsChangeable(false);\n getCdImage().setIsChangeable(false);\n getKernel_path().setIsChangeable(false);\n getInitrd_path().setIsChangeable(false);\n getKernel_parameters().setIsChangeable(false);\n\n // ==Random Generator Tab==\n getIsRngEnabled().setIsChangeable(false);\n getRngPeriod().setIsChangeable(false);\n getRngBytes().setIsChangeable(false);\n getRngSourceRandom().setIsChangeable(false);\n getRngSourceHwrng().setIsChangeable(false);\n\n // ==Custom Properties Tab==\n getCustomProperties().setIsChangeable(false);\n getCustomPropertySheet().setIsChangeable(false);\n\n // ==Icon Tab==\n getIcon().setIsChangeable(false);\n\n vmAttachedToPool = true;\n }\n }", "public void enable(){\n if(criticalStop) return;\n getModel().setStatus(true);\n }", "public void enable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Brake);\n }", "private void enableControls(boolean b) {\n\n\t}", "public void setWhitelisted ( boolean value ) {\n\t\texecute ( handle -> handle.setWhitelisted ( value ) );\n\t}", "public void enable() {\n\t\tm_enabled = true;\n\t\tm_controller.reset();\n\t}", "public final void setDisabled(boolean value)\n {\n myDisabledProperty.set(value);\n }", "private void setEnabled(JLabel a, boolean b) {\n\t\ta.setEnabled(b);\r\n\t}", "public void setUserAdmin(boolean isUserAdmin) {\r\n this.userAdmin = isUserAdmin;\r\n }", "protected void enableActionSetBalance()\n {\n Action action = new Action(\"SetBalance\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyBalance));\n iDelegateSetBalance = new DoSetBalance();\n enableAction(action, iDelegateSetBalance);\n }", "void setAccessible(boolean accessible);", "public void setEnabled(boolean newValue) {\n this.isEnabled = newValue;\n if (newValue) {\n if (isInternalSensor) {\n InternalSensors.getInstance().enableInternalSensor(this);\n } else {\n // TODO: enable external sensors\n }\n } else {\n saveSensor();\n if (isInternalSensor) {\n InternalSensors.getInstance().disableInternalSensor(this);\n } else {\n // TODO: disable external sensors\n }\n }\n }", "Boolean vmScaleSetEnabled();", "protected final void setGUIAttributes(){\r\n\t\t\r\n\t\tbtnOnOff.setEnabled( device.getOn() != null && device.getOn().getActor() != null);\r\n\t\tif(device.getOn() == null){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if the device is On\r\n\t\tif( device.getOnValue()){\r\n\t\t\tbtnOnOff.setText( \"Turn device Off\");\r\n\t\t// if the device is Off\r\n\t\t}else{\r\n\t\t\tbtnOnOff.setText( \"Turn device On\");\r\n\t\t}\r\n\t\tsetGUIAttributesHelper();\r\n\t}", "protected void setPrivileges(PrivilegeSet ps) { this.privileges = ps; }" ]
[ "0.6419561", "0.6231104", "0.6221474", "0.6174647", "0.6041686", "0.60346705", "0.6023364", "0.5994099", "0.5994099", "0.5994099", "0.5994099", "0.59853876", "0.59833944", "0.59608835", "0.59608835", "0.5891265", "0.5809258", "0.5769246", "0.5749548", "0.57445645", "0.57173026", "0.5709068", "0.57033616", "0.56934756", "0.56923217", "0.56830835", "0.5678162", "0.56739855", "0.5671647", "0.5668852", "0.56662714", "0.5654187", "0.5647961", "0.5630477", "0.5629004", "0.5615753", "0.5610065", "0.56066704", "0.5606217", "0.5603304", "0.55939305", "0.55844885", "0.55833036", "0.55799013", "0.55767643", "0.5548824", "0.554064", "0.5514192", "0.5495258", "0.54869074", "0.548554", "0.54849684", "0.5483186", "0.5482147", "0.5472759", "0.54699004", "0.5467478", "0.5443122", "0.544271", "0.54418826", "0.54384273", "0.5412658", "0.540859", "0.5395774", "0.53941435", "0.53900945", "0.5387799", "0.53830075", "0.53738356", "0.5373835", "0.5366628", "0.53538114", "0.53382784", "0.53316057", "0.5323296", "0.5323249", "0.53205127", "0.5319491", "0.5307039", "0.5299404", "0.5282465", "0.5281361", "0.5279575", "0.5275529", "0.52753764", "0.5270868", "0.5265137", "0.5262776", "0.52627033", "0.5262208", "0.52553934", "0.5249577", "0.52469856", "0.5243911", "0.52436864", "0.5233947", "0.5226099", "0.522609", "0.52242124", "0.5223223" ]
0.54428387
58
Set administratively enables or disables this instance.
public RequestCategory withEnable(Boolean enable) { this.enable = enable; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAdmin(boolean value) {\r\n this.admin = value;\r\n }", "public boolean setEnabled(boolean enable);", "protected void enableActionSetMute()\n {\n Action action = new Action(\"SetMute\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyMute));\n iDelegateSetMute = new DoSetMute();\n enableAction(action, iDelegateSetMute);\n }", "void setAdminStatus(User user, boolean adminStatus);", "public void setEnabled(Boolean value) { this.myEnabled = value.booleanValue(); }", "public void setEnable(String name,boolean value) {\n\t\tgetButtonPanel().getButton(name).setEnabled(value);\n\t\tgetGameMenuBar().getItem(name).setEnabled(value);\n\t}", "void setEnable(boolean b) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "void setEnabled(boolean enabled);", "public void enable(){\r\n\t\tthis.activ = true;\r\n\t}", "public void toggleEnable();", "public void setEnabled(boolean enabled);", "public void setEnabled(boolean enabled);", "public void enable() {\r\n m_enabled = true;\r\n }", "public void setEnable (boolean state) {\n impl.setEnable (state);\n }", "public void enable() {\n operating = true;\n }", "public void setIsModifier(java.lang.Boolean value);", "@Override\n public Users setEnable(Integer id) {\n Users u = userdao.findUserById(id);\n if (u.isEnabled()) {\n u.setEnabled(false);//if enable is true ,admin changes it to false so user can't login app\n } else {\n u.setEnabled(true);//if enable is false,admin changes it to true,so he gives access for login to user\n }\n userdao.save(u);\n\n return u;\n }", "public void setEnabled(boolean aFlag) { _enabled = aFlag; }", "public void setIsAdmin(boolean isAdmin) {\r\n this.isAdmin = isAdmin;\r\n }", "public void setEnabled(boolean isEnable) throws SQLException\r\n\t{\r\n\t\tString SQL_USER = \"UPDATE user SET enabled=? WHERE id=?;\";\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Prepare the statement\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\r\n\t\t\t//Bind the variables\r\n\t\t\tstatement.setInt(1, (isEnable ? 1 : 0));\r\n\t\t\tstatement.setInt(2, userId);\r\n\r\n\t\t\t//Execute the update\r\n\t\t\tstatement.executeUpdate();\r\n\r\n\t\t} catch (SQLException e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in SQL: Student->setEnabled(boolean \"+ isEnable+ \")\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\t\r\n\t\t}\t\t\r\n\t\t//commit change\r\n\t\tDatabase.get().commit();\r\n\t}", "private void setDishBtnUsability(boolean enable){\n dishBtn1.setEnabled(enable);\n dishBtn2.setEnabled(enable);\n dishBtn3.setEnabled(enable);\n dishBtn4.setEnabled(enable);\n dishBtn5.setEnabled(enable);\n }", "public void enablePropertyMute()\n {\n iPropertyMute = new PropertyBool(new ParameterBool(\"Mute\"));\n addProperty(iPropertyMute);\n }", "public void enable();", "public void setAchieved(Boolean newValue);", "public void enableSelfView(boolean val);", "@Override\n public void setEnabled(boolean val) {\n super.setEnabled(val);\n mEnabled = val;\n }", "public void setAdmin( boolean admin )\n {\n this.admin = admin;\n }", "private void enableSet(){\n addSubmit.setDisable(true);\n removeSubmit.setDisable(true);\n setSubmit.setDisable(false);\n addCS.setDisable(true);\n removeCS.setDisable(true);\n setCS.setDisable(false);\n addIT.setDisable(true);\n removeIT.setDisable(true);\n setIT.setDisable(false);\n addECE.setDisable(true);\n removeECE.setDisable(true);\n setECE.setDisable(false);\n partTime.setDisable(true);\n fullTime.setDisable(true);\n management.setDisable(true);\n dateAddText.setDisable(true);\n dateRemoveText.setDisable(true);\n dateSetText.setDisable(false);\n nameAddText.setDisable(true);\n nameRemoveText.setDisable(true);\n nameSetText.setDisable(false);\n hourlyAddText.setDisable(true);\n annualAddText.setDisable(true);\n managerRadio.setDisable(true);\n dHeadRadio.setDisable(true);\n directorRadio.setDisable(true);\n //codeAddText.setDisable(true);\n hoursSetText.setDisable(false);\n }", "protected void enableActionMute()\n {\n Action action = new Action(\"Mute\");\n action.addOutputParameter(new ParameterRelated(\"Value\", iPropertyMute));\n iDelegateMute = new DoMute();\n enableAction(action, iDelegateMute);\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void enable()\r\n\t{\r\n\t\tenabled = true;\r\n\t}", "@Override\r\n public void setEnabled(final boolean b) {\r\n _enabled = b;\r\n }", "public void enable ( ) {\r\n\t\tenabled = true;\r\n\t}", "protected void setMemberActionsEnabled(boolean b) {\r\n\t\tfor (Enumeration<Action> en = this.memberActions.elements(); en.hasMoreElements();) {\r\n\t\t\ten.nextElement().setEnabled(b);\r\n\t\t}\r\n\t}", "void setGodPower(boolean b);", "public void setEnable(boolean b) { this.editText.setEnabled(b); }", "public void setEnabled(UIEvent.Type aType, boolean aValue) { getEventAdapter(true).setEnabled(aType, aValue); }", "public void setEnabled (boolean enabled) {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\tint flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;\r\n\tOS.PtSetResource (topHandle, OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST);\r\n}", "public void enable() {\n \t\t\tsetEnabled(true);\n \t\t}", "public void setEnabled(boolean value) {\n m_Enabled = value;\n }", "boolean updateEnabling();", "public void setEnable(Boolean enable) {\n this.enable = enable;\n }", "public void setEnabled(boolean value) {\n this.enabled = value;\n }", "void set(boolean on);", "public void toggleMod(){\r\n this.enabled = !this.enabled;\r\n this.onToggle();\r\n if(this.enabled)\r\n this.onEnable();\r\n else\r\n this.onDisable();\r\n }", "public abstract void setEnabled(Context context, boolean enabled);", "@Override\n\tpublic void setEnabled(boolean flag) {\n\t\t\n\t}", "public void acivatePlayer() {\n\t\tthis.setEnabled(true);\n\t}", "public void setEnabled(boolean b) {\n setFocusable(b);\n other.setEnabled(b);\n }", "public void setEnabled(boolean b) {\n // Not supported for MenuComponents\n }", "public void setAdmin(boolean admin) {\n this.admin = admin;\n }", "private void setScreenProperty(boolean on) throws DeviceNotAvailableException {\n CLog.d(\"set svc power stay on \" + on);\n mTestDevice.executeShellCommand(\"svc power stayon \" + on);\n }", "protected void enableActionSetVolume()\n {\n Action action = new Action(\"SetVolume\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyVolume));\n iDelegateSetVolume = new DoSetVolume();\n enableAction(action, iDelegateSetVolume);\n }", "public void enable() {\n\t\tenabled = true;\n\t\t//System.out.println(\"Enabled Controller\");\n\t}", "void setProtection(boolean value);", "public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}", "public static void ToggleEnabled()\n {\n \t\tEnabled = !Enabled;\n \t\tConfigHandler.configFile.save();\n \t \t\n }", "public void setEnabled(final boolean enabled);", "boolean setSiteRights(SiteAdminRights r, boolean b);", "void setEditButtonEnabled(boolean isEnabled);", "public void setProtection(boolean value);", "public void setEnable(boolean enable) {\n this.enable = enable;\n }", "private void setEnabled(JButton a, boolean b) {\n\t\ta.setEnabled(b);\r\n\t}", "public void editEnabled(boolean enabled){\n }", "public void enableUpdates(boolean state) {\n sEnableUpdate = state;\n }", "public void setRestricted( boolean val ) {\n this.restricted = val;\n if ( !val && getFlow().getRestriction() != null ) {\n doCommand( new UpdateSegmentObject( getUser().getUsername(), getFlow(), \"restriction\", null ) );\n }\n }", "public void setbEnable(Boolean bEnable) {\n this.bEnable = bEnable;\n }", "private void actionChangedEstimatorSettingsManual ()\r\n\t{\r\n\t\tmainFormLink.getComponentPanelLeft().getCombobobxEstimatorBacteriaType().setEnabled(true);\r\n\t\tmainFormLink.getComponentPanelLeft().getComboboxEstimatorDrugType().setEnabled(true);\r\n\t}", "void setShowUnlockOption(boolean b);", "protected void enableActionSetDACConfig()\n {\n Action action = new Action(\"SetDACConfig\");\n action.addInputParameter(new ParameterRelated(\"DACConfig\", iPropertyDACConfig));\n iDelegateSetDACConfig = new DoSetDACConfig();\n enableAction(action, iDelegateSetDACConfig);\n }", "public void setIsadmin(Integer isadmin) {\r\n this.isadmin = isadmin;\r\n }", "protected abstract void enable();", "public void setEnable(Boolean enable) {\n\t\tthis.enable = enable;\n\t}", "public void enableSetRight(boolean state) {\r\n \t\tactionSetRight.setEnabled(state);\r\n \t}", "public void enableSmartImprovement() { this.exec = this.exec.withProperty(\"sm.improve\", true); }", "public boolean Admin(int admin) {\n this.flag = admin;\n if (admin == 1) {\n flag = 1;\n return true;\n } else {\n flag = 0;\n return false;\n }\n }", "public boolean setPropertyMute(boolean aValue);", "public abstract void Enabled();", "public void setEnabled(boolean arg){\r\n\t\tenabled = arg;\r\n\t\tif(!arg){\r\n\t\t\tstop(0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsonido = new Sonido(path,true);\r\n\t\t}\r\n\t}", "protected void setEnabled(boolean state) {\n enabled = state;\n log.warn(\"{} command has been {}.\", name, state ? \"enabled\" : \"disabled\");\n }", "public void invertAdminStatus() {\n this.isAdmin = !(this.isAdmin);\n }", "void setPowerBox(boolean powerBox);", "public void setVmAttachedToPool(boolean value) {\n if (value) {\n // ==General Tab==\n getDataCenterWithClustersList().setIsChangeable(!value);\n getQuota().setIsChangeable(false);\n getCpuProfiles().setIsChangeable(false);\n\n getVmId().setIsChangeable(false);\n\n getNumOfDesktops().setIsChangeable(false);\n getPrestartedVms().setIsChangeable(false);\n getMaxAssignedVmsPerUser().setIsChangeable(false);\n\n getBaseTemplate().setIsChangeable(false);\n getTemplateWithVersion().setIsChangeable(false);\n getInstanceTypes().setIsChangeable(false);\n getMemSize().setIsChangeable(false);\n getTotalCPUCores().setIsChangeable(false);\n\n getCustomCpu().setIsChangeable(false);\n getEmulatedMachine().setIsChangeable(false);\n\n getCoresPerSocket().setIsChangeable(false);\n getNumOfSockets().setIsChangeable(false);\n getThreadsPerCore().setIsChangeable(false);\n getSerialNumberPolicy().setIsChangeable(false);\n\n getOSType().setIsChangeable(false);\n getIsStateless().setIsChangeable(false);\n getIsRunAndPause().setIsChangeable(false);\n getIsDeleteProtected().setIsChangeable(false);\n\n // ==Initial run Tab==\n getTimeZone().setIsChangeable(false);\n\n // ==Console Tab==\n getDisplayType().setIsChangeable(false);\n getGraphicsType().setIsChangeable(false);\n getUsbPolicy().setIsChangeable(false);\n getConsoleDisconnectAction().setIsChangeable(false);\n getNumOfMonitors().setIsChangeable(false);\n getIsSingleQxlEnabled().setIsChangeable(false);\n getIsSmartcardEnabled().setIsChangeable(false);\n getAllowConsoleReconnect().setIsChangeable(false);\n getVncKeyboardLayout().setIsChangeable(false);\n getSsoMethodNone().setIsChangeable(false);\n getSsoMethodGuestAgent().setIsChangeable(false);\n\n // ==Host Tab==\n getIsAutoAssign().setIsChangeable(false);\n getDefaultHost().setIsChangeable(false);\n getHostCpu().setIsChangeable(false);\n getMigrationMode().setIsChangeable(false);\n getCpuPinning().setIsChangeable(false);\n getMigrationDowntime().setIsChangeable(false);\n\n // ==Resource Allocation Tab==\n getMinAllocatedMemory().setIsChangeable(false);\n getProvisioning().setIsChangeable(false);\n getProvisioningThin_IsSelected().setIsChangeable(false);\n getProvisioningClone_IsSelected().setIsChangeable(false);\n getDisksAllocationModel().setIsChangeable(false);\n getIoThreadsEnabled().setIsChangeable(false);\n getNumOfIoThreads().setIsChangeable(false);\n\n // ==Boot Options Tab==\n getFirstBootDevice().setIsChangeable(false);\n getSecondBootDevice().setIsChangeable(false);\n getCdAttached().setIsChangeable(false);\n getCdImage().setIsChangeable(false);\n getKernel_path().setIsChangeable(false);\n getInitrd_path().setIsChangeable(false);\n getKernel_parameters().setIsChangeable(false);\n\n // ==Random Generator Tab==\n getIsRngEnabled().setIsChangeable(false);\n getRngPeriod().setIsChangeable(false);\n getRngBytes().setIsChangeable(false);\n getRngSourceRandom().setIsChangeable(false);\n getRngSourceHwrng().setIsChangeable(false);\n\n // ==Custom Properties Tab==\n getCustomProperties().setIsChangeable(false);\n getCustomPropertySheet().setIsChangeable(false);\n\n // ==Icon Tab==\n getIcon().setIsChangeable(false);\n\n vmAttachedToPool = true;\n }\n }", "public void enable(){\n if(criticalStop) return;\n getModel().setStatus(true);\n }", "public void enable() {\n TalonHelper.configNeutralMode(Arrays.asList(armMotor, armMotorSlave), NeutralMode.Brake);\n }", "private void enableControls(boolean b) {\n\n\t}", "public void setWhitelisted ( boolean value ) {\n\t\texecute ( handle -> handle.setWhitelisted ( value ) );\n\t}", "public void enable() {\n\t\tm_enabled = true;\n\t\tm_controller.reset();\n\t}", "public final void setDisabled(boolean value)\n {\n myDisabledProperty.set(value);\n }", "private void setEnabled(JLabel a, boolean b) {\n\t\ta.setEnabled(b);\r\n\t}", "public void setUserAdmin(boolean isUserAdmin) {\r\n this.userAdmin = isUserAdmin;\r\n }", "protected void enableActionSetBalance()\n {\n Action action = new Action(\"SetBalance\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyBalance));\n iDelegateSetBalance = new DoSetBalance();\n enableAction(action, iDelegateSetBalance);\n }", "void setAccessible(boolean accessible);", "public void setEnabled(boolean newValue) {\n this.isEnabled = newValue;\n if (newValue) {\n if (isInternalSensor) {\n InternalSensors.getInstance().enableInternalSensor(this);\n } else {\n // TODO: enable external sensors\n }\n } else {\n saveSensor();\n if (isInternalSensor) {\n InternalSensors.getInstance().disableInternalSensor(this);\n } else {\n // TODO: disable external sensors\n }\n }\n }", "Boolean vmScaleSetEnabled();", "protected final void setGUIAttributes(){\r\n\t\t\r\n\t\tbtnOnOff.setEnabled( device.getOn() != null && device.getOn().getActor() != null);\r\n\t\tif(device.getOn() == null){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// if the device is On\r\n\t\tif( device.getOnValue()){\r\n\t\t\tbtnOnOff.setText( \"Turn device Off\");\r\n\t\t// if the device is Off\r\n\t\t}else{\r\n\t\t\tbtnOnOff.setText( \"Turn device On\");\r\n\t\t}\r\n\t\tsetGUIAttributesHelper();\r\n\t}", "protected void setPrivileges(PrivilegeSet ps) { this.privileges = ps; }" ]
[ "0.64202017", "0.6230282", "0.6220962", "0.61749375", "0.6040816", "0.60338485", "0.60228777", "0.5993359", "0.5993359", "0.5993359", "0.5993359", "0.59853965", "0.59836406", "0.59602296", "0.59602296", "0.58912253", "0.5808758", "0.57698286", "0.57492757", "0.5744762", "0.5716313", "0.5709607", "0.5703076", "0.5693208", "0.5691634", "0.568353", "0.56776404", "0.5673111", "0.5670685", "0.56694186", "0.56660366", "0.56543994", "0.56474423", "0.56298983", "0.56288266", "0.5614827", "0.5609924", "0.5606916", "0.5605653", "0.56028706", "0.55937177", "0.5583499", "0.55832934", "0.55796325", "0.5576873", "0.5548247", "0.55403435", "0.55131596", "0.5495208", "0.5486056", "0.54848784", "0.5484122", "0.548372", "0.5481423", "0.5473402", "0.546996", "0.5467331", "0.54433995", "0.54423904", "0.54422903", "0.54421884", "0.54375905", "0.54119074", "0.54081154", "0.53955555", "0.53935593", "0.5389363", "0.5387173", "0.53829587", "0.53731114", "0.5372933", "0.5366046", "0.5353877", "0.5337752", "0.5332114", "0.5323287", "0.5322693", "0.53204894", "0.5318741", "0.530792", "0.52990466", "0.5281802", "0.5281281", "0.527959", "0.5277296", "0.5275167", "0.5269907", "0.52659065", "0.52623266", "0.52622813", "0.5261877", "0.5255393", "0.5249579", "0.5246147", "0.5244326", "0.5243446", "0.5233124", "0.5225965", "0.52257913", "0.5223722", "0.52230936" ]
0.0
-1
Get an RCAT is a string that represents a request category used for policy enforcement.
public String getRcaT() { return rcaT; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getTermcat() {\r\n return (String) getAttributeInternal(TERMCAT);\r\n }", "String category();", "public String toString() {\n\t\treturn category;\n\t}", "public String getCat() {\n\t\treturn this.cat;\n\t}", "public String getPrmCategCode() {\n return (String)getAttributeInternal(PRMCATEGCODE);\n }", "public String getCncategory() {\n return cncategory;\n }", "public RequestCategory withRcaT(String rcaT) {\n\t\tthis.rcaT = rcaT;\n\t\treturn this;\n\t}", "private Object getAnomizedCategory() {\r\n\tString categorie = (String) record.get(\"categorie\");\r\n\tif (categorie != null) {\r\n\t switch (categorie) {\r\n\t case \"AD\":\r\n\t case \"CO\":\r\n\t case \"FI\":\r\n\t case \"IBL\":\r\n\t case \"KI\":\r\n\t case \"KL\":\r\n\t case \"VO\":\r\n\t\tbreak;\r\n\t default:\r\n\t\tcategorie = null;\r\n\t\tbreak;\r\n\t }\r\n\t}\r\n\r\n\treturn categorie;\r\n }", "public String getCategoryString(){\r\n\t\tMarketplaceConfig.Category c = MarketplaceConfig.Category.get(this.category);\r\n\t\tif(c == null || c.name() == null || \"\".equals(c.name())) return \"NONE\";\r\n\t\treturn c.name();\r\n\t}", "String getCategory();", "String getCategory();", "public String getCategory() {\t//TODO - change to array list of categories\n\t\treturn category;\n\t}", "public int getR_Category_ID();", "protected final String getCategory() {\n\t\tString category = null;\n\n\t\tif (getSplit() != null) {\n\t\t\tcategory = getSplit();\n\t\t} else {\n\t\t\tcategory = getForm().getPayTo();\n\t\t}\n\n\t\treturn category;\n\t}", "private RunnerInfo.Category stringToCat(String catStr) {\n if (catStr.contains(\"Femme\")) {\n return RunnerInfo.Category.WOMEN;\n } else {\n return RunnerInfo.Category.MEN;\n }\n }", "protected static String getConceptClassNameForCategory(Category category) {\n if (category == Category.CHIRURGIE) {\n return \"Procedure\";\n }\n if (category == Category.LABORATOIRE) {\n return \"Test\";\n }\n if (category == Category.MEDICAMENTS) {\n return \"Drug\";\n }\n return \"Misc\";\n }", "public int getSSRCategory() {\n return ssrCategory;\n }", "public String category() {\n return this.category;\n }", "public String category() {\n return this.category;\n }", "public int getCategory(){\n\t\treturn this.cat;\n\t}", "public String getCatName() {\n return (String)getAttributeInternal(CATNAME);\n }", "public java.lang.String getDocumentCategory()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DOCUMENTCATEGORY$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }", "public java.lang.String getCategory() {\n return category;\n }", "public String getCategory()\r\n {\r\n return (m_category);\r\n }", "public String getCategCode() {\n return (String) getAttributeInternal(CATEGCODE);\n }", "public java.lang.Integer getAdditionalCategoryCat() {\r\n return additionalCategoryCat;\r\n }", "public String getCategory()\n {\n return (String) getProperty(PropertyIDMap.PID_CATEGORY);\n }", "@AutoEscape\n public String getCategory();", "CodeType getCategory();", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "public int getOriginalCat() {\n\t\tif (originalCat!=-2) return originalCat;\n\t\tif (fwList==null) return originalCat = -1;\n\t\tContentWord firstFullWord = fwList.first(); \t\t\n\t\tif (firstFullWord.isVerbOrAdjVerb()) return originalCat = 0;\n\t\tif (firstFullWord.isAdverb()) return originalCat = 1;\n\t\tif (firstFullWord.isNounOrNPnumb()) return originalCat = 2;\n\t\tif (firstFullWord.isAdjective()) return originalCat = 3;\t\t\n\t\treturn originalCat = -1;\n\t}", "public String getAttributeCategory()\n {\n return (String)getAttributeInternal(ATTRIBUTECATEGORY);\n }", "java.lang.String getCit();", "public String getCategory();", "public String viewCategory() {\n ConversationContext<Category> ctx = CategoryController.newEditContext(getPart().getCategory());\n ctx.setLabelWithKey(\"part_category\");\n getCurrentConversation().setNextContextSubReadOnly(ctx);\n return ctx.view();\n }", "public String getCategory()\n\t{\n\t\treturn category;\n\t}", "private Category getCategory()\n\t{\n\t\tSystem.out.println(\"------------------------------------------------------------\");\n\t\tSystem.out.println(\"Choose category:\");\n\t\tint i = 1;\n\t\tfor(Category category : Category.values())\n\t\t{\n\t\t\tSystem.out.println(i + \": \"+category.getCategoryDescription());\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println(\"------------------------------------------------------------\");\n\t\tString userChoiceStr = scanner.nextLine();\n\t\tint userChoice;\n\t\ttry\n\t\t{\n\t\t\tuserChoice = Integer.parseInt(userChoiceStr);\n\t\t}\n\t\tcatch(NumberFormatException e)\n\t\t{\n\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif(userChoice<1 || userChoice>25)\n\t\t{\n//\t\t\tSystem.out.println(\"Invalid category code\");\n\t\t\treturn null;\n\t\t}\n\t\tCategory category;\n\t\tswitch (userChoice) \n\t\t{\n\t\t\tcase 1: category = Category.ARTS; break;\n\t\t\tcase 2: category = Category.AUTOMOTIVE; break;\n\t\t\tcase 3: category = Category.BABY; break;\n\t\t\tcase 4: category = Category.BEAUTY; break;\n\t\t\tcase 5: category = Category.BOOKS; break;\n\t\t\tcase 6: category = Category.COMPUTERS; break;\n\t\t\tcase 7: category = Category.CLOTHING;break;\n\t\t\tcase 8: category = Category.ELECTRONICS; break;\n\t\t\tcase 9: category = Category.FASHION; break;\n\t\t\tcase 10: category = Category.FINANCE; break;\n\t\t\tcase 11: category = Category.FOOD; break;\n\t\t\tcase 12: category = Category.HEALTH; break;\n\t\t\tcase 13: category = Category.HOME; break;\n\t\t\tcase 14: category = Category.LIFESTYLE; break;\n\t\t\tcase 15: category = Category.MOVIES; break;\n\t\t\tcase 16: category = Category.MUSIC; break;\n\t\t\tcase 17: category = Category.OUTDOORS; break;\n\t\t\tcase 18: category = Category.PETS; break;\n\t\t\tcase 19: category = Category.RESTAURANTS; break;\n\t\t\tcase 20: category = Category.SHOES; break;\n\t\t\tcase 21: category = Category.SOFTWARE; break;\n\t\t\tcase 22: category = Category.SPORTS; break;\n\t\t\tcase 23: category = Category.TOOLS; break;\n\t\t\tcase 24: category = Category.TRAVEL; break;\n\t\t\tcase 25: category = Category.VIDEOGAMES; break;\n\t\t\tdefault: category = null;System.out.println(\"No such category\"); break;\n\t\t}\n\t\treturn category;\n\t}", "public String getRouteCategory() {\n\t\treturn routeCategory;\n\t}", "public String categoryDesc() { //to show the description of the category\n String desc = \"\";\n if (category.equals(\"H\")) {\n desc = \"Trump category: Hardness\";\n } else if (category.equals(\"S\")) {\n desc = \"Trump category: Specific Gravity\";\n } else if (category.equals(\"C\")) {\n desc = \"Trump category: Cleavage\";\n } else if (category.equals(\"CA\")) {\n desc = \"Trump category: Crustal Abundance\";\n } else if (category.equals(\"EV\")) {\n desc = \"Trump category: Economic Value\";\n }\n return desc;\n }", "private Category classify() {\n Category category = null;\n if (name != null) {\n if (name.contains(\"potato\") || name.contains(\"apple\")) {\n category = Category.FOOD;\n } else if (name.contains(\"cloths\") || name.contains(\"pants\") || name.contains(\"shirt\")) {\n category = Category.CLOTHING;\n }\n }\n return category;\n }", "public String getCategory() {\n\t\treturn category;\n\t}", "public String getCategory() {\n\t\treturn category;\n\t}", "public String getCategory() {\r\n return category;\r\n }", "@java.lang.Override public google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory() {\n @SuppressWarnings(\"deprecation\")\n google.maps.fleetengine.v1.Vehicle.VehicleType.Category result = google.maps.fleetengine.v1.Vehicle.VehicleType.Category.valueOf(category_);\n return result == null ? google.maps.fleetengine.v1.Vehicle.VehicleType.Category.UNRECOGNIZED : result;\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory getRoomCategoryReq(RoomCategory roomCategory){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory roomCategoryReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory();\n\t\t\n\t\troomCategoryReq.setHotelId( new Integer( roomCategory.getHotelId() ) );\n\t\troomCategoryReq.setRoomCategoryId( new Integer( roomCategory.getRoomCategoryId() ) );\n\n\t\troomCategoryReq.setRoomTypeCode( roomCategory.getRoomTypeCode() );\n\t\tString desc = roomCategory.getRoomTypeDescription();\n if(desc!=null && desc.contains(\":\")){\n String split[]=desc.split(\":\");\n String description= split[0]+split[split.length-1];\n System.out.println(description);\n roomCategoryReq.setRoomTypeDescription(description); \n }else{\n \troomCategoryReq.setRoomTypeDescription( roomCategory.getRoomTypeDescription()!=null? roomCategory.getRoomTypeDescription().replaceAll(\": \", \"\"):\"\" );\n }\n//\t\tString roomTypeCode = roomCategory.getRoomTypeCode();\n//\t\tif(roomTypeCode.contains(\"-RD-\")) {\n//\t\t\tString [] splitRoomTypeCode = null;\n//\t\t\tsplitRoomTypeCode = roomTypeCode.split(\"-RD-\");\n//\t\t\troomCategoryReq.setRoomTypeCode(splitRoomTypeCode[0]);\n//\t\t\troomCategoryReq.setRoomTypeDescription(splitRoomTypeCode[1]);\n//\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\troomCategoryReq.setRatePlanId( roomCategory.getRatePlanId() );\n\t\troomCategoryReq.setRatePlanCode( roomCategory.getRatePlanCode() );\n\t\troomCategoryReq.setRatePlanDescription( roomCategory.getRatePlanDescription() );\n\t\troomCategoryReq.setRateIndicator( roomCategory.getRateIndicator() );\n\t\troomCategoryReq.setCorporateId( roomCategory.getCorporateId() );\n\t\troomCategoryReq.setGuaranteeType( roomCategory.getGuaranteeType() );\n\t\troomCategoryReq.setGuaranteeMethod( roomCategory.getGuaranteeMethod() );\n\t\troomCategoryReq.setGuaranteeRequired( roomCategory.getGuaranteeRequired() );\n\t\troomCategoryReq.setGuaranteeAmount( new Double( roomCategory.getGuaranteeAmount() ) );\n\t\troomCategoryReq.setRatePlanCategory( roomCategory.getRatePlanCategory() );\n\t\troomCategoryReq.setNoOfRoomsAvailable( new Integer( roomCategory.getNoOfRoomsAvailable() ) );\n\t\troomCategoryReq.setStatus( roomCategory.getStatus() );\n\t\troomCategoryReq.setCurrency( roomCategory.getCurrency() );\n\t\troomCategoryReq.setPosnr( roomCategory.getPosnr() );\n\t\troomCategoryReq.setOldPosnr( roomCategory.getOldPosnr() );\n\t\troomCategoryReq.setRiskRoomCategory( new Boolean( roomCategory.isRiskRoomCategory() ) );\n\t\troomCategoryReq.setAppleChoice( new Boolean( roomCategory.getAppleChoice() ) );\n\t\troomCategoryReq.setMealplanDesc( roomCategory.getMealplanDesc() );\n\t\tif( roomCategory.getDisplayRoomPrice()!= null ){\n\t\t\troomCategoryReq.setDisplayRoomPrice( this.getRoomPriceReq( roomCategory.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( roomCategory.getMealPlanType() != null ){\n\t\t\troomCategoryReq.setMealPlanType( this.getMealPlanTypeReq( roomCategory.getMealPlanType() ) );\n\t\t}\n\t\t\n\t\tif( (roomCategory.getRoomPrices() != null) && (roomCategory.getRoomPrices().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getRoomPrices().size(); i++){\n\t\t\t\troomCategoryReq.getRoomPrices().add( this.getRoomPriceReq(roomCategory.getRoomPrices().get(i)));\n\t\t\t}\n\t\t}\n\t\tif( (roomCategory.getAmenities() != null) && (roomCategory.getAmenities().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getAmenities().size(); i++){\n\t\t\t\troomCategoryReq.getAmenities().add( this.getAmenityReq( roomCategory.getAmenities().get(i) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getHbsiRates()!=null && roomCategory.getHbsiRates().size()>0)\n\t\t{\n\t\t\tHBSiRates hbsi;\n\t\t\t \n\t\t\tfor(int hbsiRate=0;hbsiRate<roomCategory.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject hbsiRateObject = roomCategory.getHbsiRates().get(hbsiRate);\n\t\t\t\t\tif(hbsiRateObject instanceof HBSiRates)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(hbsiRate,this.getHBSiRateReq(roomCategory.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t}\n//\t\t\t\t\telse \tif(hbsiRateObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject hbsiAsObject = (ASObject)hbsiRateObject;\n//\t\t\t\t\t\thbsiAsObject.setType(\"com.kcdata.abe.data.dto.HBSiRates\");\n//\t\t\t\t\t\thbsi= (HBSiRates)ast.convert(hbsiAsObject, HBSiRates.class);\n//\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(this.getHBSiRateReq(hbsi));\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set cancel Policy\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getCancelPolicy()!=null && roomCategory.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tcom.kcdata.abe.data.dto.CancelPolicy cancelPolicy;\n\t\t\t\n\t\t\tfor(int cancel=0;cancel<roomCategory.getCancelPolicy().size();cancel++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getCancelPolicy().get(cancel)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject cancelObject = roomCategory.getCancelPolicy().get(cancel);\n\t\t\t\t\tif(cancelObject instanceof com.kcdata.abe.data.dto.CancelPolicy)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(cancel,this.getCancelPolicyReq(roomCategory.getCancelPolicy().get(cancel)));\n\t\t\t\t\t}\n//\t\t\t\t\telse if(cancelObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject cancelASObject = (ASObject)cancelObject;\n//\t\t\t\t\t\tcancelASObject.setType(\"com.kcdata.abe.data.dto.CancelPolicy\");\n//\t\t\t\t\t\tcancelPolicy=(com.kcdata.abe.data.dto.CancelPolicy)ast.convert(cancelASObject, com.kcdata.abe.data.dto.CancelPolicy.class);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(this.getCancelPolicyReq(cancelPolicy));\n//\t\t\t\t\t\t\n//\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn roomCategoryReq;\n\t}", "public java.lang.String getCat_cd() {\n\t\treturn cat_cd;\n\t}", "public String getCategory() {\n return this.category;\n }", "public proto.SocialMetricCategoryEnum getCategory() {\n proto.SocialMetricCategoryEnum result = proto.SocialMetricCategoryEnum.valueOf(category_);\n return result == null ? proto.SocialMetricCategoryEnum.UNRECOGNIZED : result;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "@java.lang.Override\n public google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory() {\n @SuppressWarnings(\"deprecation\")\n google.maps.fleetengine.v1.Vehicle.VehicleType.Category result = google.maps.fleetengine.v1.Vehicle.VehicleType.Category.valueOf(category_);\n return result == null ? google.maps.fleetengine.v1.Vehicle.VehicleType.Category.UNRECOGNIZED : result;\n }", "CatType catType();", "public String getCategory() {\n return category;\n }", "String getCategoria();", "public String getCategory()\n {\n return category;\n }", "public String getCategory() {\n return this.category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public String getCategory() {\n return category;\n }", "public abstract String getCategory();", "public abstract String getCategory();", "public String getCategoryKey() {\n return getCategory().getWordVal();\n }", "public String getCategory() {\n //return ATPlugin.CLI_CATEGORY + \" \" + ATPlugin.DEFAULT_CATEGORY;\n return ATPlugin.CLI_CATEGORY;\n }", "public int getCategory() {\r\n\t\treturn category;\r\n\t}", "public long getCategory() {\r\n\t\treturn this.category;\r\n\t}", "public proto.SocialMetricCategoryEnum getCategory() {\n proto.SocialMetricCategoryEnum result = proto.SocialMetricCategoryEnum.valueOf(category_);\n return result == null ? proto.SocialMetricCategoryEnum.UNRECOGNIZED : result;\n }", "public String getCatId() {\r\n\t\treturn catId;\r\n\t}", "public String getStrCategoryName() {\n return strCategoryName;\n }", "public String getIntAttributeCategory() {\n return (String) getAttributeInternal(INTATTRIBUTECATEGORY);\n }", "public BwString getCategoryWord() {\n if (categoryWord == null) {\n categoryWord = new BwString();\n }\n\n return categoryWord;\n }", "public String getCategory() {\n\t\treturn null;\r\n\t}", "public final Class<? extends Attribute> getCategory() {\n/* 219 */ return (Class)SheetCollate.class;\n/* */ }", "public CloudCategory getCldCat() {\n return cloudCategory;\n }", "public String[] getCategoryList(){\n return new String[]{\n \"Macros\",\n \"Instrument Type\",\n \"TOF_NSCD\",\n \"NEW_SNS\"\n };\n }", "public String getCategory() {\n\t\treturn null;\n\t}", "public String getCategory() {\n\t\treturn null;\n\t}", "public String getCategorybasedattributesprefill() {\r\n return categorybasedattributesprefill;\r\n }", "public void setTermcat(String value) {\r\n setAttributeInternal(TERMCAT, value);\r\n }", "public BwCategory getCategory() {\n if (category == null) {\n category = BwCategory.makeCategory();\n }\n\n return category;\n }", "public String getCategory() {\n return mCategory;\n }", "public String getcatgdesc() {\n return (String) getAttributeInternal(CATGDESC);\n }", "public io.reactivesw.catalog.grpc.GrpcCategory getCategoryById(io.reactivesw.catalog.grpc.LongValue request) {\n return blockingUnaryCall(\n getChannel(), METHOD_GET_CATEGORY_BY_ID, getCallOptions(), request);\n }", "public RoomCategory getRoomCategory(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory res){\n\t\tRoomCategory roomCategory = new RoomCategory();\n\t\t\n\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode() );\n\t\troomCategory.setRoomTypeDescription( res.getRoomTypeDescription() );\n\t\t\n//\t\tCode to set the room description in UI\n\t\tString roomDescription = res.getRoomTypeDescription();\n\t\tif (roomDescription!=null && roomDescription.contains(\":\")) {\n\t\t\tint firstColonIndex=roomDescription.indexOf(\":\");\n\t\t\tint lastCOlonIndex= roomDescription.lastIndexOf(\":\");\n\t\t\tString removedString = (roomDescription.substring(firstColonIndex,lastCOlonIndex+1));\n\t\t\tString roomTypeToBediplayedonUI = roomDescription.replace(removedString, \"\");\n\t\t\t\n\t\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode() + \"-RD-\" + roomDescription);\n\t\t\troomCategory.setRoomTypeDescription(roomTypeToBediplayedonUI);\n\t\t}\n\t\telse{\n\t\t\t//Start the fix of HBSI 52 - Phase 1 // Setting the default roomTypeCode and Description\n\t\t\troomCategory.setRoomTypeCode( res.getRoomTypeCode());\n\t\t\troomCategory.setRoomTypeDescription(res.getRoomTypeDescription());\n\t\t}\n\t\t //End the fix of HBSI 52 -Phase 1 \n\t\troomCategory.setRatePlanId( res.getRatePlanId() );\n\t\troomCategory.setRatePlanCode( res.getRatePlanCode() );\n\t\troomCategory.setRatePlanDescription( res.getRatePlanDescription() );\n\t\tif( res.getRateIndicator() != null ){\n\t\t\troomCategory.setRateIndicator( res.getRateIndicator() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setRateIndicator( \"\" );\n\t\t}\n\t\tif( res.getCorporateId() != null ){\n\t\t\troomCategory.setCorporateId( res.getCorporateId() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setCorporateId( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeType() != null ){\n\t\troomCategory.setGuaranteeType( res.getGuaranteeType() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeType( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeMethod() != null ){\n\t\troomCategory.setGuaranteeMethod( res.getGuaranteeMethod() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeMethod( \"\" );\n\t\t}\n\t\tif( res.getGuaranteeRequired() != null ){\n\t\troomCategory.setGuaranteeRequired( res.getGuaranteeRequired() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setGuaranteeRequired( \"\" );\n\t\t}\n\t\troomCategory.setRatePlanCategory( res.getRatePlanCategory() );\n\t\troomCategory.setStatus( res.getStatus() );\n\t\tif( res.getCurrency() != null ){\n\t\t\troomCategory.setCurrency( res.getCurrency() );\n\t\t}\n\t\telse{\n\t\t\troomCategory.setCurrency( \"\" );\n\t\t}\n\t\troomCategory.setPosnr( res.getPosnr() );\n\t\troomCategory.setOldPosnr( res.getOldPosnr() );\n\t\troomCategory.setMealplanDesc( res.getMealplanDesc() );\n\t\tif( res.getHotelId() != null ){\n\t\t\troomCategory.setHotelId( res.getHotelId().intValue() );\n\t\t}\n\t\tif( res.getRoomCategoryId() != null ){\n\t\t\troomCategory.setRoomCategoryId( res.getRoomCategoryId().intValue() );\n\t\t}\n\t\tif( res.getNoOfRoomsAvailable() != null ){\n\t\t\troomCategory.setNoOfRoomsAvailable( res.getNoOfRoomsAvailable().intValue() );\n\t\t}\n\t\tif( res.isRiskRoomCategory() != null ){\n\t\t\troomCategory.setRiskRoomCategory( res.isRiskRoomCategory().booleanValue() );\n\t\t}\n\t\tif( res.isAppleChoice() != null ){\n\t\t\troomCategory.setAppleChoice( res.isAppleChoice().booleanValue() );\n\t\t}\n\t\tif( res.getGuaranteeAmount() != null ){\n\t\t\troomCategory.setGuaranteeAmount( res.getGuaranteeAmount() );\n\t\t}\n\t\tif( res.getDisplayRoomPrice() != null ){\n\t\t\troomCategory.setDisplayRoomPrice( this.getRoomPrice( res.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( (res.getMealPlanType() != null) && (res.getMealPlanType().getCode() != null) ){\n\t\t\troomCategory.setMealPlanType( this.getMealPlanType( res.getMealPlanType() ) );\n\t\t}\n\t\tif( (res.getRoomPrices() != null) && (res.getRoomPrices().size() > 0) ){\n\t\t\tList<RoomPrice> roomPrices = new ArrayList<RoomPrice>();\n\t\t\tfor(int i=0; i < res.getRoomPrices().size(); i++){\n\t\t\t\tif( res.getRoomPrices().get(i) != null )\n\t\t\t\troomPrices.add( this.getRoomPrice( res.getRoomPrices().get(i) ) );\n\t\t\t}\n\t\t\troomCategory.setRoomPrices( roomPrices );\n\t\t}\n\t\tif( (res.getAmenities() != null) && (res.getAmenities().size() > 0) ){\n\t\t\tList<Amenity> amenities = new ArrayList<Amenity>(res.getAmenities().size());\n\t\t\tfor(int i=0; i < res.getAmenities().size(); i++){\n\t\t\t\tif( res.getAmenities().get(i) != null )\n\t\t\t\tamenities.add( this.getAmenity( res.getAmenities().get(i) ) );\n\t\t\t}\n\t\t\troomCategory.setAmenities( amenities );\n\t\t}\n\t\t\n\t\tif(res!=null && res.getHbsiRates()!=null && res.getHbsiRates().size()>0){\n\t\t\tList<HBSiRates> hbsiRates = new ArrayList<HBSiRates>(res.getHbsiRates().size());\n\t\t\tfor(int hbsiRate=0;hbsiRate<res.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(res.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\thbsiRates.add(this.getHBSiRate(res.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t//roomCategory.getHbsiRates().add(hbsiRate, getHBSiRate(res.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\troomCategory.setHbsiRates(hbsiRates);\n\t\t}\n\t\t\n\t\t//set Cancel Policy for room category\n\t\tif(res!=null && res.getCancelPolicy()!=null && res.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tList<com.kcdata.abe.data.dto.CancelPolicy> canccelPolicies = new ArrayList<com.kcdata.abe.data.dto.CancelPolicy>(res.getCancelPolicy().size());\n\t\t\tfor(int cancelPolicy=0;cancelPolicy<res.getCancelPolicy().size();cancelPolicy++)\n\t\t\t{\n\t\t\t\tif(res.getCancelPolicy().get(cancelPolicy)!=null)\n\t\t\t\t{\n\t\t\t\t\tcanccelPolicies.add(this.getCancelPolicy(res.getCancelPolicy().get(cancelPolicy)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\troomCategory.setCancelPolicy(canccelPolicies);\n\t\t}\n\t\treturn roomCategory;\n\t}", "google.maps.fleetengine.v1.Vehicle.VehicleType.Category getCategory();", "@Override\n public String getCategory() {\n return category;\n }", "public String getNotiCategory() {\r\n return (String) getAttributeInternal(NOTICATEGORY);\r\n }", "public String getCostCategory() {\n\t\treturn this.costCategory;\n\t}", "public String getName(){\n return category;\n }", "@Override\n\t\t\t\tpublic String getKey() {\n\t\t\t\t\treturn \"category\";\n\t\t\t\t}", "public String categoryScan(String sIn)\r\n\t{\r\n\t\tString goBack = \"unassigned\";\r\n\t\t\r\n\t\tif(sIn.contains(\"PROFESSIONAL CATEGORY\") || sIn.contains(\"PROFESSIONAL/MANAGEMENT CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"PROFESSIONAL\";\r\n\t\t} else if(sIn.contains(\"HEALTHCARE CATEGORY\") || sIn.contains(\"HEALTH CARE/NURSING CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"HEALTHCARE\";\r\n\t\t} else if(sIn.contains(\"SALES / MARKETING CATEGORY\") || sIn.contains(\"SALES/MARKETING CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"SALES\";\r\n\t\t}else if(sIn.contains(\"SKILLS/TRADES CATEGORY\") || sIn.contains(\"SKILLED TRADES CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"SKILLS TRADES\";\r\n\t\t}else if(sIn.contains(\"GENERAL CATEGORY\"))\r\n\t\t{\r\n\t\t\tgoBack = \"GENERAL\";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn goBack;\r\n\t}", "ConfigCategory getCategoryOfTypeAndCode(String typeConstant, String categoryCode);", "public String getVehicleTypeCategory() {\r\n return vehicleType.getCategory();\r\n }", "String getCmt();", "public Integer getCategory() {\n return category;\n }", "public int getCategoryValue() {\n return category_;\n }", "Rule StCategoryScopeAndId() {\n return Sequence(\n \"smalltalk.category\",\n STIdentifier(),\n actions.pushStCategoryNamespaceNode());\n }" ]
[ "0.62388015", "0.61127704", "0.59855664", "0.5954132", "0.5906601", "0.5849044", "0.5804648", "0.5746176", "0.5727682", "0.5660293", "0.5660293", "0.56263953", "0.55973506", "0.5596143", "0.55854934", "0.5548908", "0.55428934", "0.55243367", "0.55243367", "0.5444974", "0.54254466", "0.5424914", "0.54176915", "0.5412327", "0.5390515", "0.536706", "0.53659683", "0.5363951", "0.5362128", "0.5352405", "0.5351458", "0.5344712", "0.534324", "0.5320205", "0.5319849", "0.53134936", "0.5306225", "0.53051955", "0.5303145", "0.52695864", "0.52285415", "0.52285415", "0.52199715", "0.5215575", "0.521079", "0.5202533", "0.5188544", "0.5169942", "0.51650673", "0.51650673", "0.5161332", "0.51573515", "0.5155493", "0.51529455", "0.5143125", "0.5136236", "0.5132985", "0.5132985", "0.5132985", "0.5132985", "0.5132985", "0.5132985", "0.5132985", "0.5131087", "0.5131087", "0.5130561", "0.5119241", "0.5105931", "0.5094808", "0.5093023", "0.5092392", "0.5089556", "0.5057745", "0.50477016", "0.5047563", "0.5042529", "0.50378513", "0.5016849", "0.50149965", "0.50149965", "0.50125426", "0.5000328", "0.49960017", "0.49879786", "0.4971689", "0.497094", "0.49513143", "0.49456483", "0.49432844", "0.49363557", "0.49215776", "0.49081546", "0.48911557", "0.48790002", "0.48775047", "0.4874701", "0.4859474", "0.4855285", "0.48468143", "0.48252144" ]
0.4895319
92
Set an RCAT is a string that represents a request category used for policy enforcement.
public void setRcaT(String rcaT) { this.rcaT = rcaT; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTermcat(String value) {\r\n setAttributeInternal(TERMCAT, value);\r\n }", "public RequestCategory withRcaT(String rcaT) {\n\t\tthis.rcaT = rcaT;\n\t\treturn this;\n\t}", "public void setR_Category_ID (int R_Category_ID);", "public void setSSRCategory(int value) {\n this.ssrCategory = value;\n }", "public void setCategory(String newCategory) {\n category = newCategory;\n }", "public void setCategory(String cat)\n\t{\n\t\tif(cat!=null)\n\t\t\tthis.category = cat;\n\t}", "public void setCategory(String cat) {\t//TODO\n\t\tcategory = cat;\n\t}", "public void setRequestType(String category){\n requestType = category;\n }", "public void setName(String ac) {\n categoryName = ac;\n }", "public void setCat(Categories cats) {\n if (tmpCat == null || tmpCat.isEmpty())\n return;\n\n conCat = cats.getCategory(tmpCat);\n if (conCat == null) {\n throw new Error(\"constraint category \" + tmpCat + \" does not exist in markedup\");\n }\n\n if (conRel != 0)\n conRel = cats.dependencyRelations.getRelID(cats.getString(tmpCat), conRel);\n }", "public void setCategory(String category);", "public void setPrmCategCode(String value) {\n setAttributeInternal(PRMCATEGCODE, value);\n }", "void setCit(java.lang.String cit);", "public void setRuc(String ruc) {\n this.ruc = ruc;\n }", "private RunnerInfo.Category stringToCat(String catStr) {\n if (catStr.contains(\"Femme\")) {\n return RunnerInfo.Category.WOMEN;\n } else {\n return RunnerInfo.Category.MEN;\n }\n }", "public void settype(String cat) { this.type = cat; }", "public void setCategory(String category)\r\n {\r\n m_category = category;\r\n }", "public void setCldCat(CloudCategory cldCat) {\n cloudCategory = cldCat;\n }", "public void setAttributeCategory(String value)\n {\n setAttributeInternal(ATTRIBUTECATEGORY, value);\n }", "@Override\n public void setCategory(String category) {\n this.category = category;\n }", "public void setCatName(String value) {\n setAttributeInternal(CATNAME, value);\n }", "void updateCategory(String category){}", "public void setDocumentCategory(java.lang.String documentCategory)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DOCUMENTCATEGORY$0, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DOCUMENTCATEGORY$0);\r\n }\r\n target.setStringValue(documentCategory);\r\n }\r\n }", "public void setCategory(String newCategory) {\n\t\t_pcs.firePropertyChange(\"category\", this.category, newCategory); //$NON-NLS-1$\n\t\tthis.category = newCategory;\n\t}", "public void setCategory (String category) {\n switch (category.toLowerCase()) {\n default -> this.category = Category.YOUTH;\n case \"novel\" -> this.category = Category.NOVEL;\n case \"theater\" -> this.category = Category.THEATER;\n case \"documentary\" -> this.category = Category.DOCUMENTARY;\n case \"speech\" -> this.category = Category.SPEECH;\n }\n }", "public void setCategory (String mode) { category = mode; }", "public void setCategory(Category cat) {\n this.category = cat;\n }", "public void setName(String name)\n\t{\n\t\tcategoryName= name;\n\t}", "public void setCatId(int value) {\n this.catId = value;\n }", "public void setAdditionalCategoryCat(java.lang.Integer additionalCategoryCat) {\r\n this.additionalCategoryCat = additionalCategoryCat;\r\n }", "public int getSSRCategory() {\n return ssrCategory;\n }", "public void setCategory(java.lang.String category) {\n this.category = category;\n }", "public void setCategory(Category c) {\n this.category = c;\n }", "public void setCategory(String category) {\n this.category = category;\n changeState(CHANGE);\n }", "public void setCategory(String category){\n this.category = category;\n }", "CloudCategory(String value) {\n this.value = value;\n }", "public void setIntCat(Category intCat) {\n\t\tthis.intCat = intCat;\n\t}", "public void setCategory(Integer category) {\n this.category = category;\n }", "public void setRCID(int RCID) {\n this.RCID = RCID;\n }", "void setStatCategory (String statistic);", "public void setCrustType(String crustType) {\n if (crustType.equals(\"\")) {\n return;\n }\n this.crustType = crustType;\n }", "public void setCategory(String category) {\r\n this.category = category;\r\n }", "public void setAcr(String acr) {\n this.acr = acr;\n }", "public void setCncategory(String cncategory) {\n this.cncategory = cncategory == null ? null : cncategory.trim();\n }", "public void changeCategory(Category newCategory) {\n this.category = newCategory;\n }", "public void setCvr(String cvr) {\n this.cvr = cvr;\n }", "public void setCatLevel(int value) {\n this.catLevel = value;\n }", "public void setCatId(long value) {\n this.catId = value;\n }", "public void setTerm(String value) {\r\n setAttributeInternal(TERM, value);\r\n }", "public void setCrust(){\n this.crust = \"Thin\";\n }", "public void setR(String R) {\n\t\tthis.R = R;\r\n\t\tfirePropertyChange(ConstantResourceFactory.P_R,null,R);\r\n\t}", "public String getCat() {\n\t\treturn this.cat;\n\t}", "public void setCat_cd(final java.lang.String cat_cd) {\n\t\tthis.cat_cd = cat_cd;\n\t}", "public String getCncategory() {\n return cncategory;\n }", "public void SetCategory(String text) {\n\t\t\n\t\t\n\t\tCategory_label.setText(text);\n\t}", "public void setLBR_ICMS_TaxReliefType (String LBR_ICMS_TaxReliefType);", "public void setCRN(String cRN) {\n\t\tCRN = cRN;\n\t}", "public void setCategCode(String value) {\n setAttributeInternal(CATEGCODE, value);\n }", "public String getTermcat() {\r\n return (String) getAttributeInternal(TERMCAT);\r\n }", "public void addRestriction(String r)\r\n {\r\n\ttry {\r\n\t addRestriction(Restriction.valueOf(r.toUpperCase()));\r\n\t}\r\n\tcatch(Exception e) {\r\n\t e.printStackTrace();\r\n\t}\r\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setATC(java.lang.String ATC) {\n this.ATC = ATC;\n }", "public void setR_Request_ID (int R_Request_ID);", "public void setClerk(String clerk) {\n\t\tthis.clerk = clerk;\n\t}", "public void setReplyType(String rt) {\n/* 318 */ getCOSObject().setName(\"RT\", rt);\n/* */ }", "private void setCategory(String s, int src) {\n CategoryText = findViewById(R.id.transaction_select_category);\n categoryImage = findViewById(R.id.category_image);\n CategoryText.setText(s);\n categoryName = s;\n categoryImage.setImageResource(src);\n categoryImage.setTag(src);\n imgSrc = src;\n }", "public void setDocAction (String DocAction)\n{\nif (DocAction.equals(\"AP\") || DocAction.equals(\"CL\") || DocAction.equals(\"PR\") || DocAction.equals(\"IN\") || DocAction.equals(\"CO\") || DocAction.equals(\"--\") || DocAction.equals(\"RC\") || DocAction.equals(\"RJ\") || DocAction.equals(\"RA\") || DocAction.equals(\"WC\") || DocAction.equals(\"XL\") || DocAction.equals(\"RE\") || DocAction.equals(\"PO\") || DocAction.equals(\"VO\"));\n else throw new IllegalArgumentException (\"DocAction Invalid value - Reference = DOCACTION_AD_Reference_ID - AP - CL - PR - IN - CO - -- - RC - RJ - RA - WC - XL - RE - PO - VO\");\nif (DocAction == null) throw new IllegalArgumentException (\"DocAction is mandatory\");\nif (DocAction.length() > 2)\n{\nlog.warning(\"Length > 2 - truncated\");\nDocAction = DocAction.substring(0,2);\n}\nset_Value (\"DocAction\", DocAction);\n}", "@JsonProperty(\"category\")\n public void setCategory(String category) {\n this.category = category;\n }", "static public void set_category_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"category name:\"};\n\t\tEdit_row_window.attr_vals = new String[]{Edit_row_window.selected[0].getText(1)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct m.id, m.name, m.num_links, m.year_made \" +\n\t\t\t\t\" from curr_cinema_movies m, \" +\n\t\t\t\t\" curr_cinema_movie_tag mt\" +\n\t\t\t\t\" where mt.movie_id=m.id and mt.tag_id=\"+Edit_row_window.id+\n\t\t\t\t\" order by num_links desc \";\n\n\t\tEdit_row_window.not_linked_query = \" select distinct m.id, m.name, m.num_links, m.year_made \" +\n\t\t\t\t\" from curr_cinema_movies m \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"movie name\", \"rating\", \"release year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. release year:\";\n\t\tEdit_row_window.linked_category_name = \"MOVIES\";\n\t}", "private void setcategoriaPrincipal(String categoriaPrincipal2) {\n\t\t\n\t}", "public void setCategorySeq(Integer categorySeq) {\n this.categorySeq = categorySeq;\n }", "public void setClan(String value);", "public void setStrCategoryName(final String strCategoryName) {\n this.strCategoryName = strCategoryName;\n }", "public void setClttype(java.lang.String clttype) {\n this.clttype = clttype;\n }", "public void setSMCAT(java.lang.String SMCAT) {\n this.SMCAT = SMCAT;\n }", "public void setCn(String value) {\n setAttributeInternal(CN, value);\n }", "public void setRarity(char newrareity)\n {\n rarity = newrareity;\n }", "public int getCategory(){\n\t\treturn this.cat;\n\t}", "public void setIntAttributeCategory(String value) {\n setAttributeInternal(INTATTRIBUTECATEGORY, value);\n }", "public String getPrmCategCode() {\n return (String)getAttributeInternal(PRMCATEGCODE);\n }", "public void setCategory(String category) {\n\t\tthis.category = category;\n\t}", "public void setCategory(String category) {\n\t\tthis.category = category;\n\t}", "public void setCategory1(String category1) {\n this.category1 = category1;\n }", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory getRoomCategoryReq(RoomCategory roomCategory){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory roomCategoryReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory();\n\t\t\n\t\troomCategoryReq.setHotelId( new Integer( roomCategory.getHotelId() ) );\n\t\troomCategoryReq.setRoomCategoryId( new Integer( roomCategory.getRoomCategoryId() ) );\n\n\t\troomCategoryReq.setRoomTypeCode( roomCategory.getRoomTypeCode() );\n\t\tString desc = roomCategory.getRoomTypeDescription();\n if(desc!=null && desc.contains(\":\")){\n String split[]=desc.split(\":\");\n String description= split[0]+split[split.length-1];\n System.out.println(description);\n roomCategoryReq.setRoomTypeDescription(description); \n }else{\n \troomCategoryReq.setRoomTypeDescription( roomCategory.getRoomTypeDescription()!=null? roomCategory.getRoomTypeDescription().replaceAll(\": \", \"\"):\"\" );\n }\n//\t\tString roomTypeCode = roomCategory.getRoomTypeCode();\n//\t\tif(roomTypeCode.contains(\"-RD-\")) {\n//\t\t\tString [] splitRoomTypeCode = null;\n//\t\t\tsplitRoomTypeCode = roomTypeCode.split(\"-RD-\");\n//\t\t\troomCategoryReq.setRoomTypeCode(splitRoomTypeCode[0]);\n//\t\t\troomCategoryReq.setRoomTypeDescription(splitRoomTypeCode[1]);\n//\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\troomCategoryReq.setRatePlanId( roomCategory.getRatePlanId() );\n\t\troomCategoryReq.setRatePlanCode( roomCategory.getRatePlanCode() );\n\t\troomCategoryReq.setRatePlanDescription( roomCategory.getRatePlanDescription() );\n\t\troomCategoryReq.setRateIndicator( roomCategory.getRateIndicator() );\n\t\troomCategoryReq.setCorporateId( roomCategory.getCorporateId() );\n\t\troomCategoryReq.setGuaranteeType( roomCategory.getGuaranteeType() );\n\t\troomCategoryReq.setGuaranteeMethod( roomCategory.getGuaranteeMethod() );\n\t\troomCategoryReq.setGuaranteeRequired( roomCategory.getGuaranteeRequired() );\n\t\troomCategoryReq.setGuaranteeAmount( new Double( roomCategory.getGuaranteeAmount() ) );\n\t\troomCategoryReq.setRatePlanCategory( roomCategory.getRatePlanCategory() );\n\t\troomCategoryReq.setNoOfRoomsAvailable( new Integer( roomCategory.getNoOfRoomsAvailable() ) );\n\t\troomCategoryReq.setStatus( roomCategory.getStatus() );\n\t\troomCategoryReq.setCurrency( roomCategory.getCurrency() );\n\t\troomCategoryReq.setPosnr( roomCategory.getPosnr() );\n\t\troomCategoryReq.setOldPosnr( roomCategory.getOldPosnr() );\n\t\troomCategoryReq.setRiskRoomCategory( new Boolean( roomCategory.isRiskRoomCategory() ) );\n\t\troomCategoryReq.setAppleChoice( new Boolean( roomCategory.getAppleChoice() ) );\n\t\troomCategoryReq.setMealplanDesc( roomCategory.getMealplanDesc() );\n\t\tif( roomCategory.getDisplayRoomPrice()!= null ){\n\t\t\troomCategoryReq.setDisplayRoomPrice( this.getRoomPriceReq( roomCategory.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( roomCategory.getMealPlanType() != null ){\n\t\t\troomCategoryReq.setMealPlanType( this.getMealPlanTypeReq( roomCategory.getMealPlanType() ) );\n\t\t}\n\t\t\n\t\tif( (roomCategory.getRoomPrices() != null) && (roomCategory.getRoomPrices().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getRoomPrices().size(); i++){\n\t\t\t\troomCategoryReq.getRoomPrices().add( this.getRoomPriceReq(roomCategory.getRoomPrices().get(i)));\n\t\t\t}\n\t\t}\n\t\tif( (roomCategory.getAmenities() != null) && (roomCategory.getAmenities().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getAmenities().size(); i++){\n\t\t\t\troomCategoryReq.getAmenities().add( this.getAmenityReq( roomCategory.getAmenities().get(i) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getHbsiRates()!=null && roomCategory.getHbsiRates().size()>0)\n\t\t{\n\t\t\tHBSiRates hbsi;\n\t\t\t \n\t\t\tfor(int hbsiRate=0;hbsiRate<roomCategory.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject hbsiRateObject = roomCategory.getHbsiRates().get(hbsiRate);\n\t\t\t\t\tif(hbsiRateObject instanceof HBSiRates)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(hbsiRate,this.getHBSiRateReq(roomCategory.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t}\n//\t\t\t\t\telse \tif(hbsiRateObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject hbsiAsObject = (ASObject)hbsiRateObject;\n//\t\t\t\t\t\thbsiAsObject.setType(\"com.kcdata.abe.data.dto.HBSiRates\");\n//\t\t\t\t\t\thbsi= (HBSiRates)ast.convert(hbsiAsObject, HBSiRates.class);\n//\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(this.getHBSiRateReq(hbsi));\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set cancel Policy\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getCancelPolicy()!=null && roomCategory.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tcom.kcdata.abe.data.dto.CancelPolicy cancelPolicy;\n\t\t\t\n\t\t\tfor(int cancel=0;cancel<roomCategory.getCancelPolicy().size();cancel++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getCancelPolicy().get(cancel)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject cancelObject = roomCategory.getCancelPolicy().get(cancel);\n\t\t\t\t\tif(cancelObject instanceof com.kcdata.abe.data.dto.CancelPolicy)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(cancel,this.getCancelPolicyReq(roomCategory.getCancelPolicy().get(cancel)));\n\t\t\t\t\t}\n//\t\t\t\t\telse if(cancelObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject cancelASObject = (ASObject)cancelObject;\n//\t\t\t\t\t\tcancelASObject.setType(\"com.kcdata.abe.data.dto.CancelPolicy\");\n//\t\t\t\t\t\tcancelPolicy=(com.kcdata.abe.data.dto.CancelPolicy)ast.convert(cancelASObject, com.kcdata.abe.data.dto.CancelPolicy.class);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(this.getCancelPolicyReq(cancelPolicy));\n//\t\t\t\t\t\t\n//\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn roomCategoryReq;\n\t}", "public int getR_Category_ID();", "public void setNotiCategory(String value) {\r\n setAttributeInternal(NOTICATEGORY, value);\r\n }", "protected String setlocale(String locale, String category) {\n\t\treturn \"C\";\n\t}", "public void setNotiSubcategory(String value) {\r\n setAttributeInternal(NOTISUBCATEGORY, value);\r\n }", "public void visitMICR( DevCat devCat ) {}", "void setDeploymentCategory(String deploymentId, String category);", "@AutoEscape\n public String getCategory();", "public void updatePortletCategory(PortletCategory category);", "public void setErrorCategory(String errorCategory) {\n this.errorCategory = errorCategory == null ? null : errorCategory.trim();\n }", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "public void setCategory(Category category) {\r\n this.category = category;\r\n }" ]
[ "0.62376547", "0.6064466", "0.5985839", "0.57382256", "0.5590899", "0.55172133", "0.5488471", "0.5432416", "0.5395583", "0.5386914", "0.5363053", "0.533856", "0.5291229", "0.5275972", "0.52280945", "0.52086484", "0.5192944", "0.519166", "0.5132005", "0.51147157", "0.50812215", "0.5063315", "0.50337887", "0.50151354", "0.49679285", "0.49600923", "0.49545872", "0.49269333", "0.49158937", "0.49068278", "0.4887848", "0.4883417", "0.48652667", "0.48650753", "0.48619294", "0.48614016", "0.48613355", "0.4855629", "0.48508656", "0.4838733", "0.4831131", "0.48223034", "0.48195466", "0.48149532", "0.47881022", "0.47824582", "0.4781553", "0.47715992", "0.47690266", "0.47653338", "0.4749968", "0.47474998", "0.4736647", "0.47262287", "0.47236335", "0.47144622", "0.47116733", "0.4708157", "0.47036958", "0.46968713", "0.46936566", "0.46936566", "0.46936566", "0.46936566", "0.46936566", "0.4685799", "0.4682096", "0.46782514", "0.46745813", "0.46650502", "0.46505973", "0.46325237", "0.46308798", "0.46245223", "0.46238387", "0.46231088", "0.46122286", "0.46114728", "0.46032855", "0.45966315", "0.4588213", "0.45834774", "0.45723417", "0.4567748", "0.45669308", "0.45669308", "0.4555534", "0.45511967", "0.45465836", "0.45370343", "0.4536222", "0.45324814", "0.45273948", "0.451733", "0.45088017", "0.4495265", "0.44938597", "0.4477863", "0.44726965", "0.44677433" ]
0.5137215
18
Set an RCAT is a string that represents a request category used for policy enforcement.
public RequestCategory withRcaT(String rcaT) { this.rcaT = rcaT; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTermcat(String value) {\r\n setAttributeInternal(TERMCAT, value);\r\n }", "public void setR_Category_ID (int R_Category_ID);", "public void setSSRCategory(int value) {\n this.ssrCategory = value;\n }", "public void setCategory(String newCategory) {\n category = newCategory;\n }", "public void setCategory(String cat)\n\t{\n\t\tif(cat!=null)\n\t\t\tthis.category = cat;\n\t}", "public void setCategory(String cat) {\t//TODO\n\t\tcategory = cat;\n\t}", "public void setRequestType(String category){\n requestType = category;\n }", "public void setName(String ac) {\n categoryName = ac;\n }", "public void setCat(Categories cats) {\n if (tmpCat == null || tmpCat.isEmpty())\n return;\n\n conCat = cats.getCategory(tmpCat);\n if (conCat == null) {\n throw new Error(\"constraint category \" + tmpCat + \" does not exist in markedup\");\n }\n\n if (conRel != 0)\n conRel = cats.dependencyRelations.getRelID(cats.getString(tmpCat), conRel);\n }", "public void setCategory(String category);", "public void setPrmCategCode(String value) {\n setAttributeInternal(PRMCATEGCODE, value);\n }", "void setCit(java.lang.String cit);", "public void setRuc(String ruc) {\n this.ruc = ruc;\n }", "private RunnerInfo.Category stringToCat(String catStr) {\n if (catStr.contains(\"Femme\")) {\n return RunnerInfo.Category.WOMEN;\n } else {\n return RunnerInfo.Category.MEN;\n }\n }", "public void settype(String cat) { this.type = cat; }", "public void setCategory(String category)\r\n {\r\n m_category = category;\r\n }", "public void setCldCat(CloudCategory cldCat) {\n cloudCategory = cldCat;\n }", "public void setRcaT(String rcaT) {\n\t\tthis.rcaT = rcaT;\n\t}", "public void setAttributeCategory(String value)\n {\n setAttributeInternal(ATTRIBUTECATEGORY, value);\n }", "@Override\n public void setCategory(String category) {\n this.category = category;\n }", "public void setCatName(String value) {\n setAttributeInternal(CATNAME, value);\n }", "void updateCategory(String category){}", "public void setDocumentCategory(java.lang.String documentCategory)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DOCUMENTCATEGORY$0, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DOCUMENTCATEGORY$0);\r\n }\r\n target.setStringValue(documentCategory);\r\n }\r\n }", "public void setCategory(String newCategory) {\n\t\t_pcs.firePropertyChange(\"category\", this.category, newCategory); //$NON-NLS-1$\n\t\tthis.category = newCategory;\n\t}", "public void setCategory (String category) {\n switch (category.toLowerCase()) {\n default -> this.category = Category.YOUTH;\n case \"novel\" -> this.category = Category.NOVEL;\n case \"theater\" -> this.category = Category.THEATER;\n case \"documentary\" -> this.category = Category.DOCUMENTARY;\n case \"speech\" -> this.category = Category.SPEECH;\n }\n }", "public void setCategory (String mode) { category = mode; }", "public void setCategory(Category cat) {\n this.category = cat;\n }", "public void setName(String name)\n\t{\n\t\tcategoryName= name;\n\t}", "public void setCatId(int value) {\n this.catId = value;\n }", "public void setAdditionalCategoryCat(java.lang.Integer additionalCategoryCat) {\r\n this.additionalCategoryCat = additionalCategoryCat;\r\n }", "public int getSSRCategory() {\n return ssrCategory;\n }", "public void setCategory(java.lang.String category) {\n this.category = category;\n }", "public void setCategory(Category c) {\n this.category = c;\n }", "public void setCategory(String category) {\n this.category = category;\n changeState(CHANGE);\n }", "public void setCategory(String category){\n this.category = category;\n }", "CloudCategory(String value) {\n this.value = value;\n }", "public void setIntCat(Category intCat) {\n\t\tthis.intCat = intCat;\n\t}", "public void setCategory(Integer category) {\n this.category = category;\n }", "public void setRCID(int RCID) {\n this.RCID = RCID;\n }", "void setStatCategory (String statistic);", "public void setCrustType(String crustType) {\n if (crustType.equals(\"\")) {\n return;\n }\n this.crustType = crustType;\n }", "public void setCategory(String category) {\r\n this.category = category;\r\n }", "public void setAcr(String acr) {\n this.acr = acr;\n }", "public void setCncategory(String cncategory) {\n this.cncategory = cncategory == null ? null : cncategory.trim();\n }", "public void changeCategory(Category newCategory) {\n this.category = newCategory;\n }", "public void setCvr(String cvr) {\n this.cvr = cvr;\n }", "public void setCatLevel(int value) {\n this.catLevel = value;\n }", "public void setCatId(long value) {\n this.catId = value;\n }", "public void setTerm(String value) {\r\n setAttributeInternal(TERM, value);\r\n }", "public void setCrust(){\n this.crust = \"Thin\";\n }", "public void setR(String R) {\n\t\tthis.R = R;\r\n\t\tfirePropertyChange(ConstantResourceFactory.P_R,null,R);\r\n\t}", "public String getCat() {\n\t\treturn this.cat;\n\t}", "public void setCat_cd(final java.lang.String cat_cd) {\n\t\tthis.cat_cd = cat_cd;\n\t}", "public String getCncategory() {\n return cncategory;\n }", "public void SetCategory(String text) {\n\t\t\n\t\t\n\t\tCategory_label.setText(text);\n\t}", "public void setLBR_ICMS_TaxReliefType (String LBR_ICMS_TaxReliefType);", "public void setCRN(String cRN) {\n\t\tCRN = cRN;\n\t}", "public void setCategCode(String value) {\n setAttributeInternal(CATEGCODE, value);\n }", "public String getTermcat() {\r\n return (String) getAttributeInternal(TERMCAT);\r\n }", "public void addRestriction(String r)\r\n {\r\n\ttry {\r\n\t addRestriction(Restriction.valueOf(r.toUpperCase()));\r\n\t}\r\n\tcatch(Exception e) {\r\n\t e.printStackTrace();\r\n\t}\r\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setCategory(String category) {\n this.category = category;\n }", "public void setATC(java.lang.String ATC) {\n this.ATC = ATC;\n }", "public void setR_Request_ID (int R_Request_ID);", "public void setClerk(String clerk) {\n\t\tthis.clerk = clerk;\n\t}", "public void setReplyType(String rt) {\n/* 318 */ getCOSObject().setName(\"RT\", rt);\n/* */ }", "private void setCategory(String s, int src) {\n CategoryText = findViewById(R.id.transaction_select_category);\n categoryImage = findViewById(R.id.category_image);\n CategoryText.setText(s);\n categoryName = s;\n categoryImage.setImageResource(src);\n categoryImage.setTag(src);\n imgSrc = src;\n }", "public void setDocAction (String DocAction)\n{\nif (DocAction.equals(\"AP\") || DocAction.equals(\"CL\") || DocAction.equals(\"PR\") || DocAction.equals(\"IN\") || DocAction.equals(\"CO\") || DocAction.equals(\"--\") || DocAction.equals(\"RC\") || DocAction.equals(\"RJ\") || DocAction.equals(\"RA\") || DocAction.equals(\"WC\") || DocAction.equals(\"XL\") || DocAction.equals(\"RE\") || DocAction.equals(\"PO\") || DocAction.equals(\"VO\"));\n else throw new IllegalArgumentException (\"DocAction Invalid value - Reference = DOCACTION_AD_Reference_ID - AP - CL - PR - IN - CO - -- - RC - RJ - RA - WC - XL - RE - PO - VO\");\nif (DocAction == null) throw new IllegalArgumentException (\"DocAction is mandatory\");\nif (DocAction.length() > 2)\n{\nlog.warning(\"Length > 2 - truncated\");\nDocAction = DocAction.substring(0,2);\n}\nset_Value (\"DocAction\", DocAction);\n}", "@JsonProperty(\"category\")\n public void setCategory(String category) {\n this.category = category;\n }", "static public void set_category_data(){\n\n\t\tEdit_row_window.attrs = new String[]{\"category name:\"};\n\t\tEdit_row_window.attr_vals = new String[]{Edit_row_window.selected[0].getText(1)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct m.id, m.name, m.num_links, m.year_made \" +\n\t\t\t\t\" from curr_cinema_movies m, \" +\n\t\t\t\t\" curr_cinema_movie_tag mt\" +\n\t\t\t\t\" where mt.movie_id=m.id and mt.tag_id=\"+Edit_row_window.id+\n\t\t\t\t\" order by num_links desc \";\n\n\t\tEdit_row_window.not_linked_query = \" select distinct m.id, m.name, m.num_links, m.year_made \" +\n\t\t\t\t\" from curr_cinema_movies m \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"movie name\", \"rating\", \"release year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. release year:\";\n\t\tEdit_row_window.linked_category_name = \"MOVIES\";\n\t}", "private void setcategoriaPrincipal(String categoriaPrincipal2) {\n\t\t\n\t}", "public void setCategorySeq(Integer categorySeq) {\n this.categorySeq = categorySeq;\n }", "public void setClan(String value);", "public void setStrCategoryName(final String strCategoryName) {\n this.strCategoryName = strCategoryName;\n }", "public void setClttype(java.lang.String clttype) {\n this.clttype = clttype;\n }", "public void setSMCAT(java.lang.String SMCAT) {\n this.SMCAT = SMCAT;\n }", "public void setCn(String value) {\n setAttributeInternal(CN, value);\n }", "public void setRarity(char newrareity)\n {\n rarity = newrareity;\n }", "public int getCategory(){\n\t\treturn this.cat;\n\t}", "public void setIntAttributeCategory(String value) {\n setAttributeInternal(INTATTRIBUTECATEGORY, value);\n }", "public String getPrmCategCode() {\n return (String)getAttributeInternal(PRMCATEGCODE);\n }", "public void setCategory(String category) {\n\t\tthis.category = category;\n\t}", "public void setCategory(String category) {\n\t\tthis.category = category;\n\t}", "public void setCategory1(String category1) {\n this.category1 = category1;\n }", "public void setRulesRep(String value){\r\n RulesRep = value;\r\n }", "public com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory getRoomCategoryReq(RoomCategory roomCategory){\n\t\tcom.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory roomCategoryReq =\n\t\t\tnew com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.roomcategory.v1.RoomCategory();\n\t\t\n\t\troomCategoryReq.setHotelId( new Integer( roomCategory.getHotelId() ) );\n\t\troomCategoryReq.setRoomCategoryId( new Integer( roomCategory.getRoomCategoryId() ) );\n\n\t\troomCategoryReq.setRoomTypeCode( roomCategory.getRoomTypeCode() );\n\t\tString desc = roomCategory.getRoomTypeDescription();\n if(desc!=null && desc.contains(\":\")){\n String split[]=desc.split(\":\");\n String description= split[0]+split[split.length-1];\n System.out.println(description);\n roomCategoryReq.setRoomTypeDescription(description); \n }else{\n \troomCategoryReq.setRoomTypeDescription( roomCategory.getRoomTypeDescription()!=null? roomCategory.getRoomTypeDescription().replaceAll(\": \", \"\"):\"\" );\n }\n//\t\tString roomTypeCode = roomCategory.getRoomTypeCode();\n//\t\tif(roomTypeCode.contains(\"-RD-\")) {\n//\t\t\tString [] splitRoomTypeCode = null;\n//\t\t\tsplitRoomTypeCode = roomTypeCode.split(\"-RD-\");\n//\t\t\troomCategoryReq.setRoomTypeCode(splitRoomTypeCode[0]);\n//\t\t\troomCategoryReq.setRoomTypeDescription(splitRoomTypeCode[1]);\n//\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\troomCategoryReq.setRatePlanId( roomCategory.getRatePlanId() );\n\t\troomCategoryReq.setRatePlanCode( roomCategory.getRatePlanCode() );\n\t\troomCategoryReq.setRatePlanDescription( roomCategory.getRatePlanDescription() );\n\t\troomCategoryReq.setRateIndicator( roomCategory.getRateIndicator() );\n\t\troomCategoryReq.setCorporateId( roomCategory.getCorporateId() );\n\t\troomCategoryReq.setGuaranteeType( roomCategory.getGuaranteeType() );\n\t\troomCategoryReq.setGuaranteeMethod( roomCategory.getGuaranteeMethod() );\n\t\troomCategoryReq.setGuaranteeRequired( roomCategory.getGuaranteeRequired() );\n\t\troomCategoryReq.setGuaranteeAmount( new Double( roomCategory.getGuaranteeAmount() ) );\n\t\troomCategoryReq.setRatePlanCategory( roomCategory.getRatePlanCategory() );\n\t\troomCategoryReq.setNoOfRoomsAvailable( new Integer( roomCategory.getNoOfRoomsAvailable() ) );\n\t\troomCategoryReq.setStatus( roomCategory.getStatus() );\n\t\troomCategoryReq.setCurrency( roomCategory.getCurrency() );\n\t\troomCategoryReq.setPosnr( roomCategory.getPosnr() );\n\t\troomCategoryReq.setOldPosnr( roomCategory.getOldPosnr() );\n\t\troomCategoryReq.setRiskRoomCategory( new Boolean( roomCategory.isRiskRoomCategory() ) );\n\t\troomCategoryReq.setAppleChoice( new Boolean( roomCategory.getAppleChoice() ) );\n\t\troomCategoryReq.setMealplanDesc( roomCategory.getMealplanDesc() );\n\t\tif( roomCategory.getDisplayRoomPrice()!= null ){\n\t\t\troomCategoryReq.setDisplayRoomPrice( this.getRoomPriceReq( roomCategory.getDisplayRoomPrice() ) );\n\t\t}\n\t\tif( roomCategory.getMealPlanType() != null ){\n\t\t\troomCategoryReq.setMealPlanType( this.getMealPlanTypeReq( roomCategory.getMealPlanType() ) );\n\t\t}\n\t\t\n\t\tif( (roomCategory.getRoomPrices() != null) && (roomCategory.getRoomPrices().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getRoomPrices().size(); i++){\n\t\t\t\troomCategoryReq.getRoomPrices().add( this.getRoomPriceReq(roomCategory.getRoomPrices().get(i)));\n\t\t\t}\n\t\t}\n\t\tif( (roomCategory.getAmenities() != null) && (roomCategory.getAmenities().size() > 0) ){\n\t\t\tfor(int i=0; i < roomCategory.getAmenities().size(); i++){\n\t\t\t\troomCategoryReq.getAmenities().add( this.getAmenityReq( roomCategory.getAmenities().get(i) ) );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getHbsiRates()!=null && roomCategory.getHbsiRates().size()>0)\n\t\t{\n\t\t\tHBSiRates hbsi;\n\t\t\t \n\t\t\tfor(int hbsiRate=0;hbsiRate<roomCategory.getHbsiRates().size();hbsiRate++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getHbsiRates().get(hbsiRate)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject hbsiRateObject = roomCategory.getHbsiRates().get(hbsiRate);\n\t\t\t\t\tif(hbsiRateObject instanceof HBSiRates)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(hbsiRate,this.getHBSiRateReq(roomCategory.getHbsiRates().get(hbsiRate)));\n\t\t\t\t\t}\n//\t\t\t\t\telse \tif(hbsiRateObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject hbsiAsObject = (ASObject)hbsiRateObject;\n//\t\t\t\t\t\thbsiAsObject.setType(\"com.kcdata.abe.data.dto.HBSiRates\");\n//\t\t\t\t\t\thbsi= (HBSiRates)ast.convert(hbsiAsObject, HBSiRates.class);\n//\t\t\t\t\t\troomCategoryReq.getHbsiRates().add(this.getHBSiRateReq(hbsi));\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Set cancel Policy\n\t\t\n\t\tif(roomCategory!=null && roomCategory.getCancelPolicy()!=null && roomCategory.getCancelPolicy().size()>0)\n\t\t{\n\t\t\tcom.kcdata.abe.data.dto.CancelPolicy cancelPolicy;\n\t\t\t\n\t\t\tfor(int cancel=0;cancel<roomCategory.getCancelPolicy().size();cancel++)\n\t\t\t{\n\t\t\t\tif(roomCategory.getCancelPolicy().get(cancel)!=null)\n\t\t\t\t{\n\t\t\t\t\tObject cancelObject = roomCategory.getCancelPolicy().get(cancel);\n\t\t\t\t\tif(cancelObject instanceof com.kcdata.abe.data.dto.CancelPolicy)\n\t\t\t\t\t{\n\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(cancel,this.getCancelPolicyReq(roomCategory.getCancelPolicy().get(cancel)));\n\t\t\t\t\t}\n//\t\t\t\t\telse if(cancelObject instanceof ASObject)\n//\t\t\t\t\t{\n//\t\t\t\t\t\tASTranslator ast = new ASTranslator();\n//\t\t\t\t\t\tASObject cancelASObject = (ASObject)cancelObject;\n//\t\t\t\t\t\tcancelASObject.setType(\"com.kcdata.abe.data.dto.CancelPolicy\");\n//\t\t\t\t\t\tcancelPolicy=(com.kcdata.abe.data.dto.CancelPolicy)ast.convert(cancelASObject, com.kcdata.abe.data.dto.CancelPolicy.class);\n//\t\t\t\t\t\t\n//\t\t\t\t\t\troomCategoryReq.getCancelPolicy().add(this.getCancelPolicyReq(cancelPolicy));\n//\t\t\t\t\t\t\n//\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn roomCategoryReq;\n\t}", "public int getR_Category_ID();", "public void setNotiCategory(String value) {\r\n setAttributeInternal(NOTICATEGORY, value);\r\n }", "protected String setlocale(String locale, String category) {\n\t\treturn \"C\";\n\t}", "public void setNotiSubcategory(String value) {\r\n setAttributeInternal(NOTISUBCATEGORY, value);\r\n }", "public void visitMICR( DevCat devCat ) {}", "void setDeploymentCategory(String deploymentId, String category);", "@AutoEscape\n public String getCategory();", "public void updatePortletCategory(PortletCategory category);", "public void setErrorCategory(String errorCategory) {\n this.errorCategory = errorCategory == null ? null : errorCategory.trim();\n }", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "public void setCategory(Category category) {\r\n this.category = category;\r\n }" ]
[ "0.62376547", "0.5985839", "0.57382256", "0.5590899", "0.55172133", "0.5488471", "0.5432416", "0.5395583", "0.5386914", "0.5363053", "0.533856", "0.5291229", "0.5275972", "0.52280945", "0.52086484", "0.5192944", "0.519166", "0.5137215", "0.5132005", "0.51147157", "0.50812215", "0.5063315", "0.50337887", "0.50151354", "0.49679285", "0.49600923", "0.49545872", "0.49269333", "0.49158937", "0.49068278", "0.4887848", "0.4883417", "0.48652667", "0.48650753", "0.48619294", "0.48614016", "0.48613355", "0.4855629", "0.48508656", "0.4838733", "0.4831131", "0.48223034", "0.48195466", "0.48149532", "0.47881022", "0.47824582", "0.4781553", "0.47715992", "0.47690266", "0.47653338", "0.4749968", "0.47474998", "0.4736647", "0.47262287", "0.47236335", "0.47144622", "0.47116733", "0.4708157", "0.47036958", "0.46968713", "0.46936566", "0.46936566", "0.46936566", "0.46936566", "0.46936566", "0.4685799", "0.4682096", "0.46782514", "0.46745813", "0.46650502", "0.46505973", "0.46325237", "0.46308798", "0.46245223", "0.46238387", "0.46231088", "0.46122286", "0.46114728", "0.46032855", "0.45966315", "0.4588213", "0.45834774", "0.45723417", "0.4567748", "0.45669308", "0.45669308", "0.4555534", "0.45511967", "0.45465836", "0.45370343", "0.4536222", "0.45324814", "0.45273948", "0.451733", "0.45088017", "0.4495265", "0.44938597", "0.4477863", "0.44726965", "0.44677433" ]
0.6064466
1
Get the tolerable duration, in seconds, that a request of the given RCAT category can be pending in SAF handling when a request from an M2M Application does not specify a tolerable delay. A value of 1 represents an infinite duration.
public Integer getTolerableDelay() { return tolerableDelay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic int durationToWait() {\n\t\t\t\treturn getCarType() == 2 ? 60000 : 15000;\n\t\t\t}", "public Long tolerationSeconds() {\n return this.tolerationSeconds;\n }", "com.google.protobuf.Duration getDowntimeJailDuration();", "public RequestCategory withTolerableDelay(Integer tolerableDelay) {\n\t\tthis.tolerableDelay = tolerableDelay;\n\t\treturn this;\n\t}", "long getInitialDelayInSeconds();", "public int getSleepInterval() {\n if ((curAd < 0) || (tozAdCampaign.isEmpty())) {\n AppyAdService.getInstance().debugOut(TAG, \"Sleep interval defaulting to \" + AppyAdService.getInstance().getDefaultSleepInterval());\n return (AppyAdService.getInstance().getDefaultSleepInterval());\n }\n else {\n AppyAdService.getInstance().debugOut(TAG,\"Sleep interval for current ad is \"+tozAdCampaign.get(curAd).mAdDuration);\n return (tozAdCampaign.get(curAd).mAdDuration);\n }\n //else return (sleepInterval);\n }", "@DefaultValue(\"300\")\n int getDeleteGracePeriodSeconds();", "TimeResource maxDuration();", "public int getDelay() {\n return Math.abs(currentRequest.getRequestToFloor() - currentRequest.getRequestFromFloor()) * 1000;\n }", "int getNominalDelay();", "@DefaultValue(\"600\")\n long getPodTerminationGracePeriodSeconds();", "int getTestDuration() {\n return config.big ? TEST_TIME_SECONDS : TEST_TIME_SECONDS / 10;\n }", "public static Duration retrieveDuration(ComprehensionTlv ctlv) throws ResultException {\r\n Duration.TimeUnit timeUnit = Duration.TimeUnit.SECOND;\r\n byte[] rawValue = ctlv.getRawValue();\r\n int valueIndex = ctlv.getValueIndex();\r\n try {\r\n return new Duration(rawValue[valueIndex + 1] & OemCdmaTelephonyManager.OEM_RIL_CDMA_RESET_TO_FACTORY.RESET_DEFAULT, Duration.TimeUnit.values()[rawValue[valueIndex] & OemCdmaTelephonyManager.OEM_RIL_CDMA_RESET_TO_FACTORY.RESET_DEFAULT]);\r\n } catch (IndexOutOfBoundsException e) {\r\n throw new ResultException(ResultCode.CMD_DATA_NOT_UNDERSTOOD);\r\n }\r\n }", "@Override\r\n\tpublic float Cooldown(int skilLevel, int augID) {\n\t\treturn 20;\r\n\t}", "String getMaximumRedeliveryDelay();", "long getCriticalPathDurationMs();", "int getMaximumDelay();", "@DefaultValue(\"0\")\n long getTerminatedPodGcDelayMs();", "public int calcAcknowledgeTime()\n {\n return( TIMEOUT );\n }", "public int calcAcknowledgeTime()\n {\n return( TIMEOUT );\n }", "public double connectionTimeoutSecs() {\n if (connectionTimeoutSecs <= 0)\n return Jvm.isDebug() ? 120 : 10;\n return connectionTimeoutSecs;\n }", "int getAbsoluteMaximumDelay();", "public Optional<Integer> maxLeaseTtlSeconds() {\n return Codegen.integerProp(\"maxLeaseTtlSeconds\").config(config).env(\"TERRAFORM_VAULT_MAX_TTL\").def(1200).get();\n }", "Double getActualDuration();", "public double DrivetrainLimiterWithTimeScale(){\n\t\tif (this.GetAverageTotalCurrent() > this.drivetrainCurrentLimit){\n\t\t\tpresentTime = Timer.getFPGATimestamp();\n\t\t\ttimeError = Math.abs(presentTime - startTime);\n\t\t\t\n\t\t\tcurrentError = Math.abs(this.GetAverageTotalCurrent() - this.drivetrainCurrentLimit);\n\t\t\tlimiter = 1 - (currentError * cKp) - (timeError * tKp);\n\t\t}\n\t\telse{\n\t\t\tstartTime = Timer.getFPGATimestamp();\n\t\t\tlimiter = 1;\n\t\t}\n\t\t\n\t\treturn limiter;\n\t\t\n\t}", "int getRecurrenceDuration();", "private static float getDefaultDuration(ResourceLocation effectId) {\n return new ResourceLocation(\"night_vision\").equals(effectId) ? 15.9f : 1.9f;\n }", "public static long suggestedRefreshInterval(long duration) {\n if (duration < MIN_REFRESH_MARGIN * 2) {\n return duration / 2;\n } else {\n return duration - MIN_REFRESH_MARGIN;\n }\n }", "public default int getDuration(int casterLevel){ return Reference.Values.TICKS_PER_SECOND; }", "protected long deadlineSeconds() {\n return DEFAULT_TASK_SECONDS;\n }", "int getChronicDelayTime();", "private int getWaitTime(HashMap confMap) {\n return Integer.parseInt(confMap.get(\"TimeoutInSecond\").toString());\n }", "int getDuration();", "int getDuration();", "private int blockingDialogDelay()\r\n/* */ {\r\n/* 313 */ Integer delay = null;\r\n/* 314 */ String key = \"BlockingDialogTimer.delay\";\r\n/* 315 */ ApplicationAction action = getAction();\r\n/* 316 */ if (action != null) {\r\n/* 317 */ ResourceMap actionResourceMap = action.getResourceMap();\r\n/* 318 */ String actionName = action.getName();\r\n/* 319 */ delay = actionResourceMap.getInteger(actionName + \".\" + key);\r\n/* */ }\r\n/* 321 */ ResourceMap taskResourceMap = getTask().getResourceMap();\r\n/* 322 */ if ((delay == null) && (taskResourceMap != null)) {\r\n/* 323 */ delay = taskResourceMap.getInteger(key);\r\n/* */ }\r\n/* 325 */ return delay == null ? 0 : delay.intValue();\r\n/* */ }", "@Override\n public long getRemainingSeconds(UUID uuid) {\n final long now = System.currentTimeMillis();\n final long lastUsageTime = cooldownList.get( uuid );\n final long diff = now - lastUsageTime;\n\n // Get enderpearl cooldown from configs\n final EnderpearlCategory cc = Sponge.getServiceManager().provideUnchecked(ConfigService.class).\n getGlobal().\n getEnderpearlCategory();\n final long cooldown = cc.getCooldownSeconds();\n\n // Negative values means the cooldown expired\n if (TimeUnit.MILLISECONDS.toSeconds(diff) > cooldown) {\n updateUserCooldown( uuid );\n return 0;\n }\n\n return TimeUnit.MILLISECONDS.toSeconds(diff);\n }", "long getDuration();", "java.lang.String getTransitFlightDuration();", "public Integer getDuration() {\n return duration;\n }", "private int getDeleteExportDelay() {\r\n\tint timeout = 0;\r\n\r\n\t// TODO Check first in sakai.properties, then in the components.xml as\r\n\t// a bean property and then use the constant.\r\n\tString timeOutString =\r\n\t\tServerConfigurationService\r\n\t\t\t.getString(EXPORT_DELETE_DELAY_MINUTES_KEY);\r\n\tif (timeOutString != null && !\"\".equals(timeOutString)) {\r\n\t timeout = Integer.parseInt(timeOutString);\r\n\t} else if (timeOutString == null) {\r\n\t timeout = EXPORT_DELETE_DELAY_MINUTES;\r\n\t}\r\n\treturn timeout;\r\n\r\n }", "int getRunningDuration();", "public abstract float getCooldownRemaining();", "public int getDuration();", "@SuppressWarnings(\"unchecked\")\n public static Optional<Duration> getJobRuntimePrediction(JobDescriptor jobDescriptor) {\n if (!isBatchJob(jobDescriptor)) {\n return Optional.empty();\n }\n Map<String, String> attributes = ((JobDescriptor<BatchJobExt>) jobDescriptor).getAttributes();\n return Optional.ofNullable(attributes.get(JobAttributes.JOB_ATTRIBUTES_RUNTIME_PREDICTION_SEC))\n .flatMap(StringExt::parseDouble)\n .map(seconds -> ((long) (seconds * 1000))) // seconds -> milliseconds\n .map(Duration::ofMillis);\n }", "float getDuration() throws InterruptedException, ConnectionLostException;", "long getIntervalInSeconds();", "java.lang.String getFlightLegDuration();", "public long getDuration() { throw new RuntimeException(\"Stub!\"); }", "@Schema(description = \"The time interval (in seconds) to wait for the VNF to be taken out of service during graceful stop, before stopping the VNF. \")\n public Integer getGracefulStopTimeout() {\n return gracefulStopTimeout;\n }", "public float getMaxTimeSeconds() { return getMaxTime()/1000f; }", "int getRemainingCooldown();", "Integer getStartTimeout();", "com.google.protobuf.DurationOrBuilder getDowntimeJailDurationOrBuilder();", "public int getMaxRelativeTimeoutMillis(AsyncOperation op);", "long getDurationNanos();", "private long calculateConnectionFailedTimeout()\r\n { \r\n // Once we are over BAD_CANDIDATE_CONNECTION_TRIES we dont call this \r\n // method anymore and use BAD_CANDIDATE_STATUS_TIMEOUT instead.\r\n \r\n // When CONNECTION_FAILED_STEP_TIME time is 2 it gives a sequence of\r\n // tries: 1, 2, 3,| 4, 5, 6, 7, 8, 9, 10\r\n // to: 2, 4, 8,| 16, 32, 64, 128, 128, 128, 128\r\n // to2: 2, 6, 12,| 22, 40, 74, 140, 142, 144, 146 \r\n // \r\n // to1 - would cause the values to double on each repetition.\r\n // CONNECTION_FAILED_STEP_TIME * (long)Math.pow( 2, \r\n // Math.min( failedConnectionTries - 1, 7 ) );\r\n // to2 - would add a raising penalty to to1 on each repetition\r\n // CONNECTION_FAILED_STEP_TIME * (long)Math.pow( 2,\r\n // Math.min( failedConnectionTries - 1, 7 ) ) \r\n // + (failedConnectionTries - 1) * 2;\r\n //\r\n // We use to2 currently:\r\n return CONNECTION_FAILED_STEP_TIME * (long)Math.pow( 2,\r\n Math.min( failedConnectionTries - 1, 7 ) ) \r\n + (failedConnectionTries - 1) * 2;\r\n }", "private static int getDuration() {\n\t\tStack<Object> stack = b.getCurrentWorkFrame();\n\t\tObject obj = stack.peek();\n\t\tif (Simulator.DEBUG)\n\t\t\tSystem.out.println(b.printStack() + \"...\");\n\t\tif (obj instanceof WorkFrame)\n\t\t\tthrow new RuntimeException(\"***ERROR: the next obj on stack should\"\n\t\t\t\t\t+ \"be an activity! WF_Sim.getDuration\" + obj.toString());\n\t\tActivityInstance ai = (ActivityInstance) stack.peek();\n\t\tif (ai.getActivity() instanceof CompositeActivity) {\n\t\t\tCompositeActivity comp = (CompositeActivity) ai.getActivity();\n\t\t\tif (frameInImpassed(comp))\n\t\t\t\treturn -1;\n\t\t\telse\n\t\t\t\tthrow new RuntimeException(\"***ERROR: push shouldn't have ended \" +\n\t\t\t\t\t\"with a composite on top\");\n\t\t}\n\t\treturn ai.getDuration();\n\t}", "public static DurationTag getCooldownDuration(PlayerTag player, String scriptName) {\r\n\r\n // Change to UPPERCASE so there's no case-sensitivity.\r\n scriptName = scriptName.toUpperCase();\r\n\r\n DurationTag duration = DurationTag.ZERO;\r\n\r\n // Check current entry GLOBALLY, reset it if necessary\r\n if (DenizenAPI.getSaves().contains(\"Global.Scripts.\" + scriptName + \".Cooldown Time\")) {\r\n if (System.currentTimeMillis()\r\n < DenizenAPI.getSaves().getLong(\"Global.Scripts.\" + scriptName + \".Cooldown Time\")) {\r\n duration = new DurationTag((double) (DenizenAPI.getSaves().getLong(\"Global.Scripts.\" + scriptName\r\n + \".Cooldown Time\") - System.currentTimeMillis()) / 1000);\r\n }\r\n }\r\n\r\n // No player specified? No need to check any further...\r\n if (player == null) {\r\n return duration;\r\n }\r\n\r\n // If no entry for the script, return true\r\n if (!DenizenAPI.getSaves().contains(\"Players.\" + player.getSaveName() + \".Scripts.\" + scriptName + \".Cooldown Time\")) {\r\n return duration;\r\n }\r\n\r\n // If there is an entry, check against the time\r\n if (System.currentTimeMillis()\r\n <= DenizenAPI.getSaves().getLong(\"Players.\" + player.getSaveName() + \".Scripts.\" + scriptName + \".Cooldown Time\")) {\r\n DurationTag player_dur = new DurationTag((double) (DenizenAPI.getSaves().getLong(\"Players.\" + player.getSaveName() + \".Scripts.\"\r\n + scriptName + \".Cooldown Time\") - System.currentTimeMillis()) / 1000);\r\n if (player_dur.getSeconds() > duration.getSeconds()) {\r\n return player_dur;\r\n }\r\n }\r\n\r\n return duration;\r\n }", "@Property(displayName = \"Timeout\", description = \"Sets the amount of time that must pass in milliseconds\"\n\t\t\t+ \" before the reader stops looking for tags. If this value is too small, the reader will not \"\n\t\t\t+ \"read from all of its antennas. Because of this, it is recommended that the value be at least 500ms. \"\n\t\t\t+ \"\", writable = true, type = PropertyType.PT_INTEGER, minValue = \"\"\n\t\t\t+ \"500\", maxValue = \"16535\", defaultValue = \"1000\", category=\"Timeout\")\n\tpublic Integer getTimeout() {\n\t\treturn timeout;\n\t}", "private int get_delay() {\n double exp = slider1.getValue() / 100.0 - 9; // Range -9, 1\n exp = Math.min(0, exp); // Range -9, 0\n return (int) (Math.pow(10.0, exp) * 100000000.0);\n }", "public int getTimeoutInSeconds() {\n return timeoutInSeconds;\n }", "public double getDelay();", "public Long getDurationMs();", "private Optional<Integer> getDurationForStatus(Status s) {\n Integer customD = durationPerStatus.get(s);\n if (customD != null) {\n return Optional.of(customD);\n }\n // is there a default one set?\n if (defaultDuration != null) {\n return Optional.of(defaultDuration);\n }\n // no default value or custom one for that status\n return Optional.empty();\n }", "public static int getSleepTime()\n {\n int result = SLEEP_TIME;\n SLEEP_TIME += SLEEP_TIME_INTERVAL;\n if (SLEEP_TIME > SLEEP_TIME_MAX)\n {\n SLEEP_TIME = 0;\n }\n return result;\n }", "public int getTimeoutInterval() {\n return timeoutInterval_;\n }", "float getPostEndOfAudioTimeoutMs();", "public int getDuration() {\n return duration_;\n }", "public Duration toDuration() {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.statements[23]++;\r\n long durMillis = toDurationMillis();\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.statements[24]++;\nint CodeCoverConditionCoverageHelper_C9;\r\n if ((((((CodeCoverConditionCoverageHelper_C9 = 0) == 0) || true) && (\n(((CodeCoverConditionCoverageHelper_C9 |= (2)) == 0 || true) &&\n ((durMillis == 0) && \n ((CodeCoverConditionCoverageHelper_C9 |= (1)) == 0 || true)))\n)) && (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[9].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C9, 1) || true)) || (CodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.conditionCounters[9].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C9, 1) && false)) {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[17]++;\r\n return Duration.ZERO;\n\r\n } else {\nCodeCoverCoverageCounter$1ib8k6g9t1mz1yofrpsdr7xlpbrhwxq3l.branches[18]++;\r\n return new Duration(durMillis);\r\n }\r\n }", "long getDuration(TimeUnit timeUnit);", "public int getDuration() {\n return duration_;\n }", "private long determineErrorStatusTimeout( short aErrorStatus )\r\n {\r\n if ( errorStatus == aErrorStatus )\r\n {\r\n errorStatusRepetition ++;\r\n }\r\n else\r\n {\r\n errorStatus = aErrorStatus;\r\n errorStatusRepetition = 0;\r\n }\r\n switch( errorStatus )\r\n {\r\n case STATUS_CANDIDATE_BUSY:\r\n // we can add here a step thing for each retry with a top limit\r\n // and a shorter start sleep time but currently we keep it like this.\r\n return HOST_BUSY_SLEEP_TIME;\r\n /*( statusRepetition + 1 ) * */\r\n case STATUS_CANDIDATE_RANGE_UNAVAILABLE:\r\n // when step time is 1 it gives a sequence of\r\n // 1, 2, 4, 8, 16, 32...\r\n // this would cause the values to double on each repetition.\r\n return RANGE_UNAVAILABLE_STEP_TIME * (long)Math.pow( 2, errorStatusRepetition );\r\n case STATUS_CANDIDATE_REMOTLY_QUEUED:\r\n if ( xQueueParameters == null )\r\n {\r\n return 0;\r\n }\r\n else\r\n {\r\n return xQueueParameters.getRequestSleepTime();\r\n }\r\n default:\r\n NLogger.warn( NLoggerNames.Download_Candidate, \"Unknown error status: \" + errorStatus );\r\n return 0;\r\n }\r\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay getPaymentDelay();", "public Long getMaxDelayTime() {\n return this.MaxDelayTime;\n }", "int getMaxCooldown();", "public int getCooldown() {\n \t\treturn cooldown + ((int) 0.5*level);\n \t}", "private Duration calculateDelay(ZonedDateTime expirationTime) {\n return Optional.of(Duration.between(DateUtil.now(), expirationTime))\n .filter(d -> !d.isNegative())\n .orElse(forceExecuteExpiredJobs\n .filter(Boolean.TRUE::equals)\n .map(f -> Duration.ofSeconds(1))\n .orElse(Duration.ofSeconds(-1)));\n }", "public int getduration() {\n\t\tDuration duration = Duration.between(initial_time, current_time);\n\t\treturn (int)duration.getSeconds();\n\t}", "org.apache.xmlbeans.XmlInt xgetRecurrenceDuration();", "public int getTimeout() {\n return params.getTimeout() * 1000;\n }", "@DefaultValue(\"300000\")\n long getUnknownPodGcTimeoutMs();", "public int getNortpTimeout();", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "public int getDuration() {\n return duration;\n }", "org.apache.xmlbeans.GDuration getDuration();", "@Test(groups = { \"simple\" }, timeOut = TIMEOUT)\n public void maxValueExceedingDefinedLimitStillWorksWithoutException() throws Exception {\n\n this.beforeTest(CosmosMetricCategory.DEFAULT);\n\n try {\n Tag dummyOperationTag = Tag.of(TagName.Operation.toString(), \"TestDummy\");\n Timer latencyMeter = Timer\n .builder(\"cosmos.client.op.latency\")\n .description(\"Operation latency\")\n .maximumExpectedValue(Duration.ofSeconds(300))\n .publishPercentiles(0.95, 0.99)\n .publishPercentileHistogram(true)\n .tags(Collections.singleton(dummyOperationTag))\n .register(this.meterRegistry);\n latencyMeter.record(Duration.ofSeconds(600));\n\n Meter requestLatencyMeter = this.assertMetrics(\n \"cosmos.client.op.latency\",\n true,\n dummyOperationTag);\n\n List<Measurement> measurements = new ArrayList<>();\n requestLatencyMeter.measure().forEach(measurements::add);\n\n assertThat(measurements.size()).isEqualTo(3);\n\n assertThat(measurements.get(0).getStatistic().getTagValueRepresentation()).isEqualTo(\"count\");\n assertThat(measurements.get(0).getValue()).isEqualTo(1);\n assertThat(measurements.get(1).getStatistic().getTagValueRepresentation()).isEqualTo(\"total\");\n assertThat(measurements.get(1).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n assertThat(measurements.get(2).getStatistic().getTagValueRepresentation()).isEqualTo(\"max\");\n assertThat(measurements.get(2).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n } finally {\n this.afterTest();\n }\n }", "public Duration getDuration(Rule rule) throws DatatypeConfigurationException {\n Constraint constraint = rule.getConstraint().get(0);\n if (constraint.getRightOperand().getType().equals(\"xsd:duration\")) {\n String duration = constraint.getRightOperand().getValue();\n return DatatypeFactory.newInstance().newDuration(duration);\n } else {\n return null;\n }\n }", "public float getFixedDuration() {\n return fixedDuration;\n }", "long getVoteFinalizeDelaySeconds();", "public long getDelay();", "public int getDuration() {\n return this.duration;\n }", "String getRedeliveryDelay();", "public Integer timeoutSeconds() {\n return this.timeoutSeconds;\n }", "protected final Optional<Integer> checkCustomInterval(Metadata metadata,\n Status s) {\n if (customIntervals == null)\n return Optional.empty();\n\n for (CustomInterval customInterval : customIntervals) {\n String[] values = metadata.getValues(customInterval.key);\n if (values == null) {\n continue;\n }\n for (String v : values) {\n if (v.equals(customInterval.value)) {\n return customInterval.getDurationForStatus(s);\n }\n }\n }\n\n return Optional.empty();\n }", "Double getScheduleDuration();", "public int getFetchDelay() {\r\n return getAttributeAsInt(\"fetchDelay\");\r\n }", "public Long getDuration()\r\n {\r\n return duration;\r\n }", "static int calcCoolingTime(int temperature, int amount) {\n // the time in melting reipes assumes updating 5 times a second\n // we update 20 times a second, so get roughly a quart of those values\n return IMeltingRecipe.calcTimeForAmount(temperature, amount);\n }", "@RequestMapping(\"/circuitbreaker/timeout/{duration}\")\n public ResponseEntity<String> setTimeout(@PathVariable int duration){\n ConfigurationManager.getConfigInstance().setProperty(\"hystrix.command.resources.execution.isolation.thread.timeoutInMilliseconds\", duration);\n return new ResponseEntity<String>(\"Duration in msec: \" + duration, HttpStatus.OK);\n }" ]
[ "0.58032846", "0.5797339", "0.54450387", "0.54081976", "0.53265405", "0.5301249", "0.52483296", "0.52463317", "0.5215989", "0.5162968", "0.5137315", "0.5119957", "0.5059756", "0.5047375", "0.5044296", "0.50219494", "0.5021018", "0.50148785", "0.4988717", "0.4988717", "0.4980842", "0.49723518", "0.49680158", "0.49662396", "0.49522975", "0.4928645", "0.49246094", "0.49059153", "0.49052992", "0.48814195", "0.48798633", "0.48724964", "0.4859421", "0.4859421", "0.4858196", "0.48419544", "0.48330376", "0.4827762", "0.48197237", "0.4807288", "0.47970542", "0.47843644", "0.47831297", "0.47794998", "0.4779049", "0.47763115", "0.4776036", "0.47713947", "0.47566295", "0.47533846", "0.47434887", "0.47420114", "0.4737912", "0.47222766", "0.47215545", "0.4713146", "0.47110754", "0.47072607", "0.46945432", "0.46937403", "0.4692934", "0.46833435", "0.46828198", "0.46810213", "0.46706536", "0.4669413", "0.46689594", "0.4666148", "0.46655312", "0.46640235", "0.4662125", "0.46614143", "0.46593818", "0.46573365", "0.4655685", "0.46438175", "0.46425456", "0.4639783", "0.46243215", "0.46191335", "0.46186146", "0.4614422", "0.46105674", "0.46105674", "0.46105674", "0.4609306", "0.46063554", "0.4603617", "0.46013665", "0.4600403", "0.4599748", "0.45959178", "0.45916504", "0.45865718", "0.45846626", "0.45828032", "0.45820394", "0.45783672", "0.45750442", "0.45716396" ]
0.54350066
3
Set the tolerable duration, in seconds, that a request of the given RCAT category can be pending in SAF handling when a request from an M2M Application does not specify a tolerable delay. A value of 1 represents an infinite duration.
public void setTolerableDelay(Integer tolerableDelay) { this.tolerableDelay = tolerableDelay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RequestCategory withTolerableDelay(Integer tolerableDelay) {\n\t\tthis.tolerableDelay = tolerableDelay;\n\t\treturn this;\n\t}", "@Override\n\t\t\tpublic int durationToWait() {\n\t\t\t\treturn getCarType() == 2 ? 60000 : 15000;\n\t\t\t}", "public void setDuration(int val){this.duration = val;}", "void setDuration(int duration);", "public void setDuration( Long duration );", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "@DefaultValue(\"300\")\n int getDeleteGracePeriodSeconds();", "public void setRunDuration(int value) {\n this.runDuration = value;\n }", "public void setWarmupTime(int value) {\n this.warmupTime = value;\n }", "void setRecurrenceDuration(int recurrenceDuration);", "@Override\r\n\tpublic float Cooldown(int skilLevel, int augID) {\n\t\treturn 20;\r\n\t}", "public void setDuration(int duration){\n this.duration = duration;\n }", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "public void setCoolDown(long value) {\n\t\tcooldown = value;\n\t}", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setRequestInterval(int requestInterval) {\n final int minSecs = 15;\n final int maxSecs = 600; // 10 minutes\n\n if (requestInterval <= 0) {\n requestInterval = 0;\n } else if (requestInterval < minSecs) {\n // Too often. Cannot request ads more frequently than minSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be >= \" + minSecs);\n } else if (requestInterval > maxSecs) {\n // Too infrequent. If setting this value there is no reason to have ads update more than maxSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be <= \" + maxSecs);\n }\n\n int requestIntervalMillisecs = requestInterval * 1000;\n this.requestInterval = requestIntervalMillisecs;\n\n // Set the timer to handle requesting fresh ads.\n if (requestInterval == 0) {\n // Stop the current timer (if there is one).\n manageRequestIntervalTimer(false);\n } else {\n // Start the timer.\n Log.i(AdManager.LOG, \"Requesting fresh ads every \" + requestInterval + \" seconds.\");\n manageRequestIntervalTimer(true);\n }\n }", "public void setDuration(Long duration)\r\n {\r\n this.duration = duration;\r\n }", "public void setDelay(long d){delay = d;}", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void SetDuration(int duration)\n {\n TimerMax = duration;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "void setDuration(java.lang.String duration);", "@RequestMapping(\"/circuitbreaker/timeout/{duration}\")\n public ResponseEntity<String> setTimeout(@PathVariable int duration){\n ConfigurationManager.getConfigInstance().setProperty(\"hystrix.command.resources.execution.isolation.thread.timeoutInMilliseconds\", duration);\n return new ResponseEntity<String>(\"Duration in msec: \" + duration, HttpStatus.OK);\n }", "public void setDuration(int duration) {\n mDuration = duration;\n }", "protected void setDuraction(int seconds) {\n duration = seconds * 1000L;\n }", "public LimitDuration(long maxDuration) {\n _maxDuration = maxDuration;\n }", "public void setDuration(int duration)\r\n\t{\r\n\t\tif (duration < 0) { throw new IllegalArgumentException(\"duration muss groesser als 0 sein\"); }\r\n\t\tthis.duration = duration;\r\n\t}", "void setMaxCooldown(int maxCooldown);", "public void setDuration(int newDuration) {\n this.duration = newDuration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDuration(Number duration) {\n this.duration = duration;\n }", "@Override\n\tpublic int withIntervalInSeconds() {\n\t\treturn 10;\n\t}", "public V1Toleration withTolerationSeconds(Long tolerationSeconds) {\n this.tolerationSeconds = tolerationSeconds;\n return this;\n }", "public void setDuration(int duration) {\n if (this.duration != duration) {\n this.duration = duration;\n }\n }", "Builder addTimeRequired(Duration value);", "public Long tolerationSeconds() {\n return this.tolerationSeconds;\n }", "@DefaultValue(\"600\")\n long getPodTerminationGracePeriodSeconds();", "public void setMaxTimeSeconds(float aTime) { setMaxTime(Math.round(aTime*1000)); }", "long getInitialDelayInSeconds();", "protected int minTimeout() { return 500; }", "public void setTimeLimit(long value) {\n\t\ttimeLimit = value;\n\t}", "void setRemainingCooldown(int remainingCooldown);", "public Builder setDuration(int value) {\n bitField0_ |= 0x00000008;\n duration_ = value;\n onChanged();\n return this;\n }", "private boolean durationValidation(int duration){\n return duration < 300 && duration >10;\n }", "@Autowired\n\tpublic void setDuration(@Value(\"${repair.duration}\") Duration duration) {\n\t\tthis.duration = DurationConverter.oneOrMore(duration);\n\t}", "public Integer getTolerableDelay() {\n\t\treturn tolerableDelay;\n\t}", "TimeResource maxDuration();", "public void setIncTimeout(int seconds);", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public void setDelayedTimeout(int seconds);", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "public void setDuration(Duration duration)\r\n {\r\n m_duration = duration;\r\n }", "@Test\n public void addRecord_absorbs_effective_duration_TR() {\n aggregatedDay.addRecord(aRecordWithinTheAggregatedDay(today, 160, Rounding.Strategy.SIXTY_MINUTES_UP));\n\n // then: duration is increased by *effective* duration\n assertEquals(3, aggregatedDay.getDuration().getStandardHours());\n }", "void setVoteFinalizeDelaySeconds(long voteFinalizeDelaySeconds);", "private static float getDefaultDuration(ResourceLocation effectId) {\n return new ResourceLocation(\"night_vision\").equals(effectId) ? 15.9f : 1.9f;\n }", "@Override\n public void onDurationUs(long durationUs) {\n sleep();\n isDurationSet = true;\n }", "public void setDuration(float duration) {\n\t\tthis.duration = duration;\n\t}", "protected int maxTimeout() { return 15*1000*1000; }", "@Test\n public void testTripCircuitOnTimeoutsAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public Builder setResponseTimeSec(long value) {\n bitField0_ |= 0x00000800;\n responseTimeSec_ = value;\n onChanged();\n return this;\n }", "@Property(displayName = \"Timeout\", description = \"Sets the amount of time that must pass in milliseconds\"\n\t\t\t+ \" before the reader stops looking for tags. If this value is too small, the reader will not \"\n\t\t\t+ \"read from all of its antennas. Because of this, it is recommended that the value be at least 500ms. \"\n\t\t\t+ \"\", writable = true, type = PropertyType.PT_INTEGER, minValue = \"\"\n\t\t\t+ \"500\", maxValue = \"16535\", defaultValue = \"1000\", category=\"Timeout\")\n\tpublic Integer getTimeout() {\n\t\treturn timeout;\n\t}", "public void setSleepTime(final long l) {\n if (l <= 0) {\n throw new IllegalArgumentException(\"Sleep Time must be a non-zero positive number\");\n }\n sleepTime = l;\n }", "void setDuration(org.apache.xmlbeans.GDuration duration);", "public void setDuration(Duration param) {\n this.localDuration = param;\n }", "void xsetRecurrenceDuration(org.apache.xmlbeans.XmlInt recurrenceDuration);", "private void setSessionDuration(int sessionDuration) {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor editor = sp.edit();\n editor.putInt(Constants.SESSION_QUEST_DURATION, sessionDuration);\n editor.apply();\n }", "public void setTimeLimit(java.util.Collection timeLimit);", "public void setNortpTimeout(int seconds);", "public SleepWork(long durationMillis, String category, String id) {\n super(id);\n this.durationMillis = durationMillis;\n this.category = category;\n partitionKey = String.valueOf(count.incrementAndGet());\n setProgress(Progress.PROGRESS_0_PC);\n }", "public void setMaxDelayTime(Long MaxDelayTime) {\n this.MaxDelayTime = MaxDelayTime;\n }", "private Sleep(Duration duration) {\n this.duration = duration;\n }", "public Builder setResponseTimeNsec(int value) {\n bitField0_ |= 0x00001000;\n responseTimeNsec_ = value;\n onChanged();\n return this;\n }", "@NonNull\n public Builder setNattKeepAliveDelaySeconds(\n @IntRange(\n from = IKE_NATT_KEEPALIVE_DELAY_SEC_MIN,\n to = IKE_NATT_KEEPALIVE_DELAY_SEC_MAX)\n int nattKeepaliveDelaySeconds) {\n if (nattKeepaliveDelaySeconds < IKE_NATT_KEEPALIVE_DELAY_SEC_MIN\n || nattKeepaliveDelaySeconds > IKE_NATT_KEEPALIVE_DELAY_SEC_MAX) {\n throw new IllegalArgumentException(\"Invalid NATT keepalive delay value\");\n }\n mNattKeepaliveDelaySec = nattKeepaliveDelaySeconds;\n return this;\n }", "abstract protected long getDefaultRelTimeoutMillis();", "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}", "void setPaymentDelay(ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay paymentDelay);", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "public void setSleepInterval(int len) {\n\t\tsleepSpinner.setValue(len);\n\t}", "public void setBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public Builder setUpdateIntervalInSec(long value) {\n \n updateIntervalInSec_ = value;\n onChanged();\n return this;\n }", "@Override\r\n \t\t\tpublic void setSessionDuration(long duration) {\n \t\t\t\t\r\n \t\t\t}", "public void setBoostExpiration(){\r\n\t\tboostExpiration = GameController.getTimer() + 1000000000l * length;\r\n\t}", "public void SetTimeRemaining(int value) {\n Timer = value;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "public void setDelay(int delay) {\n this.delay = delay;\n }", "@Test(groups = { \"simple\" }, timeOut = TIMEOUT)\n public void maxValueExceedingDefinedLimitStillWorksWithoutException() throws Exception {\n\n this.beforeTest(CosmosMetricCategory.DEFAULT);\n\n try {\n Tag dummyOperationTag = Tag.of(TagName.Operation.toString(), \"TestDummy\");\n Timer latencyMeter = Timer\n .builder(\"cosmos.client.op.latency\")\n .description(\"Operation latency\")\n .maximumExpectedValue(Duration.ofSeconds(300))\n .publishPercentiles(0.95, 0.99)\n .publishPercentileHistogram(true)\n .tags(Collections.singleton(dummyOperationTag))\n .register(this.meterRegistry);\n latencyMeter.record(Duration.ofSeconds(600));\n\n Meter requestLatencyMeter = this.assertMetrics(\n \"cosmos.client.op.latency\",\n true,\n dummyOperationTag);\n\n List<Measurement> measurements = new ArrayList<>();\n requestLatencyMeter.measure().forEach(measurements::add);\n\n assertThat(measurements.size()).isEqualTo(3);\n\n assertThat(measurements.get(0).getStatistic().getTagValueRepresentation()).isEqualTo(\"count\");\n assertThat(measurements.get(0).getValue()).isEqualTo(1);\n assertThat(measurements.get(1).getStatistic().getTagValueRepresentation()).isEqualTo(\"total\");\n assertThat(measurements.get(1).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n assertThat(measurements.get(2).getStatistic().getTagValueRepresentation()).isEqualTo(\"max\");\n assertThat(measurements.get(2).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n } finally {\n this.afterTest();\n }\n }", "public void removeBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.remove(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public void setDuration(int duration) {\r\n this.duration = duration;\r\n if (connections.get(lightIndex).getTrafficLight().getSignal()\r\n == TrafficSignal.YELLOW) {\r\n connections.get(lightIndex).getTrafficLight().setSignal\r\n (TrafficSignal.GREEN);\r\n }\r\n currentGreenTime = 0;\r\n currentYellowTime = 0;\r\n }", "void xsetDuration(org.apache.xmlbeans.XmlInt duration);", "public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }", "String getMaximumRedeliveryDelay();", "public synchronized void setRemovalTimeout(long removalTimeout) {\n this.removalTimeout = removalTimeout;\n }", "public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }", "@Test\n public void testMaybeScheduleStartAlarmLocked_SmallRollingQuota_UpdatedAllowedTime() {\n setDeviceConfigLong(QcConstants.KEY_ALLOWED_TIME_PER_PERIOD_WORKING_MS,\n mQcConstants.ALLOWED_TIME_PER_PERIOD_WORKING_MS / 2);\n\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_AllowedTimeCheck();\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE).clear();\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_MaxTimeCheck();\n }", "public Builder setQuickSwapCooldownDurationMs(long value) {\n \n quickSwapCooldownDurationMs_ = value;\n onChanged();\n return this;\n }", "public void setCatId(long value) {\n this.catId = value;\n }" ]
[ "0.59987193", "0.53285116", "0.5289776", "0.525282", "0.5219209", "0.5175498", "0.5173651", "0.5164048", "0.5161432", "0.51308835", "0.5125955", "0.5104281", "0.5065499", "0.50332385", "0.50026435", "0.50026435", "0.4957363", "0.48850134", "0.4876889", "0.48653302", "0.485808", "0.485808", "0.48576525", "0.48523447", "0.48355988", "0.48278818", "0.482465", "0.48111695", "0.480936", "0.48041156", "0.47810185", "0.4779646", "0.47456357", "0.47456357", "0.47455728", "0.47436956", "0.47356784", "0.47195572", "0.46994638", "0.46989888", "0.46792483", "0.46769804", "0.4675409", "0.4662248", "0.4661066", "0.46492156", "0.46465772", "0.46288195", "0.4628662", "0.46030736", "0.4599269", "0.4594407", "0.45934978", "0.45922002", "0.45900923", "0.4579654", "0.45553342", "0.4554635", "0.45431495", "0.4536392", "0.45343083", "0.45278257", "0.45137876", "0.45029354", "0.44883412", "0.4483188", "0.44823432", "0.44685382", "0.446137", "0.446015", "0.4457969", "0.44554225", "0.44542623", "0.44497642", "0.44185963", "0.44165593", "0.43943933", "0.43883282", "0.43772715", "0.43693066", "0.43651435", "0.43577707", "0.43507785", "0.435035", "0.43470067", "0.43421322", "0.43328622", "0.43280447", "0.43188733", "0.4316491", "0.4312072", "0.43069738", "0.43054593", "0.42999268", "0.42948407", "0.42867917", "0.42853653", "0.4284992", "0.42841887", "0.42826462" ]
0.55037856
1
Set the tolerable duration, in seconds, that a request of the given RCAT category can be pending in SAF handling when a request from an M2M Application does not specify a tolerable delay. A value of 1 represents an infinite duration.
public RequestCategory withTolerableDelay(Integer tolerableDelay) { this.tolerableDelay = tolerableDelay; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTolerableDelay(Integer tolerableDelay) {\n\t\tthis.tolerableDelay = tolerableDelay;\n\t}", "@Override\n\t\t\tpublic int durationToWait() {\n\t\t\t\treturn getCarType() == 2 ? 60000 : 15000;\n\t\t\t}", "public void setDuration(int val){this.duration = val;}", "void setDuration(int duration);", "public void setDuration( Long duration );", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "@DefaultValue(\"300\")\n int getDeleteGracePeriodSeconds();", "public void setRunDuration(int value) {\n this.runDuration = value;\n }", "public void setWarmupTime(int value) {\n this.warmupTime = value;\n }", "void setRecurrenceDuration(int recurrenceDuration);", "@Override\r\n\tpublic float Cooldown(int skilLevel, int augID) {\n\t\treturn 20;\r\n\t}", "public void setDuration(int duration){\n this.duration = duration;\n }", "public void setDuration(Integer duration) {\n this.duration = duration;\n }", "public void setCoolDown(long value) {\n\t\tcooldown = value;\n\t}", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setDuration(int duration) {\n this.duration = duration;\n }", "public void setRequestInterval(int requestInterval) {\n final int minSecs = 15;\n final int maxSecs = 600; // 10 minutes\n\n if (requestInterval <= 0) {\n requestInterval = 0;\n } else if (requestInterval < minSecs) {\n // Too often. Cannot request ads more frequently than minSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be >= \" + minSecs);\n } else if (requestInterval > maxSecs) {\n // Too infrequent. If setting this value there is no reason to have ads update more than maxSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be <= \" + maxSecs);\n }\n\n int requestIntervalMillisecs = requestInterval * 1000;\n this.requestInterval = requestIntervalMillisecs;\n\n // Set the timer to handle requesting fresh ads.\n if (requestInterval == 0) {\n // Stop the current timer (if there is one).\n manageRequestIntervalTimer(false);\n } else {\n // Start the timer.\n Log.i(AdManager.LOG, \"Requesting fresh ads every \" + requestInterval + \" seconds.\");\n manageRequestIntervalTimer(true);\n }\n }", "public void setDuration(Long duration)\r\n {\r\n this.duration = duration;\r\n }", "public void setDelay(long d){delay = d;}", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void SetDuration(int duration)\n {\n TimerMax = duration;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "void setDuration(java.lang.String duration);", "@RequestMapping(\"/circuitbreaker/timeout/{duration}\")\n public ResponseEntity<String> setTimeout(@PathVariable int duration){\n ConfigurationManager.getConfigInstance().setProperty(\"hystrix.command.resources.execution.isolation.thread.timeoutInMilliseconds\", duration);\n return new ResponseEntity<String>(\"Duration in msec: \" + duration, HttpStatus.OK);\n }", "public void setDuration(int duration) {\n mDuration = duration;\n }", "protected void setDuraction(int seconds) {\n duration = seconds * 1000L;\n }", "public void setDuration(int duration)\r\n\t{\r\n\t\tif (duration < 0) { throw new IllegalArgumentException(\"duration muss groesser als 0 sein\"); }\r\n\t\tthis.duration = duration;\r\n\t}", "public LimitDuration(long maxDuration) {\n _maxDuration = maxDuration;\n }", "void setMaxCooldown(int maxCooldown);", "public void setDuration(int newDuration) {\n this.duration = newDuration;\n }", "public void setDuration(long duration) {\n this.duration = duration;\n }", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDuration(String duration) {\n this.duration = duration;\n }", "public void setDuration(Number duration) {\n this.duration = duration;\n }", "@Override\n\tpublic int withIntervalInSeconds() {\n\t\treturn 10;\n\t}", "public V1Toleration withTolerationSeconds(Long tolerationSeconds) {\n this.tolerationSeconds = tolerationSeconds;\n return this;\n }", "public void setDuration(int duration) {\n if (this.duration != duration) {\n this.duration = duration;\n }\n }", "Builder addTimeRequired(Duration value);", "public Long tolerationSeconds() {\n return this.tolerationSeconds;\n }", "@DefaultValue(\"600\")\n long getPodTerminationGracePeriodSeconds();", "public void setMaxTimeSeconds(float aTime) { setMaxTime(Math.round(aTime*1000)); }", "long getInitialDelayInSeconds();", "protected int minTimeout() { return 500; }", "public void setTimeLimit(long value) {\n\t\ttimeLimit = value;\n\t}", "void setRemainingCooldown(int remainingCooldown);", "public Builder setDuration(int value) {\n bitField0_ |= 0x00000008;\n duration_ = value;\n onChanged();\n return this;\n }", "private boolean durationValidation(int duration){\n return duration < 300 && duration >10;\n }", "@Autowired\n\tpublic void setDuration(@Value(\"${repair.duration}\") Duration duration) {\n\t\tthis.duration = DurationConverter.oneOrMore(duration);\n\t}", "public Integer getTolerableDelay() {\n\t\treturn tolerableDelay;\n\t}", "TimeResource maxDuration();", "public void setIncTimeout(int seconds);", "public void setDelay(long delay) {\n this.delay = delay;\n }", "public void setDelayedTimeout(int seconds);", "public void setTimeOut(int value) {\n this.timeOut = value;\n }", "public void setDuration(Duration duration)\r\n {\r\n m_duration = duration;\r\n }", "@Test\n public void addRecord_absorbs_effective_duration_TR() {\n aggregatedDay.addRecord(aRecordWithinTheAggregatedDay(today, 160, Rounding.Strategy.SIXTY_MINUTES_UP));\n\n // then: duration is increased by *effective* duration\n assertEquals(3, aggregatedDay.getDuration().getStandardHours());\n }", "void setVoteFinalizeDelaySeconds(long voteFinalizeDelaySeconds);", "private static float getDefaultDuration(ResourceLocation effectId) {\n return new ResourceLocation(\"night_vision\").equals(effectId) ? 15.9f : 1.9f;\n }", "@Override\n public void onDurationUs(long durationUs) {\n sleep();\n isDurationSet = true;\n }", "public void setDuration(float duration) {\n\t\tthis.duration = duration;\n\t}", "protected int maxTimeout() { return 15*1000*1000; }", "@Test\n public void testTripCircuitOnTimeoutsAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public Builder setResponseTimeSec(long value) {\n bitField0_ |= 0x00000800;\n responseTimeSec_ = value;\n onChanged();\n return this;\n }", "@Property(displayName = \"Timeout\", description = \"Sets the amount of time that must pass in milliseconds\"\n\t\t\t+ \" before the reader stops looking for tags. If this value is too small, the reader will not \"\n\t\t\t+ \"read from all of its antennas. Because of this, it is recommended that the value be at least 500ms. \"\n\t\t\t+ \"\", writable = true, type = PropertyType.PT_INTEGER, minValue = \"\"\n\t\t\t+ \"500\", maxValue = \"16535\", defaultValue = \"1000\", category=\"Timeout\")\n\tpublic Integer getTimeout() {\n\t\treturn timeout;\n\t}", "void setDuration(org.apache.xmlbeans.GDuration duration);", "public void setSleepTime(final long l) {\n if (l <= 0) {\n throw new IllegalArgumentException(\"Sleep Time must be a non-zero positive number\");\n }\n sleepTime = l;\n }", "public void setDuration(Duration param) {\n this.localDuration = param;\n }", "void xsetRecurrenceDuration(org.apache.xmlbeans.XmlInt recurrenceDuration);", "private void setSessionDuration(int sessionDuration) {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());\n SharedPreferences.Editor editor = sp.edit();\n editor.putInt(Constants.SESSION_QUEST_DURATION, sessionDuration);\n editor.apply();\n }", "public void setTimeLimit(java.util.Collection timeLimit);", "public SleepWork(long durationMillis, String category, String id) {\n super(id);\n this.durationMillis = durationMillis;\n this.category = category;\n partitionKey = String.valueOf(count.incrementAndGet());\n setProgress(Progress.PROGRESS_0_PC);\n }", "public void setNortpTimeout(int seconds);", "public void setMaxDelayTime(Long MaxDelayTime) {\n this.MaxDelayTime = MaxDelayTime;\n }", "private Sleep(Duration duration) {\n this.duration = duration;\n }", "public Builder setResponseTimeNsec(int value) {\n bitField0_ |= 0x00001000;\n responseTimeNsec_ = value;\n onChanged();\n return this;\n }", "@NonNull\n public Builder setNattKeepAliveDelaySeconds(\n @IntRange(\n from = IKE_NATT_KEEPALIVE_DELAY_SEC_MIN,\n to = IKE_NATT_KEEPALIVE_DELAY_SEC_MAX)\n int nattKeepaliveDelaySeconds) {\n if (nattKeepaliveDelaySeconds < IKE_NATT_KEEPALIVE_DELAY_SEC_MIN\n || nattKeepaliveDelaySeconds > IKE_NATT_KEEPALIVE_DELAY_SEC_MAX) {\n throw new IllegalArgumentException(\"Invalid NATT keepalive delay value\");\n }\n mNattKeepaliveDelaySec = nattKeepaliveDelaySeconds;\n return this;\n }", "abstract protected long getDefaultRelTimeoutMillis();", "public void setDelay(int delay)\n {\n this.delay = delay;\n }", "private void setTimedOut() {\n\t\tthis.timedOut.set(true);\n\t}", "void setPaymentDelay(ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay paymentDelay);", "@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();", "public void setBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.set(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public void setSleepInterval(int len) {\n\t\tsleepSpinner.setValue(len);\n\t}", "public Builder setUpdateIntervalInSec(long value) {\n \n updateIntervalInSec_ = value;\n onChanged();\n return this;\n }", "@Override\r\n \t\t\tpublic void setSessionDuration(long duration) {\n \t\t\t\t\r\n \t\t\t}", "public void setBoostExpiration(){\r\n\t\tboostExpiration = GameController.getTimer() + 1000000000l * length;\r\n\t}", "public void SetTimeRemaining(int value) {\n Timer = value;\n if (Timer > TimerMax)\n {\n Timer = TimerMax;\n }\n }", "@Test(groups = { \"simple\" }, timeOut = TIMEOUT)\n public void maxValueExceedingDefinedLimitStillWorksWithoutException() throws Exception {\n\n this.beforeTest(CosmosMetricCategory.DEFAULT);\n\n try {\n Tag dummyOperationTag = Tag.of(TagName.Operation.toString(), \"TestDummy\");\n Timer latencyMeter = Timer\n .builder(\"cosmos.client.op.latency\")\n .description(\"Operation latency\")\n .maximumExpectedValue(Duration.ofSeconds(300))\n .publishPercentiles(0.95, 0.99)\n .publishPercentileHistogram(true)\n .tags(Collections.singleton(dummyOperationTag))\n .register(this.meterRegistry);\n latencyMeter.record(Duration.ofSeconds(600));\n\n Meter requestLatencyMeter = this.assertMetrics(\n \"cosmos.client.op.latency\",\n true,\n dummyOperationTag);\n\n List<Measurement> measurements = new ArrayList<>();\n requestLatencyMeter.measure().forEach(measurements::add);\n\n assertThat(measurements.size()).isEqualTo(3);\n\n assertThat(measurements.get(0).getStatistic().getTagValueRepresentation()).isEqualTo(\"count\");\n assertThat(measurements.get(0).getValue()).isEqualTo(1);\n assertThat(measurements.get(1).getStatistic().getTagValueRepresentation()).isEqualTo(\"total\");\n assertThat(measurements.get(1).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n assertThat(measurements.get(2).getStatistic().getTagValueRepresentation()).isEqualTo(\"max\");\n assertThat(measurements.get(2).getValue()).isEqualTo(600 * 1000); // transform into milliseconds\n } finally {\n this.afterTest();\n }\n }", "public void setDelay(int delay) {\n this.delay = delay;\n }", "public void removeBeatsPerMinute(java.lang.Integer value) {\r\n\t\tBase.remove(this.model, this.getResource(), BEATSPERMINUTE, value);\r\n\t}", "public void setDuration(int duration) {\r\n this.duration = duration;\r\n if (connections.get(lightIndex).getTrafficLight().getSignal()\r\n == TrafficSignal.YELLOW) {\r\n connections.get(lightIndex).getTrafficLight().setSignal\r\n (TrafficSignal.GREEN);\r\n }\r\n currentGreenTime = 0;\r\n currentYellowTime = 0;\r\n }", "void xsetDuration(org.apache.xmlbeans.XmlInt duration);", "public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }", "String getMaximumRedeliveryDelay();", "public void setCatId(long value) {\n this.catId = value;\n }", "public synchronized void setRemovalTimeout(long removalTimeout) {\n this.removalTimeout = removalTimeout;\n }", "public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }", "@Test\n public void testMaybeScheduleStartAlarmLocked_SmallRollingQuota_UpdatedAllowedTime() {\n setDeviceConfigLong(QcConstants.KEY_ALLOWED_TIME_PER_PERIOD_WORKING_MS,\n mQcConstants.ALLOWED_TIME_PER_PERIOD_WORKING_MS / 2);\n\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_AllowedTimeCheck();\n mQuotaController.getTimingSessions(SOURCE_USER_ID, SOURCE_PACKAGE).clear();\n runTestMaybeScheduleStartAlarmLocked_SmallRollingQuota_MaxTimeCheck();\n }", "public Builder setQuickSwapCooldownDurationMs(long value) {\n \n quickSwapCooldownDurationMs_ = value;\n onChanged();\n return this;\n }" ]
[ "0.55021256", "0.53253984", "0.5288518", "0.5251609", "0.52179974", "0.51750344", "0.5171708", "0.51618314", "0.51586765", "0.5130629", "0.5124162", "0.51033723", "0.50651366", "0.5031526", "0.500176", "0.500176", "0.49551558", "0.4884279", "0.4874525", "0.48644763", "0.48571527", "0.48571527", "0.48559636", "0.48516253", "0.48352277", "0.4826903", "0.4822817", "0.4809154", "0.4809088", "0.4802773", "0.4779973", "0.47786355", "0.4745236", "0.4745236", "0.4744863", "0.4742528", "0.47336504", "0.47185507", "0.469884", "0.46957386", "0.46777046", "0.4674752", "0.46721464", "0.4659946", "0.4658843", "0.46470803", "0.46449196", "0.4629142", "0.46270192", "0.46005562", "0.45977873", "0.45922485", "0.45909986", "0.45898053", "0.4587385", "0.4578963", "0.4554415", "0.4552125", "0.45408243", "0.4534431", "0.45335406", "0.45253083", "0.4513651", "0.45018148", "0.44867042", "0.44819582", "0.44811684", "0.4466356", "0.4461592", "0.44588715", "0.44567534", "0.44564155", "0.44537285", "0.44463557", "0.44174924", "0.441557", "0.43918854", "0.43868664", "0.43743595", "0.43675074", "0.43617862", "0.4355425", "0.43486214", "0.43483716", "0.43447533", "0.4340935", "0.43307298", "0.43251583", "0.43158478", "0.4315842", "0.43109235", "0.4305569", "0.4305057", "0.42963633", "0.42915866", "0.4285055", "0.42847705", "0.42839208", "0.42833734", "0.4283068" ]
0.5998225
0
Get the threshold of maximum number of pending requests permitted to be held for a specified RCAT. A value of 0 indicates that the request should be transmitted immediately.
public Long getThresh() { return thresh; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getMaxCalls();", "Integer backlogCapacity();", "public Double getLargestReceiveSuccessRequestThroughput()\r\n {\r\n return largestReceiveSuccessRequestThroughput;\r\n }", "private int getMaxReconsumeTimes() {\n if (this.defaultMQPushConsumer.getMaxReconsumeTimes() == -1) {\n return Integer.MAX_VALUE;\n } else {\n return this.defaultMQPushConsumer.getMaxReconsumeTimes();\n }\n }", "int getMaxConcurrent();", "@Nonnegative\n @CheckReturnValue\n public abstract int getRemainingRequests();", "public final String getMaximumOutstandingRequests() {\n return properties.get(MAXIMUM_OUTSTANDING_REQUESTS_PROPERTY);\n }", "private int getMaxConfiguredReplicaCount() {\n if (maxConfiguredReplicaCount > 0) {\n return maxConfiguredReplicaCount;\n } else {\n ClientMessage request = PNCounterGetConfiguredReplicaCountCodec.encodeRequest(name);\n ClientMessage response = invoke(request);\n maxConfiguredReplicaCount = PNCounterGetConfiguredReplicaCountCodec.decodeResponse(response);\n }\n return maxConfiguredReplicaCount;\n }", "private double getMaxThreshold() {\n return maxThreshold;\n }", "String getMaximumRedeliveries();", "public int getMaxAttempts(AsyncOperation op);", "public int getLimit (CallZone zone){//method of returning how many minutes a card can call based on it's balance\r\n double maxMin = balance/costPerMin(zone);//equation of determining how many minutes remain per zone\r\n \r\n return (int)maxMin;\r\n }", "public int getMaxRetries() {\n\t return maxRetries.get();\n\t}", "public double maxWait()\r\n {\r\n //find the max value in an arraylist\r\n double maxWait = servedCustomers.get(0).getwaitTime();\r\n for(int i = 1; i < servedCustomers.size(); i++){\r\n if(servedCustomers.get(i).getwaitTime()>maxWait){\r\n maxWait = servedCustomers.get(i).getwaitTime();\r\n }\r\n }\r\n return maxWait;\r\n }", "public int getMaxRequestUrlsReported() {\n return maxRequestUrlsReported;\n }", "@Override\n public int highestRequest() {\n int c = Long.numberOfLeadingZeros( get() );\n if ( c == 64 ) {\n c = -1;\n } else {\n c = 64 - 1 - c;\n }\n return c;\n }", "pb4server.MaxPrisonBuffAskReq getMaxPrisonBuffAskReq();", "protected int getMaxRetries()\n {\n return heartbeat.getMaxRetries();\n }", "public int getMaxConns() {\n return maxConns;\n }", "private boolean requestLimitReached() {\n\t\treturn (requestCount >= maximumRequests);\n\t}", "public int getMaximumCapacity() { // get the max capacity\n\t\treturn maximumCapacity;\n\t}", "int getMaxUnavailable(ClusterSpec clusterSpec);", "public Integer maxMessages();", "public final int getAllocateLimit() {\n return allocateLimit;\n }", "public void requestEviction(int cMaximum);", "private int calcMaxSize(int capacity) {\n // Clip the upper bound so that there will always be at least one available slot.\n int upperBound = capacity - 1;\n return Math.min(upperBound, (int) (capacity * loadFactor));\n }", "public int getMaxWait() {\n\t\treturn this.maxWait;\n\t}", "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "public int get_max_accept() throws Exception;", "public int getMaxRetries() {\n return maxRetries;\n }", "public Double getLargestSendRequestThroughput()\r\n {\r\n return largestSendRequestThroughput;\r\n }", "double getMaxTfCapacity();", "public static int getMaxThreadCount(){\n return Integer.parseInt(properties.getProperty(\"maxThreadCount\"));\n }", "public int getThreshold()\n {\n return threshold;\n }", "public int getCapacity() {\n\t\treturn this.maxCapacity;\n\t}", "public Optional<Integer> maxRetries() {\n return Codegen.integerProp(\"maxRetries\").config(config).env(\"VAULT_MAX_RETRIES\").def(2).get();\n }", "String getMaximumRedeliveryDelay();", "public Optional<Integer> maxRetriesCcc() {\n return Codegen.integerProp(\"maxRetriesCcc\").config(config).get();\n }", "public int getMaxCount() {\n return maxCount_;\n }", "public Integer getMaxRetryAttempt() {\n\t\treturn maxRetryAttempt;\n\t}", "public Integer getCriticalSlackLimit()\r\n {\r\n return (m_criticalSlackLimit);\r\n }", "public Integer getMaxLoginTrialCnt() {\r\n return maxLoginTrialCnt;\r\n }", "public int getMaxAttemptCount() {\n return maxAttemptCount;\n }", "public org.apache.axis.types.UnsignedInt getMaxconn() {\n return maxconn;\n }", "int getMaxCount();", "int getMaxCount();", "public static long getApiMaxRequestBytes() {\n return 10L * 1000L * 1000L; // 10 megabytes (https://en.wikipedia.org/wiki/Megabyte)\n }", "public int getMaxConnections() {\n return maxConnections;\n }", "public int getUpperThreshold() {\r\n\t\tint upperThreshold;\r\n\t\tupperThreshold=this.upperThreshold;\r\n\t\treturn upperThreshold;\r\n\t}", "private static int getApproximateMaxSize(int maxSizeFromConfig) {\n // because not to exceed the max size much we start eviction early.\n // so decrease the max size with ratio .95 below\n return maxSizeFromConfig * EVICTION_START_THRESHOLD_PERCENTAGE / ONE_HUNDRED_PERCENT;\n }", "int getMaximumDelay();", "public int getMaxCount() {\n return maxCount_;\n }", "@Override\n public int lowestRequest() {\n int c = Long.numberOfTrailingZeros( get() );\n if ( c == 64 ) {\n c = -1;\n }\n return c;\n }", "public Integer getMaxQuota() {\n return (Integer) getAttributeInternal(MAXQUOTA);\n }", "public int capturedLimit() {\n return this.limit.get();\n }", "public static int getMaxSessionCount() {\n\t\treturn (maxSessionCount);\n\t}", "int getRequestsCount();", "int getRequestsCount();", "public Integer failureThreshold() {\n return this.failureThreshold;\n }", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "int getMaxCooldown();", "int getAbsoluteMaximumDelay();", "public Long getMaxConcurrentConnection() {\n return this.MaxConcurrentConnection;\n }", "public int getMaxConnections()\n {\n return _maxConnections;\n }", "long getRequestsCount();", "public int getRequestRetryCount() {\n \t\treturn 1;\n \t}", "public static int getPendingRequests() {\n\t\treturn writeQueue.size() + requestsBeingSending.intValue();\n\t}", "public int getCapacity() {\n\t\tfinal String key = ConfigNames.CHILD_THREADS.toString();\n\n\t\tif (getJson().isNull(key)) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn getJson().getInt(key);\n\t}", "public int getRemainingCapacity() { // get the remaining capacity\n\t\treturn maximumCapacity - cargoCapacity;\n\t}", "public Double getLargestReceiveSuccessResponseThroughput()\r\n {\r\n return largestReceiveSuccessResponseThroughput;\r\n }", "public long getMaxTransactions() {\n\t\treturn (maxTrans);\n\t}", "public int getMaxActive();", "protected int retryLimit() {\n return DEFAULT_RETRIES;\n }", "public Integer getThreadPoolBlockingQueueSize() {\n String tc = getConfig().getProperty(THREAD_POOL_BLOCKING_QUEUE_SIZE).getValue();\n Integer ret = new Integer(DEFAULT_THREAD_POOL_BLOCKING_QUEUE_SIZE);\n if (tc != null){\n try {\n ret = Integer.valueOf(tc);\n } catch (Exception ex){\n ret = new Integer(DEFAULT_THREAD_POOL_BLOCKING_QUEUE_SIZE);\n }\n }\n return ret;\n }", "public int getThreshold() {\n return threshold; \n }", "com.google.protobuf.Duration getMaximumBackoff();", "public void setMaxConns(int value) {\n this.maxConns = value;\n }", "default int getMaximumCount(int slot) {\n\t\treturn 64;\n\t}", "@Override\n\tpublic int getMaxThreads() {\n\t\treturn 10;\n\t}", "int getReqCount();", "public int getCapacity() {\n switch (getID()) {\n case 5509:\n return 3;\n case 5510:\n case 5511:\n return 6;\n case 5512:\n case 5513:\n return 9;\n case 5514:\n case 5515:\n default:\n return 12;\n }\n }", "private int calculateResizeThreshold() {\n\t\treturn (buffer.length >> 2) * 3;\n\t}", "public static double calculateLimit() {\n return 500;\n }", "public int getMaxIdleConns() {\n return maxIdleConns;\n }", "public int getMaxAttack() {\n\t\treturn maxAttack;\n\t}", "int getRequestCount();", "static public int getMaxAsyncPollingRetries() {\n return maxAsyncPollingRetries;\n }", "long throttleByteCount() {\n return parseLong(settings.get(THROTTLE_BYTE_COUNT), Long.MAX_VALUE);\n }", "public int getMaxUploads() {\n return 0;\r\n }", "public int getMaxLagMaxRetries() {\n\t\treturn maxLagMaxRetries;\n\t}", "@java.lang.Override\n public int getMaximumCapacity() {\n return maximumCapacity_;\n }", "public long limit();", "public final int getMaxLinkCount() {\n\t\tint r = 0;\n\t\tlockMe(this);\n\t\tr = maxLinkCount;\n\t\tunlockMe(this);\n\t\treturn r;\n\t}", "public int currentConcurrencyLimit(int max) {\n\t\tint retVal = tool_concurrency;\n\n\t\tif (retVal <= 0) {\n\t\t\tretVal = Runtime.getRuntime().availableProcessors(); //ForkJoinPool.getCommonPoolParallelism();\n\t\t}\n\t\tif (max <= 0) {\n\t\t\treturn retVal;\n\t\t} else {\n\t\t\treturn retVal > max ? max : retVal;\n\t\t}\n\t}", "public int getMaxInactiveInterval();", "@java.lang.Override\n public int getMaximumCapacity() {\n return maximumCapacity_;\n }", "public int getMaxPoolSize(Env env) {\n return client.getMaxPoolSize();\n }", "public long getMaxRIT() {\n return localMaxRIT;\n }", "int getEnqueuedBlockRequestsNumber() {\n int count = 0;\n for (StdPeerMessage pm : sendQueue) {\n if (pm.type == StdPeerMessage.REQUEST) {\n count++;\n }\n }\n return count;\n }", "int getPeakServerSocketCount();", "public long getMaximumRetryWaitTime() {\r\n return configuration.getMaximumRetryWaitTime();\r\n }" ]
[ "0.61607194", "0.6148196", "0.60834277", "0.59926647", "0.5964878", "0.5912669", "0.590471", "0.590276", "0.5895033", "0.58672696", "0.5803713", "0.5793208", "0.57905847", "0.5790331", "0.57681555", "0.5753824", "0.5733468", "0.57185715", "0.57073337", "0.56657445", "0.56653744", "0.5664324", "0.5658861", "0.5656969", "0.565012", "0.56474483", "0.5646327", "0.5645963", "0.5632084", "0.5619977", "0.5610642", "0.5607265", "0.559819", "0.5586725", "0.5560731", "0.55584407", "0.5552633", "0.5544813", "0.55398184", "0.55159754", "0.55066884", "0.55063736", "0.5497682", "0.5497066", "0.5483831", "0.5483831", "0.54784864", "0.54736453", "0.5469376", "0.5466123", "0.54624796", "0.5458756", "0.5439424", "0.54382247", "0.5435176", "0.5433836", "0.5410694", "0.5410694", "0.5402978", "0.5400519", "0.5395675", "0.53898865", "0.5386235", "0.5385606", "0.5373361", "0.53688854", "0.53645223", "0.5360426", "0.5359492", "0.53589886", "0.535428", "0.5345236", "0.5323509", "0.5322606", "0.53125936", "0.53073597", "0.5297491", "0.52934843", "0.52932894", "0.528557", "0.5278238", "0.5275974", "0.527427", "0.52687144", "0.52664346", "0.5263274", "0.52596277", "0.5258153", "0.5257949", "0.5257011", "0.52505106", "0.524457", "0.52354634", "0.52354264", "0.5229676", "0.52251726", "0.5222779", "0.5214016", "0.521254", "0.5205444", "0.5204872" ]
0.0
-1
Set the threshold of maximum number of pending requests permitted to be held for a specified RCAT. A value of 0 indicates that the request should be transmitted immediately.
public void setThresh(Long thresh) { this.thresh = thresh; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "public void setMaxConns(int value) {\n this.maxConns = value;\n }", "public void requestEviction(int cMaximum);", "public Builder setMaximumCapacity(int value) {\n \n maximumCapacity_ = value;\n onChanged();\n return this;\n }", "public void setMaxConcurrentAccessCount(String newValue);", "public void setMaxRequestUrlsReported(int value) {\n this.maxRequestUrlsReported = value;\n }", "public void setThreshold(int aThreshold) {\n if(0 <= threshold && threshold <= 100) {\n threshold = aThreshold;\n } else {\n throw new IllegalArgumentException(\"Threshold must be in the interval <1..100> inclusive. Actual Value: \" + aThreshold);\n } \n }", "@Override\n\tpublic StructureTownHallConfigRecord setResourceCapacity(Integer value) {\n\t\tsetValue(10, value);\n\t\treturn this;\n\t}", "public void setMaxEvictionQueueEntries(int val) {\n this.mMaxEvictionQueueEntries = val;\n }", "PayloadSizeGate(long threshold) {\n this.threshold = threshold;\n }", "private void setConfigNumMaxBgJobs(int value) {\n this.bitField0_ |= 2;\n this.configNumMaxBgJobs_ = value;\n }", "void setLimit(int limit);", "public void setMaxIdleConns(int value) {\n this.maxIdleConns = value;\n }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void setCapacity(int value) {\n this.capacity = value;\n }", "public void setMaxSize(int c) {\n maxSize = c;\n }", "public void setMaxRequestParameters(int maxRequestParameters) {\n if (maxRequestParameters < 0) {\n this.maxRequestParameters = -1;\n } else {\n this.maxRequestParameters = maxRequestParameters;\n }\n }", "public static void setThreshold(int threshold) {\n EvalutionUtil.ifFalseCrash(threshold>0, \n \"The threshold for the relevant documents in the ranking should be bigger than 0\");\n thres = threshold;\n }", "public void setThreshold(int t) {\r\n\t\t\tthis.t = t;\r\n\t\t}", "private void setConfigNumMaxTotalJobs(int value) {\n this.bitField0_ |= 1;\n this.configNumMaxTotalJobs_ = value;\n }", "void setMaxCooldown(int maxCooldown);", "public void setThreshold(int inputThreshold) {\r\n\t\tthis.threshold = inputThreshold;\r\n\t}", "public Builder setMaxCount(int value) {\n bitField0_ |= 0x00000002;\n maxCount_ = value;\n onChanged();\n return this;\n }", "public void setMaximumCrowedLevel(double c) {\n this.CROWED_LEVEL_THRESHOLD = c;\n }", "public Builder setFailureRefreshThreshold(int value) {\n \n failureRefreshThreshold_ = value;\n onChanged();\n return this;\n }", "public void setFrameLimit(int value) {\n\t\tframeLimit = value;\n\t}", "public native void setMaximumRTO (long RTO);", "public void setMaxRetryAttempt(final Integer maxRetryAttempt) {\n\t\tthis.maxRetryAttempt = maxRetryAttempt;\n\t}", "public void setThreshold(double t)\n {\n this.threshold = t;\n }", "public void setMaxCalls(int max);", "public void setMaxQuota(Integer value) {\n setAttributeInternal(MAXQUOTA, value);\n }", "static public void setMaxAsyncPollingRetries(int maxRetries) {\n maxAsyncPollingRetries = maxRetries;\n }", "public void setLargestReceiveSuccessRequestThroughput(Double largestReceiveSuccessRequestThroughput)\r\n {\r\n this.largestReceiveSuccessRequestThroughput = largestReceiveSuccessRequestThroughput;\r\n }", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "public final void setPendingCount(int paramInt)\n/* */ {\n/* 517 */ this.pending = paramInt;\n/* */ }", "public static void SetMaxPassengers(double inLimit) \r\n {\r\n if (inLimit > 0) \r\n {\r\n maxPassengers = inLimit;\r\n } \r\n else \r\n {\r\n maxPassengers = 0;\r\n }\r\n }", "public void setMaxActive(int maxActive);", "private boolean requestLimitReached() {\n\t\treturn (requestCount >= maximumRequests);\n\t}", "public void setMaxConcurrentConnection(Long MaxConcurrentConnection) {\n this.MaxConcurrentConnection = MaxConcurrentConnection;\n }", "public void setThreshold(int threshold) {\n/* 357 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "@Test\n public void testCircuitDoesNotTripOnFailuresBelowThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markSuccess(40);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n\n // this should remain open as the failure threshold is below the percentage limit\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void setMaxconn(org.apache.axis.types.UnsignedInt maxconn) {\n this.maxconn = maxconn;\n }", "void setMaximumCacheSize(int maximumCacheSize);", "public void setMaxConnections(int maxConnections)\n {\n _maxConnections = maxConnections;\n }", "public void setCapacity(int newCapacity) {\n\n\t\tif (newCapacity < 1) {\n\t\t\tsendWarning(\n\t\t\t\t\t\"The capacity of a transporter should be changed to zero or \"\n\t\t\t\t\t\t\t+ \"a negative value. The capacity will remain unchanged!\",\n\t\t\t\t\t\"Transporter : \" + getName()\n\t\t\t\t\t\t\t+ \" Method: void setCapacity(int newCapacity)\",\n\t\t\t\t\t\"A capacity which is zero or negative does not make sense.\",\n\t\t\t\t\t\"Make sure to provide a valid positive capacity \"\n\t\t\t\t\t\t\t+ \"when changing this attribute.\");\n\n\t\t\treturn; // forget that rubbish\n\t\t}\n\n\t\tthis.capacity = newCapacity;\n\t}", "void setMaxReactionRounds( @Nonnegative final int maxReactionRounds )\n {\n if ( Arez.shouldCheckInvariants() )\n {\n invariant( () -> maxReactionRounds >= 0,\n () -> \"Arez-0098: Attempting to set maxReactionRounds to negative \" +\n \"value \" + maxReactionRounds + \".\" );\n }\n _maxReactionRounds = maxReactionRounds;\n }", "public void setMaxThreads(int maxThreads)\r\n {\r\n this.maxThreads = maxThreads;\r\n }", "public void setMaxCacheEntries(int val) {\n this.mMaxCacheEntries = val;\n }", "public void setHighWaterThreadCount(int threads)\n { _threadPool.setMaxSize(threads);\n }", "public void setMaxRoundsPerBattle(int value) {\n this.maxRoundsPerBattle = value;\n }", "protected short maxRetries() { return 15; }", "@Override\r\n\tpublic void setThresholds(int itemthreshold, int timethreshold) {\n\t\t\r\n\t}", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setMaxLoginTrialCnt(Integer maxLoginTrialCnt) {\r\n this.maxLoginTrialCnt = maxLoginTrialCnt;\r\n }", "Integer backlogCapacity();", "private void setConfigNumMinBgJobs(int value) {\n this.bitField0_ |= 4;\n this.configNumMinBgJobs_ = value;\n }", "public void xsetLimit(org.apache.xmlbeans.XmlNonNegativeInteger limit)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlNonNegativeInteger target = null;\r\n target = (org.apache.xmlbeans.XmlNonNegativeInteger)get_store().find_element_user(LIMIT$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlNonNegativeInteger)get_store().add_element_user(LIMIT$6);\r\n }\r\n target.set(limit);\r\n }\r\n }", "public void setMaxRetries(int maxRetries) {\n\t if (maxRetries > 0) {\n\t this.maxRetries.set(maxRetries);\n\t } else {\n\t this.maxRetries.set(0);\n\t }\n\t \n\t resetChain();\n\t}", "public void setCapacity(int capacity)\n {\n Validate.isTrue(capacity > 0, \"Capacity must be > 0\");\n capacity_ = capacity; \n }", "public void setFreePermits(Integer value) {\n setAttributeInternal(FREEPERMITS, value);\n }", "void setMaxValue();", "public Builder setAvailableCapacity(int value) {\n \n availableCapacity_ = value;\n onChanged();\n return this;\n }", "void setThreshold(float value);", "@Test\n public void testTripCircuitOnTimeoutsAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void setMaxRIT(long param) {\n if (param == java.lang.Long.MIN_VALUE) {\n localMaxRITTracker = false;\n } else {\n localMaxRITTracker = true;\n }\n this.localMaxRIT = param;\n }", "public synchronized void setTbApWtEntryTotalLimit(String value)\n\t\t\t\t throws AgentException{\n\t\t// Fill up with necessary processing\n\n\t\tif(value == null){\n\t\t\tthrow new AgentException(\"\", CommonUtils.WRONGVALUE);\n\t\t}\n\t\tif(!(((value.length()>=0)&&(value.length()<=255)))){\n\t\t\tthrow new AgentException(\"\", CommonUtils.WRONGVALUE);\n\t\t}\n\t\ttbApWtEntryTotalLimit = value;\n\t}", "private void setLimit(com.google.protobuf.Int32Value value) {\n if (value == null) {\n throw new NullPointerException();\n }\n limit_ = value;\n \n }", "public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n }", "public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n }", "public void setTimeLimit(long value) {\n\t\ttimeLimit = value;\n\t}", "void setTransactionLogMaxSize(int maxSize) {\n\t\ttransactionLog.setMaxSize(maxSize);\n\t\t\n\t\tif (maxSize == 0) {\n\t\t\ttransactionMonitor = null;\n\t\t} else {\n\t\t\ttransactionMonitor = new TransactionMonitor(transactionLog);\n\t\t}\n\t}", "public void setCompletionThreshold(java.lang.String completionThreshold);", "public void setUpperThreshold(int setUpperThreshold) {\r\n\t\tthis.upperThreshold = setUpperThreshold;\t\t\r\n\t}", "public void setMaxBps(int maxBps) {\n\t\tlock.lock();\n\t\ttry {\n\t\t\tthis.maxBps = maxBps;\n\t\t\tbytesCredit = (int) (maxBps * (float) (MAX_CREDIT_TIME / 1000));\n\t\t\tlastCreditTime = currentTimeMillis();\n\t\t} finally {\n\t\t\tlock.unlock();\n\t\t}\n\t}", "public void setLimit(int limit) {\n\tLimit = limit;\n }", "private void setLimit(\n com.google.protobuf.Int32Value.Builder builderForValue) {\n limit_ = builderForValue.build();\n \n }", "public void setMaxattempts(int maxattempts) {\n this.maxattempts = maxattempts;\n }", "public void setMiterLimit(float limit);", "void requestRateLimited();", "public void setLowWaterThreadCount(int threads)\n { _threadPool.setMinAvailable(threads);\n }", "protected int retryLimit() {\n return DEFAULT_RETRIES;\n }", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "public void setMaxBufferSize(int value) {\n this.maxBufferSize = value;\n }", "public void setThreshold(float threshold){\n this.threshold = threshold;\n }", "public ClientBuilder maxConnection(int maxConnection) {\n this.maxConnection = Predicates.bigThanZero(maxConnection);\n return this;\n }", "public void setMaximumCapacity(int maximumCapacity) { // set the max\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// capacity\n\t\tthis.maximumCapacity = maximumCapacity;\n\t}", "@Override\n\tpublic int getMaxThreads() {\n\t\treturn 10;\n\t}", "public void setSupplyReadinessRate(int value) {\n this.supplyReadinessRate = value;\n }", "private int getMaxReconsumeTimes() {\n if (this.defaultMQPushConsumer.getMaxReconsumeTimes() == -1) {\n return Integer.MAX_VALUE;\n } else {\n return this.defaultMQPushConsumer.getMaxReconsumeTimes();\n }\n }", "@Override\r\n\t\tpublic void setLimitBreachMarkOnAction(int i) {\n\t\t\t\r\n\t\t}", "protected int maxTimeout() { return 15*1000*1000; }", "private void doChargeSet(int newSetting)\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n CHARGE_NODE_HTML_DATA,\r\n CONTROL_URL,\r\n SN_HOST,\r\n makeChargeControl(newSetting),\r\n cookieData,\r\n false,\r\n token,\r\n secret ) ); \r\n }", "public void SetMaxVal(int max_val);", "public void setMaxLoadFactor(double loadFactor)\n {\n MAX_LOAD_FACTOR = loadFactor;\n }", "public void setRequestInterval(int requestInterval) {\n final int minSecs = 15;\n final int maxSecs = 600; // 10 minutes\n\n if (requestInterval <= 0) {\n requestInterval = 0;\n } else if (requestInterval < minSecs) {\n // Too often. Cannot request ads more frequently than minSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be >= \" + minSecs);\n } else if (requestInterval > maxSecs) {\n // Too infrequent. If setting this value there is no reason to have ads update more than maxSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be <= \" + maxSecs);\n }\n\n int requestIntervalMillisecs = requestInterval * 1000;\n this.requestInterval = requestIntervalMillisecs;\n\n // Set the timer to handle requesting fresh ads.\n if (requestInterval == 0) {\n // Stop the current timer (if there is one).\n manageRequestIntervalTimer(false);\n } else {\n // Start the timer.\n Log.i(AdManager.LOG, \"Requesting fresh ads every \" + requestInterval + \" seconds.\");\n manageRequestIntervalTimer(true);\n }\n }", "public abstract void setSplayLimit(int limit);", "public void setMaxIterations(int number) {\r\n if (number < CurrentIteration) {\r\n throw new Error(\"Cannot be lower than the current iteration.\");\r\n }\r\n MaxIteration = number;\r\n Candidates.ensureCapacity(MaxIteration);\r\n }", "public void setCapacity( Resource.Type type, int capacity );", "void setMaximum(int max);", "public void setMaxValue(int maxValue) {\n this.maxValue = maxValue;\n }", "@Test\n public void testTripCircuitOnFailuresAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }" ]
[ "0.64486724", "0.5918475", "0.59134525", "0.58123076", "0.5791994", "0.5781036", "0.57141596", "0.5639214", "0.56083083", "0.56019884", "0.55754054", "0.5563907", "0.5548095", "0.5543602", "0.5482801", "0.5481647", "0.5471165", "0.5461871", "0.5449814", "0.54483056", "0.54286844", "0.5401514", "0.53769755", "0.5364267", "0.5358425", "0.5351808", "0.535001", "0.5337143", "0.5335275", "0.5332628", "0.5330669", "0.53096724", "0.52789193", "0.5270406", "0.52660125", "0.5264545", "0.52436525", "0.52330786", "0.52275", "0.5227011", "0.52145016", "0.5212025", "0.52095634", "0.520611", "0.5201286", "0.5200016", "0.51990354", "0.51793", "0.51671374", "0.51652944", "0.5164308", "0.5159166", "0.5158099", "0.5138392", "0.5133182", "0.5132252", "0.51310676", "0.5118346", "0.5116895", "0.51147854", "0.5114425", "0.5113568", "0.5096623", "0.50958174", "0.50957537", "0.509104", "0.50890166", "0.50764495", "0.50764495", "0.5073732", "0.50732696", "0.50718373", "0.50632375", "0.50543505", "0.50540316", "0.50417113", "0.50403917", "0.5033842", "0.50322324", "0.50298685", "0.50198334", "0.5008639", "0.50047785", "0.50023407", "0.49929953", "0.49911526", "0.4990236", "0.4979356", "0.49791235", "0.49781087", "0.49726057", "0.49722397", "0.49652606", "0.4962143", "0.4956988", "0.49365154", "0.49334368", "0.49321392", "0.49307674", "0.49283347", "0.49268115" ]
0.0
-1
Set the threshold of maximum number of pending requests permitted to be held for a specified RCAT. A value of 0 indicates that the request should be transmitted immediately.
public RequestCategory withThresh(Long thresh) { this.thresh = thresh; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setMaxThreshold() {\n maxThreshold = value - value * postBoundChange / 100;\n }", "public void setMaxConns(int value) {\n this.maxConns = value;\n }", "public void requestEviction(int cMaximum);", "public Builder setMaximumCapacity(int value) {\n \n maximumCapacity_ = value;\n onChanged();\n return this;\n }", "public void setMaxConcurrentAccessCount(String newValue);", "public void setMaxRequestUrlsReported(int value) {\n this.maxRequestUrlsReported = value;\n }", "public void setThreshold(int aThreshold) {\n if(0 <= threshold && threshold <= 100) {\n threshold = aThreshold;\n } else {\n throw new IllegalArgumentException(\"Threshold must be in the interval <1..100> inclusive. Actual Value: \" + aThreshold);\n } \n }", "@Override\n\tpublic StructureTownHallConfigRecord setResourceCapacity(Integer value) {\n\t\tsetValue(10, value);\n\t\treturn this;\n\t}", "public void setMaxEvictionQueueEntries(int val) {\n this.mMaxEvictionQueueEntries = val;\n }", "PayloadSizeGate(long threshold) {\n this.threshold = threshold;\n }", "private void setConfigNumMaxBgJobs(int value) {\n this.bitField0_ |= 2;\n this.configNumMaxBgJobs_ = value;\n }", "void setLimit(int limit);", "public void setMaxIdleConns(int value) {\n this.maxIdleConns = value;\n }", "private void setMinThreshold() {\n minThreshold = value + value * postBoundChange / 100;\n }", "public void setCapacity(int value) {\n this.capacity = value;\n }", "public void setMaxSize(int c) {\n maxSize = c;\n }", "public void setMaxRequestParameters(int maxRequestParameters) {\n if (maxRequestParameters < 0) {\n this.maxRequestParameters = -1;\n } else {\n this.maxRequestParameters = maxRequestParameters;\n }\n }", "public static void setThreshold(int threshold) {\n EvalutionUtil.ifFalseCrash(threshold>0, \n \"The threshold for the relevant documents in the ranking should be bigger than 0\");\n thres = threshold;\n }", "public void setThreshold(int t) {\r\n\t\t\tthis.t = t;\r\n\t\t}", "private void setConfigNumMaxTotalJobs(int value) {\n this.bitField0_ |= 1;\n this.configNumMaxTotalJobs_ = value;\n }", "void setMaxCooldown(int maxCooldown);", "public void setThreshold(int inputThreshold) {\r\n\t\tthis.threshold = inputThreshold;\r\n\t}", "public Builder setMaxCount(int value) {\n bitField0_ |= 0x00000002;\n maxCount_ = value;\n onChanged();\n return this;\n }", "public void setMaximumCrowedLevel(double c) {\n this.CROWED_LEVEL_THRESHOLD = c;\n }", "public Builder setFailureRefreshThreshold(int value) {\n \n failureRefreshThreshold_ = value;\n onChanged();\n return this;\n }", "public void setFrameLimit(int value) {\n\t\tframeLimit = value;\n\t}", "public native void setMaximumRTO (long RTO);", "public void setThreshold(double t)\n {\n this.threshold = t;\n }", "public void setMaxRetryAttempt(final Integer maxRetryAttempt) {\n\t\tthis.maxRetryAttempt = maxRetryAttempt;\n\t}", "public void setMaxCalls(int max);", "public void setMaxQuota(Integer value) {\n setAttributeInternal(MAXQUOTA, value);\n }", "static public void setMaxAsyncPollingRetries(int maxRetries) {\n maxAsyncPollingRetries = maxRetries;\n }", "public void setLargestReceiveSuccessRequestThroughput(Double largestReceiveSuccessRequestThroughput)\r\n {\r\n this.largestReceiveSuccessRequestThroughput = largestReceiveSuccessRequestThroughput;\r\n }", "public void setTimeLimitAction(java.lang.String timeLimitAction);", "public static void SetMaxPassengers(double inLimit) \r\n {\r\n if (inLimit > 0) \r\n {\r\n maxPassengers = inLimit;\r\n } \r\n else \r\n {\r\n maxPassengers = 0;\r\n }\r\n }", "public final void setPendingCount(int paramInt)\n/* */ {\n/* 517 */ this.pending = paramInt;\n/* */ }", "public void setMaxActive(int maxActive);", "private boolean requestLimitReached() {\n\t\treturn (requestCount >= maximumRequests);\n\t}", "public void setThreshold(int threshold) {\n/* 357 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void setMaxConcurrentConnection(Long MaxConcurrentConnection) {\n this.MaxConcurrentConnection = MaxConcurrentConnection;\n }", "@Test\n public void testCircuitDoesNotTripOnFailuresBelowThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markSuccess(40);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n\n // this should remain open as the failure threshold is below the percentage limit\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void setMaxconn(org.apache.axis.types.UnsignedInt maxconn) {\n this.maxconn = maxconn;\n }", "void setMaximumCacheSize(int maximumCacheSize);", "public void setMaxConnections(int maxConnections)\n {\n _maxConnections = maxConnections;\n }", "public void setCapacity(int newCapacity) {\n\n\t\tif (newCapacity < 1) {\n\t\t\tsendWarning(\n\t\t\t\t\t\"The capacity of a transporter should be changed to zero or \"\n\t\t\t\t\t\t\t+ \"a negative value. The capacity will remain unchanged!\",\n\t\t\t\t\t\"Transporter : \" + getName()\n\t\t\t\t\t\t\t+ \" Method: void setCapacity(int newCapacity)\",\n\t\t\t\t\t\"A capacity which is zero or negative does not make sense.\",\n\t\t\t\t\t\"Make sure to provide a valid positive capacity \"\n\t\t\t\t\t\t\t+ \"when changing this attribute.\");\n\n\t\t\treturn; // forget that rubbish\n\t\t}\n\n\t\tthis.capacity = newCapacity;\n\t}", "void setMaxReactionRounds( @Nonnegative final int maxReactionRounds )\n {\n if ( Arez.shouldCheckInvariants() )\n {\n invariant( () -> maxReactionRounds >= 0,\n () -> \"Arez-0098: Attempting to set maxReactionRounds to negative \" +\n \"value \" + maxReactionRounds + \".\" );\n }\n _maxReactionRounds = maxReactionRounds;\n }", "public void setMaxThreads(int maxThreads)\r\n {\r\n this.maxThreads = maxThreads;\r\n }", "public void setMaxCacheEntries(int val) {\n this.mMaxCacheEntries = val;\n }", "public void setHighWaterThreadCount(int threads)\n { _threadPool.setMaxSize(threads);\n }", "public void setMaxRoundsPerBattle(int value) {\n this.maxRoundsPerBattle = value;\n }", "protected short maxRetries() { return 15; }", "@Override\r\n\tpublic void setThresholds(int itemthreshold, int timethreshold) {\n\t\t\r\n\t}", "public void setMaxValue(int x) {\r\n\t\tmaxValue = x;\r\n\t}", "public void setMaxLoginTrialCnt(Integer maxLoginTrialCnt) {\r\n this.maxLoginTrialCnt = maxLoginTrialCnt;\r\n }", "Integer backlogCapacity();", "private void setConfigNumMinBgJobs(int value) {\n this.bitField0_ |= 4;\n this.configNumMinBgJobs_ = value;\n }", "public void xsetLimit(org.apache.xmlbeans.XmlNonNegativeInteger limit)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.XmlNonNegativeInteger target = null;\r\n target = (org.apache.xmlbeans.XmlNonNegativeInteger)get_store().find_element_user(LIMIT$6, 0);\r\n if (target == null)\r\n {\r\n target = (org.apache.xmlbeans.XmlNonNegativeInteger)get_store().add_element_user(LIMIT$6);\r\n }\r\n target.set(limit);\r\n }\r\n }", "public void setMaxRetries(int maxRetries) {\n\t if (maxRetries > 0) {\n\t this.maxRetries.set(maxRetries);\n\t } else {\n\t this.maxRetries.set(0);\n\t }\n\t \n\t resetChain();\n\t}", "public void setCapacity(int capacity)\n {\n Validate.isTrue(capacity > 0, \"Capacity must be > 0\");\n capacity_ = capacity; \n }", "void setMaxValue();", "public Builder setAvailableCapacity(int value) {\n \n availableCapacity_ = value;\n onChanged();\n return this;\n }", "public void setFreePermits(Integer value) {\n setAttributeInternal(FREEPERMITS, value);\n }", "void setThreshold(float value);", "@Test\n public void testTripCircuitOnTimeoutsAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void setMaxRIT(long param) {\n if (param == java.lang.Long.MIN_VALUE) {\n localMaxRITTracker = false;\n } else {\n localMaxRITTracker = true;\n }\n this.localMaxRIT = param;\n }", "public synchronized void setTbApWtEntryTotalLimit(String value)\n\t\t\t\t throws AgentException{\n\t\t// Fill up with necessary processing\n\n\t\tif(value == null){\n\t\t\tthrow new AgentException(\"\", CommonUtils.WRONGVALUE);\n\t\t}\n\t\tif(!(((value.length()>=0)&&(value.length()<=255)))){\n\t\t\tthrow new AgentException(\"\", CommonUtils.WRONGVALUE);\n\t\t}\n\t\ttbApWtEntryTotalLimit = value;\n\t}", "private void setLimit(com.google.protobuf.Int32Value value) {\n if (value == null) {\n throw new NullPointerException();\n }\n limit_ = value;\n \n }", "public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n }", "public Builder setNumOfRetrievelRequest(int value) {\n \n numOfRetrievelRequest_ = value;\n onChanged();\n return this;\n }", "public void setCompletionThreshold(java.lang.String completionThreshold);", "public void setTimeLimit(long value) {\n\t\ttimeLimit = value;\n\t}", "void setTransactionLogMaxSize(int maxSize) {\n\t\ttransactionLog.setMaxSize(maxSize);\n\t\t\n\t\tif (maxSize == 0) {\n\t\t\ttransactionMonitor = null;\n\t\t} else {\n\t\t\ttransactionMonitor = new TransactionMonitor(transactionLog);\n\t\t}\n\t}", "public void setUpperThreshold(int setUpperThreshold) {\r\n\t\tthis.upperThreshold = setUpperThreshold;\t\t\r\n\t}", "public void setLimit(int limit) {\n\tLimit = limit;\n }", "public void setMaxBps(int maxBps) {\n\t\tlock.lock();\n\t\ttry {\n\t\t\tthis.maxBps = maxBps;\n\t\t\tbytesCredit = (int) (maxBps * (float) (MAX_CREDIT_TIME / 1000));\n\t\t\tlastCreditTime = currentTimeMillis();\n\t\t} finally {\n\t\t\tlock.unlock();\n\t\t}\n\t}", "private void setLimit(\n com.google.protobuf.Int32Value.Builder builderForValue) {\n limit_ = builderForValue.build();\n \n }", "public void setMaxattempts(int maxattempts) {\n this.maxattempts = maxattempts;\n }", "public void setMiterLimit(float limit);", "void requestRateLimited();", "public void setLowWaterThreadCount(int threads)\n { _threadPool.setMinAvailable(threads);\n }", "protected int retryLimit() {\n return DEFAULT_RETRIES;\n }", "public static long getApiMaxInflightRequests() {\n return 5000L;\n }", "public void setThreshold(float threshold){\n this.threshold = threshold;\n }", "public void setMaxBufferSize(int value) {\n this.maxBufferSize = value;\n }", "public ClientBuilder maxConnection(int maxConnection) {\n this.maxConnection = Predicates.bigThanZero(maxConnection);\n return this;\n }", "public void setMaximumCapacity(int maximumCapacity) { // set the max\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// capacity\n\t\tthis.maximumCapacity = maximumCapacity;\n\t}", "@Override\n\tpublic int getMaxThreads() {\n\t\treturn 10;\n\t}", "public void setSupplyReadinessRate(int value) {\n this.supplyReadinessRate = value;\n }", "private int getMaxReconsumeTimes() {\n if (this.defaultMQPushConsumer.getMaxReconsumeTimes() == -1) {\n return Integer.MAX_VALUE;\n } else {\n return this.defaultMQPushConsumer.getMaxReconsumeTimes();\n }\n }", "@Override\r\n\t\tpublic void setLimitBreachMarkOnAction(int i) {\n\t\t\t\r\n\t\t}", "protected int maxTimeout() { return 15*1000*1000; }", "private void doChargeSet(int newSetting)\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n CHARGE_NODE_HTML_DATA,\r\n CONTROL_URL,\r\n SN_HOST,\r\n makeChargeControl(newSetting),\r\n cookieData,\r\n false,\r\n token,\r\n secret ) ); \r\n }", "public void SetMaxVal(int max_val);", "public void setMaxLoadFactor(double loadFactor)\n {\n MAX_LOAD_FACTOR = loadFactor;\n }", "public void setRequestInterval(int requestInterval) {\n final int minSecs = 15;\n final int maxSecs = 600; // 10 minutes\n\n if (requestInterval <= 0) {\n requestInterval = 0;\n } else if (requestInterval < minSecs) {\n // Too often. Cannot request ads more frequently than minSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be >= \" + minSecs);\n } else if (requestInterval > maxSecs) {\n // Too infrequent. If setting this value there is no reason to have ads update more than maxSecs apart.\n AdManager.clientError(\"AdView.setRequestInterval(\" + requestInterval + \") seconds must be <= \" + maxSecs);\n }\n\n int requestIntervalMillisecs = requestInterval * 1000;\n this.requestInterval = requestIntervalMillisecs;\n\n // Set the timer to handle requesting fresh ads.\n if (requestInterval == 0) {\n // Stop the current timer (if there is one).\n manageRequestIntervalTimer(false);\n } else {\n // Start the timer.\n Log.i(AdManager.LOG, \"Requesting fresh ads every \" + requestInterval + \" seconds.\");\n manageRequestIntervalTimer(true);\n }\n }", "public abstract void setSplayLimit(int limit);", "public void setMaxIterations(int number) {\r\n if (number < CurrentIteration) {\r\n throw new Error(\"Cannot be lower than the current iteration.\");\r\n }\r\n MaxIteration = number;\r\n Candidates.ensureCapacity(MaxIteration);\r\n }", "public void setCapacity( Resource.Type type, int capacity );", "void setMaximum(int max);", "@Test\n public void testTripCircuitOnFailuresAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n metrics.markSuccess(400);\n metrics.markFailure(10);\n metrics.markFailure(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "public void setMaxValue(int maxValue) {\n this.maxValue = maxValue;\n }" ]
[ "0.644995", "0.5917882", "0.5912952", "0.5811967", "0.57906926", "0.5780796", "0.57158333", "0.563904", "0.56072336", "0.56045544", "0.5573818", "0.5562865", "0.55472004", "0.55456555", "0.5482019", "0.5480768", "0.5469345", "0.54639506", "0.5452063", "0.5445913", "0.5428298", "0.5404031", "0.53759855", "0.53661275", "0.53601044", "0.53510165", "0.53493947", "0.5338024", "0.53365505", "0.5331925", "0.5329875", "0.5308698", "0.5278736", "0.52691305", "0.5263766", "0.52637476", "0.52425385", "0.52325654", "0.52286565", "0.5225145", "0.52151346", "0.5210564", "0.5208007", "0.52046406", "0.5201078", "0.519962", "0.51975757", "0.51780826", "0.5166658", "0.5164129", "0.5163902", "0.5159497", "0.51571727", "0.5138122", "0.5133671", "0.5131511", "0.5130299", "0.51172656", "0.5116148", "0.5113006", "0.51129246", "0.5112901", "0.50987643", "0.50960666", "0.50945884", "0.5090244", "0.50877297", "0.5076085", "0.5076085", "0.5073743", "0.50731957", "0.5072878", "0.5064798", "0.5053416", "0.5052751", "0.50410306", "0.50390834", "0.5033093", "0.5031185", "0.5030464", "0.50196534", "0.50087863", "0.5005509", "0.50036645", "0.49917042", "0.49904528", "0.4989698", "0.497962", "0.49790463", "0.49766818", "0.49719772", "0.4971742", "0.4964017", "0.49624676", "0.49566826", "0.49356806", "0.49318787", "0.49304938", "0.4929507", "0.49276257", "0.49272084" ]
0.0
-1
Get the list is a prioritized set of Access Networks where the preference of using an Access Network is based on order of the list items with the lowest order list item as the most preferred Access Network.
public Collection<String> getRankedANList() { if (this.rankedANList == null){ this.rankedANList=new ArrayList<>();} return rankedANList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "NetworkCapabilities getNetworkCapabilities() {\n int size;\n NetworkCapabilities result = new NetworkCapabilities();\n boolean z = false;\n result.addTransportType(0);\n ArrayList<String> apnTypes = new ArrayList();\n for (ApnContext apnContext : this.mApnContexts.keySet()) {\n apnTypes.add(apnContext.getApnType());\n }\n boolean isBipNetwork = (this.mConnectionParams == null || this.mConnectionParams.mApnContext == null || this.mDct == null || !this.mDct.isBipApnType(this.mConnectionParams.mApnContext.getApnType())) ? false : true;\n if (this.mApnSetting != null) {\n ArrayList<ApnSetting> securedDunApns = this.mDct.fetchDunApns();\n String[] types = this.mApnSetting.types;\n if (enableCompatibleSimilarApnSettings()) {\n types = getCompatibleSimilarApnSettingsTypes(this.mApnSetting, this.mDct.getAllApnList());\n }\n int length = types.length;\n int i = 0;\n while (i < length) {\n String type = types[i];\n boolean shouldDropMeterApn = (this.mRestrictedNetworkOverride || this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || !ApnSetting.isMeteredApnType(type, this.mPhone)) ? z : true;\n if (!shouldDropMeterApn) {\n int hashCode = type.hashCode();\n switch (hashCode) {\n case 3023943:\n if (type.equals(\"bip0\")) {\n hashCode = 10;\n break;\n }\n case 3023944:\n if (type.equals(\"bip1\")) {\n hashCode = 11;\n break;\n }\n case 3023945:\n if (type.equals(\"bip2\")) {\n hashCode = 12;\n break;\n }\n case 3023946:\n if (type.equals(\"bip3\")) {\n hashCode = 13;\n break;\n }\n case 3023947:\n if (type.equals(\"bip4\")) {\n hashCode = 14;\n break;\n }\n case 3023948:\n if (type.equals(\"bip5\")) {\n hashCode = 15;\n break;\n }\n case 3023949:\n if (type.equals(\"bip6\")) {\n hashCode = 16;\n break;\n }\n default:\n switch (hashCode) {\n case -1490587420:\n if (type.equals(\"internaldefault\")) {\n hashCode = 18;\n break;\n }\n case 42:\n if (type.equals(CharacterSets.MIMENAME_ANY_CHARSET)) {\n hashCode = 0;\n break;\n }\n case 3352:\n if (type.equals(\"ia\")) {\n hashCode = 8;\n break;\n }\n case 98292:\n if (type.equals(\"cbs\")) {\n hashCode = 7;\n break;\n }\n case 99837:\n if (type.equals(\"dun\")) {\n hashCode = 4;\n break;\n }\n case 104399:\n if (type.equals(\"ims\")) {\n hashCode = 6;\n break;\n }\n case 108243:\n if (type.equals(\"mms\")) {\n hashCode = 2;\n break;\n }\n case 3149046:\n if (type.equals(\"fota\")) {\n hashCode = 5;\n break;\n }\n case 3541982:\n if (type.equals(\"supl\")) {\n hashCode = 3;\n break;\n }\n case 3673178:\n if (type.equals(\"xcap\")) {\n hashCode = 17;\n break;\n }\n case 1544803905:\n if (type.equals(\"default\")) {\n hashCode = 1;\n break;\n }\n case 1629013393:\n if (type.equals(\"emergency\")) {\n hashCode = 9;\n break;\n }\n }\n hashCode = -1;\n break;\n }\n switch (hashCode) {\n case 0:\n result.addCapability(12);\n result.addCapability(0);\n if (DcTracker.CT_SUPL_FEATURE_ENABLE && !apnTypes.contains(\"supl\") && this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n } else {\n result.addCapability(1);\n }\n result.addCapability(3);\n result.addCapability(4);\n result.addCapability(5);\n result.addCapability(7);\n size = securedDunApns.size();\n for (hashCode = 0; hashCode < size; hashCode++) {\n if (this.mApnSetting.equals(securedDunApns.get(hashCode))) {\n result.addCapability(2);\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n }\n }\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n case 1:\n result.addCapability(12);\n break;\n case 2:\n result.addCapability(0);\n break;\n case 3:\n if (!DcTracker.CT_SUPL_FEATURE_ENABLE || apnTypes.contains(\"supl\") || !this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n result.addCapability(1);\n break;\n }\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n break;\n break;\n case 4:\n result.addCapability(2);\n break;\n case 5:\n result.addCapability(3);\n break;\n case 6:\n result.addCapability(4);\n break;\n case 7:\n result.addCapability(5);\n break;\n case 8:\n result.addCapability(7);\n break;\n case 9:\n result.addCapability(10);\n break;\n case 10:\n result.addCapability(23);\n break;\n case 11:\n result.addCapability(24);\n break;\n case 12:\n result.addCapability(25);\n break;\n case 13:\n result.addCapability(26);\n break;\n case 14:\n result.addCapability(27);\n break;\n case 15:\n result.addCapability(28);\n break;\n case 16:\n result.addCapability(29);\n break;\n case 17:\n result.addCapability(9);\n break;\n case 18:\n result.addCapability(30);\n break;\n default:\n break;\n }\n }\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Dropped the metered \");\n stringBuilder.append(type);\n stringBuilder.append(\" for the unmetered data call.\");\n log(stringBuilder.toString());\n i++;\n z = false;\n }\n if ((this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || this.mRestrictedNetworkOverride) && this.mApnSetting.isMetered(this.mPhone)) {\n result.removeCapability(11);\n } else {\n result.addCapability(11);\n }\n z = this.mHwCustDataConnection != null && this.mHwCustDataConnection.isNeedReMakeCapability();\n if (z) {\n result = this.mHwCustDataConnection.getNetworkCapabilities(types, result, this.mApnSetting, this.mDct);\n }\n if (!isBipNetwork) {\n result.maybeMarkCapabilitiesRestricted();\n }\n }\n boolean z2 = this.mRestrictedNetworkOverride && !isBipNetwork;\n if (z2) {\n result.removeCapability(13);\n result.removeCapability(2);\n }\n int up = 14;\n int down = 14;\n size = this.mRilRat;\n if (size != 19) {\n switch (size) {\n case 1:\n up = 80;\n down = 80;\n break;\n case 2:\n up = 59;\n down = 236;\n break;\n case 3:\n up = 384;\n down = 384;\n break;\n case 4:\n case 5:\n up = 14;\n down = 14;\n break;\n case 6:\n up = 100;\n down = 100;\n break;\n case 7:\n up = 153;\n down = 2457;\n break;\n case 8:\n up = 1843;\n down = 3174;\n break;\n case 9:\n up = 2048;\n down = 14336;\n break;\n case 10:\n up = 5898;\n down = 14336;\n break;\n case 11:\n up = 5898;\n down = 14336;\n break;\n case 12:\n up = 1843;\n down = 5017;\n break;\n case 13:\n up = 153;\n down = 2516;\n break;\n case 14:\n up = 51200;\n down = 102400;\n break;\n case 15:\n up = 11264;\n down = 43008;\n break;\n }\n }\n up = 51200;\n down = 102400;\n result.setLinkUpstreamBandwidthKbps(up);\n result.setLinkDownstreamBandwidthKbps(down);\n result.setNetworkSpecifier(new StringNetworkSpecifier(Integer.toString(this.mPhone.getSubId())));\n result.setCapability(18, this.mPhone.getServiceState().getDataRoaming() ^ 1);\n result.addCapability(20);\n if ((this.mSubscriptionOverride & 1) != 0) {\n result.addCapability(11);\n }\n if ((this.mSubscriptionOverride & 2) != 0) {\n result.removeCapability(20);\n }\n return result;\n }", "public ArrayList<String> alwaysPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.topRankDecs()>=2){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "private List<WifiConfiguration> sortConfigedAPs(List<WifiConfiguration> mconfig) {\n if (mconfig == null) {\n return null;\n }\n /* ascending sort by priority */\n Collections.sort(mconfig, new Comparator<WifiConfiguration>() {\n public int compare(WifiConfiguration a, WifiConfiguration b) {\n if (a.priority > b.priority) {\n return -1;\n } else if (a.priority < b.priority) {\n return 1;\n } else {\n return -1;\n }\n }\n });\n return mconfig;\n }", "public List<PwPair> getPwPairsSortedByRank() {\n // Get all valid PwPairs.\n List<PwPair> allPwPairs = getPwPairs();\n\n // Sort the list in descending order.\n Collections.sort(allPwPairs, Collections.reverseOrder());\n\n // Filter the list.\n return removeDuplicateSiteUrls(allPwPairs);\n }", "@Nullable\r\n List<Network> getNetwork();", "public Iterator getNetworkList(){\n NeutronTest nt=new NeutronTest(this.idsEndpoint,this.tenantName,this.userName,this.password,this.region);\n Networks ns=nt.listNetworks();\n Iterator<Network> itNet=ns.iterator();\n return itNet;\n }", "private List<AccessTypeInjector> getAccessTypeOrderByPriority(boolean ascending) {\n List<AccessTypeInjector> list = new ArrayList<AccessTypeInjector>();\n for (AccessTypeInjector injector : accessTypeInjectors) {\n list.add(injector);\n }\n Collections.sort(list);\n if (!ascending) {\n Collections.reverse(list);\n }\n return list;\n }", "public List<AccessRequestStatusItem> getAccessRequestStatusExternal() {\n List sortedList = new ArrayList(getAccessRequestStatus());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "public int order() {\r\n\t\treturn connectionLists.size();\r\n\t}", "public ArrayList<String> alwaysLessPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.lessPop()){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "public List<Node> getFirstChoices() {\n Set<Node> firstChoices = new HashSet<Node>();\n // find non-redundant connectors of matching needs or capabilities.\n for ( Connector connector : findRelatedLocalConnectors() ) {\n if ( !isRedundant( connector ) )\n firstChoices.add( connector );\n }\n // Find related external connectors\n for ( Connector connector : findRelatedExternalConnectors() ) {\n if ( !isRedundant( connector ) )\n firstChoices.add( connector );\n }\n // Find all parts involved in related sharing but without related need or capability\n for ( Part part : findRelatedParts() ) {\n if ( !isRedundant( part ) )\n firstChoices.add( part );\n }\n return new ArrayList<Node>( firstChoices );\n }", "public Clan findSmallestDefaultClan() {\n\t\tList<Clan> defaultClans = clans.stream().filter(c -> c.getID().equals(DEFAULT_CLAN_ID)).collect(Collectors.toList());\n\n\t\tdefaultClans.sort((c1, c2) -> c1.getMembers().size() - c2.getMembers().size());\n\n\t\treturn defaultClans.get(0);\n\t}", "public java.util.List<Network> getNetworksList() {\n return networks_;\n }", "public static ArrayList<Connection> getLowCost(ArrayList<Connection> connections) {\n if (connections == null || connections.size() == 0)\n return new ArrayList<>();\n ArrayList<Connection> res = new ArrayList<>();\n Map<String, Integer> map = new HashMap<>();\n // put smallest cost at front\n Collections.sort(connections, new Comparator<Connection>() {\n @Override\n public int compare(Connection o1, Connection o2) {\n return o1.cost - o2.cost;\n }\n });\n\n unionNum = 0;\n for(Connection c: connections){\n String a = c.node1;\n String b = c.node2;\n if (union(map,a,b)){\n res.add(c);\n }\n }\n String find = connections.get(0).node1;\n int union = map.get(find);\n for(String str: map.keySet()){\n if(map.get(str) != union){\n return new ArrayList<>();\n }\n }\n // have the city in the order of name\n Collections.sort(res, new Comparator<Connection>() {\n @Override\n public int compare(Connection o1, Connection o2) {\n if(o1.node1.equals(o2.node1)){\n return o1.node2.compareTo(o2.node2);\n };\n return o1.node1.compareTo(o2.node1);\n }\n });\n return res;\n\n\n }", "private List<OrderDistance> sortOrdersByPriorities(List<OrderDistance> orderDistances) {\n\n /*Keeps orders and their priorities.\n * TreeMap keeps data in order using keys\n */\n\n Map<Integer, List<OrderDistance>> listMap = orderDistances.stream()\n .collect(groupingBy(order -> getPriority(order.getOrder()), TreeMap::new, mapping(Function.identity(), toList())));\n\n /*\n * There are three list which consists of vip,food and other\n * Here we are flatting them into single list\n */\n return listMap.values().stream().flatMap(Collection::stream).collect(toList());\n }", "public List<PwPair> getGroupedPwPairsSortedByRank() {\n // Get all valid PwPairs.\n List<PwPair> allPwPairs = getPwPairs();\n\n // Group pairs with the same groupId, keeping only the top-ranked PwPair.\n List<PwPair> groupedPwPairs = removeDuplicateGroupIds(allPwPairs, null);\n\n // Sort by descending rank.\n Collections.sort(groupedPwPairs, Collections.reverseOrder());\n\n // Remove duplicate site URLs.\n return removeDuplicateSiteUrls(groupedPwPairs);\n }", "public NetworkAccessPolicy networkAccessPolicy() {\n return this.networkAccessPolicy;\n }", "protected List topologicalSort() {\r\n LinkedList order = new LinkedList();\r\n HashSet knownNodes = new HashSet();\r\n LinkedList nextNodes = new LinkedList();\r\n\r\n for (Iterator i = graph.getNodes().iterator(); i.hasNext(); ) {\r\n BBNNode node = (BBNNode) i.next();\r\n if (node.getChildren().size() == 0) {\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n order.addFirst(node);\r\n }\r\n }\r\n\r\n while (nextNodes.size() > 0) {\r\n BBNNode node = (BBNNode) nextNodes.removeFirst();\r\n if (knownNodes.contains(node)) continue;\r\n\r\n List children = node.getChildren();\r\n if (knownNodes.containsAll(children)) {\r\n order.addFirst(node);\r\n nextNodes.addAll(node.getParents());\r\n knownNodes.add(node);\r\n }\r\n }\r\n return order;\r\n }", "int getPriorityOrder();", "public List getAccessRequestHistoryExternal() {\n List sortedList = new ArrayList(getAccessRequestHistory());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "public synchronized List<Request> getAllAscending() {\n\t\tList<Request> all = new ArrayList<Request>();\n\t\tfor(Request request : requests) {\n\t\t\tif(request != null) {\n\t\t\t\tall.add(request);\n\t\t\t}\n\t\t}\n\t\tall.sort(new RequestComparator());\n\t\treturn all;\n\t}", "public java.util.List<Network> getNetworksList() {\n if (networksBuilder_ == null) {\n return java.util.Collections.unmodifiableList(networks_);\n } else {\n return networksBuilder_.getMessageList();\n }\n }", "public List<AccessDetailVO> getLockList(){\r\n \t\r\n \tList<AccessDetailVO> pageLocks = new ArrayList<AccessDetailVO>();\r\n \tfor (Entry<String, AccessDetailVO> curPage : pageAccess.entrySet()) {\r\n \t\tAccessDetailVO currLock = curPage.getValue();\r\n \t\tpageLocks.add(currLock);\r\n \t}\r\n \t\r\n \tCollections.sort(pageLocks);\r\n \treturn pageLocks;\r\n }", "Map<String, Integer> sortByinlinks(Map<String, Integer> inlinks_sort){\n\tList<Map.Entry<String,Integer>> ranklist = new LinkedList<Map.Entry<String,Integer>>(inlinks_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Integer>>(){\n\t\tpublic int compare(Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2){\n\t\t\treturn o2.getValue().compareTo(o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Integer> sortedRank = new LinkedHashMap<String,Integer>();\n\tfor(Map.Entry<String, Integer> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "@Override public Set<Integer> allowedLayers() {\n Set<Integer> layers = new HashSet<>(first.allowedLayers());\n layers.retainAll(next.allowedLayers());\n return layers;\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork();", "protected List getAllowedAncestors() {\n return ALLOWED_ANCESTORS;\n }", "public Set<Integer> getActiveNeighbors() {\n HashSet<Integer> retSet = new HashSet<Integer>();\n\n for (AS tAS : this.providers) {\n retSet.add(tAS.getASN());\n }\n for (AS tAS : this.customers) {\n retSet.add(tAS.getASN());\n }\n for (AS tAS : this.peers) {\n retSet.add(tAS.getASN());\n }\n\n return retSet;\n }", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public SortedSet<WIpLink> getIncomingIpLinks () { return n.getIncomingLinks(getNet().getIpLayer().getNe()).stream().map(ee->new WIpLink(ee)).filter(e->!e.isVirtualLink()).collect(Collectors.toCollection(TreeSet::new)); }", "public Comparator<Integer> comparator() {\n return new Comparator<Integer>() {\n @Override\n public int compare(Integer o1, Integer o2) {\n Http2PriorityNode n1 = nodesByID.get(o1);\n Http2PriorityNode n2 = nodesByID.get(o2);\n if(n1 == null && n2 == null) {\n return 0;\n }\n if(n1 == null) {\n return -1;\n }\n if(n2 == null) {\n return 1;\n }\n //do the comparison\n //this is kinda crap, but I can't really think of any better way to handle this\n\n double d1 = createWeightingProportion(n1);\n double d2 = createWeightingProportion(n2);\n return Double.compare(d1, d2);\n }\n };\n }", "public List<NetworkNode> listNetworkNode();", "public TreeSet<Integer> rankSet() {\n TreeSet<Integer> rankSet = new TreeSet<Integer>();\n for (Card c : cards) {\n \tint org = rankSet.size();\n \trankSet.add(c.getRank());\n \tif (org == rankSet.size()) {\n \tthis.sameSet.add(c.getRank());\n }\n } \n return rankSet;\n }", "com.google.container.v1.NetworkPolicyConfig getNetworkPolicyConfig();", "public static Set<String> getPreferredProtocols() {\n return PREFERRED_PROTOCOLS;\n }", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}", "public ExperimentList orderExperiments(){ // tum experimentlari sirala\r\n Node last = head;\r\n Node last2 = head;\r\n ExperimentList ordered = new ExperimentList();\r\n Node min = new Node(new Experiment());\r\n min.data.accuracy = 9999999;\r\n float min2 = -9999999;\r\n int count = -1;\r\n while(last != null){ // genel dongu\r\n int count_in = 0;\r\n while(last2 != null){ // her eleman icin dongu\r\n if( min.data.accuracy > last2.data.accuracy && last2.data.accuracy >= min2){\r\n if( last2.data.accuracy != min2 || count_in >= count){\r\n min = last2; // min se ve kullanilmamissa ekle\r\n count_in++;\r\n }\r\n }\r\n last2 = last2.next;\r\n }\r\n count = count_in;\r\n Experiment temp = new Experiment(min.data);\r\n ordered.addExpList(temp);\r\n min2 = min.data.accuracy;\r\n min = new Node(new Experiment());\r\n min.data.accuracy = 9999999;\r\n last = last.next;\r\n last2 = head;\r\n }\r\n return ordered;\r\n }", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n return networks_;\n }", "public Network getNetwork() {\r\n \t\treturn network;\r\n \t}", "public static String[] getNetworkList() {\n final File dataFile = new File(kNetworkPath);\n final File[] networkFiles = dataFile.listFiles();\n String[] networkNames = new String[networkFiles.length];\n\n for (int i = 0; i < networkNames.length; ++i) {\n networkNames[i] = networkFiles[i].getName();\n }\n\n return networkNames;\n }", "AccessPoliciesClient getAccessPolicies();", "public CountryList sortByCount() {\n\t\tCountryList sorted = new CountryList();\n\t\tfor (int i = 0; i < this.nextAvailable; i++)\n\t\t\tsorted.binInsert(new Country(this.countries.get(i)));\n\t\tsorted.totalCount = this.totalCount;\n\t\treturn sorted;\n\t}", "public NatPolicy getNatPolicy();", "private NetworkScanRequest getNetworkScanRequestForTesting() {\n List<CellInfo> allCellInfo = mTelephonyManager.getAllCellInfo();\n List<RadioAccessSpecifier> radioAccessSpecifier = new ArrayList<>();\n for (int i = 0; i < allCellInfo.size(); i++) {\n RadioAccessSpecifier ras = getRadioAccessSpecifier(allCellInfo.get(i));\n if (ras != null) {\n radioAccessSpecifier.add(ras);\n }\n }\n if (radioAccessSpecifier.size() == 0) {\n RadioAccessSpecifier gsm = new RadioAccessSpecifier(\n AccessNetworkConstants.AccessNetworkType.GERAN,\n null /* bands */,\n null /* channels */);\n radioAccessSpecifier.add(gsm);\n }\n RadioAccessSpecifier[] radioAccessSpecifierArray =\n new RadioAccessSpecifier[radioAccessSpecifier.size()];\n return new NetworkScanRequest(\n NetworkScanRequest.SCAN_TYPE_ONE_SHOT /* scan type */,\n radioAccessSpecifier.toArray(radioAccessSpecifierArray),\n 5 /* search periodicity */,\n 60 /* max search time */,\n true /*enable incremental results*/,\n 5 /* incremental results periodicity */,\n null /* List of PLMN ids (MCC-MNC) */);\n }", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n if (networksBuilder_ != null) {\n return networksBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(networks_);\n }\n }", "public MhsmNetworkRuleSet networkAcls() {\n return this.networkAcls;\n }", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "private Node lowestCostThrough(List<Node> openSet, Map<Node, Double> costThrough){\n Node lowest = openSet.get(0);\n\n for(Node n: openSet){\n if(costThrough.get(n) < costThrough.get(lowest)){\n lowest = n;\n }\n }\n return lowest;\n }", "protected String getFieldOrderForReadList() {\n\t\treturn \"o.OwnerAccountId, o.ProjectCode ASC\";\n\t}", "private List<ActionCallConfig> getInTopologicalOrder(IdentityHashMap<ActionCallConfig, Set<ActionCallConfig>> dependencyGraph) throws CyclicDataDependencyException {\n\n //make the order deterministic to get deterministic error messages, e.g. in case of multiple dependency cycles\n List<Pair<ActionCallConfig, List<ActionCallConfig>>> sortedDependencyGraph = sortDependencyGraph(dependencyGraph);\n IdentityHashMap<ActionCallConfig, List<ActionCallConfig>> sortedLookup = new IdentityHashMap<>();\n sortedDependencyGraph.forEach(p -> sortedLookup.put(p.getLeft(), p.getRight()));\n\n LinkedHashSet<Equivalence.Wrapper<ActionCallConfig>> result = new LinkedHashSet<>();\n\n for (Pair<ActionCallConfig, List<ActionCallConfig>> callWithDependencies : sortedDependencyGraph) {\n putInTopologicalOrder(result, callWithDependencies.getLeft(), sortedLookup, new LinkedHashSet<>());\n }\n return result.stream()\n .map(Equivalence.Wrapper::get)\n .collect(Collectors.toList());\n }", "CyNetwork getGroupNetwork();", "public List<Idea> allIdeasLikersAsc() {\n\n List<Idea> ideas = ideaRepo.findAll();\n\n ideas.sort(new Comparator<Idea>() {\n @Override\n public int compare(Idea i1, Idea i2) {\n if(i1.getLikers().size() == i2.getLikers().size()){\n return 0;\n }\n return i1.getLikers().size() < i2.getLikers().size() ? -1 : 1;\n }\n });\n\n return ideas;\n\n }", "public Set<QuantDiseaseGroupsComparison> getSelectedComparisonsList() {\n Set<QuantDiseaseGroupsComparison> tempProteinsList = new LinkedHashSet<>();\n if (quantSearchSelection != null && selectedComparisonsList != null) {\n for (QuantDiseaseGroupsComparison quantComp : selectedComparisonsList) {\n Map<String, QuantComparisonProtein> map = new LinkedHashMap<>();\n\n for (String protien : quantSearchSelection.getSelectedProteinsList()) {\n String key = \"\";\n if (quantComp.getQuantComparisonProteinMap().containsKey(\"0_\" + protien)) {\n key = \"0_\" + protien;\n } else if (quantComp.getQuantComparisonProteinMap().containsKey(\"1_\" + protien)) {\n key = \"1_\" + protien;\n } else if (quantComp.getQuantComparisonProteinMap().containsKey(\"2_\" + protien)) {\n key = \"2_\" + protien;\n\n } else if (quantComp.getQuantComparisonProteinMap().containsKey(\"3_\" + protien)) {\n\n key = \"3_\" + protien;\n } else if (quantComp.getQuantComparisonProteinMap().containsKey(\"4_\" + protien)) // if (quantComp.getQuantComparisonProteinMap().containsValue(protien.getProtKey())) {\n {\n key = \"4_\" + protien;\n\n }\n\n if (quantComp.getQuantComparisonProteinMap().containsKey(key)) {\n map.put(key, quantComp.getQuantComparisonProteinMap().get(key));\n }\n\n }\n QuantDiseaseGroupsComparison updatedQuantComp = quantComp.cloning();\n updatedQuantComp.setQuantComparisonProteinMap(map);\n tempProteinsList.add(updatedQuantComp);\n }\n return tempProteinsList;\n\n }\n\n return selectedComparisonsList;\n }", "public SortedSet<WServiceChain> getInOutOrTraversingServiceChains () { return n.getAssociatedRoutes(getNet().getIpLayer().getNe()).stream().map(ee->new WServiceChain(ee)).collect(Collectors.toCollection(TreeSet::new)); }", "public String getNetwork() {\n String[] ipOctets = ipAddress.split(\"\\\\.\");\n String[] subnetOctets = subnetMask.split(\"\\\\.\");\n String[] result = ipOctets;\n\n for (int i = 0; i < 4; i++) {\n if (!\"255\".equals(subnetOctets[i])) {\n int sub = Integer.parseInt(subnetOctets[i]);\n int ip = Integer.parseInt(ipOctets[i]);\n result[i] = String.format(\"%s\", (ip & sub));\n }\n }\n\n return String.join(\".\", result);\n }", "public java.util.List getOrderedAncestors();", "private int getPreferredNetworkMode(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.getPreferredNetworkMode(int):int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.getPreferredNetworkMode(int):int\");\n }", "public static ProbNet prioritize(ProbNet probNet, Variable decisionVariable) {\n\t\tProbNet prioritizedNetwork = probNet.copy();\n\t\ttry {\n\t\t\tList<Node> nextDecisions = getNextDecisions(prioritizedNetwork);\n\t\t\tVariable priorVariable = prioritizedNetwork.getVariable(decisionVariable.getName());\n\n\t\t\tfor (Node decisionNode : nextDecisions) {\n\t\t\t\tVariable nextDecisionVariable = decisionNode.getVariable();\n\t\t\t\tif (nextDecisionVariable != priorVariable) {\n\t\t\t\t\tprioritizedNetwork.addLink(priorVariable, nextDecisionVariable, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (NodeNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn prioritizedNetwork;\n\t}", "com.google.appengine.v1.NetworkSettings getNetworkSettings();", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork(\n @QueryMap ListNetwork queryParameters);", "public void initializeNetwork() {\n if (DataHelper.isNull(searchDTO.getNetwork())) {\n //If no Network is set we have to see which network applies for this user\n this.searchDTO.setNetwork(obtainCurrentUserNetwork());\n }\n }", "PriorityQueue<Ride> orderRidesByPriceAscending(Set<Ride> rides){\n return new PriorityQueue<>(rides);\n }", "public static JwComparator<AcCustodySummaryVo> getApplicableKilogramsComparator()\n {\n return AcCustodySummaryVoTools.instance.getApplicableKilogramsComparator();\n }", "@Test\n\tpublic void testDefinitionPriority() {\n\n\t\tthis.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setAccept(MediaType.HTML);\n\n\t\tthis.requestDefinitions.get(1).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(1).setContentType(MediaType.HTML);\n\t\tthis.requestDefinitions.get(1).setAccept(MediaType.UNKNOWN);\n\n\t\tthis.requestDefinitions.get(2).setHttpMethod(HttpMethod.GET);\n\t\tthis.requestDefinitions.get(2).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(2).setAccept(MediaType.UNKNOWN);\n\n\t\tfinal List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(2),\n\t\t\t\tthis.requestDefinitions.get(1), this.requestDefinitions.get(0));\n\n\t\tCollections.sort(this.requestDefinitions, this.comparator);\n\t\tAssert.assertEquals(expected, this.requestDefinitions);\n\t}", "public List BestClient();", "public List<DatasetItem> getDatasetsExternal() {\n List sortedList = new ArrayList(getDatasets());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "private List<Integer> findMinNodes() {\n\t\tint minLabel = Integer.MAX_VALUE;\n\t\tList<Integer> result = new ArrayList<Integer>();\n\n\t\tfor (int node = 0; node < vertices.length; node++) {\n\t\t\tint nodeLabel = connectivity[node][node];\n\t\t\tif (nodeLabel < minLabel) {\n\t\t\t\tresult.clear();\n\t\t\t\tresult.add(node);\n\t\t\t\tminLabel = nodeLabel;\n\t\t\t} else if (nodeLabel == minLabel) {\n\t\t\t\tresult.add(node);\n\t\t\t} else\n\t\t\t\tcontinue;\n\t\t}\n\t\treturn result;\n\t}", "public Network getNetworks(int index) {\n return networks_.get(index);\n }", "public void alphabetize() {\n\t\t// write you code for alphabetize using the specifications above\n\t\tif (numElements==0){\n\t\t\treturn;\n\t\t}\n\t\tNode nodref = head;\n\t\tNode nodref1 = head.next;\n\t\tint count = 0;\n\t\tboolean x1 = false;\n\t\t\n\t\twhile(nodref!=null){\n\t\t\tnodref1=nodref.next;\n\t\t\tx1 = false;\n\t\t\twhile(nodref1!=null){\n\t\t\t\tint boo = nodref.data.compareTo(nodref1.data);\n\t\t\t\tSystem.out.println(this + \"\\n\" + nodref + \" \" + nodref1+ \" \" + boo +\"\\n\");\n\t\t\t\t\n\t\t\t\tif (boo>0){\n\t\t\t\t\tthis.add(nodref1.data);\n\t\t\t\t\tnumElements--;\n\t\t\t\t\tNode x = head;\n\t\t\t\t\tfor(int counter=0; counter<=count; counter++){\n\t\t\t\t\t\tx=x.next;\n\t\t\t\t\t}\n\t\t\t\t\tnodref.next = nodref.next.next;\n\t\t\t\t\tx1 = true;\n\t\t\t\t}\n\t\t\t\tnodref1 = nodref1.next;\n\t\t\t}\n\t\t\tSystem.out.println(count + \" \" + head + \" \" + x1);\n\t\t\tcount++;\n\t\t\tif(x1!=true){\n\t\t\t\tnodref = nodref.next;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnodref = head;\n\t\t}\n\t}", "@Override\r\n public List<Vertex> getVertices() {\r\n List<Vertex> verticesList = new LinkedList<>(adjacencyList.keySet()); //getting the key set of adjacencyList i.e, a list of all vertices\r\n Collections.sort(verticesList, Comparator.comparing(Vertex::getLabel));\r\n return verticesList;\r\n }", "private boolean isLexicographicOrder() {\n UISettings settings = UISettings.getInstance();\n\n //first first try the old way and fallback to the new method\n try {\n Field property = settings.getClass().getField(\"SORT_LOOKUP_ELEMENTS_LEXICOGRAPHICALLY\");\n Object value = property.get(settings);\n return value instanceof Boolean && Boolean.TRUE.equals(value);\n } catch (Exception e) {\n try {\n Method method = settings.getClass().getMethod(\"getSortLookupElementsLexicographically\");\n Object result = method.invoke(settings);\n\n return result instanceof Boolean && Boolean.TRUE.equals(result);\n } catch (Exception e1) {\n return false;\n }\n }\n }", "public List<Integer> findSmallestSetOfVertices(int n, List<List<Integer>> edges) {\n \n int[] indegree = new int[n];\n List<Integer> list = new ArrayList();\n \n for(List<Integer> arr : edges)\n {\n indegree[arr.get(1)]++;\n }\n \n for(int i=0; i<n; i++){\n if(indegree[i]==0)\n {\n list.add(i);\n }\n }\n \n return list;\n }", "String getDefaultCannedAcl();", "public List getSkuCompareList() {\n return mSkuCompareList;\n }", "public Collection< Remote > getPreferredRemotes()\n {\n ArrayList< Remote > remotes = new ArrayList< Remote >( preferredListModel.size() );\n for ( Enumeration< ? > e = preferredListModel.elements(); e.hasMoreElements(); )\n remotes.add( ( Remote )e.nextElement() );\n return remotes;\n }", "@Link Network network();", "public abstract List<String> getAdditionalAccessions();", "protected Collection<IRI> getNonCurrentGraphNames() {\n final IRI ext = getExtensionGraphName();\n return extensions.values().stream().map(iri -> iri.equals(ext) ? PreferUserManaged : iri).collect(toSet());\n }", "default List<Source> representativeTypicalityQuery(int topk, Set<Source> resultSet, Set<String> domain) {\n final Map<Source, List<Source>> region = interestingRegion(topk, resultSet, domain);\n\n final Comparator<Map.Entry<Source, List<Source>>> byValue =\n (entry1, entry2) ->\n Ints.compare(entry1.getValue().size(), entry2.getValue().size());\n\n return region.entrySet().stream()\n .sorted(byValue.reversed())\n .map(Map.Entry::getKey)\n .collect(Collectors.toList());\n }", "java.util.List<online_info>\n getInfoList();", "public static Map<String, List<CommonName>> sortCommonNameSources(List<CommonName> names){\n \tString pattern = \"[^a-zA-Z0-9]\";\n \tCommonName prevName = null;\n \tMap<String, List<CommonName>> map = new Hashtable<String, List<CommonName>>();\n \tList<CommonName> list = new ArrayList<CommonName>();\n \t\n \t//made a copy of names, so sorting doesn't effect original list order ....\n \tList<CommonName> newArrayList = (List<CommonName>)((ArrayList<CommonName>)names).clone();\n \tCollections.sort(newArrayList, new Comparator<CommonName>(){\n \t@Override\n public int compare(CommonName o1, CommonName o2) {\n \t\tint i = -1;\n \t\ttry{\n \t\t\ti = o1.getNameString().trim().compareToIgnoreCase(o2.getNameString().trim());\n \t\t}\n \t\tcatch(Exception e){\n \t\t\tlogger.error(e);\n \t\t}\n \t\treturn i;\n \t}\n \t});\n \tIterator<CommonName> it = newArrayList.iterator();\n \tif(it.hasNext()){\n \t\tprevName = it.next();\n \t\tlist.add(prevName);\n \t}\n \t\n \t// group the name with infosource, compare the name with alphabet & number only.\n \twhile(it.hasNext()){\n \t\tCommonName curName = it.next();\n \t\tif(prevName.getNameString().trim().replaceAll(pattern, \"\").equalsIgnoreCase(\n \t\t\t\tcurName.getNameString().trim().replaceAll(pattern, \"\"))){\n \t\t\tlist.add(curName);\n \t\t}\n \t\telse{\n \t\t\tmap.put(prevName.getNameString().trim(), list);\n \t\t\t\n \t\t\tlist = new ArrayList<CommonName>();\n \t\t\tlist.add(curName);\n \t\t\tprevName = curName;\n \t\t}\n \t}\n \tif(prevName != null){\n \t\tmap.put(prevName.getNameString().trim(), list);\n \t}\n \treturn map;\n }", "public String getNetwork() {\n initNetwork();\n NetworkInfo networkInfo =\n connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);\n if (networkInfo != null &&\n networkInfo.getState() == NetworkInfo.State.CONNECTED) {\n Logger.d(\"Current Network: WIFI\");\n return NETWORK_WIFI;\n } else {\n return getTelephonyNetworkType();\n }\n }", "@GET\n\t@PermitAll\n\t@Path(\"/{groupid}/permission\")\n\t@Produces(\"application/json\")\n\tpublic Map<String,String> getGroupNetworkPermissions(@PathParam(\"groupid\") final String groupIdStr,\n\t\t @QueryParam(\"networkid\") String networkIdStr,\n\t\t @QueryParam(\"permission\") String permissions,\n\t\t\t@DefaultValue(\"0\") @QueryParam(\"start\") int skipBlocks,\n\t\t\t@DefaultValue(\"100\") @QueryParam(\"size\") int blockSize ) \n\t\t\t\t\tthrows NdexException, SQLException, IllegalArgumentException {\n\n\t\t\n\t\tUUID groupId = UUID.fromString(groupIdStr);\n\t\t\n\t\t\n\t\tif ( networkIdStr != null) {\n\t\t\tMap<String,String> result = new TreeMap<>();\n\t\t\tUUID networkId = UUID.fromString(networkIdStr);\n\t\t\ttry (GroupDAO dao = new GroupDAO()) {\n\t\t\t\tif ( !dao.isInGroup(groupId,getLoggedInUserId()) )\n\t\t\t\t\tthrow new NdexException (\"Only a group member or admin can check group permission on a network\");\n\t\t\t\t\n\t\t\t\tPermissions m = dao.getMembershipToNetwork(groupId, networkId);\n\t\t\t\tresult.put(networkIdStr, m.toString());\n\t\t\t\treturn result;\n\t\t\t} \n\t\t}\t\n\t\t\n\t\tboolean inclusive = true;\n\t\tPermissions permission = Permissions.READ;\n\t\tif ( permission !=null) {\n\t\t\t permission = Permissions.valueOf(permissions.toUpperCase());\n\t\t}\n\t\ttry (GroupDAO dao = new GroupDAO()){\n\t//\t\tif ( !dao.isInGroup(groupId, getLoggedInUserId()))\n\t//\t\t\tthrow new NdexException(\"User is not a member of this group.\");\n\t\t\treturn dao.getGroupNetworkPermissions(groupId, permission, skipBlocks, blockSize, getLoggedInUserId(), inclusive);\n\t\t\t//logger.info(\"[end: Getting {} networks of group {}]\", permissions, groupId);\n\t\t\t//return l;\n\t\t}\n\t}", "public static void calculatePriority(DiskInfo cacheDisks){\r\n\t\t\r\n\t\tIterator<Entry<Integer, BlockInfo>> iter = cacheDisks.getBlockList().entrySet().iterator();\r\n\t\t\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tEntry<Integer, BlockInfo> entry = iter.next();\r\n\t\t\t\r\n\t\t\tBlockInfo block = entry.getValue();\r\n\t\t\t\r\n\t\t\tif(block == null){\r\n\t\t\t\tcontinue ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(block.getIdleTime() > 0){\r\n\t\t\t\t//P = requestNum/idleTime\r\n\t\t\t\tblock.setPriority(((double)block.getRequestNum())/(block.getIdleTime()));\r\n\t\t\t} else {\r\n\t\t\t\t//P = requestNum/1.0\r\n\t\t\t\tblock.setPriority(block.getRequestNum()/1.0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcacheDisks.getBlockList().put(entry.getKey(), block);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\r\n\tpublic Collection<Net> getConsumedNets() {\r\n\t\treturn Collections.unmodifiableSet(consumed);\r\n\t}", "public XbaseGrammarAccess.OpCompareElements getOpCompareAccess() {\r\n\t\treturn gaXbase.getOpCompareAccess();\r\n\t}", "public Iterator rankOrdering(Iterator pages)\n\t{\n\t\t//Iterator allWebNode = ind.retrievePages(keyword);\n\t\tIterator allWebNode = pages;\n\t\tif(allWebNode.hasNext()){\n\t\t\tWebNode wb = (WebNode) allWebNode.next();\n\t\t\tint score = wb.getInDegree() * wb.getWordFreq(keyword);\n\t\t\twb.keywordScore = score;\n\t\t\taL.add(wb); \n\t\t}\n\t\t\n\t\twhile (allWebNode.hasNext()) {\n\t\t\tWebNode nwb = (WebNode) allWebNode.next();\n\t\t\tint nscore = nwb.getInDegree() * nwb.getWordFreq(keyword);\n\t\t\tnwb.keywordScore = nscore;\n\t\t\tint i = 0; \n\t\t\twhile(i<aL.size()){\n\t\t\t\tif (nwb.keywordScore < ((WebNode) aL.get(i)).keywordScore)\n\t\t\t \ti++;\n\t\t\t else\n\t\t\t \taL.add(i,nwb);\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn aL.iterator();\n\t}", "public void findBetterDHAvailable(List<ScanResult> allScanResults)\n {\n Map allDHAvailable = new HashMap<String, Integer>();\n\n // Put all found DH to allDHAvailable Map\n for (ScanResult scanResult : allScanResults) {\n if(scanResult.SSID.toString().contains(\"DH-\")) {\n allDHAvailable.put(scanResult.SSID,scanResult.level);\n }\n }\n\n Log.v(\"AllDH Available:\", Arrays.asList(allDHAvailable).toString());\n Logger.addRecordToLog(\"All DH available:\" + Arrays.asList(allDHAvailable).toString());\n // Find key with the maximum value from allDHAvailable\n String bestFoundSSID=\"\";\n int maxValueInMap = 0;\n try {\n maxValueInMap = (int) Collections.max(allDHAvailable.values()); // This will return max value in the Hashmap\n Iterator it = allDHAvailable.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<String, Integer> pair = (Map.Entry) it.next();\n if (pair.getValue() == maxValueInMap) {\n Log.v(\"Best Found SSID:\", pair.getKey()); // Print the key with max value\n Logger.addRecordToLog(\"Best Found SSID\"+ ',' + pair.getKey());\n bestFoundSSID = pair.getKey().toString();\n }\n }\n }\n catch (Exception e)\n {}\n // Connect to the best found network\n String pass = \"password123\";\n WifiConfiguration wc = new WifiConfiguration();\n wc.SSID = \"\\\"\" + bestFoundSSID + \"\\\"\"; //IMPORTANT! This should be in Quotes!!\n wc.preSharedKey = \"\\\"\"+ pass +\"\\\"\";\n wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);\n //wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n int res = DCService.wifi.addNetwork(wc);\n boolean b = DCService.wifi.enableNetwork(res, true);\n Log.v(DCService.TAG2, \"Connected\");\n\n }", "public SortedSet<WLightpathUnregenerated> getInOutOrTraversingLigtpaths () { return n.getAssociatedRoutes(getNet().getWdmLayer().getNe()).stream().map(ee->new WLightpathUnregenerated(ee)).collect(Collectors.toCollection(TreeSet::new)); }", "public ArrayList<Network> getMyNetworks() {\n\t\treturn myNetworks;\n\t}", "@SuppressLint(\"MissingPermission\")\n private NetworkInfo getActiveNetworkInfo(){\n ConnectivityManager connectivityManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);\n return connectivityManager == null ? null : connectivityManager.getActiveNetworkInfo();\n }", "public String[] getIntefaceNetwork() {\n\t\treturn null;\n\t}", "java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();", "@VisibleForTesting\n Stream<Host> getPrioritizedHostStream(Stream<Host> hostStream, Capabilities capabilities) {\n //TODO for the moment, we're not going to operate on the Stream that was passed in--we need to\n // alter and futz with the contents, so the stream isn't the right place to operate. This\n // will likely be optimized back into the algo, but not yet\n Set<Host> filteredHostSet = hostStream.collect(Collectors.toSet());\n\n //A \"bucket\" is a list of hosts that can use a particular browser. The \"edge\" bucket is the\n // complete list of Hosts that support \"edge\". By separating Hosts into buckets, we will\n // know which browsers have fewer nodes available for the browsers we're not interested in, and\n // can prioritize based on the browsers that have more availability\n Map<String, Set<Host>> hostBuckets = sortHostsToBucketsByBrowser(filteredHostSet);\n\n //First, check to see if all buckets are the same size. If they are, just send back the full list of hosts\n // (i.e. the hosts are all \"balanced\" with regard to browser priority)\n if (allBucketsSameSize(hostBuckets)) {\n return hostBuckets.values().stream().distinct().flatMap(Set::stream);\n }\n\n //Then, starting with the smallest bucket that isn't the current browser being prioritized,\n // remove all hosts in that bucket from consideration, then rebuild the buckets. Then do the\n // \"same size\" check again, and keep doing this until either a) there is only one bucket, or b)\n // all buckets are the same size\n\n //Note: there should never be a case where a bucket will have *more* nodes available for the\n // given browser than the one being requested. The first filter in this check looks for\n // \"equal\", not \"equal-or-greater\" as a result of this assumption\n\n //There might be unforeseen cases that challenge this assumption. TODO Create unit tests to prove it\n\n //TODO a List of Map.Entry is silly. whatever this structure needs to be needs to be returned by\n // the sortHostsToBucketsByBrowser method in a way that we don't have to sort it separately like this\n final List<Map.Entry<String, Set<Host>>> sorted = hostBuckets.entrySet().stream().sorted(\n Comparator.comparingInt(v -> v.getValue().size())\n ).collect(Collectors.toList());\n\n // Until the buckets are the same size, keep removing hosts that have more \"rare\" browser capabilities\n Map<String, Set<Host>> newHostBuckets;\n for (Map.Entry<String, Set<Host>> entry: sorted) {\n //Don't examine the bucket containing the browser in question--we're prioritizing the other browsers\n //TODO This shouldn't be necessary, because if the list is sorted by size, this won't be possible until\n // they're all the same size. Create a unit test to prove it\n if (entry.getKey().equals(capabilities.getBrowserName())) {\n continue;\n }\n\n //Remove all hosts from this bucket from the full set of eligible hosts\n final Set<Host> filteredHosts = filteredHostSet.stream().filter(host -> !entry.getValue().contains(host)).collect(Collectors.toSet());\n\n //Rebuild the buckets by browser\n newHostBuckets = sortHostsToBucketsByBrowser(filteredHosts);\n\n //Check the bucket sizes--if they're the same, then we're done\n if (allBucketsSameSize(newHostBuckets)) {\n LOG.fine(\"Hosts have been balanced according to browser priority\");\n return newHostBuckets.values().stream().distinct().flatMap(Set::stream);\n }\n }\n\n return hostBuckets.values().stream().distinct().flatMap(Set::stream);\n }", "protected Set<String> getDefaultActiveGroupIds()\n {\n Set<String> result = New.set();\n\n if (myDefaultActiveLayers != null)\n {\n result.addAll(myDefaultActiveLayers.getGroupIds());\n }\n return result;\n }", "@DISPID(1610940447) //= 0x6005001f. The runtime will prefer the VTID if present\n @VTID(53)\n OrderedGeometricalSets orderedGeometricalSets();", "public Set<User> sort(List<User> list) {\n TreeSet result = new TreeSet();\n result.addAll(list);\n\n return result;\n }", "public NetworkOrBuilder getNetworksOrBuilder(int index) {\n return networks_.get(index);\n }", "private static List<List<Integer[]>> getDIOCrossConnect() {\n List<List<Integer[]>> pairs = new ArrayList<List<Integer[]>>();\n List<Integer[]> setA =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectA1, DIOCrossConnectA2},\n {DIOCrossConnectA2, DIOCrossConnectA1}\n });\n pairs.add(setA);\n\n List<Integer[]> setB =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectB1, DIOCrossConnectB2},\n {DIOCrossConnectB2, DIOCrossConnectB1}\n });\n pairs.add(setB);\n // NOTE: IF MORE DIOCROSSCONNECT PAIRS ARE ADDED ADD THEM HERE\n return pairs;\n }", "public Map<String, Map<Point, List<Point>>> leafJoin(List<CPair> orderList, List<Map<ANode, List<ANode>>> candList, List<CPair> iniOrderList){\n\t\tMap<String, Integer> iMap = new HashMap<String, Integer>();\n\t\tfor(int i = 0;i < iniOrderList.size();i ++){\n\t\t\tCPair cpair = iniOrderList.get(i);\n\t\t\tiMap.put(cpair.id1 + \":\" + cpair.id2, i);\n\t\t}\n\t\t\n\t\t//step 2: join each edge\n\t\tMap<String, Map<Point, List<Point>>> linkMap = new HashMap<String, Map<Point, List<Point>>>();\n\t\tfor(CPair cpair:orderList){\n\t\t\tif(cpair.linkOut || mark[cpair.id1][cpair.id2]){\n\t\t\t\tString edge = cpair.id1 + \":\" + cpair.id2;\n\t\t\t\tint index = iMap.get(edge);\n\t\t\t\tMap<ANode, List<ANode>> candMap = candList.get(index);//the orders are different\n\t\t\t\tMap<Point, List<Point>> map = join(candMap, cpair);\n\t\t\t\tlinkMap.put(edge, map);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn linkMap;\n\t}" ]
[ "0.5289297", "0.5050329", "0.49313262", "0.4911239", "0.48699898", "0.48628226", "0.48495582", "0.48100194", "0.4789684", "0.4724959", "0.46920395", "0.46766546", "0.46587428", "0.46362177", "0.45575944", "0.4557288", "0.4545473", "0.45374295", "0.45198542", "0.45165217", "0.44982216", "0.44973737", "0.44769928", "0.44564438", "0.44404116", "0.44368386", "0.44239166", "0.440983", "0.43870375", "0.43809012", "0.43789858", "0.43678945", "0.43461266", "0.43358016", "0.43350956", "0.43259194", "0.4315355", "0.43095383", "0.43088242", "0.43047008", "0.42975423", "0.42933887", "0.42895576", "0.42817566", "0.42800227", "0.42753375", "0.42729568", "0.42683572", "0.42665932", "0.42642292", "0.42619404", "0.42568117", "0.4252684", "0.4228257", "0.42262554", "0.42223182", "0.4221173", "0.421516", "0.42117843", "0.42060518", "0.41979462", "0.41976264", "0.41969004", "0.41908062", "0.41872004", "0.4186209", "0.4185636", "0.418311", "0.41806173", "0.4176123", "0.4170874", "0.41690445", "0.41687712", "0.41681063", "0.41647235", "0.41616657", "0.41539934", "0.4153191", "0.41430506", "0.41426867", "0.4140407", "0.41273338", "0.41268378", "0.41256326", "0.41225034", "0.41183996", "0.41111028", "0.41100973", "0.41081786", "0.41081473", "0.41054267", "0.4105416", "0.4105009", "0.41036305", "0.41029495", "0.41025957", "0.41016883", "0.40989545", "0.40967083", "0.40951702" ]
0.47181278
10
Set the list is a prioritized set of Access Networks where the preference of using an Access Network is based on order of the list items with the lowest order list item as the most preferred Access Network.
public void setRankedANList(Collection<String> rankedANList) { this.rankedANList = rankedANList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initializeNetwork() {\n if (DataHelper.isNull(searchDTO.getNetwork())) {\n //If no Network is set we have to see which network applies for this user\n this.searchDTO.setNetwork(obtainCurrentUserNetwork());\n }\n }", "private void initializeTrustedList() {\n\n final List<WifiConfiguration> SortedConfigs = sortConfigedAPs(mWifiManager\n .getConfiguredNetworks());\n mTrustedAccessPoints = new ArrayList<TrustedAccessPoint>();\n\n if (SortedConfigs != null) {\n for (WifiConfiguration config : SortedConfigs) {\n if (config.SSID != null) {\n TrustedAccessPoint mTrustedAp = new TrustedAccessPoint(config.networkId,\n config.SSID);\n mTrustedAccessPoints.add(mTrustedAp);\n }\n }\n }\n }", "@Override\n\tpublic void init() {\n\t\tint i = 0;\n\t\tfor (Link l : this.node.getInLinks().values()) {\n\t\t\tQNetwork network = netsimEngine.getNetsimNetwork() ;\n\t\t\tthis.inLinksArrayCache[i] = network.getNetsimLinks().get(l.getId());\n\t\t\ti++;\n\t\t}\n\t\t/* As the order of links has an influence on the simulation results,\n\t\t * the nodes are sorted to avoid indeterministic simulations. dg[april08]\n\t\t */\n\t\tArrays.sort(this.inLinksArrayCache, new Comparator<NetsimLink>() {\n\t\t\t@Override\n\t\t\tpublic int compare(NetsimLink o1, NetsimLink o2) {\n\t\t\t\treturn o1.getLink().getId().compareTo(o2.getLink().getId());\n\t\t\t}\n\t\t});\n\t}", "private List<WifiConfiguration> sortConfigedAPs(List<WifiConfiguration> mconfig) {\n if (mconfig == null) {\n return null;\n }\n /* ascending sort by priority */\n Collections.sort(mconfig, new Comparator<WifiConfiguration>() {\n public int compare(WifiConfiguration a, WifiConfiguration b) {\n if (a.priority > b.priority) {\n return -1;\n } else if (a.priority < b.priority) {\n return 1;\n } else {\n return -1;\n }\n }\n });\n return mconfig;\n }", "NetworkCapabilities getNetworkCapabilities() {\n int size;\n NetworkCapabilities result = new NetworkCapabilities();\n boolean z = false;\n result.addTransportType(0);\n ArrayList<String> apnTypes = new ArrayList();\n for (ApnContext apnContext : this.mApnContexts.keySet()) {\n apnTypes.add(apnContext.getApnType());\n }\n boolean isBipNetwork = (this.mConnectionParams == null || this.mConnectionParams.mApnContext == null || this.mDct == null || !this.mDct.isBipApnType(this.mConnectionParams.mApnContext.getApnType())) ? false : true;\n if (this.mApnSetting != null) {\n ArrayList<ApnSetting> securedDunApns = this.mDct.fetchDunApns();\n String[] types = this.mApnSetting.types;\n if (enableCompatibleSimilarApnSettings()) {\n types = getCompatibleSimilarApnSettingsTypes(this.mApnSetting, this.mDct.getAllApnList());\n }\n int length = types.length;\n int i = 0;\n while (i < length) {\n String type = types[i];\n boolean shouldDropMeterApn = (this.mRestrictedNetworkOverride || this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || !ApnSetting.isMeteredApnType(type, this.mPhone)) ? z : true;\n if (!shouldDropMeterApn) {\n int hashCode = type.hashCode();\n switch (hashCode) {\n case 3023943:\n if (type.equals(\"bip0\")) {\n hashCode = 10;\n break;\n }\n case 3023944:\n if (type.equals(\"bip1\")) {\n hashCode = 11;\n break;\n }\n case 3023945:\n if (type.equals(\"bip2\")) {\n hashCode = 12;\n break;\n }\n case 3023946:\n if (type.equals(\"bip3\")) {\n hashCode = 13;\n break;\n }\n case 3023947:\n if (type.equals(\"bip4\")) {\n hashCode = 14;\n break;\n }\n case 3023948:\n if (type.equals(\"bip5\")) {\n hashCode = 15;\n break;\n }\n case 3023949:\n if (type.equals(\"bip6\")) {\n hashCode = 16;\n break;\n }\n default:\n switch (hashCode) {\n case -1490587420:\n if (type.equals(\"internaldefault\")) {\n hashCode = 18;\n break;\n }\n case 42:\n if (type.equals(CharacterSets.MIMENAME_ANY_CHARSET)) {\n hashCode = 0;\n break;\n }\n case 3352:\n if (type.equals(\"ia\")) {\n hashCode = 8;\n break;\n }\n case 98292:\n if (type.equals(\"cbs\")) {\n hashCode = 7;\n break;\n }\n case 99837:\n if (type.equals(\"dun\")) {\n hashCode = 4;\n break;\n }\n case 104399:\n if (type.equals(\"ims\")) {\n hashCode = 6;\n break;\n }\n case 108243:\n if (type.equals(\"mms\")) {\n hashCode = 2;\n break;\n }\n case 3149046:\n if (type.equals(\"fota\")) {\n hashCode = 5;\n break;\n }\n case 3541982:\n if (type.equals(\"supl\")) {\n hashCode = 3;\n break;\n }\n case 3673178:\n if (type.equals(\"xcap\")) {\n hashCode = 17;\n break;\n }\n case 1544803905:\n if (type.equals(\"default\")) {\n hashCode = 1;\n break;\n }\n case 1629013393:\n if (type.equals(\"emergency\")) {\n hashCode = 9;\n break;\n }\n }\n hashCode = -1;\n break;\n }\n switch (hashCode) {\n case 0:\n result.addCapability(12);\n result.addCapability(0);\n if (DcTracker.CT_SUPL_FEATURE_ENABLE && !apnTypes.contains(\"supl\") && this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n } else {\n result.addCapability(1);\n }\n result.addCapability(3);\n result.addCapability(4);\n result.addCapability(5);\n result.addCapability(7);\n size = securedDunApns.size();\n for (hashCode = 0; hashCode < size; hashCode++) {\n if (this.mApnSetting.equals(securedDunApns.get(hashCode))) {\n result.addCapability(2);\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n }\n }\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n case 1:\n result.addCapability(12);\n break;\n case 2:\n result.addCapability(0);\n break;\n case 3:\n if (!DcTracker.CT_SUPL_FEATURE_ENABLE || apnTypes.contains(\"supl\") || !this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n result.addCapability(1);\n break;\n }\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n break;\n break;\n case 4:\n result.addCapability(2);\n break;\n case 5:\n result.addCapability(3);\n break;\n case 6:\n result.addCapability(4);\n break;\n case 7:\n result.addCapability(5);\n break;\n case 8:\n result.addCapability(7);\n break;\n case 9:\n result.addCapability(10);\n break;\n case 10:\n result.addCapability(23);\n break;\n case 11:\n result.addCapability(24);\n break;\n case 12:\n result.addCapability(25);\n break;\n case 13:\n result.addCapability(26);\n break;\n case 14:\n result.addCapability(27);\n break;\n case 15:\n result.addCapability(28);\n break;\n case 16:\n result.addCapability(29);\n break;\n case 17:\n result.addCapability(9);\n break;\n case 18:\n result.addCapability(30);\n break;\n default:\n break;\n }\n }\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Dropped the metered \");\n stringBuilder.append(type);\n stringBuilder.append(\" for the unmetered data call.\");\n log(stringBuilder.toString());\n i++;\n z = false;\n }\n if ((this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || this.mRestrictedNetworkOverride) && this.mApnSetting.isMetered(this.mPhone)) {\n result.removeCapability(11);\n } else {\n result.addCapability(11);\n }\n z = this.mHwCustDataConnection != null && this.mHwCustDataConnection.isNeedReMakeCapability();\n if (z) {\n result = this.mHwCustDataConnection.getNetworkCapabilities(types, result, this.mApnSetting, this.mDct);\n }\n if (!isBipNetwork) {\n result.maybeMarkCapabilitiesRestricted();\n }\n }\n boolean z2 = this.mRestrictedNetworkOverride && !isBipNetwork;\n if (z2) {\n result.removeCapability(13);\n result.removeCapability(2);\n }\n int up = 14;\n int down = 14;\n size = this.mRilRat;\n if (size != 19) {\n switch (size) {\n case 1:\n up = 80;\n down = 80;\n break;\n case 2:\n up = 59;\n down = 236;\n break;\n case 3:\n up = 384;\n down = 384;\n break;\n case 4:\n case 5:\n up = 14;\n down = 14;\n break;\n case 6:\n up = 100;\n down = 100;\n break;\n case 7:\n up = 153;\n down = 2457;\n break;\n case 8:\n up = 1843;\n down = 3174;\n break;\n case 9:\n up = 2048;\n down = 14336;\n break;\n case 10:\n up = 5898;\n down = 14336;\n break;\n case 11:\n up = 5898;\n down = 14336;\n break;\n case 12:\n up = 1843;\n down = 5017;\n break;\n case 13:\n up = 153;\n down = 2516;\n break;\n case 14:\n up = 51200;\n down = 102400;\n break;\n case 15:\n up = 11264;\n down = 43008;\n break;\n }\n }\n up = 51200;\n down = 102400;\n result.setLinkUpstreamBandwidthKbps(up);\n result.setLinkDownstreamBandwidthKbps(down);\n result.setNetworkSpecifier(new StringNetworkSpecifier(Integer.toString(this.mPhone.getSubId())));\n result.setCapability(18, this.mPhone.getServiceState().getDataRoaming() ^ 1);\n result.addCapability(20);\n if ((this.mSubscriptionOverride & 1) != 0) {\n result.addCapability(11);\n }\n if ((this.mSubscriptionOverride & 2) != 0) {\n result.removeCapability(20);\n }\n return result;\n }", "private void initialiseAcronymList(ArrayList<String> pAcronymList) {\n\t\tthis.acronymList = new HashSet<String>(pAcronymList);\t\t\n\t}", "public void setMyNetworks(ArrayList<Network> myNetworks) {\n\t\tthis.myNetworks = myNetworks;\n\t}", "public int order() {\r\n\t\treturn connectionLists.size();\r\n\t}", "public void createRatingList() {\n this.ratings = List.of(kriterium1, kriterium2,\n kriterium3, kriterium4, kriterium5, kriterium6, kriterium7, kriterium8);\n }", "public void assignPageRanks(double epsilon) {\r\n\t\t// TODO : Add code here\r\n\t\tArrayList<String> vertices=internet.getVertices();\r\n\t\tList<Double> currentRank=Arrays.asList(new Double[vertices.size()]);\r\n\t\tCollections.fill(currentRank,1.0);\r\n\r\n\t\tdo{\r\n\t\t\tfor(int i=0;i<vertices.size();i++){\r\n\t\t\t\tinternet.setPageRank(vertices.get(i),currentRank.get(i));\r\n\t\t\t}\r\n\t\t\tcurrentRank=computeRanks(vertices);\r\n\t\t}while (!stopRank(epsilon,currentRank,vertices));\r\n\r\n\t}", "private void setNodeConnectionList(ArrayList<Pair<String, Integer>> nodeConnectionList)\n\t{\n\t\totherNodes = nodeConnectionList; // set this field.\n\t}", "public java.util.List<Network> getNetworksList() {\n return networks_;\n }", "public Iterator getNetworkList(){\n NeutronTest nt=new NeutronTest(this.idsEndpoint,this.tenantName,this.userName,this.password,this.region);\n Networks ns=nt.listNetworks();\n Iterator<Network> itNet=ns.iterator();\n return itNet;\n }", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public Set<User> sort(List<User> list) {\n TreeSet result = new TreeSet();\n result.addAll(list);\n\n return result;\n }", "public void setList(Node in_adjacentcyList[]){\n adjacentcyList = in_adjacentcyList;\n }", "public void setSkuCompareList(List pSkuCompareList) {\n mSkuCompareList = pSkuCompareList;\n }", "public void setTypeBoundList(List<Access> list) {\n setChild(list, 2);\n }", "ManagePool(List DefaultList,List AllocList)\r\n\t{\r\n\t\tthis.DefaultList = DefaultList;\r\n\t\tthis.AllocList = AllocList;\r\n\t}", "public ListSet() {\n lists = new TernarySearchTree<>();\n }", "@Nullable\r\n List<Network> getNetwork();", "@Test\n\tpublic void testDefinitionPriority() {\n\n\t\tthis.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setAccept(MediaType.HTML);\n\n\t\tthis.requestDefinitions.get(1).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(1).setContentType(MediaType.HTML);\n\t\tthis.requestDefinitions.get(1).setAccept(MediaType.UNKNOWN);\n\n\t\tthis.requestDefinitions.get(2).setHttpMethod(HttpMethod.GET);\n\t\tthis.requestDefinitions.get(2).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(2).setAccept(MediaType.UNKNOWN);\n\n\t\tfinal List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(2),\n\t\t\t\tthis.requestDefinitions.get(1), this.requestDefinitions.get(0));\n\n\t\tCollections.sort(this.requestDefinitions, this.comparator);\n\t\tAssert.assertEquals(expected, this.requestDefinitions);\n\t}", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public static void calculatePriority(DiskInfo cacheDisks){\r\n\t\t\r\n\t\tIterator<Entry<Integer, BlockInfo>> iter = cacheDisks.getBlockList().entrySet().iterator();\r\n\t\t\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tEntry<Integer, BlockInfo> entry = iter.next();\r\n\t\t\t\r\n\t\t\tBlockInfo block = entry.getValue();\r\n\t\t\t\r\n\t\t\tif(block == null){\r\n\t\t\t\tcontinue ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(block.getIdleTime() > 0){\r\n\t\t\t\t//P = requestNum/idleTime\r\n\t\t\t\tblock.setPriority(((double)block.getRequestNum())/(block.getIdleTime()));\r\n\t\t\t} else {\r\n\t\t\t\t//P = requestNum/1.0\r\n\t\t\t\tblock.setPriority(block.getRequestNum()/1.0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcacheDisks.getBlockList().put(entry.getKey(), block);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public Clan findSmallestDefaultClan() {\n\t\tList<Clan> defaultClans = clans.stream().filter(c -> c.getID().equals(DEFAULT_CLAN_ID)).collect(Collectors.toList());\n\n\t\tdefaultClans.sort((c1, c2) -> c1.getMembers().size() - c2.getMembers().size());\n\n\t\treturn defaultClans.get(0);\n\t}", "@Test\n public void testSet_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 1, 1, 1, 1);\n instance.addAll(c);\n\n instance.set(2, 9);\n\n List<Integer> expResult = Arrays.asList(1, 1, 9, 1, 1, 1, 1);\n\n assertTrue(isEqual(expResult, instance));\n\n }", "public Collection<String> getRankedANList() {\n\t\tif (this.rankedANList == null){ this.rankedANList=new ArrayList<>();}\n\t\treturn rankedANList;\n\t}", "public VMAllocationPolicyRandom(List<? extends Host> list) {\n super(list);\n }", "public void setImportance(ArrayList<DefaultActivity> scheduleList) {\n for (DefaultActivity i : scheduleList) {\n getKeyWords(i);\n i.setUrgencyFactor(getUrgencyRating(i));\n i.setEnjoymentFactor(getEnjoymentFactor(i));\n if (!i.getTypeSwitch()) {\n i.setSubjectValue(getSubjectValue(i));\n }\n }\n for (DefaultActivity i : scheduleList) {\n i.setProficiencyFactor(getProficiency(i));\n i.setImportanceValue(getImportance(i));\n }\n }", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "public void alphabetize() {\n\t\t// write you code for alphabetize using the specifications above\n\t\tif (numElements==0){\n\t\t\treturn;\n\t\t}\n\t\tNode nodref = head;\n\t\tNode nodref1 = head.next;\n\t\tint count = 0;\n\t\tboolean x1 = false;\n\t\t\n\t\twhile(nodref!=null){\n\t\t\tnodref1=nodref.next;\n\t\t\tx1 = false;\n\t\t\twhile(nodref1!=null){\n\t\t\t\tint boo = nodref.data.compareTo(nodref1.data);\n\t\t\t\tSystem.out.println(this + \"\\n\" + nodref + \" \" + nodref1+ \" \" + boo +\"\\n\");\n\t\t\t\t\n\t\t\t\tif (boo>0){\n\t\t\t\t\tthis.add(nodref1.data);\n\t\t\t\t\tnumElements--;\n\t\t\t\t\tNode x = head;\n\t\t\t\t\tfor(int counter=0; counter<=count; counter++){\n\t\t\t\t\t\tx=x.next;\n\t\t\t\t\t}\n\t\t\t\t\tnodref.next = nodref.next.next;\n\t\t\t\t\tx1 = true;\n\t\t\t\t}\n\t\t\t\tnodref1 = nodref1.next;\n\t\t\t}\n\t\t\tSystem.out.println(count + \" \" + head + \" \" + x1);\n\t\t\tcount++;\n\t\t\tif(x1!=true){\n\t\t\t\tnodref = nodref.next;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnodref = head;\n\t\t}\n\t}", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork();", "private void setPreferredNetworkType(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.setPreferredNetworkType(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.setPreferredNetworkType(int):void\");\n }", "public static final void setWhitelist(final WhiteList listType, final String list) {\n setWhitelist(p(), listType, list);\n }", "public java.util.List<Network> getNetworksList() {\n if (networksBuilder_ == null) {\n return java.util.Collections.unmodifiableList(networks_);\n } else {\n return networksBuilder_.getMessageList();\n }\n }", "public void orderList(ArrayList<DefaultActivity> scheduleList) {\n\n }", "public void setListNodes (ArrayList<Node> list){\r\n this.listNodes = list;\r\n }", "private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }", "public void setPublicIpAddressSet(NatGatewayAddress [] PublicIpAddressSet) {\n this.PublicIpAddressSet = PublicIpAddressSet;\n }", "public void updateNetwork(double infectionChance) {\n\t\tSet<Integer> ids = idToPersons.keySet();\n\t\tList<Integer> list = new ArrayList<Integer>(ids);\n\t\tCollections.shuffle(list);\n\t\tfor (int id : list) {\n\t\t\tidToPersons.get(id).updateState(infectionChance);\n\t\t} \n\t\t//states = getState();\n\t}", "private void initList() {\n\n\t\tfor (int i = 0; i < lstPool.size(); i++) {\n\t\t\tpoolList.add(createPool(\"nomPool\", lstPool.get(i).getNomPool()));\n\t\t}\n\t}", "public NetworksSchema network(List<NetworksSchemaNetwork> network) {\n this.network = network;\n return this;\n }", "interface List extends Follow {\n @Out Network[] networks();\n\n /**\n * Sets the maximum number of networks to return. If not specified all the networks are returned.\n */\n @In Integer max();\n\n /**\n * A query string used to restrict the returned networks.\n */\n @In String search();\n\n /**\n * Indicates if the search performed using the `search` parameter should be performed taking case into\n * account. The default value is `true`, which means that case is taken into account. If you want to search\n * ignoring case set it to `false`.\n */\n @In Boolean caseSensitive();\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork(\n @QueryMap ListNetwork queryParameters);", "public ArrayList<String> alwaysPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.topRankDecs()>=2){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "public MutableNodeSet(Graph graph) {\n\t\tsuper(graph);\n\t\tthis.members = new TreeSet<Integer>();\n\t\tinitializeInOutWeights();\n\t}", "public void setProductCompareList(List pProductCompareList) {\n mProductCompareList = pProductCompareList;\n }", "public void setUpList(List upList) {\n\t\tthis.upList = upList;\n\t}", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "public List<AccessRequestStatusItem> getAccessRequestStatusExternal() {\n List sortedList = new ArrayList(getAccessRequestStatus());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n return networks_;\n }", "private void updateAccessPoints() {\n // Safeguard from some delayed event handling\n if (getActivity() == null) return;\n\n final int wifiState = mWifiManager.getWifiState();\n\n switch (wifiState) {\n case WifiManager.WIFI_STATE_ENABLED:\n // AccessPoints are automatically sorted with TreeSet.\n final Collection<AccessPoint> accessPoints = constructAccessPoints();\n getPreferenceScreen().removeAll();\n for (AccessPoint accessPoint : accessPoints) {\n getPreferenceScreen().addPreference(accessPoint);\n }\n break;\n case WifiManager.WIFI_STATE_ENABLING:\n getPreferenceScreen().removeAll();\n break;\n }\n }", "Map<String, Integer> sortByinlinks(Map<String, Integer> inlinks_sort){\n\tList<Map.Entry<String,Integer>> ranklist = new LinkedList<Map.Entry<String,Integer>>(inlinks_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Integer>>(){\n\t\tpublic int compare(Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2){\n\t\t\treturn o2.getValue().compareTo(o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Integer> sortedRank = new LinkedHashMap<String,Integer>();\n\tfor(Map.Entry<String, Integer> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "@Test\n public void shouldListNetworks() {\n assertFalse(NetworkResolver.getParameters().isEmpty());\n assertFalse(NetworkResolver.getNames().isEmpty());\n assertFalse(NetworkResolver.getCodes().isEmpty());\n }", "public void sort10(){\r\n\t\tArrayList<wifi> temp = new ArrayList<>();\r\n\t\tfor(int i=0; i<wifis.size() && i<10; i++)\r\n\t\t\ttemp.add(wifis.get(i));\r\n\t\twifis = temp;\r\n\t}", "public void testUpdateUserDefinedSortWithOnlyTwoElementsInList()\n\t{\n\t\t// arrange\n\t\tUri listUri = helper.insertNewList(\"testlist\");\n\t\tlong listId = Integer.parseInt(listUri.getPathSegments().get(1));\n\n\t\tlong[] categoryIds = new long[5];\n\t\tUri categoryUri = helper.insertNewCategory(listId, \"dudus\", 1);\n\t\tcategoryIds[0] = Integer.parseInt(categoryUri.getPathSegments().get(1));\n\t\tcategoryUri = helper.insertNewCategory(listId, \"dudus\", 2);\n\t\tcategoryIds[1] = Integer.parseInt(categoryUri.getPathSegments().get(1));\n\n\t\t// Act & Assert\n\t\t// This test updates the sort order of category from 2 to 1 (0-based)\n\t\tservice.updateUserDefinedSort(listId, categoryIds[1], 1, 0);\n\n\t\tlong[] expectedCategoryIds = new long[2];\n\t\texpectedCategoryIds[0] = categoryIds[1];\n\t\texpectedCategoryIds[1] = categoryIds[0];\n\n\t\t// now get all categories for activity\n\t\tCursor categoriesToBeUpdatedCursor = dataProvider.query(CategoryColumns.CONTENT_URI,\n\t\t\t\tCATEGORY_PROJECTION, CategoryColumns.ACTIVITY_ID + \" = \" + listId, null,\n\t\t\t\tCategoryColumns.SORT_POSITION);\n\n\t\tcategoriesToBeUpdatedCursor.moveToFirst();\n\t\twhile (!categoriesToBeUpdatedCursor.isAfterLast())\n\t\t{\n\t\t\tlong catId = categoriesToBeUpdatedCursor.getLong(categoriesToBeUpdatedCursor\n\t\t\t\t\t.getColumnIndex(CategoryColumns._ID));\n\n\t\t\tint position = categoriesToBeUpdatedCursor.getInt(categoriesToBeUpdatedCursor\n\t\t\t\t\t.getColumnIndex(CategoryColumns.SORT_POSITION));\n\n\t\t\tassertEquals(expectedCategoryIds[position - 1], catId);\n\t\t\tcategoriesToBeUpdatedCursor.moveToNext();\n\t\t}\n\t}", "public void sortByRating() {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating\");\n\n listInteractor.sortByRating(new ListCallback() {\n @Override\n public void setPhotosList(List<BasePojo.Result> photosList) {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating - setPhotosList\");\n\n getViewState().setData(photosList);\n }\n });\n }", "private void refreshNodeList() {\n if (UnderNet.router.status.equals(InterfaceStatus.STARTED)) {\n //Using connected and cached nodes if the router has started.\n ArrayList<Node> nodesToList = UnderNet.router.getConnectedNodes();\n for (Node cachedNode :\n EntryNodeCache.cachedNodes) {\n boolean canAdd = true;\n for (Node connectedNode : UnderNet.router.getConnectedNodes()) {\n if (cachedNode.getAddress().equals(connectedNode.getAddress())) {\n canAdd = false;\n }\n }\n if (canAdd) {\n nodesToList.add(cachedNode);\n }\n }\n nodeList.setListData(nodesToList.toArray());\n } else {\n //Using cached nodes if the router isn't online.\n nodeList.setListData(EntryNodeCache.cachedNodes.toArray());\n }\n }", "@Override\n public void sortList() {\n if (null != entityList) {\n Collections.sort(entityList, new Comparator<Country>() {\n @Override\n public int compare(Country c1, Country c2) {\n return c1.getCountryName().compareTo(c2.getCountryName());\n }\n });\n }\n }", "private void connectToRandomNodes(List<String> randomList) {\n wasSuccessful = true;\n attempts = 0;\n for (ListIterator<String> randomListIterator = randomList.listIterator(); randomListIterator.hasNext(); ) {\n String currentRecord = randomListIterator.next();\n NodeRecord currentNode = registeredNodes.get(currentRecord);\n while (currentNode.getConnectionsNeededToInitiate() > 0) {\n if (attempts < 15) {\n int randomConnection = ThreadLocalRandom.current().nextInt(0, registeredNodes.size());\n String randomKey = randomList.get(randomConnection);\n NodeRecord randomNode = registeredNodes.get(randomKey);\n\n if(currentNode.equals(randomNode) || currentNode.getNodesToConnectToList().contains(randomNode)\n || randomNode.getNodesToConnectToList().contains(currentNode)\n || randomNode.getNumberOfConnections() == requiredConnections) {\n ++attempts;\n //do not add and pick again\n } else {\n currentNode.addNodeToConnectTo(randomNode);\n updateConnections(currentNode, randomNode);\n attempts = 0;\n }\n } else {\n wasSuccessful = false;\n break;\n }\n }\n// currentNode.printNodesList();\n }\n }", "public static void setOrderIdsInCache(List<Long> orderIdList,String networkCode){ \t\n\t\t\n\t\tString key=DFP_ORDER_ID_KEY+\"_\"+networkCode;\n\t\tlog.info(\"setOrderIdsInCache : memcache key:\"+key);\t\n\t\tif(memcache !=null && memcache.contains(key)){\n \t\tmemcache.delete(key);\n \t}\n \tmemcache.put(key, orderIdList);\n\t}", "public Network() {\n\t\tnodes.put(\"192.168.0.0\", new NetNode(\"192.168.0.0\"));\n\t\tnodes.put(\"192.168.0.1\", new NetNode(\"192.168.0.1\"));\n\t\tnodes.put(\"192.168.0.2\", new NetNode(\"192.168.0.2\"));\n\t\tnodes.put(\"192.168.0.3\", new NetNode(\"192.168.0.3\"));\n\t\tnodes.put(\"192.168.0.4\", new NetNode(\"192.168.0.4\"));\n\t\t//manually entering ports\n\t\t//0 to 1 and 2\n\t\tnodes.get(\"192.168.0.0\").addPort(nodes.get(\"192.168.0.1\"));\n\t\tnodes.get(\"192.168.0.0\").addPort(nodes.get(\"192.168.0.2\"));\n\t\t//1 to 0 and 3\n\t\tnodes.get(\"192.168.0.1\").addPort(nodes.get(\"192.168.0.0\"));\n\t\tnodes.get(\"192.168.0.1\").addPort(nodes.get(\"192.168.0.3\"));\n\t\t//2 to 0 and 3 and 4\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.0\"));\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.3\"));\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.4\"));\n\t\t//3 to 1 and 2 and 4\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.1\"));\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.2\"));\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.4\"));\n\t\t//4 to 2 and 3\n\t\tnodes.get(\"192.168.0.4\").addPort(nodes.get(\"192.168.0.2\"));\n\t\tnodes.get(\"192.168.0.4\").addPort(nodes.get(\"192.168.0.3\"));\n\t}", "@Test\n public void testNetworkMetric() {\n MetricValue mv = new MetricValue.Builder().load(10).add();\n\n Set<String> set = ImmutableSet.of(\"eth0\", \"eth1\");\n\n set.forEach(network -> NETWORK_METRICS.forEach(cmt ->\n testUpdateMetricWithResource(cmt, mv, network)));\n\n set.forEach(network -> NETWORK_METRICS.forEach(cmt ->\n testLoadMetricWithResource(nodeId, cmt, mv, network)));\n }", "public PowerVmAllocationPolicySimple(List<? extends PowerHost> list) {\n\t\tsuper(list);\n\t}", "private static void printRanking(List<Instruction> list,final String settlementType) {\n\t\tfinal Map<String, Double> entityMap = new HashMap<>();\n\t\tfor(Instruction instruction : list) {\n\t\t\tif(entityMap.get(instruction.getEntity())!=null) {\n\t\t\t\t//if multiple trades happened for same entity \n\t\t\t\tentityMap.put(instruction.getEntity(),(entityMap.get(instruction.getEntity()) + instruction.getTotalAmount()));\n\t\t\t}else {\n\t\t\t\tentityMap.put(instruction.getEntity(), instruction.getTotalAmount());\n\t\t\t}\n\t\t}\n\t\t// sort entity map based on TotoalAmount\n\t\tfinal Map<String, Double> sortedMap = entityMap.entrySet().stream()\n\t\t.sorted(Map.Entry.<String,Double>comparingByValue().reversed())\n\t\t.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, HashMap<String,Double>::new));\n\t\t\n\t\tSystem.out.println(settlementType +\" Ranking :\\n\");\n\t\tSet<String> keySet = sortedMap.keySet();\n\t\tint rank = 1;\n\t\tfor(String key : keySet) {\n\t\t\tSystem.out.println(key +\" - \"+ rank++);\n\t\t}\n\t}", "List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}", "public void createOnlyLBPolicy(){\n\t\t\n\t\tIterator<CacheObject> ican = cacheList.iterator();\n\t\t\n\t\tint objcounter = 0;\n\t\t\n\t\twhile(ican.hasNext() && objcounter < (OBJ_FOR_REQ)){\n\t\t\t\n\t\t\tobjcounter ++;\n\t\t\tCacheObject tempCacheObject = ican.next();\n\t\t\tIterator<ASServer> itm = manager.getASServers().values().iterator();\n\t\t\twhile(itm.hasNext()){\n\t\t\t\t\n\t\t\t\tASServer as = itm.next();\n\t\t\t\tif(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey) == null){\n\t\t\t\t\t//System.out.println(\"Mapping Map is NULL\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tArrayList<String> urllist = new ArrayList<String>(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey));\n\t\t\t\tIterator<String> iurl = urllist.iterator();\n\t\t\t\twhile(iurl.hasNext()){\n\t\t\t\t\tString url = iurl.next();\n\t\t\t\t\tif(!urlList.contains(url)){\n\t\t\t\t\t\turlList.add(url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tint urlcounter = 0;\n\t\tint urllistsize = urlList.size();\n\t\tCollection<String> it1 = serverList.keySet();\n\t\tArrayList<String> server = new ArrayList<String>(it1);\n\t\t\n\t\twhile(urlcounter < urllistsize){\n\t\t\t\n\t\t\tString serId = server.get( (urlcounter) % NO_SERVERS );\n\t\t\tthis.currentLBPolicy.mapUrlToServers(urlList.get(urlcounter++), Analyser.resolveHost(serId));\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"------------LBPolicy start---------------\");\n//\t\tSystem.out.println(currentLBPolicy);\n//\t\t\n\t\tSystem.out.println(\"Number of entries in LBPolicy are: \" + currentLBPolicy.policyMap.size() );\n//\t\n\t\tSystem.out.println(\"------------LBPolicy end-----------------\");\n\t\t/*\n\t\tif(mLogger.isInfoEnabled()){\n\t\t\tmLogger.log(Priority.INFO, \"LBPolicy being printed\");\n\t\tmLogger.log(Priority.INFO, \":\" + this.currentLBPolicy);\n\t\t\n\t}\n\t\t*/\n\t}", "@Test\n\tpublic void defaultNetworkIsTestNetworkByDefault() {\n\t\t// Assert:\n\t\tAssert.assertThat(\n\t\t\t\tNetworkInfos.getDefault(),\n\t\t\t\tIsSame.sameInstance(NetworkInfos.getTestNetworkInfo()));\n\t}", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n if (networksBuilder_ != null) {\n return networksBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(networks_);\n }\n }", "public List<NetworkNode> listNetworkNode();", "public ArrayList<String> alwaysLessPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.lessPop()){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "@Override\n\tpublic void urlDecisionSetDefaultAttributes() {\n\t\t// TODO Add default attributes for decisions related to URL access\n\n\t}", "public void setIpList(String [] IpList) {\n this.IpList = IpList;\n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "@Override\n protected void set(java.util.Collection<org.tair.db.locusdetail.IPolymorphismSite> list) {\n polymorphismSite = list;\n // Add the primary keys to the serialized key list if there are any.\n if (polymorphismSite != null) {\n for (com.poesys.db.dto.IDbDto object : polymorphismSite) {\n polymorphismSiteKeys.add(object.getPrimaryKey());\n }\n }\n }", "private static void resetConfigTemplateVlanNetworkMaping(List<ConfigTemplate> cft){\n\t\tfor(ConfigTemplate cf: cft) {\r\n\t\t\tif (!cf.getConfigType().isTypeSupport(ConfigTemplateType.ROUTER)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tSet<ConfigTemplateVlanNetwork> cvnSet = new HashSet<ConfigTemplateVlanNetwork>();\r\n\t\t\tif (AhRestoreNewMapTools.getMapWlanNetworkObjectVlan(cf.getId())!=null) {\r\n\t\t\t\tcvnSet.add(AhRestoreNewMapTools.getMapWlanNetworkObjectVlan(cf.getId()));\r\n\t\t\t}\r\n\t\t\tSet<Long> upIdSet = new HashSet<Long>();\r\n\t\t\tfor(ConfigTemplateSsid cs: cf.getSsidInterfaces().values()){\r\n\t\t\t\tif (cs.getSsidProfile()!=null) {\r\n\t\t\t\t\tSsidProfile ss = QueryUtil.findBoById(SsidProfile.class, cs.getSsidProfile().getId(), new ImplQueryBoVlanNetwork());\r\n\t\t\t\t\tif (ss.getUserProfileDefault()!=null) {\r\n\t\t\t\t\t\tupIdSet.add(ss.getUserProfileDefault().getId());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (ss.getUserProfileSelfReg()!=null) {\r\n\t\t\t\t\t\tupIdSet.add(ss.getUserProfileSelfReg().getId());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (ss.getRadiusUserProfile()!=null) {\r\n\t\t\t\t\t\tfor(UserProfile up: ss.getRadiusUserProfile()){\r\n\t\t\t\t\t\t\tupIdSet.add(up.getId());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (PortGroupProfile portGroup : cf.getPortProfiles()) {\r\n\t\t\t List<PortBasicProfile> basicProfiles = portGroup.getBasicProfiles();\r\n\t\t\t if(null != basicProfiles) {\r\n\t\t\t for (PortBasicProfile portBasicProfile : basicProfiles) {\r\n\t\t\t if(null != portBasicProfile.getAccessProfile()) {\r\n\t\t\t PortAccessProfile access = QueryUtil.findBoById(PortAccessProfile.class, portBasicProfile.getAccessProfile().getId(), new ImplQueryBoVlanNetwork());\r\n if(access.getPortType() == PortAccessProfile.PORT_TYPE_8021Q) {\r\n // handle the trunk mode - Network <-> VLAN\r\n if(null != access.getNativeVlan()) {\r\n Long lanId = AhRestoreNewMapTools.getMapLanProfileReverse(access.getId());\r\n if(null != lanId) {\r\n Map<Long, Long> vlanObjNetwork = AhRestoreNewMapTools.getMapLANVLANObjectNetwork(lanId);\r\n if(null != vlanObjNetwork) {\r\n for (Long vlanId : vlanObjNetwork.keySet()) {\r\n Long networkId = vlanObjNetwork.get(vlanId);\r\n\r\n if(null != networkId && null != vlanId) {\r\n VpnNetwork networkObj = AhRestoreNewTools.CreateBoWithId(VpnNetwork.class,networkId);\r\n Vlan vlanObj = AhRestoreNewTools.CreateBoWithId(Vlan.class,vlanId);\r\n\r\n if(networkObj!=null && vlanObj!=null) {\r\n ConfigTemplateVlanNetwork cvn = new ConfigTemplateVlanNetwork();\r\n cvn.setNetworkObj(networkObj);\r\n cvn.setVlan(vlanObj);\r\n cvnSet.add(cvn);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n // handle the access mode\r\n if(null != access.getDefUserProfile()) {\r\n upIdSet.add(access.getDefUserProfile().getId());\r\n }\r\n if(null != access.getSelfRegUserProfile()) {\r\n upIdSet.add(access.getSelfRegUserProfile().getId());\r\n }\r\n if (null != access.getAuthOkUserProfile()) {\r\n for (UserProfile up : access.getAuthOkUserProfile()) {\r\n upIdSet.add(up.getId());\r\n }\r\n }\r\n }\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t }\r\n }\r\n\r\n\t\t\tfor(Long upId : upIdSet){\r\n\t\t\t\tLong networkId = AhRestoreNewMapTools.getMapUserProfileNetworkObjectWithNewID(upId);\r\n\t\t\t\tLong vlanId = null;\r\n\t\t\t\tif (networkId!=null) {\r\n\t\t\t\t\tvlanId = AhRestoreNewMapTools.getMapNetworkObjectVlanWithNewID(networkId);\r\n\t\t\t\t}\r\n\t\t\t\tVpnNetwork networkObj = AhRestoreNewTools.CreateBoWithId(VpnNetwork.class,networkId);\r\n\t\t\t\tVlan vlanObj = null;\r\n\t\t\t\tif(vlanId!=null) {\r\n\t\t\t\t\tvlanObj = AhRestoreNewTools.CreateBoWithId(Vlan.class,vlanId);\r\n\t\t\t\t}\r\n\t\t\t\tif(networkObj!=null && vlanObj!=null) {\r\n\t\t\t\t\tConfigTemplateVlanNetwork cvn = new ConfigTemplateVlanNetwork();\r\n\t\t\t\t\tcvn.setNetworkObj(networkObj);\r\n\t\t\t\t\tcvn.setVlan(vlanObj);\r\n\t\t\t\t\tcvnSet.add(cvn);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!cvnSet.isEmpty()) {\r\n\t\t\t\tif (cf.getVlanNetwork()==null) {\r\n\t\t\t\t\tList<ConfigTemplateVlanNetwork> myList = new ArrayList<ConfigTemplateVlanNetwork>();\r\n\t\t\t\t\tcf.setVlanNetwork(myList);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcf.getVlanNetwork().clear();\r\n\t\t\t\t}\r\n\t\t\t\tcf.getVlanNetwork().addAll(cvnSet);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setVoteOrder() {\n\t\tfor (int i = 1; i < temp.size(); i++) {\n\t\t\t// deleting the comma from the name\n\t\t\tString s = temp.elementAt(i).replaceAll(\",\", \"\");\n\t\t\t// creating a vector \"tempVoteOrder\" to store the preferences of\n\t\t\t// each voter\n=======\n\t\t\tCandidats.add(candidat);\n\t\t\ttempCandidats = tempCandidats.replaceFirst(\n\t\t\t\t\ttempCandidats.substring(0, tempCandidats.indexOf(\",\") + 1),\n\t\t\t\t\t\"\");// delete the first candidat in the String\n\t\t}\n\t\tfor (int j = 0; j < Candidats.size(); j++)\n\t\t\tCandidats.elementAt(j).setVowsPerRound(Candidats.size());// fill the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// vector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// size\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"candidats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0's\n\t}", "public static void sortByPopular(){\n SORT_ORDER = POPULAR_PATH;\n }", "private void initiate(Node start) {\n\t\t\tfor (Node node : network.nodes.values()){\r\n\t \r\n\t \t\tdouble nodeCost;\r\n\t if(node.getId() == start.getId()){\r\n\t \tnodeCost = 0.;\r\n\t }\r\n\t else{\r\n\t \tnodeCost = Double.MAX_VALUE;\r\n\t }\r\n\t DijkstraNode dijk = new DijkstraNode(node, nodeCost);\r\n\t this.remainingNodes.add(dijk);\r\n\t this.correspondingNodes.put(node, dijk);\r\n\t }\r\n\t \tCollections.sort(this.remainingNodes);\r\n//\t \tSystem.out.println(\"remainingNodes.size = \" + remainingNodes.size());\r\n\t }", "public void createDistributedObjectsPolicy(){\n\t\t\n\t\tint size = 0;\n\t\t\n\t\tIterator<CacheObject> cst = candidateStableOnlyList.iterator();\n\t\t\n\t\twhile(cst.hasNext()){\n\t\t\t\n\t\t\tCacheObject ct = cst.next();\n\t\t\t\n\t\t\tIterator<String> it1 = serverList.keySet().iterator();\n\t\t\t\n\t\t\twhile(it1.hasNext()){\n\t\t\t\t\n\t\t\t\tString serverId = it1.next();\n\t\t\t\tHashMap<String, CacheObject> htemp = individualMap.get(serverId); \n\t\t\t\t\n\t\t\t\tif(htemp.containsKey(ct.cacheKey)){\n\t\t\t\t\t\n\t\t\t\t\tInteger sz = serverList.get(serverId);\n\t\t\t\t\t\n\t\t\t\t\tif(sz.intValue() < STABLE_SIZE){\n\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\tlt.add(serverId);\n\t\t\t\t\t\tRuleList rl = new RuleList(serverId, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\tASPolicyMap.get(serverId).addNewPolicy(lk, rl);\n\t\t\t\t\t\tsz = sz + ct.size;\n\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\tserverList.put(serverId, sz);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tIterator<String> it2 = serverList.keySet().iterator();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(it2.hasNext()){\n\t\t\t\t\t\t\tString serverId2 = it2.next();\n\t\t\t\t\t\t\tInteger sz2 = serverList.get(serverId2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sz2.intValue() < STABLE_SIZE){\n\t\t\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\t\t\tlt.add(serverId2);\n\t\t\t\t\t\t\t\tRuleList rl = new RuleList(serverId2, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\t\t\tASPolicyMap.get(serverId2).addNewPolicy(lk, rl);\n\t\t\t\t\t\t\t\tsz2 = sz2 + ct.size;\n\t\t\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\t\t\tserverList.put(serverId2, sz2);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(size >= (STABLE_SIZE*NO_SERVERS) ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void categoriseNodes(final CyNetwork result, final Set<CyNode> leftSet,\n\t\t\t\t final Set<CyNode> rightSet)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig1 = new HashSet<CyNode>(network1.nodesList());\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig2 = new HashSet<CyNode>(network2.nodesList());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal List<CyNode> resultNodes = (List<CyNode>)result.nodesList();\n\t\t\n\t\tfinal CyAttributes nodeAttr = Cytoscape.getNodeAttributes();\n\t\t\n\t\tfor (final CyNode node : resultNodes) {\n\t\t\tfinal boolean inNetwork1 = orig1.contains(node);\n\t\t\tfinal boolean inNetwork2 = orig2.contains(node);\n\t\t\t\n\t\t\tif (inNetwork1 && inNetwork2)\n\t\t\t\t/* Do Nothing. */;\n\t\t\telse if (inNetwork1 && !inNetwork2) {\n\t\t\t\tleftSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network1.getTitle());\n\t\t\t} else if (!inNetwork1 && inNetwork2) {\n\t\t\t\trightSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network2.getTitle());\n\t\t\t} else // This should never happen!\n\t\t\t\tthrow new IllegalStateException(\"Do not know how to categorise a node!\");\n\t\t}\n\t}", "public Request sechdule1(ArrayList<Request> requestList) {\n\t\treturn null;\n\t}", "public void ranking(ArrayList<Player> list) {\r\n\t\tCollections.sort(list, new Comparator<Player>(){\r\n\t\t\tpublic int compare(Player a1, Player a2) {\r\n\t\t\t\tint a = a2.getPercent()-a1.getPercent(); \r\n\t\t\t\treturn a==0?a1.getUserName().compareTo(a2.getUserName()):a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile(aa.hasNext()){\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tin.showRanking();\r\n\t\t}\r\n\t}", "public void findBetterDHAvailable(List<ScanResult> allScanResults)\n {\n Map allDHAvailable = new HashMap<String, Integer>();\n\n // Put all found DH to allDHAvailable Map\n for (ScanResult scanResult : allScanResults) {\n if(scanResult.SSID.toString().contains(\"DH-\")) {\n allDHAvailable.put(scanResult.SSID,scanResult.level);\n }\n }\n\n Log.v(\"AllDH Available:\", Arrays.asList(allDHAvailable).toString());\n Logger.addRecordToLog(\"All DH available:\" + Arrays.asList(allDHAvailable).toString());\n // Find key with the maximum value from allDHAvailable\n String bestFoundSSID=\"\";\n int maxValueInMap = 0;\n try {\n maxValueInMap = (int) Collections.max(allDHAvailable.values()); // This will return max value in the Hashmap\n Iterator it = allDHAvailable.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<String, Integer> pair = (Map.Entry) it.next();\n if (pair.getValue() == maxValueInMap) {\n Log.v(\"Best Found SSID:\", pair.getKey()); // Print the key with max value\n Logger.addRecordToLog(\"Best Found SSID\"+ ',' + pair.getKey());\n bestFoundSSID = pair.getKey().toString();\n }\n }\n }\n catch (Exception e)\n {}\n // Connect to the best found network\n String pass = \"password123\";\n WifiConfiguration wc = new WifiConfiguration();\n wc.SSID = \"\\\"\" + bestFoundSSID + \"\\\"\"; //IMPORTANT! This should be in Quotes!!\n wc.preSharedKey = \"\\\"\"+ pass +\"\\\"\";\n wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);\n //wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n int res = DCService.wifi.addNetwork(wc);\n boolean b = DCService.wifi.enableNetwork(res, true);\n Log.v(DCService.TAG2, \"Connected\");\n\n }", "public void setSocialNetwork(int value) {\n this.socialNetwork = value;\n }", "public PowerVmAllocationPolicyAbstract(List<? extends Host> list) {\n\t\tsuper(list);\n\t}", "@NonNull\n @RequiresFeature(PackageManager.FEATURE_IPSEC_TUNNELS)\n public Builder restrictToTestNetworks() {\n mIsRestrictedToTestNetworks = true;\n return this;\n }", "public RBACwithCommonNodes(){\n\t\tvalues = new Hashtable<Integer,Hashtable<Object, Integer>>();\n\t\tint[] order = {1,4,2,5,3};\n\t\tauthGraph = new DirectedGraph(order);\n\t}", "private void createAllApnList() {\n allApns = new ArrayList<ApnSetting>();\n String operator = phone.mSIMRecords.getSIMOperatorNumeric();\n\n if (operator != null) {\n String selection = \"numeric = '\" + operator + \"'\";\n\n Cursor cursor = phone.getContext().getContentResolver().query(\n Telephony.Carriers.CONTENT_URI, null, selection, null, null);\n\n if (cursor != null) {\n if (cursor.getCount() > 0) {\n allApns = createApnList(cursor);\n // TODO: Figure out where this fits in. This basically just \n // writes the pap-secrets file. No longer tied to PdpConnection\n // object. Not used on current platform (no ppp).\n //PdpConnection pdp = pdpList.get(pdp_name);\n //if (pdp != null && pdp.dataLink != null) {\n // pdp.dataLink.setPasswordInfo(cursor);\n //}\n }\n cursor.close();\n }\n }\n\n if (allApns.isEmpty()) {\n if (DBG) log(\"No APN found for carrier: \" + operator);\n notifyNoData(PdpConnection.PdpFailCause.BAD_APN);\n }\n }", "public List getSkuCompareList() {\n return mSkuCompareList;\n }", "public static ProbNet prioritize(ProbNet probNet, Variable decisionVariable) {\n\t\tProbNet prioritizedNetwork = probNet.copy();\n\t\ttry {\n\t\t\tList<Node> nextDecisions = getNextDecisions(prioritizedNetwork);\n\t\t\tVariable priorVariable = prioritizedNetwork.getVariable(decisionVariable.getName());\n\n\t\t\tfor (Node decisionNode : nextDecisions) {\n\t\t\t\tVariable nextDecisionVariable = decisionNode.getVariable();\n\t\t\t\tif (nextDecisionVariable != priorVariable) {\n\t\t\t\t\tprioritizedNetwork.addLink(priorVariable, nextDecisionVariable, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (NodeNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn prioritizedNetwork;\n\t}", "public void setReviewList(List<Review> reviewList) {\n this.reviewList = reviewList;\n notifyDataSetChanged();\n }", "private void OrderPips(ArrayList<Pip> PipsOfInterest) {\n\t\tPip i0 = PipsOfInterest.get(0);\n Pip i1=null,i2=null,i3=null; \n\t\t\n\t\tfor(Pip P : PipsOfInterest){\n\t\t\tif(!P.getRowBit().equals(i0.getRowBit()) && !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip With no Matchings Bits to be i3\n i3 = P; \t\n\t\t\t} else if(P.getRowBit().equals(i0.getRowBit()) || !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti1 = P; \n\t\t\t} else if(!P.getRowBit().equals(i0.getRowBit()) || P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti2 = P; \n\t\t\t} \n\t\t}\t\n\t\t\n\t\tif(i0 == null || i1 == null || i2 == null || i3 == null){\n\t\t\tSystem.out.println(\"Error: i0, i1, i2, i3 not set\" + i0 + \" \" + i1 + \" \" + i2 + \" \" + i3);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//Arrange the Pips into the ArrayList\n PipsOfInterest.set(0, i0);\n PipsOfInterest.set(1, i1);\n PipsOfInterest.set(2, i2);\n PipsOfInterest.set(3, i3);\n\t}", "public Network getNetwork() {\r\n \t\treturn network;\r\n \t}", "@Override public Set<Integer> allowedLayers() {\n Set<Integer> layers = new HashSet<>(first.allowedLayers());\n layers.retainAll(next.allowedLayers());\n return layers;\n }", "public static Network createLessSymmetricTestNetwork() {\n\t\t/*\n\t\t * (2)\t\t(5)------(8)\n\t\t * \t|\t\t |\n\t\t * \t|\t\t |\n\t\t * (1)------(4)------(7)\n\t\t * \t|\t\t |\n\t\t * \t|\t\t |\n\t\t * (3)\t\t(6)------(9)\n\t\t */\n\t\tdouble freespeed = 2.7;\n\t\tdouble capacity = 500.;\n\t\tdouble numLanes = 1.;\n\n\t\tMutableScenario scenario = (MutableScenario) ScenarioUtils.createScenario(ConfigUtils.createConfig());\n\n\t\tNetwork network = (Network) scenario.getNetwork();\n\n\t\t// Nodes\n\t\tNode node1 = NetworkUtils.createAndAddNode(network, Id.create(1, Node.class), new Coord((double) 10, (double) 100));\n\t\tNode node2 = NetworkUtils.createAndAddNode(network, Id.create(2, Node.class), new Coord((double) 10, (double) 190));\n\t\tNode node3 = NetworkUtils.createAndAddNode(network, Id.create(3, Node.class), new Coord((double) 10, (double) 10));\n\t\tNode node4 = NetworkUtils.createAndAddNode(network, Id.create(4, Node.class), new Coord((double) 120, (double) 100));\n\t\tNode node5 = NetworkUtils.createAndAddNode(network, Id.create(5, Node.class), new Coord((double) 120, (double) 190));\n\t\tNode node6 = NetworkUtils.createAndAddNode(network, Id.create(6, Node.class), new Coord((double) 120, (double) 10));\n\t\tNode node7 = NetworkUtils.createAndAddNode(network, Id.create(7, Node.class), new Coord((double) 190, (double) 100));\n\t\tNode node8 = NetworkUtils.createAndAddNode(network, Id.create(8, Node.class), new Coord((double) 190, (double) 190));\n\t\tNode node9 = NetworkUtils.createAndAddNode(network, Id.create(9, Node.class), new Coord((double) 190, (double) 10));\n\n\t\tSet<String> modes = new HashSet<>();\n\t\tmodes.add(\"car\");\n\n\t\t// Links (bi-directional)\n\t\tNetworkUtils.createAndAddLink(network,Id.create(1, Link.class), node1, node2, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(1, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(2, Link.class), node2, node1, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(2, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(3, Link.class), node1, node3, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(3, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(4, Link.class), node3, node1, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(4, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(5, Link.class), node1, node4, (double) 110, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(5, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(6, Link.class), node4, node1, (double) 110, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(6, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(7, Link.class), node4, node5, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(7, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(8, Link.class), node5, node4, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(8, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(9, Link.class), node4, node6, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(9, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(10, Link.class), node6, node4, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(10, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(11, Link.class), node4, node7, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(11, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(12, Link.class), node7, node4, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(12, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(13, Link.class), node5, node8, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(13, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(14, Link.class), node8, node5, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(14, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(15, Link.class), node6, node9, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(15, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(16, Link.class), node9, node6, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(16, Link.class)).setAllowedModes(modes);\n\n\t\treturn network;\n\t}", "public void set(@NonNull NetworkCapabilities nc) {\n mNetworkCapabilities = nc.mNetworkCapabilities;\n mTransportTypes = nc.mTransportTypes;\n mLinkUpBandwidthKbps = nc.mLinkUpBandwidthKbps;\n mLinkDownBandwidthKbps = nc.mLinkDownBandwidthKbps;\n mNetworkSpecifier = nc.mNetworkSpecifier;\n mTransportInfo = nc.mTransportInfo;\n mSignalStrength = nc.mSignalStrength;\n setUids(nc.mUids); // Will make the defensive copy\n mEstablishingVpnAppUid = nc.mEstablishingVpnAppUid;\n mUnwantedNetworkCapabilities = nc.mUnwantedNetworkCapabilities;\n mSSID = nc.mSSID;\n }", "public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }" ]
[ "0.5123806", "0.5024981", "0.48273867", "0.4804583", "0.4797867", "0.4758366", "0.47429663", "0.4711693", "0.47045255", "0.46788922", "0.46471107", "0.46300533", "0.45847794", "0.45779625", "0.457776", "0.45462814", "0.45239228", "0.4512515", "0.45102718", "0.449178", "0.44789934", "0.44679573", "0.44400814", "0.4430956", "0.44251826", "0.44207776", "0.4409656", "0.43856338", "0.43831953", "0.4382351", "0.43813014", "0.43790397", "0.43628109", "0.4357577", "0.43388388", "0.4332677", "0.43154454", "0.43065378", "0.4303236", "0.42953178", "0.42944488", "0.42924532", "0.42897522", "0.42886764", "0.42861238", "0.42756358", "0.42694923", "0.42687607", "0.4268229", "0.42641705", "0.42620164", "0.42612323", "0.4258562", "0.42467624", "0.4242716", "0.42323783", "0.42312402", "0.4229254", "0.42286572", "0.42246556", "0.4216756", "0.4213012", "0.42127454", "0.42088383", "0.420693", "0.4206484", "0.4198503", "0.41966575", "0.41962698", "0.41937408", "0.4193374", "0.41901597", "0.41896647", "0.41860324", "0.41822907", "0.4181953", "0.41804132", "0.41800633", "0.41747057", "0.4173553", "0.41720665", "0.41714984", "0.4167042", "0.41645604", "0.41633314", "0.41622618", "0.4161485", "0.4157978", "0.4154096", "0.41514415", "0.41396278", "0.41372994", "0.41361168", "0.4130295", "0.41212443", "0.4121062", "0.4120632", "0.41175514", "0.41133392", "0.4108731" ]
0.47300407
7
Set the list is a prioritized set of Access Networks where the preference of using an Access Network is based on order of the list items with the lowest order list item as the most preferred Access Network.
public RequestCategory withRankedANList(String string) { getRankedANList().add(string); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void initializeNetwork() {\n if (DataHelper.isNull(searchDTO.getNetwork())) {\n //If no Network is set we have to see which network applies for this user\n this.searchDTO.setNetwork(obtainCurrentUserNetwork());\n }\n }", "private void initializeTrustedList() {\n\n final List<WifiConfiguration> SortedConfigs = sortConfigedAPs(mWifiManager\n .getConfiguredNetworks());\n mTrustedAccessPoints = new ArrayList<TrustedAccessPoint>();\n\n if (SortedConfigs != null) {\n for (WifiConfiguration config : SortedConfigs) {\n if (config.SSID != null) {\n TrustedAccessPoint mTrustedAp = new TrustedAccessPoint(config.networkId,\n config.SSID);\n mTrustedAccessPoints.add(mTrustedAp);\n }\n }\n }\n }", "@Override\n\tpublic void init() {\n\t\tint i = 0;\n\t\tfor (Link l : this.node.getInLinks().values()) {\n\t\t\tQNetwork network = netsimEngine.getNetsimNetwork() ;\n\t\t\tthis.inLinksArrayCache[i] = network.getNetsimLinks().get(l.getId());\n\t\t\ti++;\n\t\t}\n\t\t/* As the order of links has an influence on the simulation results,\n\t\t * the nodes are sorted to avoid indeterministic simulations. dg[april08]\n\t\t */\n\t\tArrays.sort(this.inLinksArrayCache, new Comparator<NetsimLink>() {\n\t\t\t@Override\n\t\t\tpublic int compare(NetsimLink o1, NetsimLink o2) {\n\t\t\t\treturn o1.getLink().getId().compareTo(o2.getLink().getId());\n\t\t\t}\n\t\t});\n\t}", "private List<WifiConfiguration> sortConfigedAPs(List<WifiConfiguration> mconfig) {\n if (mconfig == null) {\n return null;\n }\n /* ascending sort by priority */\n Collections.sort(mconfig, new Comparator<WifiConfiguration>() {\n public int compare(WifiConfiguration a, WifiConfiguration b) {\n if (a.priority > b.priority) {\n return -1;\n } else if (a.priority < b.priority) {\n return 1;\n } else {\n return -1;\n }\n }\n });\n return mconfig;\n }", "NetworkCapabilities getNetworkCapabilities() {\n int size;\n NetworkCapabilities result = new NetworkCapabilities();\n boolean z = false;\n result.addTransportType(0);\n ArrayList<String> apnTypes = new ArrayList();\n for (ApnContext apnContext : this.mApnContexts.keySet()) {\n apnTypes.add(apnContext.getApnType());\n }\n boolean isBipNetwork = (this.mConnectionParams == null || this.mConnectionParams.mApnContext == null || this.mDct == null || !this.mDct.isBipApnType(this.mConnectionParams.mApnContext.getApnType())) ? false : true;\n if (this.mApnSetting != null) {\n ArrayList<ApnSetting> securedDunApns = this.mDct.fetchDunApns();\n String[] types = this.mApnSetting.types;\n if (enableCompatibleSimilarApnSettings()) {\n types = getCompatibleSimilarApnSettingsTypes(this.mApnSetting, this.mDct.getAllApnList());\n }\n int length = types.length;\n int i = 0;\n while (i < length) {\n String type = types[i];\n boolean shouldDropMeterApn = (this.mRestrictedNetworkOverride || this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || !ApnSetting.isMeteredApnType(type, this.mPhone)) ? z : true;\n if (!shouldDropMeterApn) {\n int hashCode = type.hashCode();\n switch (hashCode) {\n case 3023943:\n if (type.equals(\"bip0\")) {\n hashCode = 10;\n break;\n }\n case 3023944:\n if (type.equals(\"bip1\")) {\n hashCode = 11;\n break;\n }\n case 3023945:\n if (type.equals(\"bip2\")) {\n hashCode = 12;\n break;\n }\n case 3023946:\n if (type.equals(\"bip3\")) {\n hashCode = 13;\n break;\n }\n case 3023947:\n if (type.equals(\"bip4\")) {\n hashCode = 14;\n break;\n }\n case 3023948:\n if (type.equals(\"bip5\")) {\n hashCode = 15;\n break;\n }\n case 3023949:\n if (type.equals(\"bip6\")) {\n hashCode = 16;\n break;\n }\n default:\n switch (hashCode) {\n case -1490587420:\n if (type.equals(\"internaldefault\")) {\n hashCode = 18;\n break;\n }\n case 42:\n if (type.equals(CharacterSets.MIMENAME_ANY_CHARSET)) {\n hashCode = 0;\n break;\n }\n case 3352:\n if (type.equals(\"ia\")) {\n hashCode = 8;\n break;\n }\n case 98292:\n if (type.equals(\"cbs\")) {\n hashCode = 7;\n break;\n }\n case 99837:\n if (type.equals(\"dun\")) {\n hashCode = 4;\n break;\n }\n case 104399:\n if (type.equals(\"ims\")) {\n hashCode = 6;\n break;\n }\n case 108243:\n if (type.equals(\"mms\")) {\n hashCode = 2;\n break;\n }\n case 3149046:\n if (type.equals(\"fota\")) {\n hashCode = 5;\n break;\n }\n case 3541982:\n if (type.equals(\"supl\")) {\n hashCode = 3;\n break;\n }\n case 3673178:\n if (type.equals(\"xcap\")) {\n hashCode = 17;\n break;\n }\n case 1544803905:\n if (type.equals(\"default\")) {\n hashCode = 1;\n break;\n }\n case 1629013393:\n if (type.equals(\"emergency\")) {\n hashCode = 9;\n break;\n }\n }\n hashCode = -1;\n break;\n }\n switch (hashCode) {\n case 0:\n result.addCapability(12);\n result.addCapability(0);\n if (DcTracker.CT_SUPL_FEATURE_ENABLE && !apnTypes.contains(\"supl\") && this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n } else {\n result.addCapability(1);\n }\n result.addCapability(3);\n result.addCapability(4);\n result.addCapability(5);\n result.addCapability(7);\n size = securedDunApns.size();\n for (hashCode = 0; hashCode < size; hashCode++) {\n if (this.mApnSetting.equals(securedDunApns.get(hashCode))) {\n result.addCapability(2);\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n }\n }\n result.addCapability(23);\n result.addCapability(24);\n result.addCapability(25);\n result.addCapability(26);\n result.addCapability(27);\n result.addCapability(28);\n result.addCapability(29);\n result.addCapability(9);\n result.addCapability(30);\n break;\n case 1:\n result.addCapability(12);\n break;\n case 2:\n result.addCapability(0);\n break;\n case 3:\n if (!DcTracker.CT_SUPL_FEATURE_ENABLE || apnTypes.contains(\"supl\") || !this.mDct.isCTSimCard(this.mPhone.getSubId())) {\n result.addCapability(1);\n break;\n }\n log(\"ct supl feature enabled and apncontex didn't contain supl, didn't add supl capability\");\n break;\n break;\n case 4:\n result.addCapability(2);\n break;\n case 5:\n result.addCapability(3);\n break;\n case 6:\n result.addCapability(4);\n break;\n case 7:\n result.addCapability(5);\n break;\n case 8:\n result.addCapability(7);\n break;\n case 9:\n result.addCapability(10);\n break;\n case 10:\n result.addCapability(23);\n break;\n case 11:\n result.addCapability(24);\n break;\n case 12:\n result.addCapability(25);\n break;\n case 13:\n result.addCapability(26);\n break;\n case 14:\n result.addCapability(27);\n break;\n case 15:\n result.addCapability(28);\n break;\n case 16:\n result.addCapability(29);\n break;\n case 17:\n result.addCapability(9);\n break;\n case 18:\n result.addCapability(30);\n break;\n default:\n break;\n }\n }\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Dropped the metered \");\n stringBuilder.append(type);\n stringBuilder.append(\" for the unmetered data call.\");\n log(stringBuilder.toString());\n i++;\n z = false;\n }\n if ((this.mConnectionParams == null || !this.mConnectionParams.mUnmeteredUseOnly || this.mRestrictedNetworkOverride) && this.mApnSetting.isMetered(this.mPhone)) {\n result.removeCapability(11);\n } else {\n result.addCapability(11);\n }\n z = this.mHwCustDataConnection != null && this.mHwCustDataConnection.isNeedReMakeCapability();\n if (z) {\n result = this.mHwCustDataConnection.getNetworkCapabilities(types, result, this.mApnSetting, this.mDct);\n }\n if (!isBipNetwork) {\n result.maybeMarkCapabilitiesRestricted();\n }\n }\n boolean z2 = this.mRestrictedNetworkOverride && !isBipNetwork;\n if (z2) {\n result.removeCapability(13);\n result.removeCapability(2);\n }\n int up = 14;\n int down = 14;\n size = this.mRilRat;\n if (size != 19) {\n switch (size) {\n case 1:\n up = 80;\n down = 80;\n break;\n case 2:\n up = 59;\n down = 236;\n break;\n case 3:\n up = 384;\n down = 384;\n break;\n case 4:\n case 5:\n up = 14;\n down = 14;\n break;\n case 6:\n up = 100;\n down = 100;\n break;\n case 7:\n up = 153;\n down = 2457;\n break;\n case 8:\n up = 1843;\n down = 3174;\n break;\n case 9:\n up = 2048;\n down = 14336;\n break;\n case 10:\n up = 5898;\n down = 14336;\n break;\n case 11:\n up = 5898;\n down = 14336;\n break;\n case 12:\n up = 1843;\n down = 5017;\n break;\n case 13:\n up = 153;\n down = 2516;\n break;\n case 14:\n up = 51200;\n down = 102400;\n break;\n case 15:\n up = 11264;\n down = 43008;\n break;\n }\n }\n up = 51200;\n down = 102400;\n result.setLinkUpstreamBandwidthKbps(up);\n result.setLinkDownstreamBandwidthKbps(down);\n result.setNetworkSpecifier(new StringNetworkSpecifier(Integer.toString(this.mPhone.getSubId())));\n result.setCapability(18, this.mPhone.getServiceState().getDataRoaming() ^ 1);\n result.addCapability(20);\n if ((this.mSubscriptionOverride & 1) != 0) {\n result.addCapability(11);\n }\n if ((this.mSubscriptionOverride & 2) != 0) {\n result.removeCapability(20);\n }\n return result;\n }", "private void initialiseAcronymList(ArrayList<String> pAcronymList) {\n\t\tthis.acronymList = new HashSet<String>(pAcronymList);\t\t\n\t}", "public void setMyNetworks(ArrayList<Network> myNetworks) {\n\t\tthis.myNetworks = myNetworks;\n\t}", "public void setRankedANList(Collection<String> rankedANList) {\n\t\tthis.rankedANList = rankedANList;\n\t}", "public int order() {\r\n\t\treturn connectionLists.size();\r\n\t}", "public void createRatingList() {\n this.ratings = List.of(kriterium1, kriterium2,\n kriterium3, kriterium4, kriterium5, kriterium6, kriterium7, kriterium8);\n }", "public void assignPageRanks(double epsilon) {\r\n\t\t// TODO : Add code here\r\n\t\tArrayList<String> vertices=internet.getVertices();\r\n\t\tList<Double> currentRank=Arrays.asList(new Double[vertices.size()]);\r\n\t\tCollections.fill(currentRank,1.0);\r\n\r\n\t\tdo{\r\n\t\t\tfor(int i=0;i<vertices.size();i++){\r\n\t\t\t\tinternet.setPageRank(vertices.get(i),currentRank.get(i));\r\n\t\t\t}\r\n\t\t\tcurrentRank=computeRanks(vertices);\r\n\t\t}while (!stopRank(epsilon,currentRank,vertices));\r\n\r\n\t}", "private void setNodeConnectionList(ArrayList<Pair<String, Integer>> nodeConnectionList)\n\t{\n\t\totherNodes = nodeConnectionList; // set this field.\n\t}", "public java.util.List<Network> getNetworksList() {\n return networks_;\n }", "public Iterator getNetworkList(){\n NeutronTest nt=new NeutronTest(this.idsEndpoint,this.tenantName,this.userName,this.password,this.region);\n Networks ns=nt.listNetworks();\n Iterator<Network> itNet=ns.iterator();\n return itNet;\n }", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public Set<User> sort(List<User> list) {\n TreeSet result = new TreeSet();\n result.addAll(list);\n\n return result;\n }", "public void setList(Node in_adjacentcyList[]){\n adjacentcyList = in_adjacentcyList;\n }", "public void setSkuCompareList(List pSkuCompareList) {\n mSkuCompareList = pSkuCompareList;\n }", "public void setTypeBoundList(List<Access> list) {\n setChild(list, 2);\n }", "ManagePool(List DefaultList,List AllocList)\r\n\t{\r\n\t\tthis.DefaultList = DefaultList;\r\n\t\tthis.AllocList = AllocList;\r\n\t}", "public ListSet() {\n lists = new TernarySearchTree<>();\n }", "@Nullable\r\n List<Network> getNetwork();", "@Test\n\tpublic void testDefinitionPriority() {\n\n\t\tthis.requestDefinitions.get(0).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(0).setAccept(MediaType.HTML);\n\n\t\tthis.requestDefinitions.get(1).setHttpMethod(HttpMethod.UNKNOWN);\n\t\tthis.requestDefinitions.get(1).setContentType(MediaType.HTML);\n\t\tthis.requestDefinitions.get(1).setAccept(MediaType.UNKNOWN);\n\n\t\tthis.requestDefinitions.get(2).setHttpMethod(HttpMethod.GET);\n\t\tthis.requestDefinitions.get(2).setContentType(MediaType.UNKNOWN);\n\t\tthis.requestDefinitions.get(2).setAccept(MediaType.UNKNOWN);\n\n\t\tfinal List<RequestDefinition> expected = Arrays.asList(this.requestDefinitions.get(2),\n\t\t\t\tthis.requestDefinitions.get(1), this.requestDefinitions.get(0));\n\n\t\tCollections.sort(this.requestDefinitions, this.comparator);\n\t\tAssert.assertEquals(expected, this.requestDefinitions);\n\t}", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public static void calculatePriority(DiskInfo cacheDisks){\r\n\t\t\r\n\t\tIterator<Entry<Integer, BlockInfo>> iter = cacheDisks.getBlockList().entrySet().iterator();\r\n\t\t\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tEntry<Integer, BlockInfo> entry = iter.next();\r\n\t\t\t\r\n\t\t\tBlockInfo block = entry.getValue();\r\n\t\t\t\r\n\t\t\tif(block == null){\r\n\t\t\t\tcontinue ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(block.getIdleTime() > 0){\r\n\t\t\t\t//P = requestNum/idleTime\r\n\t\t\t\tblock.setPriority(((double)block.getRequestNum())/(block.getIdleTime()));\r\n\t\t\t} else {\r\n\t\t\t\t//P = requestNum/1.0\r\n\t\t\t\tblock.setPriority(block.getRequestNum()/1.0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcacheDisks.getBlockList().put(entry.getKey(), block);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public Clan findSmallestDefaultClan() {\n\t\tList<Clan> defaultClans = clans.stream().filter(c -> c.getID().equals(DEFAULT_CLAN_ID)).collect(Collectors.toList());\n\n\t\tdefaultClans.sort((c1, c2) -> c1.getMembers().size() - c2.getMembers().size());\n\n\t\treturn defaultClans.get(0);\n\t}", "@Test\n public void testSet_Order() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 1, 1, 1, 1);\n instance.addAll(c);\n\n instance.set(2, 9);\n\n List<Integer> expResult = Arrays.asList(1, 1, 9, 1, 1, 1, 1);\n\n assertTrue(isEqual(expResult, instance));\n\n }", "public Collection<String> getRankedANList() {\n\t\tif (this.rankedANList == null){ this.rankedANList=new ArrayList<>();}\n\t\treturn rankedANList;\n\t}", "public VMAllocationPolicyRandom(List<? extends Host> list) {\n super(list);\n }", "public void setImportance(ArrayList<DefaultActivity> scheduleList) {\n for (DefaultActivity i : scheduleList) {\n getKeyWords(i);\n i.setUrgencyFactor(getUrgencyRating(i));\n i.setEnjoymentFactor(getEnjoymentFactor(i));\n if (!i.getTypeSwitch()) {\n i.setSubjectValue(getSubjectValue(i));\n }\n }\n for (DefaultActivity i : scheduleList) {\n i.setProficiencyFactor(getProficiency(i));\n i.setImportanceValue(getImportance(i));\n }\n }", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "public void alphabetize() {\n\t\t// write you code for alphabetize using the specifications above\n\t\tif (numElements==0){\n\t\t\treturn;\n\t\t}\n\t\tNode nodref = head;\n\t\tNode nodref1 = head.next;\n\t\tint count = 0;\n\t\tboolean x1 = false;\n\t\t\n\t\twhile(nodref!=null){\n\t\t\tnodref1=nodref.next;\n\t\t\tx1 = false;\n\t\t\twhile(nodref1!=null){\n\t\t\t\tint boo = nodref.data.compareTo(nodref1.data);\n\t\t\t\tSystem.out.println(this + \"\\n\" + nodref + \" \" + nodref1+ \" \" + boo +\"\\n\");\n\t\t\t\t\n\t\t\t\tif (boo>0){\n\t\t\t\t\tthis.add(nodref1.data);\n\t\t\t\t\tnumElements--;\n\t\t\t\t\tNode x = head;\n\t\t\t\t\tfor(int counter=0; counter<=count; counter++){\n\t\t\t\t\t\tx=x.next;\n\t\t\t\t\t}\n\t\t\t\t\tnodref.next = nodref.next.next;\n\t\t\t\t\tx1 = true;\n\t\t\t\t}\n\t\t\t\tnodref1 = nodref1.next;\n\t\t\t}\n\t\t\tSystem.out.println(count + \" \" + head + \" \" + x1);\n\t\t\tcount++;\n\t\t\tif(x1!=true){\n\t\t\t\tnodref = nodref.next;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnodref = head;\n\t\t}\n\t}", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork();", "private void setPreferredNetworkType(int r1) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.setPreferredNetworkType(int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.setPreferredNetworkType(int):void\");\n }", "public static final void setWhitelist(final WhiteList listType, final String list) {\n setWhitelist(p(), listType, list);\n }", "public java.util.List<Network> getNetworksList() {\n if (networksBuilder_ == null) {\n return java.util.Collections.unmodifiableList(networks_);\n } else {\n return networksBuilder_.getMessageList();\n }\n }", "public void orderList(ArrayList<DefaultActivity> scheduleList) {\n\n }", "public void setListNodes (ArrayList<Node> list){\r\n this.listNodes = list;\r\n }", "private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }", "public void setPublicIpAddressSet(NatGatewayAddress [] PublicIpAddressSet) {\n this.PublicIpAddressSet = PublicIpAddressSet;\n }", "public void updateNetwork(double infectionChance) {\n\t\tSet<Integer> ids = idToPersons.keySet();\n\t\tList<Integer> list = new ArrayList<Integer>(ids);\n\t\tCollections.shuffle(list);\n\t\tfor (int id : list) {\n\t\t\tidToPersons.get(id).updateState(infectionChance);\n\t\t} \n\t\t//states = getState();\n\t}", "private void initList() {\n\n\t\tfor (int i = 0; i < lstPool.size(); i++) {\n\t\t\tpoolList.add(createPool(\"nomPool\", lstPool.get(i).getNomPool()));\n\t\t}\n\t}", "public NetworksSchema network(List<NetworksSchemaNetwork> network) {\n this.network = network;\n return this;\n }", "interface List extends Follow {\n @Out Network[] networks();\n\n /**\n * Sets the maximum number of networks to return. If not specified all the networks are returned.\n */\n @In Integer max();\n\n /**\n * A query string used to restrict the returned networks.\n */\n @In String search();\n\n /**\n * Indicates if the search performed using the `search` parameter should be performed taking case into\n * account. The default value is `true`, which means that case is taken into account. If you want to search\n * ignoring case set it to `false`.\n */\n @In Boolean caseSensitive();\n }", "@HTTP(\n method = \"GET\",\n path = \"/apis/config.openshift.io/v1/networks\"\n )\n @Headers({ \n \"Accept: */*\"\n })\n KubernetesListCall<NetworkList, Network> listNetwork(\n @QueryMap ListNetwork queryParameters);", "public ArrayList<String> alwaysPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.topRankDecs()>=2){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "public void setProductCompareList(List pProductCompareList) {\n mProductCompareList = pProductCompareList;\n }", "public MutableNodeSet(Graph graph) {\n\t\tsuper(graph);\n\t\tthis.members = new TreeSet<Integer>();\n\t\tinitializeInOutWeights();\n\t}", "public void setUpList(List upList) {\n\t\tthis.upList = upList;\n\t}", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n return networks_;\n }", "public List<AccessRequestStatusItem> getAccessRequestStatusExternal() {\n List sortedList = new ArrayList(getAccessRequestStatus());\n Collections.sort(sortedList);\n return Collections.unmodifiableList(sortedList);\n }", "private void updateAccessPoints() {\n // Safeguard from some delayed event handling\n if (getActivity() == null) return;\n\n final int wifiState = mWifiManager.getWifiState();\n\n switch (wifiState) {\n case WifiManager.WIFI_STATE_ENABLED:\n // AccessPoints are automatically sorted with TreeSet.\n final Collection<AccessPoint> accessPoints = constructAccessPoints();\n getPreferenceScreen().removeAll();\n for (AccessPoint accessPoint : accessPoints) {\n getPreferenceScreen().addPreference(accessPoint);\n }\n break;\n case WifiManager.WIFI_STATE_ENABLING:\n getPreferenceScreen().removeAll();\n break;\n }\n }", "Map<String, Integer> sortByinlinks(Map<String, Integer> inlinks_sort){\n\tList<Map.Entry<String,Integer>> ranklist = new LinkedList<Map.Entry<String,Integer>>(inlinks_sort.entrySet());\n\tCollections.sort(ranklist, new Comparator<Map.Entry<String, Integer>>(){\n\t\tpublic int compare(Map.Entry<String,Integer> o1, Map.Entry<String,Integer> o2){\n\t\t\treturn o2.getValue().compareTo(o1.getValue() );\n\t\t}\n\t});\n\t\n\tMap<String, Integer> sortedRank = new LinkedHashMap<String,Integer>();\n\tfor(Map.Entry<String, Integer> rank : ranklist){\n\t\tsortedRank.put(rank.getKey(), rank.getValue());\t\t\t\n\t}\n\t\n\treturn sortedRank;\n\t}", "@Test\n public void shouldListNetworks() {\n assertFalse(NetworkResolver.getParameters().isEmpty());\n assertFalse(NetworkResolver.getNames().isEmpty());\n assertFalse(NetworkResolver.getCodes().isEmpty());\n }", "public void testUpdateUserDefinedSortWithOnlyTwoElementsInList()\n\t{\n\t\t// arrange\n\t\tUri listUri = helper.insertNewList(\"testlist\");\n\t\tlong listId = Integer.parseInt(listUri.getPathSegments().get(1));\n\n\t\tlong[] categoryIds = new long[5];\n\t\tUri categoryUri = helper.insertNewCategory(listId, \"dudus\", 1);\n\t\tcategoryIds[0] = Integer.parseInt(categoryUri.getPathSegments().get(1));\n\t\tcategoryUri = helper.insertNewCategory(listId, \"dudus\", 2);\n\t\tcategoryIds[1] = Integer.parseInt(categoryUri.getPathSegments().get(1));\n\n\t\t// Act & Assert\n\t\t// This test updates the sort order of category from 2 to 1 (0-based)\n\t\tservice.updateUserDefinedSort(listId, categoryIds[1], 1, 0);\n\n\t\tlong[] expectedCategoryIds = new long[2];\n\t\texpectedCategoryIds[0] = categoryIds[1];\n\t\texpectedCategoryIds[1] = categoryIds[0];\n\n\t\t// now get all categories for activity\n\t\tCursor categoriesToBeUpdatedCursor = dataProvider.query(CategoryColumns.CONTENT_URI,\n\t\t\t\tCATEGORY_PROJECTION, CategoryColumns.ACTIVITY_ID + \" = \" + listId, null,\n\t\t\t\tCategoryColumns.SORT_POSITION);\n\n\t\tcategoriesToBeUpdatedCursor.moveToFirst();\n\t\twhile (!categoriesToBeUpdatedCursor.isAfterLast())\n\t\t{\n\t\t\tlong catId = categoriesToBeUpdatedCursor.getLong(categoriesToBeUpdatedCursor\n\t\t\t\t\t.getColumnIndex(CategoryColumns._ID));\n\n\t\t\tint position = categoriesToBeUpdatedCursor.getInt(categoriesToBeUpdatedCursor\n\t\t\t\t\t.getColumnIndex(CategoryColumns.SORT_POSITION));\n\n\t\t\tassertEquals(expectedCategoryIds[position - 1], catId);\n\t\t\tcategoriesToBeUpdatedCursor.moveToNext();\n\t\t}\n\t}", "public void sort10(){\r\n\t\tArrayList<wifi> temp = new ArrayList<>();\r\n\t\tfor(int i=0; i<wifis.size() && i<10; i++)\r\n\t\t\ttemp.add(wifis.get(i));\r\n\t\twifis = temp;\r\n\t}", "private void refreshNodeList() {\n if (UnderNet.router.status.equals(InterfaceStatus.STARTED)) {\n //Using connected and cached nodes if the router has started.\n ArrayList<Node> nodesToList = UnderNet.router.getConnectedNodes();\n for (Node cachedNode :\n EntryNodeCache.cachedNodes) {\n boolean canAdd = true;\n for (Node connectedNode : UnderNet.router.getConnectedNodes()) {\n if (cachedNode.getAddress().equals(connectedNode.getAddress())) {\n canAdd = false;\n }\n }\n if (canAdd) {\n nodesToList.add(cachedNode);\n }\n }\n nodeList.setListData(nodesToList.toArray());\n } else {\n //Using cached nodes if the router isn't online.\n nodeList.setListData(EntryNodeCache.cachedNodes.toArray());\n }\n }", "public void sortByRating() {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating\");\n\n listInteractor.sortByRating(new ListCallback() {\n @Override\n public void setPhotosList(List<BasePojo.Result> photosList) {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating - setPhotosList\");\n\n getViewState().setData(photosList);\n }\n });\n }", "@Override\n public void sortList() {\n if (null != entityList) {\n Collections.sort(entityList, new Comparator<Country>() {\n @Override\n public int compare(Country c1, Country c2) {\n return c1.getCountryName().compareTo(c2.getCountryName());\n }\n });\n }\n }", "private void connectToRandomNodes(List<String> randomList) {\n wasSuccessful = true;\n attempts = 0;\n for (ListIterator<String> randomListIterator = randomList.listIterator(); randomListIterator.hasNext(); ) {\n String currentRecord = randomListIterator.next();\n NodeRecord currentNode = registeredNodes.get(currentRecord);\n while (currentNode.getConnectionsNeededToInitiate() > 0) {\n if (attempts < 15) {\n int randomConnection = ThreadLocalRandom.current().nextInt(0, registeredNodes.size());\n String randomKey = randomList.get(randomConnection);\n NodeRecord randomNode = registeredNodes.get(randomKey);\n\n if(currentNode.equals(randomNode) || currentNode.getNodesToConnectToList().contains(randomNode)\n || randomNode.getNodesToConnectToList().contains(currentNode)\n || randomNode.getNumberOfConnections() == requiredConnections) {\n ++attempts;\n //do not add and pick again\n } else {\n currentNode.addNodeToConnectTo(randomNode);\n updateConnections(currentNode, randomNode);\n attempts = 0;\n }\n } else {\n wasSuccessful = false;\n break;\n }\n }\n// currentNode.printNodesList();\n }\n }", "public static void setOrderIdsInCache(List<Long> orderIdList,String networkCode){ \t\n\t\t\n\t\tString key=DFP_ORDER_ID_KEY+\"_\"+networkCode;\n\t\tlog.info(\"setOrderIdsInCache : memcache key:\"+key);\t\n\t\tif(memcache !=null && memcache.contains(key)){\n \t\tmemcache.delete(key);\n \t}\n \tmemcache.put(key, orderIdList);\n\t}", "public Network() {\n\t\tnodes.put(\"192.168.0.0\", new NetNode(\"192.168.0.0\"));\n\t\tnodes.put(\"192.168.0.1\", new NetNode(\"192.168.0.1\"));\n\t\tnodes.put(\"192.168.0.2\", new NetNode(\"192.168.0.2\"));\n\t\tnodes.put(\"192.168.0.3\", new NetNode(\"192.168.0.3\"));\n\t\tnodes.put(\"192.168.0.4\", new NetNode(\"192.168.0.4\"));\n\t\t//manually entering ports\n\t\t//0 to 1 and 2\n\t\tnodes.get(\"192.168.0.0\").addPort(nodes.get(\"192.168.0.1\"));\n\t\tnodes.get(\"192.168.0.0\").addPort(nodes.get(\"192.168.0.2\"));\n\t\t//1 to 0 and 3\n\t\tnodes.get(\"192.168.0.1\").addPort(nodes.get(\"192.168.0.0\"));\n\t\tnodes.get(\"192.168.0.1\").addPort(nodes.get(\"192.168.0.3\"));\n\t\t//2 to 0 and 3 and 4\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.0\"));\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.3\"));\n\t\tnodes.get(\"192.168.0.2\").addPort(nodes.get(\"192.168.0.4\"));\n\t\t//3 to 1 and 2 and 4\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.1\"));\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.2\"));\n\t\tnodes.get(\"192.168.0.3\").addPort(nodes.get(\"192.168.0.4\"));\n\t\t//4 to 2 and 3\n\t\tnodes.get(\"192.168.0.4\").addPort(nodes.get(\"192.168.0.2\"));\n\t\tnodes.get(\"192.168.0.4\").addPort(nodes.get(\"192.168.0.3\"));\n\t}", "@Test\n public void testNetworkMetric() {\n MetricValue mv = new MetricValue.Builder().load(10).add();\n\n Set<String> set = ImmutableSet.of(\"eth0\", \"eth1\");\n\n set.forEach(network -> NETWORK_METRICS.forEach(cmt ->\n testUpdateMetricWithResource(cmt, mv, network)));\n\n set.forEach(network -> NETWORK_METRICS.forEach(cmt ->\n testLoadMetricWithResource(nodeId, cmt, mv, network)));\n }", "private static void printRanking(List<Instruction> list,final String settlementType) {\n\t\tfinal Map<String, Double> entityMap = new HashMap<>();\n\t\tfor(Instruction instruction : list) {\n\t\t\tif(entityMap.get(instruction.getEntity())!=null) {\n\t\t\t\t//if multiple trades happened for same entity \n\t\t\t\tentityMap.put(instruction.getEntity(),(entityMap.get(instruction.getEntity()) + instruction.getTotalAmount()));\n\t\t\t}else {\n\t\t\t\tentityMap.put(instruction.getEntity(), instruction.getTotalAmount());\n\t\t\t}\n\t\t}\n\t\t// sort entity map based on TotoalAmount\n\t\tfinal Map<String, Double> sortedMap = entityMap.entrySet().stream()\n\t\t.sorted(Map.Entry.<String,Double>comparingByValue().reversed())\n\t\t.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, HashMap<String,Double>::new));\n\t\t\n\t\tSystem.out.println(settlementType +\" Ranking :\\n\");\n\t\tSet<String> keySet = sortedMap.keySet();\n\t\tint rank = 1;\n\t\tfor(String key : keySet) {\n\t\t\tSystem.out.println(key +\" - \"+ rank++);\n\t\t}\n\t}", "public PowerVmAllocationPolicySimple(List<? extends PowerHost> list) {\n\t\tsuper(list);\n\t}", "List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}", "@Test\n\tpublic void defaultNetworkIsTestNetworkByDefault() {\n\t\t// Assert:\n\t\tAssert.assertThat(\n\t\t\t\tNetworkInfos.getDefault(),\n\t\t\t\tIsSame.sameInstance(NetworkInfos.getTestNetworkInfo()));\n\t}", "public void createOnlyLBPolicy(){\n\t\t\n\t\tIterator<CacheObject> ican = cacheList.iterator();\n\t\t\n\t\tint objcounter = 0;\n\t\t\n\t\twhile(ican.hasNext() && objcounter < (OBJ_FOR_REQ)){\n\t\t\t\n\t\t\tobjcounter ++;\n\t\t\tCacheObject tempCacheObject = ican.next();\n\t\t\tIterator<ASServer> itm = manager.getASServers().values().iterator();\n\t\t\twhile(itm.hasNext()){\n\t\t\t\t\n\t\t\t\tASServer as = itm.next();\n\t\t\t\tif(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey) == null){\n\t\t\t\t\t//System.out.println(\"Mapping Map is NULL\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tArrayList<String> urllist = new ArrayList<String>(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey));\n\t\t\t\tIterator<String> iurl = urllist.iterator();\n\t\t\t\twhile(iurl.hasNext()){\n\t\t\t\t\tString url = iurl.next();\n\t\t\t\t\tif(!urlList.contains(url)){\n\t\t\t\t\t\turlList.add(url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tint urlcounter = 0;\n\t\tint urllistsize = urlList.size();\n\t\tCollection<String> it1 = serverList.keySet();\n\t\tArrayList<String> server = new ArrayList<String>(it1);\n\t\t\n\t\twhile(urlcounter < urllistsize){\n\t\t\t\n\t\t\tString serId = server.get( (urlcounter) % NO_SERVERS );\n\t\t\tthis.currentLBPolicy.mapUrlToServers(urlList.get(urlcounter++), Analyser.resolveHost(serId));\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"------------LBPolicy start---------------\");\n//\t\tSystem.out.println(currentLBPolicy);\n//\t\t\n\t\tSystem.out.println(\"Number of entries in LBPolicy are: \" + currentLBPolicy.policyMap.size() );\n//\t\n\t\tSystem.out.println(\"------------LBPolicy end-----------------\");\n\t\t/*\n\t\tif(mLogger.isInfoEnabled()){\n\t\t\tmLogger.log(Priority.INFO, \"LBPolicy being printed\");\n\t\tmLogger.log(Priority.INFO, \":\" + this.currentLBPolicy);\n\t\t\n\t}\n\t\t*/\n\t}", "public java.util.List<? extends NetworkOrBuilder> getNetworksOrBuilderList() {\n if (networksBuilder_ != null) {\n return networksBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(networks_);\n }\n }", "public static void main(String[] args) {\n\t\tList<List<Integer>> res = new ArrayList<List<Integer>>();\n\t\t\n\t\tList<Integer> list = new ArrayList<>();\n\t\tlist.add(2);\n\t\tlist.add(3);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(4);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(5);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(6);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(7);\n\t\tlist.add(8);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(9);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(10);\n\t\tlist.add(11);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tlist = new ArrayList<>();\n\t\tlist.add(-1);\n\t\tlist.add(-1);\n\t\tres.add(list);\n\t\tSystem.out.println(res);\n\t\tSystem.out.println(Inorder(res));\n\t\tList<Integer> queries = new ArrayList<>();\n\t\tqueries.add(2);\n\t\tqueries.add(4);\n\t\tswapNodes(res, queries);\n\n\t}", "public List<NetworkNode> listNetworkNode();", "public ArrayList<String> alwaysLessPopular(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor (NameRecord n : list){\n\t\t\tif (n.lessPop()){\n\t\t\t\tresult.add(n.getName());\n\t\t\t}\n\t\t}\t\n\t\treturn result;\n\t}", "@Override\n\tpublic void urlDecisionSetDefaultAttributes() {\n\t\t// TODO Add default attributes for decisions related to URL access\n\n\t}", "public void setIpList(String [] IpList) {\n this.IpList = IpList;\n }", "@Override\n protected void set(java.util.Collection<org.tair.db.locusdetail.IPolymorphismSite> list) {\n polymorphismSite = list;\n // Add the primary keys to the serialized key list if there are any.\n if (polymorphismSite != null) {\n for (com.poesys.db.dto.IDbDto object : polymorphismSite) {\n polymorphismSiteKeys.add(object.getPrimaryKey());\n }\n }\n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "private static void resetConfigTemplateVlanNetworkMaping(List<ConfigTemplate> cft){\n\t\tfor(ConfigTemplate cf: cft) {\r\n\t\t\tif (!cf.getConfigType().isTypeSupport(ConfigTemplateType.ROUTER)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tSet<ConfigTemplateVlanNetwork> cvnSet = new HashSet<ConfigTemplateVlanNetwork>();\r\n\t\t\tif (AhRestoreNewMapTools.getMapWlanNetworkObjectVlan(cf.getId())!=null) {\r\n\t\t\t\tcvnSet.add(AhRestoreNewMapTools.getMapWlanNetworkObjectVlan(cf.getId()));\r\n\t\t\t}\r\n\t\t\tSet<Long> upIdSet = new HashSet<Long>();\r\n\t\t\tfor(ConfigTemplateSsid cs: cf.getSsidInterfaces().values()){\r\n\t\t\t\tif (cs.getSsidProfile()!=null) {\r\n\t\t\t\t\tSsidProfile ss = QueryUtil.findBoById(SsidProfile.class, cs.getSsidProfile().getId(), new ImplQueryBoVlanNetwork());\r\n\t\t\t\t\tif (ss.getUserProfileDefault()!=null) {\r\n\t\t\t\t\t\tupIdSet.add(ss.getUserProfileDefault().getId());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (ss.getUserProfileSelfReg()!=null) {\r\n\t\t\t\t\t\tupIdSet.add(ss.getUserProfileSelfReg().getId());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (ss.getRadiusUserProfile()!=null) {\r\n\t\t\t\t\t\tfor(UserProfile up: ss.getRadiusUserProfile()){\r\n\t\t\t\t\t\t\tupIdSet.add(up.getId());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (PortGroupProfile portGroup : cf.getPortProfiles()) {\r\n\t\t\t List<PortBasicProfile> basicProfiles = portGroup.getBasicProfiles();\r\n\t\t\t if(null != basicProfiles) {\r\n\t\t\t for (PortBasicProfile portBasicProfile : basicProfiles) {\r\n\t\t\t if(null != portBasicProfile.getAccessProfile()) {\r\n\t\t\t PortAccessProfile access = QueryUtil.findBoById(PortAccessProfile.class, portBasicProfile.getAccessProfile().getId(), new ImplQueryBoVlanNetwork());\r\n if(access.getPortType() == PortAccessProfile.PORT_TYPE_8021Q) {\r\n // handle the trunk mode - Network <-> VLAN\r\n if(null != access.getNativeVlan()) {\r\n Long lanId = AhRestoreNewMapTools.getMapLanProfileReverse(access.getId());\r\n if(null != lanId) {\r\n Map<Long, Long> vlanObjNetwork = AhRestoreNewMapTools.getMapLANVLANObjectNetwork(lanId);\r\n if(null != vlanObjNetwork) {\r\n for (Long vlanId : vlanObjNetwork.keySet()) {\r\n Long networkId = vlanObjNetwork.get(vlanId);\r\n\r\n if(null != networkId && null != vlanId) {\r\n VpnNetwork networkObj = AhRestoreNewTools.CreateBoWithId(VpnNetwork.class,networkId);\r\n Vlan vlanObj = AhRestoreNewTools.CreateBoWithId(Vlan.class,vlanId);\r\n\r\n if(networkObj!=null && vlanObj!=null) {\r\n ConfigTemplateVlanNetwork cvn = new ConfigTemplateVlanNetwork();\r\n cvn.setNetworkObj(networkObj);\r\n cvn.setVlan(vlanObj);\r\n cvnSet.add(cvn);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n // handle the access mode\r\n if(null != access.getDefUserProfile()) {\r\n upIdSet.add(access.getDefUserProfile().getId());\r\n }\r\n if(null != access.getSelfRegUserProfile()) {\r\n upIdSet.add(access.getSelfRegUserProfile().getId());\r\n }\r\n if (null != access.getAuthOkUserProfile()) {\r\n for (UserProfile up : access.getAuthOkUserProfile()) {\r\n upIdSet.add(up.getId());\r\n }\r\n }\r\n }\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t }\r\n }\r\n\r\n\t\t\tfor(Long upId : upIdSet){\r\n\t\t\t\tLong networkId = AhRestoreNewMapTools.getMapUserProfileNetworkObjectWithNewID(upId);\r\n\t\t\t\tLong vlanId = null;\r\n\t\t\t\tif (networkId!=null) {\r\n\t\t\t\t\tvlanId = AhRestoreNewMapTools.getMapNetworkObjectVlanWithNewID(networkId);\r\n\t\t\t\t}\r\n\t\t\t\tVpnNetwork networkObj = AhRestoreNewTools.CreateBoWithId(VpnNetwork.class,networkId);\r\n\t\t\t\tVlan vlanObj = null;\r\n\t\t\t\tif(vlanId!=null) {\r\n\t\t\t\t\tvlanObj = AhRestoreNewTools.CreateBoWithId(Vlan.class,vlanId);\r\n\t\t\t\t}\r\n\t\t\t\tif(networkObj!=null && vlanObj!=null) {\r\n\t\t\t\t\tConfigTemplateVlanNetwork cvn = new ConfigTemplateVlanNetwork();\r\n\t\t\t\t\tcvn.setNetworkObj(networkObj);\r\n\t\t\t\t\tcvn.setVlan(vlanObj);\r\n\t\t\t\t\tcvnSet.add(cvn);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!cvnSet.isEmpty()) {\r\n\t\t\t\tif (cf.getVlanNetwork()==null) {\r\n\t\t\t\t\tList<ConfigTemplateVlanNetwork> myList = new ArrayList<ConfigTemplateVlanNetwork>();\r\n\t\t\t\t\tcf.setVlanNetwork(myList);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcf.getVlanNetwork().clear();\r\n\t\t\t\t}\r\n\t\t\t\tcf.getVlanNetwork().addAll(cvnSet);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void createDistributedObjectsPolicy(){\n\t\t\n\t\tint size = 0;\n\t\t\n\t\tIterator<CacheObject> cst = candidateStableOnlyList.iterator();\n\t\t\n\t\twhile(cst.hasNext()){\n\t\t\t\n\t\t\tCacheObject ct = cst.next();\n\t\t\t\n\t\t\tIterator<String> it1 = serverList.keySet().iterator();\n\t\t\t\n\t\t\twhile(it1.hasNext()){\n\t\t\t\t\n\t\t\t\tString serverId = it1.next();\n\t\t\t\tHashMap<String, CacheObject> htemp = individualMap.get(serverId); \n\t\t\t\t\n\t\t\t\tif(htemp.containsKey(ct.cacheKey)){\n\t\t\t\t\t\n\t\t\t\t\tInteger sz = serverList.get(serverId);\n\t\t\t\t\t\n\t\t\t\t\tif(sz.intValue() < STABLE_SIZE){\n\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\tlt.add(serverId);\n\t\t\t\t\t\tRuleList rl = new RuleList(serverId, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\tASPolicyMap.get(serverId).addNewPolicy(lk, rl);\n\t\t\t\t\t\tsz = sz + ct.size;\n\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\tserverList.put(serverId, sz);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tIterator<String> it2 = serverList.keySet().iterator();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(it2.hasNext()){\n\t\t\t\t\t\t\tString serverId2 = it2.next();\n\t\t\t\t\t\t\tInteger sz2 = serverList.get(serverId2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sz2.intValue() < STABLE_SIZE){\n\t\t\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\t\t\tlt.add(serverId2);\n\t\t\t\t\t\t\t\tRuleList rl = new RuleList(serverId2, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\t\t\tASPolicyMap.get(serverId2).addNewPolicy(lk, rl);\n\t\t\t\t\t\t\t\tsz2 = sz2 + ct.size;\n\t\t\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\t\t\tserverList.put(serverId2, sz2);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(size >= (STABLE_SIZE*NO_SERVERS) ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void setVoteOrder() {\n\t\tfor (int i = 1; i < temp.size(); i++) {\n\t\t\t// deleting the comma from the name\n\t\t\tString s = temp.elementAt(i).replaceAll(\",\", \"\");\n\t\t\t// creating a vector \"tempVoteOrder\" to store the preferences of\n\t\t\t// each voter\n=======\n\t\t\tCandidats.add(candidat);\n\t\t\ttempCandidats = tempCandidats.replaceFirst(\n\t\t\t\t\ttempCandidats.substring(0, tempCandidats.indexOf(\",\") + 1),\n\t\t\t\t\t\"\");// delete the first candidat in the String\n\t\t}\n\t\tfor (int j = 0; j < Candidats.size(); j++)\n\t\t\tCandidats.elementAt(j).setVowsPerRound(Candidats.size());// fill the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// vector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// size\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \"candidats\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0's\n\t}", "public static void sortByPopular(){\n SORT_ORDER = POPULAR_PATH;\n }", "private void initiate(Node start) {\n\t\t\tfor (Node node : network.nodes.values()){\r\n\t \r\n\t \t\tdouble nodeCost;\r\n\t if(node.getId() == start.getId()){\r\n\t \tnodeCost = 0.;\r\n\t }\r\n\t else{\r\n\t \tnodeCost = Double.MAX_VALUE;\r\n\t }\r\n\t DijkstraNode dijk = new DijkstraNode(node, nodeCost);\r\n\t this.remainingNodes.add(dijk);\r\n\t this.correspondingNodes.put(node, dijk);\r\n\t }\r\n\t \tCollections.sort(this.remainingNodes);\r\n//\t \tSystem.out.println(\"remainingNodes.size = \" + remainingNodes.size());\r\n\t }", "private void categoriseNodes(final CyNetwork result, final Set<CyNode> leftSet,\n\t\t\t\t final Set<CyNode> rightSet)\n\t{\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig1 = new HashSet<CyNode>(network1.nodesList());\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal Set<CyNode> orig2 = new HashSet<CyNode>(network2.nodesList());\n\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tfinal List<CyNode> resultNodes = (List<CyNode>)result.nodesList();\n\t\t\n\t\tfinal CyAttributes nodeAttr = Cytoscape.getNodeAttributes();\n\t\t\n\t\tfor (final CyNode node : resultNodes) {\n\t\t\tfinal boolean inNetwork1 = orig1.contains(node);\n\t\t\tfinal boolean inNetwork2 = orig2.contains(node);\n\t\t\t\n\t\t\tif (inNetwork1 && inNetwork2)\n\t\t\t\t/* Do Nothing. */;\n\t\t\telse if (inNetwork1 && !inNetwork2) {\n\t\t\t\tleftSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network1.getTitle());\n\t\t\t} else if (!inNetwork1 && inNetwork2) {\n\t\t\t\trightSet.add(node);\n\t\t\t\tnodeAttr.setAttribute(node.getIdentifier(), visualStyleName, network2.getTitle());\n\t\t\t} else // This should never happen!\n\t\t\t\tthrow new IllegalStateException(\"Do not know how to categorise a node!\");\n\t\t}\n\t}", "public Request sechdule1(ArrayList<Request> requestList) {\n\t\treturn null;\n\t}", "public void ranking(ArrayList<Player> list) {\r\n\t\tCollections.sort(list, new Comparator<Player>(){\r\n\t\t\tpublic int compare(Player a1, Player a2) {\r\n\t\t\t\tint a = a2.getPercent()-a1.getPercent(); \r\n\t\t\t\treturn a==0?a1.getUserName().compareTo(a2.getUserName()):a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile(aa.hasNext()){\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tin.showRanking();\r\n\t\t}\r\n\t}", "public void findBetterDHAvailable(List<ScanResult> allScanResults)\n {\n Map allDHAvailable = new HashMap<String, Integer>();\n\n // Put all found DH to allDHAvailable Map\n for (ScanResult scanResult : allScanResults) {\n if(scanResult.SSID.toString().contains(\"DH-\")) {\n allDHAvailable.put(scanResult.SSID,scanResult.level);\n }\n }\n\n Log.v(\"AllDH Available:\", Arrays.asList(allDHAvailable).toString());\n Logger.addRecordToLog(\"All DH available:\" + Arrays.asList(allDHAvailable).toString());\n // Find key with the maximum value from allDHAvailable\n String bestFoundSSID=\"\";\n int maxValueInMap = 0;\n try {\n maxValueInMap = (int) Collections.max(allDHAvailable.values()); // This will return max value in the Hashmap\n Iterator it = allDHAvailable.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<String, Integer> pair = (Map.Entry) it.next();\n if (pair.getValue() == maxValueInMap) {\n Log.v(\"Best Found SSID:\", pair.getKey()); // Print the key with max value\n Logger.addRecordToLog(\"Best Found SSID\"+ ',' + pair.getKey());\n bestFoundSSID = pair.getKey().toString();\n }\n }\n }\n catch (Exception e)\n {}\n // Connect to the best found network\n String pass = \"password123\";\n WifiConfiguration wc = new WifiConfiguration();\n wc.SSID = \"\\\"\" + bestFoundSSID + \"\\\"\"; //IMPORTANT! This should be in Quotes!!\n wc.preSharedKey = \"\\\"\"+ pass +\"\\\"\";\n wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);\n //wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n int res = DCService.wifi.addNetwork(wc);\n boolean b = DCService.wifi.enableNetwork(res, true);\n Log.v(DCService.TAG2, \"Connected\");\n\n }", "public void setSocialNetwork(int value) {\n this.socialNetwork = value;\n }", "public PowerVmAllocationPolicyAbstract(List<? extends Host> list) {\n\t\tsuper(list);\n\t}", "@NonNull\n @RequiresFeature(PackageManager.FEATURE_IPSEC_TUNNELS)\n public Builder restrictToTestNetworks() {\n mIsRestrictedToTestNetworks = true;\n return this;\n }", "public RBACwithCommonNodes(){\n\t\tvalues = new Hashtable<Integer,Hashtable<Object, Integer>>();\n\t\tint[] order = {1,4,2,5,3};\n\t\tauthGraph = new DirectedGraph(order);\n\t}", "private void createAllApnList() {\n allApns = new ArrayList<ApnSetting>();\n String operator = phone.mSIMRecords.getSIMOperatorNumeric();\n\n if (operator != null) {\n String selection = \"numeric = '\" + operator + \"'\";\n\n Cursor cursor = phone.getContext().getContentResolver().query(\n Telephony.Carriers.CONTENT_URI, null, selection, null, null);\n\n if (cursor != null) {\n if (cursor.getCount() > 0) {\n allApns = createApnList(cursor);\n // TODO: Figure out where this fits in. This basically just \n // writes the pap-secrets file. No longer tied to PdpConnection\n // object. Not used on current platform (no ppp).\n //PdpConnection pdp = pdpList.get(pdp_name);\n //if (pdp != null && pdp.dataLink != null) {\n // pdp.dataLink.setPasswordInfo(cursor);\n //}\n }\n cursor.close();\n }\n }\n\n if (allApns.isEmpty()) {\n if (DBG) log(\"No APN found for carrier: \" + operator);\n notifyNoData(PdpConnection.PdpFailCause.BAD_APN);\n }\n }", "public List getSkuCompareList() {\n return mSkuCompareList;\n }", "public static ProbNet prioritize(ProbNet probNet, Variable decisionVariable) {\n\t\tProbNet prioritizedNetwork = probNet.copy();\n\t\ttry {\n\t\t\tList<Node> nextDecisions = getNextDecisions(prioritizedNetwork);\n\t\t\tVariable priorVariable = prioritizedNetwork.getVariable(decisionVariable.getName());\n\n\t\t\tfor (Node decisionNode : nextDecisions) {\n\t\t\t\tVariable nextDecisionVariable = decisionNode.getVariable();\n\t\t\t\tif (nextDecisionVariable != priorVariable) {\n\t\t\t\t\tprioritizedNetwork.addLink(priorVariable, nextDecisionVariable, true);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (NodeNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn prioritizedNetwork;\n\t}", "public void setReviewList(List<Review> reviewList) {\n this.reviewList = reviewList;\n notifyDataSetChanged();\n }", "public Network getNetwork() {\r\n \t\treturn network;\r\n \t}", "@Override public Set<Integer> allowedLayers() {\n Set<Integer> layers = new HashSet<>(first.allowedLayers());\n layers.retainAll(next.allowedLayers());\n return layers;\n }", "private void OrderPips(ArrayList<Pip> PipsOfInterest) {\n\t\tPip i0 = PipsOfInterest.get(0);\n Pip i1=null,i2=null,i3=null; \n\t\t\n\t\tfor(Pip P : PipsOfInterest){\n\t\t\tif(!P.getRowBit().equals(i0.getRowBit()) && !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip With no Matchings Bits to be i3\n i3 = P; \t\n\t\t\t} else if(P.getRowBit().equals(i0.getRowBit()) || !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti1 = P; \n\t\t\t} else if(!P.getRowBit().equals(i0.getRowBit()) || P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti2 = P; \n\t\t\t} \n\t\t}\t\n\t\t\n\t\tif(i0 == null || i1 == null || i2 == null || i3 == null){\n\t\t\tSystem.out.println(\"Error: i0, i1, i2, i3 not set\" + i0 + \" \" + i1 + \" \" + i2 + \" \" + i3);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//Arrange the Pips into the ArrayList\n PipsOfInterest.set(0, i0);\n PipsOfInterest.set(1, i1);\n PipsOfInterest.set(2, i2);\n PipsOfInterest.set(3, i3);\n\t}", "public static Network createLessSymmetricTestNetwork() {\n\t\t/*\n\t\t * (2)\t\t(5)------(8)\n\t\t * \t|\t\t |\n\t\t * \t|\t\t |\n\t\t * (1)------(4)------(7)\n\t\t * \t|\t\t |\n\t\t * \t|\t\t |\n\t\t * (3)\t\t(6)------(9)\n\t\t */\n\t\tdouble freespeed = 2.7;\n\t\tdouble capacity = 500.;\n\t\tdouble numLanes = 1.;\n\n\t\tMutableScenario scenario = (MutableScenario) ScenarioUtils.createScenario(ConfigUtils.createConfig());\n\n\t\tNetwork network = (Network) scenario.getNetwork();\n\n\t\t// Nodes\n\t\tNode node1 = NetworkUtils.createAndAddNode(network, Id.create(1, Node.class), new Coord((double) 10, (double) 100));\n\t\tNode node2 = NetworkUtils.createAndAddNode(network, Id.create(2, Node.class), new Coord((double) 10, (double) 190));\n\t\tNode node3 = NetworkUtils.createAndAddNode(network, Id.create(3, Node.class), new Coord((double) 10, (double) 10));\n\t\tNode node4 = NetworkUtils.createAndAddNode(network, Id.create(4, Node.class), new Coord((double) 120, (double) 100));\n\t\tNode node5 = NetworkUtils.createAndAddNode(network, Id.create(5, Node.class), new Coord((double) 120, (double) 190));\n\t\tNode node6 = NetworkUtils.createAndAddNode(network, Id.create(6, Node.class), new Coord((double) 120, (double) 10));\n\t\tNode node7 = NetworkUtils.createAndAddNode(network, Id.create(7, Node.class), new Coord((double) 190, (double) 100));\n\t\tNode node8 = NetworkUtils.createAndAddNode(network, Id.create(8, Node.class), new Coord((double) 190, (double) 190));\n\t\tNode node9 = NetworkUtils.createAndAddNode(network, Id.create(9, Node.class), new Coord((double) 190, (double) 10));\n\n\t\tSet<String> modes = new HashSet<>();\n\t\tmodes.add(\"car\");\n\n\t\t// Links (bi-directional)\n\t\tNetworkUtils.createAndAddLink(network,Id.create(1, Link.class), node1, node2, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(1, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(2, Link.class), node2, node1, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(2, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(3, Link.class), node1, node3, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(3, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(4, Link.class), node3, node1, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(4, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(5, Link.class), node1, node4, (double) 110, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(5, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(6, Link.class), node4, node1, (double) 110, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(6, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(7, Link.class), node4, node5, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(7, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(8, Link.class), node5, node4, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(8, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(9, Link.class), node4, node6, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(9, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(10, Link.class), node6, node4, (double) 90, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(10, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(11, Link.class), node4, node7, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(11, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(12, Link.class), node7, node4, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(12, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(13, Link.class), node5, node8, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(13, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(14, Link.class), node8, node5, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(14, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(15, Link.class), node6, node9, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(15, Link.class)).setAllowedModes(modes);\n\n\t\tNetworkUtils.createAndAddLink(network,Id.create(16, Link.class), node9, node6, (double) 70, freespeed, capacity, numLanes);\n\t\tnetwork.getLinks().get(Id.create(16, Link.class)).setAllowedModes(modes);\n\n\t\treturn network;\n\t}", "public void set(@NonNull NetworkCapabilities nc) {\n mNetworkCapabilities = nc.mNetworkCapabilities;\n mTransportTypes = nc.mTransportTypes;\n mLinkUpBandwidthKbps = nc.mLinkUpBandwidthKbps;\n mLinkDownBandwidthKbps = nc.mLinkDownBandwidthKbps;\n mNetworkSpecifier = nc.mNetworkSpecifier;\n mTransportInfo = nc.mTransportInfo;\n mSignalStrength = nc.mSignalStrength;\n setUids(nc.mUids); // Will make the defensive copy\n mEstablishingVpnAppUid = nc.mEstablishingVpnAppUid;\n mUnwantedNetworkCapabilities = nc.mUnwantedNetworkCapabilities;\n mSSID = nc.mSSID;\n }", "public void initialize() {\n\n list.add(user1);\n list.add(user2);\n list.add(user3);\n }" ]
[ "0.5121202", "0.5023334", "0.4825949", "0.48047578", "0.47982705", "0.47590667", "0.47438556", "0.47310647", "0.47134268", "0.4704756", "0.4678282", "0.46480453", "0.46327505", "0.45870128", "0.4578655", "0.45776016", "0.4547963", "0.45256948", "0.45140436", "0.45134264", "0.44938207", "0.44806635", "0.447095", "0.44385636", "0.4429805", "0.44233042", "0.44206348", "0.44110018", "0.43866178", "0.43852764", "0.43839318", "0.43831843", "0.43783468", "0.4366168", "0.43555617", "0.43391347", "0.43356466", "0.43178418", "0.43088347", "0.43008584", "0.42948067", "0.42939717", "0.42938718", "0.4292047", "0.42919707", "0.4289799", "0.4277486", "0.4269899", "0.4269755", "0.4269032", "0.42656666", "0.42638832", "0.42609563", "0.4257742", "0.4246174", "0.42440292", "0.4232423", "0.42316785", "0.4228696", "0.42269632", "0.42246005", "0.42184556", "0.4215091", "0.42129257", "0.42101702", "0.42084605", "0.4208181", "0.41976738", "0.41966677", "0.41966662", "0.41961017", "0.41956964", "0.4193053", "0.4190099", "0.41844603", "0.41840896", "0.4181853", "0.4181211", "0.41810083", "0.41736755", "0.41734326", "0.41720304", "0.41718915", "0.41676867", "0.41651455", "0.41644794", "0.41643134", "0.41616058", "0.4159864", "0.4153617", "0.415216", "0.41407073", "0.41389886", "0.4132485", "0.41306937", "0.4122261", "0.4121587", "0.41195783", "0.41176325", "0.4113109", "0.410862" ]
0.0
-1
It would be faster if we use the array to memorize the char frequency;
public String minWindow(String s, String t) { String res = ""; if (t.length() > s.length()) return res; Map<Character, Integer> dict = new HashMap<>(); int count=t.length(); for (char ch : t.toCharArray()) { dict.put(ch, dict.getOrDefault(ch,0)+1); } int start=0, end=0, d=Integer.MAX_VALUE, head=0; while (end < s.length()) { if (dict.containsKey(s.charAt(end))) { if (dict.get(s.charAt(end)) > 0) { count--; } dict.put(s.charAt(end), dict.get(s.charAt(end)) - 1); } end++; while (count == 0) { if (end - start < d) { res = s.substring(start,end); d = end - start; } // make it invalid; // notice that we could seize the essence???? // to make it invalid, we only care if the counter is positive or not; // we don't care about the char at end if it is changed; if (dict.containsKey(s.charAt(start))) { if (dict.get(s.charAt(start)) >= 0) { count++; } dict.put(s.charAt(start), dict.get(s.charAt(start)) + 1); } start++; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int[] buildFrequencyTable(String s)\n{\n int[] table = new int [Character.getNumericValue('z') - Character.getNumericValue('a') + 1];\n for (char c : s.toCharArray())\n {\n int x = getCharNumber(c);\n if (x != -1) table[x]++;\n }\n return table;\n}", "private void RecalculateCharDistribution() {\r\n\t\tMap<Character, Integer> temp = new HashMap<>();\r\n\t\tfor (String s : sameWordLength) {\r\n\t\t\tfor (int i = 0; i < s.length(); i++) {\r\n\r\n\t\t\t\tchar ch = s.charAt(i);\r\n\t\t\t\tif (guessedCharacter.contains(ch)) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!temp.containsKey(ch)) {\r\n\t\t\t\t\t\ttemp.put(ch, 1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tint t = temp.get(ch) + 1;\r\n\t\t\t\t\t\ttemp.put(ch, t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcharCount = temp;\r\n\r\n\t}", "HashMap<Character, Integer> countCharacter(char[] array) {\n\t\tHashMap<Character, Integer> hm = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hm.containsKey(array[i]))\n\t\t\t\thm.put(array[i], hm.get(array[i]) + 1);\n\n\t\t\telse\n\t\t\t\thm.put(array[i], 1);\n\t\t}\n\t\treturn hm;\n\n\t}", "public String frequencySort(String s) {\n\n\t\t// prepare a frequency map\n\t\tMap<Character, Integer> m = new HashMap<Character, Integer>();\n\t\tfor (char c : s.toCharArray())\n\t\t\tm.put(c, m.getOrDefault(c, 0) + 1);\n\n\t\tPriorityQueue<CKEntry1> pq = new PriorityQueue<>();\n\t\tfor (Entry<Character, Integer> e : m.entrySet()) {\n\t\t\tpq.add(new CKEntry1(e.getKey(), e.getValue()));\n\t\t}\n\t\t\n\t\t// prepare the output now\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile(!pq.isEmpty()) {\n\t\t\tCKEntry1 temp = pq.poll();\n\t\t\tchar[] tempC = new char[temp.count];\n\t\t\tArrays.fill(tempC, temp.c); // repeat c count' times\n\t\t\tsb.append(tempC);\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}", "private static void cryptanalysis() {\n\t for (char cipherChar : cipherText.toCharArray()) {\n\t if (Character.isLetter(cipherChar)) { // only letters are encrypted, punctuation marks and whitespace are not\n\t // following line converts letters to numbers between 0 and 25\n\t int cipher = (int) cipherChar - alphaIndex;\n\t // following line increments the value at frequency[cipher] to count frequency of letters used\n\t frequency[cipher] = frequency[cipher] + 1;\n\t }\n\t } \n\t char currChar = 'A';\n \t for (int i = 0; i < 26; i++) {\n \t\t System.out.println(currChar++ + \" \" + frequency[i]);\n \t }\n }", "public void charSorting(char input[]) {\n int n = input.length;\n char[] output = new char[n];\n\n // Create an array of 256 size to store count the frequency of char and assign with 0\n int[] count = new int[256];\n for (int i = 0; i < 256; i++)\n count[i] = 0;\n\n //Count the frequency of char in input array\n for (int i = 0; i < n; i++)\n count[input[i]]++;\n\n // Change count[i] so that count[i] now contains actual\n // position of this character in output array\n //Computing cumulative sum\n for (int i = 1; i <= 255; i++)\n count[i] += count[i - 1];\n\n //Assign the chars in output array by operating in reverse order\n for (int i = n - 1; i >= 0; i--) {\n output[count[input[i]] - 1] = input[i];\n count[input[i]]--;\n }\n\n //Print the output array\n for (int i = 0; i < n ; i++)\n System.out.print(output[i] + \" \");\n }", "private Map<Character, Integer> getFreqs(String input) {\n\t\tMap<Character, Integer> freqMap = new HashMap<>();\n\t\tfor (char c : input.toCharArray()) {\n\t\t\tif (freqMap.containsKey(c)) {\n\t\t\t\tfreqMap.put(c, freqMap.get(c) + 1);\n\t\t\t} else {\n\t\t\t\tfreqMap.put(c, 1);\n\t\t\t}\n\t\t}\n\t\treturn freqMap;\n\t}", "public void charFrequencyCount(Scanner s) {\n\t\twhile (s.hasNextLine()) { /* keep scanning while there is info in the\n\t\t\t\t\t\t\t\t * file\n\t\t\t\t\t\t\t\t * */ \n\t\t\tchar[] curLine = s.nextLine().toCharArray();\n\t\t\tfileData.add(curLine); // save the data for later\n\n\t\t\t/*\n\t\t\t * Go through the line curRent line and count the characters\n\t\t\t */\n\t\t\tfor (int i = 0; i < curLine.length; i++) {\n\t\t\t\tfrequencyCount[curLine[i]]++;\n\t\t\t}\n\t\t\tfrequencyCount[10]++; // add a new line!\n\t\t}\n\t\t/*\n\t\t * There is always one extra newline so take one away to re-balance it.\n\t\t */\n\t\tfrequencyCount[10]--;\n\t}", "private int[] readCharacterFrequency(BitInputStream in) throws IOException {\r\n int[] freq = new int[n];\r\n for(int i = 0; i < n; i++){\r\n freq[i] = in.readInt();\r\n }\r\n return freq;\r\n }", "public static void cuentaLetras(char[] c)\n{\n for(int k=0; k < c.length; k++)\n {\n char currentChar = c[k]; \n //to check that currentChar is not in map, if not will add 1 count for firsttime\n if(map1.get(currentChar) == null){\n map1.put(currentChar, 1); \n } \n /*If it is repeating then simply we will increase the count of that key(character) by 1*/\n else {\n map1.put(currentChar, map1.get(currentChar) + 1);\n }\n } //todo el parrafo\n\n}", "private static String frequencySort(String s) {\n if (s == null || s.isEmpty()) { return s; }\n\n int[] freq = new int[256];\n for (char c : s.toCharArray()) {\n freq[c]++;\n }\n\n PriorityQueue<Pair<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());\n for (int i = 0; i < freq.length; i++) {\n if (freq[i] == 0) { continue; }\n Pair<Character, Integer> pair = new Pair<>((char) (i), freq[i]);\n pq.offer(pair);\n }\n\n StringBuilder sb = new StringBuilder();\n while (!pq.isEmpty()) {\n Pair<Character, Integer> pair = pq.poll();\n for (int i = 0; i < pair.getValue(); i++) {\n sb.append(pair.getKey());\n }\n }\n return sb.toString();\n }", "static int countCharacters2(String[] words, String chars) {\n int count = 0;\n int[] seen = new int[26];\n //Count char of Chars String\n for (char c : chars.toCharArray())\n seen[c - 'a']++;\n // Comparing each word in words\n for (String word : words) {\n // simple making copy of seen arr\n int[] tSeen = Arrays.copyOf(seen, seen.length);\n int Tcount = 0;\n for (char c : word.toCharArray()) {\n if (tSeen[c - 'a'] > 0) {\n tSeen[c - 'a']--;\n Tcount++;\n }\n }\n if (Tcount == word.length())\n count += Tcount;\n }\n return count;\n }", "public static FreqChar exe2(String text) {\n FreqChar freqChar = new FreqChar();\n Map<Character, Integer> cFreq = new HashMap<>();\n for (Character c : text.toCharArray()) {\n cFreq.put(c, cFreq.getOrDefault(c, 0)+1);\n }\n\n int max = 0;\n for (Character c : cFreq.keySet()) {\n if (cFreq.get(c) > max) {\n max = cFreq.get(c);\n freqChar.setC(c);\n freqChar.setFreq(max);\n }\n\n }\n return freqChar;\n }", "static void getCharCountArray(String str) {\n for (int i = 0; i < str.length(); i++)\n count[str.charAt(i)]++;\n }", "public static int frequency(String str, char ch){\n//will return frequency of char from the string\n int count = 0; //to save the frequency of char\n/*each character is a char : and need to compare it with str.\nevery time it matches we add frequency to count*/\n\n for(char each : str.toCharArray() ){\n if(each == ch){//every time this is true, count will increase to 1\n count++;\n }\n }\n //return the frequency of one character from the string\n return count;\n }", "public static Map<Character,Integer> countFreq(String string){\n\n\n\n Map<Character,Integer> results = new HashMap<Character,Integer>();\n for (int i = 0; i < string.length(); i++) {\n Character temp = string.charAt(i);\n Integer count;\n// System.out.println(temp);\n if (results.containsKey(temp)){\n count=results.get(temp);\n count++;\n results.replace(temp,count);\n }\n else\n results.put(temp,1);\n\n }\n\n return results;\n }", "@Override //old methd for letter count\n public Integer letterCount(String inputString) {\n char[] characterArray = inputString.toCharArray();\n Map<Character, Integer> wordFrequencyMap = new HashMap<Character, Integer>();\n\n for (char character : characterArray) {\n if (wordFrequencyMap.containsKey(character)) {\n\n Integer wordCount = (Integer) wordFrequencyMap.get(character);\n wordFrequencyMap.put(character, wordCount + 1);\n\n } else {\n wordFrequencyMap.put(character, 1);\n\n }\n }\n return null; //iterateWordCount(wordFrequencyMap);\n }", "int getFreq();", "private static int[] letterHist(String acharArray) {\n int[] alphabet = new int[26];\n\n for (int i = 0; i < acharArray.length(); i++) {\n char singleChar = acharArray.toLowerCase().charAt(i);\n\n if ('a' <= singleChar && 'z' >= singleChar) {\n alphabet[singleChar - 'a']++;\n }\n }\n return alphabet;\n }", "public static void showFrequency(int[]ASCIIarray) {\n char letter = ' ';\n for(int i = 0; i < ASCIIarray.length;i++){\n if(ASCIIarray[i]>0){\n letter = (char)(i);\n System.out.println(\"The letter '\" + letter + \"' appeared \" + ASCIIarray[i] + \" times\");\n }\n }\n }", "private Map<Character, Double> getStrFrequencyTable(String str) {\n str = str.toLowerCase(Locale.ENGLISH);\n\n Map<Character, Double> frequencyTable = new HashMap<>(26);\n int[] countArr = countLetters(str);\n int numOfLetters = Arrays.stream(countArr).sum();\n\n for (char alphabet = 'a'; alphabet <= 'z'; alphabet++) {\n double frequency = 0.0;\n if (numOfLetters != 0) {\n frequency = countArr[alphabet-'a'] / (double) numOfLetters;\n }\n frequencyTable.put(alphabet, frequency);\n }\n\n return frequencyTable;\n }", "static int countCharacters(String[] words, String chars) {\n int ans = 0;\n int[] letters = new int[26];\n char[] arr = chars.toCharArray();\n for (char a : arr) {\n letters[a-'a']++;\n }\n for (String s : words) {\n char[] charArray = s.toCharArray();\n int[] temp = new int[26];\n int i = 0;\n for (;i<charArray.length;i++) {\n if (letters[charArray[i]-'a'] > 0) {\n letters[charArray[i]-'a']--;\n temp[charArray[i]-'a']++;\n } else {\n break;\n }\n }\n if (i == charArray.length) {\n ans += s.length();\n }\n i=0;\n for (;i<temp.length;i++) {\n letters[i] += temp[i];\n }\n }\n return ans;\n }", "public static void main(String[] args) {\n\t\tString str=\"aabcccccaaaa\";\n\t\tString str2=\"\";\n\t\tint freq=1;\n\t\tfor(int i=0;i<str.length()-1;i++){\n\t\t\tif(str.charAt(i)==str.charAt(i+1)){\n\t\t\t\tfreq++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tstr2=str2+str.charAt(i)+freq;\n\t\t\t\tfreq=1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(str2+str.charAt(str.length()-1)+freq);\n\t}", "public static void getOccuringChar(String inPutString) {\n HashMap<Character, Integer> charCountMap = new HashMap<Character, Integer>();\n /* converting given string to char Array*/\n char[] strArray = inPutString.toCharArray();\n /*Checking each char in strArray*/\n for (char c : strArray) {\n if (charCountMap.containsKey(c)) {\n //If char 'c' is present in charCountMap, incrementing it's count by 1\n charCountMap.put(c, charCountMap.get(c) + 1);\n } else {\n /*If char 'c' is not present in charCountMap,putting 'c' into charCountMap with 1 as it's value\n */\n charCountMap.put(c, 1);\n }\n }\n /*Printing input String*/\n System.out.println(\"The frequency of Character is \" + charCountMap);\n }", "static void codonfreq(String s) {\n int[] fromNuc = new int[128];\r\n for (int i = 0; i < fromNuc.length; i++)\r\n fromNuc[i] = -1;\r\n fromNuc['a'] = fromNuc['A'] = 0;\r\n fromNuc['c'] = fromNuc['C'] = 1;\r\n fromNuc['g'] = fromNuc['G'] = 2;\r\n fromNuc['t'] = fromNuc['T'] = 3;\r\n // Count frequencies of codons (triples of nucleotides)\r\n int[][][] freq = new int[4][4][4];\r\n for (int i = 0; i + 2 < s.length(); i += 3) {\r\n int nuc1 = fromNuc[s.charAt(i)];\r\n int nuc2 = fromNuc[s.charAt(i + 1)];\r\n int nuc3 = fromNuc[s.charAt(i + 2)];\r\n freq[nuc1][nuc2][nuc3] += 1;\r\n }\r\n // The translation from index 0123 to nucleotide ACGT\r\n final char[] toNuc = {'A', 'C', 'G', 'T'};\r\n for (int i = 0; i < 4; i++)\r\n for (int j = 0; j < 4; j++) {\r\n for (int k = 0; k < 4; k++)\r\n System.out.print(\" \" + toNuc[i] + toNuc[j] + toNuc[k]\r\n + \": \" + freq[i][j][k]);\r\n System.out.println();\r\n }\r\n }", "java.lang.String getFrequency();", "private static void charCount(String str) {\n\t\t\n\t\tHashMap<Character, Integer> mp = new HashMap<Character, Integer>();\n\t\t\n\t\tchar[] cr=str.toCharArray();\n\t\t\n\t\tSystem.out.println(cr);\n\t\t\n\t\tfor(char c: cr) {\n\t\t\t\n\t\t\tif(mp.containsKey(c)) {\n\t\t\t\tmp.put(c, mp.get(c)+1);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\tmp.put(c, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(Map.Entry<Character, Integer> ent: mp.entrySet()) {\n\t\t\tSystem.out.println(ent.getKey() + \" \" + ent.getValue());\n\t\t}\n\t\t\n\t}", "private void ReadFreq(char[] imagenaux) {\n if (imagenaux[29] == '/') iteradorFreq = 29;\n else iteradorFreq = 28;\n for (int x = 0; x < sizeY; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqY.put(n, f);\n }\n\n for (int x = 0; x < sizeCB; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCB.put(n, f);\n }\n\n for (int x = 0; x < sizeCR; ++x) {\n StringBuilder Key = new StringBuilder();\n StringBuilder Value = new StringBuilder();\n int n;\n int f;\n if (imagenaux[iteradorFreq] == '/') {\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Key.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n ++iteradorFreq;\n while (imagenaux[iteradorFreq] != '/') {\n Value.append(imagenaux[iteradorFreq]);\n ++iteradorFreq;\n }\n }\n if (Key.length() > 9) {\n //negativo\n String auxi = Key.toString();\n auxi = Utils.andOfString(auxi);\n n = Integer.parseInt(auxi, 2);\n ++n;\n n = -1 * n;\n } else {\n n = Integer.parseInt(Key.toString(), 2);\n }\n f = Integer.parseInt(Value.toString(), 2);\n FreqCR.put(n, f);\n }\n }", "public static int duplicateCount(String text) {\n \r\n int count=0; \r\n \r\n \r\n \r\n int l=text.length(); int index=0; String s1=\"\"; char [] c= new\r\n char [text.length()] ; for (int i=0;i <text.length();i++) {\r\n c[i]=text.toLowerCase().charAt(index++);\r\n \r\n System.out.println(\"Character at c[\"+i+\"] is\"+c[i]);\r\n \r\n }\r\n \r\n System.out.println(\"Character array is \"+Arrays.toString(c));\r\n \r\n int charSize=c.length; int index2=1;\r\n \r\n HashMap h =new HashMap();\r\n for (int i=0;i<charSize;i++)\r\n {\r\n for(int j=i+1;j<charSize;j++)\r\n {\r\n if (c[i]==c[j])\r\n {\r\n count++;\r\n //s1=s1+c[j];\r\n \r\n h.put(c[j],count);\r\n }\r\n }\r\n }\r\n \r\n \r\n System.out.println(h);\r\n \r\n int hsize= h.size();\r\n \r\n return hsize;\r\n }", "void countSortG(char[] str) {\n\t\tchar[] output = new char[str.length];\n\n\t\t// Create a count array to store count of inidividul characters and\n\t\t// initialize count array as 0\n\t\tint[] count = new int[RANGEG + 1];\n\t\t;\n\t\tint i = 0;\n\n\t\t// Store count of each character\n\t\tfor (i = 0; i < str.length; ++i)\n\t\t\t++count[str[i]];\n\n\t\t// Change count[i] so that count[i] now contains actual position of\n\t\t// this character in output array\n\t\tfor (i = 1; i <= RANGE; ++i)\n\t\t\tcount[i] += count[i - 1];\n\n\t\t// Build the output character array\n\t\tfor (i = 0; i < str.length; ++i) {\n\t\t\toutput[count[str[i]] - 1] = str[i];\n\t\t\t--count[str[i]];\n\t\t}\n\n\t\t// Copy the output array to str, so that str now\n\t\t// contains sorted characters\n\t\tfor (i = 0; i < str.length; ++i)\n\t\t\tstr[i] = output[i];\n\n\t\tSystem.out.println();\n\t}", "public void getOccuringChar() \n\t\t {\n\t\t \tint count[] = new int[MAX_CHAR]; \n\t\t \t \n\t\t int len = str.length(); \n\t\t \n\t\t // Initialize count array index \n\t\t for (int i = 0; i < len; i++) \n\t\t count[str.charAt(i)]++; \n\t\t \n\t\t // Create an array of given String size \n\t\t char ch[] = new char[str.length()]; \n\t\t for (int i = 0; i < len; i++) { \n\t\t ch[i] = str.charAt(i); \n\t\t int find = 0; \n\t\t for (int j = 0; j <= i; j++) { \n\t\t \n\t\t // If any matches found \n\t\t if (str.charAt(i) == ch[j]) \n\t\t find++; \n\t\t } \n\t\t \n\t\t if (find == 1) \n\t\t System.out.println(\"Number of Occurrence of \" + \n\t\t str.charAt(i) + \" is:\" + count[str.charAt(i)]); \n\t\t } \n\t\t }", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Enter a word:\");\n String word = scan.next();\n System.out.println(\"Enter character:\");\n char character = scan.next().charAt(0);\n\n int count=0; //count frequency of character\n for (int i =0; i<word.length(); i++) {\n char each = word.charAt(i); //each character by given string word\n\n if (each == character) { //if each character in str is matching with ch\n count++; //count increase the frequency of ch by 1\n\n }\n }\n System.out.println(count);\n\n System.out.println(\"===========================\");\n\n\n\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s1=\"Hi Hello\";\n\t\tfrequent(s1);\n//\t\tchar ch[] = s1.toCharArray();\n//\t\tchar ch1;\n//\t\tchar ch2[]=new char[10];\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\tSystem.out.println(ch[i]);\n//\t\t}\n//\t\t\n//\t\tfor(int i=0;i<ch.length;i++) {\n//\t\t\t\n//\t\t\tint count=1;\n//\t\t\tfor(int j=i+1;j<ch.length;j++) {\n//\t\t\t\t\n//\t\t\t\tif(ch[i]==ch[j]) {\n//\t\t\t\t\t\n//\t\t\t\t\tcount++;\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}System.out.println(\"Count of \"+ch[i]+\"=\"+count);\n//\t\t}\n\t\t\n\t\t\n\t\n\n\t}", "public void tempArray() {\n for (int i = 0; i < newWord.length(); i++) {\n for (String c : keySetNewWord) {\n if(String.valueOf(newWord.charAt(i)).equals(c)) {\n int p = mapNewWord.get(c) + 1;\n mapNewWord.put(c, p);\n }\n }\n }\n }", "@Override\n\tpublic int showFrequency(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn hashArray[hashVal].frequency;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public void getCounts() {\t\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++)\r\n\t\t\tfor(int j = 0; j < 3; j++)\r\n\t\t\t\tthecounts[i][j] = 0;\r\n\t\t\r\n\t\tfor(int i=0;i<maps.length-1;i++) {\r\n\t\t\tif(maps.Array1.charAt(i) == 'H' && maps.Array1.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[0][0]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == 'E' && maps.Array1.charAt(i+1) =='-') \r\n\t\t\t\tthecounts[0][1]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[0][2]++;\r\n\t\t\tif(maps.Array2.charAt(i) == 'H' && maps.Array2.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[1][0]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == 'E' && maps.Array2.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[1][1]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == '-' && maps.Array2.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[1][2]++;\r\n\t\t\tif(maps.Array3.charAt(i) == 'H' && maps.Array3.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[2][0]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == 'E' && maps.Array3.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[2][1]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == '-' && maps.Array3.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[2][2]++;\r\n\t\t\tif(maps.Array4.charAt(i) == 'H' && maps.Array4.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[3][0]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == 'E'&&maps.Array4.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[3][1]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[3][2]++;\r\n\t\t}\r\n\t\t\r\n\t\t//Getting transition value between 1 and 0\r\n\t\tfor(int i=0;i<4;i++) {\r\n\t\t\tfor(int j=0;j<3;j++) {\r\n\t\t\t\tthecounts[i][j]/=maps.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Displaying the obtained values\r\n\t\tSystem.out.println(\"\\nTRANSITION\");\r\n\t\tSystem.out.println(\"HYDROPHOBICITY: 1->2: \" + thecounts[0][0] + \" 2->3: \" + thecounts[0][1] + \" 3->1: \" + thecounts[0][2]);\r\n\t\tSystem.out.println(\"POLARIZABILITY: 1->2: \" + thecounts[1][0] + \" 2->3: \" + thecounts[1][1] + \" 3-1: \" + thecounts[1][2]);\r\n\t\tSystem.out.println(\"POLARITY: 1->2: \" + thecounts[2][0] + \" 2->3: \" + thecounts[2][1] + \" 3->1: \" + thecounts[2][2]);\r\n\t\tSystem.out.println(\"VAN DER WALLS VOLUME: 1->2: \" + thecounts[3][0] + \" 2->3: \" + thecounts[3][1] + \" 3->1: \" + thecounts[3][2]);\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n String res= freqAlphabets( \"10#11#12\");\n System.out.println(res);\n }", "public static ArrayList<Integer> findAnagrams(String s, String p) {\r\n\t \t \r\n\t \t //write your code here\r\n\t\t if(s.length()<p.length()) {\r\n\t\t\t ArrayList<Integer> arr = new ArrayList<>();\r\n\t\t\t return arr;\r\n\t\t }\r\n\t\t ArrayList<Integer> result = new ArrayList<>();\r\n\t\t HashMap<Character,Integer> P = new HashMap<>();\r\n\t\t HashMap<Character,Integer> H = new HashMap<>();\r\n\t\t \r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = p.charAt(i);\r\n\t\t\t if(!P.containsKey(ch)) {\r\n\t\t\t\t P.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t P.put(ch,P.get(ch)+1);\r\n\t\t\t }\r\n\t\t }\r\n\t\t int start =0;\r\n\t\t int end=0;\r\n\t\t int mcount=0;\r\n\t\t for(int i=0;i<p.length();i++) {\r\n\t\t\t char ch = s.charAt(i);\r\n\t\t\t if(!H.containsKey(ch)) {\r\n\t\t\t\t H.put(ch,1);\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t H.put(ch,H.get(ch)+1);\r\n\t\t\t }\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t if(P.get(ch)>=H.get(ch)) {\r\n\t\t\t\t\t mcount++;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t end=i;\r\n\t\t }\r\n\t\t if(mcount==p.length()) {\r\n\t\t\t result.add(start);\r\n\t\t }\r\n\t\t while(end<s.length()-1) {\r\n\t\t\t char ch=s.charAt(start);\r\n\t\t\t int hfreq = H.get(ch)-1;\r\n\t\t\t H.put(ch,hfreq);\r\n\t\t\t if(H.get(ch)==0) {\r\n\t\t\t\t H.remove(ch);\r\n\t\t\t }\r\n\t\t\t int pfreq=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreq=P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreq<pfreq) {\r\n\t\t\t\t mcount--;\r\n\t\t\t }\r\n\t\t\t ch=s.charAt(end+1);\r\n\t\t\t int hfreqend=0;\r\n\t\t\t if(H.containsKey(ch)) {\r\n\t\t\t\t hfreqend = H.get(ch);\r\n\t\t\t }\r\n\t\t\t hfreqend++;\r\n\t\t\t H.put(ch, hfreqend);\r\n\t\t\t int pfreqend=0;\r\n\t\t\t if(P.containsKey(ch)) {\r\n\t\t\t\t pfreqend = P.get(ch);\r\n\t\t\t }\r\n\t\t\t if(hfreqend<=pfreqend) {\r\n\t\t\t\t mcount++;\r\n\t\t\t }\r\n\t\t\t start++;\r\n\t\t\t end++;\r\n\t\t\t if(mcount==p.length()) {\r\n\t\t\t\t result.add(start);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t }\r\n\t\t return result;\r\n\t\t \r\n\t \t \r\n\t }", "static boolean possibleSameCharFreqByOneRemoval(String str)\n {\n int l = str.length();\n\n // fill frequency array\n int[] freq = new int[M];\n\n for (int i = 0; i < l; i++)\n freq[getIdx(str.charAt(i))]++;\n\n // if all frequencies are same, then return true\n if (allSame(freq, M))\n return true;\n\n /* Try decreasing frequency of all character\n by one and then check all equality of all\n non-zero frequencies */\n for (char c = 'a'; c <= 'z'; c++) {\n int i = getIdx(c);\n\n // Check character only if it occurs in str\n if (freq[i] > 0) {\n freq[i]--;\n\n if (allSame(freq, M))\n return true;\n freq[i]++;\n }\n }\n\n return false;\n }", "public static void main(String[] args)\n {\n System.out.println(\"Enter your sentence: \");\n Scanner in = new Scanner(System.in);\n //Take the entered sentence\n String input = in.nextLine();\n //This is for searching\n char auxiliary = 'a';\n //This is the final letter which has the highest occurrence\n char[] letter = new char[26];\n int arrayCounter = 0;\n //This is simply a counter\n int frequency = 0;\n //This shows the highest frequency of a letter inside the entered sentence\n int maxFrequency = 0;\n //The outer loop goes for all letters in English\n for(int i = 0; i < 26; i++)\n {\n //The inner loop searches along the whole entered sentence\n for(int j = 0; j < input.length(); j++)\n {\n //No matter if the letter inside the sentence is capital or small\n if((auxiliary+i == input.charAt(j)) || (auxiliary+i-32 == input.charAt(j)))\n {\n frequency++;\n }\n }\n //The counted number and its associated letter are saved as maxFrequency and\n //letter respectively, only if it is higher than the\n //previous maxFrequency\n if(frequency > maxFrequency)\n {\n maxFrequency = frequency;\n frequency = 0;\n letter[arrayCounter] = (char) (auxiliary+i);\n arrayCounter++;\n }\n //In case more than one letter has been repeated with the highest frequency\n else if((frequency == maxFrequency) && ((maxFrequency > 0)))\n {\n frequency = 0;\n letter[arrayCounter] = (char) (auxiliary+i);\n arrayCounter++;\n }\n else\n {\n //If not bigger than the max, its value simply vanishes!\n frequency = 0;\n }\n }\n System.out.print(\"The letter(s) \");\n for(int i = 0; i < arrayCounter-1; i++)\n {\n System.out.print(letter[i] + \", \");\n }\n System.out.print(letter[arrayCounter-1]);\n System.out.print(\" has/have been repeated (regardless of being small or capital) \"\n +maxFrequency+\" times,\" +\n \" which is the maximum in this entered sentence!\");\n }", "public static void countSort(char seq[])\n {\n Arrays.sort(seq); \n }", "public static void main(String[] args) {\n\t\tScanner stdin = new Scanner(System.in);\n\t\tString line = stdin.nextLine().toLowerCase();\n\t\tint[] freq = new int[26];\n\t\tint cnt = 0;\n\t\tfor (int i=0; i<line.length(); i++) {\n\t\t\tif (line.charAt(i) >= 'a' && line.charAt(i) <='z') {\n\t\t\t\tfreq[line.charAt(i)-'a']++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// We greedily assign these in order.\n\t\tArrays.sort(freq);\n\t\t\n\t\t// So make the most frequent characters the cheapest.\n\t\tint cost = 0;\n\t\tfor (int i=0,j=freq.length-1; j>=0; i++,j--)\n\t\t\tcost += (freq[j]*COST[i]);\n\t\t\t\n\t\t// Separators.\n\t\tcost += (3*(cnt-1));\n\t\t\t\t\n\t\t// Ta da!\n\t\tSystem.out.println(cost);\n\t}", "static String isValid(String s){\n // Complete this function\n int[] charArray = new int[26];\n for(int i=0;i<26;i++){\n charArray[i] = 0;\n }\n for(int i=0;i<s.length();i++){\n int index = s.charAt(i) - 'a';\n charArray[index]++;\n }\n boolean oneDelete = false;\n //int prevValue = charArray[0];\n //System.out.println(\"a\" + \": \" + charArray[0]);\n /*for(int i=1;i<26;i++){\n System.out.println((char) (i+'a') + \": \" + charArray[i] + \" \" + \"prevValue\" + \": \" + prevValue);\n \n if(charArray[i] !=0 && prevValue!= 0 && charArray[i] != prevValue){\n if(oneDelete){\n return \"NO\";\n }else{\n if(Math.abs(charArray[i] - prevValue) != 1){\n return \"NO\";\n }else{\n oneDelete = true;\n }\n }\n }\n if(charArray[i] !=0){\n prevValue = charArray[i]; \n }\n }*/\n HashMap<Integer,Integer> frequencyCount = new HashMap<>();\n for(int i=0;i<26;i++){\n if(charArray[i] !=0){\n if(!frequencyCount.containsKey(charArray[i])){\n frequencyCount.put(charArray[i],1);\n }else{\n int count =frequencyCount.get(charArray[i]);\n frequencyCount.put(charArray[i],count+1);\n }\n }\n }\n \n if(frequencyCount.size() > 2){\n return \"NO\";\n }else if(frequencyCount.size() == 2){\n if(frequencyCount.containsKey(1) && frequencyCount.get(1) == 1){\n return \"YES\";\n }\n if(isConsecutiveFrequencies(frequencyCount)){\n return \"YES\";\n }else{\n return \"NO\";\n }\n }else{\n return \"YES\"; \n }\n \n \n }", "private static Map<Character, Integer> countChars(char[] characters) {\n\t\t/**\n\t\t * creating hashMap called map for storing the character along with count\n\t\t */\n\t\tMap<Character, Integer> map = new HashMap<>();\n\t\t/**\n\t\t * using for as outerloop to take each character for checking\n\t\t */\n\t\tfor (int i = 0; i < characters.length; i++) {\n\t\t\t/**\n\t\t\t * declaring count variable to keep count of repeated characters\n\t\t\t */\n\t\t\tint count = 0;\n\t\t\t/**\n\t\t\t * inner loop for checking the character with particular character\n\t\t\t */\n\t\t\tfor (int j = 0; j < characters.length; j++) {\n\t\t\t\t/**\n\t\t\t\t * if both the character are equal increment the count\n\t\t\t\t */\n\t\t\t\tif (characters[i] == characters[j]) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * checking if the character already exists in map to remove duplicates\n\t\t\t */\n\t\t\tif (!(map.containsKey(characters[i]))) {\n\t\t\t\t/**\n\t\t\t\t * adding the character and the character count into the map\n\t\t\t\t */\n\t\t\t\tmap.put(characters[i], count);\n\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * returning the map\n\t\t */\n\t\treturn map;\n\t}", "public static char getMaxFreq(String str){\n HashMap<Character,Integer> map=new HashMap<>();\n for(int i=0;i<str.length();i++){\n char cc=str.charAt(i);\n if(map.containsKey(cc)){\n int oldValue=map.get(cc);\n int newValue=oldValue+1;\n map.put(cc,newValue);\n }else{\n map.put(cc,1);\n }\n }\n char maxChar='\\0';\n int max=0;\n Set<Map.Entry<Character,Integer>> entries=map.entrySet();\n for(Map.Entry<Character,Integer> entry:entries){\n if(entry.getValue()>max){\n max=entry.getValue();\n maxChar=entry.getKey();\n }\n }\n return maxChar;\n }", "private static String hashWord(String word) {\n int[] counts = new int[26];\n for (char c : word.toCharArray()) { // O(c)\n counts[(int)c-97]++;\n }\n StringBuilder sb = new StringBuilder();\n for (int i : counts) { // O(26)\n sb.append(Integer.toString(i));\n }\n return sb.toString();\n }", "public void analyze(ArrayList<String> words) throws IOException\n {\n int[] letterOccurences = new int[regularAlphabet.length];\n double[] percentOccurence = new double[letterOccurences.length];\n int numberOfLetters = 0;\n \n //Loops to calculate number of occurences per letter.\n for(int wordCount = 0; wordCount<words.size(); wordCount++)\n {\n for(int letterCount = 0; letterCount<words.get(wordCount).length(); letterCount++)\n {\n for(int alphabetCharacter = 0; alphabetCharacter<regularAlphabet.length; alphabetCharacter++)\n {\n if(regularAlphabet[alphabetCharacter].equalsIgnoreCase(words.get(wordCount).substring(letterCount, letterCount+1)))\n {\n letterOccurences[alphabetCharacter]++;\n numberOfLetters++;\n }\n }\n }\n }\n \n //Loop to calculate percent occurences of letters.\n for(int index = 0; index<percentOccurence.length; index++)\n {\n percentOccurence[index] = (letterOccurences[index]/(double)numberOfLetters)*100;\n }\n \n PrintWriter outFile = new PrintWriter (new File(\"ciphertextfreq.txt\"));\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%6s | %12s | %11s|\",\"Letter\",\"Frequency\",\"Percent\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.printf(\"|%6s | %12s | %11s|\\n\",\"Letter\",\"Frequency\",\"Percent\");\n System.out.println(\"-------------------------------------------\");\n for(int printIndex = 0; printIndex<regularAlphabet.length; printIndex++)\n {\n outFile.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n System.out.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\\n\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n }\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%5s | %10d | %10d%s|\",\"Total\",numberOfLetters,100,\"%\");\n System.out.printf(\"|%5s | %10d | %10d%s|\\n\",\"Total\",numberOfLetters,100,\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.close();\n }", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tString S = s.nextLine();\n\t\tint[] freq = new int[26]; // 빈도수 저장\n\t\tfor (int i = 0; i < S.length(); i++) {\n\t\t\tfreq[S.charAt(i) - 97]++;\n\t\t}\n\t\tfor (int i = 0; i < freq.length; i++) {\n\t\t\tif (i == freq.length - 1)\n\t\t\t\tSystem.out.println(freq[i]);\n\t\t\telse\n\t\t\t\tSystem.out.print(freq[i] + \" \");\n\t\t}\n\t}", "public void getProfileCounts(char[][] c, int j, int[] counts) {\n for (int i = 0; i < c.length; i++) {\n switch (c[i][j]) {\n case 'A':\n counts[0]++;\n break;\n case 'C':\n counts[1]++;\n break;\n case 'G':\n counts[2]++;\n break;\n case 'T':\n counts[3]++;\n break;\n }\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tString s = \"asdfasdfafk asd234asda\";\n\t //Map<Character, Integer> charMap = new HashMap<Character, Integer>();\n\t \n\t Map<Character,Integer> map = new HashMap<Character,Integer>();\n\t for (int i = 0; i < s.length(); i++) {\n\t char c = s.charAt(i);\n\t System.out.println(c);\n\t //if (Character.isAlphabetic(c)) {\n\t if (map.containsKey(c)) {\n\t int cnt = map.get(c);\n\t System.out.println(cnt);\n\t map.put(c,++cnt);\n\t } else {\n\t map.put(c, 1);\n\t }\n\t \n\t }\n\t // }\n\t System.out.println(map);\n\t \n\t \n\t /* char[] arr = str.toCharArray();\n\t System.out.println(arr);\n\t \n\n\t\t\n\t\tfor (char value: arr) {\n\t\t \n\t\t if (Character.isAlphabetic(value)) { \n\t\t\t if (charMap.containsKey(value)) {\n\t\t charMap.put(value, charMap.get(value) + 1);\n\t\t \n\t\t } \n\t\t\t else { charMap.put(value, 1); \n\t\t } \n\t\t\t } \n\t\t }\n\t\t \n\t\t System.out.println(charMap);*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n \t}", "private static String stringCompress(String input) {\n int length = input.length();\n int count = 0;\n StringBuilder output = new StringBuilder();\n char curr = input.charAt(0);\n for(int i=0;i<length;i++){\n char temp = input.charAt(i);\n // If the current char is the same as previous one\n // we increment the counter and move to the next one\n if(curr == temp)\n count++;\n // If the current char is not same as previous one\n // we add the char and its frequency to output\n else{\n output.append(curr);\n output.append(count);\n // reset the counter for next char\n count = 1;\n curr = temp;\n }\n }\n // The last char and its frequency are yet to be added\n output.append(curr);\n output.append(count);\n return output.toString();\n }", "private List<Tuple> charCountMap(Tuple input) {\n \n String[] words = input.snd().replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n \n List<Tuple> output = new ArrayList<Tuple>();\n \n for(String word : words) {\n Integer chars = word.length();\n output.add(new Tuple(chars.toString(),\"1\"));\n }\n \n lolligag();\n \n //<charCount, 1>, <charCount, 1> ...\n return output;\n }", "int main() \n{\n string s1,s2;\n cin>>s1>>s2;\n int freq[128]={0},i;\n for(i=0;i<s1.length();i++)\n freq[s1[i]]++;\n for(i=0;i<s2.length();i++)\n freq[s2[i]]--;\n for(i=0;i<128;i++)\n {\n if(freq[i]!=0)\n {\n cout<<\"Not anagrams\";\n return 0;\n }\n }\n cout<<\"Anagram\";\n}", "public void countWordLengthsWithIsLettermethod(FileResource resource, int[] counts) {\r\n for (String word : resource.words()) {\r\n String trim = word.trim();\r\n int wordSize = trim.length();\r\n char firstChar = trim.charAt(0);\r\n char endChar = trim.charAt(trim.length()-1);\r\n if (!Character.isLetter(firstChar) && !Character.isLetter(endChar)) {\r\n wordSize -= 2;\r\n } else \r\n if (!Character.isLetter(firstChar) || !Character.isLetter(endChar)) {\r\n wordSize -= 1;\r\n }\r\n if(wordSize>=counts.length) {\r\n counts[counts.length-1] += 1; \r\n } else\r\n //right algorithm\r\n if( wordSize> 0 && counts[wordSize] != 0 ) {\r\n counts[wordSize] += 1;\r\n \r\n } else if ( wordSize> 0) {\r\n counts[wordSize] = 1;\r\n }\r\n }\r\n \r\n //test\r\n for(int i : counts) {\r\n System.out.println(i);\r\n }\r\n }", "public void doCount(ArrayList<String> liste){\n\t\tint j;\n\t\t\n\t\tfor (int i = 0; i < liste.size(); i++) {\n\t\t\t// check if string already exists\n\t\t\tif(!map.containsKey(liste.get(i))){\n\t\t\t\t// check frequency of the given string\n\t\t\t\tj = Collections.frequency(liste, liste.get(i));\t\n\t\t\t\t\n\t\t\t\t// underscore instead of blank space\n\t\t\t\tif(liste.get(i).equals(\" \"))\n\t\t\t\t\tmap.put(\"_\", j);\t\n\t\t\t\telse\n\t\t\t\t\tmap.put(liste.get(i), j);\t// (char, frequency)\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t\n\t\t//return map;\n\t}", "public static void main(String[] args) {\n\n\t\tint[] a = {1,2,3,8,8,9,6,4};\n\t String s = \"hello2java\"; \n\t\tHashMap<Integer,Integer> countMap1 = new HashMap<Integer,Integer>();\n\t\tHashMap<Character,Integer> countMap2 = new HashMap<Character,Integer>();\n \n\t\tchar[] ch = s.toCharArray();\n\t\t\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tif(countMap1.containsKey(a[i])){\n\t\t\t\t\tcountMap1.put(a[i], countMap1.get(a[i])+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcountMap1.put(a[i],1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//}\n\t\tSystem.out.println(countMap1);\n\t\t\n\t\tfor(int i=0;i<ch.length;i++){\n\t\t\tif(countMap2.containsKey(ch[i])){\n\t\t\t\tcountMap2.put(ch[i], countMap2.get(ch[i])+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap2.put(ch[i],1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(countMap2);\n\t\t\n\t\tSet<Character> ket = countMap2.keySet();\n for(Character c:ket){\n \tif(countMap2.get(c)>1){\n \t\tSystem.out.println(c+\"-->\"+countMap2.get(c));\n \t}\n }\n\t}", "protected void int2alphaCount(long val, CharArrayWrapper aTable,\n FastStringBuffer stringBuf)\n {\n\n int radix = aTable.getLength();\n char[] table = new char[radix];\n\n // start table at 1, add last char at index 0. Reason explained above and below.\n int i;\n\n for (i = 0; i < radix - 1; i++)\n {\n table[i + 1] = aTable.getChar(i);\n }\n\n table[0] = aTable.getChar(i);\n\n // Create a buffer to hold the result\n // TODO: size of the table can be detereined by computing\n // logs of the radix. For now, we fake it.\n char buf[] = new char[100];\n\n //some languages go left to right(ie. english), right to left (ie. Hebrew),\n //top to bottom (ie.Japanese), etc... Handle them differently\n //String orientation = thisBundle.getString(org.apache.xml.utils.res.XResourceBundle.LANG_ORIENTATION);\n // next character to set in the buffer\n int charPos;\n\n charPos = buf.length - 1; // work backward through buf[] \n\n // index in table of the last character that we stored\n int lookupIndex = 1; // start off with anything other than zero to make correction work\n\n // Correction number\n //\n // Correction can take on exactly two values:\n //\n // 0 if the next character is to be emitted is usual\n //\n // radix - 1\n // if the next char to be emitted should be one less than\n // you would expect\n // \n // For example, consider radix 10, where 1=\"A\" and 10=\"J\"\n //\n // In this scheme, we count: A, B, C ... H, I, J (not A0 and certainly\n // not AJ), A1\n //\n // So, how do we keep from emitting AJ for 10? After correctly emitting the\n // J, lookupIndex is zero. We now compute a correction number of 9 (radix-1).\n // In the following line, we'll compute (val+correction) % radix, which is,\n // (val+9)/10. By this time, val is 1, so we compute (1+9) % 10, which\n // is 10 % 10 or zero. So, we'll prepare to emit \"JJ\", but then we'll\n // later suppress the leading J as representing zero (in the mod system,\n // it can represent either 10 or zero). In summary, the correction value of\n // \"radix-1\" acts like \"-1\" when run through the mod operator, but with the\n // desireable characteristic that it never produces a negative number.\n long correction = 0;\n\n // TODO: throw error on out of range input\n do\n {\n\n // most of the correction calculation is explained above, the reason for the\n // term after the \"|| \" is that it correctly propagates carries across\n // multiple columns.\n correction =\n ((lookupIndex == 0) || (correction != 0 && lookupIndex == radix - 1))\n ? (radix - 1) : 0;\n\n // index in \"table\" of the next char to emit\n lookupIndex = (int)(val + correction) % radix;\n\n // shift input by one \"column\"\n val = (val / radix);\n\n // if the next value we'd put out would be a leading zero, we're done.\n if (lookupIndex == 0 && val == 0)\n break;\n\n // put out the next character of output\n buf[charPos--] = table[lookupIndex]; // left to right or top to bottom \n }\n while (val > 0);\n\n stringBuf.append(buf, charPos + 1, (buf.length - charPos - 1));\n }", "public void displayFrequency(int[] frequencyCount) {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t// For every character...\n\t\tfor (int i = 0; i < frequencyCount.length; i++) {\n\t\t\tif (frequencyCount[i] > 0) { // if it appears at least once..\n\t\t\t\t// tabs have a char value of 9\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t// new lines have a char value of 10\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t} else {\n\t\t\t\t\t// everything else is simply the same but as a char.\n\t\t\t\t\t// the index i is the char values\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t// the values at i is (char)i's frequency.\n\t\t\t\ttoPrint.append(\":\" + frequencyCount[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(toPrint.toString());\n\t}", "public static void main(String[] args) {\n String str = \"abcDaaafmOO\";\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n System.out.println(\"unique values are: \"+uniques);\n System.out.println(\"========================\");\n String str2 = \"ppppoifugggggsxL\";\n String uniques2 = uniques(str2);\n System.out.println(\"unique values are: \"+uniques2);\n }", "float getFrequency();", "public void countOfLetters()\n {\n Scanner sc = new Scanner(System.in);\n //Ask an user to enter a string\n System.out.print(\"Enter a string: \");\n //Read next line as string and assign it value to String str\n String str = sc.nextLine();\n\n //Create a new int array with 26 elements\n int []Letters = new int[26];\n\n //For each index in str\n for(int i = 0; i < str.length(); i++)\n {\n //Get current character\n char c = str.toLowerCase().charAt(i);\n //Get char as int\n int val = (int)c;\n //If char is letter\n if(val >= 97 && val <= 122)\n {\n //Increment a value at position of this letter\n Letters[c-'a']++;\n }\n }\n //Get sum of the array\n int Sum = Arrays.stream(Letters).sum();\n //For each index in Letters\n for(int i = 0; i<Letters.length; i++)\n {\n //If value of current position > 0 then print count of this letter at given string and its percentage\n if(Letters[i] > 0)\n {\n System.out.printf(\"The count of `%c` is %x, the percentage is %f \\n\", (char)97+i, Letters[i], (double)Letters[i]/Sum);\n }\n }\n\n }", "public static void getFreq(){\n\t\t\tint mutTotalcounter=0;\n\t\t\t\n\t\t\tfor(int i=0; i<numOfMutations.length-1; i++){\n\t\t\t\t\n\t\t\t\tif(numOfMutations[i]==numOfMutations[i+1]){\n\t\t\t\t\tfrequency[mutTotalcounter]+=1; //if number of mutation is repeated in original array, frequency is incremented\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(numOfMutations[i]!=numOfMutations[i+1])\n\t\t\t\t{\n\t\t\t\t\tmutTotal[mutTotalcounter++]=numOfMutations[i]; //if number is not repeated in array, the next element in array\n\t\t\t\t\t//becomes the next number of mutations that occurred\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((i+1)==numOfMutations.length-1){\n\t\t\t\t\t//used to get the last element in original array since for loop will go out of bounds\n\t\t\t\t\tmutTotal[mutTotalcounter]=numOfMutations[i+1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"XMut : YFreq\");\n\t\t\t//console display of mutation and frequency values\n\t\t\tfor (int i=0; i<=mutTotal.length-1;i++){\n\t\t\t\tif(mutTotal[i]==0 && frequency[i]==0) continue;\n\t\t\t\tfrequency[i]+=1;\n\t\t\t\tSystem.out.print(mutTotal[i]+\" : \");\n\t\t\t\tSystem.out.print(frequency[i]);\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t}", "public static void main(String[] args) {\n Scanner teclado = new Scanner(System.in);\r\n String mensajeUsuario;\r\n System.out.println(\"Ingrese su mensaje:\");\r\n mensajeUsuario = teclado.nextLine();\r\n \r\n ArrayList inicial = new ArrayList<Nodo>();\r\n \r\n boolean valido = true;\r\n int contador = 0;\r\n //Se convierte el mensaje a una array de chars\r\n char [] arrayMensaje = mensajeUsuario.toCharArray();\r\n //Se cuenta la frecuencia de cada elemento\r\n for(char i: arrayMensaje){\r\n valido = true;\r\n Iterator itr = inicial.iterator();\r\n //Si el elemento que le toca no fue contado ya, es valido contar su frecuencia\r\n while (itr.hasNext()&&valido){\r\n Nodo element = (Nodo) itr.next();\r\n if (i==element.getCh()){\r\n valido = false;\r\n }\r\n }\r\n //Contar la frecuencia del elemento\r\n if (valido== true){\r\n Nodo temp = new Nodo();\r\n temp.setCh(i);\r\n for (char j:arrayMensaje){\r\n if (j==i){\r\n contador++;\r\n }\r\n }\r\n temp.setFreq(contador);\r\n inicial.add(temp);\r\n contador = 0;\r\n \r\n }\r\n }\r\n //Se recorre la lista generada de nodos para mostrar la frecuencia de cada elemento ene el orden en que aparecen\r\n System.out.println(\"elemento | frecuencia\");\r\n Iterator itr = inicial.iterator();\r\n while (itr.hasNext()){\r\n Nodo element = (Nodo)itr.next();\r\n System.out.println(element.getCh() + \" \"+ element.getFreq());\r\n }\r\n \r\n HuffmanTree huff = new HuffmanTree();\r\n huff.createTree(inicial);\r\n //System.out.println(huff.getRoot().getCh()+\" \"+huff.getRoot().getFreq());\r\n \r\n huff.codificar();\r\n System.out.println(\"elemento | frecuencia | codigo\");\r\n Iterator itrf= huff.getListaH().iterator();\r\n while(itrf.hasNext()){\r\n Nodo pivotal = (Nodo)itrf.next();\r\n System.out.println(pivotal.getCh() + \" \"+ pivotal.getFreq()+ \" \"+ pivotal.getCadena()); \r\n }\r\n \r\n System.out.println(\"Ingrese un codigo en base a la tabla anterior, separando por espacios cada nuevo caracter\");\r\n mensajeUsuario = teclado.nextLine();\r\n mensajeUsuario.indexOf(\" \");\r\n String mensajeFinal = \"\";\r\n String letra = \" \";\r\n String[] arrayDecode = mensajeUsuario.split(\" \");\r\n boolean codigoValido = true;\r\n for (String i: arrayDecode){\r\n if (codigoValido){\r\n letra = huff.decodificar(i);\r\n }\r\n if (letra.length()>5){\r\n codigoValido = false;\r\n }\r\n else {\r\n mensajeFinal = mensajeFinal.concat(letra);\r\n }\r\n }\r\n \r\n if (codigoValido){\r\n System.out.println(mensajeFinal);\r\n }\r\n else {\r\n System.out.println(\"El codigo ingresado no es valido\");\r\n }\r\n \r\n \r\n }", "public int getFrequency(char symbol) {\r\n if(isEmpty()){\r\n throw new ArrayIndexOutOfBoundsException(\"No symbols in table\");\r\n }\r\n else {\r\n Node symbolNode = first;\r\n while(true) {\r\n if(symbolNode.symbol == symbol) {\r\n return symbolNode.frequency;\r\n }\r\n else if(symbolNode.next == null) {\r\n throw new NoSuchElementException(\"Symbol is not in the table\");\r\n }\r\n else {\r\n symbolNode = symbolNode.next;\r\n }\r\n }\r\n }\r\n }", "public void sortChars(String[] array){\n HashMap<String, LinkedList<String>> list = new HashMap<String, LinkedList<String>>();\n\n for(String s: array){\n String key = sortChars(s);\n if(!list.containsKey(key)){\n list.put(key, new LinkedList<String>());\n }\n LinkedList<String> anagrams = list.get(key);\n anagrams.push(s);\n }\n\n int index = 0;\n for(String key: list.keySet()){\n LinkedList<String> anagrams = list.get(key);\n for(String val: anagrams){\n array[index] = val;\n index++;\n }\n }\n }", "public static void main(String[] args) {\n\n\t\tString str = \"Better Butter\";\n\t\t// char[] chararray=s.toCharArray();\n\n\t\tHashMap<Character, Integer> map = new HashMap<>();\n\n\t\t// if(hm.containsKey(s.charAt(index)))\n\n\t\tfor (int i = str.length() - 1; i >= 0; i--) {\n\n\t\t\tif (map.containsKey(str.charAt(i))) {\n\n\t\t\t\tif (str.charAt(i) == '\\0') {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\tint count = map.get(str.charAt(i));\n\t\t\t\tmap.put(str.charAt(i), ++count);\n\t\t\t\tSystem.out.println(map);\n\t\t\t} else {\n\t\t\t\tmap.put(str.charAt(i), 1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(map);\n\t}", "static void sortByFreq(int arr[], int n){\n Map<Integer, Integer> map = new HashMap<>(); \n List<Integer> outputArray = new ArrayList<>(); \n \n // Assign elements and their count in the list and map \n for (int current : arr) { \n int count = map.getOrDefault(current, 0); \n map.put(current, count + 1); \n outputArray.add(current); \n } \n \n // Compare the map by value \n SortComparator comp = new SortComparator(map); \n \n // Sort the map using Collections CLass \n Collections.sort(outputArray, comp); \n \n // Final Output \n for (Integer i : outputArray) { \n System.out.print(i + \" \"); \n }\n }", "public static void main(String[] args) {\n HashMap<Character, Integer> finalChar = new HashMap<>();\n int charCount = 1;\n\n String str = \"If the product of two terms is zero then common sense says at least one of the two terms has to be zero to start with. \" +\n \"So if you move all the terms over to one side, \" +\n \"you can put the quadratics into a form that can be factored allowing that side of the equation to equal zero. \" +\n \"Once you’ve done that, it’s pretty straightforward from there.\";\n\n // convert String to char[] array\n char[] charInString = str.toCharArray();\n\n // iterate over charInString[] array using enhanced for loop\n for (char charName : charInString) {\n\n if (finalChar.containsKey(charName)) {\n finalChar.put(charName, finalChar.get(charName) + 1);\n } else {\n finalChar.put(charName, 1);\n }\n\n }\n System.out.println(finalChar);\n }", "Alphabet(String chars) {\n char[] newChars = chars.toCharArray();\n Map<Character, Integer> map = new HashMap<>();\n for (char c : newChars) {\n if (map.containsKey(c)) {\n int counter = map.get(c);\n map.put(c, ++counter);\n } else {\n map.put(c, 1);\n }\n }\n\n for (char c : map.keySet()) {\n if (map.get(c) > 1) {\n throw new EnigmaException(\"Duplicates Found\");\n } else {\n _letters = chars;\n }\n }\n }", "public static boolean areAnagramStringsUsingOneFrequencyArray(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n int[] f = new int[256];\n\n for (int i = 0; i < word1.length(); i++) {\n f[word1.charAt(i)]++;\n f[word2.charAt(i)]--;\n }\n\n for (int i = 0; i < f.length; i++) {\n if (f[i] != 0) {\n return false;\n }\n\n }\n return true;\n\n }", "public static void main(String[] args) {\n\t\t\t\n\t\t\tString input=\"ABCGRETCABCG\";\n\t\t\tint n = 3;\n\t\t\t\n\t\t\tMap<String,Integer> substrMap=new HashMap<String,Integer>();\n\t\t\t\n\t\t\tfor(int i=0;i+n<=input.length();i++){\n\t\t\t\t\n\t\t\t\tString substr=input.substring(i, i+n);\n\t\t\t\t\n\t\t\t\tint frequency=1;\n\t\t\t\t\n\t\t\t\tif(substrMap.containsKey(substr)){\n\t\t\t\t\t\n\t\t\t\t\tfrequency=substrMap.get(substr);\n\t\t\t\t\tfrequency++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsubstrMap.put(substr, frequency);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(substrMap.toString());\n\t\t}", "public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}", "public static void main(String args[]){\n Scanner sc=new Scanner(System.in);\n String str=sc.nextLine();\n int len=str.length();\n int stat[]=new int[26];\n for(int i=0;i<len;i++)\n {\n if((str.charAt(i)>='a') && ( str.charAt(i)<='z'))\n {\n int offset=str.charAt(i) - 'a';\n stat[offset]++; \n }\n if((str.charAt(i)>='A') && ( str.charAt(i)<='Z'))\n {\n int offset=str.charAt(i) - 'A';\n stat[offset]++; \n }\n }\n for(int i=0;i<26;i++)\n {\n \n if( stat[i]==0)\n {\n char ch=(char)('a'+i);\n System.out.print(ch+\" \");\n \n \n \n }\n }\n}", "static HashMap runLengthEncoding(List<Character> list){\r\n\t\t\r\n\t\tHashMap<Character,Integer> map=new HashMap<>();\r\n\t\t\r\n\t\tfor(char a:list)\r\n\t\t{\r\n\t\tif(map.get(a)==null)\r\n\t\t{\r\n\t\t\tmap.put(a, 1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmap.put(a, map.get(a)+1);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\treturn map;\r\n\t\r\n\t}", "boolean hasFreq();", "BoyerMoore(CharSequence p) {\n\t\t\tocc = new int[256];\n\t\t\tSystem.arraycopy(BASE, 0, occ, 0, 256);\n\t\t\tpattern = p;\n\t\t\tpatternLen = pattern.length();\n\t\t\tfor (int i = 0; i < pattern.length(); i++) {\n\t\t\t\tocc[pattern.charAt(i)] = i;\n\t\t\t}\n\t\t}", "public static void main(String[] args) {\n\t\tint arr[] = {1,5,3,1,2,5,7};\r\n\t\t//all elements are in range 1 to N (7 here)\r\n\t\t//find frequency of each element in O(N) and space complexity 1.\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\t//add any random number (say 10, greater than length)\r\n\t\t\t//to index 1 less than arr[i]\r\n\t\t\t//%10 to prevent overflow in case value comes out to be greater than allowed length\r\n\t\t\tarr[arr[i]%10 - 1] += 10;\r\n\t\t}\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\tSystem.out.println(\"Frequency of \" +(i+1) +\" is \"+ (arr[i]/10));\r\n\t\t}\r\n\t}", "private void buildFreqMap() {\n\t\toriginalFreq = new HashMap<String, WordOccurence>();\n\n\t\tfor (ListIterator<Caption> itr = original.captionIterator(0); itr\n\t\t\t\t.hasNext();) {\n\t\t\tfinal Caption currentCap = itr.next();\n\t\t\tfinal String[] words = currentCap.getCaption().split(\"\\\\s+\");\n\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\tfinal String lowerCasedWord = words[i].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(lowerCasedWord)) {\n\t\t\t\t\toriginalFreq.get(lowerCasedWord).addOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t} else {\n\t\t\t\t\tfinal WordOccurence occ = new WordOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t\toriginalFreq.put(lowerCasedWord, occ);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < identified.size(); i++) {\n\t\t\tResultChunk curretResult = identified.get(i);\n\t\t\tfinal String[] words = curretResult.getDetectedString().split(\n\t\t\t\t\t\"\\\\s+\");\n\t\t\tint identifiedAt = curretResult.getDetectedAt();\n\t\t\tfor (int j = 0; j < words.length; j++) {\n\t\t\t\tString currentWord = words[j].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(currentWord)) {\n\t\t\t\t\tint detectedAt = (int) (identifiedAt - (words.length - j)\n\t\t\t\t\t\t\t* AVG_WORD_TIME);\n\t\t\t\t\toriginalFreq.get(currentWord).addVoiceDetection(detectedAt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int getFreq(){ return frequency;}", "public static void main(String[] args) {\n Scanner inputScanner = new Scanner(System.in);\n System.out.println(\"Enter the filename to be used as the text:\");\n String file = inputScanner.nextLine();\n \n // Read in text from file\n String text = new String();\n try (BufferedReader reader = new BufferedReader(new FileReader(file))) {\n StringBuilder sb = new StringBuilder();\n String line = reader.readLine();\n \n while (line != null) {\n sb.append(line);\n line = reader.readLine();\n }\n text = sb.toString();\n }\n catch (Exception e) {\n System.out.println(e.toString());\n System.exit(-1);\n }\n \n // Preprocessing.\n long startTime = System.nanoTime();\n BWT L = new BWT(text);\n SuffixArray SA = new SuffixArray(text);\n WaveletTree WT = new WaveletTree(L.getBWT());\n \n // Obtain the alphabet of the text.\n HashSet<Character> textAlphabet = new HashSet<>();\n for (int i = 0; i < text.length(); i++) {\n textAlphabet.add(text.charAt(i));\n }\n \n System.out.println(\"The size of the alphabet of the text is \" + textAlphabet.size());\n \n // Compute the C mapping.\n Hashtable<Character, Integer> C = new Hashtable<>();\n for (Character c : textAlphabet) {\n // Add the character if it isn't already present.\n if (!C.contains(c))\n C.put(c, 0);\n \n // Iterate over the text, computing C.\n for (int i = 0; i < text.length(); i++) {\n if (text.charAt(i) < c) {\n C.put(c, C.get(c) + 1);\n }\n }\n }\n \n long endTime = System.nanoTime();\n long duration = (endTime - startTime);\n \n System.out.println(\"Construction time: \" + duration/1000000);\n \n // Search for patterns forever.\n Scanner input = new Scanner(System.in);\n String pattern = null;\n while (true) {\n System.out.println();\n System.out.println(\"Enter a pattern:\");\n pattern = input.nextLine();\n\n // Run the algorithm a hundred times to get a reasonable time value.\n startTime = System.nanoTime();\n int sp = 0;\n int ep = 0;\n for (int repeat = 0; repeat < 1000; repeat++) {\n // All values are prepared for the search.\n int i = pattern.length();\n sp = 1;\n ep = L.getBWT().length();\n while (sp <= ep && i >= 1) {\n char c = pattern.charAt(i-1);\n sp = C.get(c) + WT.occ(WT.getRoot(), sp - 1, c) + 1;\n ep = C.get(c) + WT.occ(WT.getRoot(), ep, c);\n i--;\n }\n }\n \n endTime = System.nanoTime();\n duration = (endTime - startTime);\n \n if (ep < sp)\n System.out.println(\"Pattern not found.\");\n else\n System.out.println(\"<sp, ep> pair is <\" + sp + \", \" + ep + \">\");\n\n// for (int j = sp; j <= ep; j++) {\n// System.out.println(SA.getSuffixArray().get(j-1).toString());\n// }\n \n System.out.println();\n System.out.println(\"The text length is \" + text.length());\n System.out.println(\"The pattern length is \" + pattern.length());\n System.out.println(\"1000 repetitions of the search took \" + duration/1000000 + \" milliseconds.\");\n }\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString input1=sc.nextLine();\r\ninput1=input1.toLowerCase();\r\nint l=input1.length();\r\nchar a[]=input1.toCharArray();\r\nint d[]=new int[1000];\r\nString str=\"\";\r\nint i=0,k1=0,k2=0,m=0,c1=0,c2=0,c3=0,l1=0,u=0,u1=0;\r\nchar b[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};\r\nfor(i=0;i<l;i++)\r\n{ c3=0;\r\n\tif(a[i]==' ')\r\n\t{u=i;c3=0;\r\n\t\tfor(k1=u1,k2=i-1;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tu1=i+1;\r\n\t\tc3=0;\r\n\t}\r\n\tif(i==l-1)\r\n\t{\r\n\t\tfor(k1=u+1,k2=i;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tk1=i+1;\r\n\t}\r\n}\r\n\r\n for(i=0;i<l1;i++)\r\n {\r\n\t str=str+Integer.toString(d[i]);\r\n }\r\n int ans=Integer.parseInt(str);\r\n System.out.print(ans);\r\n}", "public static String uniques(String str){\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n return uniques;\n\n }", "public void setFrequencies() {\n\t\tleafEntries[0] = new HuffmanData(5000, 'a');\n\t\tleafEntries[1] = new HuffmanData(2000, 'b');\n\t\tleafEntries[2] = new HuffmanData(10000, 'c');\n\t\tleafEntries[3] = new HuffmanData(8000, 'd');\n\t\tleafEntries[4] = new HuffmanData(22000, 'e');\n\t\tleafEntries[5] = new HuffmanData(49000, 'f');\n\t\tleafEntries[6] = new HuffmanData(4000, 'g');\n\t}", "public void firstNonRepeated(String str){\n Map<Character, Integer> map = new LinkedHashMap<Character, Integer>();\n\n /*Input string convert to array of char*/\n char[] charArray = str.toCharArray();\n\n\n /*Iterating through array, count and put in hashmap */\n for(char c:charArray) {\n if (map.get(c) != null)\n map.put(c, map.get(c) + 1);\n else\n map.put(c, new Integer(1));\n }\n\n\n /*Iterating through map and check if there is character with just one occurrence*/\n Set<Character> keySet = map.keySet();\n for(Character key : keySet){\n if (map.get(key) == 1){\n System.out.println(\"Character is: \"+ key);\n System.exit(0);\n }\n }\n System.out.println(\"There are no characters with just one occurrence!\");\n }", "private static double freqOfKey(int index) {\n return 440 * Math.pow(2, (double) (index - 12) / 24);\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int T = scan.nextInt();\n scan.nextLine();\n for(int i = 0 ; i < T ; i++){\n int count = 0;\n String text = scan.nextLine();\n char[] letters = text.toCharArray();\n\n if(letters.length > 0){\n char character = letters[0];\n\n for(int j = 1 ; j < letters.length ; j++){\n\n if(character == letters[j]){\n count++;\n }else{\n character = letters[j];\n }\n }\n }\n System.out.println(count);\n }\n scan.close();\n }", "private static HashMap<String, Double> ComputeRelativeFrequencyLetters(String text) {\n\tlong length = text.length();\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Search through the string and count each character.\n\tfor (int i = 0; i < length; i++) {\n\t char character = text.charAt(i);\n\n\t if ((character >= 'A' && character <= 'Z'))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this character yet, frequency is 1, otherwise, increment it.\n\t\tif (freqMap.get(Character.toString(character)) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(Character.toString(character)) + 1;\n\t\t}\n\t\tfreqMap.put(Character.toString(character), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "public static void main(String[] args) {\n\r\n\t\tint arr[]={2, 3, 2, 4, 5, 12, 2, 3, 3, 3, 12};\r\n\t\tMap<Integer,Data> map = new HashMap<>();\r\n\t\tfor(int a :arr)\r\n\t\t{\r\n\t\t\tif(map.containsKey(a))\r\n\t\t\t{\r\n\t\t\t\tmap.get(a).incrementFrequency();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmap.put(a, new Data(a));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSet<Data> sortedData = new TreeSet<>(map.values());\r\n\t\tList<Integer> result = new ArrayList<>();\r\n\t\tfor(Data d : sortedData)\r\n\t\t{\r\n\t\t\tfor(int i=0;i<d.frequency;i++)\r\n\t\t\t\tresult.add(d.number);\r\n\t\t}\r\n\t\tSystem.out.println(result);\r\n\t}", "int sizeOfScansArray();", "public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }", "public static void main(String[] args) throws IOException {\n\n String file = \"C:/Java Projects/java-web-dev-exercises/src/exercises/CountingCharsSentence.txt\";\n Path path = Paths.get(file);\n List<String> lines = Files.readAllLines(path);\n Object[] string = lines.toArray();\n String string2 = Arrays.toString(string);\n\n String[] wordsInString = string2.toLowerCase().split(\"\\\\W+\");\n String rejoinedString = String.join(\"\", wordsInString);\n char[] charactersInString = rejoinedString.toCharArray();\n\n HashMap<Character, Integer> letterMap = new HashMap<>();\n\n\n for (char letter : charactersInString) {\n if (!letterMap.containsKey(letter)) {\n int letterCount = 1;\n letterMap.put(letter, letterCount);\n } else if (letterMap.containsKey(letter)) {\n letterMap.put(letter, letterMap.get(letter) + 1);\n }\n }\n\n\n System.out.println(letterMap);\n }", "public static void decode () {\n // read the input\n int firstThing = BinaryStdIn.readInt();\n s = BinaryStdIn.readString();\n char[] t = s.toCharArray();\n char[] firstColumn = new char[t.length];\n int [] next = new int[t.length];\n \n // copy array and sort\n for (int i = 0; i < t.length; i++) {\n firstColumn[i] = t[i];\n }\n Arrays.sort(firstColumn);\n \n // decode\n int N = t.length;\n int [] count = new int[256];\n \n // counts frequency of each letter\n for (int i = 0; i < N; i++) {\n count[t[i]]++;\n }\n \n int m = 0, j = 0;\n \n // fills the next[] array with appropriate values\n while (m < N) {\n int _count = count[firstColumn[m]];\n while (_count > 0) {\n if (t[j] == firstColumn[m]) {\n next[m++] = j;\n _count--;\n }\n j++;\n }\n j = 0;\n }\n \n // decode the String\n int _next = next.length;\n int _i = firstThing;\n for (int i = 0; i < _next; i++) {\n _i = next[_i];\n System.out.print(t[_i]);\n } \n System.out.println();\n }", "@Test\n public void chiSquaredTest1() {\n long[] occs = new long[26];\n occs[0] = 43;\n occs[1] = 453;\n occs[2] = 42;\n occs[3] = 4;\n occs[4] = 1;\n occs[5] = 0;\n occs[6] = 27;\n occs[7] = 29;\n occs[8] = 301;\n occs[9] = 107;\n occs[10] = 79;\n occs[11] = 201;\n occs[12] = 3;\n occs[13] = 5;\n occs[14] = 82;\n occs[15] = 36;\n occs[16] = 47;\n occs[17] = 90;\n occs[18] = 68;\n occs[19] = 45;\n occs[20] = 9;\n occs[21] = 23;\n occs[22] = 42;\n occs[23] = 421;\n occs[24] = 26;\n occs[25] = 2;\n int textLen = 2186;\n assertEquals(64388.4292706625, this.ic.chiSquared(occs,\n this.freq.getExpectedLetterFrequencies(), textLen), 0.01);\n\n }", "public void encodeChars() {\n encodedChars = new int[uniqueChars.size()];\n Iterator<Character> mover = uniqueChars.iterator();\n Iterator<Character> moverTwo = uniqueChars.iterator();\n System.out.print(\"\\nEncoding characters to its ASCII integer value:\");\n for(int a = 0; a < uniqueChars.size(); a++) {\n encodedChars[a] = (int)mover.next();\n encodedChars[a] = encodedChars[a] / encodedChars[a] + a - 1;\n System.out.print(moverTwo.next() + \" : \" + encodedChars[a] + \", \");\n }\n System.out.println(\"\\n\");\n }", "public static void main(String[] args) \r\n\t{\n\t\tString str=\"pizzapan\";\r\n\t\t//int c=0;\r\n\t\t\r\n\t\tHashMap<Character,Integer> hm=new HashMap<>();\r\n\t\t\r\n\t\tchar s[]=str.toCharArray();\r\n\t\t\r\n\t\t//for(int i=0;i<=s.length;i++)\r\n\t\t\r\n\t\tfor(char var:s)\r\n\t\t{\r\n\t\t\t//c++;\r\n\t\t\tif(hm.containsKey(var))\r\n\t\t\t{\r\n\t\t\t\t//System.out.println( hm.get(var));\r\n\t\t\t\thm.put(var, hm.get(var)+1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\thm.put(var, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(hm);\r\n\t\t\r\n\t\tSet<Entry<Character, Integer>>en=hm.entrySet();\r\n\t\t\r\n\t\tIterator<Entry<Character, Integer>>itr=en.iterator();\r\n\t\twhile(itr.hasNext())\r\n\t\t{\r\n\t\t\r\n\t\t\tMap.Entry<Character, Integer> data=itr.next();\r\n\t\t\tchar ch=data.getKey();\r\n\t\t\tint occ=data.getValue();\r\n\t\t\tSystem.out.println(ch+\" \"+occ);\r\n\t\t}\r\n\t\t\r\n\t}", "static void sortByFreq(int arr[], int n)\r\n {\n int[] hash = new int[61];\r\n for (int x : arr) {\r\n hash[x]++;\r\n }\r\n HashMap<Integer, ArrayList<Integer>> valueHash = new HashMap<Integer, ArrayList<Integer>>();\r\n \r\n for (int i = 0; i<hash.length; i++) {\r\n int x = hash[i];\r\n if (x != 0) {\r\n if (valueHash.containsKey(x)) {\r\n valueHash.get(x).add(i);\r\n } else {\r\n ArrayList<Integer> list = new ArrayList<>();\r\n list.add(i);\r\n valueHash.put(x, list);\r\n }\r\n }\r\n }\r\n Set<Integer> keys = valueHash.keySet();\r\n List<Integer> list = new ArrayList<Integer>(keys); \r\n Collections.sort(list, new Comparator<Integer>()\r\n\t\t{\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Integer o1, Integer o2)\r\n\t\t\t{\r\n\t\t\t\tif (o1 > o2) return -1;\r\n\t\t\t\t\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t});\r\n StringBuffer buff = new StringBuffer();\r\n for (int x : list) {\r\n \tArrayList<Integer> numList = valueHash.get(x);\r\n \tCollections.sort(numList);\r\n \tfor (int num : numList) {\r\n \t\tint y = x;\r\n \t\twhile (y > 0) {\r\n \t\t\tbuff.append(num + \" \");\r\n \t\t\ty--;\r\n \t\t}\r\n \t}\r\n }\r\n System.out.print(buff);\r\n }", "private static int[] makeCharTable(char[] needle) {\n final int ALPHABET_SIZE = 256;\n int[] table = new int[ALPHABET_SIZE];\n for (int i = 0; i < table.length; ++i) {\n table[i] = needle.length;\n }\n for (int i = 0; i < needle.length - 1; ++i) {\n table[needle[i]] = needle.length - 1 - i;\n }\n return table;\n }", "public static void letterCount(String[] s, int[] count){\n\t\t//Checks if s or count is null. Only continues if both are false\n\t\tif (s != null && count != null){\n\t\t\t//Loops through each index of s\n\t\t\tfor (int j = 0; j < s.length; j++){\n\t\t\t\t//Only continues if index is not null\n\t\t\t\tif (s[j] != null){\n\t\t\t\t\t//Loops through each letter of the String at index j\n\t\t\t\t\tfor (int k = 0; k < s[j].length(); k++){\n\t\t\t\t\t\t//Loops through alphabet until the character at s[j].charAt(k) equals h\n\t\t\t\t\t\tfor (char h = 'a', i = 0; h <= 'z'; h++, i++){\n\t\t\t\t\t\t\t//If the character at k in s[j] equals h, add 1 to the corresponding position to the alphabet in count[]\n\t\t\t\t\t\t\tif (Character.toLowerCase(s[j].charAt(k)) == h || Character.toUpperCase(s[j].charAt(k)) == h){\n\t\t\t\t\t\t\t\th = 'z';\n\t\t\t\t\t\t\t\tcount[i] += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tString character = \"fsdkjfklsdjfksdlkjdsfoweiopriewfklsdkfldksaflkdsafldkfsieoirwpoiroewofkdsfksldkf\";\n\t\tMap<Character,Integer> map = new HashMap<Character, Integer>();\n\t\tmap = countChars(character);\n\t\tSortMap(map);\n\t}", "static int makeAnagram(String a, String b) {\n \n \tchar arr[] = a.toCharArray();\n char brr[] = b.toCharArray();\n Arrays.sort(arr);\n Arrays.sort(brr);\n Map<Character, Integer> aMap = new HashMap<>();\n Map<Character, Integer> bMap = new HashMap<>();\n for(int i =0 ;i <arr.length;i++){\n \tif(!aMap.containsKey(arr[i])){\n \t\taMap.put(arr[i], 1);\n \t}else{\n \t\taMap.put(arr[i], aMap.get(arr[i])+1);\n \t}\n }\n for(int i =0 ;i <brr.length;i++){\n \tif(!bMap.containsKey(brr[i])){\n \t\tbMap.put(brr[i], 1);\n \t}else{\n \t\tbMap.put(brr[i], bMap.get(brr[i])+1);\n \t}\n }\n int removeCharCount = 0;\n \n for(char ch = 'a'; ch<='z';ch++){\n \tif(aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tif(aMap.get(ch) > bMap.get(ch)){\n \t\t\tint count = aMap.get(ch) - bMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, aMap.get(ch) - count);\n \t\t}else if(aMap.get(ch) < bMap.get(ch)){\n \t\t\tint count = bMap.get(ch) - aMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, bMap.get(ch) - count);\n \t\t}\n \t}else if(aMap.containsKey(ch) && !bMap.containsKey(ch)){\n \t\tint count = aMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\taMap.remove(ch);\n \t}else if(!aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tint count = bMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\tbMap.remove(ch);\n \t}\n }\n /* if(removeCharCount == Math.min(arr.length, brr.length)){\n \treturn 0;\n }*/\n return removeCharCount;\n }", "public static void main(String[] args) {\n HashMap<Character,Integer> hMapOutPut = new HashMap<>();\n //HashMap map = new HashMap();\n String sInput = \"india\";\n char[] strInputArray = sInput.toCharArray();\n for(char fLoop: strInputArray) {\n System.out.println(fLoop);\n if(hMapOutPut.containsKey(fLoop)) {\n int temp=hMapOutPut.get(fLoop)+1;\n hMapOutPut.put(fLoop,temp );\n }else {\n hMapOutPut.put(fLoop, 1);\n }\n }\nSystem.out.println(hMapOutPut);\n }" ]
[ "0.7123012", "0.7103299", "0.6793126", "0.66329515", "0.6527571", "0.65241355", "0.65076584", "0.648403", "0.6414739", "0.64070356", "0.6350026", "0.6340337", "0.63300335", "0.62695354", "0.6265364", "0.6236783", "0.6175745", "0.61611974", "0.61324835", "0.6116514", "0.6085661", "0.60508776", "0.6028182", "0.6008937", "0.60013336", "0.5971542", "0.59549403", "0.59458584", "0.5944054", "0.5938992", "0.59366226", "0.58820355", "0.58717996", "0.58594936", "0.58480024", "0.5843087", "0.5841591", "0.5815478", "0.58070326", "0.5799578", "0.57957774", "0.57947296", "0.57942414", "0.5780304", "0.57624996", "0.5736744", "0.5733378", "0.5733081", "0.5728248", "0.5715978", "0.5676606", "0.5672468", "0.5670045", "0.56623006", "0.56555647", "0.5643612", "0.56427264", "0.5637951", "0.563633", "0.56281704", "0.5626608", "0.55987567", "0.5590463", "0.5578846", "0.55784434", "0.5555907", "0.55496716", "0.5547272", "0.5538578", "0.55380446", "0.5520823", "0.5516973", "0.55159646", "0.5515127", "0.55150914", "0.5514753", "0.551323", "0.5507517", "0.54935867", "0.5490772", "0.544879", "0.544095", "0.54359066", "0.5424688", "0.5418237", "0.54112583", "0.54070115", "0.539094", "0.53793204", "0.53791404", "0.5375524", "0.5373573", "0.537287", "0.53716296", "0.53651506", "0.5364842", "0.536403", "0.5359007", "0.535226", "0.53445387", "0.5331345" ]
0.0
-1
Create a new neural language model with N1 context words, M size word representations, H size hidden vector, and V size vocabulary size
public Network(int N, int M, int H, int V){ E = new LinkedHashMap<Integer,DoubleMatrix>(); for(int i = 0; i < V; i++){ DoubleMatrix v = DoubleMatrix.zeros(M, 1); initMatrixRandom(v); E.put(i, v); } W = new DoubleMatrix[N-1]; for(int i = 0; i < W.length; i++){ W[i] = DoubleMatrix.zeros(H, M); initMatrixRandom(W[i]); } Wout = DoubleMatrix.zeros(V, H); initMatrixRandom(Wout); hidden = DoubleMatrix.zeros(H, 1); output = DoubleMatrix.zeros(V, 1); errorOutput = DoubleMatrix.zeros(V, 1); errorWout = DoubleMatrix.zeros(V, H); errorHidden = DoubleMatrix.zeros(H, 1); errorW = new DoubleMatrix[N-1]; for(int i = 0; i < errorW.length; i++) errorW[i] = DoubleMatrix.zeros(W[i].rows, W[i].columns); errorInput = new DoubleMatrix[N-1]; for(int i = 0; i < errorW.length; i++) errorInput[i] = DoubleMatrix.zeros(W[i].columns, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HDPModel getModel() {\n HDPModelBuilder builder = new HDPModelBuilder(numberOfTopics, totalNumberOfWords);\n for (int k = 0; k < numberOfTopics; k++) {\n for (int w = 0; w < sizeOfVocabulary; w++) {\n builder.addTopicWordCount(k, w, wordCountByTopicAndTerm[k][w]);\n }\n }\n return builder.build();\n }", "private void buildLanguageModel() {\n int total = 0;\n Map<Integer, Integer> wordCount = new HashMap<>();\n for (List<Integer> story : corpus.getStories()) {\n for (Integer word : story) {\n total++;\n if (wordCount.get(word) == null) wordCount.put(word, 0);\n wordCount.put(word, wordCount.get(word) + 1);\n }\n }\n wordValues = new HashMap<>();\n for (Map.Entry<Integer, Integer> entry : wordCount.entrySet()) {\n wordValues.put(entry.getKey(), total * 1.0 / entry.getValue());\n }\n }", "public void buildModel(String wordFileName) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(new File(wordFileName)));\n\n String str;\n while ((str = br.readLine()) != null) {\n List<String> tokens = StanfordParser.stanfordTokenize(str).stream().map(CoreLabel::originalText).collect(Collectors.toList());\n for (String word : tokens) {\n double count = model.wordProbability.containsKey(word) ? model.wordProbability.get(word) : 0;\n count++;\n model.wordProbability.put(word, count);\n }\n }\n br.close();\n\n // Remove Empty prob.\n model.wordProbability.remove(StringUtils.EMPTY);\n model.normalizeWordProbability();\n }", "public static MultiLayerNetwork lenetModel(Integer numLabels) {\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .l2(0.005)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .updater(new Nesterovs(0.0001, 0.9))\n .list()\n .layer(0, convInit(\"cnn1\", channels, 50, new int[]{5, 5}, new int[]{1, 1}, new int[]{0, 0}, 0))\n .layer(1, maxPool(\"maxpool1\", new int[]{2, 2}))\n .layer(2, conv5x5(\"cnn2\", 100, new int[]{5, 5}, new int[]{1, 1}, 0))\n .layer(3, maxPool(\"maxool2\", new int[]{2, 2}))\n .layer(4, new DenseLayer.Builder().nOut(500).build())\n .layer(5, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .nOut(numLabels)\n .activation(Activation.SOFTMAX)\n .build())\n .backprop(true).pretrain(false)\n .setInputType(InputType.convolutional(height, width, channels))\n .build();\n\n return new MultiLayerNetwork(conf);\n\n }", "public static void main(String[] args) throws Exception {\n final int numRows = 28;\n final int numColumns = 28;\n int outputNum = 10; // number of output classes\n int batchSize = 128; // batch size for each epoch\n int rngSeed = 123; // random number seed for reproducibility\n int numEpochs = 15; // number of epochs to perform\n String modelPath = \"モデルパスを入力\";\n\n //Get the DataSetIterators:\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\n\n\n System.out.println(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(rngSeed) //include a random seed for reproducibility\n // use stochastic gradient descent as an optimization algorithm\n .updater(new Nesterovs(0.006, 0.9))\n .l2(1e-4)\n .list()\n .layer(new DenseLayer.Builder() //create the first, input layer with xavier initialization\n .nIn(numRows * numColumns)\n .nOut(1000)\n .activation(Activation.RELU)\n .weightInit(WeightInit.XAVIER)\n .build())\n .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\n .nIn(1000)\n .nOut(outputNum)\n .activation(Activation.SOFTMAX)\n .weightInit(WeightInit.XAVIER)\n .build())\n .build();\n\n\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n //print the score with every 1 iteration\n UIServer uiServer = UIServer.getInstance();\n InMemoryStatsStorage statsStorage = new InMemoryStatsStorage();\n uiServer.attach(statsStorage);\n model.setListeners(new StatsListener(statsStorage),new ScoreIterationListener(1));\n\n System.out.println(\"Train model....\");\n model.fit(mnistTrain, numEpochs);\n\n\n\n\n System.out.println(\"Evaluate model....\");\n Evaluation eval = model.evaluate(mnistTest);\n System.out.println(eval.stats());\n ModelSerializer.writeModel(model, new File(modelPath), false);\n System.out.println(\"****************Example finished********************\");\n\n }", "public static HMM createModel(\n\t\t\tint N,\n\t\t\tint size,\n\t\t\tfloat[][] sequence,\n\t\t\tint init_type)\n\t{\n\t\tCollection<float[][]> list = new ArrayList<float[][]>(1);\n\t\tlist.add(sequence);\n\t\treturn createModel(N, size, list, init_type);\n\t}", "public void buildMultigramModel(String fileName, int n) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t\tString line = null;\n\t\tStringBuilder sb = null;\n\t\tMap<String, Integer> count = new HashMap<>();\n\t\tint totalCount = 0;\n\t\twhile ((line = reader.readLine()) != null) {\n\t\t\tsb = new StringBuilder();\n//\t\t\tsb.append(terminal); // no \"$\" at the beginning\n\t\t\tfor (char c : line.toCharArray()) {\n\t\t\t\tif (Character.isLetter(c) || c == ' ' || c == ',' || c == '.' || c == '\\'') {\n\t\t\t\t\tif (Character.isLowerCase(c)) {\n\t\t\t\t\t\tc = (char) (c + 'A' - 'a');\n\t\t\t\t\t}\n\t\t\t\t\tsb.append(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsb.append(terminal);\n\t\t\t// sb is established and preprocessed: \"hello, this is a sentence.$\"\n\t\t\t\n\t\t\twhile (sb.length() >= n) { // n == 2 if it is a bigram model\n\t\t\t\tString crt = sb.substring(0, n); // the first n characters\n\t\t\t\tif (count.containsKey(crt)) {\n\t\t\t\t\tcount.put(crt, count.get(crt) + 1);\n\t\t\t\t\ttotalCount++;\n\t\t\t\t}else {\n\t\t\t\t\tcount.put(crt, 1);\n\t\t\t\t}\n\t\t\t\tsb.deleteCharAt(0);\n\t\t\t}\n\t\t}\n\t\tif (n == 2) {\n\t\t\tbi = new HashMap<>(count);\n\t\t\tlm.putAll(bi);\n\t\t\tthis.sizeOfBiword = totalCount;\n\t\t} else if (n == 3) {\n\t\t\ttri = new HashMap<>(count);\n\t\t\tlm.putAll(tri);\n\t\t\tthis.sizeOfTriword = totalCount;\n\t\t}\n//\t\tSystem.out.println(\"File \" + fileName + \"\\'s \" + n + \"-gram model is ready.\");\n\t\treader.close();\n\t}", "public static Classifier create(final AssetManager assetManager,\n final String modelFilename,\n final String labelFilename,\n final int inputSize,\n final boolean isQuantized) throws IOException {\n final TFLiteRecognitionAPIModel d = new TFLiteRecognitionAPIModel();\n\n d.labels = readLabelFile(assetManager, labelFilename);\n d.inputSize = inputSize;\n\n // NEW: Prepare GPU delegate.\n //GpuDelegate delegate = new org.tensorflow.lite.Delegate();\n //Interpreter.Options options = (new Interpreter.Options()).addDelegate(delegate);\n\n try {\n File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), modelFilename);\n d.tfLite = new Interpreter(file);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n d.isModelQuantized = isQuantized;\n // Pre-allocate buffers.\n int numBytesPerChannel;\n if (d.isModelQuantized) {\n numBytesPerChannel = 1; // Quantized\n } else {\n numBytesPerChannel = 4; // Floating point\n }\n d.imgData = ByteBuffer.allocateDirect(1 * d.inputSize * d.inputSize * 3 * numBytesPerChannel); ////////////////////// 3 -> 2\n d.imgData.order(ByteOrder.nativeOrder());\n d.intValues = new int[d.inputSize * d.inputSize];\n\n d.tfLite.setNumThreads(NUM_THREADS);\n d.tfoutput_recognize = new float[1][NUM_CLASSES];\n /*d.outputLocations = new float[1][NUM_DETECTIONS][4];\n d.outputClasses = new float[1][NUM_DETECTIONS];\n d.outputScores = new float[1][NUM_DETECTIONS];\n d.numDetections = new float[1];*/\n return d;\n }", "public static MultiLayerNetwork alexnetModel(Integer numLabels) {\n\n double nonZeroBias = 1;\n double dropOut = 0.5;\n\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .weightInit(WeightInit.DISTRIBUTION)\n .dist(new NormalDistribution(0.0, 0.01))\n .activation(Activation.RELU)\n .updater(new Nesterovs(new StepSchedule(ScheduleType.ITERATION, 1e-2, 0.1, 100000), 0.9))\n .biasUpdater(new Nesterovs(new StepSchedule(ScheduleType.ITERATION, 2e-2, 0.1, 100000), 0.9))\n .gradientNormalization(GradientNormalization.RenormalizeL2PerLayer) // normalize to prevent vanishing or exploding gradients\n .l2(5 * 1e-4)\n .list()\n .layer(0, convInit(\"cnn1\", channels, 96, new int[]{11, 11}, new int[]{4, 4}, new int[]{3, 3}, 0))\n .layer(1, new LocalResponseNormalization.Builder().name(\"lrn1\").build())\n .layer(2, maxPool(\"maxpool1\", new int[]{3, 3}))\n .layer(3, conv5x5(\"cnn2\", 256, new int[]{1, 1}, new int[]{2, 2}, nonZeroBias))\n .layer(4, new LocalResponseNormalization.Builder().name(\"lrn2\").build())\n .layer(5, maxPool(\"maxpool2\", new int[]{3, 3}))\n .layer(6, conv3x3(\"cnn3\", 384, 0))\n .layer(7, conv3x3(\"cnn4\", 384, nonZeroBias))\n .layer(8, conv3x3(\"cnn5\", 256, nonZeroBias))\n .layer(9, maxPool(\"maxpool3\", new int[]{3, 3}))\n .layer(10, fullyConnected(\"ffn1\", 4096, nonZeroBias, dropOut, new GaussianDistribution(0, 0.005)))\n .layer(11, fullyConnected(\"ffn2\", 4096, nonZeroBias, dropOut, new GaussianDistribution(0, 0.005)))\n .layer(12, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .name(\"output\")\n .nOut(numLabels)\n .activation(Activation.SOFTMAX)\n .build())\n .backprop(true)\n .pretrain(false)\n .setInputType(InputType.convolutional(height, width, channels))\n .build();\n\n return new MultiLayerNetwork(conf);\n\n }", "public int initializeTensorFlow(\n AssetManager assetManager,\n String modelFilename,\n String vocabFilename,\n int numClasses,\n int input_max_Size,\n String inputName,\n String inputName2,\n String outputName) throws IOException {\n this.inputName = inputName;\n this.outputName = outputName;\n this.inputName2 = inputName2;\n\n // Read the label names into memory.\n // TODO(andrewharp): make this handle non-assets.\n String actualFilename = vocabFilename.split(\"file:///android_asset/\")[1];\n Log.i(TAG, \"Reading vocab from: \" + actualFilename);\n BufferedReader br = null;\n br = new BufferedReader(new InputStreamReader(assetManager.open(actualFilename)));\n String line;\n int index = 0;\n while ((line = br.readLine()) != null) {\n id_to_word.add(line);\n word_to_id.put(line, index);\n index++;\n }\n br.close();\n Log.e(TAG, \"Read \" + id_to_word.size() + \", \" + numClasses + \" specified\");\n\n this.input_max_Size = input_max_Size;\n\n //TODO Pre-allocate buffers. this.intValues?\n outputNames = new String[] {outputName};\n intValues = new int[input_max_Size];\n outputs = new float[numClasses];\n data_len = new int[1];\n\n inferenceInterface = new TensorFlowInferenceInterface();\n\n return inferenceInterface.initializeTensorFlow(assetManager, modelFilename);\n }", "private void generateModel() {\n // Initialize a new model object\n mCm = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n mCm[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n }", "@Override\n public List<Prediction> predictWord(final String string) {\n Trace.beginSection(\"predictWord\");\n\n Trace.beginSection(\"preprocessText\");\n Log.e(TAG, \"inut_string: \" + string);\n //TODO\n\n String[] input_words = string.split(\" \");\n data_len[0] = input_words.length;\n Log.e(TAG, \"data_len: \" + data_len[0]);\n //intValues = new int[input_words.length];\n if (input_words.length < input_max_Size) {\n for (int i = 0; i < input_words.length; ++i) {\n Log.e(TAG, \"input_word: \" + input_words[i]);\n if (word_to_id.containsKey(input_words[i])) intValues[i] = word_to_id.get(input_words[i]);\n else intValues[i] = 6; //rare words, <unk> in the vocab\n Log.e(TAG, \"input_id: \" + intValues[i]);\n }\n for (int i = input_words.length; i < input_max_Size; ++i) {\n intValues[i] = 0; //padding using <eos>\n Log.e(TAG, \"input_id: \" + intValues[i]);\n }\n }\n else {\n Log.e(TAG, \"input out of max Size allowed!\");\n return null;\n }\n Trace.endSection();\n // Copy the input data into TensorFlow.\n Trace.beginSection(\"fillNodeFloat\");\n // TODO\n inferenceInterface.fillNodeInt(inputName, new int[] {1, input_max_Size}, intValues);\n Log.e(TAG, \"fillNodeInt success!\");\n inferenceInterface.fillNodeInt(inputName2, new int[] {1}, data_len);\n Log.e(TAG, \"fillDATA_LEN success!\");\n Trace.endSection();\n\n // Run the inference call.\n Trace.beginSection(\"runInference\");\n inferenceInterface.runInference(outputNames);\n Log.e(TAG, \"runInference success!\");\n Trace.endSection();\n\n // Copy the output Tensor back into the output array.\n Trace.beginSection(\"readNodeFloat\");\n inferenceInterface.readNodeFloat(outputName, outputs);\n Log.e(TAG, \"readNodeFloat success!\");\n Trace.endSection();\n\n // Find the best predictions.\n PriorityQueue<Prediction> pq = new PriorityQueue<Prediction>(3,\n new Comparator<Prediction>() {\n @Override\n public int compare(Prediction lhs, Prediction rhs) {\n // Intentionally reversed to put high confidence at the head of the queue.\n return Float.compare(rhs.getConfidence(), lhs.getConfidence());\n }\n });\n for (int i = 0; i < outputs.length; ++i) { //don't show i = 0 <unk>; i = 1<eos>\n if (outputs[i] > THRESHOLD) {\n pq.add(new Prediction(\"\" + i, id_to_word.get(i), outputs[i]));\n }\n }\n final ArrayList<Prediction> predictions = new ArrayList<Prediction>();\n for (int i = 0; i < Math.min(pq.size(), MAX_RESULTS); ++i) {\n predictions.add(pq.poll());\n }\n for (int i = 0; i < predictions.size(); ++i) {\n Log.e(TAG, predictions.get(i).toString());\n }\n Trace.endSection(); // \"predict word\"\n return predictions;\n }", "public InterpolationModel(Collection<List<String>> sentences) {\n\tthis();\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n\ttrain(sentences);\n }", "public MyNLP()\n\t{\n\t\t//create StanfordNLP\n\t\tsnlp = new StanfordNLP();\n\t\t//create Recognizer\n\t\trec = new MyRecognizer();\n\t\t//build recognizers\n\t\trec.build();\n\t\t//create SentimentalAnalysis\n\t\tsa = new SentimentalAnalysis();\n\t}", "public BackPropagationNeural_3H(int size_in,int size_hidden1,int size_hidden2,int size_hidden3,int size_output){\n\t\tthis.size_in = size_in;\n\t\tthis.size_hidden1 = size_hidden1;\n\t\tthis.size_hidden2 = size_hidden2;\n\t\tthis.size_hidden3 = size_hidden3;\n\t\tthis.size_output = size_output;\n\t\t\n\t\tinputs = new float[size_in];\n\t\thidden1 = new float[size_hidden1];\n\t\thidden2 = new float[size_hidden2];\n\t\thidden3 = new float[size_hidden3];\n\t\toutput = new float[size_output];\n\t\t\n\t\tweight1 = new float[size_in][size_hidden1];\n\t\tweight2 = new float[size_hidden1][size_hidden2];\n\t\tweight3 = new float[size_hidden2][size_hidden3];\n\t\tweight4 = new float[size_hidden3][size_output];\n\t\t\n\t\tW1_last_delta = new float[size_in][size_hidden1];\n W2_last_delta = new float[size_hidden1][size_hidden2];\n W3_last_delta = new float[size_hidden2][size_hidden3];\n W4_last_delta = new float[size_hidden3][size_output];\n \n\t\trandomizeWeights();\n\t\toutput_error = new float[size_output];\n\t\thidden1_error = new float[size_hidden1];\n\t\thidden2_error = new float[size_hidden2];\n\t\thidden3_error = new float[size_hidden3];\n\t}", "public WordGenerator()\n {\n adjective1a = new ArrayList<String>();\n adjective1b = new ArrayList<String>();\n adjective1c = new ArrayList<String>();\n adjective2a = new ArrayList<String>();\n adjective2b = new ArrayList<String>();\n adjective2c = new ArrayList<String>();\n fillAdjectives();\n noun = \"\";\n adj1 = \"\";\n adj2 = \"\";\n }", "public static HMM createModel(\n\t\t\tint N,\n\t\t\tint size,\n\t\t\tCollection<float[][]> sequences,\n\t\t\tint init_type)\n\t{\n\t\tHMM hmm = new HMM(N, size);\n\t\t\n\t\tArrays.fill(hmm.init, 1.0f / N);\n\n\t\tSystem.arraycopy(initGaussianDist(size, N, sequences), 0, hmm.dist, 0, N);\n\n\t\tfor (int n = 0; n < N; ++n)\n\t\t\tArrays.fill(hmm.trans[n], 1.0f / N);\n\n\t\ttry {\n\t\t\tdouble opt_path = hmm.getLogProbBestPath(sequences);\n\t\t\tfor (int num_iter=0; true; ++num_iter) {\n/*\t\t\t\t\n\t\t\t\tfor (int n=0; n<hmm.N; ++n)\n\t\t\t\t\thmm.dist[n].toMatlab(System.out);\n*/\n\t\t\t\tHMM hmm_new = hmm.optimizeModel(sequences, init_type);\n\t\t\t\tdouble opt_path_new = hmm_new.getLogProbBestPath(sequences);\n\n\t\t\t\tassert Debug.println(System.err,\n\t\t\t\t\t\t\t\t\t num_iter + \", \" + opt_path_new + \" (\" +\n\t\t\t\t\t\t\t\t\t (opt_path_new - opt_path) + \")\");\n\n\t\t\t\t// check if model does not change much anymore.\n\t\t\t\tif (Math.abs(1.0 - opt_path_new / opt_path) < 1e-5) {\n\t\t\t\t\thmm = hmm_new;\n\t\t\t\t\topt_path = opt_path_new;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\thmm = hmm_new;\n\t\t\t\topt_path = opt_path_new;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tassert printStackTrace(e);\n\t\t}\n\n\t\treturn hmm;\n\t}", "public void saveTrainingDataToFileHybridSampling1() throws Exception {\n NGramTokenizer tokenizer = new NGramTokenizer();\r\n tokenizer.setNGramMinSize(1);\r\n tokenizer.setNGramMaxSize(1);\r\n tokenizer.setDelimiters(\"\\\\W\");\r\n\r\n //set stemmer - set english stemmer\r\n SnowballStemmer stemmer = new SnowballStemmer();\r\n stemmer.setStemmer(\"english\");\r\n\r\n //set lemmatizer\r\n StanfordCoreNLPLemmatizer scnlpl = new StanfordCoreNLPLemmatizer();\r\n\r\n //create new filter for vector transformation\r\n StringToWordVector filter = new StringToWordVector();\r\n filter.setLowerCaseTokens(true);\r\n filter.setOutputWordCounts(true);\r\n filter.setTFTransform(true);\r\n filter.setIDFTransform(true);\r\n filter.setStopwords(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\StopWordsR2.txt\")); // stop word removal given in research paper\r\n filter.setTokenizer(tokenizer);\r\n filter.setStemmer(scnlpl);\r\n\r\n System.out.println(\"Stemmer Name- \" + filter.getStemmer());\r\n\r\n InstanceQuery query = new InstanceQuery();\r\n query.setUsername(\"root\");\r\n query.setPassword(\"\");\r\n\r\n int numberOfPapers = 5;\r\n Instances[] otherArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'other'\");\r\n otherArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='other'\");\r\n otherArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='other'\");\r\n otherArticles[2] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'other'\");\r\n otherArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'other'\");\r\n otherArticles[4] = query.retrieveInstances();\r\n\r\n Instances[] crimeArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'crime'\");\r\n crimeArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='crime'\");\r\n crimeArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='crime'\");\r\n crimeArticles[2] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'crime'\");\r\n crimeArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'crime'\");\r\n crimeArticles[4] = query.retrieveInstances();\r\n\r\n FastVector attributeList = new FastVector(2);\r\n Attribute a1 = new Attribute(\"text\", (FastVector) null);\r\n FastVector classVal = new FastVector();\r\n classVal.addElement(\"crime\");\r\n classVal.addElement(\"other\");\r\n Attribute c = new Attribute(\"@@class@@\", classVal);\r\n //add class attribute and news text\r\n attributeList.addElement(a1);\r\n attributeList.addElement(c);\r\n Instances trainingData = new Instances(\"TrainingNews\", attributeList, 0);\r\n trainingData.setClassIndex(1);\r\n\r\n //up sampling using SMOTE\r\n int crimeArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < crimeArticles[i].numInstances(); j++) {\r\n\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, crimeArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, crimeArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n crimeArticlesCount++;\r\n// if (crimeArticlesCount == 50) {\r\n// break;\r\n// }\r\n }\r\n// if (crimeArticlesCount == 50) {\r\n// break;\r\n// }\r\n }\r\n\r\n System.out.println(\"Total Number of Crime Instances: \" + crimeArticlesCount);\r\n\r\n //downsampling using ?? \r\n int otherArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < otherArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, otherArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, otherArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n otherArticlesCount++;\r\n\r\n if (otherArticlesCount == 4872) {\r\n break;\r\n }\r\n }\r\n if (otherArticlesCount == 4872) {\r\n break;\r\n }\r\n }\r\n System.out.println(\"Total Number of Other Instances: \" + otherArticlesCount);\r\n System.out.println(\"Total num of instances= \" + trainingData.numInstances());\r\n\r\n // apply the StringToWordVector filter\r\n filter.setInputFormat(trainingData);\r\n Instances dataFiltered = Filter.useFilter(trainingData, filter);\r\n System.out.println(\"Number of Attributes after stop words removal- \" + dataFiltered.numAttributes());\r\n System.out.println(\"\\n\\nFiltered data:\\n\\n\" + dataFiltered);\r\n\r\n /**\r\n * Resamples a dataset by applying the Synthetic Minority Oversampling\r\n * TEchnique (SMOTE)\r\n * http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume16/chawla02a-html/node6.html\r\n * http://weka.sourceforge.net/doc.packages/SMOTE/weka/filters/supervised/instance/SMOTE.html \r\n *\r\n */\r\n SMOTE s = new SMOTE();\r\n s.setInputFormat(dataFiltered);\r\n // Specifies percentage of SMOTE instances to create.\r\n s.setPercentage(300.0);//464\r\n Instances dataBalanced = Filter.useFilter(dataFiltered, s);\r\n\r\n Random r = new Random();\r\n dataBalanced.randomize(r);\r\n\r\n ArffSaver saver = new ArffSaver();\r\n saver.setInstances(dataBalanced);\r\n saver.setFile(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataHybridRandom.arff\"));\r\n saver.writeBatch();\r\n }", "public static void main(String[] args) throws InvalidFormatException, FileNotFoundException, IOException {\n\n int classNumber = 2;\n int Ngram = 2; // The default value is unigram.\n int lengthThreshold = 5; // Document length threshold\n int numberOfCores = Runtime.getRuntime().availableProcessors();\n\n String tokenModel = \"./data/Model/en-token.bin\"; // Token model.\n\n EmbeddingParameter param = new EmbeddingParameter(args);\n\n String providedCV = String.format(\"%s/%s/%sSelectedVocab.txt\", param.m_prefix, param.m_data, param.m_data);\n String userFolder = String.format(\"%s/%s/Users\", param.m_prefix, param.m_data);\n String friendFile = String.format(\"%s/%s/%sFriends.txt\", param.m_prefix, param.m_data, param.m_data);\n String cvIndexFile = String.format(\"%s/%s/%sCVIndex.txt\", param.m_prefix, param.m_data, param.m_data);\n String cvIndexFile4Interaction = String.format(\"%s/%s/%sCVIndex4Interaction_fold_%d_train.txt\", param.m_prefix, param.m_data, param.m_data, param.m_kFold);\n\n MultiThreadedNetworkAnalyzer analyzer = null;\n int kFold = 5;\n\n if(param.m_data.equals(\"StackOverflow\")){\n analyzer = new MultiThreadedStackOverflowAnalyzer(tokenModel, classNumber, providedCV, Ngram, lengthThreshold, numberOfCores, true);\n } else\n analyzer = new MultiThreadedNetworkAnalyzer(tokenModel, classNumber, providedCV, Ngram, lengthThreshold, numberOfCores, true);\n analyzer.setAllocateReviewFlag(false); // do not allocate reviews\n\n // we store the interaction information before-hand, load them directly\n analyzer.loadUserDir(userFolder);\n analyzer.constructUserIDIndex();\n\n // if it is cv for doc, use all the interactions + part of docs\n if(param.m_mode.equals(\"cv4doc\") && !param.m_coldStartFlag){\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n // if it is cv for edge, use all the docs + part of edges\n else if(param.m_mode.equals(\"cv4edge\") && !param.m_coldStartFlag){\n analyzer.loadInteractions(cvIndexFile4Interaction);\n }\n // cold start for doc, use all edges, test doc perplexity on light/medium/heavy users\n else if(param.m_mode.equals(\"cv4doc\") && param.m_coldStartFlag) {\n cvIndexFile = String.format(\"%s/%s/ColdStart/%s_cold_start_4docs_fold_%d.txt\", param.m_prefix, param.m_data,\n param.m_data, param.m_kFold);\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n // cold start for edge, use all edges, learn user embedding for light/medium/heavy users\n else if(param.m_mode.equals(\"cv4edge\") && param.m_coldStartFlag){\n cvIndexFile4Interaction = String.format(\"%s/%s/ColdStart/%s_cold_start_4edges_fold_%d_interactions.txt\",\n param.m_prefix, param.m_data, param.m_data, param.m_kFold);\n analyzer.loadInteractions(cvIndexFile4Interaction);\n }\n // answerer recommendation for stackoverflow data only\n else if(param.m_mode.equals(\"ansrec\")){\n cvIndexFile = String.format(\"%s/%s/AnswerRecommendation/%sCVIndex4Recommendation.txt\",\n param.m_prefix, param.m_data, param.m_data);\n friendFile = String.format(\"%s/%s/AnswerRecommendation/%sFriends4Recommendation.txt\",\n param.m_prefix, param.m_data, param.m_data);\n analyzer.loadCVIndex(cvIndexFile, kFold);\n analyzer.loadInteractions(friendFile);\n }\n /***Start running joint modeling of user embedding and topic embedding****/\n double emConverge = 1e-10, alpha = 1 + 1e-2, beta = 1 + 1e-3, lambda = 1 + 1e-3, varConverge = 1e-6;//these two parameters must be larger than 1!!!\n _Corpus corpus = analyzer.getCorpus();\n\n long start = System.currentTimeMillis();\n LDA_Variational tModel = null;\n\n if(param.m_multiFlag && param.m_coldStartFlag) {\n tModel = new EUB4ColdStart_multithreading(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics,\n alpha, param.m_varIter, varConverge, param.m_embeddingDim);\n } else if(param.m_multiFlag && !param.m_coldStartFlag){\n tModel = new EUB_multithreading(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics,\n alpha, param.m_varIter, varConverge, param.m_embeddingDim);\n } else{\n tModel = new EUB(param.m_emIter, emConverge, beta, corpus, lambda, param.m_number_of_topics, alpha,\n param.m_varIter, varConverge, param.m_embeddingDim);\n }\n\n ((EUB) tModel).initLookupTables(analyzer.getUsers());\n ((EUB) tModel).setModelParamsUpdateFlags(param.m_alphaFlag, param.m_gammaFlag, param.m_betaFlag,\n param.m_tauFlag, param.m_xiFlag, param.m_rhoFlag);\n ((EUB) tModel).setMode(param.m_mode);\n\n ((EUB) tModel).setTrainInferMaxIter(param.m_trainInferIter);\n ((EUB) tModel).setTestInferMaxIter(param.m_testInferIter);\n ((EUB) tModel).setParamMaxIter(param.m_paramIter);\n ((EUB) tModel).setStepSize(param.m_stepSize);\n ((EUB) tModel).setGamma(param.m_gamma);\n ((EUB) tModel).setData(param.m_data);\n\n if(param.m_mode.equals(\"ansrec\")){\n String questionIds = String.format(\"%s/%s/AnswerRecommendation/%sSelectedQuestions.txt\",\n param.m_prefix, param.m_data, param.m_data);\n ((EUB) tModel).loadQuestionIds(questionIds);\n }\n\n if(param.m_multiFlag && param.m_coldStartFlag){\n ((EUB4ColdStart_multithreading) tModel).fixedCrossValidation(param.m_kFold, param.m_saveDir);\n } else{\n ((EUB) tModel).fixedCrossValidation(param.m_kFold, param.m_saveDir);\n }\n\n String saveDir = param.m_saveDir + String.format(\"%s_nuTopics_%d_dim_%d_fold_%d\", param.m_data,\n param.m_number_of_topics, param.m_embeddingDim, param.m_kFold);\n File dir = new File(saveDir);\n if(!dir.exists())\n dir.mkdir();\n\n tModel.printBeta(param.m_saveDir);\n if(param.m_mode.equals(\"ansrec\")){\n ((EUB) tModel).printTopicEmbeddingAsMtx(param.m_saveDir);\n ((EUB) tModel).printTheta(param.m_saveDir);\n }\n long end = System.currentTimeMillis();\n\n // the total time of training and testing in the unit of hours\n double hours = (end - start)/((1000*60*60) * 1.0);\n System.out.print(String.format(\"[Time]This training+testing process took %.2f hours.\\n\", hours));\n\n }", "IFMLModel createIFMLModel();", "public void trainDocTopicModel(Vector original, Vector labels, Matrix docTopicModel, boolean inf) {\n List<Integer> terms = new ArrayList<Integer>();\n Iterator<Vector.Element> docElementIter = original.iterateNonZero();\n //long getIterTime=System.currentTimeMillis();\n double docTermCount = 0.0;\n while (docElementIter.hasNext()) {\n Vector.Element element = docElementIter.next();\n terms.add(element.index());\n docTermCount += element.get();\n }\n //long midTime=System.currentTimeMillis();\n List<Integer> topicLabels = new ArrayList<Integer>();\n Iterator<Vector.Element> labelIter = labels.iterateNonZero();\n while (labelIter.hasNext()) {\n Vector.Element e = labelIter.next();\n topicLabels.add(e.index());\n }\n //long t1 = System.currentTimeMillis();\n //log.info(\"get List use {} ms ,with terms' size of {} and doc size of {},get term list use {} ms,get termIter use time {} \",new Object[]{(t1-preTime),terms.size(),original.size(),(midTime-preTime),(getIterTime-preTime)});\n //log.info(\"docTopicModel columns' length is {} \",docTopicModel.columnSize());\n pTopicGivenTerm(terms, topicLabels, docTopicModel);\n //long t2 = System.currentTimeMillis();\n //log.info(\"pTopic use {} ms with terms' size {}\", new Object[]{(t2 - t1),terms.size()});\n normByTopicAndMultiByCount(original, terms, docTopicModel);\n //long t3 = System.currentTimeMillis();\n //log.info(\"normalize use {} ms with terms' size {}\", new Object[]{(t3 - t2),terms.size()});\n // now multiply, term-by-term, by the document, to get the weighted distribution of\n // term-topic pairs from this document.\n\n // now recalculate \\(p(topic|doc)\\) by summing contributions from all of pTopicGivenTerm\n if (inf) {\n for (Vector.Element topic : labels) {\n labels.set(topic.index(), (docTopicModel.viewRow(topic.index()).norm(1) + alpha) / (docTermCount + numTerms * alpha));\n }\n // now renormalize so that \\(sum_x(p(x|doc))\\) = 1\n labels.assign(Functions.mult(1 / labels.norm(1)));\n //log.info(\"set topics use {} \" + (System.currentTimeMillis() - t3));\n }\n //log.info(\"after train: \"+ topics.toString());\n }", "public Linearmodel() {\n this(DSL.name(\"LinearModel\"), null);\n }", "protected GrammarNode createGrammar() throws IOException {\n languageModel.allocate();\n Timer.start(\"LMGrammar.create\");\n GrammarNode firstNode = null;\n if (languageModel.getMaxDepth() > 2) {\n System.out.println(\"Warning: LMGrammar limited to bigrams\");\n }\n int identity = 0;\n List nodes = new ArrayList();\n Set words = languageModel.getVocabulary();\n // create all of the word nodes\n for (Iterator i = words.iterator(); i.hasNext();) {\n String word = (String) i.next();\n GrammarNode node = createGrammarNode(identity++, word);\n if (node != null && !node.isEmpty()) {\n if (node.getWord().equals(\n getDictionary().getSentenceStartWord())) {\n firstNode = node;\n } else if (node.getWord().equals(\n getDictionary().getSentenceEndWord())) {\n node.setFinalNode(true);\n }\n nodes.add(node);\n }\n }\n if (firstNode == null) {\n throw new Error(\"No sentence start found in language model\");\n }\n for (Iterator i = nodes.iterator(); i.hasNext();) {\n GrammarNode prevNode = (GrammarNode) i.next();\n // don't add any branches out of the final node\n if (prevNode.isFinalNode()) {\n continue;\n }\n for (Iterator j = nodes.iterator(); j.hasNext();) {\n GrammarNode nextNode = (GrammarNode) j.next();\n String prevWord = prevNode.getWord().getSpelling();\n String nextWord = nextNode.getWord().getSpelling();\n Word[] wordArray = {getDictionary().getWord(prevWord),\n getDictionary().getWord(nextWord)};\n float logProbability = languageModel\n .getProbability(WordSequence.getWordSequence(wordArray));\n prevNode.add(nextNode, logProbability);\n }\n }\n Timer.stop(\"LMGrammar.create\");\n languageModel.deallocate();\n return firstNode;\n }", "private void buildAndRunNetwork() throws IOException {\n final int numRows = 28;\r\n final int numColumns = 28;\r\n int outputNum = 10; // number of output classes\r\n int batchSize = 128; // batch size for each epoch\r\n int rngSeed = 123; // random number seed for reproducibility\r\n int numEpochs = 15; // number of epochs to perform\r\n double rate = 0.0015; // learning rate\r\n\r\n //Get the DataSetIterators:\r\n DataSetIterator mnistTrain = new MnistDataSetIterator(batchSize, true, rngSeed);\r\n DataSetIterator mnistTest = new MnistDataSetIterator(batchSize, false, rngSeed);\r\n\r\n\r\n log.info(\"Build model....\");\r\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\r\n .seed(rngSeed) //include a random seed for reproducibility\r\n .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT) // use stochastic gradient descent as an optimization algorithm\r\n .iterations(1)\r\n .activation(Activation.RELU)\r\n .weightInit(WeightInit.XAVIER)\r\n .learningRate(rate) //specify the learning rate\r\n .updater(Updater.NESTEROVS).momentum(0.98) //specify the rate of change of the learning rate.\r\n .regularization(true).l2(rate * 0.005) // regularize learning model\r\n .list()\r\n .layer(0, new DenseLayer.Builder() //create the first input layer.\r\n .nIn(numRows * numColumns)\r\n .nOut(500)\r\n .build())\r\n .layer(1, new DenseLayer.Builder() //create the second input layer\r\n .nIn(500)\r\n .nOut(100)\r\n .build())\r\n .layer(2, new OutputLayer.Builder(LossFunction.NEGATIVELOGLIKELIHOOD) //create hidden layer\r\n .activation(Activation.SOFTMAX)\r\n .nIn(100)\r\n .nOut(outputNum)\r\n .build())\r\n .pretrain(false).backprop(true) //use backpropagation to adjust weights\r\n .build();\r\n\r\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\r\n model.init();\r\n \r\n model.setListeners(new ScoreIterationListener(5)); //print the score with every iteration\r\n\r\n log.info(\"Train model....\");\r\n for( int i=0; i<numEpochs; i++ ){\r\n \tlog.info(\"Epoch \" + i);\r\n model.fit(mnistTrain);\r\n }\r\n\r\n\r\n log.info(\"Evaluate model....\");\r\n Evaluation eval = new Evaluation(outputNum); //create an evaluation object with 10 possible classes\r\n while(mnistTest.hasNext()){\r\n DataSet next = mnistTest.next();\r\n INDArray output = model.output(next.getFeatureMatrix()); //get the networks prediction\r\n eval.eval(next.getLabels(), output); //check the prediction against the true class\r\n }\r\n\r\n log.info(eval.stats());\r\n log.info(\"****************Example finished********************\");\r\n\t}", "public void trainModel(String input) {\n\n String[] words = input.split(\" \");\n String currentWord = \"\";\n\n for (int i = 0; i < words.length; i++) {\n\n if (i == 0 || words[i-1].contains(\".\")) {\n model.get(\"_begin\").add(words[i]);\n } else if (i == words.length - 1 || words[i].contains(\".\")) {\n model.get(\"_end\").add(words[i]);\n } else {\n model.putIfAbsent(currentWord, new ArrayList<String>());\n model.get(currentWord).add(words[i]);\n }\n\n currentWord = words[i];\n\n }\n }", "private Word2Vec generateWord2Vec(String fileName) throws FileNotFoundException {\n /*\n * Original work from DL4J - Deeplearning4J\n * GitHub: https://github.com/deeplearning4j/dl4j-examples\n */\n\n File file = new File(fileName);\n\n if (!file.exists()) {\n System.err.println(\"File \" + file + \" doesn't exist.\");\n System.exit(1);\n }\n\n // Gets Path to text file\n String filePath = file.getAbsolutePath();\n\n log.info(\"Load & Vectorize Sentences....\");\n\n // Strip white space before and after for each line\n SentenceIterator iter = new BasicLineIterator(filePath);\n\n // Split on white spaces in the line to get words\n TokenizerFactory t = new DefaultTokenizerFactory();\n\n /*\n CommonPreprocessor will apply the following regex to each token: [\\d\\.:,\"'\\(\\)\\[\\]|/?!;]+\n So, effectively all numbers, punctuation symbols and some special symbols are stripped off.\n Additionally it forces lower case for all tokens.\n */\n\n t.setTokenPreProcessor(new CommonPreprocessor());\n\n log.info(\"Building model....\");\n Word2Vec vec = new Word2Vec.Builder()\n .minWordFrequency(5)\n .iterations(1)\n .layerSize(100)\n .seed(42)\n .windowSize(5)\n .iterate(iter)\n .tokenizerFactory(t)\n .build();\n\n log.info(\"Fitting Word2Vec model....\");\n vec.fit();\n\n return vec;\n }", "private void createNewDynamicModel(){\n\t\tDynamicModel dModel = new DynamicModel(currentView.getViewModel().getName());\r\n\r\n\t\t// Add the new graph to the view\r\n\t\tint modelWidth = DynamicModelView.minimumWidth; \r\n\t\tint modelHeight = DynamicModelView.minimumHeight; \r\n\t\tint viewHeight = currentView.getHeight();\r\n\t\tint pad = 8;\r\n\t\tcurrentView.addModelView(new DynamicModelView(new EntityViewConfig(pad, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t viewHeight - (modelHeight + pad), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t modelWidth, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t modelHeight, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t EntityViewConfig.Type.DYNAMIC_MODEL), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdModel, this, currentView));\r\n\t\tcurrentView.repaint();\r\n\t}", "public Lemmatizer(String modelFileName) {\n\t\t\n\t\t// tell the lemmatizer the location of the model\n\t\ttry {\n\t\t\tOptions m_options = new Options(new String[] {\"-model\", modelFileName});\n\t\t\tli = new Long2Int(m_options.hsize);\n\n\t\t\t// initialize the lemmatizer\n\t\t\treadModel(m_options);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public EfficientMarkovModel(int n) {\n super(n);\n map = new HashMap<String, ArrayList<String> >();\n }", "public Stemmer ()\n {\n AllWords = new HashMap<String,String>();\n dictionary = Dictionary.getInstance();\n p = PointerUtils.getInstance();\n\n try\n {\n // JWNL.initialize(new FileInputStream(\"file_properties.xml\"));\n JWNLConnecter.initializeJWNL();\n dic = Dictionary.getInstance();\n morph = dic.getMorphologicalProcessor();\n // ((AbstractCachingDictionary)dic).\n //\tsetCacheCapacity (10000);\n IsInitialized = true;\n }\n catch (Exception e){\n System.err.println(e.getMessage());\n }\n /*catch ( FileNotFoundException e )\n {\n System.out.println ( \"Error initializing Stemmer: JWNLproperties.xml not found\" );\n }\n catch ( JWNLException e )\n {\n System.out.println ( \"Error initializing Stemmer: \"\n + e.toString() );\n }*/\n\n }", "public WorkingMemory createInferredModel(IRI modelId) {\n\t\tSet<Statement> statements = JavaConverters.setAsJavaSetConverter(SesameJena.ontologyAsTriples(getModelAbox(modelId))).asJava();\n\t\tSet<Triple> triples = statements.stream().map(s -> Bridge.tripleFromJena(s.asTriple())).collect(Collectors.toSet());\n\t\ttry {\n\t\t\t// Using model's ontology IRI so that a spurious different ontology declaration triple isn't added\n\t\t\tOWLOntology schemaOntology = OWLManager.createOWLOntologyManager().createOntology(getOntology().getRBoxAxioms(Imports.INCLUDED), modelId);\n\t\t\tSet<Statement> schemaStatements = JavaConverters.setAsJavaSetConverter(SesameJena.ontologyAsTriples(schemaOntology)).asJava();\n\t\t\ttriples.addAll(schemaStatements.stream().map(s -> Bridge.tripleFromJena(s.asTriple())).collect(Collectors.toSet()));\n\t\t} catch (OWLOntologyCreationException e) {\n\t\t\tLOG.error(\"Couldn't add rbox statements to data model.\", e);\n\t\t}\n\t\treturn getRuleEngine().processTriples(JavaConverters.asScalaSetConverter(triples).asScala());\n\t}", "@Override\n protected List<Term> segSentence(char[] sentence)\n {\n WordNet wordNetAll = new WordNet(sentence);\n ////////////////生成词网////////////////////\n generateWordNet(wordNetAll);\n ///////////////生成词图////////////////////\n// System.out.println(\"构图:\" + (System.currentTimeMillis() - start));\n if (HanLP.Config.DEBUG)\n {\n System.out.printf(\"粗分词网:\\n%s\\n\", wordNetAll);\n }\n// start = System.currentTimeMillis();\n List<Vertex> vertexList = viterbi(wordNetAll);\n// System.out.println(\"最短路:\" + (System.currentTimeMillis() - start));\n\n if (config.useCustomDictionary)\n {\n if (config.indexMode > 0)\n combineByCustomDictionary(vertexList, this.dat, wordNetAll);\n else combineByCustomDictionary(vertexList, this.dat);\n }\n\n if (HanLP.Config.DEBUG)\n {\n System.out.println(\"粗分结果\" + convert(vertexList, false));\n }\n\n // 数字识别\n if (config.numberQuantifierRecognize)\n {\n mergeNumberQuantifier(vertexList, wordNetAll, config);\n }\n\n // 实体命名识别\n if (config.ner)\n {\n WordNet wordNetOptimum = new WordNet(sentence, vertexList);\n int preSize = wordNetOptimum.size();\n if (config.nameRecognize)\n {\n PersonRecognition.recognition(vertexList, wordNetOptimum, wordNetAll);\n }\n if (config.translatedNameRecognize)\n {\n TranslatedPersonRecognition.recognition(vertexList, wordNetOptimum, wordNetAll);\n }\n if (config.japaneseNameRecognize)\n {\n JapanesePersonRecognition.recognition(vertexList, wordNetOptimum, wordNetAll);\n }\n if (config.placeRecognize)\n {\n PlaceRecognition.recognition(vertexList, wordNetOptimum, wordNetAll);\n }\n if (config.organizationRecognize)\n {\n // 层叠隐马模型——生成输出作为下一级隐马输入\n wordNetOptimum.clean();\n vertexList = viterbi(wordNetOptimum);\n wordNetOptimum.clear();\n wordNetOptimum.addAll(vertexList);\n preSize = wordNetOptimum.size();\n OrganizationRecognition.recognition(vertexList, wordNetOptimum, wordNetAll);\n }\n if (wordNetOptimum.size() != preSize)\n {\n vertexList = viterbi(wordNetOptimum);\n if (HanLP.Config.DEBUG)\n {\n System.out.printf(\"细分词网:\\n%s\\n\", wordNetOptimum);\n }\n }\n }\n\n // 如果是索引模式则全切分\n if (config.indexMode > 0)\n {\n return decorateResultForIndexMode(vertexList, wordNetAll);\n }\n\n // 是否标注词性\n if (config.speechTagging)\n {\n speechTagging(vertexList);\n }\n\n return convert(vertexList, config.offset);\n }", "private void createModel() {\n model = new Node(\"Enemy\"+enemyCounter);\n Box b = new Box(.5f, 2, .5f);\n Geometry bg = new Geometry(\"Box\", b);\n Material bm = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n Sphere sphere = new Sphere(32, 32, 1.5f, false, false);\n Geometry sg = new Geometry(\"Sphere\", sphere);\n Material sm = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n bm.setColor(\"Color\", ColorRGBA.Blue);\n sm.setColor(\"Color\", ColorRGBA.Red);\n bg.setMaterial(bm); \n sg.setMaterial(sm);\n model.attachChild(bg);\n model.attachChild(sg);\n sg.setLocalTranslation(0,2.5f,0);\n \n attachChild(model);\n }", "public void train(int n_epochs) {\n TrainModel train_model = null;\n\n int lenW = vocabulary.length;\n int W = 3 * lenW + 3;\n\n // randomly initialize U_Ot, values are randomly selected between -0.1 to 0.1;\n double[][] U_Ot = new double[D][W];\n\n // randomly initialize U_R, values are randomly selected between -0.1 and 0.1\n double[][] U_R = new double[D][W];\n\n double prev_err = 0D;\n for (int epoch = 0; epoch < n_epochs; epoch++) {\n double total_error = 0D;\n int n_wrong = 0;\n\n for (int i = 0; i < train_lines.size(); i++) {\n Instance line = train_lines.get(i);\n if (\"q\".equals(line.type)) { // indicates question\n List<Integer> refs = line.refs; // Indexing from 1\n List<Integer> f = refs.stream()\n .map(ref -> ref-1)\n .collect(Collectors.toList()); // Indexing from 0\n int id = line.ID - 1; // Indexing from 0\n\n // all indices from\n List<Integer> indices = range(i-id, i+1);\n List<double[]> memory_list = indices.stream()\n .map(idx -> L_train[idx])\n .collect(Collectors.toList());\n\n\n if (train_model == null) {\n train_model = new TrainModel(lenW, f.size());\n }\n\n List<Integer> m = f;\n // TODO\n List<Integer> mm = new ArrayList<>(); //TODO\n for (int j = 0; j < f.size(); j++) {\n mm.add(O_t(\n newM,\n memory_list\n ));\n }\n\n double err = train_model(H.get(\"answer\"),\n gamma, memory_list, V, id, ???)[0];\n total_error += err;\n System.out.println(\"epoch: \" + epoch + \"\\terr: \" + (total_error / train_lines.size()));\n }\n }\n }\n }", "public WordNet(String synsets, String hypernyms)\n {\n In text = new In(synsets);\n synsetList = new ArrayList<String>();\n synsetHash = new HashMap<String, ArrayList<Integer>>();\n // parse words into array synsetList\n synsetNum = 0;\n while (!text.isEmpty())\n {\n String temp = text.readLine().split(\",\")[1];\n synsetList.add(temp);\n synsetNum++;\n }\n //initialize synsetHash with word:list of integers\n for (int i = 0; i < synsetNum; i++)\n {\n String[] stringArray = synsetList.get(i).split(\" \");\n for (String s : stringArray)\n {\n if (synsetHash.containsKey(s))\n {\n ArrayList<Integer> temp = synsetHash.get(s);\n temp.add(i);\n }\n else\n {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(i);\n synsetHash.put(s, temp);\n }\n }\n }\n\n wordGraph = new Digraph(synsetNum);\n text = new In(hypernyms);\n while (!text.isEmpty())\n {\n String[] edges = text.readLine().split(\",\");\n int mainEdge = Integer.parseInt(edges[0]);\n for (int i = 1; i < edges.length; i++)\n {\n wordGraph.addEdge(mainEdge, Integer.parseInt(edges[i]));\n }\n }\n // check if input is a rooted DAG\n int count = 0;\n for (int v = 0; v < synsetNum; v++)\n {\n if (wordGraph.outdegree(v) == 0) count++;\n if (count > 1) throw new IllegalArgumentException();\n }\n // may be redundant check, but wanna make sure\n if (count != 1) throw new IllegalArgumentException();\n\n DirectedCycle cycle = new DirectedCycle(wordGraph);\n if (cycle.hasCycle()) throw new IllegalArgumentException();\n\n shortestPath = new SAP(wordGraph);\n \n }", "protected CreateMachineNodeModel() {\r\n super(0,1);\r\n }", "public void initializeModel(int N){\n\t\tint twoN = 2*N;\n\t\t\n\t\tfor (int i = 1; i < twoN+1; i++)\n\t\t\tpi[i] = 1.0/twoN;\n\t\tfor (int i = 1; i < N+1; i++)\n\t\t\tfor (int j = 1; j < N + 1; j++)\n\t\t\t\ta[i][j][N] = 1.0/N;\n\t\t\n\t\ttagMap.put(\"SEM\", 1);\n\t\ttagMap.put(\"FUN\", 2);\n\t\ttagMap.put(\"PDE\", 3);\n\t\ttagMap.put(\"CDE\", 4);\n\t\ttagMap.put(\"MDE\", 5);\n\t\ttagMap.put(\"GIS\", 6);\n\t\ttagMap.put(\"GIF\", 7);\n\t\ttagMap.put(\"COI\", 8);\n\t\ttagMap.put(\"TIN\", 9);\n\t\ttagMap.put(\"NTR\", 10);\n\t\ttagMap.put(\"MTA\", 11);\n\t\t\n\t}", "public WeightingModel(){}", "@Test\n public void testNamedEntityRecognitionWithCounterNeuron() {\n Model m = new Model(null, 1); // number of threads\n\n Neuron forenameCategory = m.createNeuron(\"C-forename\");\n Neuron surnameCategory = m.createNeuron(\"C-surname\");\n Neuron suppressingN = m.createNeuron(\"SUPPR\");\n\n // The following three neurons are used to assign each word activation\n // a relational id (rid). Here, the relational id specifies the\n // word position within the sentence.\n Neuron spaceN = m.createNeuron(\"SPACE\");\n Neuron startSignal = m.createNeuron(\"START-SIGNAL\");\n Neuron ctNeuron = m.initCounterNeuron(m.createNeuron(\"RID Counter\"),\n spaceN, // clock signal\n false, // direction of the clock signal (range end counts)\n startSignal, // start signal\n true, // direction of the start signal (range begin counts)\n false // direction of the counting neuron\n );\n // initCounterNeuron is just a convenience method which creates an ordinary neuron\n // with some input synapses.\n\n\n // The word input neurons which do not yet possess a relational id.\n HashMap<String, Neuron> inputNeurons = new HashMap<>();\n\n // The word input neurons with a relational id.\n HashMap<String, Neuron> relNeurons = new HashMap<>();\n\n\n String[] words = new String[] {\n \"mr.\", \"jackson\", \"cook\", \"was\", \"born\", \"in\", \"new\", \"york\"\n };\n for(String word: words) {\n Neuron in = m.createNeuron(\"W-\" + word);\n Neuron rn = m.initRelationalNeuron(\n m.createNeuron(\"WR-\" + word),\n ctNeuron, // RID Counting neuron\n in, // Input neuron\n false // Direction of the input neuron\n );\n\n inputNeurons.put(word, in);\n relNeurons.put(word, rn);\n }\n\n // The entity neurons represent the concrete meanings of the input words.\n // The helper function 'initAndNeuron' computes the required bias for a\n // conjunction of the inputs.\n Neuron cookSurnameEntity = m.initNeuron(\n m.createNeuron(\"E-cook (surname)\"),\n 3, // adjusts the bias\n new Input() // Requires the word to be recognized\n .setNeuron(relNeurons.get(\"cook\"))\n .setWeight(10.0f)\n // This input requires the input activation to have an\n // activation value of at least 0.9\n .setBiasDelta(0.9)\n .setRelativeRid(0) // references the current word\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input() // The previous word needs to be a forename\n .setNeuron(forenameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(-1) // references the previous word\n .setRecurrent(true) // this input is a positive feedback loop\n .setRangeMatch(NONE),\n\n // This neuron may be suppressed by the E-cook (profession) neuron, but there is no\n // self suppression taking place even though 'E-cook (surname)' is also contained\n // in the suppressingN.\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true) // this input is a negative feedback loop\n .setRangeMatch(CONTAINS)\n );\n\n Neuron cookProfessionEntity = m.initNeuron(\n m.createNeuron(\"E-cook (profession)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"cook\"))\n .setWeight(15.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINS)\n );\n\n Neuron jacksonForenameEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (forename)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"jackson\"))\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(0)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(surnameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(1)\n .setRecurrent(true)\n .setRangeMatch(NONE),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n Neuron jacksonCityEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (city)\"),\n 3,\n new Input()\n .setNeuron(relNeurons.get(\"jackson\"))\n .setWeight(12.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n m.initNeuron(forenameCategory,\n -0.001,\n new Input() // In this example there is only one forename considered.\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n m.initNeuron(surnameCategory,\n -0.001,\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n m.initNeuron(suppressingN,\n -0.001,\n new Input()\n .setNeuron(cookProfessionEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonCityEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n\n // Now that the model is complete, start processing an actual text.\n Document doc = m.createDocument(\"mr. jackson cook was born in new york \", 0);\n\n // The start signal is used as a starting point for relational id counter.\n startSignal.addInput(doc, 0, 1, 0); // iteration, begin, end, relational id\n\n int i = 0;\n for(String w: doc.getContent().split(\" \")) {\n int j = i + w.length();\n // The space is used as a clock signal to increase the relational id.\n spaceN.addInput(doc, j, j + 1);\n\n // Feed the individual words as inputs into the network.\n inputNeurons.get(w).addInput(doc, i, j);\n i = j + 1;\n }\n\n // Search for the best interpretation of this text.\n doc.process();\n\n System.out.println(doc.neuronActivationsToString(true, false, true));\n System.out.println();\n\n System.out.println(\"Selected Option: \" + doc.bestInterpretation.toString());\n System.out.println();\n\n System.out.println(\"Activations of the Surname Category:\");\n for(Activation act: surnameCategory.getFinalActivations(doc)) {\n System.out.print(act.key.r + \" \");\n System.out.print(act.key.rid + \" \");\n System.out.print(act.key.o + \" \");\n System.out.print(act.key.n.neuron.get().label + \" \");\n System.out.print(act.finalState.value);\n }\n\n doc.clearActivations();\n }", "private void train() throws IOException {\n\t\thamContent = new String();// the content of ham training files\n\t\tspamContent = new String();// the content of spam training files\n\t\tvocabulary = new ArrayList<String>();// all the\n\t\t\t\t\t\t\t\t\t\t\t\t// vocabulary\n\t\t\t\t\t\t\t\t\t\t\t\t// within\n\t\t\t\t\t\t\t\t\t\t\t\t// training\n\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\thamSenderDomainHash = new HashMap<String, Integer>();\n\t\thamTimeHash = new HashMap<String, Integer>();\n\t\thamReplyHash = new HashMap<String, Integer>();\n\t\thamNonCharNumHash = new HashMap<String, Integer>();\n\t\tspamSenderDomainHash = new HashMap<String, Integer>();\n\t\tspamTimeHash = new HashMap<String, Integer>();\n\t\tspamReplyHash = new HashMap<String, Integer>();\n\t\tspamNonCharNumHash = new HashMap<String, Integer>();\n\n\t\thamWordProb = new HashMap<String, Double>();\n\t\tspamWordProb = new HashMap<String, Double>();\n\t\tclassProb = new HashMap<String, Double>();\n\n\t\tfor (int i = 0; i < 24; i++) {\n\t\t\thamTimeHash.put(String.valueOf(i), 0);\n\t\t\tspamTimeHash.put(String.valueOf(i), 0);\n\t\t}\n\t\tint numSpam = 0, numHam = 0, numFile = 0;// numbers of training files\n\t\tString buff;// file reading tmp buffer\n\n\t\t/* get all the files in the directory */\n\t\tFile directory = new File(inputDirectory);\n\t\tFile[] files = directory.listFiles();\n\n\t\t/*\n\t\t * assign the content of hams and spams while counting the number of\n\t\t * files\n\t\t */\n\t\tfor (File f : files) {\n\t\t\tif (f.getName().startsWith(\"spam\")) {\n\t\t\t\tString readbuffer = readFile(f, 1);\n\t\t\t\tif (!spamTime.equals(\"-1\")) {\n\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain, 0);\n\t\t\t\t\thamSenderDomainHash.put(spamSenderDomain, 0);\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum, 0);\n\t\t\t\t\thamNonCharNumHash.put(spamNonCharNum, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (f.getName().startsWith(\"ham\")) {\n\t\t\t\tString readbufferString = readFile(f, 0);\n\t\t\t\tif (!hamTime.equals(\"-1\")) {\n\t\t\t\t\tspamSenderDomainHash.put(hamSenderDomain, 0);\n\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain, 0);\n\t\t\t\t\tspamNonCharNumHash.put(hamNonCharNum, 0);\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (File f : files) {\n\t\t\tnumFile++;\n\t\t\t// System.out.println(f.getName());\n\t\t\tif (f.getName().startsWith(\"spam\")) {\n\t\t\t\tnumSpam++; // add to the number of spams\n\t\t\t\tString readbuffer = readFile(f, 1);\n\t\t\t\tif (!spamNonCharNumHash.containsKey(spamNonCharNum))\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum, 1);\n\t\t\t\telse if (spamNonCharNumHash.containsKey(spamNonCharNum))\n\t\t\t\t\tspamNonCharNumHash.put(spamNonCharNum,\n\t\t\t\t\t\t\tspamNonCharNumHash.get(spamNonCharNum) + 1);\n\t\t\t\tif (!spamTime.equals(\"-1\")) {\n\t\t\t\t\tif (!spamSenderDomainHash.containsKey(spamSenderDomain)\n\t\t\t\t\t\t\t&& !(spamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (spamSenderDomain.length() <= 3))\n\t\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain, 1);\n\t\t\t\t\telse if (spamSenderDomainHash.containsKey(spamSenderDomain)\n\t\t\t\t\t\t\t&& !(spamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (spamSenderDomain.length() <= 3))\n\t\t\t\t\t\tspamSenderDomainHash.put(spamSenderDomain,\n\t\t\t\t\t\t\t\tspamSenderDomainHash.get(spamSenderDomain) + 1);\n\t\t\t\t\tif (!spamTimeHash.containsKey(spamTime))\n\t\t\t\t\t\tspamTimeHash.put(spamTime, 1);\n\t\t\t\t\telse if (spamTimeHash.containsKey(spamTime))\n\t\t\t\t\t\tspamTimeHash.put(spamTime,\n\t\t\t\t\t\t\t\tspamTimeHash.get(spamTime) + 1);\n\t\t\t\t\tif (!spamReplyHash.containsKey(spamReply))\n\t\t\t\t\t\tspamReplyHash.put(spamReply, 1);\n\t\t\t\t\telse if (spamReplyHash.containsKey(spamReply))\n\t\t\t\t\t\tspamReplyHash.put(spamReply,\n\t\t\t\t\t\t\t\tspamReplyHash.get(spamReply) + 1);\n\n\t\t\t\t}\n\t\t\t\tspamContent += readbuffer.toLowerCase();\n\t\t\t\tspamContent = spamContent.replaceAll(\"[^a-zA-Z$\\n]+\", \" \");\n\n\t\t\t} else if (f.getName().startsWith(\"ham\")) { // the same thing for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ham\n\t\t\t\tnumHam++;\n\t\t\t\tString readbuffer = readFile(f, 0);\n\t\t\t\tif (!hamNonCharNumHash.containsKey(hamNonCharNum))\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum, 1);\n\t\t\t\telse if (hamNonCharNumHash.containsKey(hamNonCharNum))\n\t\t\t\t\thamNonCharNumHash.put(hamNonCharNum,\n\t\t\t\t\t\t\thamNonCharNumHash.get(hamNonCharNum) + 1);\n\t\t\t\tif (!hamTime.equals(\"-1\")) {\n\t\t\t\t\tif (!hamSenderDomainHash.containsKey(hamSenderDomain)\n\t\t\t\t\t\t\t&& !(hamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (hamSenderDomain.length() <= 3))\n\t\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain, 1);\n\t\t\t\t\telse if (hamSenderDomainHash.containsKey(hamSenderDomain)\n\t\t\t\t\t\t\t&& !(hamSenderDomain.equals(\"\"))\n\t\t\t\t\t\t\t&& (hamSenderDomain.length() <= 3))\n\t\t\t\t\t\thamSenderDomainHash.put(hamSenderDomain,\n\t\t\t\t\t\t\t\thamSenderDomainHash.get(hamSenderDomain) + 1);\n\n\t\t\t\t\tif (!hamTimeHash.containsKey(hamTime))\n\t\t\t\t\t\thamTimeHash.put(hamTime, 1);\n\t\t\t\t\telse if (hamTimeHash.containsKey(hamTime))\n\t\t\t\t\t\thamTimeHash.put(hamTime, hamTimeHash.get(hamTime) + 1);\n\t\t\t\t\tif (!hamReplyHash.containsKey(hamReply))\n\t\t\t\t\t\thamReplyHash.put(hamReply, 1);\n\t\t\t\t\telse if (hamReplyHash.containsKey(hamReply))\n\t\t\t\t\t\thamReplyHash.put(hamReply,\n\t\t\t\t\t\t\t\thamReplyHash.get(hamReply) + 1);\n\n\t\t\t\t}\n\t\t\t\thamContent += readbuffer.toLowerCase();\n\t\t\t\thamContent = hamContent.replaceAll(\"[^a-zA-Z$\\n]+\", \" \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"file read complete!!!\");\n\t\t// System.out.println(hamSenderDomainHash);\n\t\t// System.out.println(hamTimeHash);\n\t\t// System.out.println(hamReplyHash);\n\t\t// System.out.println(hamNonCharNumHash);\n\t\t// System.out.println(spamSenderDomainHash);\n\t\t// System.out.println(spamTimeHash);\n\t\t// System.out.println(spamReplyHash);\n\t\t// System.out.println(spamNonCharNumHash);\n\t\t// System.out.println(spamContent);\n\t\t// System.out.println(hamContent);\n\n\t\t/* calculate probabilities */\n\t\tpHam = (double) numHam / (double) numFile;\n\t\tpSpam = (double) numSpam / (double) numFile;\n\t\t// System.out.println(numHam);\n\t\t// System.out.println(numSpam);\n\t\t// System.out.println(numFile);\n\n\t\tclassProb.put(\"hamProb\", pHam);\n\t\tclassProb.put(\"spamProb\", pSpam);\n\n\t\t/* get vocabulary and its length */\n\t\tString[] hamWord = hamContent.split(\"\\\\s+\");\n\t\tHashMap<String, Integer> hamWordFreq = new HashMap<String, Integer>();\n\t\tfor (int i = 0; i < hamWord.length; i++) {\n\t\t\tif (hamWordFreq.containsKey(hamWord[i]))\n\t\t\t\thamWordFreq.put(hamWord[i], hamWordFreq.get(hamWord[i]) + 1);\n\t\t\tif (!hamWordFreq.containsKey(hamWord[i]))\n\t\t\t\thamWordFreq.put(hamWord[i], 1);\n\t\t}\n\t\thamWordCount = hamWord.length;\n\t\tString[] spamWord = spamContent.split(\"\\\\s+\");\n\t\tHashMap<String, Integer> spamWordFreq = new HashMap<String, Integer>();\n\t\tfor (int i = 0; i < spamWord.length; i++) {\n\t\t\tif (spamWordFreq.containsKey(spamWord[i]))\n\t\t\t\tspamWordFreq\n\t\t\t\t\t\t.put(spamWord[i], spamWordFreq.get(spamWord[i]) + 1);\n\t\t\tif (!spamWordFreq.containsKey(spamWord[i]))\n\t\t\t\tspamWordFreq.put(spamWord[i], 1);\n\t\t}\n\t\tspamWordCount = spamWord.length;\n\t\tSystem.out.println(hamWordFreq.size());\n\t\tSystem.out.println(spamWordFreq.size());\n\t\tSystem.out.println(\"count get!!!\");\n\t\t// System.out.println(hamWordCount);\n\t\t// System.out.println(spamWordCount);\n\t\tfor (int i = 0; i < hamWordCount; i++) {\n\t\t\tif (!vocabulary.contains(hamWord[i]) && !hamWord[i].equals(\"\"))\n\t\t\t\tvocabulary.add(hamWord[i]);\n\t\t}\n\t\t// System.out.println(hamWordFreq);\n\t\tfor (int i = 0; i < spamWordCount; i++)\n\t\t\tif (!vocabulary.contains(spamWord[i]) && !spamWord[i].equals(\"\"))\n\t\t\t\tvocabulary.add(spamWord[i]);\n\t\tvocabLen = vocabulary.size();\n\t\tSystem.out.println(\"vocab init\");\n\t\t/* remove unnecessary words */\n\t\tfor (int i = 0; i < vocabulary.size(); i++) {\n\t\t\tint hamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\thamwordFreq = hamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\thamwordFreq = 0;\n\t\t\t}\n\t\t\tint spamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\tspamwordFreq = spamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\tspamwordFreq = 0;\n\t\t\t}\n\t\t\tif ((hamwordFreq <= 3) && (spamwordFreq <= 3)) {\n\t\t\t\tvocabulary.remove(i);\n\t\t\t\ti--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (((double) ((double) hamwordFreq / (double) hamWordCount) >= 0.005)\n\t\t\t\t\t&& ((double) ((double) spamwordFreq / (double) spamWordCount) >= 0.005)) {\n\t\t\t\t// System.out.println(vocabulary.get(i));\n\t\t\t\tvocabulary.remove(i);\n\t\t\t\ti--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"vocab complete!!!\");\n\t\tSystem.out.println(vocabulary.size());\n\t\tvocabLen = vocabulary.size();\n\t\tfor (int i = 0; i < vocabulary.size(); i++) {\n\t\t\tint hamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\thamwordFreq = hamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\thamwordFreq = 0;\n\t\t\t}\n\t\t\tint spamwordFreq = 0;\n\t\t\ttry {\n\t\t\t\tspamwordFreq = spamWordFreq.get(vocabulary.get(i));\n\t\t\t} catch (Exception e) {\n\t\t\t\tspamwordFreq = 0;\n\t\t\t}\n\t\t\thamWordProb.put(\n\t\t\t\t\tvocabulary.get(i),\n\t\t\t\t\tjava.lang.Math.log((double) (hamwordFreq + 1)\n\t\t\t\t\t\t\t/ (double) (hamWordCount + vocabLen)));\n\t\t\tspamWordProb.put(\n\t\t\t\t\tvocabulary.get(i),\n\t\t\t\t\tjava.lang.Math.log((double) (spamwordFreq + 1)\n\t\t\t\t\t\t\t/ (double) (spamWordCount + vocabLen)));\n\t\t\t// System.out.println(i);\n\n\t\t}\n\t\t// System.out.println(hamWordCount);\n\t\t// System.out.println(hamContent);\n\t\t// System.out.println(hamWordProb.size());\n\t\t// System.out.println(spamWordProb.size());\n\t\t// System.out.println(vocabulary.size());\n\t\t//\n\t\t// System.out.println(hamWordProb.size());\n\t\t// System.out.println(vocabulary);\n\t\t// System.out.println(vocabLen);\n\t\tSystem.out.println(\"word prob complete!!!\");\n\t}", "public void testConvolution2() {\n ConvolutionLayer cl1 = new ConvolutionLayer(28, 28, 32, 5, 1, 1,ActivationFunction.LEAKYRELU);\r\n cl1.setName(\"Conv1\");\r\n PoolLayer pl1 = new PoolLayer(28, 28, 32, 2, 2,1);\r\n pl1.setName(\"Pool1\");\r\n\r\n FuzzyficationLayer fl = new FuzzyficationLayer(pl1.getNrOfOutputs(), 10, 1);\r\n\r\n Layer full = new Layer(fl.getNrOfOutputs(), 0, 10, ActivationFunction.CESIGMOID);\r\n full.setName(\"full\");\r\n full.setDropRate(.003f);\r\n\r\n DeepLayer dl = new DeepLayer(new LearningRateConst(LEARNING_RATE), cl1, pl1, fl, full);\r\n dl.setCostFunction(new CrossEntropyCostFunction());\r\n\r\n BinImageReader bir = new BinImageReader(\"/data/train-images.idx3-ubyte.bin\");\r\n fmatrix images = bir.getResult();\r\n System.out.println(images.getSizeAsString());\r\n\r\n BinLabelReader blr = new BinLabelReader(\"/data/train-labels.idx1-ubyte.bin\");\r\n fmatrix trainSetLabels = blr.getResult();\r\n System.out.println(trainSetLabels.getSizeAsString());\r\n\r\n Random r = new Random(System.currentTimeMillis());\r\n dl.randomizeWeights(r, -.1f, .1f);\r\n\r\n int maxImage = images.getNrOfColumns();\r\n fmatrix image = new fmatrix(1, images.getNrOfColumns());\r\n fmatrix target = new fmatrix(1, 10);\r\n\r\n System.out.println(image.getSizeAsString());\r\n String weightFolder = \"weights/\" + dl.getTrainingStartTimeAsFolder();\r\n for (int i = 0; i < TRAIN_ITERATIONS; ++i) {\r\n target.reset();\r\n for (int b = 0; b < 1; ++b) {\r\n int nextImage = r.nextInt(maxImage);\r\n images.getRow(nextImage, b, image);\r\n\r\n int digit = (int) trainSetLabels.get(0, nextImage);\r\n target.set(b, digit, 1);\r\n }\r\n dl.train(i, image, target, TrainingMode.BATCH);\r\n// if (i == 0) {\r\n// dl.writeOutputImages();\r\n// }\r\n if (i % BATCH_SIZE == 0) {\r\n dl.adaptWeights(i, BATCH_SIZE);\r\n }\r\n\r\n if (i % WEIGHT_DEBUG_CYCLE == 0) {\r\n dl.writeWeightImages(weightFolder, i);\r\n }\r\n }\r\n dl.writeWeightImages(weightFolder, TRAIN_ITERATIONS);\r\n\r\n DeepLayerWriter dlw = new DeepLayerWriter();\r\n Path export = Paths.get(System.getProperty(\"user.home\"), \".nn\", weightFolder, \"final.nn\");\r\n dlw.writeDeepLayer(export, dl);\r\n testDigitRecognition(dl, 1, r);\r\n }", "public MENameTagger () {\n\t\tmene = new MaxEntNE();\n\t\tannotator = new HMMannotator(mene);\n\t\tannotator.setBItag (true);\n\t\tannotator.setAnnotateEachToken (false);\n\t}", "public NeuralNet(int[] sizes) {\n _layers = new double[sizes.length][];\n for (int i = 0; i < sizes.length; i++) {\n _layers[i] = new double[sizes[i]];\n }\n\n _weights = new double[sizes.length-1][][];\n _biases = new double[sizes.length - 1][];\n for (int i = 0; i < sizes.length-1; i++) {\n _weights[i] = new double[sizes[i+1]][];\n _biases[i] = new double[sizes[i+1]];\n for (int j = 0; j < sizes[i+1]; j++) {\n _weights[i][j] = new double[sizes[i]];\n }\n }\n }", "private void createNeuralNet() {\n\t\tMSimulationConfig simConfig;\n\t\tHashMap<Integer, MNeuron> neuronMap = new HashMap<Integer, MNeuron>();\n\t\tArrayList<MNeuron> neurons = new ArrayList<MNeuron>();\n\t\tArrayList<MSynapse> synapses = new ArrayList<MSynapse>();\n\n\t\tNeatGenome genome = (NeatGenome) geneticObject;\n\t\t/* Create neurons. */\n\t\tfor (NeatNode nn : genome.getNodes()) {\n\t\t\tint id = nn.getId();\n\t\t\tMNeuronParams params = nn.getParams();\n\t\t\tMNeuronState state =\n\t\t\t\t\tMFactory.createInitialRSNeuronState();\n\n\t\t\t/* Create a neuron. */\n\t\t\tMNeuron neuron = new MNeuron(params, state, id);\n\n\t\t\t/* Add it to temporary NID->Neuron map. */\n\t\t\tneuronMap.put(id, neuron);\n\n\t\t\t/* Add neuron to the list. */\n\t\t\tneurons.add(neuron);\n\t\t}\n\n\t\t/* Create synapses. */\n\t\tfor (GenomeEdge<NeatNode> g : genome.getGene()) {\n\t\t\t/* Get the synapse information. */\n\t\t\tNeatNode preNode = g.getIn();\n\t\t\tNeatNode postNode = g.getOut();\n\t\t\tdouble weight = g.getWeight();\n\t\t\tint delay = g.getDelay();\n\t\t\tInteger preNid = new Integer(preNode.getId());\n\t\t\tInteger postNid = new Integer(postNode.getId());\n\n\t\t\t/* Find the pre and post neurons. */\n\t\t\tMNeuron preNeuron = neuronMap.get(preNid);\n\t\t\tMNeuron postNeuron = neuronMap.get(postNid);\n\n\t\t\t/* Create the synapse. */\n\t\t\tMSynapse synapse = new MSynapse(preNeuron, postNeuron,\n\t\t\t\t\tweight, delay);\n\t\t\t/*\n\t\t\tAdd the synapse to the pre and post neuron synapse list\n\t\t\t */\n\t\t\tArrayList<MSynapse> postSynapses\n\t\t\t= preNeuron.getPostSynapses();\n\t\t\tArrayList<MSynapse> preSynapses\n\t\t\t= postNeuron.getPreSynapses();\n\n\t\t\tpostSynapses.add(synapse);\n\t\t\tpreSynapses.add(synapse);\n\n\t\t\tpreNeuron.setPostSynapses(postSynapses);\n\t\t\tpostNeuron.setPreSynapses(preSynapses);\n\n\t\t\t/* Add the synapse to the list. */\n\t\t\tsynapses.add(synapse);\n\t\t}\n\n\t\t/* Create the network. */\n\t\tthis.mnetwork = new MNetwork(neurons, synapses);\n\n\t\t/* Create and set the simulation configuration parameters. */\n\t\tsimConfig = new MSimulationConfig(20);\n\n\t\t/* Create the simulation instance with our network. */\n\t\tthis.msimulation = new MSimulation(this.mnetwork, simConfig);\n\t}", "DataGenModel()\n {\n }", "com.google.ortools.linearsolver.MPModelProto getModel();", "public Generation(){\n\t\twords = new ArrayList<String>();\n\t}", "public void saveTrainingDataToFileUpSampling() throws Exception {\r\n //set tokenizer - we can specify n-grams for classification\r\n NGramTokenizer tokenizer = new NGramTokenizer();\r\n tokenizer.setNGramMinSize(1);\r\n tokenizer.setNGramMaxSize(1);\r\n tokenizer.setDelimiters(\"\\\\W\");\r\n\r\n //set stemmer - set english stemmer\r\n SnowballStemmer stemmer = new SnowballStemmer();\r\n stemmer.setStemmer(\"english\");\r\n\r\n //set lemmatizer\r\n StanfordCoreNLPLemmatizer scnlpl = new StanfordCoreNLPLemmatizer();\r\n\r\n //create new filter for vector transformation\r\n StringToWordVector filter = new StringToWordVector();\r\n filter.setLowerCaseTokens(true);\r\n filter.setOutputWordCounts(true);\r\n filter.setTFTransform(true);\r\n filter.setIDFTransform(true);\r\n filter.setStopwords(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\StopWordsR2.txt\")); // stop word removal given in research paper\r\n filter.setTokenizer(tokenizer);\r\n filter.setStemmer(scnlpl);\r\n\r\n System.out.println(\"Stemmer Name- \" + filter.getStemmer());\r\n\r\n InstanceQuery query = new InstanceQuery();\r\n query.setUsername(\"root\");\r\n query.setPassword(\"\");\r\n\r\n int numberOfPapers = 5;\r\n\r\n Instances[] otherArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'other'\");\r\n otherArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='other'\");\r\n otherArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='other'\");\r\n otherArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'other'\");\r\n otherArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'other'\");\r\n otherArticles[4] = query.retrieveInstances();\r\n\r\n Instances[] crimeArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'crime'\");\r\n crimeArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='crime'\");\r\n crimeArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='crime'\");\r\n crimeArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'crime'\");\r\n crimeArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'crime'\");\r\n crimeArticles[4] = query.retrieveInstances();\r\n\r\n FastVector attributeList = new FastVector(2);\r\n Attribute a1 = new Attribute(\"text\", (FastVector) null);\r\n FastVector classVal = new FastVector();\r\n classVal.addElement(\"crime\");\r\n classVal.addElement(\"other\");\r\n Attribute c = new Attribute(\"@@class@@\", classVal);\r\n //add class attribute and news text\r\n attributeList.addElement(a1);\r\n attributeList.addElement(c);\r\n Instances trainingData = new Instances(\"TrainingNews\", attributeList, 0);\r\n trainingData.setClassIndex(1);\r\n\r\n int crimeArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < crimeArticles[i].numInstances(); j++) {\r\n for (int k = 0; k < 5; k++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, crimeArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, crimeArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n crimeArticlesCount++;\r\n }\r\n }\r\n }\r\n System.out.println(\"Total Number of Crime Instances: \" + crimeArticlesCount);\r\n\r\n int otherArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < otherArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, otherArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, otherArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n otherArticlesCount++;\r\n\r\n if (otherArticlesCount == crimeArticlesCount) {\r\n break;\r\n }\r\n }\r\n if (otherArticlesCount == crimeArticlesCount) {\r\n break;\r\n }\r\n }\r\n System.out.println(\"Total Number of Other Instances: \" + otherArticlesCount);\r\n System.out.println(\"Total num of instances= \" + trainingData.numInstances());\r\n\r\n // apply the StringToWordVector filter\r\n filter.setInputFormat(trainingData);\r\n Instances dataFiltered = Filter.useFilter(trainingData, filter);\r\n System.out.println(\"Number of Attributes after stop words removal- \" + dataFiltered.numAttributes());\r\n System.out.println(\"\\n\\nFiltered data:\\n\\n\" + dataFiltered);\r\n\r\n Random r = new Random();\r\n dataFiltered.randomize(r);\r\n\r\n ArffSaver saver = new ArffSaver();\r\n saver.setInstances(dataFiltered);\r\n saver.setFile(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSRandom.arff\"));\r\n saver.writeBatch();\r\n }", "public WordNet(String synsets, String hypernyms)\n {\n if (synsets==null || hypernyms==null) throw new IllegalArgumentException();\n h=new TreeMap<>();\n In i1=new In(synsets);\n int i=0;\n h2=new ArrayList<>();\n while(!i1.isEmpty())\n {\n String[] temp=i1.readLine().split(\",\");\n String[] temp2=temp[1].trim().split(\"\\\\s+\");\n String t=\"\";\n for (String s:temp2)\n {\n if (h.containsKey(s))\n {\n h.get(s).add(i);\n }\n else\n {\n ArrayList<Integer> a=new ArrayList<>();\n a.add(i);\n h.put(s,a);\n }\n\n t=t+s+\" \";\n }\n h2.add(t);\n i++;\n }\n\n g=new Digraph(i);\n In i2=new In(hypernyms);\n while (!i2.isEmpty())\n {\n String[] temp=i2.readLine().split(\",\");\n int j=Integer.parseInt(temp[0].trim());\n for (int k=1;k<temp.length;k++)\n g.addEdge(j, Integer.parseInt(temp[k].trim()));\n }\n\n sap=new SAP(g);\n\n //All the below lines check for Illegal Arguments\n DirectedCycle obj=new DirectedCycle(g);\n boolean b=obj.hasCycle();\n if (b) throw new IllegalArgumentException();\n\n int numberOfRoots=0;\n for (int j=0;j<g.V() && numberOfRoots < 2;j++)\n if (g.outdegree(j)==0) numberOfRoots++;\n\n //System.out.println(\"The number of roots is \"+numberOfRoots);\n if (numberOfRoots!=1) throw new IllegalArgumentException();\n }", "public static void main(String[] args) {\r\n // feed the generator a fixed random value for repeatable behavior\r\n MarkovTextGeneratorLoL gen = new MarkovTextGeneratorLoL(new Random(42));\r\n //String textString = \"hi there hi Leo\";\r\n //String textString = \"\";\r\n \r\n String textString = \"Hello. Hello there. This is a test. Hello there. Hello Bob. Test again.\";\r\n System.out.println(textString);\r\n gen.train(textString);\r\n System.out.println(gen);\r\n System.out.println(\"Generator: \" + gen.generateText(0));\r\n String textString2 = \"You say yes, I say no, \" +\r\n \"You say stop, and I say go, go, go, \" +\r\n \"Oh no. You say goodbye and I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"I say high, you say low, \" +\r\n \"You say why, and I say I don't know. \" +\r\n \"Oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"Why, why, why, why, why, why, \" +\r\n \"Do you say goodbye. \" +\r\n \"Oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello. \" +\r\n \"You say yes, I say no, \" +\r\n \"You say stop and I say go, go, go. \" +\r\n \"Oh, oh no. \" +\r\n \"You say goodbye and I say hello, hello, hello. \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello, \" +\r\n \"I don't know why you say goodbye, I say hello, hello, hello,\";\r\n System.out.println(textString2);\r\n gen.retrain(textString2);\r\n System.out.println(gen);\r\n System.out.println(gen.generateText(20));\r\n }", "NNImpl(ArrayList<Instance> trainingSet, int hiddenNodeCount, Double learningRate, int maxEpoch, Random random, Double[][] hiddenWeights, Double[][] outputWeights) {\r\n this.trainingSet = trainingSet;\r\n this.learningRate = learningRate;\r\n this.maxEpoch = maxEpoch;\r\n this.random = random;\r\n\r\n //input layer nodes\r\n inputNodes = new ArrayList<>();\r\n int inputNodeCount = trainingSet.get(0).attributes.size();\r\n int outputNodeCount = trainingSet.get(0).classValues.size();\r\n for (int i = 0; i < inputNodeCount; i++) {\r\n Node node = new Node(0);\r\n inputNodes.add(node);\r\n }\r\n\r\n //bias node from input layer to hidden\r\n Node biasToHidden = new Node(1);\r\n inputNodes.add(biasToHidden);\r\n\r\n //hidden layer nodes\r\n hiddenNodes = new ArrayList<>();\r\n for (int i = 0; i < hiddenNodeCount; i++) {\r\n Node node = new Node(2);\r\n //Connecting hidden layer nodes with input layer nodes\r\n for (int j = 0; j < inputNodes.size(); j++) {\r\n NodeWeightPair nwp = new NodeWeightPair(inputNodes.get(j), hiddenWeights[i][j]);\r\n node.parents.add(nwp);\r\n }\r\n hiddenNodes.add(node);\r\n }\r\n\r\n //bias node from hidden layer to output\r\n Node biasToOutput = new Node(3);\r\n hiddenNodes.add(biasToOutput);\r\n\r\n //Output node layer\r\n outputNodes = new ArrayList<>();\r\n for (int i = 0; i < outputNodeCount; i++) {\r\n Node node = new Node(4);\r\n //Connecting output layer nodes with hidden layer nodes\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n NodeWeightPair nwp = new NodeWeightPair(hiddenNodes.get(j), outputWeights[i][j]);\r\n node.parents.add(nwp);\r\n }\r\n outputNodes.add(node);\r\n }\r\n }", "public void createBodyMetamorphWekaNN() throws Exception\n {\n // Create instances.\n bodyMetamorphWekaInstances = new Instances(\"body_metamorphs\", bodyMetamorphWekaNNattributeNames, 0);\n for (List<Metamorph> metamorphList : bodyMetamorphs.values())\n {\n for (Metamorph m : metamorphList)\n {\n bodyMetamorphWekaInstances.add(createInstance(bodyMetamorphWekaInstances, m));\n }\n }\n bodyMetamorphWekaInstances.setClassIndex(bodyMetamorphWekaInstances.numAttributes() - 1);\n\n // Create and train the neural network.\n MultilayerPerceptron mlp = new MultilayerPerceptron();\n bodyMetamorphWekaNN = mlp;\n mlp.setLearningRate(0.1);\n mlp.setMomentum(0.2);\n mlp.setTrainingTime(2000);\n mlp.setHiddenLayers(\"20\");\n mlp.setOptions(Utils.splitOptions(\"-L 0.1 -M 0.2 -N 2000 -V 0 -S 0 -E 20 -H 20\"));\n mlp.buildClassifier(bodyMetamorphWekaInstances);\n\n // Save training instances?\n if (saveMetamorphWekaInstances)\n {\n ArffSaver saver = new ArffSaver();\n saver.setInstances(bodyMetamorphWekaInstances);\n saver.setFile(new File(\"bodyMetamorphWekaInstances.arff\"));\n saver.writeBatch();\n }\n\n // Save networks?\n if (saveMetamorphWekaNN)\n {\n Debug.saveToFile(\"bodyMetamorphWekaNN.dat\", mlp);\n }\n\n // Evaluate the network.\n if (evaluateMetamorphWekaNN)\n {\n Evaluation eval = new Evaluation(bodyMetamorphWekaInstances);\n eval.evaluateModel(mlp, bodyMetamorphWekaInstances);\n System.out.println(\"Error rate=\" + eval.errorRate());\n System.out.println(eval.toSummaryString());\n }\n }", "public void trainFromExamples(int noOfIteration, double eenta) throws FileNotFoundException {\n //Use the wordcount to calcualte the weight verctor repetetively\n for (int count = 0; count < noOfIteration; count++) \n {\n for (List<Integer> wordCount : wordCountSpamList) \n {\n //Compute the new weight vector\n calculateNewWeightVector(eenta, true, wordCount);\n \n }\n for (List<Integer> wordCount : wordCountHamList) \n {\n //Compute the new weight vector\n calculateNewWeightVector(eenta, false, wordCount);\n \n }\n }\n \n }", "public ME_Model() {\n _nheldout = 0;\n _early_stopping_n = 0;\n _ref_modelp = null;\n }", "public OpenGLModel() {\n\n\n\t}", "public void buildUnigramModel(String fileName) throws IOException {\n\t\t// this function gives frequency of each letter\n\t\tBufferedReader testReader = new BufferedReader(new FileReader(fileName));\n\t\tString line = null;\n\t\tMap<String, Integer> count = new HashMap<>();\n\t\t\n\t\tcount.put(terminal, 0);\n\t\tint totalCount = 1; // there is already terminal char in map, so 1 instead of 0.\n\t\tString cc = null; // to process char c\n\t\twhile ((line = testReader.readLine()) != null) { // unigram doesn't consider the sentences\n\t\t\tfor (char c : line.toCharArray()) {\n\t\t\t\tif (Character.isLetter(c) || c == ' ' || c == ',' || c == '.' || c == '\\'') {\n\t\t\t\t\tif (Character.isLowerCase(c)) {\n\t\t\t\t\t\tc = (char) (c + 'A' - 'a');\n\t\t\t\t\t}\n\t\t\t\t\tcc = String.valueOf(c);\n\t\t\t\t\tif (!count.containsKey(cc)) {\n\t\t\t\t\t\tcount.put(cc, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcount.put(cc, count.get(cc) + 1);\n\t\t\t\t\t}\n\t\t\t\t\ttotalCount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount.put(terminal, count.get(terminal) + 1); // add a '$' to the end of this sentence.\n\t\t}\n\t\tthis.sizeOfUniword = totalCount;\n\t\tuni = new HashMap<>(count);\n\t\tlm.putAll(count);\n//\t\tSystem.out.println(\"File \" + fileName + \"\\'s unigram model is ready.\");\n\t\ttestReader.close();\n\t}", "public void initWeights(){\r\n Random rand = new Random();\r\n double e = Math.sqrt(6.0/(wordSize*windowSize+hiddenSize));\r\n \r\n W = SimpleMatrix.random(hiddenSize, windowSize*wordSize, -e, e, rand);\r\n b1 = new SimpleMatrix(hiddenSize, 1);\r\n b1.zero();\r\n \r\n //U = SimpleMatrix.random(hiddenSize, 1, -0.1, 0.1, rand);\r\n U = new SimpleMatrix(hiddenSize, 1);\r\n U.zero();\r\n b2 = 0.0;\r\n \r\n C = C/(W.getNumElements()+U.getNumElements());\r\n \t}", "public void modelNew(Model m)\n {\n\tmodelStop();\n\tmanim = new GenerationsAnimator(m.generations());\n\tmanim.scale(width,height);\n\tclearToBack();\n\tmodelStep();\n\t//modelStart();\n\tStatusBar.setStatus(\"Ready\");\n\n\tif (cListener != null)\n\t cListener.setButtonState(true);\n }", "public WorldModel(){\t\n\t}", "public InterpolationModel() {\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n }", "public void addInstances (InstanceList training)\n\t{\n\t\tSystem.out.println(\"LabeledLDA Model : Adding training instances ..%\");\n\t\t//Data Alphabet\n\t\talphabet = training.getDataAlphabet();\n\t\tnumTypes = alphabet.size();\n\t\tbetaSum = beta * numTypes;\n\t\t\n\t\t// We have one topic for every possible label.\n\t\tlabelAlphabet = training.getTargetAlphabet();\n\t\tnumTopics = labelAlphabet.size();\n\t\toneDocTopicCounts = new int[numTopics];\n\t\ttokensPerTopic = new int[numTopics];\n\t\ttypeTopicCounts = new int[numTypes][numTopics];\n\n\t\t//topicAlphabet = AlphabetFactory.labelAlphabetOfSize(numTopics); //generate d0,d1 [3shan target string w hwa 3wzo label]\n topicAlphabet = new LabelAlphabet();\n\t\tfor (int i = 0; i < numTopics; i++) {\n\t\t\tString target = labelAlphabet.lookupObject(i).toString();\n topicAlphabet.lookupLabel(target);\n\t\t}\n //System.out.println(topicAlphabet);\n\n for (Instance instance : training)\n\t\t{\n\t\t\tFeatureSequence tokens = (FeatureSequence) instance.getData(); //read data featureSequence\n\t\t\tLabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[ tokens.size() ]);\n FeatureVector labels = (FeatureVector) instance.getTarget(); //read target featurevector\n\n\t\t\tint[] topics = topicSequence.getFeatures();\n\t\t\tfor (int position = 0; position < tokens.size(); position++)\n\t\t\t{\n\t\t\t\tint topic = labels.indexAtLocation(random.nextInt(labels.numLocations()));\n\t\t\t\ttopics[position] = topic;\n\t\t\t\ttokensPerTopic[topic]++;\n\t\t\t\tint type = tokens.getIndexAtPosition(position);\n\t\t\t\ttypeTopicCounts[type][topic]++;\n\t\t\t}\n\t\t\tTopicAssignment t = new TopicAssignment(instance, topicSequence);\n\t\t\tdata.add(t);\n\t\t}\n\t\t/*\n for (Instance instance : training)\n {\n FeatureSequence tokens = (FeatureSequence) instance.getData();\n LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[ tokens.size() ]);\n\n int[] topics = topicSequence.getFeatures();\n for (int position = 0; position < topics.length; position++) {\n int topic = random.nextInt(numTopics);\n topics[position] = topic;\n }\n TopicAssignment t = new TopicAssignment(instance, topicSequence);\n data.add(t);\n }\n\n buildInitialTypeTopicCounts();\n initializeHistograms();\n\t\t */\n\t\tSystem.out.println(\"Data loaded.\");\n\t}", "public void testConvolution() {\n ConvolutionLayer cl1 = new ConvolutionLayer(28, 28, 32, 5, 1, 1, ActivationFunction.RELU);\r\n cl1.setName(\"Conv1\");\r\n PoolLayer pl1 = new PoolLayer(28, 28, 32, 2, 2, 1);\r\n pl1.setName(\"Pool1\");\r\n ConvolutionLayer cl2 = new ConvolutionLayer(14, 14, 32, 64, 5, 1, 1, ActivationFunction.LEAKYRELU);\r\n cl2.setName(\"Conv2\");\r\n PoolLayer pl2 = new PoolLayer(14, 14, 64, 2, 2, 1);\r\n pl2.setName(\"Pool2\");\r\n Layer full = new Layer(pl2.getNrOfOutputs(), 1, 10, ActivationFunction.CESIGMOID);\r\n full.setName(\"full\");\r\n full.setDropRate(.3f);\r\n\r\n DeepLayer dl = new DeepLayer(new LearningRateConst(LEARNING_RATE), cl1, pl1, cl2, pl2, full);\r\n dl.setCostFunction(new CrossEntropyCostFunction());\r\n\r\n BinImageReader bir = new BinImageReader(\"/data/train-images.idx3-ubyte.bin\");\r\n fmatrix images = bir.getResult();\r\n System.out.println(images.getSizeAsString());\r\n\r\n BinLabelReader blr = new BinLabelReader(\"/data/train-labels.idx1-ubyte.bin\");\r\n fmatrix trainSetLabels = blr.getResult();\r\n System.out.println(trainSetLabels.getSizeAsString());\r\n\r\n Random r = new Random(System.currentTimeMillis());\r\n dl.randomizeWeights(r, -.1f, .1f);\r\n\r\n int maxImage = images.getNrOfColumns();\r\n fmatrix image = new fmatrix(1, images.getNrOfColumns());\r\n fmatrix target = new fmatrix(1, 10);\r\n\r\n System.out.println(image.getSizeAsString());\r\n String weightFolder = \"weights/\" + dl.getTrainingStartTimeAsFolder();\r\n for (int i = 0; i < TRAIN_ITERATIONS; ++i) {\r\n target.reset();\r\n for (int b = 0; b < 1; ++b) {\r\n int nextImage = r.nextInt(maxImage);\r\n images.getRow(nextImage, b, image);\r\n\r\n int digit = (int) trainSetLabels.get(0, nextImage);\r\n target.set(b, digit, 1);\r\n }\r\n dl.train(i, image, target, TrainingMode.BATCH);\r\n// if (i == 0) {\r\n// dl.writeOutputImages();\r\n// }\r\n if (i % BATCH_SIZE == 0) {\r\n dl.adaptWeights(i, BATCH_SIZE);\r\n }\r\n\r\n if (i % WEIGHT_DEBUG_CYCLE == 0) {\r\n dl.writeWeightImages(weightFolder, i);\r\n }\r\n }\r\n\r\n dl.writeWeightImages(weightFolder, TRAIN_ITERATIONS);\r\n testDigitRecognition(dl, 1, r);\r\n }", "public DigitGuessNeuralNetwork(){\r\n neuralNetwork=NeuralNetwork.load(MainActivity.neuralNetInputStream);\r\n }", "public void saveTrainingDataToFileUpSamplingWithSMOTE() throws Exception {\r\n //set tokenizer - we can specify n-grams for classification\r\n NGramTokenizer tokenizer = new NGramTokenizer();\r\n tokenizer.setNGramMinSize(1);\r\n tokenizer.setNGramMaxSize(1);\r\n tokenizer.setDelimiters(\"\\\\W\");\r\n\r\n //set stemmer - set english stemmer\r\n SnowballStemmer stemmer = new SnowballStemmer();\r\n stemmer.setStemmer(\"english\");\r\n\r\n //set lemmatizer\r\n StanfordCoreNLPLemmatizer scnlpl = new StanfordCoreNLPLemmatizer();\r\n\r\n //create new filter for vector transformation\r\n StringToWordVector filter = new StringToWordVector();\r\n filter.setLowerCaseTokens(true);\r\n filter.setOutputWordCounts(true);\r\n filter.setTFTransform(true);\r\n filter.setIDFTransform(true);\r\n filter.setStopwords(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\StopWordsR2.txt\"));\r\n filter.setTokenizer(tokenizer);\r\n filter.setStemmer(scnlpl);\r\n\r\n System.out.println(\"Stemmer Name- \" + filter.getStemmer());\r\n\r\n InstanceQuery query = new InstanceQuery();\r\n query.setUsername(\"root\");\r\n query.setPassword(\"\");\r\n\r\n int numberOfPapers = 5;\r\n\r\n Instances[] otherArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'other'\");\r\n otherArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='other'\");\r\n otherArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='other'\");\r\n otherArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'other'\");\r\n otherArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'other'\");\r\n otherArticles[4] = query.retrieveInstances();\r\n\r\n Instances[] crimeArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'crime'\");\r\n crimeArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='crime'\");\r\n crimeArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='crime'\");\r\n crimeArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'crime'\");\r\n crimeArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'crime'\");\r\n crimeArticles[4] = query.retrieveInstances();\r\n\r\n FastVector attributeList = new FastVector(2);\r\n Attribute a1 = new Attribute(\"text\", (FastVector) null);\r\n FastVector classVal = new FastVector();\r\n classVal.addElement(\"crime\");\r\n classVal.addElement(\"other\");\r\n Attribute c = new Attribute(\"@@class@@\", classVal);\r\n //add class attribute and news text\r\n attributeList.addElement(a1);\r\n attributeList.addElement(c);\r\n Instances trainingData = new Instances(\"TrainingNews\", attributeList, 0);\r\n trainingData.setClassIndex(1);\r\n\r\n int crimeArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < crimeArticles[i].numInstances(); j++) {\r\n\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, crimeArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, crimeArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n crimeArticlesCount++;\r\n// if (crimeArticlesCount == 50) {\r\n// break;\r\n// }\r\n }\r\n// if (crimeArticlesCount == 50) {\r\n// break;\r\n// }\r\n }\r\n\r\n System.out.println(\"Total Number of Crime Instances: \" + crimeArticlesCount);\r\n\r\n int otherArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < otherArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, otherArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, otherArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n otherArticlesCount++;\r\n\r\n// if (otherArticlesCount == 100) {\r\n// break;\r\n// }\r\n }\r\n//// if (otherArticlesCount == 100) {\r\n//// break;\r\n//// }\r\n }\r\n System.out.println(\"Total Number of Other Instances: \" + otherArticlesCount);\r\n System.out.println(\"Total num of instances= \" + trainingData.numInstances());\r\n\r\n\r\n // apply the StringToWordVector filter\r\n filter.setInputFormat(trainingData);\r\n Instances dataFiltered = Filter.useFilter(trainingData, filter);\r\n System.out.println(\"Number of Attributes after stop words removal- \" + dataFiltered.numAttributes());\r\n System.out.println(\"\\n\\nFiltered data:\\n\\n\" + dataFiltered);\r\n\r\n /**\r\n * Resamples a dataset by applying the Synthetic Minority Oversampling\r\n * TEchnique (SMOTE)\r\n * http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume16/chawla02a-html/node6.html\r\n * http://weka.sourceforge.net/doc.packages/SMOTE/weka/filters/supervised/instance/SMOTE.html \r\n *\r\n */\r\n SMOTE s = new SMOTE();\r\n s.setInputFormat(dataFiltered);\r\n // Specifies percentage of SMOTE instances to create.\r\n s.setPercentage(464.0);\r\n Instances dataBalanced = Filter.useFilter(dataFiltered, s);\r\n\r\n Random r = new Random();\r\n dataBalanced.randomize(r);\r\n\r\n ArffSaver saver = new ArffSaver();\r\n saver.setInstances(dataBalanced);\r\n saver.setFile(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSSMOTE464Random.arff\"));\r\n saver.writeBatch();\r\n }", "public Digraph createGraph() {\n wordGraph = new Digraph(words.size());\n\n for (int v = 0; v < words.size(); v++) {\n for (int w = 0; w < words.size(); w++) {\n if (compareWords(words.get(v), words.get(w))) {\n wordGraph.addEdge(w, v);\n }\n }\n }\n return wordGraph;\n }", "private void _generate(int versions) {\n\t \n\t \n\t \n\t _generate(); //V0\n\t \n\t File[] files = new File(System.getProperty(\"user.dir\")).listFiles();\n\t Model model = ModelFactory.createDefaultModel();\n\t //model.set\n\t\tfor(File file : files){\n\t\t\tif(!file.getName().contains(\"owl\")) continue;\n\t\t\ttry{\n\t\t\t\t\n\t\t\t\tFileInputStream in = new FileInputStream(file);\n\t\t\t\tmodel.read(in, \"http://example.com\", \"RDF/XML\");\t\t\t\n\t\t\t\tin.close();\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tlong startingSize = model.size();\n\t\tmodel.close();\n\t double desSize = startingSize*(1+evoChange);\n\t int schemaEvol = (int)(strict*10);\n\t int schemaEvol2 = schemaEvol / (evoVersions-1);\n\t System.out.println(\"schema evol param: \" + schemaEvol2);\n\t int howManyDepts = (int) Math.floor(totalDeptsV0*evoChange);\n\t HashMap<Integer, String> newClasses = new HashMap<Integer, String>();\n\t for(int i = 0; i < schemaEvol; i++)\n\t\t newClasses.put(i,\"\");\n\n\t double evoChangeOriginal = evoChange;\n\t boolean pub = false, conf = false, journ = false, tech = false, \n\t\t\t book = false, thes = false, proj = false, even = false;\n\t HashMap<String, HashMap<Integer, Double>> initialWeightsMap = new HashMap<String, HashMap<Integer,Double>>();\n\t for(String key : fileWeightsMap.keySet()){\n\t\t HashMap<Integer, Double> innerClone = new HashMap<Integer, Double>();\n\t\t for(Integer innerKey : fileWeightsMap.get(key).keySet()){\n\t\t\t innerClone.put(innerKey, fileWeightsMap.get(key).get(innerKey));\n\t\t }\n\t\t initialWeightsMap.put(key, innerClone);\n\t }\n\t for(int vi = 0 ; vi < evoVersions-1; vi++){\n\t \t\n\t\t globalVersionTrigger = true;\n\t\t File dir = new File(System.getProperty(\"user.dir\")+\"/v\"+vi);\n dir.mkdirs();\n\t\t //assignFilters(classFilters);\n\t\t //System.out.println(\"current filters: \" + currentFilters.toString());\n\t \tint classForChange ;\n\t \n\t \t//the number of depts (files) to evolve, based on the defined evoChange parameter\t \n\t \n\t List<String> asList = new ArrayList<String>(fileWeightsMap.keySet());\n\t \n\t writer_log = new OwlWriter(this);\t \n writer_log.startLogFile(dir.getAbsolutePath()+\"/changes.rdf\");\n writer_log.start();\n\t for(int d = 0 ; d < howManyDepts ; d++){\n\t \t\n\t \t//System.out.println(\"aslist: \" + asList.size());\n\t \tif(asList.size() == 0) break;\n\t String randomFile = asList.get(random_.nextInt(asList.size()));\n\t instances_ = fileInstanceMap.get(randomFile);\n\t \n\t asList.remove(randomFile);\n\t \t\n\t //System.out.println(\"Selected file: \" + randomFile);\n\t writer_ = new OwlWriter(this);\n\t \n\t writer_.startFile(dir.getAbsolutePath()+\"/\"+randomFile);\n\t writer_.start();\n\t for(Integer nextClass : fileWeightsMap.get(randomFile).keySet()){\n\t \t\n\t \tclassForChange = nextClass;\n\t \t\n\t \tif(classForChange < 2) {\n\t \t\t\tcontinue;\n\t \t}\n\t \t\n\t \tif(classForChange == 4) continue;\n\t \tint totalIter = (int) Math.floor(2*initialWeightsMap.get(randomFile).get(classForChange))/howManyDepts;\n\t \t\n\t for(int i = 0; i < totalIter ; i++){\n\t \t\n\t \t_generateASection(classForChange, \n\t \t\t\tinstances_[classForChange].count ); \t \t\t\t\n\t }\n\t \n\t if(nextClass == 21 ){\n\t \twriter_log.addTypeClass(ontology+\"WebCourse\");\n\t \twriter_log.addSuperClass(ontology+\"WebCourse\", ontology+\"Course\");\n\t }\n\t else if(nextClass == 20 ){\n\t \twriter_log.addTypeClass(ontology+\"VisitingStudent\");\n\t \twriter_log.addSuperClass(ontology+\"VisitingStudent\", ontology+\"Student\");\n\t }\n\t else if(nextClass == 19 ){\n\t \twriter_log.addTypeClass(ontology+\"VisitingProfessor\");\n\t \twriter_log.addSuperClass(ontology+\"VisitingProfessor\", ontology+\"Professor\");\n\t }\n\t \n\t }\n\t \n\t for(int k = 0; k < schemaEvol2+1; k++){\n\t \t\n\t \tif(newClasses.isEmpty()) break;\n\t \tint newClass = _getRandomFromRange(0, newClasses.keySet().size()+1);\n\t \tint index = 0;\n\t \tfor(Integer s : newClasses.keySet()){\n\t \t\tif(index == newClass){\n\t \t\t\tnewClass = s;\n\t \t\t\tbreak;\n\t \t\t}\n\t \t\tindex++;\n\t \t}\n\t \t/*if(newClass == 1){\n\t \t_generatePublications();\n\t \tnewClasses.remove(newClass);\n\t }*/\n\t if(newClass == 2){\n\t \t_generateConferencePublications();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"ConferencePublication\");\n\t \twriter_log.addSuperClass(ontology+\"ConferencePublication\", ontology+\"Publication\");\n\t }\n\t if(newClass == 3){\n\t \t_generateJournalPublications();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"JournalArticle\");\n\t \twriter_log.addSuperClass(ontology+\"JournalArticle\", ontology+\"Publication\");\n\t }\n\t if(newClass == 4 ){\n\t \t_generateTechnicalReports();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"TechnicalReport\");\n\t \twriter_log.addSuperClass(ontology+\"TechnicalReport\", ontology+\"Publication\");\n\t }\n\t if(newClass == 5 ){\n\t \t_generateBooks();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Book\");\n\t \twriter_log.addSuperClass(ontology+\"Book\", ontology+\"Publication\");\n\t }\n\t if(newClass == 6 ){\n\t \t_generateThesis();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Thesis\");\n\t \twriter_log.addSuperClass(ontology+\"Thesis\", ontology+\"Publication\");\n\t }\n\t if(newClass == 7 ){\n\t \t_generateProjects();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Project\");\n\t }\n\t if(newClass == 8){\n\t \t_generateEvents();\n\t \tnewClasses.remove(newClass);\n\t \twriter_log.addTypeClass(ontology+\"Event\");\n\t }\n\t }\n\t \n\t writer_.end();\n\t writer_.endFile();\n\t //correction\n\t //remainingUnderCourses_.\n\t remainingUnderCourses_.clear();\n\t \n\t for (int i = 0; i < UNDER_COURSE_NUM + (int) (UNDER_COURSE_NUM*evoChange); i++) {\n\t remainingUnderCourses_.add(new Integer(i));\n\t }\n\t remainingGradCourses_.clear();\n\t for (int i = 0; i < GRAD_COURSE_NUM + (int) (GRAD_COURSE_NUM*evoChange); i++) {\n\t remainingGradCourses_.add(new Integer(i));\n\t }\n\t remainingWebCourses_.clear();\n\t for (int i = 0; i < WEB_COURSE_NUM + (int) (WEB_COURSE_NUM*evoChange); i++) {\n\t remainingWebCourses_.add(new Integer(i));\n\t }\n\t \n\t assignWeights(randomFile);\t \t \n\t \n\t }\t\n\t evoChange = evoChange + evoVersions*evoChangeOriginal*evoChangeOriginal;\n\t \n\t writer_log.end();\n\t writer_log.endLogFile();\n\t \n\t \t\n\t }\n\t \n\t \n }", "public Context(Model<Label> model, List<Prediction<Label>> predictions) {\n super(model, predictions);\n this.cm = new LabelConfusionMatrix(model.getOutputIDInfo(), predictions);\n }", "@Test\n public void testNamedEntityRecognitionWithoutCounterNeuron() {\n Model m = new Model(null, 1); // number of threads\n\n Neuron forenameCategory = m.createNeuron(\"C-forename\");\n Neuron surnameCategory = m.createNeuron(\"C-surname\");\n Neuron suppressingN = m.createNeuron(\"SUPPR\");\n\n\n // The word input neurons which do not yet possess a relational id.\n HashMap<String, Neuron> inputNeurons = new HashMap<>();\n\n String[] words = new String[] {\n \"mr.\", \"jackson\", \"cook\", \"was\", \"born\", \"in\", \"new\", \"york\"\n };\n for(String word: words) {\n Neuron in = m.createNeuron(\"W-\" + word);\n\n inputNeurons.put(word, in);\n }\n\n // The entity neurons represent the concrete meanings of the input words.\n // The helper function 'initAndNeuron' computes the required bias for a\n // conjunction of the inputs.\n Neuron cookSurnameEntity = m.initNeuron(\n m.createNeuron(\"E-cook (surname)\"),\n 3.0, // adjusts the bias\n new Input() // Requires the word to be recognized\n .setNeuron(inputNeurons.get(\"cook\"))\n .setWeight(10.0f)\n // This input requires the input activation to have an\n // activation value of at least 0.9\n .setBiasDelta(0.9)\n .setRelativeRid(0) // references the current word\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input() // The previous word needs to be a forename\n .setNeuron(forenameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(-1) // references the previous word\n .setRecurrent(true) // this input is a positive feedback loop\n .setRangeMatch(NONE)\n .setRangeOutput(false),\n\n // This neuron may be suppressed by the E-cook (profession) neuron, but there is no\n // self suppression taking place even though 'E-cook (surname)' is also contained\n // in the suppressingN.\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true) // this input is a negative feedback loop\n .setRangeMatch(CONTAINS)\n );\n\n Neuron cookProfessionEntity = m.initNeuron(\n m.createNeuron(\"E-cook (profession)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"cook\"))\n .setWeight(15.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINS)\n );\n\n Neuron jacksonForenameEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (forename)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"jackson\"))\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(0)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(surnameCategory)\n .setWeight(10.0f)\n .setBiasDelta(0.9)\n .setRelativeRid(1)\n .setRecurrent(true)\n .setRangeMatch(NONE),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n Neuron jacksonCityEntity = m.initNeuron(\n m.createNeuron(\"E-jackson (city)\"),\n 3.0,\n new Input()\n .setNeuron(inputNeurons.get(\"jackson\"))\n .setWeight(12.0f)\n .setBiasDelta(0.9)\n .setRecurrent(false)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(suppressingN)\n .setWeight(-20.0f)\n .setBiasDelta(1.0)\n .setRecurrent(true)\n .setRangeMatch(CONTAINED_IN)\n );\n\n m.initNeuron(\n forenameCategory,\n 0.0,\n new Input() // In this example there is only one forename considered.\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n m.initNeuron(\n surnameCategory,\n -0.001,\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRelativeRid(0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n m.initNeuron(\n suppressingN,\n -0.001,\n new Input().setNeuron(cookProfessionEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(cookSurnameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonCityEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true),\n new Input()\n .setNeuron(jacksonForenameEntity)\n .setWeight(10.0f)\n .setBiasDelta(0.0)\n .setRangeMatch(EQUALS)\n .setRangeOutput(true)\n );\n\n\n // Now that the model is complete, start processing an actual text.\n Document doc = m.createDocument(\"mr. jackson cook was born in new york \");\n\n int i = 0;\n int wordPos = 0;\n for(String w: doc.getContent().split(\" \")) {\n int j = i + w.length();\n\n // Feed the individual words as inputs into the network.\n inputNeurons.get(w).addInput(doc, i, j, wordPos);\n i = j + 1;\n wordPos++;\n }\n\n // Search for the best interpretation of this text.\n doc.process();\n\n System.out.println(doc.neuronActivationsToString(true, false, true));\n System.out.println();\n\n System.out.println(\"Final Interpretation: \" + doc.bestInterpretation.toString());\n System.out.println();\n\n System.out.println(\"Activations of the Surname Category:\");\n for(Activation act: surnameCategory.getFinalActivations(doc)) {\n System.out.print(act.key.r + \" \");\n System.out.print(act.key.rid + \" \");\n System.out.print(act.key.o + \" \");\n System.out.print(act.key.n.neuron.get().label + \" \");\n System.out.print(act.finalState.value);\n }\n\n doc.clearActivations();\n }", "public WordNet(String synsets, String hypernyms) throws IOException {\n\n this.synsetsMap = new HashMap<Integer, ArrayList<String>>();\n this.nounsMap = new HashMap<String, ArrayList<Integer>>();\n this.edgesMap = new HashMap<Integer, ArrayList<Integer>>();\n int graphNodes = 0; \n \n // Process synsets.txt\n BufferedReader br = new BufferedReader(new FileReader(synsets));\n String line;\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int synsetID = Integer.parseInt(items[0]);\n String[] nouns = items[1].split(\" \");\n \n for (String noun : nouns) {\n if (!nounsMap.containsKey(noun)) {\n nounsMap.put(noun, new ArrayList<Integer>());\n }\n nounsMap.get(noun).add(synsetID);\n }\n \n if (!synsetsMap.containsKey(synsetID)) {\n synsetsMap.put(synsetID, new ArrayList<String>());\n }\n \n for (String noun : nouns) {\n synsetsMap.get(synsetID).add(noun);\n }\n graphNodes++; \n }\n br.close();\n\n // Process hypernyms.txt\n br = new BufferedReader(new FileReader(hypernyms));\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int hypernymID = Integer.parseInt(items[0]);\n \n if (!edgesMap.containsKey(hypernymID)) {\n edgesMap.put(hypernymID, new ArrayList<Integer>());\n }\n \n for (int i = 1; i < items.length; i++) {\n edgesMap.get(hypernymID).add(Integer.parseInt(items[i]));\n }\n }\n br.close();\n \n // Construct Graph\n this.G = new Digraph(graphNodes);\n for (Map.Entry<Integer, ArrayList<Integer>> entry : edgesMap.entrySet()) {\n for (int edge : entry.getValue()) {\n this.G.addEdge(entry.getKey(), edge);\n }\n }\n \n // Check if there's a cycle\n DirectedCycle cycle = new DirectedCycle(this.G);\n if (cycle.hasCycle()) {\n throw new java.lang.IllegalArgumentException();\n }\n \n // Construct SAP \n this.sap = new SAP(this.G);\n }", "HdbSequenceModel createHdbSequenceModel();", "private void saveToFile() throws Exception {\n NGramTokenizer tokenizer = new NGramTokenizer();\r\n tokenizer.setNGramMinSize(1);\r\n tokenizer.setNGramMaxSize(1);\r\n tokenizer.setDelimiters(\"\\\\W\");\r\n\r\n //set stemmer - set english stemmer\r\n SnowballStemmer stemmer = new SnowballStemmer();\r\n stemmer.setStemmer(\"english\");\r\n\r\n //set lemmatizer\r\n StanfordCoreNLPLemmatizer scnlpl = new StanfordCoreNLPLemmatizer();\r\n\r\n //create new filter for vector transformation\r\n StringToWordVector filter = new StringToWordVector();\r\n filter.setLowerCaseTokens(true); //ok accepted\r\n filter.setOutputWordCounts(true); // ok accepted given in research papers\r\n filter.setTFTransform(true); // normalization as given in scikit\r\n filter.setIDFTransform(true); // normalization as given in scikit \r\n filter.setStopwords(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\StopWordsR2.txt\")); // stop word removal given in research paper\r\n filter.setTokenizer(tokenizer); // given in research papers\r\n filter.setStemmer(scnlpl); // given in research papers as stemming , here we go forward as use lemmatizer\r\n // feature selection has not performed as \"how to\" paper say that it wont improve accuracy in SVM and our dictionary\r\n // is small\r\n\r\n\r\n System.out.println(\"Stemmer Name- \" + filter.getStemmer());\r\n\r\n\r\n InstanceQuery query = new InstanceQuery();\r\n query.setUsername(\"root\");\r\n query.setPassword(\"\");\r\n\r\n int numberOfPapers = 5;\r\n\r\n Instances[] otherArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'other'\");\r\n otherArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='other'\");\r\n otherArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='other'\");\r\n otherArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'other'\");\r\n otherArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'other'\");\r\n otherArticles[4] = query.retrieveInstances();\r\n\r\n Instances[] crimeArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'crime'\");\r\n crimeArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='crime'\");\r\n crimeArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='crime'\");\r\n crimeArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'crime'\");\r\n crimeArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'crime'\");\r\n crimeArticles[4] = query.retrieveInstances();\r\n\r\n\r\n\r\n\r\n FastVector attributeList = new FastVector(2);\r\n Attribute a1 = new Attribute(\"text\", (FastVector) null);\r\n FastVector classVal = new FastVector();\r\n classVal.addElement(\"crime\");\r\n classVal.addElement(\"other\");\r\n Attribute c = new Attribute(\"@@class@@\", classVal);\r\n //add class attribute and news text\r\n attributeList.addElement(a1);\r\n attributeList.addElement(c);\r\n Instances trainingData = new Instances(\"TrainingNews\", attributeList, 0);\r\n trainingData.setClassIndex(1);\r\n\r\n\r\n int crimeArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < crimeArticles[i].numInstances(); j++) {\r\n\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, crimeArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, crimeArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n crimeArticlesCount++;\r\n\r\n }\r\n\r\n }\r\n\r\n System.out.println(\"Total Number of Crime Instances: \" + crimeArticlesCount);\r\n\r\n\r\n int otherArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < otherArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, otherArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, otherArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n otherArticlesCount++;\r\n\r\n }\r\n }\r\n System.out.println(\"Total Number of Other Instances: \" + otherArticlesCount);\r\n\r\n System.out.println(\"Total num of instances= \" + trainingData.numInstances());\r\n\r\n\r\n // apply the StringToWordVector filter\r\n filter.setInputFormat(trainingData);\r\n Instances dataFiltered = Filter.useFilter(trainingData, filter);\r\n System.out.println(\"Number of Attributes after stop words removal- \" + dataFiltered.numAttributes());\r\n //System.out.println(\"\\n\\nFiltered data:\\n\\n\" + dataFiltered);\r\n System.out.println(dataFiltered.instance(8086));\r\n\r\n ArffSaver saver = new ArffSaver();\r\n saver.setInstances(dataFiltered);\r\n saver.setFile(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingPreDataHybrid2.arff\"));\r\n saver.writeBatch();\r\n }", "public Context(SequenceModel<Label> model, List<Prediction<Label>> predictions) {\n super(model, predictions);\n this.cm = new LabelConfusionMatrix(model.getOutputIDInfo(), predictions);\n }", "NCModel getModel();", "final public ASTModel Model() throws ParseException {\r\n /*@bgen(jjtree) Model */\r\n ASTModel jjtn000 = new ASTModel(JJTMODEL);\r\n boolean jjtc000 = true;\r\n jjtree.openNodeScope(jjtn000);\r\n try {\r\n if (jj_2_1(2)) {\r\n jj_consume_token(BEGIN);\r\n jj_consume_token(MODEL);\r\n label_1:\r\n while (true) {\r\n jj_consume_token(BEGIN);\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case COMPARTMENTS:\r\n CompartmentsBlock();\r\n break;\r\n case PARAMETERS:\r\n ParameterBlock();\r\n break;\r\n case MOLECULE:\r\n MolecularDefinitionBlock();\r\n break;\r\n case ANCHORS:\r\n AnchorsBlock();\r\n break;\r\n case SEED:\r\n SeedSpeciesBlock();\r\n break;\r\n case REACTION:\r\n ReactionRulesBlock();\r\n break;\r\n case OBSERVABLES:\r\n ObservablesBlock();\r\n break;\r\n case FUNCTIONS:\r\n FunctionsBlock();\r\n break;\r\n default:\r\n jj_la1[0] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case BEGIN:\r\n ;\r\n break;\r\n default:\r\n jj_la1[1] = jj_gen;\r\n break label_1;\r\n }\r\n }\r\n jj_consume_token(END);\r\n jj_consume_token(MODEL);\r\n label_2:\r\n while (true) {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case ACTION:\r\n ;\r\n break;\r\n default:\r\n jj_la1[2] = jj_gen;\r\n break label_2;\r\n }\r\n Action();\r\n }\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n } else if (jj_2_2(2)) {\r\n label_3:\r\n while (true) {\r\n jj_consume_token(BEGIN);\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case COMPARTMENTS:\r\n CompartmentsBlock();\r\n break;\r\n case PARAMETERS:\r\n ParameterBlock();\r\n break;\r\n case MOLECULE:\r\n MolecularDefinitionBlock();\r\n break;\r\n case ANCHORS:\r\n AnchorsBlock();\r\n break;\r\n case SEED:\r\n SeedSpeciesBlock();\r\n break;\r\n case REACTION:\r\n ReactionRulesBlock();\r\n break;\r\n case OBSERVABLES:\r\n ObservablesBlock();\r\n break;\r\n case FUNCTIONS:\r\n FunctionsBlock();\r\n break;\r\n default:\r\n jj_la1[3] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case BEGIN:\r\n ;\r\n break;\r\n default:\r\n jj_la1[4] = jj_gen;\r\n break label_3;\r\n }\r\n }\r\n label_4:\r\n while (true) {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case ACTION:\r\n ;\r\n break;\r\n default:\r\n jj_la1[5] = jj_gen;\r\n break label_4;\r\n }\r\n Action();\r\n }\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n } else {\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n } catch (Throwable jjte000) {\r\n if (jjtc000) {\r\n jjtree.clearNodeScope(jjtn000);\r\n jjtc000 = false;\r\n } else {\r\n jjtree.popNode();\r\n }\r\n if (jjte000 instanceof RuntimeException) {\r\n {if (true) throw (RuntimeException)jjte000;}\r\n }\r\n if (jjte000 instanceof ParseException) {\r\n {if (true) throw (ParseException)jjte000;}\r\n }\r\n {if (true) throw (Error)jjte000;}\r\n } finally {\r\n if (jjtc000) {\r\n jjtree.closeNodeScope(jjtn000, true);\r\n }\r\n }\r\n throw new Error(\"Missing return statement in function\");\r\n }", "public MarkovWord(int myOrder){\n this.myOrder = myOrder; \n }", "private void createHiddenLayer() {\r\n\t\tint layers = 1;\r\n\t\t\r\n\t\tint hiddenLayerSize = 0; \r\n\t\tint prevLayerSize = numAttributes;\r\n\t\t\r\n\t\tfor (int layer = 0; layer < layers; layer++) {\r\n\t\t\thiddenLayerSize = (numAttributes + numClasses) / 2;\r\n\t\t\t\r\n\t\t\tfor (int nob = 0; nob < hiddenLayerSize; nob++) {\r\n\t\t\t\tInnerNode temp = new InnerNode(String.valueOf(nextId), random);\r\n\t\t\t\tnextId++;\r\n\t\t\t\taddNode(temp);\r\n\t\t\t\tif (layer > 0) {\r\n\t\t\t\t\t// then do connections\r\n\t\t\t\t\tfor (int noc = innerNodes.size() - nob - 1 - prevLayerSize; noc < innerNodes.size() - nob - 1; noc++) {\r\n\t\t\t\t\t\tNeuralNode.connect(innerNodes.get(noc), temp);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprevLayerSize = hiddenLayerSize;\r\n\t\t}\r\n\r\n\t\tif (hiddenLayerSize == 0) {\r\n\t\t\tfor (InputNode input : inputs) {\r\n\t\t\t\tfor (NeuralNode node : innerNodes) {\r\n\t\t\t\t\tNeuralNode.connect(input, node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (NeuralNode input : inputs) {\r\n\t\t\t\tfor (int nob = numClasses; nob < numClasses + hiddenLayerSize; nob++) {\r\n\t\t\t\t\tNeuralNode.connect(input, innerNodes.get(nob));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (int noa = innerNodes.size() - prevLayerSize; noa < innerNodes.size(); noa++) {\r\n\t\t\t\tfor (int nob = 0; nob < numClasses; nob++) {\r\n\t\t\t\t\tNeuralNode.connect(innerNodes.get(noa), innerNodes.get(nob));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void buildModel(SparseMatrix rm) {\n\t\trateMatrix = rm;\n\t\t\n\t\t/* =====================\n\t\t * COMMENT FOR AUTHORS\n\t\t * =====================\n\t\t * Using the training data in \"rm\", you are supposed to write codes to learn your model here.\n\t\t * If your method is memory-based one, you may leave the model as rateMatrix itself, simply by \"rateMatrix = rm;\".\n\t\t * If your method is model-based algorithm, you may not need a reference to rateMatrix.\n\t\t * (In this case, you may remove the variable \"rateMatrix\", just as matrix-factorization-based methods do in this toolkit.)\n\t\t * Note that in any case train data in \"rateMatrix\" are read-only. You should not alter any value in it to guarantee proper operation henceforth.\n\t\t */\n\t}", "protected DirectProductNodeModel() {\n\t\tsuper(2, 1);\n\t}", "public VocabularyTerms() {}", "public Form_stage_one() {\n System.out.println(Global.categories.size());\n initComponents();\n ws = new JWS(\"WordNet\", \"2.1\");\n stem = new WordnetStemmer(ws.getDictionary());\n POSTaggerButton.setVisible(false);\n }", "public WordMatrix(int N) {\n solution = new int[N][N];\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n solution[i][j] = 0;\n }\n }\n }", "public TwoClassConfusionMatrix() {\n\t}", "public RtfOptimizer()\n {\n }", "M getModel();", "public NNImpl(ArrayList<Instance> trainingSet, int hiddenNodeCount, Double learningRate, int maxEpoch, Double [][]hiddenWeights, Double[] outputWeights)\r\n\t{\r\n\t\tthis.trainingSet=trainingSet;\r\n\t\tthis.learningRate=learningRate;\r\n\t\tthis.maxEpoch=maxEpoch;\r\n\r\n\t\t//input layer nodes\r\n\t\tinputNodes=new ArrayList<Node>();\r\n\t\tint inputNodeCount=trainingSet.get(0).attributes.size();\r\n\t\tint outputNodeCount=1;\r\n\t\tfor(int i=0;i<inputNodeCount;i++)\r\n\t\t{\r\n\t\t\tNode node=new Node(0);\r\n\t\t\tinputNodes.add(node);\r\n\t\t}\r\n\r\n\t\t//bias node from input layer to hidden\r\n\t\tNode biasToHidden=new Node(1);\r\n\t\tinputNodes.add(biasToHidden);\r\n\r\n\t\t//hidden layer nodes\r\n\t\thiddenNodes=new ArrayList<Node> ();\r\n\t\tfor(int i=0;i<hiddenNodeCount;i++)\r\n\t\t{\r\n\t\t\tNode node=new Node(2);\r\n\t\t\t//Connecting hidden layer nodes with input layer nodes\r\n\t\t\tfor(int j=0;j<inputNodes.size();j++)\r\n\t\t\t{\r\n\t\t\t\tNodeWeightPair nwp=new NodeWeightPair(inputNodes.get(j),hiddenWeights[i][j]);\r\n\t\t\t\tnode.parents.add(nwp);\r\n\t\t\t}\r\n\t\t\thiddenNodes.add(node);\r\n\t\t}\r\n\r\n\t\t//bias node from hidden layer to output\r\n\t\tNode biasToOutput=new Node(3);\r\n\t\thiddenNodes.add(biasToOutput);\r\n\r\n\r\n\r\n\t\tNode node=new Node(4);\r\n\t\t//Connecting output node with hidden layer nodes\r\n\t\tfor(int j=0;j<hiddenNodes.size();j++)\r\n\t\t{\r\n\t\t\tNodeWeightPair nwp=new NodeWeightPair(hiddenNodes.get(j), outputWeights[j]);\r\n\t\t\tnode.parents.add(nwp);\r\n\t\t}\t\r\n\t\toutputNode = node;\r\n\r\n\t}", "@Override\n public int variableSize() {\n return CONSTANT.wordSize;\n }", "public TweetTagger() throws IOException {\n super();\n loadModel(MODEL_LOCATION);\n tfIdf = new HashMap<String, Map<String, Integer>>();\n documentFrequencyMap = new HashMap<String, Integer>();\n previousTopWords = new HashMap<String, List<Map<String, Double>>>();\n }", "public MD2_Model(PApplet app, int numFrames, int numXYZ, int frameSize,\n\t\t\tgb_Vector3[] points, gb_Vector3 modOffset, gb_Vector3 modSize,\n\t\t\tint[] glCommand, MD2_Loader.GL_Vertex[] vertex, PImage modelTex,\n\t\t\tMD2_ModelState[] state) {\n\t\tthis.app = app;\n\t\tthis.numFrames = numFrames;\n\t\tthis.numXYZ = numXYZ;\n\t\tthis.frameSize = frameSize;\n\t\tthis.point = points;\n\t\tthis.modOffset = modOffset;\n\t\tthis.modSize = modSize;\n\t\tthis.glComannd = glCommand;\n\t\tthis.glVertex = vertex;\n\t\tthis.modelTex = modelTex;\n\t\tthis.state = state;\n\t\tthis.stateIndex = 0;\n\t}", "abstract void train(Matrix features, Matrix labels);", "public NBClassifier(String trainDataFolder, int trainPortion)\n\t{\n\t\ttrainingDocs = new ArrayList<String>();\n\t\tallDocs = new ArrayList<String>();\n\t\tnumClasses = 2;\n\t\tclassCounts = new int[numClasses];\n\t\tclassStrings = new String[numClasses];\n\t\tclassTokenCounts = new int[numClasses];\n\t\tcondProb = new HashMap[numClasses];\n\t\tvocabulary = new HashSet<String>();\n\t\tfor(int i=0;i<numClasses;i++){ //just initialization\n\t\t\tclassStrings[i] = \"\";\n\t\t\tcondProb[i] = new HashMap<String,Double>();\n\t\t}\n\t\ttotalDocs = 5574;\n\t\toffset = Math.round(totalDocs) * trainPortion / 100;\n\t\tSystem.out.println(\"Numer of Documents For Training: \"+offset);\n\t\tSystem.out.println(\"Numer of Documents For Testing: \"+(totalDocs-offset));\n\t\tpreprocess(trainDataFolder);\n\t\t\n\t\tfor(int i=0;i<numClasses;i++){\n\t\t\tString[] tokens = classStrings[i].split(\" \");\n\t\t\tclassTokenCounts[i] = tokens.length;\n\t\t\t//collecting the counts\n\t\t\tfor(String token:tokens){\n\t\t\t\t//System.out.println(token);\n\t\t\t\tvocabulary.add(token);\n\t\t\t\tif(condProb[i].containsKey(token)){\n\t\t\t\t\tdouble count = condProb[i].get(token);\n\t\t\t\t\tcondProb[i].put(token, count+1);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tcondProb[i].put(token, 1.0);\n\t\t\t\t//System.out.println(token+\" : \"+condProb[i].get(token));\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<numClasses;i++){\n\t\t\tIterator<Map.Entry<String, Double>> iterator = condProb[i].entrySet().iterator();\n\t\t\tint vSize = vocabulary.size();\n\t\t\twhile(iterator.hasNext())\n\t\t\t{\n\t\t\t\tMap.Entry<String, Double> entry = iterator.next();\n\t\t\t\tString token = entry.getKey();\n\t\t\t\tDouble count = entry.getValue();\n\t\t\t\t//System.out.println(count+1+\" / ( \"+classTokenCounts[i]+\" + \"+vSize+\" )\");\n\t\t\t\tcount = (count+1)/(classTokenCounts[i]+vSize);\n\t\t\t\tcondProb[i].put(token, count);\n\t\t\t}\n\t\t\t//System.out.println(\"dekho: \"+condProb[i]);\n\t\t}\n\t\ttestModel();\n\t}", "public static void main(String[] args) {\n\t\tUtility.dirPath = \"C:\\\\Users\\\\imSlappy\\\\workspace\\\\FeelingAnalysis\\\\Documents\\\\2_group_eng\";\n\t\tString sub[] = {\"dup\",\"bug\"};\n\t\tUtility.classLabel = sub;\n\t\tUtility.numdoc = 350;\n\t\tSetClassPath.read_path(Utility.dirPath);\n\t\tUtility.language = \"en\";\n\t\t\n\t\tUtility.stopWordHSEN = Fileprocess.FileHashSet(\"data/stopwordAndSpc_eng.txt\");\n\t\tUtility.dicen = new _dictionary();\n\t\tUtility.dicen.getDictionary(\"data/dicEngScore.txt\");\n\t\t\n\t\tUtility.vocabHM = new HashMap();\n\t\t// ================= completed initial main Program ==========================\n\n\t\tMainExampleNaive ob = new MainExampleNaive();\n\t\t\n\t\t// --------------------- Pre-process -----------------------\n\t\tob.word_arr = new HashSet [Utility.listFile.length][];\n\t\tob.wordSet = new ArrayList<String>();\n\t\tfor (int i = 0; i < Utility.listFile.length; i++) {\n\t\t\tob.word_arr[i]=new HashSet[Utility.listFile[i].length];\n\t\t\tfor (int j = 0; j < Utility.listFile[i].length; j++) {\n\t\t\t\tStringBuffer strDoc = Fileprocess.readFile(Utility.listFile[i][j]);\n\t\t\t\tob.word_arr[i][j]=ob.docTokenization(new String(strDoc));\n\t\t\t}\n\t\t\tob.checkBound(3, 10000);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"++ Total : \"+Utility.vocabHM.size()+\" words\");\n\t\tSystem.out.println(\"++ \"+Utility.vocabHM);\n\t\t\n\t\t// ---------------------- Selection ------------------------\n//\t\tInformationGain ig = new InformationGain(ob.word_arr.length*ob.word_arr[0].length , ob.wordSet,ob.word_arr);\n//\t\tArrayList<String> ban_word = ig.featureSelection(0.0); // selected out with IG = 0\n//\t\t//ob.banFeature(ban_word);\n//\t\tSystem.out.println(\"ban list[\"+ban_word.size()+\"] : \"+ban_word);\n//\t\t\n//\t\tSystem.out.println(\"-- After \"+Utility.vocabHM.size());\n//\t\tSystem.out.println(\"-- \"+Utility.vocabHM);\n\t\t\n\t\tob.setWordPosition();\n\t\t// ---------------------- Processing -----------------------\n\t\tNaiveBayes naive = new NaiveBayes();\n\t\tnaive.naiveTrain(true);\n\t\t\n\t\tint result = naive.naiveUsage(\"after cold reset of my pc (crash of xp) the favorites of firefox are destroyed and all settings are standard again! Where are firefox-favorites stored and the settings ? how to backup them rgularely? All other software on my pc still works properly ! even INternetExplorer\");\n\t\tSystem.out.println(\"\\nResult : \"+Utility.classLabel[result]);\n\t}", "public void Tokenizer(String s) throws FileNotFoundException\r\n {\nInputStream modelIn = new FileInputStream(\"C:/OpenNLP_models/en-token.bin\"); \r\n\t \r\n // InputStream modelIn=getClass().getResourceAsStream(\"en-token.bin\");\r\n try {\r\n TokenizerModel model = new TokenizerModel(modelIn);\r\n TokenizerME tokenizer = new TokenizerME(model);\r\n String tokens[] = tokenizer.tokenize(s);\r\n \r\n for(int i=0; i<tokens.length;i++)\r\n {\r\n System.out.println(tokens[i]);\r\n }\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n if (modelIn != null) {\r\n try {\r\n modelIn.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n } \r\n } \r\n }", "private static void CreateClassifierVec(Dataset set, int dim_num,\n\t\t\tArrayList<KDNode> class_buff, int vec_offset) {\n\t\t\t\n\t\tAttribute atts[] = new Attribute[set.size()];\n\t\t// Declare the class attribute along with its values\n\t\t FastVector fvClassVal = new FastVector(4);\n\t\t fvClassVal.addElement(\"n2\");\n\t\t fvClassVal.addElement(\"n1\");\n\t\t fvClassVal.addElement(\"p1\");\n\t\t fvClassVal.addElement(\"p2\");\n\t\t Attribute ClassAttribute = new Attribute(\"theClass\", fvClassVal);\n\t \n\t\tFastVector fvWekaAttributes = new FastVector(set.size() + 1);\n\t for(int i=0; i<set.size(); i++) {\n\t \tatts[i] = new Attribute(\"att\"+i);\n\t \tfvWekaAttributes.addElement(atts[i]);\n\t }\n\t \n\t fvWekaAttributes.addElement(ClassAttribute);\n\t \n\t Instances isTrainingSet = new Instances(\"Rel\", fvWekaAttributes, class_buff.size()); \n\t isTrainingSet.setClassIndex(set.size());\n\t\t\n\t for(int k=0; k<class_buff.size(); k++) {\n\t \t\n\t \tArrayList<Integer> data_set = new ArrayList<Integer>();\n\t\t\tfor(int j=0; j<set.size(); j++) {\n\t\t\t\t\n\t\t\t\t\tint offset = 0;\n\t\t\t\t\tSet<Entry<Integer, Double>> s = set.instance(j).entrySet();\n\t\t\t\t\tdouble sample[] = new double[dim_num];\n\t\t\t\t\tfor(Entry<Integer, Double> val : s) {\n\t\t\t\t\t\tsample[offset++] = val.getValue();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint output = class_buff.get(k).classifier.Output(sample);\n\t\t\t\t\tdata_set.add(output);\n\t\t\t}\n\t\t\t\n\t\t\tif(data_set.size() != set.size()) {\n\t\t\t\tSystem.out.println(\"dim mis\");System.exit(0);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tInstance iExample = new Instance(set.size() + 1);\n\t\t\tfor(int j=0; j<set.size(); j++) {\n\t\t\t\tiExample.setValue(j, data_set.get(j));\n\t\t\t}\n\t\t\t\n\t\t\tif(Math.random() < 0.5) {\n\t\t\t\tiExample.setValue((Attribute)fvWekaAttributes.elementAt(set.size()), \"n1\"); \n\t\t\t} else {\n\t\t\t\tiExample.setValue((Attribute)fvWekaAttributes.elementAt(set.size()), \"p1\"); \n\t\t\t}\n\t\t\t \n\t\t\t// add the instance\n\t\t\tisTrainingSet.add(iExample);\n\t }\n\t\t\n\t System.out.println(dim_num+\" *************\");\n\t int select_num = 16;\n\t\tPrincipalComponents pca = new PrincipalComponents();\n\t\t//pca.setVarianceCovered(0.1);\n Ranker ranker = new Ranker();\n ranker.setNumToSelect(select_num);\n AttributeSelection selection = new AttributeSelection();\n selection.setEvaluator(pca);\n \n Normalize normalizer = new Normalize();\n try {\n normalizer.setInputFormat(isTrainingSet);\n isTrainingSet = Filter.useFilter(isTrainingSet, normalizer);\n \n selection.setSearch(ranker);\n selection.SelectAttributes(isTrainingSet);\n isTrainingSet = selection.reduceDimensionality(isTrainingSet);\n\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(0);\n }\n \n for(int i=0; i<class_buff.size(); i++) {\n \tInstance inst = isTrainingSet.instance(i);\n \tdouble val[] = inst.toDoubleArray();\n \tint offset = vec_offset;\n \t\n \tfloat length = 0;\n \tfor(int j=0; j<select_num; j++) {\n \t\tlength += val[j] * val[j];\n \t}\n \t\n \tlength = (float) Math.sqrt(length);\n \tfor(int j=0; j<select_num; j++) {\n \t\tclass_buff.get(i).class_vect[offset++] = val[j] / length;\n \t}\n }\n\t}", "EisModel createEisModel();", "public NetspeakAnalysisEngine() {\n super(Sentence.class, Token.class);\n this.netspeakCache = new Cache<>(new NetspeakRetriever());\n this.setApiBaseUrl(DEFAULT_API_BASE_URL);\n this.setPreviousContextSize(DEFAULT_PREVIOUS_CONTEXT_SIZE);\n this.setFollowingContextSize(DEFAULT_FOLLOWING_CONTEXT_SIZE);\n this.setMaxResults(DEFAULT_MAX_RESULTS);\n }", "public void buildModel() {\n double loss_pre = Double.MAX_VALUE;\n for (int iter = 0; iter < maxIter; iter ++) {\n Long start = System.currentTimeMillis();\n if (showProgress)\n System.out.println(\"Iteration \"+(iter+1)+\" started\");\n // Update user latent vectors\n IntStream.range(0,userCount).parallel().peek(i->update_user(i)).forEach(j->{});\n /*\n for (int u = 0; u < userCount; u ++) {\n update_user(u);\n }\n */\n if (showProgress) {\n System.out.println(\"Users updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n IntStream.range(0,itemCount).parallel().peek(i->update_item(i)).forEach(j->{});\n // Update item latent vectors\n /*\n for (int i = 0; i < itemCount; i ++) {\n update_item(i);\n }\n */\n if (showProgress) {\n System.out.println(\"Items updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n // Show loss\n if (showLoss)\n loss_pre = showLoss(iter, start, loss_pre);\n\n\n } // end for iter\n\n }", "public Model() {\n operation = new DecimalOperation();\n base = 10;\n newnum = true;\n memory = new Stack<>();\n }", "public static void buildTrainData() throws IOException {\n\t\tString negativePath = \"./corpus/20ng-train-all-terms.txt\";\n\t\tString positivePath = \"./corpus/r8-train-all-terms.txt\";\n\t\tString fileout = \"./corpus/trainData\";\n\t\tFileReader fr1 = new FileReader(negativePath);\n\t\tFileReader fr2 = new FileReader(positivePath);\n\t\tFileWriter fw = new FileWriter(fileout);\n\t\tBufferedReader br1 = new BufferedReader(fr1);\n\t\tBufferedReader br2 = new BufferedReader(fr2);\n\t\tBufferedWriter bw = new BufferedWriter(fw);\n\t\tHashtable<String, Integer> map = new Hashtable<String, Integer>();\n\t\tString readoneline;\n\t\twhile (((readoneline = br1.readLine()) != null)) {\n\t\t\tint pos = readoneline.indexOf(\"\\t\");\n\t\t\tString topic = readoneline.substring(0, pos);\n\t\t\tString content = readoneline.substring(pos + 1);\n\n\t\t\tif (!map.containsKey(topic)) {\n\t\t\t\tmap.put(topic, new Integer(1));\n\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbw.write(\"-1\\t\" + result.toString());\n\t\t\t\tbw.newLine();\n\t\t\t} else {\n\t\t\t\tInteger num = map.get(topic);\n\t\t\t\tif (num < 50) {\n\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbw.write(\"-1\\t\" + result.toString());\n\t\t\t\t\tbw.newLine();\n\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twhile (((readoneline = br2.readLine()) != null)) {\n\t\t\tint pos = readoneline.indexOf(\"\\t\");\n\t\t\tString topic = readoneline.substring(0, pos);\n\t\t\tString content = readoneline.substring(pos + 1);\n\t\t\tif (topic.equals(\"acq\") || topic.equals(\"earn\")\n\t\t\t\t\t|| topic.equals(\"money-fx\") || topic.equals(\"trade\")\n\t\t\t\t\t|| topic.equals(\"interest\")) {\n\t\t\t\tif (!map.containsKey(topic)) {\n\t\t\t\t\tmap.put(topic, new Integer(1));\n\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\tbw.newLine();\n\t\t\t\t} else {\n\t\t\t\t\tInteger num = map.get(topic);\n\t\t\t\t\tif (topic.equals(\"acq\") && num < 300) {\n\t\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t\t} else if (topic.equals(\"earn\") && num < 450) {\n\t\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t\t} else if (topic.equals(\"money-fx\") && num < 100) {\n\t\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t\t} else if (topic.equals(\"trade\") && num < 100) {\n\t\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t\t} else if (topic.equals(\"interest\") && num < 50) {\n\t\t\t\t\t\tStringBuffer result = new StringBuffer();\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(content, \" \");\n\t\t\t\t\t\twhile (st.hasMoreTokens()) {\n\t\t\t\t\t\t\tString tmp = st.nextToken();\n\t\t\t\t\t\t\tif (tmp.length() >= 3) {\n\t\t\t\t\t\t\t\tresult.append(tmp + \" \");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbw.write(\"1\\t\" + result.toString());\n\t\t\t\t\t\tbw.newLine();\n\t\t\t\t\t\tmap.put(topic, num + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbw.flush();\n\t\tbr1.close();\n\t\tbw.close();\n\t\tfw.close();\n\n\t}", "public void saveTrainingDataToFileDownSampling() throws Exception {\r\n //set tokenizer - we can specify n-grams for classification\r\n NGramTokenizer tokenizer = new NGramTokenizer();\r\n tokenizer.setNGramMinSize(1);\r\n tokenizer.setNGramMaxSize(1);\r\n tokenizer.setDelimiters(\"\\\\W\");\r\n\r\n //set stemmer - set english stemmer\r\n SnowballStemmer stemmer = new SnowballStemmer();\r\n stemmer.setStemmer(\"english\");\r\n\r\n //set lemmatizer\r\n StanfordCoreNLPLemmatizer scnlpl = new StanfordCoreNLPLemmatizer();\r\n\r\n //create new filter for vector transformation\r\n StringToWordVector filter = new StringToWordVector();\r\n filter.setLowerCaseTokens(true);\r\n filter.setOutputWordCounts(true);\r\n filter.setTFTransform(true);\r\n filter.setIDFTransform(true);\r\n filter.setStopwords(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\StopWordsR2.txt\")); // stop word removal given in research paper\r\n filter.setTokenizer(tokenizer);\r\n filter.setStemmer(scnlpl);\r\n System.out.println(\"Stemmer Name- \" + filter.getStemmer());\r\n\r\n InstanceQuery query = new InstanceQuery();\r\n query.setUsername(\"root\");\r\n query.setPassword(\"\");\r\n\r\n int numberOfPapers = 5;\r\n\r\n Instances[] otherArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'other'\");\r\n otherArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='other'\");\r\n otherArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='other'\");\r\n otherArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'other'\");\r\n otherArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'other'\");\r\n otherArticles[4] = query.retrieveInstances();\r\n\r\n Instances[] crimeArticles = new Instances[numberOfPapers];\r\n query.setQuery(\"SELECT content, label FROM article_ceylon_today_2013 where `label` = 'crime'\");\r\n crimeArticles[0] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2012 where `label` ='crime'\");\r\n crimeArticles[1] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_daily_mirror_2013 where `label` ='crime'\");\r\n crimeArticles[2] = query.retrieveInstances();\r\n\r\n //SELECT content, label FROM article_the_island_2012 where `label` IS NOT NULL\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2012 where `label` = 'crime'\");\r\n crimeArticles[3] = query.retrieveInstances();\r\n\r\n query.setQuery(\"SELECT content, label FROM article_the_island_2013 where `label` = 'crime'\");\r\n crimeArticles[4] = query.retrieveInstances();\r\n\r\n FastVector attributeList = new FastVector(2);\r\n Attribute a1 = new Attribute(\"text\", (FastVector) null);\r\n FastVector classVal = new FastVector();\r\n classVal.addElement(\"crime\");\r\n classVal.addElement(\"other\");\r\n Attribute c = new Attribute(\"@@class@@\", classVal);\r\n //add class attribute and news text\r\n attributeList.addElement(a1);\r\n attributeList.addElement(c);\r\n Instances trainingData = new Instances(\"TrainingNews\", attributeList, 0);\r\n trainingData.setClassIndex(1);\r\n\r\n int crimeArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < crimeArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, crimeArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, crimeArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n crimeArticlesCount++;\r\n }\r\n }\r\n System.out.println(\"Total Number of Crime Instances: \" + crimeArticlesCount);\r\n\r\n int otherArticlesCount = 0;\r\n for (int i = 0; i < numberOfPapers; i++) {\r\n for (int j = 0; j < otherArticles[i].numInstances(); j++) {\r\n Instance inst = new Instance(trainingData.numAttributes());\r\n inst.setValue(a1, otherArticles[i].instance(j).stringValue(0));\r\n inst.setValue(c, otherArticles[i].instance(j).stringValue(1));\r\n inst.setDataset(trainingData);\r\n\r\n\r\n System.out.println(inst);\r\n trainingData.add(inst);\r\n otherArticlesCount++;\r\n\r\n if (otherArticlesCount == crimeArticlesCount) {\r\n break;\r\n }\r\n }\r\n if (otherArticlesCount == crimeArticlesCount) {\r\n break;\r\n }\r\n }\r\n System.out.println(\"Total Number of Other Instances: \" + otherArticlesCount);\r\n System.out.println(\"Total num of instances= \" + trainingData.numInstances());\r\n\r\n // apply the StringToWordVector filter\r\n filter.setInputFormat(trainingData);\r\n Instances dataFiltered = Filter.useFilter(trainingData, filter);\r\n System.out.println(\"Number of Attributes after stop words removal- \" + dataFiltered.numAttributes());\r\n System.out.println(\"\\n\\nFiltered data:\\n\\n\" + dataFiltered);\r\n\r\n Random r = new Random();\r\n dataFiltered.randomize(r);\r\n\r\n ArffSaver saver = new ArffSaver();\r\n saver.setInstances(dataFiltered);\r\n saver.setFile(new File(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataDSRandom.arff\"));\r\n saver.writeBatch();\r\n }", "@Override\n public LiteModelWrapper loadInitializeModel() throws IOException {\n return new LiteModelWrapper(this.loadMappedFile(\"softmax_initialize_ones.tflite\"));\n }", "private String generateModel() {\n\t\tString model = \"\";\n\t\tint caseNumber = randomGenerator.nextInt(6) + 1;\n\t\t\n\t\tswitch (caseNumber) {\n\t\tcase 1: \n\t\t\tmodel = \"compact\";\n\t\t\tbreak;\n\t\tcase 2: \n\t\t\tmodel = \"intermediate\";\n\t\t\tbreak;\n\t\tcase 3: \n\t\t\tmodel = \"fullSized\";\n\t\t\tbreak;\n\t\tcase 4: \n\t\t\tmodel = \"van\";\n\t\t\tbreak;\n\t\tcase 5: \n\t\t\tmodel = \"suv\";\n\t\t\tbreak;\n\t\tcase 6: \n\t\t\tmodel = \"pickup\";\n\t\t\tbreak;\n\t\tdefault: \n\t\t\tmodel = \"\";\n\t\t\tbreak;\n\t\t}\n\t\treturn model;\n\t}" ]
[ "0.5855542", "0.5712062", "0.56370986", "0.5559653", "0.5484044", "0.54182476", "0.5329372", "0.5292922", "0.52360827", "0.5179502", "0.51340216", "0.51220614", "0.5084875", "0.5084733", "0.5061007", "0.5048025", "0.5020509", "0.5015905", "0.5015385", "0.5006912", "0.50012946", "0.4996893", "0.49887866", "0.498064", "0.49676624", "0.49648446", "0.49530327", "0.4944711", "0.49371076", "0.48937634", "0.48763937", "0.48722324", "0.48369822", "0.48305532", "0.48232713", "0.48205104", "0.4818006", "0.48147583", "0.48023248", "0.47908473", "0.4787468", "0.47712743", "0.4767905", "0.4763146", "0.47604266", "0.4756556", "0.47444254", "0.47433016", "0.4738888", "0.47312388", "0.4725675", "0.4706114", "0.47026718", "0.46978396", "0.46944618", "0.46914464", "0.4691228", "0.46910062", "0.46848047", "0.46768245", "0.4676481", "0.46529472", "0.46424505", "0.46410432", "0.46310404", "0.46285892", "0.46239007", "0.4621394", "0.4620584", "0.45937115", "0.45904368", "0.45859265", "0.4583813", "0.4579271", "0.4566349", "0.45648995", "0.4559742", "0.4559605", "0.45533332", "0.4548506", "0.4546709", "0.4540889", "0.45407856", "0.4533982", "0.4528627", "0.45259643", "0.45253417", "0.45128003", "0.4512764", "0.45119423", "0.45110053", "0.4508626", "0.45081398", "0.4502581", "0.45024177", "0.45015666", "0.4494221", "0.449235", "0.44884494", "0.4480195", "0.44777566" ]
0.0
-1
Initialise the matrix with random normally distributed values
public void initMatrixRandom(DoubleMatrix m){ for(int i = 0; i < m.rows; i++) for(int j = 0; j < m.columns; j++) m.put(i, j, randomValue()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initMatrix() {\n\t\ttry {\n\t\t\tRandom random = new Random();\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\t// generate alive cells, with CHANCE_OF_ALIVE chance\n\t\t\t\t\tboolean value = (random.nextInt(100) < CHANCE_OF_ALIVE);\n\t\t\t\t\t_matrix.setCellValue(row, column, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t}\n\t}", "public void random_initialize_ss()\r\n\t{\r\n//\t\tMersenneTwister mt = new MersenneTwister(10); //set seed\r\n\t\tRandom rand = new Random(); \r\n\t\tint k, n;\r\n\t\tfor (k = 0; k < num_topics; k++)\r\n\t {\r\n\t for (n = 0; n < num_terms; n++)\r\n\t {\r\n\t class_word[k][n] += 1.0/num_terms + rand.nextDouble();\r\n\t class_total[k] += class_word[k][n];\r\n\t }\r\n\t }\r\n\t}", "private static DenseMatrix generateRandomMatrix (int rows, int cols, int m_seed){\n\n Random random_value = new Random(m_seed);\n DenseMatrix randomMX = new DenseMatrix(rows, cols);\n for (int i=0; i<rows; i++){\n for (int j=0; j<cols;j++){\n randomMX.set(i,j, random_value.nextDouble());\n }\n }\n return randomMX;\n }", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "private void setWeightsUniformly(RandomDataImpl rnd, double eInit) {\n\t\tfor (int i = 0; i < weights.length; i++) {\t\t\n\t\t\tweights[i] = rnd.nextUniform(-eInit, eInit);\n\t\t}\n\t}", "public static Matrix random(int m, int n) {\n Matrix A = new Matrix(m,n);\n double[][] X = A.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n X[i][j] = Math.random();\n }\n }\n return A;\n }", "public void random_init()\r\n\t{\r\n\t\tRandom random_generator = new Random();\r\n\t\t\r\n\t\tfor(int i=0;i<chromosome_size;i++)\r\n\t\t{\r\n\t\t\tchromosome[i] = random_generator.nextInt(num_colors)+1;\r\n\t\t}\r\n\t}", "public void genRand(int n) {\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tfor(int j = 0; j < n; j++) {\n\t\t\t\tm[i][j] = rand.nextInt(10);\n\t\t\t}\n\t\t}\n\t}", "private void populateRandom(double[][] matrix, double min, double max) {\n\t\tdouble range = max - min;\n\t\tfor (int i = 0; i < matrix.length; i++) {\n\t\t\tfor (int j = 0; j < matrix[0].length; j++) {\n\t\t\t\tmatrix[i][j] = (range * Math.random()) + min;\n\t\t\t}\n\t\t}\n\t}", "Matrix(int rows, int columns) {\n try {\n if (rows < 1 || columns < 1) {\n throw zeroSize;\n }\n this.rows = rows;\n this.columns = columns;\n matrix = new int[rows][columns];\n\n for (int rw = 0; rw < rows; rw++) {\n for (int col = 0; col < columns; col++) {\n matrix[rw][col] = (int) Math.floor(Math.random() * 100);\n }\n }\n }\n catch (Throwable zeroSize) {\n zeroSize.printStackTrace();\n }\n\n }", "public LogNormalDistribution(){\n\t\tthis(0, 1);\n\t}", "public abstract void initiateRandomCells(double probabilityForEachCell);", "public GridSimRandom() {\n // empty\n }", "public NormalGen (RandomStream s) {\n this (s, 0.0, 1.0);\n }", "public void randomInit() {\n Plain plain = new Plain(width + 2);\n grid = new Living[width + 2][width + 2];\n for (int i = 1; i < grid.length - 1; i++) {\n for (int j = 1; j < grid[i].length - 1; j++) {\n int randomNum = (int) (Math.random() * 5);\n switch (randomNum) {\n case 0:\n grid[i][j] = new Badger(plain, i, j, 0);\n break;\n case 1:\n grid[i][j] = new Empty(plain, i, j);\n break;\n case 2:\n grid[i][j] = new Fox(plain, i, j, 0);\n break;\n case 3:\n grid[i][j] = new Grass(plain, i, j);\n break;\n case 4:\n grid[i][j] = new Rabbit(plain, i, j, 0);\n break;\n }\n }\n }\n }", "static private double[][] initMatrix(double[][] c) {\n final int N = c.length;\n final double value = 1 / Math.sqrt(2.0);\n\n for (int i = 1; i < N; i++) {\n for (int j = 1; j < N; j++) {\n c[i][j] = 1;\n }\n }\n\n for (int i = 0; i < N; i++) {\n c[i][0] = value;\n c[0][i] = value;\n }\n c[0][0] = 0.5;\n return c;\n }", "public static Matrix random(int M, int N) {\n Matrix A = new Matrix(M, N);\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n A.data[i][j] = Math.random();\n return A;\n }", "public static Matrix random(int M, int N) {\n Matrix A = new Matrix(M, N);\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n A.data[i][j] = Math.random();\n return A;\n }", "public MarkovZero() {\n\t\tmyRandom = new Random();\n\t}", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "protected void initializeUniformWeight() {\n\n if(CrashProperties.fitnessFunctions.length == 2){\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = 1 - (a);\n }\n }else {\n for (int n = 0; n < populationSize; n++) {\n double a = 1.0 * n / (populationSize - 1);\n lambda[n][0] = a;\n lambda[n][1] = (1 - (a))/2;\n lambda[n][2] = (1 - (a))/2;\n }\n }\n\n }", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "@Override\n\n //-----------------\n\n public void init() {\n //test(); // <---------------- Uncomment to TEST!\n\n // %-distribution of RED, BLUE and NONE\n double[] dist = {0.49, 0.49, 0.02};\n\n // Number of locations (places) in world (square)\n int nLocations = 950;\n\n Actor[] distArray = distribution(nLocations, dist); //Generates array with correct distribution.\n distArray = shuffle(distArray); //Shuffles array\n world = toMatrix(distArray, nLocations, world); //Generates the start world.\n // Should be last\n fixScreenSize(nLocations);\n }", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "public Matrix(int nrOfRows, int nrOfCols, Random rand, BigInteger q) {\n this(nrOfRows, nrOfCols);\n for (int col = 0; col < nrOfCols; col++) {\n for (int row = 0; row < nrOfRows; row++) {\n inner[row][col] = rand.nextRandom(q);\n }\n }\n }", "private void assuerNN_random() {\n //Check, if the variable is null..\n if (this.random == null) {\n //..and now create it.\n this.random = new Random(10);\n }\n }", "public static void getInitialStates(int rows, int cols, int [][] states){\n // Create a 2d array for initial state of cells\n states = new int[rows][cols];\n Random rand = new Random();\n int random = rand.nextInt();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (random%100 <= 100*NUM_CELLS/(rows*cols)){\n states[i][j] = 1;\n }\n else{\n states[i][j] = 0;\n }\n }\n }\n }", "public void setRandomSpawn(final Random random)\r\n {\r\n final List<Double> rows = new ArrayList<>();\r\n \r\n final double column;\r\n \r\n //get a random true/false result\r\n if (random.nextBoolean())\r\n {\r\n //here we will do west\r\n column = 0.5;\r\n }\r\n else\r\n {\r\n //here we will do east\r\n column = COLUMNS - 0.5;\r\n }\r\n \r\n for (double row=0; row < ROWS; row++)\r\n {\r\n //if platform exists add this as a possibility\r\n if (getObject(Type.Platform, (int)column, row) != null)\r\n rows.add(row);\r\n }\r\n \r\n super.setCol(column);\r\n \r\n final int index = random.nextInt(rows.size());\r\n super.setRow(rows.get(index) + 0.5);\r\n }", "public void initEmptyRowsRandomly(Random rng) {\n this.reset();\n for (int i = 0; i < this.numRows; i++) {\n if (this.rows[i] == null || this.rows[i].length == 0) {\n int randomColId = rng.nextInt(this.numCols);\n this.rows[i] = new int[]{randomColId};\n this.getColumn(randomColId).add(i);\n }\n }\n }", "public static void initTwoD(int[][] array) {\n System.out.println(\"Entering random numbers in matrix of \" + array.length + \" rows and \" + array[0].length + \" columns: \");\n for (int row = 0; row < array.length; row++) {\n for (int column = 0; column < array[0].length; column++) {\n array[row][column] = (int) (Math.random() * 100);\n }\n }\n\n }", "public void setRandomValues(float avg, float distr) {\n\t\tfor(int i = 0; i < size; i++)\n\t\t\tvector[i] = avg+MathUtils.randomTriangular()*distr;\n\t}", "private static Integer[][] createRandomStart(Integer dimension) {\n Integer[][] startmatrix = new Integer[dimension][dimension];\n for (int i = 0; i < dimension; i++) {\n for (int j = 0; j < dimension; j++) {\n startmatrix[i][j] = (int)(Math.random() * 2);\n }\n }\n return startmatrix;\n }", "public NormalGen (RandomStream s, double mu, double sigma) {\n super (s, new NormalDist(mu, sigma));\n setParams (mu, sigma);\n }", "public void randomize(final Matrix m) {\n\t\tfinal double[][] d = m.getData();\n\t\tfor (int r = 0; r < m.getRows(); r++) {\n\t\t\tfor (int c = 0; c < m.getCols(); c++) {\n\t\t\t\td[r][c] = randomize(d[r][c]);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void initialize() {\n\t\tRandom randomGenerator = new Random();\r\n\t\tthis.size = Helper.getRandomInRange(1, 9, randomGenerator);\r\n\t\tif (this.size % 2 == 0)\r\n\t\t\tthis.size--;\r\n\t}", "public void initialiseNewRandomPopulation(Random rnd) {\n\t\tthis.population = new ArrayList<Individual>();\n\t\tfor (int i = 0; i < this.popSize; i++) {\t\t\t\t\t//FOR ALL DESIRED POPULATION SIZE\n\t\t\tdouble[] randomValues = new double[DIMENSIONS];\t\t\t//INITIATE RANDOM X ARRAY WITH CORRECT DIMENSIONS\n\t\t\tfor (int j = 0; j < DIMENSIONS; j++) {\t\t\t\t\t//CREATE RANDOM X VALUES\n\t\t\t\trandomValues[j] = -5 + rnd.nextDouble() * 10;\t\t//ASSIGN VALUES TO EACH POSITION IN ARRAY\n\t\t\t}\n\t\t\tIndividual newInd = new Individual(randomValues);\t\t//CREATE NEW INDIVIDUAL WITH RANDOM X VALUES\n\t\t\tthis.population.add(newInd);\t\t\t\t\t\t\t//ADD INDIVIDUAL TO POPULATION\n\t\t}\n\t}", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "public NormalGen (RandomStream s, NormalDist dist) {\n super (s, dist);\n if (dist != null)\n setParams (dist.getMu(), dist.getSigma());\n }", "public static double random() {\r\n return uniform();\r\n }", "private double[][] random(double time) {\r\n this.time += time;\r\n double totalN = MatrixUtils.sum(occ), k = Math.pow(L, 2);\r\n double pt = totalN / k;\r\n pvec.set(0, pt);\r\n ppvec.set(0, pt);\r\n // publishProgress(occ);\r\n // main loop 7.4. SPATIAL MODEL WITH\r\n // LONG-DISTANCE DISPERSAL: MATHEMATICAL METHOD97\r\n\r\n for (int i = 0; i < time; i++) {\r\n// birth: let a given site in occ be 1 if it\r\n// already was 1, or if the site gets colonized (each site gets\r\n// colonized independently with probability pcol)\r\n Vector x = VectorFactory.createRandomVector((int) (lambda.value * totalN), L);\r\n Vector y = VectorFactory.createRandomVector((int) (lambda.value * totalN), L);\r\n for (int j = 0; j < lambda.value * totalN - 1; j++)\r\n occ.set((int) x.get(j), (int) y.get(j), 1);\r\n occ = MatrixFactory.createSquareUnifMatrix(L, p0.value);\r\n// death: proportion\r\n// mu of the sites die, i.e. a given site in\r\n// occ will then be 1 if it\r\n// was already 1 and it doesn't die\r\n occ.transform(new ProbDeathFunction(mu.value));\r\n// # compute new total pop size, for\r\n// plotting # and for the next iteration\r\n totalN = MatrixUtils.sum(occ);\r\n// record measured population density\r\n\r\n\r\n }\r\n\r\n android.util.Log.i(\"Matrix\", \" \" + test.value);\r\n return occ.toArray();\r\n }", "Matrix(){\n matrixVar = new double[1][1];\n rows = 1;\n columns = 1;\n }", "public GoLRandomInitializer() {\n Random randomLifeOrDeath = new Random();\n \n // Give life to random cells in the board\n for (int row = 0; row < this.NUM_ROWS; row++)\n for (int column = 0; column < this.NUM_COLUMNS; column++)\n this.gameBoard[row][column] = new \n GoLCell(randomLifeOrDeath.nextBoolean());\n }", "public static void randomInit(int r) { }", "public double[][] monteCarloEigenValues(){\n if(!this.monteCarloDone)this.monteCarlo();\n return this.randomEigenValues;\n }", "public void initWeights(){\r\n Random rand = new Random();\r\n double e = Math.sqrt(6.0/(wordSize*windowSize+hiddenSize));\r\n \r\n W = SimpleMatrix.random(hiddenSize, windowSize*wordSize, -e, e, rand);\r\n b1 = new SimpleMatrix(hiddenSize, 1);\r\n b1.zero();\r\n \r\n //U = SimpleMatrix.random(hiddenSize, 1, -0.1, 0.1, rand);\r\n U = new SimpleMatrix(hiddenSize, 1);\r\n U.zero();\r\n b2 = 0.0;\r\n \r\n C = C/(W.getNumElements()+U.getNumElements());\r\n \t}", "public void init() {\n float xoff = 0;\n for (int i = 0; i < cols; i++) {\n float yoff = 0;\n for (int j = 0; j < rows; j++) {\n // Use perlin noise to get an angle between 0 and 2 PI\n float theta = map(noise(xoff,yoff),0,1,0,TWO_PI);\n // Polar to cartesian coordinate transformation to get x and y components of the vector\n field[i][j] = new PVector(cos(theta),sin(theta));\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n }", "public double[] newstater (){\r\n double[] styles = new double[Config.numberOfSeeds];\r\n for(int iii=0; iii < Config.numberOfSeeds; iii++)\r\n {\r\n Random randomr = new Random();\r\n styles[iii] = 0 + (5 - 0) * randomr.nextDouble();\r\n// RandGenerator.randDouble(0, 5);\r\n }\r\n return styles;\r\n }", "public static int[][] generateMatrix() {\n int rowsCount = RANDOM.nextInt( MAX_ROWS_COUNT ) + 1;\n int[][] result = new int[rowsCount][];\n for (int i = 0; i < rowsCount; i++) {\n result[i] = new int[RANDOM.nextInt( MAX_COLUMNS_COUNT ) + 1];\n fillArray( result[i] );\n }\n return result;\n }", "private RandomData() {\n initFields();\n }", "RandomArrayGenerator() {\n this.defaultLaenge = 16;\n }", "static void initValues()\n\t // Initializes the values array with random integers from 0 to 99.\n\t {\n\t Random rand = new Random();\n\t for (int index = 0; index < SIZE; index++)\n\t values[index] = Math.abs(rand.nextInt(100001));\n\t for (int i = 0; i < RANDSAMP; i++)\n\t \tvalues2[i] = values[Math.abs(rand.nextInt(SIZE+1))]; \n\t }", "public Matrix() {\n matrix = new double[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "void init() {\r\n \tfor (int i=0; i<SIZE; i++) {\r\n \t\tfor (int j=0; j<LEN; j++) {\r\n \t\t\tif (rnd.nextDouble() < 0.5)\r\n \t\t\t\toldpop[i][j] = 0;\r\n \t\t\telse\r\n \t\t\t\toldpop[i][j] = 1;\r\n \t\t}\r\n \t}\r\n \tfor (int j=0; j<LEN; j++) {\r\n \t\tcbest[j] = oldpop[0][j];\r\n \t}\r\n\t\tbest = fitness(0);\r\n }", "private void setRand(){\n rand = generator.nextInt(9) + 1;\n }", "public Gaussian() {\r\n this(1, 0, 1);\r\n }", "public static SimpleMatrix randomNormal( SimpleMatrix covariance, Random random ) {\n\n SimpleMatrix found = new SimpleMatrix(covariance.numRows(), 1, covariance.getType());\n\n switch (found.getType()) {\n case DDRM: {\n CovarianceRandomDraw_DDRM draw = new CovarianceRandomDraw_DDRM(random, (DMatrixRMaj)covariance.getMatrix());\n\n draw.next((DMatrixRMaj)found.getMatrix());\n }\n break;\n\n case FDRM: {\n CovarianceRandomDraw_FDRM draw = new CovarianceRandomDraw_FDRM(random, (FMatrixRMaj)covariance.getMatrix());\n\n draw.next((FMatrixRMaj)found.getMatrix());\n }\n break;\n\n default:\n throw new IllegalArgumentException(\"Matrix type is currently not supported\");\n }\n\n return found;\n }", "public LogNormalDistribution(double m, double s){\n\t\tsetParameters(m, s);\n\t}", "public static void generateMatrix() {\r\n Random random = new Random();\r\n for (int i = 0; i < dim; i++)\r\n {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n if (i != j)\r\n \r\n adjacencyMatrix[i][j] = I; \r\n }\r\n }\r\n for (int i = 0; i < dim * dim * fill; i++)\r\n {\r\n adjacencyMatrix[random.nextInt(dim)][random.nextInt(dim)] =\r\n random.nextInt(maxDistance + 1);\r\n }\r\n \r\n\r\n\r\n \r\n //print(adjacencyMatrix);\r\n \r\n \r\n //This makes the main matrix d[][] ready\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n d[i][j] = adjacencyMatrix[i][j];\r\n if (i == j)\r\n {\r\n d[i][j] = 0;\r\n }\r\n }\r\n }\r\n }", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public void init( int pointDimension, long randomSeed );", "public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}", "public Random() {\n real = new UniversalGenerator();\n twister = new MersenneTwister();\n }", "public RandomizedSet() {\n data=new ArrayList<>();\n valueIndex=new HashMap<>();\n random=new Random();\n }", "private void random() {\n\n\t}", "public void initialize() {\n\t\tinitialize(seedValue0, seedValue1);\n\t}", "public GridSimRandom(long seed, double lessFactorIO, double moreFactorIO,\n double lessFactorExec, double moreFactorExec)\n {\n random_.setSeed(seed);\n lessFactorIO_ = lessFactorIO;\n moreFactorIO_ = moreFactorIO;\n lessFactorExec_ = lessFactorExec;\n moreFactorExec_ = moreFactorExec;\n }", "public void initialize() {\n\t\t// set seed, if defined\n\t\tif (randomSeed > Integer.MIN_VALUE) {\n\t\t\tapp.randomSeed(randomSeed);\n\t\t}\n\n\t\tfor (int x = 0; x < gridX; x++) {\n\t\t\tfor (int y = 0; y < gridY; y++) {\n\t\t\t\tCell c = new Cell(\n\t\t\t\t\tapp,\n\t\t\t\t\tcellSize,\n\t\t\t\t\tcolors[(int)app.random(colors.length)],\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tc.position = PVector.add(offset, new PVector(x * cellSize, y * cellSize));\n\t\t\t\tcells[x + (y * gridX)] = c;\n\t\t\t\tnewCells[x + (y * gridX)] = c;\n\t\t\t}\n\t\t}\n\t}", "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble dist = getDist(i, j);\n\t\t\t\t\tTreeMap<String, Double> temp2 = new TreeMap<>();\n\t\t\t\t\tif(distanceMatrix.containsKey(j+\"\"))\n\t\t\t\t\t\ttemp2 = distanceMatrix.get(j+\"\");\n\t\t\t\t\ttemp2.put(i+\"\", dist);\n\t\t\t\t\tdistanceMatrix.put(j+\"\", temp2);\n\t\t\t\t\ttemp1.put(j+\"\", dist);\n\t\t\t\t\tupdateMinMatrix(i+\"\",j+\"\",dist);\n\t\t\t\t}\n\t\t\t\tdistanceMatrix.put(i+\"\", temp1);\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Position sampleRandomGaussianPosition();", "private void generateRealizations() {\n\t\t// lastTime + 1 rows because the first hosts the initial value\n\t\trealizations = new double[lastTime + 1][numberOfSimulations];\n\t\tgenerateUpsAndDowns();// will be called only once\n\t\t// a first for loop the fill the first row\n\t\tfor (int simulationIndex = 0; simulationIndex < numberOfSimulations; simulationIndex++) {\n\t\t\trealizations[0][simulationIndex] = initialValue;\n\t\t}\n\t\t// double for loop for the realizations. We start from time 1\n\t\tfor (int timeIndex = 1; timeIndex <= lastTime; timeIndex++) {\n\t\t\tfor (int simulationIndex = 0; simulationIndex < numberOfSimulations; simulationIndex++) {\n\t\t\t\trealizations[timeIndex][simulationIndex] = realizations[timeIndex - 1][simulationIndex]\n\t\t\t\t\t\t* upsAndDowns[timeIndex - 1][simulationIndex];\n\t\t\t\t// S(i+1)=S(i)M(I)\n\t\t\t}\n\t\t}\n\t}", "public Matrix(int m, int n, double s) {\n this.m = m;\n this.n = n;\n data = new double[m][n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n data[i][j] = s;\n }\n }\n }", "@Override\n public void initialize() {\n numPlayers = game().numPlayers();\n haveSeen = new ArrayList<>();\n goldProb = new double[3];\n Probability = new double[numPlayers];\n oldBoard = game().board().copy();\n //sets all of the players to miners at first\n //the lower the value the higher the player is predicted as Saboteur\n for (int i = 0; i < numPlayers; i++) {\n Probability[i] = 0.5;\n haveSeen.add(new int[3]);\n }\n for(int i=0; i<3; i++) {\n //top is 0, middle is 1, bottom is 2\n goldProb[i]=0.1;\n }\n if(role() == Role.SABOTEUR) Probability[index()]=0;\n else if(role() == Role.GOLD_MINER) Probability[index()]=1;\n }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "private DataSet normalDataSet(){\n //create normal distribution with mean .05 and sd .05/3 so that 99.7% of events are < .1\n NormalDistribution normalDistribution = new NormalDistribution(TARGET_MEAN, TARGET_MEAN/3D);\n DataSet dataSet = new DataSet();\n Task[] tasks = new Task[NUM_DISTINCT_TASKS];\n //generate costs from sampling from normal distribution\n for(int i=0; i < NUM_DISTINCT_TASKS; i++){\n UUID uuid = UUID.randomUUID();\n Long cost = (long) Math.max(1, normalDistribution.sample()); //make sure no 0 cost events\n tasks[i] = new Task(cost, uuid);\n }\n //generate task multiplities from sampling from uniform distribution\n for(int i=0; i < NUM_TASKS; i++){\n dataSet.getTasks().add(tasks[random.nextInt(NUM_DISTINCT_TASKS)]);\n }\n return dataSet;\n }", "private void makeInitial(){\r\n for (int row = 0; row < 9; row++)\r\n System.arraycopy(solution[row], 0, initial[row], 0, 9);\r\n List<Position> fields = new ArrayList<Position>();\r\n for (int row = 0; row < 9; row++)\r\n for (int col = 0; col < 9; col++)\r\n fields.add(new Position(row, col));\r\n Collections.shuffle(fields);\r\n for (int index = 0; index < 40; index ++)\r\n initial[fields.get(index).row][fields.get(index).col] = 0;\r\n }", "public void generateMatrix() {\n\n flow = new int[MATRIX_TAM][MATRIX_TAM];\n loc = new int[MATRIX_TAM][MATRIX_TAM];\n\n for (int i = 0; i < MATRIX_TAM; i++) {\n for (int j = 0; j < MATRIX_TAM; j++) {\n\n //fill the distances matrix\n if (i != j) {\n loc[i][j] = rn.nextInt(MAX_DISTANCE - MIN_DISTANCE + 1) + MIN_DISTANCE;\n } else {\n loc[i][j] = 0;\n }\n\n //fill the flow matrix\n if (i != j) {\n flow[i][j] = rn.nextInt(MAX_FLOW - MIN_FLOW + 1) + MIN_FLOW;\n } else {\n flow[i][j] = 0;\n }\n\n }\n }\n\n }", "public GridSimRandom(long seed) {\n random_.setSeed(seed);\n }", "public List<Float> randomLikelihood() {\n\t\tList<Float> likelihood = new ArrayList<Float>();\n\t\tlikelihood.add((float) getRandomInteger(-200, 0));\n\t\treturn(likelihood);\n\t}", "public static void main (String[] args) {\n double[][] matrix = new double[25][25];\n for (int i = 0; i < matrix.length; i++) { //Vertical matrix (y-akse)\n for (int j = 0; j < matrix[i].length; j++) { //Horizontal matrix (x-akse)\n // Math.random gives at random number between 0 and 1\n // (int)(Math.random() * ((upperbound - lowerbound) + 1) + lowerbound); \n // Generate a random numbers between 50 and 100 \n matrix[i][j] = (int)(Math.random() * ((100 - 50) + 1) + 50);\n }\n } \n min(matrix);\n \n }", "public double[] monteCarloStandardDeviations(){\n if(!this.monteCarloDone)this.monteCarlo();\n return this.randomEigenValuesSDs;\n }", "public void randomize() {\n\t\tx = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t\ty = ThreadLocalRandom.current().nextInt(0, 499 + 1);\n\t}", "public double[] monteCarloMeans(){\n if(!this.monteCarloDone)this.monteCarlo();\n return this.randomEigenValuesMeans;\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public static SimpleMatrix random_DDRM( int numRows, int numCols, double minValue, double maxValue, Random rand ) {\n SimpleMatrix ret = new SimpleMatrix(numRows, numCols);\n RandomMatrices_DDRM.fillUniform((DMatrixRMaj)ret.mat, minValue, maxValue, rand);\n return ret;\n }", "public static int[][] generateMatrix(int rows, int columns) {\n\tint[][] result = new int[rows][columns];\n\tfor (int i = 0; i < rows; i++) {\n\tfor (int j = 0; j < columns; j++) {\n\tresult[i][j] = (int) (Math.random() * 100) + 1;\n\t}\n\t}\n\treturn result;\n\t}", "private void loadSimulatedNormalData() throws Exception {\n setLowestMeasuredPercentile(1.0);\n\n setSampleCount(sentinelA, 1000);\n setSampleCount(sentinelB, 1000);\n setSampleCount(sentinelC, 1000);\n setSampleCount(sentinelD, 1000);\n setSampleCount(sentinelE, 1000);\n\n when(mbeanServer.getAttribute(sentinelA, \"50thPercentile\")).thenReturn(1.0);\n when(mbeanServer.getAttribute(sentinelB, \"75thPercentile\")).thenReturn(1.0);\n when(mbeanServer.getAttribute(sentinelC, \"75thPercentile\")).thenReturn(1.0);\n when(mbeanServer.getAttribute(sentinelD, \"75thPercentile\")).thenReturn(1.0);\n when(mbeanServer.getAttribute(sentinelE, \"75thPercentile\")).thenReturn(1.0);\n\n when(mbeanServer.isRegistered(sentinelA)).thenReturn(Boolean.TRUE);\n when(mbeanServer.isRegistered(sentinelB)).thenReturn(Boolean.TRUE);\n when(mbeanServer.isRegistered(sentinelC)).thenReturn(Boolean.TRUE);\n when(mbeanServer.isRegistered(sentinelD)).thenReturn(Boolean.TRUE);\n when(mbeanServer.isRegistered(sentinelE)).thenReturn(Boolean.TRUE);\n\n System.out.println(\"Start manual evaluation ...\");\n qosHandler.evaluateQoSActions();\n }", "private void fillRandomEmptyCell(int value, PredatorPreyCell cell, Grid<Integer> grid) {\n\t\tRandom r = new Random();\n\t\tPredatorPreyCell randCell = getEmptyCells(grid).get(r.nextInt(getEmptyCells(grid).size()));\n\t\tswap(cell, randCell);\n\t}", "public void agregarVidaLogica(){\n int numvida = tam * tam;\n numvida*=0.05;\n System.out.println(numvida);\n for(int i=0;i<numvida;i++){\n int x= (int)(Math.random()*tam);\n int y= (int)(Math.random()*tam);\n if(matriz[y][x]!=2 && matriz[y][x]!=1){\n matriz[y][x]=4;\n }\n }\n }", "public void initializeGrid() {\n for (int i = minRow; i <= maxRow; i++) {\n for (int j = minCol; j <= maxCol; j++) {\n grid[i][j] = 0;\n }\n }\n }", "public static JCudaMatrix randomMatrix(int rows, int cols, Random rand, double lowerBound, double upperBound) {\n JCudaMatrix matrix = new JCudaMatrix(rows, cols);\n matrix.randomize(rand, lowerBound, upperBound);\n return matrix;\n }", "public RandomizedCollection() {\n map=new HashMap();\n li=new ArrayList();\n rand=new Random();\n }", "public void initiateRandomCells(double probabilityForEachCell){\n for(int y = 0; y < getHeight(); y++){\n for(int x = 0; x < getWidth(); x++){\n if(rand.nextDouble() < probabilityForEachCell)\n turnToLiving(x, y);\n }\n }\n }", "public static void test() {\n // create M-by-N matrix that doesn't have full rank\n int M = 8, N = 5;\n Matrix B = Matrix.random(5, 3);\n Matrix A = Matrix.random(M, N).times(B).times(B.transpose());\n System.out.print(\"A = \");\n A.print(9, 6);\n\n // compute the singular vallue decomposition\n System.out.println(\"A = U S V^T\");\n System.out.println();\n SingularValueDecomposition s = A.svd();\n System.out.print(\"U = \");\n Matrix U = s.getU();\n U.print(9, 6);\n System.out.print(\"Sigma = \");\n Matrix S = s.getS();\n S.print(9, 6);\n System.out.print(\"V = \");\n Matrix V = s.getV();\n V.print(9, 6);\n System.out.println(\"rank = \" + s.rank());\n System.out.println(\"condition number = \" + s.cond());\n System.out.println(\"2-norm = \" + s.norm2());\n\n // print out singular values\n System.out.print(\"singular values = \");\n Matrix svalues = new Matrix(s.getSingularValues(), 1);\n svalues.print(9, 6);\n\n\t\t Matrix C = U.times(S).times(V.transpose());\n\t\t C.print(9, 6);\n\n\t\t Matrix D = A.transpose();\n\t\t D.print(9, 6);\n\n\t\t Matrix E = D.times(A);\n\t\t E.print(9, 6);\n }", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "private void inicializarConexoesDaPrimeiraCamada() {\n conexoesPrimeiraCamada = new double[numeroNeuroniosPrimeiraCamada][numeroNeuroniosEntrada];\n for (int i = 0; i < conexoesPrimeiraCamada.length; i++) {\n for (int j = 0; j < conexoesPrimeiraCamada[i].length; j++) {\n conexoesPrimeiraCamada[i][j] = Math.random();\n //conexoesPrimeiraCamada[i][j] = 1.0;\n }\n }\n }", "public RNGRandomImpl() {\n\t\tsetRand(new Random());\n\t}", "public Enigma(){ \r\n randNumber = new Random(); \r\n }" ]
[ "0.69478065", "0.6702655", "0.6323627", "0.62835807", "0.6145962", "0.595755", "0.59169406", "0.59039193", "0.5894495", "0.5857536", "0.5856368", "0.58536357", "0.58220917", "0.5786677", "0.57715946", "0.57686436", "0.5742967", "0.5742967", "0.57124436", "0.56972885", "0.5689743", "0.5682882", "0.56755704", "0.5664771", "0.56488866", "0.5645161", "0.5639789", "0.5608665", "0.5588831", "0.5585402", "0.5585267", "0.55745625", "0.557311", "0.55499786", "0.5535587", "0.55340177", "0.55189687", "0.55109924", "0.5492754", "0.546906", "0.5468027", "0.5466595", "0.54557407", "0.545034", "0.5437552", "0.5434257", "0.5418212", "0.54170364", "0.541042", "0.54027873", "0.53838295", "0.5383381", "0.53819203", "0.5368744", "0.53661984", "0.5364758", "0.53445625", "0.53256094", "0.53045076", "0.52815104", "0.52733517", "0.52712", "0.5261221", "0.5260477", "0.52576613", "0.52519006", "0.5246562", "0.5244609", "0.52398545", "0.5229971", "0.52286917", "0.5222399", "0.5220471", "0.5204469", "0.52020764", "0.5193244", "0.5192763", "0.51927376", "0.51845443", "0.5182905", "0.517959", "0.51761836", "0.5172959", "0.5167762", "0.5147812", "0.5144913", "0.51215124", "0.51116586", "0.5108443", "0.51056814", "0.5102109", "0.50958604", "0.50920093", "0.5080976", "0.50741595", "0.5071699", "0.5070868", "0.50687706", "0.5066059", "0.5062122" ]
0.6716472
1
A helper function for generating a normally distributed random value
public double randomValue(){ return _randomValue() + _randomValue() + _randomValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "public float gaussianRandom() {\n\t\treturn (CCMath.constrain((float)nextGaussian() / 4,-1 ,1 ) + 1) / 2;\n\t}", "public static double random() {\r\n return uniform();\r\n }", "public static double uniform() {\r\n return random.nextDouble();\r\n }", "public static long normalRandom(long mean) {\n\t\t// create random object \n Random ran = new Random(); \n // generating integer \n double nxt = ran.nextGaussian(); \n long wage = mean + (long)(mean * nxt);\n if(wage < 0 ) wage = 0;\n return wage;\n\t}", "public static double uniform() {\n return random.nextDouble();\n }", "public static double nextGaussian() {\n return randGen.nextGaussian();\n }", "private double getRandomNumber(){\n double rand = Math.random();//produce a number between 0 and 1\n rand = rand - 0.5;\n return rand;\n }", "static double getNormalDistribution(double x) {\n return (1 / Math.sqrt(2 * Math.PI)) * Math.exp(-1 * x * x / 2.0);\n }", "public static double random()\n {\n final int MAX_INT = 2147483647;\n int n = MAX_INT;\n \n // Just to ensure it does not return 1.0\n while(n == MAX_INT)\n \tn = abs (RAND.nextInt());\n \n return n * (1.0 / MAX_INT);\n }", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "public static double rand() {\n return (new Random()).nextDouble();\n }", "public static double randomNum(Random g)\n\t{\n\t\treturn -5+g.nextDouble()*10;\n\t}", "public static double sample_value(double lambda) {\n return -Math.log(Util.random()) / lambda;\n }", "public double sample_value() {\n checkHasParams();\n return -Math.log(Util.random()) / this.lambda;\n }", "public static double gaussian() {\n // use the polar form of the Box-Muller transform\n double r, x, y;\n do {\n x = uniform( -1.0, 1.0 );\n y = uniform( -1.0, 1.0 );\n r = x*x + y*y;\n } while ( r >= 1 || r == 0 );\n \n return x * Math.sqrt(-2 * Math.log(r) / r);\n\n // Remark: y * Math.sqrt(-2 * Math.log(r) / r)\n // is an independent random gaussian\n }", "public static double random(double input){\n\t\treturn Math.random()*input;\n\t}", "public double getRandom(){\n\t\treturn random.nextDouble();\n\t}", "public double doubleRandomNegativeNumbers() {\n\t\tdouble result = 0.0;\n\t\tresult = rnd.nextDouble() * (-10);\n\t\treturn result;\n\t}", "static double expon(double mean) {\n return -mean * Math.log(Math.random());\n }", "public static double fastRandomDouble(){\n\t\treturn rdm.nextDouble();\n\t\t//return rdm.nextDoubleFast();\n\t\t//return ((double)(fastRandomInt()) - ((double)Integer.MIN_VALUE)) / (-(Integer.MIN_VALUE * 2.0));\n\t}", "public static double nextGaussian(final RandomEventSource source) {\r\n double v1, v2, s;\r\n do {\r\n // Generates two independent random variables U1, U2\r\n v1 = 2 * source.nextDouble() - 1;\r\n v2 = 2 * source.nextDouble() - 1;\r\n s = v1 * v1 + v2 * v2;\r\n } while (s >= 1 || s == 0);\r\n final double norm = Math.sqrt(-2 * Math.log(s) / s);\r\n final double result = v1 * norm;\r\n // On 1,000,000 calls, this would usually yield about -5 minimum value,\r\n // and +5 maximum value. So we pretend the range is [-5.5,5.5] and normalize\r\n // it to [0,1], clamping if needed.\r\n final double normalized = (result + 5.5) / 11.0;\r\n return (normalized < 0) ? 0 : (normalized > BEFORE_ONE ? BEFORE_ONE\r\n : normalized);\r\n }", "public Double generateRandomDouble() {\n\t\tRandom rand = new Random(Double.doubleToLongBits(Math.random()));\n\t\treturn rand.nextDouble();\n\t}", "public static double randomPositiveDouble() {\n return randomDouble(1, Double.MAX_VALUE);\n }", "public double getRandom() {\n return 20*Math.random() - 10;\n }", "public static double random()\n {\n return _prng2.nextDouble();\n }", "public static int randomNext() { return 0; }", "@Override\r\n public Double getValue() {\r\n return Math.random()*Integer.MAX_VALUE;\r\n \r\n }", "public static double rangedRandom(double a){\n\t\treturn -a + Calc.random(a * 2);\n\t}", "public static float getRandomFloatNormal(float mean, float stdDev)\n\t{\n\t\treturn (float) ThreadLocalRandom.current().nextGaussian() * stdDev + mean;\n\t}", "public static int uniform(int N) {\r\n return random.nextInt(N);\r\n }", "public float nextLog ()\n {\n // Generate a non-zero uniformly-distributed random value.\n float u;\n while ((u = GENERATOR.nextFloat ()) == 0)\n {\n // try again if 0\n }\n\n return (float) (-m_fMean * Math.log (u));\n }", "private static double randomGenerator(double min, double max) {\n return (double)java.lang.Math.random() * (max - min +1) + min;\n }", "public double simulate(){\n\t\tdouble r = Math.sqrt(-2 * Math.log(Math.random()));\n\t\tdouble theta = 2 * Math.PI * Math.random();\n\t\treturn Math.exp(location + scale * r * Math.cos(theta));\n\t}", "public NormalGen (RandomStream s) {\n this (s, 0.0, 1.0);\n }", "public static double generateDensity() {\n double lower = config.getDensityLowerBound();\n double upper = config.getDensityUpperBound();\n\n Random random = new Random();\n return lower + (upper - lower) * random.nextDouble();\n }", "protected Random get_rand_value()\n {\n return rand;\n }", "public static int uniform( int N ) {\n return random.nextInt( N + 1 );\n }", "private double generateRandomValue(int min, int max) {\n\t\tdouble number = (Math.random() * max * 100) / 100 + min;\n\t\treturn number;\n\t}", "public static double randomDouble() {\n return randomDouble(-Double.MAX_VALUE, Double.MAX_VALUE);\n }", "public static double randn(double miu, double sigma, double min, double max) {\n\t\tdouble x, y, dScope;\n\t\tdo {\n\t\t\tx = rand(min, max);\n\t\t\ty = normal(x, miu, sigma);\n\t\t\tdScope = rand(0.0, normal(miu, miu, sigma));\n\t\t} while (dScope > y);\n\t\treturn x;\n\t}", "public List<Float> randomLikelihood() {\n\t\tList<Float> likelihood = new ArrayList<Float>();\n\t\tlikelihood.add((float) getRandomInteger(-200, 0));\n\t\treturn(likelihood);\n\t}", "public LogNormalDistribution(){\n\t\tthis(0, 1);\n\t}", "private double randomLandau(double mu, double sigma, Random aRandom) {\n\t \n if (sigma <= 0) return 0;\n \n double res = mu + landau_quantile(aRandom.nextDouble(), sigma);\n return res;\n }", "private float genX(float x) {\r\n return (_rand.nextFloat() * 40) - 20;\r\n }", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "public double getRandomX() {\r\n\t\treturn x1;\r\n\t}", "private int randomNum() {\r\n\t return((int)(Math.random() * 100));\r\n\t }", "public static double exponential( double lambda ) {\n return -Math.log( 1 - Math.random() ) / lambda;\n }", "public final void rand() {\n\t\tpush(randomNumberGenerator.nextDouble());\n\t}", "public static RuntimeValue bernoulli(RuntimeValue p) throws RuntimeException {\n if (isDiscreteFloatSample(p) && hasSingleValue(p.getDiscreteFloatSample())) {\n return new RuntimeValue(\n RuntimeValue.Type.DISTRIBUTION,\n new BernoulliDistribution(p.getDiscreteFloatSample().single())\n );\n }\n\n throw new RuntimeException(\"Unable to create Bernoulli distribution\");\n }", "public static double doubleSample() {\n return random_.nextDouble();\n }", "public Double randomDouble() {\n\n final Random random = new Random();\n return random.nextInt(100) / 100.0;\n }", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public double nextDouble(){\r\n\t\tlong rand = nextLong();\r\n\t\treturn (double)(rand & 0x000fffffffffffffL)/((double)0x000fffffffffffffL);\r\n\t}", "public Boolean IsNormally() {\n Random r = new Random();\n int k = r.nextInt(100);\n //5%\n if (k <= 5) {\n normally++;\n return true;\n }\n return false;\n }", "public static double randomNegativeDouble() {\n return randomDouble(-Double.MAX_VALUE, 0);\n }", "int accidentVelo()\r\n\t{\r\n\t\tdouble rand = Math.random()*100;\r\n\t\tSystem.out.println(rand);\r\n\t\tif ((double)rand <= 0.5) {\r\n\t\t\tSystem.out.println(\"Finalement vous auriez du y aller à pied. Vous vous vider de votre sang sur le bord du trottoir.\");\r\n\t\t\treturn 0.5;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public static double nextGaussian(double mu, double sigma) {\n return randGen.nextGaussian()*sigma+mu;\n }", "private int generateRandomNumber() {\n\t\treturn new SplittableRandom().nextInt(0, 3);\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static int getRandomAmount(){\n return rand.nextInt(1000);\n }", "public NormalGen (RandomStream s, double mu, double sigma) {\n super (s, new NormalDist(mu, sigma));\n setParams (mu, sigma);\n }", "float genChance();", "private static double randomDouble(final Random rnd) {\n return randomDouble(Double.MIN_EXPONENT, Double.MAX_EXPONENT, rnd);\n }", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(10, 20); \t\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public Position sampleRandomGaussianPosition();", "public float randomize() {\n return nextFloat(this.min, this.max);\n }", "public static RuntimeValue normal(RuntimeValue m, RuntimeValue sd) throws RuntimeException {\n if (isDiscreteFloatSample(m) && hasSingleValue(m.getDiscreteFloatSample()) &&\n isDiscreteFloatSample(sd) && hasSingleValue(sd.getDiscreteFloatSample())) {\n return new RuntimeValue(\n RuntimeValue.Type.DISTRIBUTION,\n new NormalDistribution(m.getDiscreteFloatSample().single(), sd.getDiscreteFloatSample().single())\n );\n }\n\n throw new RuntimeException(\"Unable to create Normal distribution\");\n }", "private double noisyRt(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getRtStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "@Override\n\t\t\tpublic double getAsDouble() {\n\t\t\t\treturn Math.random();\n\t\t\t}", "public static int generatRandomPositiveNegitiveValue(int max , int min) {\n\t int ii = -min + (int) (Math.random() * ((max - (-min)) + 1));\n\t return ii;\n\t}", "@Test\n public void testSd() {\n System.out.println(\"sd\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(Math.sqrt(7/0.3), instance.sd(), 1E-7);\n }", "public static void main(String[] args) {\n\r\n\t\tRandom rr=new Random();\r\n\t\t\r\n\t\tSystem.out.println(Math.random());//[0,1)\r\n\t\t \r\n\t\t// 第一种情况 int(强转之后最终的值一定是0)\r\n\t\t// 第二种情况 int(强转之后将小数点舍去 1-5)\r\n\t\tSystem.out.println((int)Math.random()*5);//0.99*5永远到不了5\r\n\t\tSystem.out.println((int)(Math.random()*5+1));//[1,5.)\r\n\t\t\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\tSystem.out.println(rr.rand107());\r\n\t\t\r\n\t\tfor(int i=0;i<=20;i++){\r\n\t\t\tSystem.out.print(i%7+\"-\");\r\n\t\t\t\r\n\t\t}\r\n\t\t//1-M的随机产生\r\n\t\t//(int)(Math.random()*M+1)\r\n\t\t\r\n\t\t\r\n\t\t//产生0 1的概率不同 Math.random()<p?0:1\r\n\t\tSystem.out.println(\"----\"+rr.rand01p());\r\n\t\tSystem.out.println(\"----\"+rr.rand01());\r\n\t\tfor(int i=0;i<=11;i++){\r\n\t\t\tSystem.out.print(i%6+\"-\");\r\n\t\t \t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(rr.rand106());\r\n\t}", "private Vec3 calculateRandomValues(){\n\n Random rand1 = new Random();\n float randX = (rand1.nextInt(2000) - 1000) / 2000f;\n float randZ = (rand1.nextInt(2000) - 1000) / 2000f;\n float randY = rand1.nextInt(1000) / 1000f;\n\n return new Vec3(randX, randY, randZ).normalize();\n }", "protected String random(String value) {\n \t\treturn value + new Random().nextInt(100);\n \t}", "@Test\n public void testMean() {\n System.out.println(\"mean\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(7, instance.mean(), 1E-7);\n }", "public static double nextDouble (RandomStream s, double mu, double sigma) {\n return NormalDist.inverseF (mu, sigma, s.nextDouble());\n }", "@Override\n\tpublic Double generarGenRandom(int longitud) {\n\t\treturn null;\n\t}", "@Test\n public void genRandom() {\n runAndWait(() -> genRandom(10_000, 500, 1), 32, 2000);\n runAndWait(() -> genRandom(10_000, 500, 100), 32, 2000);\n runAndWait(() -> genRandom(250_000, 4000, 50), 4, 5_000);\n }", "public static int customRandom(int range)\n {\n \tint random = (int)(Math.random()*10)%range;\n\t\n\treturn random;\n }", "private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}", "static int getRandomDelta() {\n int d = rand.nextInt(100);\n if (d < 50) {\n return -1;\n } else {\n return 1;\n }\n }", "public static int randNum() {\r\n\t\tint rand = (int)(Math.random()*((100)+1)); // Num generated between [0, 100]\r\n\t\treturn rand;\r\n\t}", "public static double getRandomRating() {\n return (double) (RandomNumberGenerator.getRandomInt(0, 10) / 2d);\n }", "public double getTimestamp() {\n switch (randomType) {\n case EXPONENT:\n return forArrive ? (-1d / LAMBDA) * Math.log(Math.random()) : (-1d / NU) * Math.log(Math.random());\n\n default:\n return 0;\n }\n }", "public static int randomNumber() {\n //Random rndNumbers = new Random();\n //for(int i = 0; i < 100; i++) {\n // int rndNumber = rndNumbers.nextInt();\n // System.out.println(rndNumber);\n int rand = (int) (Math.random() * 100);\n System.out.println(rand);\n if (rand > 50) {\n return rand;\n } else {\n System.out.println(\"-1\");\n }\n return rand;\n }", "public int eDmg(){\r\n eDmg = rand.nextInt(13);\r\n return eDmg;\r\n }", "public static Double randomDecimal(){\r\n int max = 1000;\r\n int min = 0;\r\n int range = max-min+1;\r\n \r\n int randNum = (int)(Math.random()*range) + min;\r\n \r\n double randDec = (randNum/100.0);\r\n \r\n return randDec;\r\n \r\n }", "public double pissRandom(double a, double b){\n\t\tdouble min = b, max = a;\n\t\tif (a < b){\n\t\t\tmin = a;\n\t\t\tmax = b;\n\t\t}\n\t\treturn min + pissRandom(max - min);\n\t}", "public static double standardNormDensity(double x) {\r\n\t\t// return standardNormDistribution.density(x);\r\n\t\treturn Math.exp(-x * x / 2) / Math.sqrt(2 * Math.PI);\r\n\t}", "public double[] genDiscreteDistribution(int n) {\n\t\tRandom generator = null;\n\t\tgenerator = new Random();\n\t\tdouble[] res = allocateVector(n);\n\t\tdo {\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tres[i] = generator.nextDouble();\n\t\t\t}\n\t\t} while (sum(res) == 0);\n\t\tdivideAssign(res, sum(res));\n\t\treturn res;\n\t}", "public float generarTE(){\n float ts;\n float rnd=(float)Math.random();\n \n if(rnd<=0.20){ts=1;}\n else if(rnd<=0.50){ts=2;}\n else if(rnd<=0.85){ts=3;}\n else {ts=4;}\n \n return ts;\n }", "public int getRandomPositiveInt(){\r\n long gen = (a*seed+c)%m;\r\n seed = gen;\r\n return (int)gen;\r\n }", "public double nextGaussian() {\n\n /*\n * This implementation uses the polar method to generate two gaussian\n * values at a time. One is returned, and the other is stored to be returned\n * next time.\n */\n\n if (haveStoredGaussian) {\n haveStoredGaussian = false;\n return storedGaussian;\n }\n\n double v1;\n double v2;\n double s;\n do {\n v1 = 2 * nextDouble() - 1;\n v2 = 2 * nextDouble() - 1;\n s = v1 * v1 + v2 * v2;\n } while (s >= 1 || s == 0);\n\n double m = StrictMath.sqrt(-2 * StrictMath.log(s) / s);\n storedGaussian = v2 * m;\n haveStoredGaussian = true;\n\n return v1 * m;\n }", "private double getRandomDouble(double min, double max)\r\n\t{\r\n\t\tdouble randNum = Math.random() * (max - min) + min;\r\n\t\treturn randNum;\r\n\t}", "public static Double[] mutate(Double[] genotype) {\n\t\tRandom random = new Random();\n\t\tint position = random.nextInt(variableNum);\n\t\tgenotype[position]+=((Math.random()-0.5)*mutateVal);\n\t\tif(genotype[position] > maxValue) genotype[position] = maxValue;\n\t\tif(genotype[position] < minValue) genotype[position] = minValue;\n\t\treturn genotype;\n\t}", "public RandomGenerator_Exponential(double lambda) {\r\n\t\tthis.lambda = lambda;\r\n\t}", "public int RandomNegativeNumbers() {\n\t\tint result = 0;\n\t\tresult = rnd.nextInt(10) - 10;\n\t\treturn result;\n\t}", "private void randomNormal(Vector3f v)\n // Create a unit vector. The x- and y- values can be +ve or -ve.\n // The z-value is positive, so facing towards the viewer.\n {\n float z = (float) Math.random(); // between 0-1\n float x = (float) (Math.random() * 2.0 - 1.0); // -1 to 1\n float y = (float) (Math.random() * 2.0 - 1.0); // -1 to 1\n v.set(x, y, z);\n v.normalize();\n }" ]
[ "0.76634926", "0.70782214", "0.7059548", "0.6899315", "0.6885558", "0.6835547", "0.67849094", "0.6607904", "0.64997745", "0.64927393", "0.6491856", "0.6439919", "0.6361747", "0.63323027", "0.630071", "0.62860113", "0.62454605", "0.62405527", "0.6222701", "0.62158537", "0.6208461", "0.6203303", "0.6186931", "0.61587673", "0.6149634", "0.6128453", "0.61177814", "0.61128837", "0.606927", "0.60560185", "0.6051972", "0.5989331", "0.5981605", "0.5978978", "0.5964109", "0.59601873", "0.5916239", "0.5909485", "0.5903261", "0.59022063", "0.5869233", "0.58667797", "0.5823142", "0.5822668", "0.5800833", "0.5791295", "0.5781229", "0.57652235", "0.57512337", "0.5738451", "0.57281244", "0.5726753", "0.5719084", "0.57027537", "0.5696625", "0.5692524", "0.5684974", "0.56837827", "0.5683312", "0.5670168", "0.5667024", "0.5666192", "0.5650152", "0.5648759", "0.56381667", "0.56369776", "0.56208885", "0.56199265", "0.56129396", "0.5611697", "0.5591545", "0.55812836", "0.5552344", "0.55444473", "0.5537514", "0.55369115", "0.5531116", "0.5527524", "0.5509839", "0.5501917", "0.5494613", "0.54902977", "0.5489522", "0.5483296", "0.54810125", "0.54783976", "0.54747", "0.5472256", "0.5468849", "0.5463334", "0.54628307", "0.54597056", "0.54470104", "0.54427904", "0.5436631", "0.54302263", "0.54301965", "0.54293907", "0.54277855", "0.5422068" ]
0.60353243
31
Calculates the output probabilities of all words, and returns the log probability (in base 10) of the correct word.
public double feedForward(List<Integer> context, Integer nextWord){ // TODO: implement the feedforward activation process return -10000.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void test2 (List<List<String>> sentences) {\n double totalLogProb = 0;\n double totalNumTokens = 0;\n for (List<String> sentence : sentences) {\n totalNumTokens += sentence.size();\n double sentenceLogProb = sentenceLogProb2(sentence);\n totalLogProb += sentenceLogProb;\n }\n double perplexity = Math.exp(-totalLogProb / totalNumTokens);\n System.out.println(\"Word Perplexity = \" + perplexity );\n }", "public double getProb(String word) {\n double numWords = wordMap.get(\"TOTAL_WORDS\");\n return wordMap.getOrDefault(word, 0.0)/numWords;\n }", "public double getCandProbability(String candidate){\n\t\tString[] candTerms = candidate.split(\"\\\\s+\");\n\t\t\n\t\t// Total Tokens\n\t\tdouble totTokens = (double)unigramDict.termCount();\n\t\t//P(w1) in log\n\t\tString w1 = candTerms[0];\n\t\tdouble probW1 = Math.log10((double)unigramDict.count(w1, wordToId)/totTokens);\n\t\t\n\t\t//P (w1, w2, ..., wn)\n\t\tdouble probCandidate = probW1;\n\t\t\n\t\t\n\t\tfor( int i =0; i < candTerms.length-1; i++){\n\t\t\t//Pint(w2|w1) = Pmle(w2) + (1 )Pmle(w2|w1)\n\t\t\tString currentTerm = candTerms[i];\n\t\t\tString nextTerm = candTerms[i+1];\n\t\t\tString bigram = currentTerm + \" \" + nextTerm;\n\t\t\tint freqBigram = bigramDict.count(bigram, wordToId);\n\t\t\t\n\t\t\t//this term should be in dictionary\n\t\t\tint freqFirstTerm = unigramDict.count(currentTerm, wordToId);\n\t\t\t\n\t\t\tdouble PmleW2W1 = (double)freqBigram/(double)freqFirstTerm;\n\t\t\t\n\t\t\t//System.out.println(\"candidate=[\" + candidate + \"]\\tbigram=[\" + bigram + \"]\\tterms=\" + Arrays.toString(terms));\n\t\t\tdouble PmleW2 = (double)unigramDict.count(nextTerm, wordToId) / totTokens;\n\t\t\t//double lamda= 0.1;\n\t\t\tdouble PintW2W1 = lamda*PmleW2 + (1-lamda)*PmleW2W1;\n\t\t\tprobCandidate = probCandidate + Math.log10(PintW2W1);\n\t\t}\n\t\treturn probCandidate;\n\t}", "@Override\n public double makePrediction(ParsedText text) {\n double pr = 0.0;\n\n /* FILL IN HERE */\n double productSpam = 0;\n double productNoSpam = 0;\n \n int i, tempSpam,tempNoSpam;\n int minSpam, minNoSpam ;\n \n \n for (String ng: text.ngrams) {\n \tminSpam = Integer.MAX_VALUE;\n \tminNoSpam = Integer.MAX_VALUE;\n \n\n \tfor (int h = 0;h < nbOfHashes; h++) {\n \t\ti = hash(ng,h);\n\n \t\ttempSpam = counts[1][h][i];\n \t\ttempNoSpam = counts[0][h][i];\n \t\t\n \t\t//System.out.print(tempSpam + \" \");\n\n \t\tminSpam = minSpam<tempSpam?minSpam:tempSpam; \n \t\tminNoSpam = minNoSpam<tempNoSpam?minNoSpam:tempNoSpam; \n \t\t\n \t}\n\n \t//System.out.println(minSpam + \"\\n\");\n \tproductSpam += Math.log(minSpam);\n \tproductNoSpam += Math.log(minNoSpam);\n }\n \n // size of set minus 1\n int lm1 = text.ngrams.size() - 1;\n \n //System.out.println((productNoSpam - productSpam ));\n //System.out.println((lm1*Math.log(this.classCounts[1]) - lm1*Math.log(this.classCounts[0])));\n\n //\n pr = 1 + Math.exp(productNoSpam - productSpam + lm1*(Math.log(classCounts[1]) - Math.log(classCounts[0])));\n // System.out.print(1.0/pr + \"\\n\");\n \n return 1.0 / pr;\n\n }", "private double p_w_given_l(String word, Label label) {\n\t\t// TODO : Implement\n\t\t// Calculate the probability with Laplace smoothing for word in class(label)\n\t\tif(label.equals(Label.POSITIVE)) {\n\t\t\tdouble posCount = wordCount.get(Label.POSITIVE) + 0.0;\n\t\t\tif(!posWords.containsKey(word))\n\t\t\t\treturn 1.0/(v + posCount);\n\t\t\telse\n\t\t\t\treturn (1.0 + ((double)(posWords.get(word))))/(v + posCount);\n\t\t}\n\t\telse {\n\t\t\tdouble negCount = wordCount.get(Label.NEGATIVE) + 0.0;\n\t\t\tif(!negWords.containsKey(word))\n\t\t\t\treturn 1.0/(v + negCount);\n\t\t\telse\n\t\t\t\treturn (1.0 + ((double)(negWords.get(word))))/(v + negCount);\n\t\t}\n\t}", "public void calculateProbabilities(){\n\t}", "public abstract float getProbability(String[] tokens);", "private double sentenceLogProbability(String sentence, String category) {\r\n double logProbability = Math.log(categoryPriorProbability(category));\r\n // - for debugging -\r\n //System.out.println(\"category prior probability:\" + logProbability);\r\n // - - - - -\r\n List<String> terms = termSegmentor.segmentSentence(sentence);\r\n for (String term : terms) {\r\n double probability;\r\n if (!termGivenCategoryToCount.get(category).containsKey(term)) {\r\n // new term detected on the fly\r\n // smoothen it with a naive prior probability\r\n probability = 1.0 / (words.size() + 1);\r\n } else {\r\n probability = termGivenCategoryPosteriorProbability(term, category);\r\n }\r\n // - for debugging -\r\n //System.out.println(\"probability:\" + probability);\r\n // - - - - -\r\n logProbability += Math.log(probability);\r\n }\r\n // - for debugging -\r\n //System.out.println(\"logProbability:\" + logProbability);\r\n // - - - - -\r\n return logProbability;\r\n }", "public double getWordProbability(List<String> sentence, int index) {\n\t\n\treturn (Weights[0] * Trigram.getWordProbability(sentence, index) +\n\t\tWeights[1] * Bigram.getWordProbability(sentence, index) +\n\t\tWeights[2] * Unigram.getWordProbability(sentence, index));\n }", "public double getSentenceProbability(List<String> sentence) {\n\tList<String> stoppedSentence = new ArrayList<String>(sentence);\n\tstoppedSentence.add(0, START);\n\tstoppedSentence.add(0, START);\n\tstoppedSentence.add(STOP);\n\tdouble probability = 1.0;\n\tfor (int index = 2; index < stoppedSentence.size(); index++) {\n\t probability *= getWordProbability(stoppedSentence, index);\n\t}\n\treturn probability;\n }", "@Override\n\tpublic double p_w_given_l(String word, Label label) {\n\n\t\t// Calculate the probability with Laplace smoothing for word in class(label)\n\t\tdouble ret = 0;\n\t\tm_delta = 0.00001;\n\n\t\tif (label == Label.SPORTS) {\n\t\t\t// if training data has this word\n\t\t\tif (m_map[0].get(word) != null) {\n\t\t\t\tret = (m_map[0].get(word).intValue() + m_delta) / (m_v * m_delta + sumV[0]);\n\t\t\t}\n\t\t\t// training data does not have this word\n\t\t\telse {\n\t\t\t\tret = m_delta / (m_v * m_delta + sumV[0]);\n\t\t\t}\n\t\t} else {\n\t\t\t// if training data has this word\n\t\t\tif (m_map[1].get(word) != null) {\n\t\t\t\tret = (m_map[1].get(word).intValue() + m_delta) / (m_v * m_delta + sumV[1]);\n\t\t\t}\n\t\t\t// training data does not have this word\n\t\t\telse {\n\t\t\t\tret = m_delta / (m_v * m_delta + sumV[1]);\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}", "public float calculateRLogF(Vector<String> words) {\n\t\tdouble targetExtractedCount = 0;\n\t\tfor (String word : words) {\n\t\t\tdouble count = ObjectInfoWrapper.getCount(\n\t\t\t\t\tthis.wordCountWrappers, word);\n\t\t\ttargetExtractedCount += count;\n\t\t}\n\t\tdouble score = (targetExtractedCount / this.totalWordCount)\n\t\t\t\t* Math.log(targetExtractedCount);\n\t\treturn new Float(score).floatValue();\n\t}", "public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }", "@Override\n\tpublic ClassifyResult classify(List<String> words) {\n\t\t// TODO : Implement\n\t\t// Sum up the log probabilities for each word in the input data, and the\n\t\t// probability of the label\n\t\t// Set the label to the class with larger log probability\n\t\tdouble log_POSITIVE = Math.log(p_l(Label.POSITIVE));\n\t\tfor (String word : words)\n\t\t\tlog_POSITIVE += Math.log(p_w_given_l(word, Label.POSITIVE));\n\n\t\tdouble log_NEGATIVE = Math.log(p_l(Label.NEGATIVE));\n\t\tfor (String word : words)\n\t\t\tlog_NEGATIVE += Math.log(p_w_given_l(word, Label.NEGATIVE));\n\n\t\t// Create the ClassifyResult\n\t\tClassifyResult result = new ClassifyResult();\n\t\tresult.logProbPerLabel = new HashMap<Label, Double>();\n\t\tresult.logProbPerLabel.put(Label.POSITIVE, log_POSITIVE);\n\t\tresult.logProbPerLabel.put(Label.NEGATIVE, log_NEGATIVE);\n\t\t\n\t\tif (log_POSITIVE > log_NEGATIVE)\n\t\t\tresult.label = Label.POSITIVE;\n\t\telse\n\t\t\tresult.label = Label.NEGATIVE;\n\n\t\treturn result;\n\t}", "public float computePhraseScore(int dl, int tf, GlobalStats stats);", "static double probabilityValue(String str, String findStr) {\n\t\tdouble val = count(str, findStr) / count(str, str.substring(str.length() - 1));\n\t\treturn val;\n\t}", "private static void findBigramProbTuring() {\n\t\t\t\t\n\t\tbigramProbT= new HashMap<String, Double>();\n\t\tdouble prob;\n\t\t\n\t\tfor(String s: corpusBigramCount.keySet()){\n\t\t\tint count=corpusBigramCount.get(s);\n\t\t\tif(count==0){\n\t\t\t\tprob= bucketCountT.getOrDefault(1,0.0)/corpusNumOfBigrams;\n\t\t\t}\n\t\t\telse\n\t\t\t\tprob= bigramCountTI.get(count)/corpusNumOfBigrams;\n\t\t\tbigramProbT.put(s, prob);\n\t\t}\n\t\t\t\n\t}", "private void figureOutProbability() {\n\t\tMysqlDAOFactory mysqlFactory = (MysqlDAOFactory) DAOFactory\n\t\t\t\t.getDAOFactory(DAOFactory.MYSQL);\n\n\t\tstaticPr = new StaticProbability(trialId);\n\t\tstatisticPr = new StatisticProbability(trialId);\n\t\tstaticProbability = staticPr.getProbability();\n\t\tstatisticProbability = statisticPr.getProbability();\n\n\t\tfor (Entry<Integer, BigDecimal> entry : staticProbability.entrySet()) {\n\t\t\ttotalProbability.put(\n\t\t\t\t\tentry.getKey(),\n\t\t\t\t\tentry.getValue().add(statisticProbability.get(entry.getKey())).setScale(2));\n\t\t}\n\n\t\tBigDecimal summaryProbability = BigDecimal.valueOf(0);\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tsummaryProbability = summaryProbability.add(entry.getValue());\n\t\t}\n\t\t\n\t\t// figures out probability\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tentry.setValue(entry.getValue().divide(summaryProbability, 2,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Total probability -> \" + totalProbability);\n\t\t\n\t\t// figures out and sets margin\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tBigDecimal probability = entry.getValue();\n\t\t\tBigDecimal winCoefficient = (BigDecimal.valueOf(1.).divide(\n\t\t\t\t\tprobability, 2, BigDecimal.ROUND_HALF_UP))\n\t\t\t\t\t.multiply(BigDecimal.valueOf(1.).subtract(Constants.MARGIN));\n\t\t\tentry.setValue(winCoefficient.setScale(2, BigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Winning coefficient -> \" + totalProbability);\n\t\t\n\t\t// updates info in db\n\t\tTrialHorseDAO trialHorseDAO = mysqlFactory.getTrialHorseDAO();\n\t\tTrialHorseDTO trialHorseDTO = null;\n\t\tfor(Entry<Integer, BigDecimal> entry : totalProbability.entrySet()){\n\t\t\ttrialHorseDTO = trialHorseDAO.findTrialHorseByTrialIdHorseId(trialId, entry.getKey());\n\t\t\ttrialHorseDTO.setWinCoefficient(entry.getValue());\n\t\t\ttrialHorseDAO.updateTrialHorseInfo(trialHorseDTO);\n\t\t}\t\n\t}", "@SuppressWarnings(\"deprecation\")\n\t@Override\n public double calculateLogP() {\n logP = 0.0;\n // jeffreys Prior!\n if (jeffreys) {\n logP += -Math.log(getChainValue(0));\n }\n for (int i = 1; i < chainParameter.getDimension(); i++) {\n final double mean = getChainValue(i - 1);\n final double x = getChainValue(i);\n\n if (useLogNormal) {\n\t final double sigma = 1.0 / shape; // shape = precision\n\t // convert mean to log space\n\t final double M = Math.log(mean) - (0.5 * sigma * sigma);\n\t logNormal.setMeanAndStdDev(M, sigma);\n\t logP += logNormal.logDensity(x);\n } else {\n final double scale = mean / shape;\n gamma.setBeta(scale);\n logP += gamma.logDensity(x);\n }\n }\n return logP;\n }", "public static HashMap<String, HashMap<String, Double>> logProb(HashMap<String, HashMap<String, Double>> map){\n //for each key in the given map\n for (String key : map.keySet()){\n HashMap<String,Double> innerMap = map.get(key);\n Double total = 0.0;\n //loop through the inner map, add integer values to total\n for (String key2: innerMap.keySet()){\n total += innerMap.get(key2);\n }\n //loop through the inner map, set the integer values to log probability\n for (String key2: innerMap.keySet()){\n innerMap.put(key2, Math.log(innerMap.get(key2) / total));\n }\n }\n //return new map\n return map;\n }", "@Override\n\tpublic ClassifyResult classify(String[] words) {\n\n\t\t// Sum up the log probabilities for each word in the input data, and the\n\t\t// probability of the label\n\t\t// Set the label to the class with larger log probability\n\t\tClassifyResult ret = new ClassifyResult();\n\t\tret.label = Label.SPORTS;\n\t\tret.log_prob_sports = 0;\n\t\tret.log_prob_business = 0;\n\n\t\tfor (String w : words) {\n\t\t\tret.log_prob_sports += Math.log(p_w_given_l(w, Label.SPORTS));\n\t\t\tret.log_prob_business += Math.log(p_w_given_l(w, Label.BUSINESS));\n\t\t}\n\n\t\tret.log_prob_sports += Math.log(p_l(Label.SPORTS));\n\t\tret.log_prob_business += Math.log(p_l(Label.BUSINESS));\n\n\t\tif (ret.log_prob_business > ret.log_prob_sports) {\n\t\t\tret.label = Label.BUSINESS;\n\t\t}\n\n\t\treturn ret;\n\t}", "float getSpecialProb();", "protected double wordSubClusterProbability(List<Node> cluster, String word) {\n return clusterProbability(makeWordSubCluster(cluster, word));\n }", "public void analyze(ArrayList<String> words) throws IOException\n {\n int[] letterOccurences = new int[regularAlphabet.length];\n double[] percentOccurence = new double[letterOccurences.length];\n int numberOfLetters = 0;\n \n //Loops to calculate number of occurences per letter.\n for(int wordCount = 0; wordCount<words.size(); wordCount++)\n {\n for(int letterCount = 0; letterCount<words.get(wordCount).length(); letterCount++)\n {\n for(int alphabetCharacter = 0; alphabetCharacter<regularAlphabet.length; alphabetCharacter++)\n {\n if(regularAlphabet[alphabetCharacter].equalsIgnoreCase(words.get(wordCount).substring(letterCount, letterCount+1)))\n {\n letterOccurences[alphabetCharacter]++;\n numberOfLetters++;\n }\n }\n }\n }\n \n //Loop to calculate percent occurences of letters.\n for(int index = 0; index<percentOccurence.length; index++)\n {\n percentOccurence[index] = (letterOccurences[index]/(double)numberOfLetters)*100;\n }\n \n PrintWriter outFile = new PrintWriter (new File(\"ciphertextfreq.txt\"));\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%6s | %12s | %11s|\",\"Letter\",\"Frequency\",\"Percent\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.printf(\"|%6s | %12s | %11s|\\n\",\"Letter\",\"Frequency\",\"Percent\");\n System.out.println(\"-------------------------------------------\");\n for(int printIndex = 0; printIndex<regularAlphabet.length; printIndex++)\n {\n outFile.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n System.out.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\\n\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n }\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%5s | %10d | %10d%s|\",\"Total\",numberOfLetters,100,\"%\");\n System.out.printf(\"|%5s | %10d | %10d%s|\\n\",\"Total\",numberOfLetters,100,\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.close();\n }", "void calculateLogLikelihoods(double[] fPartials, double[] fFrequencies, double[] fOutLogLikelihoods)\n\t{\n int v = 0;\n\t\tfor (int k = 0; k < m_nPatterns; k++) {\n\n double sum = 0.0;\n\t\t\tfor (int i = 0; i < m_nStates; i++) {\n\n\t\t\t\tsum += fFrequencies[i] * fPartials[v];\n\t\t\t\tv++;\n\t\t\t}\n fOutLogLikelihoods[k] = Math.log(sum) + getLogScalingFactor(k);\n\t\t}\n\t}", "public double getTerminalTransitionProb(String yWord,String xWord){\n\t\tHashMap<String,DataUnit> terminalTransitionMap=transition_map.get(yWord).terminal_transition;\n\t\treturn (terminalTransitionMap.containsKey(xWord)?terminalTransitionMap.get(xWord).prob:0.0);\n\t}", "public abstract float getProbability(String singleToken);", "void CalculateProbabilities()\n\t{\n\t int i;\n\t double maxfit;\n\t maxfit=fitness[0];\n\t for (i=1;i<FoodNumber;i++)\n\t {\n\t if (fitness[i]>maxfit)\n\t maxfit=fitness[i];\n\t }\n\n\t for (i=0;i<FoodNumber;i++)\n\t {\n\t prob[i]=(0.9*(fitness[i]/maxfit))+0.1;\n\t }\n\n\t}", "public void trainBernoulli() {\t\t\n\t\tMap<String, Cluster> trainingDataSet = readFile(trainLabelPath, trainDataPath, \"training\");\n\t\tMap<String, Cluster> testingDataSet = readFile(testLabelPath, testDataPath, \"testing\");\n\n\t\t// do testing, if the predicted class and the gold class is not equal, increment one\n\t\tdouble error = 0;\n\n\t\tdouble documentSize = 0;\n\n\t\tSystem.out.println(\"evaluate the performance\");\n\t\tfor (int testKey = 1; testKey <= 20; testKey++) {\n\t\t\tCluster testingCluster = testingDataSet.get(Integer.toString(testKey));\n\t\t\tSystem.out.println(\"Cluster: \"+testingCluster.toString());\n\n\t\t\tfor (Document document : testingCluster.getDocuments()) {\n\t\t\t\tdocumentSize += 1; \n\t\t\t\tList<Double> classprobability = new ArrayList<Double>();\n\t\t\t\tMap<String, Integer> testDocumentWordCounts = document.getWordCount();\n\n\t\t\t\tfor (int classindex = 1; classindex <= 20; classindex++) {\n\t\t\t\t\t// used for calculating the probability\n\t\t\t\t\tCluster trainCluster = trainingDataSet.get(Integer.toString(classindex));\n\t\t\t\t\t// System.out.println(classindex + \" \" + trainCluster.mClassId);\n\t\t\t\t\tMap<String, Double> bernoulliProbability = trainCluster.bernoulliProbabilities;\n\t\t\t\t\tdouble probability = Math.log(trainCluster.getDocumentSize()/trainDocSize);\n\t\t\t\t\tfor(int index = 1; index <= voc.size(); index++ ){\n\n\t\t\t\t\t\t// judge whether this word is stop word \n\t\t\t\t\t\tboolean isStopwords = englishStopPosition.contains(index);\n\t\t\t\t\t\tif (isStopwords) continue;\n\n\t\t\t\t\t\tboolean contain = testDocumentWordCounts.containsKey(Integer.toString(index));\t\t\t\t\t\t\n\t\t\t\t\t\tif (contain) {\n\t\t\t\t\t\t\tprobability += Math.log(bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprobability += Math.log(1 - bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// put the probability into the map for the specific class\n\t\t\t\t\tclassprobability.add(probability);\n\t\t\t\t}\n\t\t\t\tObject obj = Collections.max(classprobability);\n\t\t\t\t// System.out.println(classprobability);\n\t\t\t\tString predicte_class1 = obj.toString();\n\t\t\t\t// System.out.println(predicte_class1);\n\t\t\t\t// System.out.println(Double.parseDouble(predicte_class1));\n\t\t\t\tint index = classprobability.indexOf(Double.parseDouble(predicte_class1));\n\t\t\t\t// System.out.println(index);\n\t\t\t\tString predicte_class = Integer.toString(index + 1);\n\n\n\t\t\t\tconfusion_matrix[testKey - 1][index] += 1;\n\n\t\t\t\t// System.out.println(document.docId + \": G, \" + testKey + \"; P: \" + predicte_class);\n\t\t\t\tif (!predicte_class.equals(Integer.toString(testKey))) {\n\t\t\t\t\terror += 1;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize);\n\t\t}\n\n\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize + \" precision rate : \" + (1 - error/documentSize));\n\n\t\t// print confusion matrix\n\t\tprintConfusionMatrix(confusion_matrix);\n\t}", "private double p_l(Label label) {\n\t\t// TODO : Implement\n\t\t// Calculate the probability for the label. No smoothing here.\n\t\t// Just the number of label counts divided by the number of documents.\n\t\tint total = docCount.get(Label.POSITIVE)+docCount.get(Label.NEGATIVE);\n\t\t\n\t\t\n\t\tif(label.equals(Label.POSITIVE))\n\t\t\treturn ((double)(docCount.get(Label.POSITIVE)))/((double)(total));\n\t\telse\n\t\t\treturn ((double)(docCount.get(Label.NEGATIVE)))/((double)(total));\n\t}", "@Test\n public void chiSquaredTest1() {\n long[] occs = new long[26];\n occs[0] = 43;\n occs[1] = 453;\n occs[2] = 42;\n occs[3] = 4;\n occs[4] = 1;\n occs[5] = 0;\n occs[6] = 27;\n occs[7] = 29;\n occs[8] = 301;\n occs[9] = 107;\n occs[10] = 79;\n occs[11] = 201;\n occs[12] = 3;\n occs[13] = 5;\n occs[14] = 82;\n occs[15] = 36;\n occs[16] = 47;\n occs[17] = 90;\n occs[18] = 68;\n occs[19] = 45;\n occs[20] = 9;\n occs[21] = 23;\n occs[22] = 42;\n occs[23] = 421;\n occs[24] = 26;\n occs[25] = 2;\n int textLen = 2186;\n assertEquals(64388.4292706625, this.ic.chiSquared(occs,\n this.freq.getExpectedLetterFrequencies(), textLen), 0.01);\n\n }", "public Map<String, WordImageRelevaces> calculateImageWordRelevance(\r\n\t\t\tMap<String, WordImage> wordImageRel) {\r\n\r\n\t\tPrintWriter tempOut;\r\n\t\tMap<String, WordImageRelevaces> wordImgRelevance = new HashMap<String, WordImageRelevaces>();\r\n\t\ttry {\r\n\r\n\t\t\ttempOut = new PrintWriter(word_prop_output);\r\n\r\n\t\t\tdouble IuWTotal1 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal2 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal3 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal4 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal5 = 0; // The normalization factor\r\n\t\t\tdouble IuWTotal6 = 0; // The normalization factor\r\n\r\n\t\t\tint index = 0;\r\n\r\n\t\t\tdouble IuWSingle1[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle2[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle3[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle4[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle5[] = new double[wordImageRel.size()];\r\n\t\t\tdouble IuWSingle6[] = new double[wordImageRel.size()];\r\n\r\n\t\t\ttempOut.println(\"Word , total Occur , #NotSimImgs, #SimImgs , WordOccur , #Unique Users \"\r\n\t\t\t\t\t+ \", Pw1, Pw2,Pw3 , Pw4 , Pw5,Pw6 , C, R, Rw, Lw\");\r\n\r\n\t\t\tfor (String word : wordImageRel.keySet()) { // For each word\r\n\r\n\t\t\t\tWordImage wordImage = wordImageRel.get(word);\r\n\t\t\t\tdouble PcjW = wordImage.getImageProbability();\r\n\r\n\t\t\t\tdouble Pw1 = wordImage.getPwOnlyWords();\r\n\t\t\t\tdouble Pw2 = wordImage.getPwAllUsers();\r\n\t\t\t\tdouble Pw3 = wordImage.getPwOnlyUniqueUsers();\r\n\t\t\t\tdouble Pw4 = wordImage.getPwTFIDFlOnlyWords();\r\n\t\t\t\tdouble Pw5 = wordImage.getPwTFIDFlAllUsers();\r\n\t\t\t\tdouble Pw6 = wordImage.getPwTFIDFOnlyUniqueUsers();\r\n\r\n\t\t\t\tint C = totalNumberOfImages;\r\n\t\t\t\tint R = totalNumberOfSimilarImages;\r\n\t\t\t\tint Rw = wordImageRel.get(word).getSimlarImages().size();\r\n\t\t\t\tint Lw = wordImageRel.get(word).getOcurrances();\r\n\r\n\t\t\t\ttempOut.println(word\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getTotalOcurences()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordNotSimilarImages.get(word)\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getSimilarImageIDs().size()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word).getOcurrances()\r\n\t\t\t\t\t\t+ \",\"\r\n\t\t\t\t\t\t+ wordImageRel.get(word)\r\n\t\t\t\t\t\t\t\t.getWordUniqueUsers(this.photoList).size()\r\n\t\t\t\t\t\t+ \",\" + +Pw1 + \",\" + Pw2 + \",\" + Pw3 + \",\" + Pw4 + \",\"\r\n\t\t\t\t\t\t+ Pw5 + \",\" + Pw6 + \",\" + C + \",\" + R + \",\" + Rw + \",\"\r\n\t\t\t\t\t\t+ Lw);\r\n\r\n\t\t\t\tSet<String> imgIDs = wordImage.getSimilarImageIDs(); // Get\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// images\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// related\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// that\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// word\r\n\r\n\t\t\t\tfor (String imgID : imgIDs) {\r\n\r\n\t\t\t\t\tdouble PIc = wordImage.getSimilarImage(imgID)\r\n\t\t\t\t\t\t\t.getPointSimilarity();\r\n\r\n\t\t\t\t\tIuWSingle1[index] += Pw1 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle2[index] += Pw2 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle3[index] += Pw3 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle4[index] += Pw4 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle5[index] += Pw5 * PcjW * PIc;\r\n\t\t\t\t\tIuWSingle6[index] += Pw6 * PcjW * PIc;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Normalise\r\n\t\t\t\tWordImageRelevaces wImgRels = new WordImageRelevaces();\r\n\t\t\t\twImgRels.setFreqRelOnlyWords(IuWSingle1[index]);\r\n\t\t\t\twImgRels.setFreqRelWordsAndAllUsers(IuWSingle2[index]);\r\n\t\t\t\twImgRels.setFreqRelWordAndOnlyUniqueUsers(IuWSingle3[index]);\r\n\t\t\t\twImgRels.setTfIdfRelOnlyWords(IuWSingle4[index]);\r\n\t\t\t\twImgRels.setTfIdfRelWordsAndAllUsers(IuWSingle5[index]);\r\n\t\t\t\twImgRels.setTfIdfRelWordAndOnlyUniqueUsers(IuWSingle6[index]);\r\n\r\n\t\t\t\twordImgRelevance.put(word, wImgRels); // unnormalized value\r\n\r\n\t\t\t\tIuWTotal1 += IuWSingle1[index];\r\n\t\t\t\tIuWTotal2 += IuWSingle2[index];\r\n\t\t\t\tIuWTotal3 += IuWSingle3[index];\r\n\t\t\t\tIuWTotal4 += IuWSingle4[index];\r\n\t\t\t\tIuWTotal5 += IuWSingle5[index];\r\n\t\t\t\tIuWTotal6 += IuWSingle6[index];\r\n\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tfor (String word : wordImgRelevance.keySet()) {\r\n\r\n\t\t\t\tdouble notNormalizedValue1 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelOnlyWords();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelOnlyWords(\r\n\t\t\t\t\t\tnotNormalizedValue1 / IuWTotal1);\r\n\r\n\t\t\t\tdouble notNormalizedValue2 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelWordsAndAllUsers();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelWordsAndAllUsers(\r\n\t\t\t\t\t\tnotNormalizedValue2 / IuWTotal2);\r\n\r\n\t\t\t\tdouble notNormalizedValue3 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getFreqRelWordAndOnlyUniqueUsers();\r\n\t\t\t\twordImgRelevance.get(word).setFreqRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\t\tnotNormalizedValue3 / IuWTotal3);\r\n\r\n\t\t\t\tdouble notNormalizedValue4 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelOnlyWords();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelOnlyWords(\r\n\t\t\t\t\t\tnotNormalizedValue4 / IuWTotal4);\r\n\r\n\t\t\t\tdouble notNormalizedValue5 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelWordsAndAllUsers();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelWordsAndAllUsers(\r\n\t\t\t\t\t\tnotNormalizedValue5 / IuWTotal5);\r\n\r\n\t\t\t\tdouble notNormalizedValue6 = wordImgRelevance.get(word)\r\n\t\t\t\t\t\t.getTfIdfRelWordAndOnlyUniqueUsers();\r\n\t\t\t\twordImgRelevance.get(word).setTfIdfRelWordAndOnlyUniqueUsers(\r\n\t\t\t\t\t\tnotNormalizedValue6 / IuWTotal6);\r\n\r\n\t\t\t\ttempOut.close();\r\n\t\t\t}\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn wordImgRelevance;\r\n\r\n\t}", "private double[] evaluateProbability(double[] data) {\n\t\tdouble[] prob = new double[m_NumClasses], v = new double[m_NumClasses];\n\n\t\t// Log-posterior before normalizing\n\t\tfor (int j = 0; j < m_NumClasses - 1; j++) {\n\t\t\tfor (int k = 0; k <= m_NumPredictors; k++) {\n\t\t\t\tv[j] += m_Par[k][j] * data[k];\n\t\t\t}\n\t\t}\n\t\tv[m_NumClasses - 1] = 0;\n\n\t\t// Do so to avoid scaling problems\n\t\tfor (int m = 0; m < m_NumClasses; m++) {\n\t\t\tdouble sum = 0;\n\t\t\tfor (int n = 0; n < m_NumClasses - 1; n++)\n\t\t\t\tsum += Math.exp(v[n] - v[m]);\n\t\t\tprob[m] = 1 / (sum + Math.exp(-v[m]));\n\t\t\tif (prob[m] == 0)\n\t\t\t\tprob[m] = 1.0e-20;\n\t\t}\n\n\t\treturn prob;\n\t}", "abstract double rightProbability();", "public static void main(String[] args) {\n\t\t\r\n\t\tScanner info = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the phrase:\");\r\n\t\tString sentence = info.nextLine();\r\n\t\t\r\n\t\tsentence = sentence.trim().toUpperCase();\r\n\t\t\r\n\t\tfor (int i = 0; i < sentence.length(); i++) {\r\n\t\t\tif (sentence.charAt(i) <'A' || sentence.charAt(i) > 'Z' ) {\r\n\t\t\t\tsentence = sentence.replace(\"\"+sentence.charAt(i), \"/\");\r\n//\t\t\t\tSystem.out.println(sentence);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString[] word = sentence.split(\"/\") ;\r\n\t\t\r\n\t\tint total = 0;\r\n\t\tif (word.length < 1) {\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\tHashMap hMap = new HashMap();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (word[0].length() > 0) {\r\n\t\t\t\thMap.put(word[0].length(), 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (int i = 1; i < word.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < i; j++) {\r\n\t\t\t\t\tif (word[i].length() == word[j].length()) {\r\n\t\t\t\t\t\tint cnt = (int) hMap.get(word[i].length());\r\n\t//\t\t\t\t\tSystem.out.println(\"cnt==>\"+cnt);\r\n\t\t\t\t\t\thMap.put(word[i].length(),++cnt);\r\n\t\t\t\t\t\t\t\r\n\t//\t\t\t\t\tSystem.out.println(word[i].length()+\"==>\"+hMap.get(word[i].length()));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (j == (i-1)){\r\n\t\t\t\t\t\t\thMap.put(word[i].length(), 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSet<Integer> keys1 = hMap.keySet();\r\n\t\r\n\t\t\tfor(int key:keys1) {\r\n\t\t\t\tif (key !=0) {\r\n\t\t\t\t\tSystem.out.println(hMap.get(key)+\" \"+key +\" letter words\");\r\n\t\t\t\t\ttotal += (int)hMap.get(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(total+\" total words\");\r\n\t\t\r\n\t}", "public static float calculatePercentOfWordsFoundInText(String text, List<String> words) {\n int totalWords = words.size();\n List<String> wordsFound = new ArrayList<>();\n for (String w : words) {\n Pattern searchPattern = Pattern.compile(\".*\\\\b\" + w.toLowerCase() + \"\\\\b.*\");\n if (searchPattern.matcher(text).matches()) {\n wordsFound.add(w);\n }\n }\n return (float) (wordsFound.size() * 100 / totalWords);\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n naiveBayesMultinomialText0.m_minWordP = (-988.56143);\n double double0 = naiveBayesMultinomialText0.getMinWordFrequency();\n assertEquals((-988.56143), double0, 0.01);\n }", "protected double wordSubClusterProbability(Cluster cluster, String word) {\n return clusterProbability(makeWordSubCluster(cluster, word));\n }", "public double getAccuracyWithLabFormat(String input)\n {\n\n resetWeight();\n\n BagOfWords bag =new BagOfWords(\" \");\n\n String tt=input;\n\n input = input.replaceAll(\"\\n\",\" \");\n\n for (String s:input.split(\" \"))\n {\n bag.add(s);\n }\n\n\n\n for(HashMap.Entry<String, Integer> entry : bag.getBagHashMap().entrySet())\n {\n String key = entry.getKey();\n\n for (TFIDF bag1: trainedClasses)\n {\n for (Word w:bag1.getWordsSets().getWordList())\n {\n if (w.getValue().equals(key))\n {\n bag1.setWeight(bag1.getWeight()+w.getFreq());\n bag1.setFileCount(bag1.getFileCount()+1);\n }\n }\n\n }\n\n }\n\n for (TFIDF bag1: trainedClasses)\n {\n bag1.setWeight(bag1.getWeight()/(bag1.getFileCount()+1));\n }\n\n int i= trainedClasses.size();\n\n for (TFIDF bag1: trainedClasses)\n {\n if (tt.split(\"\\n\")[0].contains(bag1.getName()))\n {\n i=Math.min(i, trainedClasses.indexOf(bag1));\n }\n\n }\n\n StringBuilder ret= new StringBuilder(\"(\" + i + \")\" + \"\\n\");\n\n trainedClasses.sort(new Comparator<TFIDF>() {\n @Override\n public int compare(TFIDF idf, TFIDF t1) {\n if (idf.getWeight()>t1.getWeight())\n return -1;\n else\n return 1;\n }\n });\n\n for (TFIDF bag1: trainedClasses)\n {\n ret.append(\" --> \").append(bag1.getName()).append(\": \").append(bag1.getWeight()).append(\"\\n\");\n }\n\n return (100/Math.pow(i+1,2));\n\n }", "public static void main(String[] args) {\n\t\tint[] i = new int[100];\n\t\tint unique = 0;\n\t\tfloat ratio = 0;\n\t\tList<String> inputWords = new ArrayList<String>();\n\t\tMap<String,List<String>> wordcount = new HashMap<String,List<String>>();\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"/Users/huziyi/Documents/NLP file/Assignment1/Twitter messages.txt\"));\n\t\t\tString str;\n\t\t\twhile((str = in.readLine())!=null){\n\t\t\t\tstr = str.toLowerCase();\n\t\t\t\t\n\t\t\t\tString[] words = str.split(\"\\\\s+\");\n\t\t\t\t\n\t\t\t//\tSystem.out.println(words);\n\t\t\t//\tSystem.out.println(\"1\");\n\t\t\t\tfor(String word:words){\n\t\t\t\t\t\n\t\t\t//\t\tString word = new String();\n\t\t\t\t\t\n\t\t\t\t\tword = word.replaceAll(\"[^a-zA-Z]\", \"\");\n\t\t\t\t\tinputWords.add(word);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tfor(int k=0;k<inputWords.size()-1;k++){\n\t\t\tString thisWord = inputWords.get(k);\n\t\t\tString nextWord = inputWords.get(k+1);\n\t\t\tif(!wordcount.containsKey(thisWord)){\n\t\t\t\twordcount.put(thisWord, new ArrayList<String>());\n\t\t\t}\n\t\t\twordcount.get(thisWord).add(nextWord);\n\t\t}\n\t\t for(Entry e : wordcount.entrySet()){\n\t// System.out.println(e.getKey());\n\t\tMap<String, Integer>count = new HashMap<String, Integer>();\n List<String>words = (List)e.getValue();\n for(String s : words){\n if(!count.containsKey(s)){\n count.put(s, 1);\n }\n else{\n count.put(s, count.get(s) + 1);\n }\n }\n \t\n // for(Entry e1 : wordcount.entrySet()){\n for(Entry f : count.entrySet()){\n \n // \tint m = 0;\n //\tint[] i = new int[100];\n //\ti[m] = (Integer) f.getValue();\n \tint n = (Integer) f.getValue();\n \tn = (Integer) f.getValue();\n // \tList<String> values = new ArrayList<String>();\n \t\t// values.addAll(count.g());\n \tif(n>=120){\n \tif(!(e.getKey().equals(\"\"))&&!(f.getKey().equals(\"\"))){\n //\t\t int a = (Integer) f.getValue();\n //\t\t Arrays.sort(a);\n System.out.println(e.getKey()+\" \"+f.getKey() + \" : \" + f.getValue());\n \n \t}\n \t}\n //\tm++;\n \t }\n\t\t }\n\t\t \n\t\n\t\t \n\t\t// Arrays.sort(i);\n\t\t //System.out.println(i[0]+i[1]);\n/*\n\t\t ArrayList<String> values = new ArrayList<String>();\n\t\t values.addAll(count.values());\n\n\t\t Collections.sort(values, Collections.reverseOrder());\n\n\t\t int last_i = -1;\n\n\t\t for (Integer i : values.subList(0, 99)) { \n\t\t if (last_i == i) \n\t\t continue;\n\t\t last_i = i;\n\n\n\n\n\t\t for (String s : wordcount.keySet()) { \n\n\t\t if (wordcount.get(s) == i)\n\t\t \n\t\t \tSystem.out.println(s+ \" \" + i);\n\n\t\t }\n\t\t \n\t\t\t}*/\n\t}", "private static double[] calculateYuleK(Map<String, Double> wordFrequencies) \n\t{\n\t\t// m1 = number of different words in document (review)\n\t\tdouble m1 = wordFrequencies.keySet().size();\n\n\t\tMap<Double, Double> yuleMap = Utilities.reverseMap(wordFrequencies);\n\n\t\t// m2 = sum of products of each observed frequency squared and number of \n\t\t// words with that frequency\n\t\tdouble m2 = 0.0;\n\t\tdouble[] legomenas = new double[11];\n\t\tfor(Entry<Double,Double> e : yuleMap.entrySet()){\n\t\t\tDouble freq = e.getKey();\n\t\t\tDouble wordCount = e.getValue();\n\t\t\tm2 += freq*freq*wordCount;\n\t\t\tif (freq.intValue() < legomenas.length)\n\t\t\t\tlegomenas[freq.intValue()] = wordCount;\n\t\t}\n\t\tlegomenas[0] = 10000*(m2-m1)/(m1*m1); \n\t\treturn legomenas;\n\t}", "@Test\n public void testLogP() {\n System.out.println(\"logP\");\n NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3);\n instance.rand();\n assertEquals(Math.log(0.027), instance.logp(0), 1E-7);\n assertEquals(Math.log(0.0567), instance.logp(1), 1E-7);\n assertEquals(Math.log(0.07938), instance.logp(2), 1E-7);\n assertEquals(Math.log(0.09261), instance.logp(3), 1E-7);\n assertEquals(Math.log(0.05033709), instance.logp(10), 1E-7);\n }", "public double empiricalLikelihood(int numSamples, ArrayList<ArrayList<Integer>> testing) {\n\t\tNCRPNode[] path = new NCRPNode[numLevels];\n\t\tNCRPNode node;\n\t\t\n\t\tpath[0] = rootNode;\n\n\t\tArrayList<Integer> fs;\n\t\tint sample, level, type, token, doc, seqLen;\n\n\t\tDirichlet dirichlet = new Dirichlet(numLevels, alpha);\n\t\tdouble[] levelWeights;\n\t\t//dictionary\n\t\tdouble[] multinomial = new double[numTypes];\n\n\t\tdouble[][] likelihoods = new double[ testing.size() ][ numSamples ];\n\t\t\n\t\t//for each sample\n\t\tfor (sample = 0; sample < numSamples; sample++) {\n\t\t\tArrays.fill(multinomial, 0.0);\n\n\t\t\t//select a path\n\t\t\tfor (level = 1; level < numLevels; level++) {\n\t\t\t\tpath[level] = path[level-1].selectExisting();\n\t\t\t}\n\t \n\t\t\t//sample level weights\n\t\t\tlevelWeights = dirichlet.nextDistribution();\n\t \n\t\t\t//for each words in dictionary\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\t//for each topic\n\t\t\t\tfor (level = 0; level < numLevels; level++) {\n\t\t\t\t\tnode = path[level];\n\t\t\t\t\tmultinomial[type] +=\n\t\t\t\t\t\tlevelWeights[level] * \n\t\t\t\t\t\t(eta + node.typeCounts[type]) /\n\t\t\t\t\t\t(etaSum + node.totalTokens);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//convert to log\n\t\t\tfor (type = 0; type < numTypes; type++) {\n\t\t\t\tmultinomial[type] = Math.log(multinomial[type]);\n\t\t\t}\n\n\t\t\t//calculate document likelihoods \n\t\t\tfor (doc=0; doc<testing.size(); doc++) {\n fs = testing.get(doc);\n seqLen = fs.size();\n \n for (token = 0; token < seqLen; token++) {\n type = fs.get(token);\n likelihoods[doc][sample] += multinomial[type];\n }\n }\n\t\t}\n\t\n double averageLogLikelihood = 0.0;\n double logNumSamples = Math.log(numSamples);\n for (doc=0; doc<testing.size(); doc++) {\n \t\n \t//find the max for normalization, avoid overflow of sum\n double max = Double.NEGATIVE_INFINITY;\n for (sample = 0; sample < numSamples; sample++) {\n if (likelihoods[doc][sample] > max) {\n max = likelihoods[doc][sample];\n }\n }\n\n double sum = 0.0;\n //normalize \n for (sample = 0; sample < numSamples; sample++) {\n sum += Math.exp(likelihoods[doc][sample] - max);\n }\n\n //calc average\n averageLogLikelihood += Math.log(sum) + max - logNumSamples;\n }\n\n\t\treturn averageLogLikelihood;\n }", "public double outcomeProb(char[] outcome) {\r\n\t\t// get all forward probabilities\r\n\t\tdouble[][] probs = getForwards(outcome);\r\n\t\t\r\n\t\t// initialize the probability of this outcome to 0\r\n\t\tdouble outcomeProb = 0;\r\n\t\t// loop over all nodes in the last column\r\n\t\tfor (int i = 0; i < states.length; ++i)\r\n\t\t\t// add this node's probability to the overall probability\r\n\t\t\toutcomeProb += probs[i][outcome.length - 1];\r\n\t\t\r\n\t\treturn outcomeProb;\r\n\t}", "private static int calculateScore( String word )\n\t{\n\t\tif (word.equals(\"rc\")) {\n\t\t\treturn -1;\n\t\t} else if (word.equals(\"b\")) {\n\t\t\treturn -2;\n\t\t} else if (word.equals(\"beta\")) {\n\t\t\treturn -3;\n\t\t} else if (word.equals(\"a\")) {\n\t\t\treturn -4;\n\t\t} else if (word.equals(\"alpha\")) {\n\t\t\treturn -5;\n\t\t} else if (word.equals(\"snapshot\")) {\n\t\t\treturn -10;\n\t\t} else if (word.equals(\"push0ver\")) {\n\t\t\treturn -11;\n\t\t} else if (word.equals(\"cvs\")) {\n\t\t\treturn -21;\n\t\t} else if (word.equals(\"svn\")) {\n\t\t\treturn -21;\n\t\t} else if (word.equals(\"bzr\")) {\n\t\t\treturn -21;\n\t\t} else if (word.equals(\"hg\")) {\n\t\t\treturn -21;\n\t\t} else if (word.equals(\"git\")) {\n\t\t\treturn -21;\n\t\t} else if (word.equals(\"rev\")) {\n\t\t\treturn -100;\n\t\t} else if (word.equals(\"r\")) {\n\t\t\treturn -101;\n\t\t} else if (word.equals(\"release\")) {\n\t\t\treturn 12;\n\t\t} else if (word.equals(\"update\")) {\n\t\t\treturn 11;\n\t\t} else if (word.equals(\"u\")) {\n\t\t\treturn 10;\n\t\t} else if (word.equals(\"patch\")) {\n\t\t\treturn 9;\n\t\t} else if (word.equals(\"p\")) {\n\t\t\treturn 8;\n\t\t} else if (word.equals(\"hotfix\")) {\n\t\t\treturn 7;\n\t\t} else if (word.equals(\"fix\")) {\n\t\t\treturn 6;\n\t\t}\n\t\tLong l = toLong( word );\n\t\treturn l != null ? 100 : 0; // a pure number (with no alpha) wins against all of those.\n\t}", "public static double sumLogProb (double a, double b)\n\t{\n\t\tif (a == Double.NEGATIVE_INFINITY) {\n\t\t\tif (b == Double.NEGATIVE_INFINITY)\n\t\t\t\treturn Double.NEGATIVE_INFINITY;\n return b;\n\t\t}\n\t\telse if (b == Double.NEGATIVE_INFINITY)\n\t\t\treturn a;\n\t\telse if (a > b)\n\t\t\treturn a + Math.log (1 + Math.exp(b-a));\n\t\telse\n\t\t\treturn b + Math.log (1 + Math.exp(a-b));\n\t}", "public double getObservationProbability(){\r\n double ret=0;\r\n int time=o.length;\r\n int N=hmm.stateCount;\r\n for (int t=0;t<=time;++t){\r\n for (int i=0;i<N;++i){\r\n ret+=fbManipulator.alpha[t][i]*fbManipulator.beta[t][i];\r\n }\r\n }\r\n ret/=time;\r\n return ret;\r\n }", "public void solve(Scanner in) {\n\tint K = in.nextInt();\n\tint L = in.nextInt();\n\tint S = in.nextInt();\n\t\n\tint[] letters = new int[26];\n\t\n\tin.nextLine();\n\n\tString keyboard = in.nextLine(), word = in.nextLine();\n\tchar c;\n\t\n\t\n\n\tfor (int i = 0; i < K; i++) {\n\t\tc = keyboard.charAt(i);\n\t\tletters[c - 'A']++;\n\t}\n\t\n\tdouble chanceOfWord = 1;\n\n\tfor (int i = 0; i < L; i++) {\n\t\tchanceOfWord *= (letters[word.charAt(i)-'A']+0.0)/(K+0.0);\n\t}\n\t\n \tif (chanceOfWord == 0 || chanceOfWord == 1){\n\t\tSystem.out.println (0.0);\n\t\treturn;\n\t}\n\telse if (L == S) {\n\t\tSystem.out.println (1.0-chanceOfWord);\n\t\treturn;\n\t}\t\n\n\tmax = 0;\n\tcol = 0;\n\tdouble result = full (letters,\"\",word,S);\n\tSystem.out.println ((max - (result+0.0)/(col+0.0)));\n}", "private double countWordFrequencyScore(Page page, String[] queryWords) {\n double score = 0;\n for (String word : queryWords) {\n int wordId = this.pb.getIdForWord(word);\n for (double pageWordId : page.getWords()) {\n if (wordId == pageWordId) score++;\n }\n }\n\n return score;\n }", "public static void main (String [] args)\r\n {\r\n System.out.println(\"\\nWelcome to Scrabble Word! This program finds the most valuable word based on a scrabble hand. The rules the program works off are the point values for letters provided by http://scrabble.hasbro.com/en-us/faq and the double score multiplier for consecutive double letters.\\n\");\r\n System.out.print(\"Please enter a list of letters, from 3 to 12 letters long, without spaces -> \"); \r\n String input = userInput(); \r\n if(input == null)\r\n {\r\n System.exit(0);\r\n }\r\n String [] word = findWords(input);\r\n printWords(word); \r\n //pointvalues of letters (alphabetical order)\r\n int [] table = {1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10};\r\n String best = bestWord(word,table);\r\n if(best == null || best.equals(\"\"))\r\n {\r\n System.out.println(\"No word from the IGN data source can be created with that input.\");\r\n System.exit(1);\r\n }\r\n System.out.println(\"\\n\\nHighest scoring word: \" + best + \"\\n\");\r\n }", "public int scoreOf(String word) {\n if (dictionary.contains(word)) {\n switch (word.length()) {\n case 0:\n case 1:\n case 2:\n return 0;\n case 3:\n case 4:\n return 1;\n case 5:\n return 2;\n case 6:\n return 3;\n case 7:\n return 5;\n default:\n return 11;\n }\n } else {\n return 0;\n }\n }", "public ArrayList<String> predict(String sentence){\r\n\t\t//Splits the String and creates the necessary maps\r\n\t\tString words[] = sentence.split(\" \");\r\n\t\tSystem.out.println(\"SENTENCE \" + sentence + \" LENGTH \" + words.length);\r\n\t\tTreeMap<String, Float> prevscores = new TreeMap<String, Float>();\r\n\t\tArrayList<TreeMap<String, String>> backtrack = new ArrayList<TreeMap<String, String>>(); \r\n\t\tFloat zero = new Float(0);\r\n\t\tprevscores.put(\"start\", zero);\r\n\t\t//Looping over every word in the String\r\n\t\tfor (int i = 0; i < words.length; i++){\r\n\t\t\tTreeMap<String, Float> scores = new TreeMap<String, Float>();\r\n\t\t\tSet<String> keys = prevscores.keySet();\r\n\t\t\tbacktrack.add(new TreeMap<String, String>());\r\n\t\t\t//Looping over all the previous states\r\n\t\t\tfor(String state : keys){\r\n\t\t\t\tSet<String> tagKeys = this.transMap.get(state).keySet();\r\n\t\t\t\t//Looping over all the possible states\r\n\t\t\t\tfor(String tagKey : tagKeys){\r\n\t\t\t\t\r\n\t\t\t\t\tfloat nextscore = (prevscores.get(state) + this.transMap.get(state).get(tagKey));\r\n\t\t\t\t\tif(this.emissionMap.containsKey(tagKey) && this.emissionMap.get(tagKey).containsKey(words[i])){\r\n\t\t\t\t\t\tnextscore += this.emissionMap.get(tagKey).get(words[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse nextscore += -200;\r\n\t\t\t\t\tif(!scores.containsKey(tagKey) || nextscore > scores.get(tagKey)){\r\n\t\t\t\t\t\tscores.put(tagKey, nextscore);\r\n\t\t\t\t\t\tbacktrack.get(i).put(tagKey, state);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprevscores = scores;\r\n\r\n\t\t}\r\n\t\tString finalState = \"\";\r\n\t\tSet<String> prevKeys = prevscores.keySet();\r\n\t\tfloat max = -100000;\r\n\t\tfor(String key : prevKeys){\r\n\t\t\tfloat num = prevscores.get(key);\r\n\t\t\tif(num > max) {\r\n\t\t\t\tmax = num;\r\n\t\t\t\tfinalState = key;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString[] end_states = new String[sentence.split(\" \").length];\r\n\t\tend_states[backtrack.size() - 1] = finalState;\r\n\r\n\t\tString state = finalState;\r\n\t\tfor(int i = backtrack.size() - 1; i>=1; i-- ) {\r\n\t\t\tstate = backtrack.get(i).get(state);\r\n\t\t\tend_states[i - 1] = state;\r\n\t\t}\r\n\t\t\r\n\t\tArrayList<String> sequence = new ArrayList<String>();\r\n\t\tfor(int i = 0; i < end_states.length; i++) {\r\n\t\t\tsequence.add(end_states[i]);\r\n\t\t}\r\n\t\treturn sequence;\r\n\t}", "@Test\n void adjectivesScoring() {\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day; glad @JeremyKappell is standing up against #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB (Via NEWS 8 WROC)\");\n HashMap<String, Double> as = np.adjectivesScoring(sentences);\n for (String key : as.keySet()) {\n Double value = as.get(key);\n assertTrue(value >= 0 && value <= 4);\n }\n }", "public double logProb(double[] cFactor) {\n\n double logProb = 0;\n for(int i = 0; i < cFactor.length; i++) {\n logProb += Math.log(cFactor[i]);\n }\n logProb = -logProb;\n return logProb;\n }", "float getHotwordPower();", "private void evaluateProbabilities()\n\t{\n\t}", "@Test\n public void genNeighStateProbability() {\n double[] metrics = new double[STATES.length * STATES.length];\n double sum = 0;\n Random rand = new Random();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (x == y) {\n metrics[i] = 0;\n } else {\n double d = Math.abs(rand.nextGaussian());//Math.exp(-Math.abs(STATES[x] - STATES[y]) / 3) * Math.abs(rand.nextGaussian());\n metrics[i] = d;\n sum += d;\n }\n }\n final double finalSum = sum;\n metrics = DoubleStream.of(metrics).map(d -> d / finalSum).toArray();\n for (int i = 0; i < metrics.length; i++) {\n int x = i / STATES.length;\n int y = i % STATES.length;\n if (metrics[i] > 0.01) {\n System.out.printf(\"%d:%d:%.4f\\n\", STATES[x], STATES[y], metrics[i]);\n }\n }\n }", "public p207() {\n double target = 1/12345.0;\n double log2 = Math.log(2);\n\n for (int x = 2; x < 2000000; x++){\n double a = Math.floor(Math.log(x) / log2) / (x-1);\n if (a < target){\n System.out.println(x*(x-1L));\n break;\n }\n }\n }", "@Test\n public void chiSquaredTest2() {\n long[] occs = new long[26];\n occs[0] = 195;\n occs[1] = 51;\n occs[2] = 96;\n occs[3] = 51;\n occs[4] = 305;\n occs[5] = 72;\n occs[6] = 32;\n occs[7] = 130;\n occs[8] = 194;\n occs[9] = 1;\n occs[10] = 4;\n occs[11] = 119;\n occs[12] = 64;\n occs[13] = 183;\n occs[14] = 236;\n occs[15] = 72;\n occs[16] = 8;\n occs[17] = 130;\n occs[18] = 159;\n occs[19] = 269;\n occs[20] = 62;\n occs[21] = 24;\n occs[22] = 40;\n occs[23] = 8;\n occs[24] = 48;\n occs[25] = 3;\n int textLen = 2556;\n\n assertEquals(136.9908235901, this.ic.chiSquared(occs,\n this.freq.getExpectedLetterFrequencies(), textLen), 0.01);\n }", "public static void printPermutaions(String word) {\n TreeMap<Character, Integer> map = new TreeMap<>();\n for (int i = 0; i < word.length(); i++) {\n if (map.get(word.charAt(i)) != null) {\n map.put(word.charAt(i), map.get(word.charAt(i)) + 1);\n } else {\n map.put(word.charAt(i), 1);\n }\n }\n\n int[] count = new int[map.size()];\n char[] chars = new char[map.size()];\n\n int index = 0;\n for (Map.Entry entry : map.entrySet()) {\n chars[index] = (char) entry.getKey();\n count[index] = (int) entry.getValue();\n index++;\n }\n\n char[] result = new char[word.length()];\n ArrayList<String> resultList = new ArrayList<String>();\n permuteUtil(chars, count, result, resultList, 0);\n for (String perm : resultList) {\n System.out.print(perm+\" \");\n }\n }", "public float evaluate(PhraseInfo p) {\n int numChords = p.gen.prog.get(p.gen.progIndex).size();\n int tn = Math.min(phraseLen, (int)Math.round(targetNotes * ((numChords + 1) / 3.0))); // not directly proportional.\n // scores: 50, 49, 46, 41, 34, 25 etc.\n int score = Math.max(0, 50 - (int)Math.round(Math.pow(Math.abs(p.noteCount - tn), 2)));\n return (float)Math.min(1.0f, score/50.0f);\n }", "private int getResult(HashMap<Integer, String> probSuffix, Prefix prefix, LinkedList<String> text, int count) {\n\n\t\tif (probSuffix.isEmpty()) {\n\t\t\tif (debug) {\n\t\t\t\tSystem.out.println(\"DEBUG: successors: <END OF FILE>\");\n\t\t\t}\n\t\t\tcurrPrefix = prefix.findRandomPrefix();\n\t\t\tprefixArr = currPrefix.split(\"\\\\s\");\n\t\t\ttext.clear();\n\t\t\tfor (int k = 0; k < prefixArr.length; k++) {\n\t\t\t\ttext.add(prefixArr[k]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (debug) {\n\t\t\t\tSystem.out.println(\"DEBUG: successors: \" + probSuffix.toString());\n\t\t\t}\n\t\t\tint pick = random.nextInt(probSuffix.size());\n\t\t\tresult += probSuffix.get(pick) + \" \";\n\t\t\tif (debug) {\n\t\t\t\tSystem.out.println(\"DEBUG: word generated: \" + probSuffix.get(pick));\n\t\t\t}\n\t\t\ttext.add(probSuffix.get(pick));\n\t\t\ttext.removeFirst();\n\t\t\tcurrPrefix = \"\";\n\t\t\tint k = 0;\n\t\t\tfor (String p : text) {\n\t\t\t\tif (k == text.size() - 1) {\n\t\t\t\t\tcurrPrefix += p;\n\t\t\t\t\tk++;\n\t\t\t\t} else {\n\t\t\t\t\tcurrPrefix += p + \" \";\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (debug) {\n\t\t\t\tSystem.out.println(\"prefix: \" + currPrefix);\n\t\t\t}\n\t\t\tprefixArr = currPrefix.split(\"\\\\s\");\n\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "public double getScore(String goldFile,String myOutput){\n\t\tdouble prob=0.0;\n\t\ttry {\n\t\t\tBufferedReader goldReader=new BufferedReader(new InputStreamReader(new FileInputStream(goldFile),\"ISO-8859-1\"));\n\t\t\tBufferedReader myReader=new BufferedReader(new InputStreamReader(new FileInputStream(myOutput),\"ISO-8859-1\"));\n\t\t\tString gline=null,mline=null;\n\t\t\tint totalCount=0,correctCount=0;\n\t\t\twhile((gline=goldReader.readLine())!=null&&(mline=myReader.readLine())!=null){\n\t\t\t\tString[] gwords=gline.split(\" \");\n\t\t\t\tString[] mwords=mline.split(\" \");\n\t\t\t\tassert(gwords.length==mwords.length&&gwords.length%2==0);\n\t\t\t\ttotalCount+=gwords.length/2;\n\t\t\t\t\n\t\t\t\tfor(int i=1;i<gwords.length;i+=2){\n\t\t\t\t\tcorrectCount+=(gwords[i].equals(mwords[i])?1:0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//close the buffered reader\n\t\t\tgoldReader.close();\n\t\t\tmyReader.close();\n\t\t\tprob=correctCount*1.0/totalCount;\n\t\t\t\n\t\t}catch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn prob;\n\t}", "public static double calcW2Wsentencesimilarity(String question, String answer) {\n\t \t \n\t double Lamda = 2000;\n\t double Beta = 0.2;\n\t String[] answerwords=answer.split(\"\\\\s+\");\n\t String[] questionwords=question.split(\"\\\\s+\");\n\t int CountAwords = answerwords.length;\n\t double PbUV = 0.0;\n\t \n\t for ( String questionword: questionwords)\n\t {\n\t\t//String QACorpus = GetQACorpus(\"file1\",\"file2\");\n\t\t \n\t\tString QACorpus = GetQACorpus(\"/Tarun Malhotra/codechef/answers.txt\",\"/Tarun Malhotra/codechef/questions.txt\");\n\t\t \n\t\t\n\t\tint CountQWordinCorpus=WordFrequencyInSentence(questionword,QACorpus);\n\t\tString trimmed = QACorpus.trim();\n\t\tint CorpusWordCount = trimmed.isEmpty() ? 0 : trimmed.split(\"\\\\s+\").length;\n\t\t\n\t\tdouble PbmlWbyV = WordFrequencyInSentence(questionword,answer)/answerwords.length;\n\t\t\n\t\tdouble PbmxWbyV = (1-Beta)*PbmlWbyV+Beta*CalculatedProbability\n\t\t\t\t(QACorpus,questionword,answer );\n\t\t\n\t\tdouble PbmlWbyC = CountQWordinCorpus/CorpusWordCount;\n\t\tdouble PbWbyV= (CountAwords/(CountAwords+Lamda))*PbmxWbyV +\n\t\t\t\t(Lamda/(CountAwords+Lamda))*PbmlWbyC;\n\n\t\t PbUV +=PbWbyV; \n\n\t }\n\t \n\treturn PbUV;\n\t}", "private double getScore(String source, String target) {\n return sourceTargetCounts.getCount(source, target) / (sourceWordCounts.get(source) * targetWordCounts.get(target));\n }", "public double logpdf(int[][] table) {\n int n = 0;\n int N = 0;\n // Marginals from rows\n double logP = 0;\n for (int[] table1 : table) {\n int rMarginals = table1[0] + table1[1];\n N += rMarginals;\n n += table1[0];\n logP += logFactorial.getLogFactorial(rMarginals) - logFactorial.getLogFactorial(table1[0]) - logFactorial.getLogFactorial(table1[1]);\n }\n logP+= -(logFactorial.getLogFactorial(N)-logFactorial.getLogFactorial(n)-logFactorial.getLogFactorial(N-n));\n return logP;\n }", "private double[][] tokenDistribution(double[] pi, StateList states) {\n\t\tint numstates = states.size();\n\t\tif (numstates == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tint numplaces = states.get(0).length;\n\t\tint highestnumberoftokens = 1;\n\n\t\tDecimalFormat f = new DecimalFormat();\n\t\tf.setMaximumFractionDigits(1);\n\n\t\t// The following ArrayList tallies up the probabilities.\n\t\t// Each element in the ArrayList is an array of doubles.\n\t\t// Each row in the array of doubles represents a particular number of\n\t\t// tokens on that place and the value at that row is the probability of\n\t\t// having that many tokens.\n\t\tArrayList counter = new ArrayList(numplaces);\n\n\t\tdouble[] copy; // A temporary array for storing intermediate results\n\t\tdouble[][] result;\n\n\t\t// Each place will have at least 0 or 1 tokens on it at some point so\n\t\t// initialise each ArrayList with at a double array of at least two\n\t\t// elements\n\t\tfor (int p = 0; p < numplaces; p++) {\n\t\t\tcounter.add(p, new double[] { 0, 0 });\n\t\t}\n\n\t\tSystem.out.println(\"Calculating token distribution...\");\n\t\t// Now go through each tangible state and each place in that state. For\n\t\t// each place, determine the number of tokens on it and add that states\n\t\t// steady state distribution to the appropriate tally for that place and\n\t\t// number of tokens in the ArrayList. Also keep track of the highest\n\t\t// number of tokens for any place as we will need to know it for the\n\t\t// final\n\t\t// results array.\n\t\tfor (int marking = 0; marking < numstates; marking++) {\n\t\t\tint[] current = states.get(marking);\n\t\t\tfor (int p = 0; p < numplaces; p++) {\n\t\t\t\tif (current[p] > highestnumberoftokens) {\n\t\t\t\t\thighestnumberoftokens = current[p];\n\t\t\t\t}\n\n\t\t\t\tif (current[p] > (((double[]) counter.get(p)).length - 1)) {\n\t\t\t\t\tcopy = new double[current[p] + 1];\n\t\t\t\t\tSystem.arraycopy(counter.get(p), 0, copy, 0,\n\t\t\t\t\t\t\t((double[]) counter.get(p)).length);\n\t\t\t\t\t// Zero all the remainder of the array\n\t\t\t\t\tfor (int i = ((double[]) counter.get(p)).length; i < copy.length; i++) {\n\t\t\t\t\t\tcopy[i] = 0.0;\n\t\t\t\t\t}\n\t\t\t\t\t// Start off the tally for this number of tokens on place p\n\n\t\t\t\t\tcopy[current[p]] = pi[marking];\n\t\t\t\t\t// Get rid of the old smaller array\n\t\t\t\t\tcounter.remove(p);\n\t\t\t\t\t// Put the new one in instead\n\t\t\t\t\tcounter.add(p, copy);\n\t\t\t\t} else {\n\t\t\t\t\tcopy = (double[]) counter.get(p);\n\t\t\t\t\tcopy[current[p]] += pi[marking];\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// System.out.print(f.format(((double)marking/numstates) * 100) +\n\t\t\t// \"% done. \\r\");\n\t\t}\n\t\tSystem.out.println(\"100.0% done. \");\n\n\t\t// Now put together our results array\n\t\tresult = new double[numplaces][highestnumberoftokens + 1];\n\t\tfor (int p = 0; p < numplaces; p++) {\n\t\t\tSystem.arraycopy(counter.get(p), 0, result[p], 0,\n\t\t\t\t\t((double[]) counter.get(p)).length);\n\t\t\tif (((double[]) counter.get(p)).length < highestnumberoftokens) {\n\t\t\t\tfor (int i = ((double[]) counter.get(p)).length; i < highestnumberoftokens; i++) {\n\t\t\t\t\tresult[p][i] = 0.0;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static double word(final int token, final double length) {\n return min(1, log(1 + LOG * token / length));\n }", "public static String determinePasswordStrength(String password)\r\n {\r\n double passwordlength = password.length();\r\n ArrayList<Long> possibilties= new ArrayList<Long>();\r\n double countedPossibilities = 0;\r\n double totalPossibilties = 0;\r\n ArrayList<String> counterArray = new ArrayList<String>();\r\n String longestMatchingWord = \"\";\r\n\r\n File fileToRead = new File(\"dictionary.txt\");\r\n boolean hasUpper = false;\r\n boolean hasLower = false;\r\n boolean hasNumber = false;\r\n boolean hasSpecial = false;\r\n boolean isUpper = false;\r\n boolean isLower = false;\r\n boolean isNumber = false;\r\n boolean isSpecial = false;\r\n\r\n for(int i = 0; i < password.length(); i++)\r\n {\r\n\r\n if(\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i))) && !hasLower)\r\n {\r\n hasLower = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i))) && !hasUpper)\r\n {\r\n hasUpper = true;\r\n countedPossibilities = countedPossibilities + 26;\r\n }\r\n else if(\"0123456789\".contains(Character.toString(password.charAt(i))) && !hasNumber)\r\n {\r\n hasNumber= true;\r\n countedPossibilities = countedPossibilities + 10;\r\n }\r\n else if(\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i))) && !hasSpecial)\r\n {\r\n hasSpecial = true;\r\n countedPossibilities = countedPossibilities + 33;\r\n }\r\n\r\n }\r\n double centuries = 0;\r\n double years = 0;\r\n double days = 0;\r\n double hours = 0;\r\n double minutes = 0;\r\n double seconds = 0;\r\n double tempcenturies = 0;\r\n double tempyears = 0;\r\n double tempdays = 0;\r\n double temphours = 0;\r\n double tempminutes = 0;\r\n double tempseconds2 = 0;\r\n double tempseconds = 0;\r\n double point = 0.00000037;\r\n double point1 = 3.8;\r\n\r\n// BigDecimal E = new BigDecimal(Math.E);\r\n// BigInteger fivehundread = new BigInteger(\"1000\");\r\n// BigInteger zero = new BigInteger(\"0\");\r\n //BigDecimal centuries = new BigDecimal(\"0\");\r\n\r\n ///////////////INSERT Dictionary Attack Here//////////////////////\r\n try {\r\n BufferedReader reader = new BufferedReader(new FileReader(fileToRead));\r\n String wordInFile = \"\";\r\n\r\n while ((wordInFile = reader.readLine()) != null) {\r\n //System.out.println(wordInFile);\r\n wordInFile = wordInFile.toLowerCase();\r\n if (wordInFile.length() > 3) {\r\n if (password.contains(wordInFile))\r\n {\r\n if(longestMatchingWord.length() < wordInFile.length())\r\n {\r\n longestMatchingWord = wordInFile;\r\n }\r\n }\r\n }\r\n }\r\n for (int i = 0; i < longestMatchingWord.length(); i++) {\r\n if (\"abcdefghijklmnopkrstuvwxyz\".contains(Character.toString(password.charAt(i)))) {\r\n //isLower = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n //System.out.println(passwordlength);\r\n }\r\n else if (\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".contains(Character.toString(password.charAt(i)))) {\r\n //isUpper = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(26));\r\n passwordlength--;\r\n }\r\n else if (\"0123456789\".contains(Character.toString(password.charAt(i)))) {\r\n //isNumber = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(10));\r\n passwordlength--;\r\n }\r\n else if (\" ,!”#$%&’()*+,-./:;<=>?@[\\\\]^_`{|}~\".contains(Character.toString(password.charAt(i)))) {\r\n //isSpecial = true;\r\n //countedPossibilities = countedPossibilities.add(BigDecimal.valueOf(33));\r\n passwordlength--;\r\n }\r\n\r\n }\r\n }\r\n catch (FileNotFoundException e)\r\n {\r\n\r\n }\r\n catch(IOException e)\r\n {\r\n System.out.println(\"didnt read file\");\r\n }\r\n\r\n // Algorithm is here\r\n //y =3.7*e(3.8x) rounded to 4 to fit into big decimal\r\n\r\n totalPossibilties = (Math.pow(countedPossibilities, passwordlength));\r\n tempseconds2 = point*Math.pow(Math.E, totalPossibilties*4);\r\n tempseconds = tempseconds2;\r\n\r\n if (tempseconds == 0)\r\n {\r\n\r\n }\r\n else if (tempseconds > 1)\r\n {\r\n\r\n }\r\n else\r\n {\r\n tempseconds = 0;\r\n }\r\n\r\n\r\n seconds = tempseconds % 60;\r\n tempminutes = tempseconds / 60;\r\n minutes = tempminutes % 60;\r\n temphours = tempminutes / 60;\r\n hours = temphours % 24;\r\n tempdays = temphours / 24;\r\n days = tempdays % 365;\r\n tempyears = tempdays / 365;\r\n\r\n if(tempyears > 500)\r\n {\r\n return (\"Greater than 500\" + \" years \");\r\n }\r\n //years = tempcenturies.divide(BigInteger.valueOf(100));\r\n //System.out.println(tempyears.toString() + \" years \" + days.toString() + \" days \" + hours.toString() + \" hours \" + minutes.toString() + \" minutes \" + seconds.toString() + \" seconds\");\r\n else\r\n {\r\n return (tempyears + \" years \" + days + \" days \" + hours + \" hours \" + minutes + \" minutes \" + seconds + \" seconds\");\r\n }\r\n }", "public void translate() {\n\t\tif(!init)\r\n\t\t\treturn; \r\n\t\ttermPhraseTranslation.clear();\r\n\t\t// document threshold: number of terms / / 8\r\n//\t\tdocThreshold = (int) (wordKeyList.size() / computeAvgTermNum(documentTermRelation) / 8.0);\r\n\t\t//\t\tuseDocFrequency = true;\r\n\t\tint minFrequency=1;\r\n\t\temBkgCoefficient=0.5;\r\n\t\tprobThreshold=0.001;//\r\n\t\titerationNum = 20;\r\n\t\tArrayList<Token> tokenList;\r\n\t\tToken curToken;\r\n\t\tint j,k;\r\n\t\t//p(w|C)\r\n\r\n\t\tint[] termValues = termIndexList.values;\r\n\t\tboolean[] termActive = termIndexList.allocated;\r\n\t\ttotalCollectionCount = 0;\r\n\t\tfor(k=0;k<termActive.length;k++){\r\n\t\t\tif(!termActive[k])\r\n\t\t\t\tcontinue;\r\n\t\t\ttotalCollectionCount +=termValues[k];\r\n\t\t}\r\n\t\t\r\n\t\t// for each phrase\r\n\t\tint[] phraseFreqKeys = phraseFrequencyIndex.keys;\r\n\t\tint[] phraseFreqValues = phraseFrequencyIndex.values;\r\n\t\tboolean[] states = phraseFrequencyIndex.allocated;\r\n\t\tfor (int phraseEntry = 0;phraseEntry<states.length;phraseEntry++){\r\n\t\t\tif(!states[phraseEntry]){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (phraseFreqValues[phraseEntry] < minFrequency)\r\n\t\t\t\tcontinue;\r\n\t\t\ttokenList=genSignatureTranslation(phraseFreqKeys[phraseEntry]); // i is phrase number\r\n\t\t\tfor (j = 0; j <tokenList.size(); j++) {\r\n\t\t\t\tcurToken=(Token)tokenList.get(j);\r\n\t\t\t\tif(termPhraseTranslation.containsKey(curToken.getIndex())){\r\n\t\t\t\t\tIntFloatOpenHashMap old = termPhraseTranslation.get(curToken.getIndex());\r\n\t\t\t\t\tif(old.containsKey(phraseFreqKeys[phraseEntry])){\r\n\t\t\t\t\t\tSystem.out.println(\"aha need correction\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\told.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight()); //phrase, weight\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tIntFloatOpenHashMap newPhrase = new IntFloatOpenHashMap();\r\n\t\t\t\t\tnewPhrase.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight());\r\n\t\t\t\t\ttermPhraseTranslation.put(curToken.getIndex(), newPhrase);\r\n\t\t\t\t}\r\n\t\t\t\t//\t\t\t\toutputTransMatrix.add(i,curToken.getIndex(),curToken.getWeight());\r\n\t\t\t\t//\t\t\t\toutputTransTMatrix.add(curToken.getIndex(), i, curToken.getWeight());\r\n\t\t\t\t//TODO termPhrase exists, create PhraseTerm\r\n\t\t\t}\r\n\t\t\ttokenList.clear();\r\n\t\t}\r\n\r\n\t}", "public float CalculatePPMIOfTwoWords(int w1, int w2) {\n\t\t\n\t\tfloat[][] C = this.TermContextMatrix_FREQ;\n\t\t\n\t\ttry {\n\n\t\t\t// Calculate matrix sum\n\t\t\tfloat sum = 0f;\n\t\t\tfloat sumDelta = 0f;\n\t\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\t\tfor(int j = 0; j < C[i].length; j++) {\n\t\t\t\t\tsumDelta = C[i][j];\n\t\t\t\t\tsum += sumDelta;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\tfloat intersection = C[w1][w2] / sum;\n\t\t\t\n\t\t\tfloat row = 0f;\n\t\t\tfloat rowDelta = 0f;\n\t\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\t\trowDelta = C[w1][i];\n\t\t\t\trow += rowDelta;\n\t\t\t}\n\t\t\tfloat rowProbability = row / sum;\n\t\t\t\n\t\t\tfloat col = 0f;\n\t\t\tfloat colDelta = 0f;\n\t\t\tfor(int i = 0; i < C[w1].length; i++) {\n\t\t\t\tcolDelta = C[i][w2];\n\t\t\t\tcol += colDelta;\n\t\t\t}\n\t\t\tfloat colProbability = (float) (Math.pow(col, 0.75) / Math.pow(sum, 0.75));\n\t\t\t\n\t\t\tfloat logValue = intersection / (rowProbability * colProbability);\n\t\t\tfloat maxValue = (float) (Math.log10(logValue) / Math.log10(2));\n\t\t\t\n\t\t\tfloat PPMI = (float) (Math.max(maxValue, 0));\n\t\t\t\n\t\t\treturn PPMI;\n\t\t\t\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn 0f;\n\t}", "public void checkDictionary (String[] target) {\n try {\n File f = new File(\"cmudict.0.7a\");\n BufferedReader br = new BufferedReader(new FileReader(f));\n String[][] data;\n Double result;\n for (String line; (line = br.readLine()) != null; ) {\n if (!line.matches(\"^[A-Za-z].*\")) {\n continue;\n }\n data = readDictionary(line);\n result = compareWords(target, data[1]);\n try {\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"results.txt\", true)));\n out.print(result);\n out.println(\" \" + data[0][0]); // prints the word\n out.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected float computeProbs(int n)\n\t{\n\t\tfloat Cmi = 0;\n\t\t// Compute probabilities\n\t\tfor (int k = 0; k < bins; k++)\n\t\tfor (int l = 0; l < bins; l++)\n\t\t{\n\t\t float Pkl = Puv[k*bins+l];\n\t\t if (Pkl > 0)\n\t\t\t Cmi -= Pkl / n * Math.log(n * Pkl / (Pu[k] * Pv[l]));\n\t\t}\n\t\treturn Cmi;\n\t}", "public void emissionProbabilities() {\r\n /**\r\n * Word and Tag List.\r\n */\r\n final TreeSet<String> words = new TreeSet(), tags = new TreeSet();\r\n Iterator<Kata> iterSatu = MarkovCore.LIST_KATA.iterator();\r\n while (iterSatu.hasNext()) {\r\n final Kata kata = iterSatu.next();\r\n words.add(kata.getKata());\r\n tags.add(kata.getTag());\r\n }\r\n System.out.println(\"Jumlah Kata: \" + words.size());\r\n System.out.println(\"Jumlah Tag: \" + tags.size());\r\n System.out.println();\r\n //<editor-fold defaultstate=\"collapsed\" desc=\"Emissions Calculation\">\r\n /**\r\n * Perhitungan Emisi.\r\n */\r\n Iterator<String> iterDua = words.iterator();\r\n while (iterDua.hasNext()) {\r\n final String kata = iterDua.next();\r\n Iterator<String> iterTiga = tags.iterator();\r\n while (iterTiga.hasNext()) {\r\n final StrBuilder strBuilder = new StrBuilder(10);\r\n final String tag = iterTiga.next();\r\n strBuilder.append(\"P(\");\r\n strBuilder.append(kata + \"|\");\r\n strBuilder.append(tag + \") = \");\r\n final Emissions emissions = new Emissions(kata, tag, strBuilder.toString());\r\n emissionses.add(emissions);\r\n }\r\n }\r\n\r\n final HashMap<String, Double> penyebut = new HashMap();\r\n Iterator<Kata> iterEmpat = MarkovCore.LIST_KATA.iterator();\r\n while (iterEmpat.hasNext()) {\r\n final Kata kata = iterEmpat.next();\r\n if (penyebut.get(kata.getTag()) == null) {\r\n penyebut.put(kata.getTag(), 1.0);\r\n } else {\r\n penyebut.put(kata.getTag(), penyebut.get(kata.getTag()) + 1);\r\n }\r\n }\r\n\r\n Iterator<Emissions> iterTiga = emissionses.iterator();\r\n while (iterTiga.hasNext()) {\r\n final Emissions emissions = iterTiga.next();\r\n double pembilang = 0.0;\r\n Iterator<Kata> iterKata = MarkovCore.LIST_KATA.iterator();\r\n while (iterKata.hasNext()) {\r\n Kata kata = iterKata.next();\r\n if (StringUtils.equalsIgnoreCase(kata.getKata(), emissions.word) && StringUtils.equalsIgnoreCase(kata.getTag(), emissions.tag)) {\r\n pembilang++;\r\n }\r\n }\r\n\r\n /**\r\n * WARNING - Laplace Smoothing is Activated.\r\n */\r\n// emissions.setEmissionsProbability(pembilang + 1, penyebut.get(emissions.tag) + this.uniqueWords.size(), (pembilang + 1) / (penyebut.get(emissions.tag) + this.uniqueWords.size()));\r\n emissions.setEmissionsProbability(pembilang, penyebut.get(emissions.tag), pembilang / penyebut.get(emissions.tag));\r\n }\r\n//</editor-fold>\r\n\r\n// System.out.println(emissionses.size());\r\n Iterator<Emissions> emissionsIterator = emissionses.iterator();\r\n while (emissionsIterator.hasNext()) {\r\n final Emissions emissions = emissionsIterator.next();\r\n this.emissionsMap.put(new MultiKey(emissions.word, emissions.tag), emissions.emissionsProbability);\r\n// System.out.println(emissions);\r\n }\r\n// System.out.println(this.emissionsMap.size());\r\n }", "private IDictionary<String, Double> computeTfScores(IList<String> words) {\n IDictionary<String, Double> tfScores = new ChainedHashDictionary<String, Double>();\n IDictionary<String, Double> wordCounts = new ChainedHashDictionary<String, Double>();\n \n // maps each given word to their frequency\n for (String word: words) {\n \t\tif (!wordCounts.containsKey(word)) {\n \t\t\twordCounts.put(word, 1.0);\n \t\t} else {\n \t\t\tDouble count = wordCounts.get(word);\n \t\t\twordCounts.put(word, count + 1.0);\n \t\t} \t\t\n }\n Double totalWords = (double) words.size();\n \n // Computes TF scores\n for (KVPair<String, Double> pair: wordCounts) {\n \t\ttfScores.put(pair.getKey(), pair.getValue() / totalWords);\n }\n return tfScores;\n }", "public void calculateScore() {\n for (Sequence seq: currentSeq) {\n double wordWeight = Retriever.getWeight(seq);\n String token = seq.getToken();\n int size = seq.getRight() - seq.getLeft() + 1;\n int titleCount = getCount(token.toLowerCase(), title.toLowerCase());\n if (titleCount != 0) {\n setMatch(size);\n setTitleContains(true);\n }\n int lowerCount = getCount(token.toLowerCase(), lowerContent);\n if (lowerCount == 0) {\n// scoreInfo += \"Token: \" + token + \" Original=0 Lower=0 WordWeight=\" + wordWeight + \" wordTotal=0\\n\";\n continue;\n }\n int originalCount = getCount(token, content);\n lowerCount = lowerCount - originalCount;\n if (lowerCount != 0 || originalCount != 0) {\n setMatch(size);\n }\n double originalScore = formula(wordWeight, originalCount);\n double lowerScore = formula(wordWeight, lowerCount);\n final double weight = 1.5;\n double addedScore = weight * originalScore + lowerScore;\n// scoreInfo += \"Token: \" + token + \" Original=\" + originalScore + \" Lower=\" + lowerScore +\n// \" WordWeight=\" + wordWeight + \" wordTotal=\" + addedScore + \"\\n\";\n dependencyScore += addedScore;\n }\n currentSeq.clear();\n }", "public static double calculateSentenceScore(Map<String, Double> wordScores, String sentence) {\n\t\t/* IMPLEMENT THIS METHOD! */\n\t\tSystem.out.println(\"Sentence: \" + sentence + wordScores);\n\t\tif(wordScores == null || wordScores.isEmpty() || sentence == null || sentence.length() < 1 ) return 0;\n\t\tsentence.toLowerCase();//converts all words to lower case\n\t\tString[] words = sentence.split(\"\\\\s+\");//split on empty spaces\n\t\tint howManyWords = words.length;\n\t\tdouble sc = 0.0;\n\t\tfor(String word : words) {\n\t\t\tif(!word.trim().equals(\"\") && word.trim().matches(\"^[a-zA-Z]*$\")) {//regex ensures that word starts with letter only\n\t\t\t\tif(wordScores.containsKey(word.trim())) {\n//\t\t\t\t\tSystem.out.println(\"for key: \" + word.trim() + wordScores.get(word.trim()));\n\t\t\t\t\tsc += wordScores.get(word.trim());\n\t\t\t\t}else {\n//\t\t\t\t\tSystem.out.println(\"no such key\");\n\t\t\t\t\tsc += 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn sc/howManyWords; // this line is here only so this code will compile if you don't modify it\n\n\t}", "public double tf(String wordToLookFor, HashMap<String, ArrayList<Integer>> tokensHM, Document doc) {\n if (tokensHM.containsKey(wordToLookFor)) {\n double count = 0;\n String[] words = doc.generateWordList(doc.getDocument());\n if(tokensHM.get(wordToLookFor).contains(doc.getIndex())) {\n for (String word : words) {\n if (word.equals(wordToLookFor)) {\n count++;\n }\n }\n }\n return count/words.length;\n }\n else {\n return 0;\n }\n }", "public Map<String, WordImage> calculateWordsAndImagePropability(\r\n\t\t\tMap<String, WordImage> wordImageRel, int totalUniqueUserCount) {\r\n\r\n\t\tint totalOcurrance = 0;\r\n\r\n\t\t// Calculate the total number of word occurrences in the set of similar\r\n\t\t// and dissimilar images\r\n\r\n\t\tfor (String word : wordImageRel.keySet()) { // For each word\r\n\r\n\t\t\tint wordOccur = wordImageRel.get(word).getSimlarImages().size();\r\n\r\n\t\t\tif (this.wordNotSimilarImages.get(word) != null)\r\n\t\t\t\twordOccur += this.wordNotSimilarImages.get(word);\r\n\r\n\t\t\twordImageRel.get(word).setOcurrances(wordOccur);\r\n\r\n\t\t\ttotalOcurrance += wordOccur;\r\n\t\t}\r\n\r\n\t\tfor (String word : wordImageRel.keySet()) { // For each word\r\n\r\n\t\t\tint wordOccur = wordImageRel.get(word).getOcurrances();\r\n\r\n\t\t\t// wordImageRel.get(word).setOcurrances(wordOccur);\r\n\r\n\t\t\tint uniqueUsers = wordImageRel.get(word)\r\n\t\t\t\t\t.getWordUniqueUsers(this.photoList).size();\r\n\r\n\t\t\twordImageRel.get(word).setTotalOcurances(totalOcurrance);\r\n\r\n\t\t\t// .......... Voting-similar word probability\r\n\t\t\t// .......................\r\n\r\n\t\t\t// 1. Word probability without user assumptions\r\n\t\t\tdouble PwOnlyWords = ((double) wordOccur / (double) totalOcurrance);\r\n\t\t\twordImageRel.get(word).setPwOnlyWords(PwOnlyWords);\r\n\r\n\t\t\t// 2. Word probability with user proportion to the total number of\r\n\t\t\t// users\r\n\t\t\tdouble PwAllUsers = PwOnlyWords\r\n\t\t\t\t\t* ((double) uniqueUsers / (double) totalUniqueUserCount);\r\n\t\t\twordImageRel.get(word).setPwAllUsers(PwAllUsers);\r\n\r\n\t\t\t// 3. Word probability. Word freq is represented by the number of\r\n\t\t\t// unique users only\r\n\t\t\tdouble PwOnlyUniqueUsers = ((double) uniqueUsers / (double) totalOcurrance);\r\n\t\t\twordImageRel.get(word).setPwOnlyUniqueUsers(PwOnlyUniqueUsers);\r\n\r\n\t\t\t// ..........TF-IDF Word Probability Calculation\r\n\t\t\t// .......................\r\n\t\t\tint C = totalNumberOfImages;\r\n\t\t\tint R = totalNumberOfSimilarImages;\r\n\t\t\tint Rw = wordImageRel.get(word).getSimlarImages().size();\r\n\t\t\tint Lw = wordImageRel.get(word).getOcurrances();\r\n\r\n\t\t\t// 1. Word probability TF.IDF approach without user assumptions\r\n\t\t\tdouble PwTFIDFlOnlyWords = ((double) Rw / R)\r\n\t\t\t\t\t* (Math.log((double) C / Lw) / Math.log(2))\r\n\t\t\t\t\t/ (Math.log((double) C) / Math.log(2));\r\n\t\t\twordImageRel.get(word).setPwTFIDFlOnlyWords(PwTFIDFlOnlyWords);\r\n\r\n\t\t\t// 2. Word probability TF.IDF approach with user proportion to the\r\n\t\t\t// totall number of users\r\n\t\t\tdouble PwTFIDFlAllUsers = PwTFIDFlOnlyWords\r\n\t\t\t\t\t* ((double) uniqueUsers / (double) totalUniqueUserCount);\r\n\t\t\twordImageRel.get(word).setPwTFIDFlAllUsers(PwTFIDFlAllUsers);\r\n\r\n\t\t\t// 3. Word probability TF.IDF approach. Word freq is represented by\r\n\t\t\t// the number of unique users only\r\n\t\t\tdouble PwTFIDFOnlyUniqueUsers = PwTFIDFlOnlyWords\r\n\t\t\t\t\t* (uniqueUsers / (double) wordOccur);\r\n\t\t\twordImageRel.get(word).setPwTFIDFOnlyUniqueUsers(\r\n\t\t\t\t\tPwTFIDFOnlyUniqueUsers);\r\n\r\n\t\t\twordImageRel.get(word)\r\n\t\t\t\t\t.setImageProbability(1.0 / (double) wordOccur); // P(c_j|w)\r\n\r\n\t\t}\r\n\t\treturn wordImageRel;\r\n\r\n\t}", "abstract double leftProbability();", "private double[] computePredictionValues() {\n double[] predResponses = new double[D];\n for (int d = 0; d < D; d++) {\n double expDotProd = Math.exp(docLabelDotProds[d]);\n double docPred = expDotProd / (expDotProd + 1);\n predResponses[d] = docPred;\n }\n return predResponses;\n }", "static void returnTfIdfResults() {\n\t\tSet<String> specificWords = findKeywords();\n\n\t\t// for every phrase\n\t\tfor (String word : specificWords) {\n\t\t\t// get the total number of documents\n\t\t\tdouble totalSize = size;\n\n\t\t\t// get the collection of documents containing that word\n\t\t\tCollection<File> containingWordSet = invertedMap.getValues(word);\n\n\t\t\t// makes a new one if null (for ease of code)\n\t\t\tif (containingWordSet == null) {\n\t\t\t\tcontainingWordSet = new HashSet<File>();\n\t\t\t}\n\n\t\t\t// the number containing the word\n\t\t\tdouble numContainingWord = containingWordSet.size();\n\n\t\t\t// get the idf (log(total/(1 + |# contain word|)\n\t\t\t// it is normalize with 1 to prevent division by 0\n\t\t\tdouble idf = Math.log(totalSize / (1 + numContainingWord));\n\n\t\t\t// System.out.println(\"------------------\");\n\t\t\t// System.out.println(word + \" totalSize \" + totalSize);\n\t\t\t// System.out.println(word + \" numContainingWord \" +\n\t\t\t// numContainingWord);\n\t\t\t// System.out.println(word + \" idf \" + idf);\n\t\t\t// System.out.println(\"------------------\");\n\n\t\t\t// set the wordscore to 0\n\t\t\tdouble wordScore = 0;\n\n\t\t\t// for all of the files with the word\n\t\t\tfor (File file : containingWordSet) {\n\t\t\t\tString fileName = file.getName();\n\n\t\t\t\t// get the phrase count for this document\n\t\t\t\tInteger phraseCount = phraseCountMap.get(fileName);\n\t\t\t\tdouble numPhrases = phraseCount.doubleValue();\n\n\t\t\t\t// get the word frequency map for this page\n\t\t\t\tHashMap<String, Integer> docFreqMap = wordFreqMap.get(fileName);\n\t\t\t\tInteger freq = docFreqMap.get(word);\n\n\t\t\t\t// otherwise, get the tf\n\t\t\t\tdouble tf;\n\t\t\t\tif (freq == null) {\n\t\t\t\t\t// if it's not present, it's 0\n\t\t\t\t\ttf = 0;\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, it's the value\n\t\t\t\t\ttf = freq / numPhrases;\n\t\t\t\t\t// System.out.println(tf);\n\t\t\t\t}\n\n\t\t\t\t// multiply for this score\n\t\t\t\tdouble score = tf * idf;\n\n\t\t\t\t// add it to the page score\n\t\t\t\twordScore += score;\n\t\t\t}\n\n\t\t\t// make a node with the sum of tf-idf for all relevant phrases and\n\t\t\t// add to pq\n\t\t\tWordNode w = new WordNode(word, wordScore);\n\t\t\tpq.add(w);\n\t\t}\n\t}", "public double uniGramProb(UniGram uniGram)\n\t{\n\t\tUniGram t1 = new UniGram(uniGram.t1());\n\t\tdouble uniGramProb = Math.log(this.UniGramFreq.get(t1) / (double) this.corpusSize);\n\t\t\n\t\treturn uniGramProb;\n\t}", "@Override\n\tpublic double p_l(Label label) {\n\n\t\t// Calculate the probability for the label. No smoothing here.\n\t\t// Just the number of label counts divided by the number of documents.\n\t\tdouble ret = 0;\n\t\t\n\t\t// set up m_sports_count and m_business_count\n\t\tdocuments_per_label_count(m_trainingData);\n\n\t\tdouble sum = m_sports_count + m_business_count;\n\n\t\tif (label == Label.SPORTS) {\n\t\t\tret = m_sports_count / sum;\n\t\t} else {\n\t\t\tret = m_business_count / sum;\n\t\t}\n\n\t\treturn ret;\n\t}", "public int maxProduct(String[] words) {\n final int len = words.length;\n // 1. init table 'useOfLetters'\n final int[] useOfLetters = new int[len];\n for (int i = 0; i < len ; i++) {\n useOfLetters[i] = getUseOfLetter(words[i]);\n }\n\n // 2. find out result.\n int result = 0;\n for (int i = 0; i < len; i++) {\n for (int j = i + 1; j < len; j++) {\n if ((useOfLetters[i] & useOfLetters[j]) == 0 &&\n words[i].length() * words[j].length() > result) {\n result = words[i].length() * words[j].length();\n }\n }\n }\n return result;\n }", "@Test(timeout = 4000)\n public void test36() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n assertEquals(3.0, naiveBayesMultinomialText0.getMinWordFrequency(), 0.01);\n \n naiveBayesMultinomialText0.setMinWordFrequency(0.0);\n double double0 = naiveBayesMultinomialText0.getMinWordFrequency();\n assertEquals(0.0, double0, 0.01);\n }", "private String getWordStatsFromList(List<String> wordList) {\n\t\tif (wordList != null && !wordList.isEmpty()) {\n\t\t\tList<String> wordsUsedCaps = new ArrayList<>(); \n\t\t\tList<String> wordsExcludedCaps = new ArrayList<>(); \n\t\t\tListIterator<String> iterator = wordList.listIterator();\n\t\t\tMap<String, Integer> wordToFreqMap = new HashMap<>();\n\t\t\t// iterate on word List using listIterator to enable edits and removals\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tString origWord = iterator.next();\n\t\t\t\t// remove quotes from word e.g. change parents' to parents; \n\t\t\t\t// change children's to children; change mark'd to mark\n\t\t\t\tString curWord = stripQuotes(origWord);\n\t\t\t\tif (!curWord.equals(origWord)) {\n\t\t\t\t\titerator.set(curWord);\n\t\t\t\t}\n\t\t\t\tString curWordCaps = curWord.toUpperCase();\n\t\t\t\t// remove words previously used (to prevent duplicates) or previously\n\t\t\t\t// excluded (compare capitalized version)\n\t\t\t\tif (wordsExcludedCaps.contains(curWordCaps)) {\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse if (wordsUsedCaps.contains(curWordCaps)) {\n\t\t\t\t\t// if word was previously used then update wordToFreqMap to increment\n\t\t\t\t\t// its usage frequency\n\t\t\t\t\tSet<String> wordKeys = wordToFreqMap.keySet();\n\t\t\t\t\tfor (String word : wordKeys) {\n\t\t\t\t\t\tif (curWord.equalsIgnoreCase(word)) {\n\t\t\t\t\t\t\twordToFreqMap.put(word, wordToFreqMap.get(word).intValue() + 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// invoke checkIfEligible() with algorithm described in Challenge 2 to see if word not\n\t\t\t\t\t// previously used/excluded should be kept. If kept in list \n\t\t\t\t\t// then add to wordsUsedCaps list; if not qualified then add to\n\t\t\t\t\t// wordsExcludedCaps list to prevent checkIfEligible() having to be \n\t\t\t\t\t// called again\n\t\t\t\t\tif (checkIfEligible(curWordCaps)) {\n\t\t\t\t\t\twordsUsedCaps.add(curWordCaps);\n\t\t\t\t\t\twordToFreqMap.put(curWord, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twordsExcludedCaps.add(curWordCaps);\n\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort words in list in order of length\n\t\t\twordList.sort(Comparator.comparingInt(String::length));\n\t\t\t// sort wordToFreqMap by value (frequency) and choose the last sorted map element\n\t\t\t// to get most frequently used word\n\t\t\tList<Map.Entry<String, Integer>> mapEntryWtfList = new ArrayList<>(wordToFreqMap.entrySet());\n\t\t\tmapEntryWtfList.sort(Map.Entry.comparingByValue());\n\t\t\tMap<String, Integer> sortedWordToFreqMap = new LinkedHashMap<>();\n\t\t\tsortedWordToFreqMap.put(mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey(), mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\t\n\t\t\t// set up Json object to be returned as string\n\t\t\t// the code below is self-explaining\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\tjson.put(\"remaining words ordered by length\", wordList);\n\t\t\t\tjson.put(\"most used word\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey());\n\t\t\t\tjson.put(\"number of uses\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\n\t\t\t} catch(JSONException je) {\n\t\t\t\tje.printStackTrace();\n\t\t\t}\n\t\t\treturn json.toString();\n\t\t\t\n\t\t}\n\t\treturn \"\";\n\t}", "private Map<String, Double> distance1Generation(String word) {\n if (word == null || word.length() < 1) throw new RuntimeException(\"Input words Error: \" + word);\n\n Map<String, Double> result = new HashMap<String, Double>();\n\n String prev;\n String last;\n\n for (int i = 0; i < word.length(); i++) {\n // Deletion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n result.put(prev + last, 1.0);\n\n // transposition\n if ((i + 1) < word.length()) {\n prev = word.substring(0, i);\n last = word.substring(i + 2, word.length());\n String trans = prev + word.charAt(i + 1) + word.charAt(i) + last;\n result.put(trans, 1.0);\n }\n\n // alter\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + last, 1.0);\n }\n\n // insertion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + word.charAt(i) + last, 1.0);\n result.put(prev + word.charAt(i) + (char) (j + 97) + last, 1.0);\n }\n\n }\n\n result.remove(word);\n return result;\n }", "public void theDude() {\n\t\ttotal_targets = 0;\n\t\ttotal = 0;\n\t\tint target_count = 0;\n\t\tresult.clear();\n\t\t\n\t\tfor(int k=0; k<input.getWords().size();k++) {\n\t\t\tWord currentWordStat = input.getWordStatistics().get(k);\n\t\t\ttarget_count = 0;\n\t\t\t\n\t\t\tfor(int i=0;i<input.getWords().get(k).length();i++) {\n\t\t\t\tif(target.contains(input.getWords().get(k).charAt(i))) {\n\t\t\t\t\ttarget_count++;\n\t\t\t\t\ttotal_targets++;\n\t\t\t\t}\n\t\t\t\ttotal++;\n\t\t\t}\n\t\t\t\n\t\t\tif(result.containsKey(currentWordStat)) {\n\t\t\t\tresult.put(currentWordStat, result.get(currentWordStat)+target_count);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresult.put(currentWordStat, target_count);\n\t\t\t}\n\t\t}\t\n\t}", "protected double clusterProbability(List<Node> cluster) {\n float p = LogMath.LOG_ZERO;\n LogMath logMath = LogMath.getInstance();\n\n for (Node node : cluster)\n p = logMath.addAsLinear(p, (float)node.getPosterior());\n\n return p;\n }", "public double entropyCalc(String stateSigS,String stateS){\n double total= 0;\n //Probability of the stateSigS occuring\n double pSigSP;\n //Probability of stateS occuring\n double pSigS;\n //Given stateS whats the chance of sigP\n double pCond;\n //lg10 of pSigSP/pCond*pSigS\n double lgP;\n //Used for concating pSigSP so that we get pSigS0 and pSigS1\n String sigP;\n for(int cnt = 0;cnt<states.size();cnt++){\n sigP = states.get(cnt);\n pSigSP = getCumlProbs(stateSigS.concat(sigP));\n pSigS = getCumlProbs(stateSigS);\n pCond = condProb(stateS, sigP);\n lgP = Math.log10(pSigSP/(pCond*pSigS));\n if(Double.isInfinite(lgP)){\n lgP = 0;\n }\n if(Double.isNaN(lgP)){\n lgP = 0;\n }\n total = total + pSigSP*lgP;\n }\n \n //System.out.println(total);\n if(Double.isInfinite(total)){\n return 0;\n }\n return total;\n }", "public double getLogProb(double value) {\n checkHasParams();\n if (value < 0) {\n return Double.NEGATIVE_INFINITY;\n } else {\n return logLambda - lambda * value;\n }\n }", "private void wordAdd(String word){\n if (!fileWords.containsKey(word)){\n fileWords.put(word,1);\n if (probabilities.containsKey(word)) {\n double oldCount = probabilities.get(word);\n probabilities.put(word, oldCount+1);\n } else {\n probabilities.put(word, 1.0);\n }\n }\n }", "private void fillConditionalProb(\tfloat[] conditionalTable,\r\n\t\t\t\t\t\t\t\t\t\tFile trainDir) \r\n\t{\r\n\t\t// Let nCharLanguage be the total number of characters (including \r\n\t\t// multiple occurrences of the same unique character, including spaces) \r\n\t\t// contained in all training documents, \r\n\t\t// For each of the 27 unique characters, ci, compute conditional prob:\r\n\t\t// P(ci | Language) = countLanguage(ci) / nCharLanguage,\r\n\t\t// where countLetter(ci) is the number of times character ci occurs \r\n\t\t// in all documents in the training set. \r\n\t\t\r\n\t\t// GET OVERALL COUNT OF ALL LETTERS IN THIS TRAINING DIRECTORY\r\n\t\tfloat nCharLanguage = (float) getTotalLetters(trainDir);\r\n\t\t\t\t\r\n\t\t// FILL IN THE CONDITIONAL TABLE\r\n\t\tfor(int i = 0; i < 26; i++){\r\n\t\t\tchar currentLetter = (char) ('a' + i);\r\n\t\t\tconditionalTable[i] = \r\n\t\t\t\t\tcountLetter(currentLetter, trainDir) / nCharLanguage;\r\n\t\t}\r\n\t\tconditionalTable[26] = \r\n\t\t\t\tcountLetter(' ', trainDir) / nCharLanguage;\r\n\t}", "public double getVavlueOfO(List<Integer> wordCount) {\n double result = 0.0;\n for (int i = 0; i < weights.size(); i++) {\n result = result + weights.get(i).doubleValue() * wordCount.get(i).doubleValue();\n }\n\n if (result > 0) {\n result = 1.0;\n } else {\n result = -1.0;\n }\n\n return result;\n }", "@Override\n\tpublic double probability() {\n\t\treturn 0;\n\n\t}", "public double getNormalizedCount(String word1, String word2) {\n// double normalizedCount = 0;\n// // YOUR CODE HERE\n// return normalizedCount;\n \n double normalizedCount = 0;\n // YOUR CODE HERE\n if (KnownWord(word1) && KnownWord(word2)) {\n normalizedCount = bi_grams_normalized[NDTokens.indexOf(word1)][NDTokens.indexOf(word2)];\n } else {\n if(smooth) {\n double temp = (!KnownWord(word1)) ? 0 : uni_grams[NDTokens.indexOf(word1)];\n double sum = temp+NDTokens_size;\n normalizedCount = 1/sum;\n }\n }\n return normalizedCount;\n \n }", "public float[][] getTopicWordProb() {\n SortedSet<WordPosition> sortedWords = new TreeSet<WordPosition>();\n Iterator it = dataAlphabet.iterator();\n int i = 0;\n while (it.hasNext()) {\n sortedWords.add(new WordPosition((String) it.next(), i++));\n }\n\n // re-sort the topicWords probability matrix with respect to the new order\n int newPos = 0;\n float[][] topicSortedWords = new float[topicWords.length][corpusVocabularySize];\n for (WordPosition wp : sortedWords) {\n\n for (int t = 0; t < topicWords.length; t++) {\n topicSortedWords[t][newPos] = (float) topicWords[t][wp.position];\n }\n\n newPos++;\n }\n\n return topicSortedWords;\n }", "private double calcProbability(int index) {\n\t\treturn (double) fitnesses[index] / sumOfFitnesses();\n\t}", "public double quatoGramProbSucceed(QuatoGram quatoGram)\n\t{\n\t\t//Count sum of t1,t2,tx,t4\n\t\tint B = 0;\n\t\tint N = 0;\n\t\tint X = 0;\n\t\t\n\t\tfor (Entry<UniGram, Integer> entry: this.UniGramFreq.entrySet())\n\t\t{\n\t\t\tQuatoGram t1t2t3t4 = new QuatoGram(quatoGram.t1(), quatoGram.t2(), \n\t\t\t\t\t\t\t entry.getKey().t1(), quatoGram.t4());\n\t\t\t\t\t\t\t \n\t\t\tif (this.QuatoGramFreq.containsKey(t1t2t3t4))\n\t\t\t{\n\t\t\t\tB += 1;\n\t\t\t\tN += this.QuatoGramFreq.get(t1t2t3t4);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Lidstone's law\n\t\t// X + 1c / N + Bc\n\t\t// X = sum(t1t2t3t4)\n\t\t// 0 <= c <= 1\n\t\tif (this.QuatoGramFreq.containsKey(quatoGram))\n\t\t{\n\t\t\tX = this.QuatoGramFreq.get(quatoGram);\n\t\t}\n\t\t\n\t\tdouble prob = 0.00000001f;\n\t\tif (N != 0) {\n\t\t\tprob = ((double)X + BigramLambda) / (double)(N + (BigramLambda * B));\n\t\t}\n\t\t\n\t\treturn Math.log(prob);\n\t}", "public double calculateEntropy(int[] input) {\n if (input == null || input.length == 0) return 0;\n \n Map<Integer, Integer> map = new HashMap<>();\n int n = input.length;\n double res = 0;\n \n for (int num : input) \n map.put(num, map.getOrDefault(num, 0) + 1);\n \n for (Integer key : map.keySet()) {\n double p = (double) map.get(key) / (double) n;\n res += -(p * (Math.log(p) / Math.log(2)));\n }\n \n return res;\n }" ]
[ "0.71076477", "0.681295", "0.6608435", "0.6484906", "0.62216187", "0.6215903", "0.6192051", "0.6174297", "0.61305624", "0.60717946", "0.5859442", "0.5850505", "0.5810984", "0.5805826", "0.5781817", "0.57678723", "0.5717903", "0.5717546", "0.56585056", "0.56583536", "0.5654869", "0.56343305", "0.5630643", "0.5618407", "0.5612765", "0.5561003", "0.55606663", "0.55597794", "0.55377364", "0.55266005", "0.5526326", "0.55154496", "0.5511746", "0.5507948", "0.54922634", "0.5491859", "0.54883724", "0.5477218", "0.5465173", "0.54552704", "0.5451868", "0.5436549", "0.5430135", "0.54296845", "0.5427614", "0.5419644", "0.54082996", "0.54063123", "0.5400998", "0.53907794", "0.53903943", "0.538704", "0.5372849", "0.5372564", "0.53705263", "0.53524053", "0.5329788", "0.5314476", "0.5313782", "0.5303694", "0.530049", "0.5293727", "0.5293241", "0.52921087", "0.5291533", "0.52910805", "0.52887976", "0.5281444", "0.5276824", "0.527655", "0.52650106", "0.5262937", "0.52534145", "0.5251217", "0.52506775", "0.5242158", "0.5234844", "0.52317864", "0.5209066", "0.51998335", "0.51799655", "0.5179906", "0.517798", "0.51749283", "0.5164995", "0.5157368", "0.51508313", "0.5144888", "0.5138283", "0.5135569", "0.5134229", "0.51328206", "0.5131232", "0.51274693", "0.51248217", "0.5105266", "0.5102293", "0.5101244", "0.50875247", "0.5086837", "0.5083436" ]
0.0
-1
Using the output vector the system calculated in the feedForward function, this function now needs to calculate error derivatives across the network and update the weights for W, Wout and E.
public void backProp(List<Integer> context, Integer nextWord, double alpha){ // TODO: implement backpropagation }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void backwardCalculation(double[] trainingOutput) {\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\terrorOutput[i] = output[i] * (1 - output[i]) * (trainingOutput[i] - output[i]);\n\t\t}\n\n\t\t// computer error at every hidden node\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\tfor (int j = 0; j < numberOfOutputs; j++) {\n\t\t\t\tsum += matrixOutput[i][j] * errorOutput[j];\n\t\t\t}\n\n\t\t\terrorMiddle[i] = middle[i] * (1 - middle[i]) * sum;\n\t\t}\n\n\t\t// update weights between hidden and output nodes\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tfor (int j = 0; j < numberOfOutputs; j++) {\n\t\t\t\tmatrixOutput[i][j] += rate * middle[i] * errorOutput[j];\n\t\t\t}\n\t\t}\n\n\t\t// update weights between input and hidden nodes\n\t\tfor (int i = 0; i < numberOfInputs; i++) {\n\t\t\tfor (int j = 0; j < numberOfMiddle; j++) {\n\t\t\t\tmatrixMiddle[i][j] += rate * input[i] * errorMiddle[j];\n\t\t\t}\n\t\t}\n\n\t\t// update thetas at output nodes\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\tthetaOutput[i] += rate * errorOutput[i];\n\t\t}\n\n\t\t// update thetas at hidden nodes\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tthetaMiddle[i] += rate * errorMiddle[i];\n\t\t}\n\t}", "public void backprop(double[] inputs, FeedForwardNeuralNetwork net, boolean verbose)\n {\n //create variables that will be used later\n int[] sizes = net.getSizes();\n int biggestSize = 0;\n for(int k = 0; k < sizes.length; k++)\n {\n if(sizes[k] > biggestSize)\n {\n biggestSize = sizes[k];\n }\n }\n int hiddenLayers = sizes.length - 2;\n //if input or output wrong size, return\n if(inputs.length != sizes[0])\n {\n System.out.println(\"Invalid number of inputs\");\n return;\n }\n\n double[][] allOutputs = new double[sizes.length][biggestSize];\n double[][] allErrors = new double[sizes.length][biggestSize];\n\n //fill out first layer to temp output\n int lastLayer = sizes[0];\n for(int k = 0; k < lastLayer; k++)\n {\n allOutputs[0][k] = inputs[k];\n }\n\n //for each layer after the input\n for(int k = 1; k < hiddenLayers + 2; k++)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //get sum and get activation function result and its derivative\n double sum = 0;\n for(int t = 0; t < lastLayer; t++)\n {\n sum += allOutputs[k - 1][t] * net.getWeight(k - 1, t, k, a);\n }\n sum += net.getBiasNum() * net.getWeight(-1, 0, k, a);\n if(k != hiddenLayers + 1)\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getHiddenActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getHiddenActivationFunction());\n }\n else\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getOutputActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getOutputActivationFunction());\n }\n }\n lastLayer = sizes[k];\n }\n\n if(verbose)\n {\n System.out.println(\"Outputs\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(allOutputs[hiddenLayers + 1][k] + \", \");\n }\n System.out.println();\n }\n double[] expectedOutputs = new double[maxClusters];\n int cluster = 0;\n double max = 0;\n for(int k = 0; k < maxClusters; k++)\n {\n expectedOutputs[k] = allOutputs[hiddenLayers + 1][k];\n if(allOutputs[hiddenLayers + 1][k] > max)\n {\n cluster = k;\n max = allOutputs[hiddenLayers + 1][k];\n }\n }\n if(verbose)\n {\n System.out.println(\"Output \" + cluster + \" will be set to max value\");\n System.out.println();\n }\n\n expectedOutputs[cluster] = 4;\n\n\n //go backward from output to first hidden layer\n for(int k = hiddenLayers + 1; k > 0; k--)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //compute error for not output layer\n if(k != hiddenLayers + 1)\n {\n double temp = allErrors[k][a];\n allErrors[k][a] = 0;\n for(int t = 0; t < sizes[k + 1]; t++)\n {\n allErrors[k][a] += net.getWeight(k, t, k + 1, a) * allErrors[k + 1][t];\n }\n allErrors[k][a] *= temp;\n }\n //compute error for output layer\n else\n {\n allErrors[k][a] *= (expectedOutputs[a] - allOutputs[k][a]);\n }\n\n //for each weight node takes as input\n for(int t = 0; t < sizes[k - 1]; t++)\n {\n //find the delta for the weight and apply\n int index = net.getIndex(k - 1, t, k, a);\n double delta = learningRate * allOutputs[k - 1][t] * allErrors[k][a]\n + momentum * lastDeltas[index];\n\n net.setWeight(k - 1, t, k, a, net.getWeight(k - 1, t, k, a) + delta);\n lastDeltas[index] = delta;\n }\n }\n }\n }", "@Override\n\tpublic void backProp() {\n\t\tdouble dOut = 0;\n\t\tfor (Node n : outputs) {\n\t\t\tdOut += n.dInputs.get(this);\n\t\t}\n\t\tdouble dTotal = activationFunction.derivative(total)*dOut;\n\t\tfor (Node n : inputs) {\n\t\t\tdInputs.put(n, dTotal * weights.get(n).getWeight());\n\t\t\tweights.get(n).adjustWeight(dTotal * n.output);\n\t\t}\n\t\tbiasWeight.adjustWeight(bias * dTotal);\n\t}", "@Override\n\tpublic Object backward(Object grad_output) {\n\t\t\n\t\tdouble[] grads=(double[])grad_output;\n\t\t\n\t\t//for weights\n\t\tweights_gradients=new double[weights.length][];\n\t\tfor(int i=0;i<weights.length;i++)\n\t\t{\n\t\t\tweights_gradients[i]=grads;\n\t\t}\n\t\t\n\t\t//for grad_inputs\n\t\tdouble[] grad_inputs=MatrixTool.MatrixRightDotVector(weights, grads);\n\t\treturn grad_inputs;\n\t}", "public void calculateError() {\n double sum = 0;\n\n for (ErrorNeuron neuron : frontNeurons) {\n sum += neuron.error * neuron.neuron.getWeights()[index];\n }\n\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * sum;\n }", "private void updateOutputLayerErrors(Vector errorVector) {\r\n\t\tList<Neuron> neurons = getNetwork().getOutputLayer().getNeurons();\r\n\t\tfor (int i = 0; i < neurons.size(); i++) {\r\n\t\t\tNeuron neuron = neurons.get(i);\r\n\t\t\tdouble outputError = errorVector.get(i);\r\n\t\t\tupdateOutputLayerErrors(outputError, neuron);\r\n\t\t}\r\n\t}", "public void iteration() {\n\n\t\tfinal ErrorCalculation errorCalculation = new ErrorCalculation();\n\n\t\tfinal Layer inputLayer = this.network.getLayer(BasicNetwork.TAG_INPUT);\n\t\tfinal Layer outputLayer = this.network\n\t\t\t\t.getLayer(BasicNetwork.TAG_OUTPUT);\n\n\t\tfor (final NeuralDataPair pair : this.training) {\n\t\t\t// calculate the error\n\t\t\tfinal NeuralData output = this.network.compute(pair.getInput());\n\n\t\t\tfor (int currentAdaline = 0; currentAdaline < output.size(); \n\t\t\t\tcurrentAdaline++) {\n\t\t\t\tfinal double diff = pair.getIdeal().getData(currentAdaline)\n\t\t\t\t\t\t- output.getData(currentAdaline);\n\n\t\t\t\t// weights\n\t\t\t\tfor (int i = 0; i < inputLayer.getNeuronCount(); i++) {\n\t\t\t\t\tfinal double input = pair.getInput().getData(i);\n\t\t\t\t\tthis.synapse.getMatrix().add(i, currentAdaline,\n\t\t\t\t\t\t\tthis.learningRate * diff * input);\n\t\t\t\t}\n\n\t\t\t\t// threshold (bias)\n\t\t\t\tdouble t = outputLayer.getThreshold(currentAdaline);\n\t\t\t\tt += this.learningRate * diff;\n\t\t\t\toutputLayer.setThreshold(currentAdaline, t);\n\t\t\t}\n\n\t\t\terrorCalculation.updateError(output, pair.getIdeal());\n\t\t}\n\n\t\t// set the global error\n\t\tsetError(errorCalculation.calculateRMS());\n\t}", "public void applyBackpropagation( float expectedOutput[] ) {\n\t\t// The code for updating weights goes here \n\t\t// NOTE: if using a single perceptron, this is not technically back-propagation, despite the function name \n }", "private void updateHiddenLayersErrors(Neuron neuron) {\r\n\r\n\t\t// Calculate the neuron error by weighting the errors of the output neurons of the output synapses.\r\n\t\tList<Synapse> outputSynapses = neuron.getOutputSynapses();\r\n\t\tdouble weightedOutputError = 0;\r\n\t\tfor (Synapse outputSynapse : outputSynapses) {\r\n\t\t\t// Output neuron and update.\r\n\t\t\tNeuron outputNeuron = outputSynapse.getOutputNeuron();\r\n\t\t\tdouble error = outputNeuron.getError();\r\n\t\t\tdouble weight = outputSynapse.getWeight();\r\n\t\t\tweightedOutputError += (error * weight);\r\n\t\t}\r\n\r\n\t\t// Back propagate weighted output\r\n\t\tOutputFunction outputFunction = neuron.getOutputFunction();\r\n\t\tdouble input = neuron.getInput();\r\n\t\tdouble derivative = outputFunction.getDerivative(input);\r\n\t\tdouble neuronError = weightedOutputError * derivative;\r\n\t\tneuron.setError(neuronError);\r\n\r\n\t\t// Update neuron weights if applicable\r\n\t\tif (updateWeights) {\r\n\t\t\tupdateNeuronWeights(neuron);\r\n\t\t}\r\n\r\n\t\t// Update bias if applicable\r\n\t\tif (updateBiases) {\r\n\t\t\tupdateNeuronBias(neuron);\r\n\t\t}\r\n\t}", "public static void gradientCheck(){\n\t\tList<Integer> context = Arrays.asList(1, 2, 3);\n\t\tInteger nextWord = 5;\n\t\tNetwork network = new Network(4, 20, 30, 40);\n\t\t\n\t\tdouble epsilon = 0.0001;\n\t\tdouble alpha = 0.1;\n\t\t\n\t\tint i = 1, j = 12;\n\t\tdouble originalValue = network.E.get(i).get(j, 0);\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue + epsilon);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tdouble loss1 = -1.0 * Math.log(network.output.get(nextWord, 0));\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue - epsilon);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tdouble loss2 = -1.0 * Math.log(network.output.get(nextWord, 0));\n\t\t\n\t\tdouble derivative1 = (loss1 - loss2)/(2.0 * epsilon);\n\t\tSystem.out.println(\"Derivative1: \" + derivative1);\n\t\t\n\t\tnetwork.E.get(i).put(j, 0, originalValue);\n\t\tnetwork.feedForward(context, nextWord);\n\t\tnetwork.backProp(context, nextWord, alpha);\n\t\tdouble derivative2 = (network.E.get(i).get(j, 0) - originalValue) / (-1.0 * alpha);\n\t\tSystem.out.println(\"Derivative2: \" + derivative2);\n\t\t\n\t\tif(Math.abs(derivative1 - derivative2) < 0.00001)\n\t\t\tSystem.out.println(\"Gradient check: PASS\");\n\t\telse\n\t\t\tSystem.out.println(\"Gradient check: FAIL\");\n\t}", "public void updateWeights(int sampleNum) {\n\t\tint lastLayer = layers.size() - 1;\n\n\t\t/* Calculate signal error in output layer */\n\t\tfor (Node n : layers.get(lastLayer).getNodes()) {\n\t\t\tint i = layers.get(lastLayer).getNodes().indexOf(n);\n\t\t\tDouble sigErr = ((expectedOutput.get(sampleNum % expectedOutput.size()).get(i)\n\t\t\t\t\t- layers.get(lastLayer).getNodes().get(i).getOutput())\n\t\t\t\t\t* layers.get(lastLayer).getNodes().get(i).getOutput()\n\t\t\t\t\t* (1 - layers.get(lastLayer).getNodes().get(i).getOutput()));\n\t\t\tn.setSigErr(sigErr);\n\t\t}\n\n\t\t/* \n\t\t * Calculates signal errors for all nodes in hidden layers.\n\t\t * Back propagates the signal errors.\n\t\t */\n\t\tfor (int i = (lastLayer - 1); i > 0; i--) {\n\t\t\tfor (int j = 0; j < layers.get(i).getNodes().size(); j++) {\n\t\t\t\tDouble sum = 0.0;\n\t\t\t\ttry {\n\t\t\t\tfor (int k = 0; k < layers.get(i + 1).getNodes().size(); k++) {\n\t\t\t\t\tsum += layers.get(i + 1).getNodes().get(k).getWeights().get(j)\n\t\t\t\t\t\t\t* layers.get(i + 1).getNodes().get(k).getSigErr();\n\t\t\t\t}\n\t\t\t\t} catch(IndexOutOfBoundsException e) {\n\n\t\t\t\t}\n\t\t\t\tlayers.get(i).getNodes().get(j).setSigErr(sum * layers.get(i).getNodes().get(j).getOutput()\n\t\t\t\t\t\t* (1 - layers.get(i).getNodes().get(j).getOutput()));\n\t\t\t}\n\t\t}\n\n\t\t/* Updates weights */\n\t\tfor (int i = (layers.size() - 1); i > 0; i--) {\n\t\t\tfor (Node n : layers.get(i).getNodes()) {\n\t\t\t\t/* Calculate weight error */\n\t\t\t\tn.setThresholdErr(learningRate * n.getSigErr() + momentum * n.getThresholdErr());\n\t\t\t\tn.setThreshold(n.getThreshold() + n.getThresholdErr());\n\n\t\t\t\t/* updates weights */\n\t\t\t\ttry {\n\t\t\t\t\tfor (int j = 0; j < n.getWeights().size(); j++) {\n\t\t\t\t\t\t/* Calculate distance between nodes */\n\t\t\t\t\t\tn.getWeightsErr().set(j,\n\t\t\t\t\t\t\t\tlearningRate * n.getSigErr() * layers.get(i - 1).getNodes().get(j).getOutput()\n\t\t\t\t\t\t\t\t\t\t+ momentum * n.getWeightsErr().get(j));\n\t\n\t\t\t\t\t\t/* Update based on distance */\n\t\t\t\t\t\tn.getWeights().set(j, n.getWeights().get(j) + n.getWeightsErr().get(j));\n\t\t\t\t\t}\n\t\t\t\t} catch(IndexOutOfBoundsException e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Reduces learning rate over time to prevent over or under fitting */\n\t\tepoch++;\n\t\tlearningRate = learningRate / ((1 + epoch) / (epoch));\n\t}", "private double calculateErrors(Instance instance, Hashtable<NeuralNode, Double> nodeValues) throws Exception {\r\n\t\tdouble ret = 0;\r\n\t\t\r\n\t\t// calculate errors for the network\r\n\t\tfor (InputNode input : inputs) {\r\n\t\t\tinput.getError(instance, nodeValues);\r\n\t\t}\r\n\t\t\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\tdouble error = output.getError(instance, nodeValues);\r\n\t\t\tret += error * error;\r\n\t\t}\r\n\t\treturn ret;\r\n\r\n\t}", "public void trainNet() {\t\t\n\t\t// Synapses contain the weights for each layer, these are randomised to begin with\n\t\tsynapse0 = new double[X[0].length][hiddenNeurons];\n\t\tpopulateRandom(synapse0, minRandomWeight, maxRandomWeight);\n\t\t\n\t\tsynapse1 = new double[hiddenNeurons][y[0].length];\n\t\tpopulateRandom(synapse1, minRandomWeight, maxRandomWeight);\n\t\t\n\t\t// The layers are the output values of each layer.\n\t\t// They are initialised to nothing to begin with, created properly in the training loop\n\t\tlayer1 = new double[0][0];\n\t\tlayer2 = new double[0][0];\n\t\t\n\t\t// Printing the initial state of the system\n\t\tm.printMatrix(\"X:\", X);\n\t\tm.printMatrix(\"y:\", y);\n\t\t\n\t\t// The training loop\n\t\tfor (int i = 0; i < trainingCycles; i++) {\n\t\t\t// calculate the values of each layer given the inputs and the weights\n\t\t\tlayer1 = forwardPropogate(X, synapse0);\n\t\t\tlayer2 = forwardPropogate(layer1, synapse1);\n\t\t\t\n\t\t\t// Calculate the delta error for each output layer, starting\n\t\t\t// with the bottom working up.\n\t\t\t// This is the difference between the expected values and actual values\n\t\t\t// times the derivative (gradient) of the sigmoid activation function\n\t\t\t// The 1st error comes from y - output\n\t\t\tdouble[][] layer2Delta = m.subtract(y, layer2);\n\t\t\tlayer2Delta = delta(layer2Delta, layer2);\n\t\t\t// subsequent layers come from the delta of the lower layer divided by the weights\n\t\t\tdouble[][] layer1Delta = m.dot(layer2Delta, m.t(synapse1));\n\t\t\tlayer1Delta = delta(layer1Delta, layer1);\n\t\t\t\n\t\t\t// Apply the error gradients to each weight, this moves the value closer to the expected\n\t\t\t// or reduces the error\n\t\t\tsynapse1 = m.add(synapse1, m.scale(m.dot(m.t(layer1), layer2Delta), trainingRate));\n\t\t\tsynapse0 = m.add(synapse0, m.scale(m.dot(m.t(X), layer1Delta), trainingRate));\n\t\t}\n\t\t// Run the input matrix through the net to get outputs for each training value on layer 2\n\t\tdouble[][] testNet = runData(X);\n\t\t// Show the results\n\t\tm.printMatrix(\"Output for X after training:\", testNet);\n\t\tm.printMatrixInts(\"Output for X after training (out of 100:\", testNet);\n\t}", "public void calcError(double[] idealOutput){\n for (int i = 0; i < getNeuronCount(); i++) {\n setError(i, idealOutput[i] - fire[i]);\n setErrorDelta(i, bound(calculateDelta(i)));\n }\n\n }", "private void backwardPropagation(int[] trainingData, int[] trainingLabel, double[] outputActivations, double[] hiddenActiv) {\n\t\tdouble[] delta = new double[SIZE_OUTPUT_LAYER];\n\t\t// Update OutputLayer weights\n\t\tfor(int indexOutput = 0; indexOutput < SIZE_OUTPUT_LAYER; indexOutput++) {\n\t\t\t// We define delta as the difference between the real label and the softmax probability\n\t\t\tdelta[indexOutput] = trainingLabel[indexOutput] - outputActivations[indexOutput];\n\n\t\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\t\tweightsOfOutputLayer[indexOutput][indexHidden] += learningRate * delta[indexOutput] * hiddenActiv[indexHidden] / datasetSize;\n\t\t\t}\t\n\t\t\tbiasOfOutputLayer[indexOutput] += learningRate * delta[indexOutput] / datasetSize;\n\t\t}\t\n\t\t// Create delta2 \n\t\tdouble[] delta2 = new double[SIZE_HIDDEN_LAYER];\n\t\tfor(int i = 0; i < SIZE_HIDDEN_LAYER; i++) {\n\t\t\tdelta2[i] = 0;\n\t\t\tfor(int j = 0; j < SIZE_OUTPUT_LAYER; j++) {\n\t\t\t\t// Why is it multiplying the weights for delta1?\n\t\t\t\tdelta2[i] += delta[j] * weightsOfOutputLayer[j][i];\n\t\t\t}\n\t\t\tdelta2[i] *= dtanh(hiddenActiv[i]);\n\t\t}\n\t\t// Update HiddenLayer weights\n\t\tfor(int i = 0; i < SIZE_HIDDEN_LAYER; i++) {\n\t\t\tfor(int j = 0; j < SIZE_INPUT_LAYER; j++) {\n weightsOfHiddenLayer[i][j] += learningRate * delta2[i] * (double)trainingData[j] / datasetSize;\n\t\t\t}\n biasOfHiddenLayer[i] += learningRate * delta2[i] / datasetSize;\n\t\t}\t\n\t}", "@Override\n public void backward() {\n Tensor x = modInX.getOutput();\n Tensor tmp = new Tensor(yAdj); // copy\n tmp.elemDivide(x);\n modInX.getOutputAdj().elemAdd(tmp);\n }", "public void calculateOutput() {\n inputSum = 0.0;\n //for output (linear) neuron\n if (layer == 0) {\n for (int i = 0; i < inputs; ++i) {\n inputSum += weights[i] * network.getInput()[i];\n }\n }\n //for Sigmoidal neurons\n else {\n for(int i = 0; i < inputs; ++i) {\n inputSum += weights[i] * network.getNeurons()[layer - 1][i].output;\n }\n }\n if (enableConstAddend) {\n inputSum += weights[inputs];\n }\n output = activate(inputSum);\n }", "@Override\n /**\n * @param X The input vector. An array of doubles.\n * @return The value returned by th LUT or NN for this input vector\n */\n\n public double outputFor(double[] X) {\n int i = 0, j = 0;\n for(i=0;i<argNumInputs;i++){\n S[0][i] = X[i];\n NeuronCell[0][i] = X[i];\n }\n //then add the bias term\n S[0][argNumInputs] = 1;\n NeuronCell[0][argNumInputs] = customSigmoid(S[0][argNumInputs]);\n S[1][argNumHidden] = 1;\n NeuronCell[1][argNumHidden] = customSigmoid(S[1][argNumInputs]);\n\n for(i=0;i<argNumHidden;i++){\n for(j=0;j<=argNumInputs;j++){\n //Wji : weigth from j to i\n WeightSum+=NeuronCell[0][j]*Weight[0][j][i];\n }\n //Sj = sigma(Wji * Xi)\n S[1][i]=WeightSum;\n NeuronCell[1][i]=(customSigmoid(WeightSum));\n //reset weigthsum\n WeightSum=0;\n }\n\n for(i = 0; i < argNumOutputs; i++){\n for(j = 0;j <= argNumHidden;j++){\n WeightSum += NeuronCell[1][j] * Weight[1][j][i];\n }\n NeuronCell[2][i]=customSigmoid(WeightSum);\n S[2][i]=WeightSum;\n WeightSum=0;\n }\n //if we only return 1 double, it means we only have one output, so actually we can write return NeuronCell[2][0]\n return NeuronCell[2][0];\n }", "@Override\n\tpublic void train(DataSet data) {\n\t\tArrayList<Example> examples = data.getCopyWithBias().getData();\n\t\t// initialize both weight vectors with random values between -0.1 ad 0.1\n\t\tinitWeights(examples.size());\n\n\t\t// store outputs from forward calculation for each example\n\t\t// array will have size # examples.\n\t\tArrayList<Double> nodeOutputs = calculateForward(examples);\n\n\t\t// now take error and back-propagate from output to hidden nodes\n\n\t\tfor (int j = 0; j < examples.size(); j++) {\n\t\t\tExample ex = examples.get(j);\n\n\t\t\t// get hidden node outputs for single example\n\t\t\tfor (int num = 0; num < numHidden; num++) {\n\t\t\t\tArrayList<Double> h_outputs = hiddenOutputs.get(num);\n\t\t\t\tdouble vDotH = dotProduct(h_outputs, layerTwoWeights); // calculate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// v dot\n\t\t\t\t// h for\n\t\t\t\t// this node\n\n\t\t\t\tfor (int i = 0; i < numHidden - 1; i++) {\n\t\t\t\t\tdouble oldV = layerTwoWeights.get(i);\n\t\t\t\t\tdouble hk = h_outputs.get(i);\n\t\t\t\t\t// Equation describing line below:\n\t\t\t\t\t// v_k = v_k + eta*h_k(y-f(v dot h)) f'(v dot h)\n\t\t\t\t\tlayerTwoWeights.set(i, oldV + eta * hk * (ex.getLabel() - Math.tanh(vDotH)) * derivative(vDotH));\n\t\t\t\t}\n\n\t\t\t\tSet<Integer> features = ex.getFeatureSet();\n\t\t\t\tIterator<Integer> iter = features.iterator();\n\t\t\t\tArrayList<Double> featureVals = new ArrayList<Double>();\n\t\t\t\tfor (int f : features) {\n\t\t\t\t\tfeatureVals.add((double) f);\n\t\t\t\t}\n\n\t\t\t\t// take that error and back-propagate one more time\n\t\t\t\tfor (int x = 0; x < numHidden; x++) {\n\t\t\t\t\tArrayList<Double> initWeights = hiddenWeights.get(x);\n\t\t\t\t\t// List<Object> features =\n\t\t\t\t\t// Arrays.asList(ex.getFeatureSet().toArray());\n\n\t\t\t\t\t// for (int i = 0; i < featureVals.size()-1; i++) {\n\t\t\t\t\tdouble oldWeight = initWeights.get(j);\n\t\t\t\t\tdouble thisInput = ex.getFeature(featureVals.get(x).intValue());\n\t\t\t\t\t// w_kj = w_kj + eta*xj(input)*f'(w_k dot x)*v_k*f'(v dot\n\t\t\t\t\t// h)(y-f(v dot h))\n\t\t\t\t\tdouble updateWeight = oldWeight + eta * thisInput * derivative(dotProduct(featureVals, initWeights))\n\t\t\t\t\t\t\t* layerTwoWeights.get(x) * derivative(vDotH) * (ex.getLabel() - Math.tanh(vDotH));\n\t\t\t\t\tinitWeights.set(j, updateWeight);\n\t\t\t\t\t// }\n\t\t\t\t\thiddenWeights.set(x, initWeights); // update weights for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// current\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// example\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public void train(double[] inputs, double[] outputsTarget) {\n assert(outputsTarget.length == weights.get(weights.size() - 1).length);\n \n ArrayList<double[]> layersOutputs = new ArrayList<double[]>(); \n classify(inputs, layersOutputs);\n\n // Calculate sensitivities for the output nodes\n int outputNeuronCount = this.weights.get(this.weights.size() - 1).length;\n double[] nextLayerSensitivities = new double[outputNeuronCount];\n assert(layersOutputs.get(layersOutputs.size() - 1).length == outputNeuronCount);\n for (int i = 0; i < outputNeuronCount; i++) {\n nextLayerSensitivities[i] = calculateErrorPartialDerivitive(\n layersOutputs.get(layersOutputs.size() - 1)[i],\n outputsTarget[i]\n ) * calculateActivationDerivitive(layersOutputs.get(layersOutputs.size() - 1)[i]);\n assert(!Double.isNaN(nextLayerSensitivities[i]));\n }\n\n for (int weightsIndex = this.weights.size() - 1; weightsIndex >= 0; weightsIndex--) {\n int previousLayerNeuronCount = this.weights.get(weightsIndex)[0].length;\n int nextLayerNeuronCount = this.weights.get(weightsIndex).length;\n assert(nextLayerSensitivities.length == nextLayerNeuronCount);\n\n double[] previousLayerOutputs = layersOutputs.get(weightsIndex);\n double[] previousLayerSensitivities = new double[previousLayerNeuronCount];\n\n // Iterate over neurons in the previous layer\n for (int j = 0; j < previousLayerNeuronCount; j++) {\n\n // Calculate the sensitivity of this node\n double sensitivity = 0;\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n sensitivity += nextLayerSensitivities[i] * this.weights.get(weightsIndex)[i][j];\n }\n sensitivity *= calculateActivationDerivitive(previousLayerOutputs[j]);\n assert(!Double.isNaN(sensitivity));\n previousLayerSensitivities[j] = sensitivity;\n\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n double weightDelta = learningRate * nextLayerSensitivities[i] * calculateActivation(previousLayerOutputs[j]);\n this.weights.get(weightsIndex)[i][j] += weightDelta;\n assert(!Double.isNaN(this.weights.get(weightsIndex)[i][j]) && !Double.isInfinite(this.weights.get(weightsIndex)[i][j]));\n }\n }\n\n nextLayerSensitivities = previousLayerSensitivities;\n }\n }", "public void train()\r\n\t{\r\n\t\tfor(int i=0; i < this.maxEpoch; i++)\r\n\t\t{\r\n\t\t\tfor(Instance temp_example: this.trainingSet)\r\n\t\t\t{\r\n\t\t\t\tdouble O = calculateOutputForInstance(temp_example);\r\n\t\t\t\tdouble T = temp_example.output;\r\n\t\t\t\tdouble err = T - O;\r\n\r\n\t\t\t\t//w_jk (hidden to output)\r\n\t\t\t\tdouble g_p_out = (outputNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(this.learningRate*\r\n\t\t\t\t\t\t\thiddenNode.node.getOutput()*err*g_p_out);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//w_ij (input to hidden)\r\n\t\t\t\tint hid_count =0;\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tdouble g_p_hid = (hiddenNode.getSum() <= 0) ? 0 : 1;\r\n\t\t\t\t\tif(hiddenNode.getType()==2)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tdouble a_i = inputNode.node.getOutput();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tthis.learningRate*\r\n\t\t\t\t\t\t\t\t\ta_i*g_p_hid*(err*\r\n\t\t\t\t\t\t\t\t\toutputNode.parents.get(hid_count).weight*\r\n\t\t\t\t\t\t\t\t\tg_p_out)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\thid_count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// for all w_pq, update weights\r\n\t\t\t\tfor(Node hiddenNode: hiddenNodes){\r\n\t\t\t\t\tif(hiddenNode.getType()==2){\r\n\t\t\t\t\t\tfor(NodeWeightPair inputNode: hiddenNode.parents){\r\n\t\t\t\t\t\t\tinputNode.weight += inputNode.get_deltaw_pq();\r\n\t\t\t\t\t\t\tinputNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor(NodeWeightPair hiddenNode: outputNode.parents)\r\n\t\t\t\t{\r\n\t\t\t\t\thiddenNode.weight += hiddenNode.get_deltaw_pq();\r\n\t\t\t\t\thiddenNode.set_deltaw_pq(new Double (0.00));\r\n\t\t\t\t}\r\n\r\n\t\t\t} // end of an instance \r\n\t\t} // end of an epoch\r\n\t}", "public ArrayList<Double> calculateOutput(){\n for(int i = 0; i < inputSize; i++){\n network.get(0).get(i).setInput(inputs.get(i));\n }\n //Make it go through each node in the network and calculate output for each of them top down\n for(int i = 0; i < numOutputs; i++){\n output.set(i, network.get(layers-1).get(i).calculateOutput());\n }\n return output;\n }", "public static void main(String[] args) {\n\t\tfinal int input1 = 1;\r\n\t\tfinal int input2 = 1;\r\n\t\t\r\n\t\t// One output in layer 3\r\n\t\tdouble targetOutput = 0;\r\n\t\t\r\n\t\t// Input to Hidden (IH) weights\r\n\t\tdouble IH1 = 0.8;\r\n\t\tdouble IH2 = 0.4;\r\n\t\tdouble IH3 = 0.3;\r\n\t\tdouble IH4 = 0.2;\r\n\t\tdouble IH5 = 0.9;\r\n\t\tdouble IH6 = 0.5;\r\n\t\t\r\n\t\t// second iteration of weights: Hidden to Output (HO) weights\r\n\t\tdouble HO1 = 0.3;\r\n\t\tdouble HO2 = 0.5;\r\n\t\tdouble HO3 = 0.9;\r\n\t\t\r\n\t\t// initialization\r\n\t\tdouble weightedSum1;\r\n\t\tdouble weightedSum2;\r\n\t\tdouble weightedSum3;\r\n\t\t\r\n\t\tdouble hiddenOutput1;\r\n\t\tdouble hiddenOutput2;\r\n\t\tdouble hiddenOutput3;\r\n\t\t\r\n\t\tdouble calculatedOutput;\r\n\t\t\r\n\t\tdouble secondWeightedSum;\r\n\t\t\r\n\t\tdouble outputSumError;\r\n\t\t\r\n\t\tdouble deltaSum;\r\n\t\t\r\n\t\tdouble deltaHO1;\r\n\t\tdouble deltaHO2;\r\n\t\tdouble deltaHO3;\r\n\t\t\r\n\t\tdouble deltaIH1;\r\n\t\tdouble deltaIH2;\r\n\t\tdouble deltaIH3;\r\n\t\tdouble deltaIH4;\r\n\t\tdouble deltaIH5;\r\n\t\tdouble deltaIH6;\r\n\t\t\r\n\t\tfor (int i=0;i<10000;i++){\r\n\t\t\t// Three inputs in layer 2 (hidden layer)\r\n\t\t\tweightedSum1 = input1*IH1+input2*IH4;\r\n\t\t\tweightedSum2 = input1*IH2+input2*IH5;\r\n\t\t\tweightedSum3 = input1*IH3+input2*IH6;\r\n\t\t\t\r\n\t\t\t// weighted sums converted into probabilities by sigmoid\r\n\t\t\thiddenOutput1 = sigmoid(weightedSum1);\r\n\t\t\thiddenOutput2 = sigmoid(weightedSum2);\r\n\t\t\thiddenOutput3 = sigmoid(weightedSum3);\r\n\t\t\t// second iteration of weighted sum\r\n\t\t\tsecondWeightedSum = hiddenOutput1*HO1+hiddenOutput2*HO2+hiddenOutput3*HO3;\r\n\t\t\t\r\n\t\t\t// applying sigmoid on secondWeightedSum to get calculatedOutput\r\n\t\t\tcalculatedOutput = sigmoid(secondWeightedSum);\r\n\t\t\tSystem.out.println(calculatedOutput);\r\n\t\t\t// Back Propagation \r\n\t\t\t\r\n\t\t\t//output sum error = target output - calculated output\r\n\t\t\toutputSumError = targetOutput - calculatedOutput;\r\n\t\t\t\r\n\t\t\t// delta sum = S'(sum)*outputSumError \r\n\t\t\tdeltaSum = sigmoidPrime(secondWeightedSum)*outputSumError;\r\n\t\t\t\t\r\n\t\t/* deltaIHWeights (1,2,3 are equal to 4,5,6 respectively \r\n\t\t because input1 and input2 are both 1) */\r\n\t\tdeltaIH1 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH2 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH3 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\tdeltaIH4 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH5 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH6 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\t\r\n\t\t// deltaHOWeights\r\n\t\tdeltaHO1 = deltaSum / hiddenOutput1;\r\n\t\tdeltaHO2 = deltaSum / hiddenOutput2;\r\n\t\tdeltaHO3 = deltaSum / hiddenOutput3;\r\n\t\t\r\n\t\t// Modifying Old Weights \r\n\t\t\r\n\t\t// modifying IH weights\r\n\t\tIH1 += deltaIH1;\r\n\t\tIH2 += deltaIH2;\r\n\t\tIH3 += deltaIH3;\r\n\t\tIH4 += deltaIH4;\r\n\t\tIH5 += deltaIH5;\r\n\t\tIH6 += deltaIH6;\r\n\t\t\r\n\t\t// modifying HO weights\r\n\t\tHO1 += deltaHO1;\r\n\t\tHO2 += deltaHO2;\r\n\t\tHO3 += deltaHO3;\r\n\t\t\r\n\t\t}\r\n\t}", "public void correctWeights() {\n double tmp;\n\n for(int i = 0; i < inputs; ++i) {\n //temporary store old value\n tmp = weights[i];\n // correct weight's value using MOMENTUM parameter\n weights[i] += changes[i] + MOMENTUM * (weights[i] - exWeights[i]);\n //store old value in class member\n exWeights[i] = tmp;\n // clear corrections value\n changes[i] = 0.0;\n }\n\n // const input weight correction if const input is enabled\n if (enableConstAddend) {\n // temporary store old value\n tmp = weights[inputs];\n // change weight's value using MOMENTUM parameter\n weights[inputs] += changes[inputs] + MOMENTUM * (weights[inputs] - exWeights[inputs]);\n // store old value\n exWeights[inputs] = tmp;\n // clear value of calculated change\n changes[inputs] = 0.0;\n }\n }", "public void train(int iterations) {\n\t\tNeuron n = new NeuronSigmoid();\n\t\t\n\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\tSystem.out.print(\"Epoch: \" +(i+1));\n\t\t\tdouble[][] localOutput = n.think(this.input,this.weights);\n\n\t\t\tdouble[][] error = Matrix2d.subtract(output, localOutput);\n\t\t\tSystem.out.print(\" Error: \"+calcOverallError(error));\n\t\t\tdouble[][] sigDeriv = Matrix2d.sigmoidDerivative(localOutput);\n\t\t\tdouble[][] prod = Matrix2d.multiply(error, sigDeriv);\n\t\t\tdouble[][] transInput = Matrix2d.transposeMatrix(input);\n\t\t\tdouble[][] adjustment = Matrix2d.dot(transInput, prod);\n\n\t\t\tweights = Matrix2d.add(adjustment, weights);\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "private void updateWeights(Hashtable<NeuralNode, Double> nodeValues, double learnRate, double momentum) {\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\toutput.updateWeights(null, nodeValues, learnRate, momentum);\r\n\t\t}\r\n\t}", "void calculateWeights(List<Neuron> connectedNeurons) {\n // neuron_k:weight = neuron_k:weight - this:LearningRate * neuron_k:error * this:output\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n try{\n double currentWeight = neuron.inputWeights.get(this.neuronName);\n double neuronError = neuron.error;\n double newWeight = currentWeight - LEARNING_RATE*neuronError*this.getOutput(); // !!! equation difference\n \n System.out.println(\"this neuronName: \" + this.neuronName + \" that neuron keys: \" + neuron.inputWeights);\n System.out.println(\"Old weight: \" + currentWeight + \" new weight: \" + newWeight);\n \n neuron.inputWeights.put(this.getName(), newWeight);\n }catch (Exception e) {\n System.out.println(this.neuronName + \" : \" + neuron.inputWeights);\n e.printStackTrace();\n System.exit(1);\n }\n }\n }", "public ArrayList<Double> calculateForward(ArrayList<Example> data) {\n\t\t// store outputs from hidden layer for each example\n\t\t// array will have size # examples.\n\t\tArrayList<Double> nodeOutputs = new ArrayList<Double>();\n\n\t\t// randomly shuffle training data\n\t\tCollections.shuffle(data);\n\n\t\t// go through each example and calculate forwards\n\t\tfor (Example ex : data) {\n\t\t\t// get associated weight in hiddenWeights & calculate dot product,\n\t\t\t// run through tanh function\n\t\t\tdouble bias = ex.getFeature(ex.getFeatureSet().size() - 1);\n\t\t\tArrayList<Double> thisNodeOutputs = new ArrayList<Double>();\n\t\t\t// loop through features, and the weight vector for each feature\n\t\t\tfor (int n = 0; n < numHidden; n++) {\n\t\t\t\tdouble thisNode = 0.0; // get dot product of f & h for each node\n\t\t\t\tArrayList<Double> weightVec = hiddenWeights.get(n);\n\t\t\t\tSet<Integer> features = ex.getFeatureSet();\n\t\t\t\tIterator<Integer> iter = features.iterator();\n\t\t\t\tfor (int i = 0; i < features.size(); i++) {\n\t\t\t\t\tdouble featureVal = ex.getFeature(iter.next());\n\t\t\t\t\tdouble weight = weightVec.get(i);\n\t\t\t\t\tthisNode += weight * featureVal;\n\t\t\t\t}\n\t\t\t\tthisNodeOutputs.add(Math.tanh(thisNode * bias));\n\t\t\t}\n\t\t\thiddenOutputs.add(thisNodeOutputs);\n\t\t\t// now do same for output layer\n\t\t\tdouble outSum = 0.0;\n\t\t\tfor (int i = 0; i < numHidden; i++) {\n\t\t\t\tdouble w = layerTwoWeights.get(i);\n\t\t\t\tdouble output = thisNodeOutputs.get(i);\n\t\t\t\toutSum += w * output;\n\t\t\t}\n\t\t\tnodeOutputs.add(Math.tanh(outSum * bias));\n\t\t}\n\t\treturn nodeOutputs;\n\t}", "public double transfer(double[] inputs, double[] weights) throws Exception;", "private double[] getOutputWeightDerivs () {\n\t\tdouble[] weightDerivs = new double[synapses[1][0].length];\n\n\t\tfor (int i = 0; i < weightDerivs.length; i++) {\n\t\t\tweightDerivs[i] = getOutputSumDerivForWeights()[i] * getOutputResultDeriv();\n\t\t}\n\t\treturn weightDerivs;\n\t}", "void calculateError(List<Neuron> connectedNeurons) {\n double weightedErrorSum = 0.0;\n Iterator<Neuron> iter = connectedNeurons.iterator();\n while(iter.hasNext()) {\n Neuron neuron = iter.next();\n weightedErrorSum += neuron.error * neuron.output;\n }\n this.error = this.getOutput()*(1-this.getOutput())*weightedErrorSum;\n }", "@Override\n\tpublic Object forward(Object input) {\n\t\t\n\t\tdouble[] inputs=(double[])input;\n\t\tdouble[] output=MatrixTool.VectorRightDotMatrix(inputs, weights);\n\t\t\n\t\treturn output;\n\t}", "public void train(){\r\n\t\tdouble output = 0.0;\r\n\t\tList<Integer> teacher = null;\r\n\t\tdouble adjustedWeight = 0.0;\r\n\t\tdouble error = 0.0;\r\n\t\tdouble deltaK = 0.0;\r\n\r\n\t\tfor(int counter = 0; counter < maxEpoch; counter++){\r\n\t\t\tfor(Instance inst : trainingSet){\r\n\t\t\t\tcalculateOutputForInstance(inst);\r\n\t\t\t\tteacher = inst.classValues;\r\n\t\t\t\t//jk weight\r\n\t\t\t\tfor(int i = 0; i < outputNodes.size(); i++){\r\n\t\t\t\t\tNode kNode = outputNodes.get(i);\r\n\t\t\t\t\toutput = kNode.getOutput();\r\n\t\t\t\t\terror = teacher.get(i) - output;\r\n\t\t\t\t\tdeltaK = error*getReLU(kNode.getSum());\r\n\t\t\t\t\tfor(int j = 0; j < kNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair jkWeight = kNode.parents.get(j);\r\n\t\t\t\t\t\tNode jNode = jkWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getJK(jNode, deltaK);\r\n\t\t\t\t\t\tjkWeight.weight += adjustedWeight;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//ij weight\r\n\t\t\t\tfor(int i = 0; i < hiddenNodes.size(); i++){\r\n\t\t\t\t\tNode jNode = hiddenNodes.get(i);\r\n\t\t\t\t\tif(jNode.parents == null) continue;\r\n\t\t\t\t\tfor(int j = 0; j < jNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair ijWeight = jNode.parents.get(j);\r\n\t\t\t\t\t\tNode iNode = ijWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getIJ(iNode, jNode, teacher, i);\r\n\t\t\t\t\t\tijWeight.weight += adjustedWeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void computeOutputs(double[] input){\n if (input != null) {\n for (int i=0; i<fire.length; i++) {\n fire[i] = input[i];\n }\n }\n\n //if this a hidden layer then we set the input to be\n double layerInput[] = new double[fire.length+ 1];\n for(int i=0; i<fire.length; i++){\n layerInput[i] = fire[i];\n }\n //add in another element for threshold to be multiplied by 1\n layerInput[fire.length] = 1;\n\n //compute outputs\n for (int i=0; i<next.getNeuronCount(); i++) {\n //get column at i of weightThreshold\n double colWeightThreshold[] = new double[weightThreshold.length];\n for(int j=0; j<colWeightThreshold.length; j++){\n colWeightThreshold[j] = weightThreshold[j][i];\n }\n\n double sum = dotProduct(colWeightThreshold, layerInput);\n //activation function on the sum and store neuron output\n next.fire[i] = activationFunction(sum);//(exp(sum*2.0)-1.0)/(exp(sum*2.0)+1.0);\n //System.out.println(\"output[\"+i+\"]: \"+output[i]);\n\n }\n\n }", "public void batchUpdateWeights() {\n\t\tObject[] keys = nextLayerNodes.keySet().toArray();\n\t\tfor (Object key : keys) {\n\t\t\tNode nextLayerNode = (Node) key;\n\t\t\t// System.out.printf(\"Updating weight from %f to %f%n\", nextLayerNodes.get(nextLayerNode), nextLayerNodesUpdateMap.get(nextLayerNode));\n\t\t\tdouble oldWeight = nextLayerNodes.get(nextLayerNode);\n\t\t\tnextLayerNodes.put(nextLayerNode, nextLayerNodesUpdateMap.get(nextLayerNode));\n\t\t\tdouble newWeight = nextLayerNodes.get(nextLayerNode);\n\t\t\tdouble deltaWeight = oldWeight-newWeight;\n\t\t\tSystem.out.printf(\"Changed from %f to %f%n\", oldWeight, newWeight);\n\t\t\tif (deltaWeight > 0.0) {\n\t\t\t\tif (nextLayerNodesArrayList.get(0).nextLayerNodes.size() == 0) {\n\t\t\t\t\tSystem.out.print(\"Hidden Node connected to output layer \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"Node connected to another hidden layer \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf (\"Increased!! Delta weight = %.10f%n\", deltaWeight);\n\t\t\t} else if (deltaWeight < 0.0) {\n\t\t\t\tif (nextLayerNodesArrayList.get(0).nextLayerNodes.size() == 0) {\n\t\t\t\t\tSystem.out.print(\"Hidden Node connected to output layer \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"Node connected to another hidden layer \");\n\t\t\t\t}\n\t\t\t\tSystem.out.printf(\"Decreased!! Delta weight = %.10f%n\", deltaWeight);\n\t\t\t}\n\t\t}\n\t}", "private void updateHiddenLayersErrors() {\r\n\t\t// Back iterate hidden layers\r\n\t\tList<Layer> layers = getNetwork().getLayers();\r\n\t\tfor (int i = layers.size() - 2; i > 0; i--) {\r\n\t\t\tLayer layer = layers.get(i);\r\n\t\t\t// Iterate the neurons of the layer\r\n\t\t\tList<Neuron> neurons = layer.getNeurons();\r\n\t\t\tfor (Neuron neuron : neurons) {\r\n\t\t\t\t// Do update.\r\n\t\t\t\tupdateHiddenLayersErrors(neuron);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private double computeError(){\n double temp = 0;\r\n for(int trial_Number = 0; trial_Number < expectedOutputList.length; trial_Number++){\r\n for(int index = 0; index< expectedOutputList[trial_Number].length; index++){\r\n double difference = expectedOutputList[trial_Number][index] - this.getOutput()[index];\r\n double error = difference*difference;\r\n temp += error;\r\n }\r\n }\r\n return temp;\r\n }", "private void forwardPropagation(int[] trainingData, double[] activationsOfHiddenLayer, double[] outputActivations) {\n\t\tdouble[] hiddenActivations = new double[SIZE_HIDDEN_LAYER];\n\n\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\thiddenActivations[indexHidden] = 0;\n\t\t\tfor(int indexInput = 0; indexInput < SIZE_INPUT_LAYER; indexInput++) {\n\t\t\t\thiddenActivations[indexHidden] += weightsOfHiddenLayer[indexHidden][indexInput] * trainingData[indexInput];\n\t\t\t}\t\n\t\t\thiddenActivations[indexHidden] += biasOfHiddenLayer[indexHidden];\n//\t\t\t// We then call the activation function \n\t\t\thiddenActivations[indexHidden] = tanh(hiddenActivations[indexHidden]);\n\t\t\tactivationsOfHiddenLayer[indexHidden] = hiddenActivations[indexHidden];\n\n\t\t}\n\t\t\t\t\n\t\tfor(int indexOuput = 0; indexOuput < SIZE_OUTPUT_LAYER; indexOuput++) {\n\t\t\toutputActivations[indexOuput] = 0;\n\t\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden ++) {\n\t\t\t\toutputActivations[indexOuput] += weightsOfOutputLayer[indexOuput][indexHidden] * hiddenActivations[indexHidden];\n\t\t\t}\t\n\t\t\toutputActivations[indexOuput] += biasOfOutputLayer[indexOuput];\n\t\t}\n\t\tsoftmax(outputActivations);\t\n\t}", "public void generatingNetwork(String path, int maxIterations, double learningRate, double maxError) {\n neuroNetwork = new MultiLayerPerceptron(TransferFunctionType.SIGMOID, ENTRYNODES, INTERMEDIATENODES, OUTPUTNODES);\n // create DataSet\n dataset = DataSet.createFromFile(path, ENTRYNODES, OUTPUTNODES, \" \", true);\n\n //Normalizing data\n MaxMinNormalizer normalizing = new MaxMinNormalizer();\n normalizing.normalize(dataset);\n\n //Implementing Learning Rule\n learningRule = new BackPropagation();\n learningRule.setNeuralNetwork(neuroNetwork);\n learningRule.setLearningRate(learningRate);\n learningRule.setMaxError(maxError);\n learningRule.setMaxIterations(maxIterations);\n\n SubSampling samples = new SubSampling(TRAINPERCENTAGE, 100 - TRAINPERCENTAGE);\n List<DataSet> dataSets = samples.sample(dataset);\n dataTraining = dataSets.get(0);\n dataTest = dataSets.get(1);\n\n neuroNetwork.learn(dataTraining, learningRule);\n String[] name = path.split(\"_\");\n File finalFile = new File(\"Expressions\\\\Final_\" + name[1]);\n this.Finalfile = finalFile;\n if (!finalFile.exists()) {\n try {\n finalFile.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n int i = 0;\n double error;\n double diff = 0.0;\n\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(finalFile, true);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n BufferedWriter line = new BufferedWriter(new OutputStreamWriter(fos));\n\n for (DataSetRow dataRow : this.dataTraining.getRows()) {\n neuroNetwork.setInput(dataRow.getInput());\n neuroNetwork.calculate();\n double[] networkOutput = neuroNetwork.getOutput();\n double[] networkDesiredOutput = dataRow.getDesiredOutput();\n diff += Math.pow(networkOutput[0] - networkDesiredOutput[0], 2);\n\n\n i++;\n }\n error = diff / i;\n try {\n line.write(\"Train error: \" + error);\n line.newLine();\n line.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }", "@Override\n\tpublic void run() {\n\t\ttotal = 0;\n\t\tfor (Node n : inputs) {\n\t\t\ttotal += n.output * weights.get(n).getWeight();\n\t\t}\n\t\ttotal += bias * biasWeight.getWeight();\n\t\toutput = activationFunction.run(total);\n\t}", "public void calculateError(double expected) {\n error = neuron.getTransferFunction().derivative(neuron.getRawOutput()) * (expected - neuron.getOutput());\n }", "public abstract double computeOutputFlow(double inputFlow);", "private void forwardCalculation(double[] recordInputs) {\n\t\t\tfor (int j = 0; j < numberOfInputs; j++) {\n\t\t\t\tinput[j] = recordInputs[j];\n\t\t\t}\n\t\t\n\t\t// for each hidden node\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\t// compute input at hidden node\n\t\t\tfor (int j = 0; j < numberOfInputs; j++) {\n\t\t\t\tsum += input[j] * matrixMiddle[j][i];\n\t\t\t}\n\n\t\t\t// add theta\n\t\t\tsum += thetaMiddle[i];\n\n\t\t\t// compute output at hidden node\n\t\t\tmiddle[i] = 1 / (1 + Math.exp(-sum));\n\n\t\t}\n\n\t\t// for each output node\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\t// compute input at output node\n\t\t\tfor (int j = 0; j < numberOfMiddle; j++) {\n\t\t\t\tsum += middle[j] * matrixOutput[j][i];\n\t\t\t}\n\n\t\t\t// add theta\n\t\t\tsum += thetaOutput[i];\n\n\t\t\t// compute output at output node\n\t\t\toutput[i] = 1 / (1 + Math.exp(-sum));\n\t\t}\n\t}", "public void calculateGradients(int dataIndex, double learningRate){\r\n for (int i = 0; i < outputLayer.length; i++) {\r\n for (int j = 0; j < outputLayer[i].weights.length; j++) {\r\n outputLayer[i].dw[j] = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z)*outputLayer[i].data[j];\r\n }\r\n outputLayer[i].db = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, true);\r\n calculateDesireHiddenLayerActivation(dataIndex);\r\n\r\n for (int i = 0; i < hiddenLayer.length; i++) {\r\n for (int j = 0; j < hiddenLayer[i].weights.length; j++) {\r\n hiddenLayer[i].dw[j] = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z)*hiddenLayer[i].data[j];\r\n }\r\n hiddenLayer[i].db = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, false);\r\n }", "private void calculateNewWeights(double tmp) {\n // a) for output layer (linear) neuron\n if (layer == 0) {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getInput()[j];\n }\n }\n // b) if neuron belongs to one of hidden layers\n else {\n for (int j = 0; j < inputs; ++j) {\n changes[j] += tmp * network.getNeurons()[layer - 1][j].output;\n }\n }\n\n // additional calculation if const input is enabled\n if (enableConstAddend)\n changes[inputs] += tmp;\n }", "private void calculateUpdates(\n BSPPeer<LongWritable, FloatVectorWritable, NullWritable, NullWritable, ParameterMessage> peer)\n throws IOException {\n // receive update information from master\n if (peer.getNumCurrentMessages() != 0) {\n ParameterMessage inMessage = peer.getCurrentMessage();\n FloatMatrix[] newWeights = inMessage.getCurMatrices();\n FloatMatrix[] preWeightUpdates = inMessage.getPrevMatrices();\n this.inMemoryModel.setWeightMatrices(newWeights);\n this.inMemoryModel.setPrevWeightMatrices(preWeightUpdates);\n this.isConverge = inMessage.isConverge();\n // check converge\n if (isConverge) {\n return;\n }\n }\n\n FloatMatrix[] weightUpdates = new FloatMatrix[this.inMemoryModel.getSizeOfWeightmatrix()];\n int matrixIdx = 0;\n for (List<FloatMatrix> aWeightMatrixList: this.inMemoryModel.weightMatrixLists) {\n for (FloatMatrix aWeightMatrix : aWeightMatrixList) {\n weightUpdates[matrixIdx++] = new DenseFloatMatrix(\n aWeightMatrix.getRowCount(), aWeightMatrix.getColumnCount());\n }\n }\n\n // continue to train\n float avgTrainingError = 0.0f;\n for (int recordsRead = 0; recordsRead < batchSize; ++recordsRead) {\n FloatVector trainingInstance = getRandomInstance();\n RecurrentLayeredNeuralNetwork.matricesAdd(\n weightUpdates, this.inMemoryModel.trainByInstance(trainingInstance));\n avgTrainingError += this.inMemoryModel.trainingError;\n }\n avgTrainingError /= batchSize;\n\n // calculate the average of updates\n for (int i = 0; i < weightUpdates.length; ++i) {\n weightUpdates[i] = weightUpdates[i].divide(batchSize);\n }\n\n FloatMatrix[] prevWeightUpdates = this.inMemoryModel\n .getPrevMatricesUpdates();\n ParameterMessage outMessage = new ParameterMessage(avgTrainingError, false,\n weightUpdates, prevWeightUpdates);\n\n peer.send(peer.getPeerName(peer.getNumPeers() - 1), outMessage);\n }", "public void FeedForward() {\r\n\t\tfor (int i = 0; i < Node.length; i++) {\r\n\t\t\tNet = Node[i].Threshold;\r\n\r\n\t\t\tfor (int j = 0; j < Node[i].Weight.length; j++)\r\n\t\t\t\tNet = Net + Input[j] * Node[i].Weight[j];\r\n\r\n\t\t\tNode[i].Output = Sigmoid(Net);\r\n\t\t}\r\n\t}", "public void train() {\r\n // For each epoch, call setInputValue on input nodes\r\n for (int i = 0; i < maxEpoch; i++) {\r\n Collections.shuffle(trainingSet, random);\r\n\r\n // get each training instance\r\n for (int k = 0; k < trainingSet.size(); k++) {\r\n\r\n Instance instance = trainingSet.get(k);\r\n\r\n // set the input value in the input nodes from the training instance\r\n for (int j = 0; j < instance.attributes.size(); j++) {\r\n inputNodes.get(j).setInput(instance.attributes.get(j));\r\n }\r\n\r\n //set the target value in output nodes\r\n for (int j = 0; j < instance.classValues.size(); j++) {\r\n outputNodes.get(j).setTargetValue((double) instance.classValues.get(j));\r\n }\r\n\r\n // calculate values for hidden nodes\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n // for each hidden node\r\n Node hiddenNode = hiddenNodes.get(j);\r\n hiddenNode.calculateOutput();\r\n }\r\n\r\n //calculate values for output nodes\r\n double sumOfExponents = 0.0;\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n // for each output node\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.calculateOutput();\r\n sumOfExponents += outputNode.getOutput();\r\n }\r\n\r\n //update output values of output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.updateOutputValue(sumOfExponents);\r\n }\r\n\r\n // calculate delta values for output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.calculateDelta();\r\n }\r\n\r\n // calculate delta values for hidden nodes\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n Node hiddenNode = hiddenNodes.get(j);\r\n hiddenNode.calculateDelta();\r\n hiddenNode.resetSumOfPartialDelta();\r\n }\r\n\r\n // update weights going from input layer to hidden layer\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n Node hiddenNode = hiddenNodes.get(j);\r\n hiddenNode.updateWeight(learningRate);\r\n }\r\n\r\n // update weights going from hidden layer to output layer\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.updateWeight(learningRate);\r\n }\r\n\r\n /*if (k == 0 && i==0) {\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n for (NodeWeightPair pair : outputNode.parents) {\r\n System.out.println(pair.weight);\r\n }\r\n }\r\n }\r\n\r\n if (k == 0 && i == 0) {\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n Node hiddenNode = hiddenNodes.get(j);\r\n if (hiddenNode.parents != null) {\r\n for (NodeWeightPair pair : hiddenNode.parents) {\r\n System.out.println(pair.weight);\r\n }\r\n }\r\n }\r\n }*/\r\n }\r\n\r\n /* if (i==29) {\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n for (NodeWeightPair pair : outputNode.parents) {\r\n System.out.println(pair.weight);\r\n }\r\n }\r\n }*/\r\n\r\n double totalLoss = 0.0;\r\n // Calculate loss and sum for each training instance, and then take average\r\n for (int k = 0; k < trainingSet.size(); k++) {\r\n Instance instance = trainingSet.get(k);\r\n totalLoss += loss(instance);\r\n }\r\n totalLoss /= trainingSet.size();\r\n System.out.println(\"Epoch: \" + i + \", \" + \"Loss: \" + String.format(\"%.3e\", totalLoss));\r\n }\r\n }", "public FeedForwardNeuralNetwork mutate(FeedForwardNeuralNetwork net)\n\t{\n // Copies the net\n FeedForwardNeuralNetwork newNetwork = new FeedForwardNeuralNetwork(net);\n newNetwork.setWeightVector((Vector<Double>)net.getWeightVector().clone());\n\n Vector<Double> newWeights = new Vector<Double>();\n\t\tRandom gen = new Random();\n int mc = gen.nextInt(100), slSize;\n\n if (mc <= 10) { // all the weights in the network\n for(SynapseLayer sl: newNetwork.synapse_layers) {\n slSize = sl.getWeightVector().size() / 20;\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian()*Math.sqrt(slSize));\n }\n newNetwork.setWeightVector(newWeights);\n }\n else if (mc <= 37) { // all the weights in a randomly selected layer\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else if (mc <= 64) { // all the weights going into a randomly selecte layer, i can't tell the difference between this and the last one\n SynapseLayer sl = newNetwork.synapse_layers.get(gen.nextInt(newNetwork.synapse_layers.size()));\n for (Double weight: sl.getWeightVector())\n newWeights.add(weight + gen.nextGaussian() * Math.sqrt(sl.getWeightVector().size()/20));\n sl.setWeightVector(newWeights);\n }\n else {\n newWeights = newNetwork.getWeightVector();\n int rInd = gen.nextInt(newWeights.size());\n newWeights.set(rInd, newWeights.get(rInd) + Math.sqrt(gen.nextGaussian()*14));\n newNetwork.setWeightVector(newWeights);\n }\n\t\treturn newNetwork;\n\t}", "private double calculateError(double[] outputsActual, double[] outputsTarget) {\n return Utilities.calculateError(outputsActual, outputsTarget);\n }", "private double[][] forwardPropogate(double[][] inputs, double[][] weights) {\n\t\tdouble[][] resultLayer = m.dot(inputs, weights);\n\t\tsigmoid(resultLayer);\n\t\treturn resultLayer;\n\t}", "public int feedforward(float[] inputs) {\r\n float sum = 0;\r\n for (int i = 0; i < weights.length; i++) {\r\n sum += inputs[i] * weights[i];\r\n }\r\n System.out.println(\"sum = \" + sum);\r\n return activate(sum);\r\n }", "@Test\n public void testAccumulateGradients() {\n // TODO: MXNet support for accumulating gradients does not currently work\n TestUtils.requiresNotEngine(\"MXNet\");\n try (NDManager manager = NDManager.newBaseManager(TestUtils.getEngine())) {\n NDArray a = manager.create(0.0f);\n a.setRequiresGradient(true);\n\n Engine engine = Engine.getEngine(TestUtils.getEngine());\n try (GradientCollector gc = engine.newGradientCollector()) {\n for (int i = 1; i <= 3; i++) {\n NDArray b = a.mul(2);\n gc.backward(b);\n Assert.assertEquals(a.getGradient().getFloat(), 2.0f * i);\n }\n }\n }\n }", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "private void calculateOutputs(Instance instance, Hashtable<NeuralNode, Double> nodeValues) {\r\n\t\tfor (OutputNode output : outputs) {\r\n\t\t\toutput.getValue(instance, nodeValues);\r\n\t\t}\r\n\t}", "private double[] getOutputSumDerivsForHiddenOutput() {\n\t\t//dOutputSum/dHiddenOutput\n\t\tdouble[] outputSumDerivs = new double[synapses[1][0].length];\n\t\t\n\t\tfor (int i = 0 ; i < outputSumDerivs.length; i++) {\n\t\t\toutputSumDerivs[i] = synapses[1][0][i].getWeight();\n\t\t}\n\t\t\n\t\treturn outputSumDerivs;\n\t}", "public void calculate(double[] theta) {\r\n dvModel.vectorToParams(theta);\r\n\r\n double localValue = 0.0;\r\n double[] localDerivative = new double[theta.length];\r\n\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryW_dfsG,binaryW_dfsB;\r\n binaryW_dfsG = TwoDimensionalMap.treeMap();\r\n binaryW_dfsB = TwoDimensionalMap.treeMap();\r\n TwoDimensionalMap<String, String, SimpleMatrix> binaryScoreDerivativesG,binaryScoreDerivativesB ;\r\n binaryScoreDerivativesG = TwoDimensionalMap.treeMap();\r\n binaryScoreDerivativesB = TwoDimensionalMap.treeMap();\r\n Map<String, SimpleMatrix> unaryW_dfsG,unaryW_dfsB ;\r\n unaryW_dfsG = new TreeMap<String, SimpleMatrix>();\r\n unaryW_dfsB = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> unaryScoreDerivativesG,unaryScoreDerivativesB ;\r\n unaryScoreDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n unaryScoreDerivativesB= new TreeMap<String, SimpleMatrix>();\r\n\r\n Map<String, SimpleMatrix> wordVectorDerivativesG = new TreeMap<String, SimpleMatrix>();\r\n Map<String, SimpleMatrix> wordVectorDerivativesB = new TreeMap<String, SimpleMatrix>();\r\n\r\n for (TwoDimensionalMap.Entry<String, String, SimpleMatrix> entry : dvModel.binaryTransform) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n binaryW_dfsG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryW_dfsB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(numRows, numCols));\r\n binaryScoreDerivativesG.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n binaryScoreDerivativesB.put(entry.getFirstKey(), entry.getSecondKey(), new SimpleMatrix(1, numRows));\r\n }\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.unaryTransform.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n unaryW_dfsG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryW_dfsB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n unaryScoreDerivativesG.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n unaryScoreDerivativesB.put(entry.getKey(), new SimpleMatrix(1, numRows));\r\n }\r\n if (op.trainOptions.trainWordVectors) {\r\n for (Map.Entry<String, SimpleMatrix> entry : dvModel.wordVectors.entrySet()) {\r\n int numRows = entry.getValue().numRows();\r\n int numCols = entry.getValue().numCols();\r\n wordVectorDerivativesG.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n wordVectorDerivativesB.put(entry.getKey(), new SimpleMatrix(numRows, numCols));\r\n }\r\n }\r\n\r\n // Some optimization methods prints out a line without an end, so our\r\n // debugging statements are misaligned\r\n Timing scoreTiming = new Timing();\r\n scoreTiming.doing(\"Scoring trees\");\r\n int treeNum = 0;\r\n MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>> wrapper = new MulticoreWrapper<Tree, Pair<DeepTree, DeepTree>>(op.trainOptions.trainingThreads, new ScoringProcessor());\r\n for (Tree tree : trainingBatch) {\r\n wrapper.put(tree);\r\n }\r\n wrapper.join();\r\n scoreTiming.done();\r\n while (wrapper.peek()) {\r\n Pair<DeepTree, DeepTree> result = wrapper.poll();\r\n DeepTree goldTree = result.first;\r\n DeepTree bestTree = result.second;\r\n\r\n StringBuilder treeDebugLine = new StringBuilder();\r\n Formatter formatter = new Formatter(treeDebugLine);\r\n boolean isDone = (Math.abs(bestTree.getScore() - goldTree.getScore()) <= 0.00001 || goldTree.getScore() > bestTree.getScore());\r\n String done = isDone ? \"done\" : \"\";\r\n formatter.format(\"Tree %6d Highest tree: %12.4f Correct tree: %12.4f %s\", treeNum, bestTree.getScore(), goldTree.getScore(), done);\r\n System.err.println(treeDebugLine.toString());\r\n if (!isDone){\r\n // if the gold tree is better than the best hypothesis tree by\r\n // a large enough margin, then the score difference will be 0\r\n // and we ignore the tree\r\n\r\n double valueDelta = bestTree.getScore() - goldTree.getScore();\r\n //double valueDelta = Math.max(0.0, - scoreGold + bestScore);\r\n localValue += valueDelta;\r\n\r\n // get the context words for this tree - should be the same\r\n // for either goldTree or bestTree\r\n List<String> words = getContextWords(goldTree.getTree());\r\n\r\n // The derivatives affected by this tree are only based on the\r\n // nodes present in this tree, eg not all matrix derivatives\r\n // will be affected by this tree\r\n backpropDerivative(goldTree.getTree(), words, goldTree.getVectors(),\r\n binaryW_dfsG, unaryW_dfsG,\r\n binaryScoreDerivativesG, unaryScoreDerivativesG,\r\n wordVectorDerivativesG);\r\n\r\n backpropDerivative(bestTree.getTree(), words, bestTree.getVectors(),\r\n binaryW_dfsB, unaryW_dfsB,\r\n binaryScoreDerivativesB, unaryScoreDerivativesB,\r\n wordVectorDerivativesB);\r\n\r\n }\r\n ++treeNum;\r\n }\r\n\r\n double[] localDerivativeGood;\r\n double[] localDerivativeB;\r\n if (op.trainOptions.trainWordVectors) {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator(),\r\n wordVectorDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator(),\r\n wordVectorDerivativesB.values().iterator());\r\n } else {\r\n localDerivativeGood = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsG.valueIterator(), unaryW_dfsG.values().iterator(),\r\n binaryScoreDerivativesG.valueIterator(),\r\n unaryScoreDerivativesG.values().iterator());\r\n\r\n localDerivativeB = NeuralUtils.paramsToVector(theta.length,\r\n binaryW_dfsB.valueIterator(), unaryW_dfsB.values().iterator(),\r\n binaryScoreDerivativesB.valueIterator(),\r\n unaryScoreDerivativesB.values().iterator());\r\n }\r\n\r\n // correct - highest\r\n for (int i =0 ;i<localDerivativeGood.length;i++){\r\n localDerivative[i] = localDerivativeB[i] - localDerivativeGood[i];\r\n }\r\n\r\n // TODO: this is where we would combine multiple costs if we had parallelized the calculation\r\n value = localValue;\r\n derivative = localDerivative;\r\n\r\n // normalizing by training batch size\r\n value = (1.0/trainingBatch.size()) * value;\r\n ArrayMath.multiplyInPlace(derivative, (1.0/trainingBatch.size()));\r\n\r\n // add regularization to cost:\r\n double[] currentParams = dvModel.paramsToVector();\r\n double regCost = 0;\r\n for (int i = 0 ; i<currentParams.length;i++){\r\n regCost += currentParams[i] * currentParams[i];\r\n }\r\n regCost = op.trainOptions.regCost * 0.5 * regCost;\r\n value += regCost;\r\n // add regularization to gradient\r\n ArrayMath.multiplyInPlace(currentParams, op.trainOptions.regCost);\r\n ArrayMath.pairwiseAddInPlace(derivative, currentParams);\r\n\r\n }", "public double[] propagate( double t0, double[] xin, double tf);", "public void gradientDescent(double[][] gradient, double eps) {\n for (int i = 0; i < _weights.length; i++) {\n for (int j = 0; j < _weights[0].length; j++) {\n _weights[i][j] -= eps * gradient[i][j];\n }\n }\n }", "private double loss(Instance instance) {\r\n // set the input value in the input nodes from the training instance\r\n for (int j = 0; j < instance.attributes.size(); j++) {\r\n inputNodes.get(j).setInput(instance.attributes.get(j));\r\n }\r\n\r\n //set the target value in output nodes\r\n for (int j = 0; j < instance.classValues.size(); j++) {\r\n outputNodes.get(j).setTargetValue((double) instance.classValues.get(j));\r\n }\r\n\r\n // calculate values for hidden nodes\r\n for (int j = 0; j < hiddenNodes.size(); j++) {\r\n // for each hidden node\r\n Node hiddenNode = hiddenNodes.get(j);\r\n hiddenNode.calculateOutput();\r\n }\r\n\r\n double sumOfExponents = 0.0;\r\n //calculate values for output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n // for each output node\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.calculateOutput();\r\n sumOfExponents += outputNode.getOutput();\r\n }\r\n\r\n //update output values of output nodes\r\n for (int j = 0; j < outputNodes.size(); j++) {\r\n Node outputNode = outputNodes.get(j);\r\n outputNode.updateOutputValue(sumOfExponents);\r\n }\r\n\r\n double lossPerInstance = 0.0;\r\n for (int j = 0; j < instance.classValues.size(); j++) {\r\n double y = (double) instance.classValues.get(j);\r\n Node outputNode = outputNodes.get(j);\r\n lossPerInstance = lossPerInstance + (-1) * y * Math.log(outputNode.getOutput());\r\n }\r\n\r\n return lossPerInstance;\r\n }", "@Override\n public Tensor forward() {\n Tensor x = modInX.getOutput();\n y = new Tensor(x); // copy\n y.log();\n return y;\n }", "public static void main(String[] args) throws Exception {\n\t\t// double[] w = evolveWeights();\n\t\t// printWeights(w);\n\t\tdouble[] myweights = { -2.21466955153828, -0.07474857363573262, -1.1749783341411326, 0.16397829193498464,\n\t\t\t\t0.07131629649717008, 1.61328716208057, -2.641459977820003, -2.189110351161901, -0.20970779418672014,\n\t\t\t\t1.4439418468883647, -0.2184717560493591, -1.5078991641372075, -0.4975766167697391, -0.02410194533351991,\n\t\t\t\t-1.528121086508629, 0.4893670827264642, 0.24474596975099, -0.33381774735153213, -2.0197364115373686,\n\t\t\t\t-2.285127694998558, -1.6102939758132773, -1.5170275119464784, 2.839569745070095, -2.2196308724273552,\n\t\t\t\t-0.0212824892080149, 0.014455462339448166, -0.8294873147131405, -4.008294779402316, -1.6636632454217084,\n\t\t\t\t-1.9129203960517205, 0.25183900782052027, -3.9328447788262255, 1.7493959642027366, 0.4956568965253274,\n\t\t\t\t-0.07060668503545968, -1.0647141555175716, -2.5621340861527404, -0.5646708616200512,\n\t\t\t\t-3.3199764295441483, -0.7423376302286884, -2.0759415442240625, 1.8468059487043376, 1.8301868662020766,\n\t\t\t\t0.3265136721962445, 0.2963634372088102, -1.570986722570204, 0.030502603573360328, 1.4024108876313992,\n\t\t\t\t-0.14772072123156077, 1.4790013912446605, -0.19399829641453603, 0.025796871304820657,\n\t\t\t\t-1.7353744443081178, -0.7774882870945194, -0.8864079092655823, 0.01860475661039064,\n\t\t\t\t-0.38816929845666215, 5.433590999656766, -0.7039983033363961, 1.1052189890385327, -0.6337678641299205,\n\t\t\t\t2.577846157879395, -1.6954645339963452, -3.3151515029911014, -0.5905535947937579, -3.208862197909249,\n\t\t\t\t0.3533810265008289, -0.014479467387126133, -0.4997747691476975, 0.17895696721499255, 0.7889684353058366,\n\t\t\t\t0.6640692831578959, -1.7362432877961986, 2.4182626823702855, 1.2843792391756987, 1.9815093968825601,\n\t\t\t\t-0.30220651427285306, 0.7436105113169372, 1.0680163086014036, 1.7517072771957438, 1.2282614956016236,\n\t\t\t\t-4.1695808227962035, 0.5978930687432595, -1.5020444810097677, 1.2212439971243139, -3.2648411343496164,\n\t\t\t\t0.6909710728147561, -1.3070485527971965, -2.028589199427193, -1.2316367055137034, -1.1776549704837918,\n\t\t\t\t3.0932207527724955, 0.09163042597406289, 0.14951497594494684, 3.4362942167755, -0.5107751983055535,\n\t\t\t\t1.4777997649386783, -1.6160308476702507, -0.7331259806111848, 2.6279925296341906, -1.7722891199616801,\n\t\t\t\t-2.632229462809496, 0.44428581550083274, 1.6278865636527509, -0.0329347232073198, -2.918867540199039,\n\t\t\t\t0.9628195606239641, -2.156481296002708, -1.056790342242603, -2.2556629595171356, -0.9553204054731589,\n\t\t\t\t2.413880737785754, -0.9992245987211152, 0.9108199628723169, -1.134380039817171, -1.0116006672645148,\n\t\t\t\t-0.5854694644938652, -3.8446665938925046, 3.232988970599319, -0.05839122943338931, -0.12200406901238987,\n\t\t\t\t-1.1970864247655226, -1.7736651076674108, 3.2042060881784344, -0.06681900340608203, 0.6095617884784129,\n\t\t\t\t2.6621135698954426, -1.9808653269739094, 2.4179303951852247, -0.1020298670663256, 0.8455422105561868,\n\t\t\t\t-0.6172016676389036, 1.5106799954170962, 0.22045980127688758, -0.32315411146978057, 0.3521551186665719,\n\t\t\t\t-1.376041285561516, -0.5007424056636434, 1.361180226793381, 0.5485767449283305, 0.4822090152603501,\n\t\t\t\t0.0035720899920257954, 0.20198792489462591, 2.9637620623310696, 0.746515676821096, 1.33314607227669,\n\t\t\t\t1.7880569950236676, 0.24310824088346455, -0.7720019287108711, 0.2770938718675544, -0.002821079170251539,\n\t\t\t\t0.6432076089386127, -2.080883646553964, -2.2316867814270336, -0.8152503328954235, 0.07666991930368347,\n\t\t\t\t0.7994585307407924, 4.040588645491936, 3.293290177485252, -0.6587327188020271, -0.2608808875988929,\n\t\t\t\t0.9747677475984142, 2.398983410951306, -0.6437438305433649, 0.02124428359002813, 1.5585328640214078,\n\t\t\t\t-0.301679640295372, -1.6053388324773985, 0.24993532845039462, 0.24408970961912746, 2.425260721978244,\n\t\t\t\t-0.8068206244484942, 0.05105476442114232, 0.6059510612060248, -3.2193288600922187, -3.631848243294158,\n\t\t\t\t1.4240768232681529, -1.7707952765701727, 1.2344743497386608, 2.4338900468729023, 0.43014199440688067,\n\t\t\t\t0.20816791679939328, 1.4989715392344287, 0.13455171261820276, 1.0621048796860084, 0.9728863685939746,\n\t\t\t\t-3.9871305903296723, 0.6897219833391851, -1.098819235411824, -0.5984492289686463, -2.303924190561265,\n\t\t\t\t1.1193184751481047, -1.0328499504466768, -0.8910211970908617, 0.9946509861991504, -0.6898892448411882,\n\t\t\t\t-0.43356416305497014, 0.054783696872076626, 0.233434394673659, 3.225842335938765, 3.297560597443148,\n\t\t\t\t-0.9815414837749732, -1.5241431138614758, 0.2003787279485732, -0.6881136445150136, 3.4238717049813934,\n\t\t\t\t0.003453173792474847, -0.8061218778816472, -0.4402066310426072, -1.636723071030285, 3.163218840903199,\n\t\t\t\t0.5100537731772297, -1.103269998723354, -0.7879470972745664, -2.236992460857296, -2.1393375184180212,\n\t\t\t\t-1.1548394915305815, -2.280645418548106, 0.6909647906413796, -0.8314321184642959, -3.2122142779955563,\n\t\t\t\t0.37452253354430365, -0.7849739993770579, 0.3504279749557794, -1.0540725377016087, 0.041950910604904586,\n\t\t\t\t0.8784481358277388, -0.14974538330350365, 1.559727397979539, -0.6605219061003249, 3.622853835751025,\n\t\t\t\t1.7401420193245865, 1.220309981802207, -0.22257446946377682, -0.7746021595685124, -1.117421721755124,\n\t\t\t\t-0.9138705765688842, 0.14610649511784396, -0.7526008992175952, 0.10653763536360544,\n\t\t\t\t-0.06514332909119891, -0.2097381331142011, -1.0529132828316619, 2.1798628015621757, -0.3091083139673463,\n\t\t\t\t0.8577372690910885, 1.6985927086198869, 0.4634835727447051, 0.03566063568597455, -0.13895025188806187,\n\t\t\t\t0.8498827214996195, -0.9091546683669671, 1.3826935600107073, -0.8152255589205574, 1.7274291860876136,\n\t\t\t\t0.786497013333733, 1.6227793753957989, 0.7876476663994035, 2.157300684833067, -0.09447665526454312,\n\t\t\t\t-2.11514518468542, -1.089786880457046, -0.1570647222609598, 0.743643370603463, -0.4237412616449528,\n\t\t\t\t2.38254290787229, 5.305775057877128, 1.8737860414844345, -1.8325132176577972, 2.5427149426139777,\n\t\t\t\t0.6923303547353667, -1.1867898040888405, 2.584322135207721, 1.9779450607594122, -0.8178488064297246,\n\t\t\t\t1.9581575076866673, -0.2412475645390626, 1.2870350743909154, 0.2570224449276464, -4.092909749196866,\n\t\t\t\t3.898874605498058, -0.16220823886347796, 0.2634423746472414, -2.5921511819647276, -0.29329004951913773,\n\t\t\t\t-3.485083266813694, 3.5670785842138093, 0.7244265147251102, -0.0029356664095335516, 1.4901040035846655,\n\t\t\t\t2.8999162174147775 };\n\n\t\tController.doBattle(new ReflexAgent(), new NeuralAgent(myweights));\n\t\t// System.out.print(win_Collection[]);\n\t}", "public void adjustWeightsTest() {\n\t\tboolean[] tempCorrectArray = new boolean[numInstances()];\n\t\tfor (int i = 0; i < tempCorrectArray.length / 2; i++) {\n\t\t\ttempCorrectArray[i] = true;\n\t\t} // Of for i\n\n\t\tdouble tempWeightedError = 0.3;\n\n\t\tadjustWeights(tempCorrectArray, tempWeightedError);\n\n\t\tSystem.out.println(\"After adjusting\");\n\n\t\tSystem.out.println(toString());\n\t}", "public void updateNeighbors(Neuron BMU, ArrayList<Double> input, int t) {\n double radiusMap = this.width / 2;\n double lambda = this.nbIterations / radiusMap;\n\n // Calculation of the radius of influence.\n double radius = radiusMap * Math.exp(-t / lambda);\n\n int iMin = (BMU.getY() - radius) < 0 ? 0 : (int) (BMU.getY() - radius);\n int iMax = (BMU.getY() + radius) > this.width ? this.width : (int) (BMU.getY() + radius);\n int jMin = (BMU.getX() - radius) < 0 ? 0 : (int) (BMU.getX() - radius);\n int jMax = (BMU.getX() + radius) > this.width ? this.width : (int) (BMU.getX() + radius);\n\n // Set the new weights of neurons in proximity\n for (int i = iMin; i < iMax; i++) {\n for (int j = jMin; j < jMax; j++) {\n // Run over weights\n Neuron n = this.network[i][j];\n double Lt = this.learningRate * Math.exp(-t / lambda);\n\n double sumDist = this.euclideDistance(BMU.getWeights(), n.getWeights());\n\n double delta = sumDist / (2 * radius * radius);\n //double theta = Math.exp(-1 * (sumDist / (2 * Math.pow(radius, 2))));\n double theta = Math.exp(-delta);\n\n for (int k = 0; k < BMU.getSizeWeights(); k++) {\n\n double value = n.getWeightI(k) + theta * Lt * (input.get(k) - n.getWeightI(k));\n\n n.setWeightI(k, value);\n if (value > 1.0)\n System.out.println(\"error\");\n }\n }\n }\n }", "private void mergeUpdates(\n BSPPeer<LongWritable, FloatVectorWritable, NullWritable, NullWritable, ParameterMessage> peer)\n throws IOException {\n int numMessages = peer.getNumCurrentMessages();\n boolean converge = false;\n if (numMessages == 0) { // converges\n converge = true;\n return;\n }\n\n double avgTrainingError = 0;\n FloatMatrix[] matricesUpdates = null;\n FloatMatrix[] prevMatricesUpdates = null;\n\n while (peer.getNumCurrentMessages() > 0) {\n ParameterMessage message = peer.getCurrentMessage();\n if (matricesUpdates == null) {\n matricesUpdates = message.getCurMatrices();\n prevMatricesUpdates = message.getPrevMatrices();\n } else {\n RecurrentLayeredNeuralNetwork.matricesAdd(matricesUpdates,\n message.getCurMatrices());\n RecurrentLayeredNeuralNetwork.matricesAdd(prevMatricesUpdates,\n message.getPrevMatrices());\n }\n\n avgTrainingError += message.getTrainingError();\n }\n\n if (numMessages > 1) {\n avgTrainingError /= numMessages;\n for (int i = 0; i < matricesUpdates.length; ++i) {\n matricesUpdates[i] = matricesUpdates[i].divide(numMessages);\n prevMatricesUpdates[i] = prevMatricesUpdates[i].divide(numMessages);\n }\n }\n\n this.inMemoryModel.updateWeightMatrices(matricesUpdates);\n this.inMemoryModel.setPrevWeightMatrices(prevMatricesUpdates);\n\n // check convergence\n if (peer.getSuperstepCount() > 0\n && iterations % convergenceCheckInterval == 0) {\n if (prevAvgTrainingError < curAvgTrainingError) {\n // error cannot decrease any more\n converge = true;\n }\n // update\n prevAvgTrainingError = curAvgTrainingError;\n LOG.info(\"Training error: \" + curAvgTrainingError + \" at \" + (iterations)\n + \" iteration.\");\n curAvgTrainingError = 0;\n }\n curAvgTrainingError += avgTrainingError / convergenceCheckInterval;\n this.isConverge = converge;\n\n if (iterations < maxIterations) {\n // broadcast updated weight matrices\n for (String peerName : peer.getAllPeerNames()) {\n ParameterMessage msg = new ParameterMessage(0, converge,\n this.inMemoryModel.getWeightMatrices(),\n this.inMemoryModel.getPrevMatricesUpdates());\n if (!peer.getPeerName().equals(peerName))\n peer.send(peerName, msg);\n }\n }\n }", "public static void main(String[] args) throws IOException {\n Date date = Calendar.getInstance().getTime();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH.mm.ss\");\n String strDate = dateFormat.format(date);\n String pathString = \"C:/Users/Akshay/Desktop/RL LUT Values/Neural Net Outputs/\"+strDate+\"/\";\n File dir = new File(pathString);\n dir.mkdirs();\n\n String pathStringWeights = pathString+\"Final Weights/\";\n File dirWeights = new File(pathStringWeights);\n dirWeights.mkdirs();\n\n\n //Declare All Variables\n double[][][][][][] LUT = new double[6][4][4][4][4][8];\n\n //Read Input LUT\n String pathToLut = \"C:/Users/Akshay/Desktop/RL LUT Values/Battle 3.txt\";\n loadLutToArray(LUT, pathToLut);\n\n //Initialize Neural Net\n int numInputNeurons = 13; //5 State Variables and 8 for Action with 1 hot Encoding\n int numHiddenNeurons = 20;\n int numOutputNeurons = 1;\n\n double learningRate = 0.01;\n double momentum = 0.5;\n\n double argA = 0;\n double argB = 0;\n\n int t = 1;\n String activation = \"\";\n switch (t) {\n case 1:\n activation = \"Bipolar Sigmoid\";\n break;\n case 2:\n activation = \"Tan Hyperbolic\";\n break;\n default:\n activation = \"Sigmoid\";\n }\n\n double E = 0;\n\n NeuralNet nn1 = new NeuralNet(numInputNeurons, numHiddenNeurons, numOutputNeurons, learningRate, momentum, argA, argB);\n nn1.initWeights(-0.5, 0.5);\n\n //Track Epoch using k\n int k = 0;\n String s = \"Activation = \"+activation+\"\\nLearning Rate = \"+learningRate+\"\\nMomentum = \"+momentum+\"\\nHidden Neurons = \"+numHiddenNeurons;\n\n while(true){\n k++;\n\n if(k>10000){\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }\n\n //Start Loop Across LUT\n for(int d = 0; d < 6; d++){\n double di = absScale(d,0,5,-0.8,0.8);\n for(int men = 0; men < 4; men++){\n double meni = absScale(men,0,3,-0.8,0.8);\n for(int een = 0; een < 4; een++){\n double eeni = absScale(een,0,3,-0.8,0.8);\n for(int ex = 0; ex < 4; ex++){\n double exi = absScale(ex,0,3,-0.8,0.8);\n for(int yi = 0; yi < 4; yi++){\n double yii = absScale(yi,0,3,-0.8,0.8);\n for(int act = 0; act < 8; act++){\n //Each action needs to be 1 hot encoded\n double x[] = new double[13];\n switch(act){\n case 0: x = new double[] {di,meni,eeni,exi,yii,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 1: x = new double[] {di,meni,eeni,exi,yii,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 2: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 3: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8,-0.8};\n break;\n case 4: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8,-0.8};\n break;\n case 5: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8,-0.8};\n break;\n case 6: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8,-0.8};\n break;\n case 7: x = new double[] {di,meni,eeni,exi,yii,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,-0.8,0.8};\n break;\n }\n\n //Defining Training Output For ErrorBackPropagation\n double y[] = {absScale(LUT[d][men][een][ex][yi][act],-1000,1000,-0.8,0.8)};\n\n //Error Back Propagation\n nn1.propagateForward(x,t);\n nn1.propagateBackwardOutput(y,t);\n nn1.weightUpdateOutput(learningRate,momentum);\n nn1.propagateBackwardHidden(t);\n nn1.weightUpdateHidden(learningRate,momentum,x);\n\n E = E + Math.pow((nn1.finalOutput[0] - y[0]),2);\n }\n }\n }\n }\n }\n }\n //RMS Error This Time. Not Total Error\n E = Math.sqrt(E/(12288));\n //Perfect Condition Stuff\n /*if(E<=0.05){\n //System.out.println(\"Trial Number: \"+loop+\" Converged at Epoch \"+k);\n String identifier = k+\".\";\n nn1.saveWeights(pathStringWeights,identifier);\n break;\n }*/\n\n //End of Epoch Code Goes Here\n String cmdOp = \"Epoch \"+k+\", Error = \"+E;\n System.out.println(cmdOp);\n\n s = s + \"\\n\" + k + \" \" + E;\n writeToFile(pathString+\"Stats.txt\",s);\n E = 0;\n }\n }", "public void trainWeights(int numEpochs, int player, int winner) {\n // Will be using the boardStates member which has already encoded the\n // boards on the path to the endgame.\n // The board states must now be fit to a reinforcement learning curve.\n double[][] trainingOutput = new double[stateCount][1]; // this is the total output (useful if using an ANN).\n double nn_i_succ = 0.0;\n double nn_i = 0.0;\n\n //REALLY IMPORTANT: Training is from the perspective of the black player, so if black lost, training will\n //use negative values. If black won, it will be trained with positive values. This must be kept in mind\n //when querying the features for values!\n\n //every other value depends on this one.\n for (int i=stateCount-1; i>=0; i--) {\n //for convenience get the value of the nn at boardStates[i] and boardStates[i+1]\n if (i == stateCount-1) {\n if (winner == LOABoard.PLAYER_BLACK)\n nn_i_succ = 1;\n else if (winner == LOABoard.PLAYER_WHITE)\n nn_i_succ = -1;\n else // Draw\n nn_i_succ = 0;\n } else {\n nn_i_succ = DISCOUNT_FACTOR * nn_i;\n }\n\n nn_i = 0;\n for ( int j = 0; j < numberOfWeights; j++ )\n nn_i += boardStates[i][j] * weights[j];\n\n trainingOutput[i][0] = nn_i + LEARNING_RATE*(nn_i_succ-nn_i);\n\n for (int j=0; j< numberOfWeights; j++) {//each epoch involves training on every board state in the game\n weights[j] = weights[j] + LEARNING_RATE*(nn_i_succ-nn_i)*boardStates[i][j];\n }//for j\n }//for i\n\n ////begin debug\n//\t System.out.println(\"Debug Message: Displaying array trainingOutput (after fit to TD learning curve) \" + stateCount);\n//\t for (int debug =0; debug < trainingOutput.length; debug++) {\n//\t\tSystem.out.println(trainingOutput[debug][0]);\n// }\n ////done debug\n\n System.out.println(\"Debug Message: Displaying weights array after update.\");\n for (int i = 0; i < numberOfWeights; i++) {\n System.out.println(weights[i]);\n }\n\n System.out.println(\"Info Message: Done training weights on results from game.\");\n }", "private void train(float[] inputs, int desired) {\r\n int guess = feedforward(inputs);\r\n float error = desired - guess;\r\n for (int i = 0; i < weights.length; i++) {\r\n weights[i] += c * error * inputs[i];\r\n }\r\n }", "public double loss() {\n double L,l;\n if (weightStrategy != 2) {\n\n L = reg * (U.squaredSum() + V.squaredSum());\n for (int u = 0; u < userCount; u++) {\n l = 0;\n for (int i : trainMatrix.getRowRef(u).indexList()) {\n double pred = predict(u, i);\n l += W.getValue(u, i) * Math.pow(trainMatrix.getValue(u, i) - pred, 2);\n l -= getNegWeight(i) * Math.pow(pred, 2);\n }\n l += SV.mult(U.row(u, false)).inner(U.row(u, false));\n L += l;\n }\n\n return L;\n }\n else {\n L = reg * (U.squaredSum() + V.squaredSum());\n for (int i = 0; i < itemCount; i++) {\n l = 0;\n for (int u : trainMatrix.getColRef(i).indexList()) {\n double pred = predict(u, i);\n l += W.getValue(u, i) * Math.pow(trainMatrix.getValue(u, i) - pred, 2);\n l -= getNegWeight(u) * Math.pow(pred, 2);\n }\n l += SU.mult(V.row(i, false)).inner(V.row(i, false));\n L += l;\n }\n\n return L;\n }\n }", "public static double validate(Network validationNetwork, int start, int end, boolean printResult){\n double ETotal=0;\n String results=\"\";\n for (int i = start; i < end; i++) {\n ArrayList<Double> outputs = validationNetwork.runNetwork(data.getFeatures().get(i));\n //print outputs\n int output= outputs.indexOf(Collections.max(outputs))+1;\n results+= output+\", \";\n\n int target = data.getTargets().get(i);\n double[] targetlist = new double[7];\n targetlist[target - 1] = 1;\n double[] errorlist = new double[7];\n double totalerror = 0;\n for (int j = 0; j < 7; j++) {\n double outputvalue = outputs.get(j);\n double error = targetlist[j] - outputvalue;\n totalerror += error * error;\n\n }\n //Update weights of network\n ETotal += totalerror / 7;\n //MSElist.add(totalerror / 7);\n }\n if (printResult)\n System.out.println(results);\n\n return ETotal / (end-start);\n\n\n\n }", "public abstract void recalcNormalizationExtrema();", "public double[] runOptimizer() {\n List<Integer> sents = new ArrayList<Integer>();\n for(int i=0; i<sentNum; i++)\n sents.add(i);\n \n if(needShuffle)\n Collections.shuffle(sents);\n \n double oraMetric, oraScore, predMetric, predScore;\n double[] oraPredScore = new double[4];\n double eta = 1.0; //learning rate, will not be changed if run percep\n double avgEta = 0; //average eta, just for analysis\n double loss = 0;\n double featNorm = 0;\n double featDiffVal;\n double sumMetricScore = 0;\n double sumModelScore = 0;\n String oraFeat = \"\";\n String predFeat = \"\";\n String[] oraPredFeat = new String[2];\n String[] vecOraFeat;\n String[] vecPredFeat;\n String[] featInfo;\n boolean first = true;\n //int processedSent = 0;\n Iterator it;\n Integer diffFeatId;\n double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required\n for(int i=0; i<initialLambda.length; i++)\n avgLambda[i] = 0.0;\n\n //update weights\n for(Integer s : sents) {\n //find out oracle and prediction\n if(first)\n findOraPred(s, oraPredScore, oraPredFeat, initialLambda, featScale);\n else\n findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);\n \n //the model scores here are already scaled in findOraPred\n oraMetric = oraPredScore[0];\n oraScore = oraPredScore[1];\n predMetric = oraPredScore[2];\n predScore = oraPredScore[3];\n oraFeat = oraPredFeat[0];\n predFeat = oraPredFeat[1];\n \n //update the scale\n if(needScale) { //otherwise featscale remains 1.0\n sumMetricScore += java.lang.Math.abs(oraMetric+predMetric);\n sumModelScore += java.lang.Math.abs(oraScore+predScore)/featScale; //restore the original model score\n \n if(sumModelScore/sumMetricScore > scoreRatio)\n featScale = sumMetricScore/sumModelScore;\n\n /* a different scaling strategy \n if( (1.0*processedSent/sentNum) < sentForScale ) { //still need to scale\n double newFeatScale = java.lang.Math.abs(scoreRatio*sumMetricDiff / sumModelDiff); //to make sure modelScore*featScale/metricScore = scoreRatio\n \n //update the scale only when difference is significant\n if( java.lang.Math.abs(newFeatScale-featScale)/featScale > 0.2 )\n featScale = newFeatScale;\n }*/\n }\n// processedSent++;\n\n HashMap<Integer, Double> allOraFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> allPredFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();\n\n vecOraFeat = oraFeat.split(\"\\\\s+\");\n vecPredFeat = predFeat.split(\"\\\\s+\");\n \n for (int i = 0; i < vecOraFeat.length; i++) {\n featInfo = vecOraFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allOraFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));\n }\n\n for (int i = 0; i < vecPredFeat.length; i++) {\n featInfo = vecPredFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allPredFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n\n if (featDiff.containsKey(diffFeatId)) //overlapping features\n featDiff.put(diffFeatId, featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]));\n else //features only firing in the 2nd feature vector\n featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));\n }\n\n if(!runPercep) { //otherwise eta=1.0\n featNorm = 0;\n\n Collection<Double> allDiff = featDiff.values();\n for(it =allDiff.iterator(); it.hasNext();) {\n featDiffVal = (Double) it.next();\n featNorm += featDiffVal*featDiffVal;\n }\n \n //a few sanity checks\n if(! evalMetric.getToBeMinimized()) {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score+ora_metric > pred_score+pred_metric\n * pred_score-pred_metric > ora_score-ora_metric\n * => ora_metric > pred_metric */\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be greater than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for max-metric oracle selection or min-metric prediction selection, the oracle metric \" +\n \t\t\"score must be greater than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n } else {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score-ora_metric > pred_score-pred_metric\n * pred_score+pred_metric > ora_score+ora_metric\n * => ora_metric < pred_metric */\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be smaller than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for min-metric oracle selection or max-metric prediction selection, the oracle metric \" +\n \"score must be smaller than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n }\n \n if(predSelectMode==2) {\n if(predScore+1e-10 < oraScore) {\n System.err.println(\"WARNING: for max-model prediction selection, the prediction model score must be greater than oracle model score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n //cost - margin\n //remember the model scores here are already scaled\n loss = evalMetric.getToBeMinimized() ? //cost should always be non-negative \n (predMetric-oraMetric) - (oraScore-predScore)/featScale: \n (oraMetric-predMetric) - (oraScore-predScore)/featScale;\n \n if(loss<0)\n loss = 0;\n\n if(loss == 0)\n eta = 0;\n else\n //eta = C < loss/(featNorm*featScale*featScale) ? C : loss/(featNorm*featScale*featScale); //feat vector not scaled before\n eta = C < loss/(featNorm) ? C : loss/(featNorm); //feat vector not scaled before\n }\n \n avgEta += eta;\n\n Set<Integer> diffFeatSet = featDiff.keySet();\n it = diffFeatSet.iterator();\n\n if(first) {\n first = false;\n \n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = initialLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n else {\n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = finalLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n \n if(needAvg) {\n for(int i=0; i<avgLambda.length; i++)\n avgLambda[i] += finalLambda[i];\n }\n }\n \n if(needAvg) {\n for(int i=0; i<finalLambda.length; i++)\n finalLambda[i] = avgLambda[i]/sentNum;\n }\n \n avgEta /= sentNum;\n System.out.println(\"Average learning rate: \"+avgEta);\n\n // the intitialLambda & finalLambda are all trainable parameters\n //if (!trainMode.equals(\"3\")) // for mode 3, no need to normalize sparse\n // feature weights\n //normalizeLambda(finalLambda);\n //else\n //normalizeLambda_mode3(finalLambda);\n\n /*\n * for( int i=0; i<finalLambda.length; i++ ) System.out.print(finalLambda[i]+\" \");\n * System.out.println(); System.exit(0);\n */ \n\n double initMetricScore = computeCorpusMetricScore(initialLambda); // compute the initial corpus-level metric score\n double finalMetricScore = computeCorpusMetricScore(finalLambda); // compute final corpus-level metric score // the\n\n // prepare the printing info\n int numParamToPrint = 0;\n String result = \"\";\n\n if (trainMode.equals(\"1\") || trainMode.equals(\"4\")) {\n numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters\n // to print\n result = paramDim > 10 ? \"Final lambda(first 10): {\" : \"Final lambda: {\";\n\n for (int i = 1; i < numParamToPrint; i++)\n // in ZMERT finalLambda[0] is not used\n result += finalLambda[i] + \" \";\n } else {\n int sparseNumToPrint = 0;\n if (trainMode.equals(\"2\")) {\n result = \"Final lambda(regular feats + first 5 sparse feats): {\";\n for (int i = 1; i <= regParamDim; ++i)\n result += finalLambda[i] + \" \";\n\n result += \"||| \";\n\n sparseNumToPrint = 5 < (paramDim - regParamDim) ? 5 : (paramDim - regParamDim);\n\n for (int i = 1; i <= sparseNumToPrint; i++)\n result += finalLambda[regParamDim + i] + \" \";\n } else {\n result = \"Final lambda(first 10 sparse feats): {\";\n sparseNumToPrint = 10 < paramDim ? 10 : paramDim;\n\n for (int i = 1; i < sparseNumToPrint; i++)\n result += finalLambda[i] + \" \";\n }\n }\n\n output.add(result + finalLambda[numParamToPrint] + \"}\\n\" + \"Initial \"\n + evalMetric.get_metricName() + \": \" + initMetricScore + \"\\nFinal \"\n + evalMetric.get_metricName() + \": \" + finalMetricScore);\n\n // System.out.println(output);\n\n if (trainMode.equals(\"3\")) {\n // finalLambda = baseline(unchanged)+disc\n for (int i = 0; i < paramDim; i++)\n copyLambda[i + regParamDim + 1] = finalLambda[i];\n\n finalLambda = copyLambda;\n }\n\n return finalLambda;\n }", "public double getFreeEnergy(){\n\n\t\tdouble freeEnergy = 0.;\n\n\t\tfor(int i = 0; i < this.layers[0].length; i++){\n\t\t\tfreeEnergy -= this.layers[0][i].getState()*this.layers[0][i].getBias();\n\t\t}\n\n\n\t\tfor(int j = 0; j < this.layers[1].length; j++){\n\t\t\tdouble x = this.layers[1][j].getBias();\n\t\t\t//System.out.println(\"x = \" + x);\n\t\t\tfor(int i = 0; i < this.layers[0].length; i++){\n\t\t\t\tx += this.layers[0][i].getState()*this.connections[i][j];\n\t\t\t\t/*System.out.println(\"1 = \" + this.layers[0][i].getState());\n\t\t\t\tSystem.out.println(\"2 = \" + this.connections[i][j]);\n\t\t\t\tSystem.out.println(\"x = \" + x);\n\t\t\t\tif(x != x){ this.layers[3] = null;}*/\n\t\t\t}\n\t\t\t//System.out.println(\"x = \" + x);\n\t\t\tfreeEnergy -= Math.log(1 + Math.exp(x));\n\t\t}\n\n\t\t/*\n\t\tfor(int j = 0; j < this.layers[1].length; j++){\n\t\t\tdouble x = this.layers[1][j].getBias();\n\t\t\tfor(int i = 0; i < this.layers[0].length; i++){\n\t\t\t\tx += this.layers[0][i].getState()*this.connections[i][j];\n\t\t\t}\n\t\t\tfreeEnergy -= x*Sigmoid.getINSTANCE().apply(x);\n\t\t}\n\n\t\tfor(int j = 0; j < this.layers[1].length; j++){\n\t\t\tdouble x = this.layers[1][j].getBias();\n\t\t\tfor(int i = 0; i < this.layers[0].length; i++){\n\t\t\t\tx += this.layers[0][i].getState()*this.connections[i][j];\n\t\t\t}\n\t\t\tdouble p = Sigmoid.getINSTANCE().apply(x);\n\t\t\tfreeEnergy += p*Math.log10(p) + (1. - p)*Math.log10(1. - p);\n\t\t}\n\t\t */\n\n\t\treturn freeEnergy;\n\t}", "public void updateWeights() {\n\t\t\n\t}", "private void learnStep(){\n Connection[][][] temp = this.connections;\r\n for(int trialIndex = 0; trialIndex< inputList.length; trialIndex++) {\r\n for (int layerIndex = 0; layerIndex < connections.length; layerIndex++) {\r\n for (int startIndex = 0; startIndex < connections[layerIndex].length; startIndex++) {\r\n for (int endIndex = 0; endIndex < connections[layerIndex][startIndex].length; endIndex++) {\r\n double weightDerivative = 0.0;\r\n double biasDerivative = 0.0;\r\n weightDerivative += learningRate* derivativeWeight(layerIndex, startIndex, endIndex, trialIndex);\r\n biasDerivative += learningRate * derivativeBias(layerIndex, startIndex, endIndex, trialIndex);\r\n double currentWeight = temp[layerIndex][startIndex][endIndex].getWeight();\r\n double currentBias = temp[layerIndex][startIndex][endIndex].getBias();\r\n temp[layerIndex][startIndex][endIndex] = new Connection(currentWeight - weightDerivative, currentBias - biasDerivative);\r\n\r\n }\r\n }\r\n }\r\n this.run();\r\n }\r\n this.connections = temp;\r\n }", "protected void findWeights( double learning_rate, int iterations )\n\t{\n\t\tdouble sum, error, o, delta;\n\t\tint n = this.class_data.attribute_data.size();\n\t\tAttribute temp;\n\n\t\tfor ( int i = 0; i < iterations; i++ )\n\t\t{\n\t\t\tsum = 0;\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t{\n\t\t\t\ttemp = this.attribute_list.get( j );\n\t\t\t\tsum += temp.attribute_data.get( i % n ) * temp.getWeigth();\t\t//Sum of wi * xi\n\t\t\t}\n\n\t\t\to = getSigmoidValue( sum );\t\t\t\t\t\t\t\t\t\t//Get the value from sigmoid function\n\t\t\terror = this.class_data.attribute_data.get( i % n ) - o;\t\t//Find out the error\n\t\t\tdelta = learning_rate * error * o * (1.0 - o);\t\t\t\t\t//Delta w\n\n\t\t\tfor ( int j = 0; j < this.attribute_list.size(); j++ )\n\t\t\t\tthis.attribute_list.get( j ).incrementWeigth( delta, i % n );\t\t//Update weights\n\t\t}\n\t}", "@Override\n\tpublic double computeOutput(double[][] inputs) {\n\t\t// sum weighted inputs\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < inputs[0].length; i++) {\n\t\t\tsum += (inputs[0][i] * inputs[1][i]);\n\t\t}\n\t\treturn sum;\n\t}", "private void updateMNetwork() {\n\t\t/*\n\t\t Having applied the network inputs, update the brain simulation.\n\t\t */\n\t\tmsimulation.step();\n\t}", "@Override\r\n\tpublic DataContainer backProp(DataContainer backPropError, double learningRate) {\n\t\tif (lastInputBiased == null) {\r\n\t\t\tthrow new RuntimeException(\"Invalid operation\"); \r\n\t\t}\r\n\t\tMat error = backPropError.getVec(); \r\n\t\t\r\n\t\tMat dW = lastInputBiased.T().mul(error).scale(learningRate); \r\n\t\t\r\n\t\tMat temp = error.mul(inputWeight.T()); \r\n Mat output = new Mat(temp.size[0], temp.size[1] - 1); \r\n for (int i = 0; i < output.size[1]; i++) {\r\n \toutput.matrix[0][i] = temp.matrix[0][i]; \r\n }\r\n \r\n\t\tinputWeight = inputWeight.add(dW); \r\n\t\t\r\n\t\treturn new DataContainer(output); \r\n\t}", "public void backpropagate (FlatLayer flat){\n\t\tDouble [] err = flat.getErrors();\n\t\tDouble [][] weights = flat.getOldWeights();\n\t\tDouble sum;\n\t\tint index;\n\n\t\tfor ( int i = 0; i < poolMaps.size() ; i++){\n\n\t\t\tPoolMap pmap = poolMaps.get(i);\n\n\t\t\tDouble [][] error = pmap.getErrors();\n\n\t\t\tfor(int row = 0; row < error.length; row++){\n\t\t\t\tfor(int col = 0; col < error[0].length; col++){\n\t\t\t\t\t\n\t\t\t\t\tsum = 0.0;\n\t\t\t\t\t\n\t\t\t\t\tfor(int j = 0; j < weights.length; j++){\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex = i * error.length * error[0].length + row * error.length + col;\n\t\t\t\t\t\tsum += weights[j][index]*err[j];\n\n\t\t\t\t\t}\n\t\t\t\t\terror[row][col] = sum;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "private void trainOnSamples() {\n for (Sample sample : samples) {\n double sum = 0;\n \n for (int i = 0; i < weights.length; i++) { //calculating w1.x1 + w2.x2 + ... \n sum += weights[i] * sample.getP()[i];\n }\n sum += bias; //adding bias to the sum\n\n if (!compareOutput(sum, sample)) { //compare network & target output\n //updating the weights\n for (int i = 0; i < weights.length; i++) {\n weights[i] += sample.getTarget() * sample.getP()[i];\n }\n //updating the bias\n bias += sample.getTarget();\n sample.setValidation(false);\n } else {\n sample.setValidation(true);\n }\n }\n }", "public FCMResult getSingleResult(double [] input)throws Exception{\n if (this.adjacencyMatrix.length != input.length) {\n throw new Exception(\"the length of the input array does not match with the length of the adjascent matrix\");\n }\n boolean check = true;\n double [] temp = input;//copy the value of the input in another data so that the variable scope will not be messed with.\n double [] init = new double[input.length];\n //include the whhile loop with the condition here\n int iterationCount=0;\n do { \n for (int i = 0; i < temp.length; i++) {//update each of the activation value inthe emp variable and test for the \n for (int j = 0; j < adjacencyMatrix[i].length; j++) {\n if (i==j) {\n continue;\n }\n init[j] +=temp[j] * adjacencyMatrix[i][j];//update the state of the input\n }\n }\n // add the value \n double [] previous = temp.clone();\n for (int i = 0; i < init.length; i++) {\n temp[i] = activationFunction(temp[i] + init[i]);\n }\n double check1 = getAbsoluteAverage(previous);\n double check2 = getAbsoluteAverage(temp) ;\n check = Math.abs(check1 - check2)> error;\n iterationCount++;\n } while (check);\n return evaluateResult(temp,iterationCount);\n //evaluate the result when you get here.\n }", "public void train(int n_epochs) {\n TrainModel train_model = null;\n\n int lenW = vocabulary.length;\n int W = 3 * lenW + 3;\n\n // randomly initialize U_Ot, values are randomly selected between -0.1 to 0.1;\n double[][] U_Ot = new double[D][W];\n\n // randomly initialize U_R, values are randomly selected between -0.1 and 0.1\n double[][] U_R = new double[D][W];\n\n double prev_err = 0D;\n for (int epoch = 0; epoch < n_epochs; epoch++) {\n double total_error = 0D;\n int n_wrong = 0;\n\n for (int i = 0; i < train_lines.size(); i++) {\n Instance line = train_lines.get(i);\n if (\"q\".equals(line.type)) { // indicates question\n List<Integer> refs = line.refs; // Indexing from 1\n List<Integer> f = refs.stream()\n .map(ref -> ref-1)\n .collect(Collectors.toList()); // Indexing from 0\n int id = line.ID - 1; // Indexing from 0\n\n // all indices from\n List<Integer> indices = range(i-id, i+1);\n List<double[]> memory_list = indices.stream()\n .map(idx -> L_train[idx])\n .collect(Collectors.toList());\n\n\n if (train_model == null) {\n train_model = new TrainModel(lenW, f.size());\n }\n\n List<Integer> m = f;\n // TODO\n List<Integer> mm = new ArrayList<>(); //TODO\n for (int j = 0; j < f.size(); j++) {\n mm.add(O_t(\n newM,\n memory_list\n ));\n }\n\n double err = train_model(H.get(\"answer\"),\n gamma, memory_list, V, id, ???)[0];\n total_error += err;\n System.out.println(\"epoch: \" + epoch + \"\\terr: \" + (total_error / train_lines.size()));\n }\n }\n }\n }", "public double activationDerivative(double z);", "private static double evaluate_dev(int count, int t) {\n double[][] tmp_featweights = new double[Features.num_feat][600000];\n double[][] tmp_best_avg_featVal = new double[Features.num_feat][600000];\n double[][] tmp_sum_featVal = new double[Features.num_feat][600000];\n double[][] tmp_changes_featVal = new double[Features.num_feat][600000];\n for (int ii = 0; ii < Features.num_feat; ii++) {\n tmp_featweights[ii] = Arrays.copyOf(Features.featweights[ii], Features.featweights[ii].length);\n tmp_best_avg_featVal[ii] = Arrays.copyOf(Features.best_avg_featVal[ii], Features.best_avg_featVal[ii].length);\n tmp_sum_featVal[ii] = Arrays.copyOf(Features.sum_featVal[ii], Features.sum_featVal[ii].length);\n tmp_changes_featVal[ii] = Arrays.copyOf(Features.changes_featVal[ii], Features.changes_featVal[ii].length);\n }\n double[][] tmp_a = new double[Features.m][Features.m];\n double[][] tmp_best_avg_a = new double[Features.m][Features.m];\n double[][] tmp_sum_a = new double[Features.m][Features.m];\n double[][] tmp_changes_a = new double[Features.m][Features.m];\n for (int ii = 0; ii < Features.m; ii++) {\n tmp_a[ii] = Arrays.copyOf(Features.a[ii], Features.a[ii].length);\n tmp_best_avg_a[ii] = Arrays.copyOf(Features.best_avg_a[ii], Features.best_avg_a[ii].length);\n tmp_sum_a[ii] = Arrays.copyOf(Features.sum_a[ii], Features.sum_a[ii].length);\n tmp_changes_a[ii] = Arrays.copyOf(Features.changes_a[ii], Features.changes_a[ii].length);\n }\n // final average\n Features.final_average(count);\n try {\n BufferedReader test_file = new BufferedReader(new FileReader(dev_file));\n String sentence = \"\";\n String line = null;\n while ((line=test_file.readLine()) != null) {\n if (line.isEmpty()) {\n Features.viterbi(\"<s> \"+sentence.substring(0,sentence.length()-1)+\" </s>\", true, mdl_path+\"/dev_output_\"+ (t+1), avg_flag);\n sentence = \"\";\n } else {\n sentence += line.substring(0,line.indexOf(\"\\t\")) + \" \";\n }\n }\n test_file.close();\n }\n catch(Exception ex){\n ex.printStackTrace();\n }\n double dev_acc = tagging_accuracy(dev_file, mdl_path+\"/dev_output_\"+ (t+1));\n if (dev_acc > best_acc_so_far) {\n Features.bestiter_a = Features.a;\n Features.bestiter_featweights = Features.featweights;\n Features.bestiter_avg_a = Features.best_avg_a;\n Features.bestiter_avg_featVal = Features.best_avg_featVal;\n }\n // restore before evaluation values\n Features.featweights = tmp_featweights;\n Features.best_avg_featVal = tmp_best_avg_featVal;\n Features.sum_featVal = tmp_sum_featVal;\n Features.changes_featVal = tmp_changes_featVal;\n Features.a = tmp_a;\n Features.best_avg_a = tmp_best_avg_a;\n Features.sum_a = tmp_sum_a;\n Features.changes_a = tmp_changes_a;\n return dev_acc;\n }", "public double calculateOutputForInstance(Instance inst)\r\n\t{\r\n\t\tint k =0;\r\n\t\tfor(Node input_temp: inputNodes)\r\n\t\t{\r\n\t\t\tif(input_temp.getType()==0)\r\n\t\t\t{\r\n\t\t\t\tinput_temp.setInput(inst.attributes.get(k));\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t\t// set output\r\n\t\tfor(Node hidden_temp: hiddenNodes)\r\n\t\t{\r\n\t\t\thidden_temp.calculateOutput();\r\n\t\t}\r\n\r\n\t\toutputNode.calculateOutput();\r\n\t\t\r\n\t\treturn outputNode.getOutput();\r\n\r\n\t}", "void update(int bit) \n {\n this.idx = 0;\n int err = (bit<<12) - this.pr;\n\n if (err == 0)\n return; \n \n err = (err << 3) - err;\n\n // Train Neural Network: update weights\n this.buffer[this.ctx+8] += ((this.buffer[this.ctx] *err + 0) >> 16); \n this.buffer[this.ctx+9] += ((this.buffer[this.ctx+1]*err + 0) >> 16); \n this.buffer[this.ctx+10] += ((this.buffer[this.ctx+2]*err + 0) >> 16); \n this.buffer[this.ctx+11] += ((this.buffer[this.ctx+3]*err + 0) >> 16); \n this.buffer[this.ctx+12] += ((this.buffer[this.ctx+4]*err + 0) >> 16); \n this.buffer[this.ctx+13] += ((this.buffer[this.ctx+5]*err + 0) >> 16); \n this.buffer[this.ctx+14] += ((this.buffer[this.ctx+6]*err + 0) >> 16); \n this.buffer[this.ctx+15] += ((this.buffer[this.ctx+7]*err + 0) >> 16); \n }", "public static void perceptronB(List<double[]> wektoryTrenujace,\n double[] w, double[] d, double c){\n\n double[] result = new double[4];\n double[] sumOfWec = new double[4];\n boolean repeat;\n\n //y1\n int iteracje = 0;\n do {\n Arrays.fill(sumOfWec, 0.0);\n repeat = false;\n iteracje++;\n System.out.println(\"Iteracja: \" + iteracje);\n for (int i=0; i< wektoryTrenujace.size();i++){\n result[i] = vectorSign(sigmFunc(matrixMult(wektoryTrenujace.get(i),w)),d[i]);\n sumOfWec = matrixAdd(sumOfWec, matrixMult(result[i],wektoryTrenujace.get(i)));\n if (result[i] != 0){\n System.out.println(\"Wektor trenujacy x\" + (i+1) + \" zostal zle rozpoznany przez wage \" + Print(w));\n repeat = true;\n }\n\n }\n w = matrixAdd(w,matrixMult(c,sumOfWec));\n System.out.println(\"Nowa waga: \" + Print(w) + \"\\n\");\n if (iteracje> 40)\n {\n System.out.println(\"Wagi nie stabilizują się po 40 iteracjach.\");\n return;\n }\n } while (repeat);\n\n System.out.println(\"Wagi ustabilizowaly sie po \" + iteracje + \" iteracji/ach.\\nWaga wynosi \" + Print(w));\n\n\n\n }", "public void updateVelocity() {\n \t// Step 1: input power and convert the power to a force based on the starting velocity\n \tsetWeight();\n \tdouble trainMass = trainWeight*KG_PER_POUND;\n \t\n \t// this is ensuring that we never get a negative speed\n \tif (this.currentSpeed == 0) {\n \t\tthis.force = (this.powerIn)/1;\n \t} else {\n \t\tthis.force = (this.powerIn)/this.currentSpeed;\n \t}\n \tsetGrade();\n \t\n \t// Step 2: Calculate the slope of the train's current angle (Degrees = Tan-1 (Slope Percent/100))\n \tthis.slope = Math.atan2(this.grade,100);\n \tdouble angle = Math.toDegrees(this.slope);\n \t\n \t// Step 3: Calculate the forces acting on the train using the coefficient of friction\n \t// and the train's weight in lbs converted to kg divided over the wheels (where the force is technically\n \t// being applied times gravity (G)\n \tthis.normalForce = (trainMass/this.trainWheels) * G * Math.sin((angle*Math.PI)/180);\t// divide by 12 for the number of wheels\n \tthis.downwardForce = (trainMass/this.trainWheels) * G * Math.cos((angle*Math.PI)/180);\t// divide by 12 for the number of wheels\n\n \t// compute friction force\n \tthis.friction = (FRICTION_COEFFICIENT * this.downwardForce) + this.normalForce;\n \t\n \t// sum of the forces\n \tthis.totalForce = this.force - this.friction;\n \t \t\n \tthis.force = this.totalForce;\n \t\n \t// Step 4: Calculate acceleration using the F = ma equation, where m = the mass of the body moving\n \tthis.trainAcceleration = this.force/trainMass;\n \t\n \t// and have to check to make sure this acceleration does not exceed our max.\n \tif (this.trainAcceleration >= TRAIN_MAX_ACCELERATION * 1) {\t// time elapsed (one second)\n \t\t// set the acceleration as the max acceleration because we cannot exceed that\n \t\tthis.trainAcceleration = TRAIN_MAX_ACCELERATION * 1;\t// time elapsed (one second)\n \t}\n \t\n\t\temerBrake = this.getEBrake();\n \t// decelerates the train based on the values given in the spec sheet for the emergency brake\n \tif (emerBrake) {\n \t\tthis.trainAcceleration += (TRAIN_MAX_ACCELERATION_E_BRAKE*1);\n \t}\n \t\n \t// decelerates the train based onthe values given in the spec sheet for the service brake\n \tif(serviceBrake) {\n \t\tthis.trainAcceleration += (TRAIN_MAX_ACCELERATION_SERVICE_BRAKE*1);\n \t}\n \t\n \t// Step 5: Calculate the final speed by adding the old speed with the acceleration x the time elapsed (one second)\n \tthis.finalSpeed = this.currentSpeed + (this.trainAcceleration * 1);\n \t\n \t// NO NEGATIVE SPEEDS YINZ\n \tif(this.finalSpeed < 0) {\n this.finalSpeed = 0;\n }\n \t\n \t// resetting the current speed based on our calculations\n \tthis.currentSpeed = this.finalSpeed;\n \tthis.distTravelled = this.currentSpeed * 1; // speed times the time between clock ticks = distance travelled\n \t//System.out.println(finalSpeed);\n \t\n \tif(!(currentBlock == this.position.getCurrentBlock())) {\n \t\tmetersIn = 0;\n \t} else {\n \t\tmetersIn += this.distTravelled;\n \t}\n \tthis.position.moveTrain(this.distTravelled); // method call to tell the position class how far to move the train\n \t\n }", "static void compute(){\n XYChart.Series<Number, Number> euler = new XYChart.Series<>();\n XYChart.Series<Number, Number> eulerLocalError = new XYChart.Series<>();\n\n //inserting into series values at 0-th step\n euler.getData().add(new XYChart.Data<>(x0, y0));\n eulerLocalError.getData().add(new XYChart.Data<>(x0, 0.0));\n\n //looping through N steps (N - user inserted value)\n for (int i = 1; i <= N; ++i){\n //retrieving x and y-approximation at previous step\n double prevX = euler.getData().get(i - 1).getXValue().doubleValue();\n double prevY = euler.getData().get(i - 1).getYValue().doubleValue();\n\n //calculating current x, and current y-approximation\n double x = x0 + h * i;\n double y = prevY + h * derivativeAtPoint(prevX, prevY);\n\n //inserting to the approximation series pair of correspondent values\n euler.getData().add(new XYChart.Data<>(x, y));\n\n //calculating previous and current step exact solutions\n double prevExactY = exactSolution.calculate(x - h);\n double curExactY = exactSolution.calculate(x);\n\n //using formula for local error, calculating it and putting it into local error series for Euler's computational method\n double A = derivativeAtPoint(x - h, prevExactY);\n eulerLocalError.getData().add(new XYChart.Data<>(x, Math.abs(curExactY - prevExactY - h * A)));\n }\n //defining the name of the series\n euler.setName(\"Euler method\");\n eulerLocalError.setName(\"Euler method\");\n\n //inserting these series into their correspondent charts\n localErrorsChart.getData().add(eulerLocalError);\n approximationsAndExactSolutionChart.getData().add(euler);\n }", "public interface TransferFunction {\n\t\n\t/**\n\t * The transfer function takes the array of inputs and weights and performs some computation to produce \n\t * a single output which will be fed in to an activation function. \n\t * \n\t * The arrays of inputs and outputs must be of the same length.\n\t * @param inputs An array of double values.\n\t * @param weights An array of double values.\n\t * @return a single double value for use with an activation function.\n\t */\n\tpublic double transfer(double[] inputs, double[] weights) throws Exception; //TODO: make this a self-defined exception.\n\n}", "public BackPropagationNeural_3H(int size_in,int size_hidden1,int size_hidden2,int size_hidden3,int size_output){\n\t\tthis.size_in = size_in;\n\t\tthis.size_hidden1 = size_hidden1;\n\t\tthis.size_hidden2 = size_hidden2;\n\t\tthis.size_hidden3 = size_hidden3;\n\t\tthis.size_output = size_output;\n\t\t\n\t\tinputs = new float[size_in];\n\t\thidden1 = new float[size_hidden1];\n\t\thidden2 = new float[size_hidden2];\n\t\thidden3 = new float[size_hidden3];\n\t\toutput = new float[size_output];\n\t\t\n\t\tweight1 = new float[size_in][size_hidden1];\n\t\tweight2 = new float[size_hidden1][size_hidden2];\n\t\tweight3 = new float[size_hidden2][size_hidden3];\n\t\tweight4 = new float[size_hidden3][size_output];\n\t\t\n\t\tW1_last_delta = new float[size_in][size_hidden1];\n W2_last_delta = new float[size_hidden1][size_hidden2];\n W3_last_delta = new float[size_hidden2][size_hidden3];\n W4_last_delta = new float[size_hidden3][size_output];\n \n\t\trandomizeWeights();\n\t\toutput_error = new float[size_output];\n\t\thidden1_error = new float[size_hidden1];\n\t\thidden2_error = new float[size_hidden2];\n\t\thidden3_error = new float[size_hidden3];\n\t}", "double calculateSomaAndAxon(List<Double> weights, ActivationFunction activationFunction);", "public void calculateCorrections(int i) {\n delta = 0.0;\n // Calculate the value of learning factor\n //a) if neuron belongs to the output layer\n if (layer == network.getNumberOfLayers()) {\n // simply calculating difference between output value and given correct value\n delta = (network.getLearnVector()[i] - output);\n }\n //b) if neuron belongs to one of hidden layers\n else {\n // count number of neurons in previous layer\n int layersSize = network.getLayersSize(layer);\n // calculate sum of products of higher layer's neurons output values and the weights of connecting edges\n for(int j = 0; j < layersSize; ++j) {\n delta += network.getNeurons()[layer + 1][j].delta * network.getNeurons()[layer + 1][j].weights[i];\n }\n }\n // delta parameter equals sum calculated above times derivative of activation function\n delta *= activateDerivative(inputSum);\n // store value of formula in order to speed up calculations\n double tmp = 2 * network.getLearningRate() * delta;\n\n // Calculate new weights\n calculateNewWeights(tmp);\n }", "private double[][] delta(double[][] error, double[][] layer) {\n\t\tdouble[][] delta = new double[error.length][error[0].length];\n\t\tfor (int j = 0; j < error.length; j++) {\n\t\t\tfor (int k = 0; k < error[0].length; k++) {\n\t\t\t\tdelta[j][k] = error[j][k] * (layer[j][k] * (1.0 - layer[j][k]));\n\t\t\t}\n\t\t}\n\t\treturn delta;\n\t}", "public double[] RightHandSide(ArrayList<Argument> variableArgList, ArrayList<Argument> stockArgList, \n ArrayList<FlowObject> flowArrayList, ArrayList<StockObject> stockArrayList,\n ArrayList<VariableObject> variableArrayList) {\n\n //set double array of size of stockArrayList\n double[] ret = new double[stockArgList.size()];\n\n ArrayList<Argument> globalArgList = new ArrayList<Argument>();\n globalArgList.addAll(stockArgList);\n globalArgList.addAll(variableArgList);\n Argument[] globalvariables = globalArgList.toArray(new Argument[globalArgList.size()]);\n\n Expression e;\n Expression v;\n //for how ever many stocks there are, you get each stock and find the solution to each equation from the stock using\n // the variables array. it then returns that to the double ret array at the appropriate index\n \n //code for updating variable values. needs to be fixed -KM\n /*for (int k = 0;k<variableArgList.size(); k++){\n VariableObject var = variableArrayList.get(k);\n String eq=var.getVarEquation();\n v = new Expression(eq, globalvariables);\n variableArgList.get(k).setArgumentValue(v.calculate());\n for(int r=0;r<globalArgList.size();r++){\n if(globalArgList.get(r).getArgumentName().equals(variableArgList.get(k).getArgumentName())){\n globalArgList.get(r).setArgumentValue(variableArgList.get(k).getArgumentValue());\n }\n else{}\n }\n }*/\n for (int i = 0; i < stockArgList.size(); i++) {\n StockObject stock = stockArrayList.get(i);\n Vector<ModelingObject> inputs = stock.getInputs();\n Vector<ModelingObject> outputs = stock.getOutputs();\n String equations = \"\";\n for (ModelingObject mobj : inputs) {\n if (mobj.getStyle() == 0) { // check if the incoming is flow\n FlowObject fobj = (FlowObject) mobj;\n equations += fobj.getFlowEquation();// if it is flow then add the equation\n }\n\n }\n for (ModelingObject mobj : outputs) {\n if (mobj.getStyle() == 0) { // check if the incoming is flow\n FlowObject fobj = (FlowObject) mobj;\n equations += \"-\" + fobj.getFlowEquation();// if it is flow th en add the equation\n }\n }\n e = new Expression(equations, globalvariables);\n ret[i] = e.calculate();\n }\n\n return ret;\n }", "public void calculateEdgeWeights() {\n\n\t// Use a ListIterator so that we can modify the list\n\t// as we go\n\tListIterator<LayoutEdge>iter = edgeList.listIterator();\n\twhile (iter.hasNext()) {\n\t LayoutEdge edge = iter.next();\n\n\t // If we're only dealing with selected nodes, drop any edges\n\t // that don't have any selected nodes\n\t if (edge.getSource().isLocked() && edge.getTarget().isLocked()) {\n\t\titer.remove();\n\t } else if (edgeWeighter != null && edgeWeighter.normalizeWeight(edge) == false)\n\t\titer.remove();\n\n\t //logger.debug(\"Edge \"+edge.getEdge().getIdentifier()+\" now has weight \"+edge.getWeight());\n\t // logger.info( edge.toString() + \" now has weight \"+edge.getWeight());\n\t}\n }", "private void adjustWeights(double activationValues[],Image image){\n\n for(int i=0;i<perceptrons.size();i++){\n for(int j=0;j<4;j++) {\n if ((j + 1) == image.getEmotion()) {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 1, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n } else {\n perceptrons.get(i).adjustWeight(j, learningValue\n , 0, activationValues[j]\n ,normalizeImageValue(image.getImage()[i]));\n }\n }\n }\n\n }", "private void trainPerceptrons(){\n double activationValues[] = new double[4];\n for(Image image:asciiReader.getTrainingImages()){\n for (int j = 0 ; j < activationValues.length; j++){\n activationValues[j] = activationFunction\n .apply(sumWeights(j,image));\n }\n adjustWeights(activationValues,image);\n }\n }", "public void propagate(double t0, double tf)\n\t{\n\t\tdouble[] temp = new double[6];\n\n\t\t// Determine step size\n\t\tdouble n = this.meanMotion();\n\t\tdouble period = this.period();\n\t\tdouble dt = period / steps;\n\t\tif ((t0 + dt) > tf) // check to see if we're going past tf\n\t\t{\n\t\t\tdt = tf - t0;\n\t\t}\n\n\t\t// determine initial E and M\n\t\tdouble sqrome2 = Math.sqrt(1.0 - this.e * this.e);\n\t\tdouble cta = Math.cos(this.ta);\n\t\tdouble sta = Math.sin(this.ta);\n\t\tdouble sine0 = (sqrome2 * sta) / (1.0 + this.e * cta);\n\t\tdouble cose0 = (this.e + cta) / (1.0 + this.e * cta);\n\t\tdouble e0 = Math.atan2(sine0, cose0);\n\n\t\tdouble ma = e0 - this.e * Math.sin(e0);\n\n\t\t// determine sqrt(1+e/1-e)\n\n\t\t//double q = Math.sqrt((1.0 + this.e) / (1.0 - this.e));\n\n\t\t// initialize t\n\n\t\tdouble t = t0;\n\n\t\twhile (t < tf)\n\t\t{\n\t\t\tma = ma + n * dt;\n\t\t\tdouble ea = solveKepler(ma, this.e);\n\n\t\t\tdouble sinE = Math.sin(ea);\n\t\t\tdouble cosE = Math.cos(ea);\n\t\t\tdouble den = 1.0 - this.e * cosE;\n\n\t\t\tdouble sinv = (sqrome2 * sinE) / den;\n\t\t\tdouble cosv = (cosE - this.e) / den;\n\n\t\t\tthis.ta = Math.atan2(sinv, cosv);\n\t\t\tif (this.ta < 0.0)\n\t\t\t{\n\t\t\t\tthis.ta = this.ta + 2.0 * Constants.pi;\n\t\t\t}\n\n\t\t\tt = t + dt;\n\n\t\t\ttemp = this.randv();\n\t\t\tthis.rv = new VectorN(temp);\n\n\t\t\tif ((t + dt) > tf)\n\t\t\t{\n\t\t\t\tdt = tf - t;\n\t\t\t}\n\n\t\t}\n\t}", "public void processError(Vector errorVector) {\r\n\t\t// Update the output layer errors\r\n\t\tupdateOutputLayerErrors(errorVector);\r\n\t\t// Update hidden layers errors\r\n\t\tupdateHiddenLayersErrors();\r\n\t}" ]
[ "0.68845934", "0.6380964", "0.6338177", "0.6316022", "0.6315563", "0.62738585", "0.6216751", "0.6200954", "0.6180498", "0.61556125", "0.6135404", "0.61298054", "0.60964787", "0.6059467", "0.6033076", "0.5982131", "0.5938101", "0.59315157", "0.5920313", "0.5908132", "0.5899703", "0.5892641", "0.57883596", "0.5765867", "0.5758982", "0.5746131", "0.574378", "0.57104224", "0.5701473", "0.56799", "0.5668661", "0.56487817", "0.561677", "0.56123596", "0.5591441", "0.55467033", "0.5546577", "0.5545815", "0.5526908", "0.55174625", "0.5511809", "0.5467073", "0.5448384", "0.54430413", "0.5435133", "0.53971726", "0.5372405", "0.536115", "0.53347003", "0.5333037", "0.5320524", "0.53089094", "0.53068316", "0.5302078", "0.52985185", "0.52753234", "0.5272225", "0.5259219", "0.525895", "0.52327067", "0.5231764", "0.5228824", "0.5220059", "0.5216089", "0.5200419", "0.51875883", "0.51854885", "0.51734954", "0.51518923", "0.51510614", "0.5144615", "0.51292515", "0.5119478", "0.5117003", "0.50832427", "0.5060593", "0.50580114", "0.50391406", "0.5027109", "0.5025174", "0.50139856", "0.50114995", "0.50107014", "0.50030905", "0.5003071", "0.50018543", "0.49844667", "0.49808073", "0.49799293", "0.4973956", "0.49706283", "0.49697158", "0.49462414", "0.49423003", "0.49404833", "0.4937879", "0.49347574", "0.49112523", "0.4909085", "0.4908538", "0.4895205" ]
0.0
-1
Perform the gradient check on the backprop implementation
public static void gradientCheck(){ List<Integer> context = Arrays.asList(1, 2, 3); Integer nextWord = 5; Network network = new Network(4, 20, 30, 40); double epsilon = 0.0001; double alpha = 0.1; int i = 1, j = 12; double originalValue = network.E.get(i).get(j, 0); network.E.get(i).put(j, 0, originalValue + epsilon); network.feedForward(context, nextWord); double loss1 = -1.0 * Math.log(network.output.get(nextWord, 0)); network.E.get(i).put(j, 0, originalValue - epsilon); network.feedForward(context, nextWord); double loss2 = -1.0 * Math.log(network.output.get(nextWord, 0)); double derivative1 = (loss1 - loss2)/(2.0 * epsilon); System.out.println("Derivative1: " + derivative1); network.E.get(i).put(j, 0, originalValue); network.feedForward(context, nextWord); network.backProp(context, nextWord, alpha); double derivative2 = (network.E.get(i).get(j, 0) - originalValue) / (-1.0 * alpha); System.out.println("Derivative2: " + derivative2); if(Math.abs(derivative1 - derivative2) < 0.00001) System.out.println("Gradient check: PASS"); else System.out.println("Gradient check: FAIL"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void verifyGradient(Instance instance,\r\n\t\t\tMap<Integer, Double> mpFeatureIdToGradient) {\r\n\t\tdouble before = getObjectiveFunctionValueForSingleInstanceOriginal(instance);\r\n\t\tfor (int featureId : mpFeatureIdToGradient.keySet()) {\r\n\t\t\tdouble delta = param.gradientVerificationDelta;\r\n\t\t\tx[featureId][0] += delta;\r\n\t\t\tsum_x[0] += delta;\r\n\t\t\tdouble after = getObjectiveFunctionValueForSingleInstanceOriginal(instance);\r\n\t\t\tdouble gradientCalculated = mpFeatureIdToGradient.get(featureId);\r\n\t\t\tif (Math.abs(before + delta * gradientCalculated - after) > Constant.SMALL_THAN_AS_ZERO) {\r\n\t\t\t\tSystem.out.println(before + delta * gradientCalculated);\r\n\t\t\t\tSystem.out.println(after);\r\n\t\t\t}\r\n\t\t\tExceptionUtility\r\n\t\t\t\t\t.assertAsException(\r\n\t\t\t\t\t\t\tMath.abs(before + delta * gradientCalculated\r\n\t\t\t\t\t\t\t\t\t- after) < Constant.SMALL_THAN_AS_ZERO,\r\n\t\t\t\t\t\t\t\"Gradient verification fails!\");\r\n\t\t\t// Revert the actions.\r\n\t\t\tx[featureId][0] -= delta;\r\n\t\t\tsum_x[0] -= delta;\r\n\t\t}\r\n\t}", "public boolean checkGradient() {\r\n boolean temp = true;\r\n for (int i = 0; i<clusters.length; i++) {\r\n for (int j = 0; j<clusters[i].length; j++) {\r\n try {\r\n if (this.data.getProbeColor(this.experiment.getGeneIndexMappedToData(clusters[i][j])) != null) {\r\n temp = false;\r\n }\r\n } catch (Exception e) {\r\n }\r\n }\r\n }\r\n return temp;\r\n }", "void computeGradient(GradientCalc calc);", "@Test\n public void testAccumulateGradients() {\n // TODO: MXNet support for accumulating gradients does not currently work\n TestUtils.requiresNotEngine(\"MXNet\");\n try (NDManager manager = NDManager.newBaseManager(TestUtils.getEngine())) {\n NDArray a = manager.create(0.0f);\n a.setRequiresGradient(true);\n\n Engine engine = Engine.getEngine(TestUtils.getEngine());\n try (GradientCollector gc = engine.newGradientCollector()) {\n for (int i = 1; i <= 3; i++) {\n NDArray b = a.mul(2);\n gc.backward(b);\n Assert.assertEquals(a.getGradient().getFloat(), 2.0f * i);\n }\n }\n }\n }", "private void gradientDecent(double[][] X, double[] y){\n double[] h = matrix.sigmoid(matrix.multiply(X,Theta));\n double[] cp = costPrime(X,h,y);\n\n double scp = 0;\n for(double i: cp){\n scp = scp + i;\n }\n System.out.println(+ cost(h,y));\n // Average Cost\n scp = round(scp/h.length,5);\n System.out.println(scp);\n int j = 0;\n\n // while Average Cost is not 0\n while(scp > 0.00001){\n Theta = matrix.subtract(Theta,matrix.multiply(alpha,cp));\n h = matrix.sigmoid(matrix.multiply(X,Theta));\n cp = costPrime(X,h,y);\n double sum = 0;\n for(double i: cp){\n sum = sum + i;\n }\n scp = round(sum/h.length,5);\n System.out.println(scp);\n }\n }", "@Test\n public void testClearGradients() {\n // TODO: Currently not supported by PyTorch. See PtGradientCollector\n TestUtils.requiresNotEngine(\"PyTorch\");\n try (NDManager manager = NDManager.newBaseManager(TestUtils.getEngine())) {\n NDArray a = manager.create(0.0f);\n a.setRequiresGradient(true);\n\n Engine engine = Engine.getEngine(TestUtils.getEngine());\n for (int i = 0; i < 3; i++) {\n try (GradientCollector gc = engine.newGradientCollector()) {\n NDArray b = a.mul(2);\n gc.backward(b);\n }\n Assert.assertEquals(a.getGradient().getFloat(), 2.0f);\n }\n }\n }", "public void calculateGradients(int dataIndex, double learningRate){\r\n for (int i = 0; i < outputLayer.length; i++) {\r\n for (int j = 0; j < outputLayer[i].weights.length; j++) {\r\n outputLayer[i].dw[j] = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z)*outputLayer[i].data[j];\r\n }\r\n outputLayer[i].db = -2*((attribute[dataIndex] == i ? 1 : 0) - sigmoid(outputLayer[i].z))*sigmoidDeri(outputLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, true);\r\n calculateDesireHiddenLayerActivation(dataIndex);\r\n\r\n for (int i = 0; i < hiddenLayer.length; i++) {\r\n for (int j = 0; j < hiddenLayer[i].weights.length; j++) {\r\n hiddenLayer[i].dw[j] = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z)*hiddenLayer[i].data[j];\r\n }\r\n hiddenLayer[i].db = -2*(desireHiddenLayerActivation[i] - hiddenLayer[i].a)*sigmoidDeri(hiddenLayer[i].z);\r\n }\r\n\r\n adjust(learningRate, false);\r\n }", "int computeGradient(\n int gx, int gy);", "public void backprop(double[] inputs, FeedForwardNeuralNetwork net, boolean verbose)\n {\n //create variables that will be used later\n int[] sizes = net.getSizes();\n int biggestSize = 0;\n for(int k = 0; k < sizes.length; k++)\n {\n if(sizes[k] > biggestSize)\n {\n biggestSize = sizes[k];\n }\n }\n int hiddenLayers = sizes.length - 2;\n //if input or output wrong size, return\n if(inputs.length != sizes[0])\n {\n System.out.println(\"Invalid number of inputs\");\n return;\n }\n\n double[][] allOutputs = new double[sizes.length][biggestSize];\n double[][] allErrors = new double[sizes.length][biggestSize];\n\n //fill out first layer to temp output\n int lastLayer = sizes[0];\n for(int k = 0; k < lastLayer; k++)\n {\n allOutputs[0][k] = inputs[k];\n }\n\n //for each layer after the input\n for(int k = 1; k < hiddenLayers + 2; k++)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //get sum and get activation function result and its derivative\n double sum = 0;\n for(int t = 0; t < lastLayer; t++)\n {\n sum += allOutputs[k - 1][t] * net.getWeight(k - 1, t, k, a);\n }\n sum += net.getBiasNum() * net.getWeight(-1, 0, k, a);\n if(k != hiddenLayers + 1)\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getHiddenActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getHiddenActivationFunction());\n }\n else\n {\n allOutputs[k][a] = net.applyActivationFunction(sum, net.getOutputActivationFunction());\n allErrors[k][a] = net.applyActivationFunctionDerivative(sum, net.getOutputActivationFunction());\n }\n }\n lastLayer = sizes[k];\n }\n\n if(verbose)\n {\n System.out.println(\"Outputs\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(allOutputs[hiddenLayers + 1][k] + \", \");\n }\n System.out.println();\n }\n double[] expectedOutputs = new double[maxClusters];\n int cluster = 0;\n double max = 0;\n for(int k = 0; k < maxClusters; k++)\n {\n expectedOutputs[k] = allOutputs[hiddenLayers + 1][k];\n if(allOutputs[hiddenLayers + 1][k] > max)\n {\n cluster = k;\n max = allOutputs[hiddenLayers + 1][k];\n }\n }\n if(verbose)\n {\n System.out.println(\"Output \" + cluster + \" will be set to max value\");\n System.out.println();\n }\n\n expectedOutputs[cluster] = 4;\n\n\n //go backward from output to first hidden layer\n for(int k = hiddenLayers + 1; k > 0; k--)\n {\n //for each node in that layer\n for(int a = 0; a < sizes[k]; a++)\n {\n //compute error for not output layer\n if(k != hiddenLayers + 1)\n {\n double temp = allErrors[k][a];\n allErrors[k][a] = 0;\n for(int t = 0; t < sizes[k + 1]; t++)\n {\n allErrors[k][a] += net.getWeight(k, t, k + 1, a) * allErrors[k + 1][t];\n }\n allErrors[k][a] *= temp;\n }\n //compute error for output layer\n else\n {\n allErrors[k][a] *= (expectedOutputs[a] - allOutputs[k][a]);\n }\n\n //for each weight node takes as input\n for(int t = 0; t < sizes[k - 1]; t++)\n {\n //find the delta for the weight and apply\n int index = net.getIndex(k - 1, t, k, a);\n double delta = learningRate * allOutputs[k - 1][t] * allErrors[k][a]\n + momentum * lastDeltas[index];\n\n net.setWeight(k - 1, t, k, a, net.getWeight(k - 1, t, k, a) + delta);\n lastDeltas[index] = delta;\n }\n }\n }\n }", "public abstract double gradient(double betaForDimension, int dimension);", "public void gradientDescent(double[][] gradient, double eps) {\n for (int i = 0; i < _weights.length; i++) {\n for (int j = 0; j < _weights[0].length; j++) {\n _weights[i][j] -= eps * gradient[i][j];\n }\n }\n }", "@Test\n\tpublic void testGetGradients() throws GeoTessException\n\t{\n\t\t// set the active region and get a set of layers for which gradients are to\n\t\t// be calculated\n\t\tint[] layers = {2, 3, 4, 5, 6, 7, 8};\n\t\tmodel.setActiveRegion();\n\n\t\t// set grid node location indices and compute the gradients\n\t\tint attributeIndex = 0;\n\t\tboolean reciprocal = true; \n int layerId = 4;\n int nodeIndex = 1;\n int vertexIndex = 0;\n int pointIndex = 94;\n double radius = 6002.0;\n\t\tmodel.computeGradients(attributeIndex, reciprocal, layers);\n\n\t\t// set the previously evaluated truth for the gradients at the requested\n\t\t// location and create the vectors to hold the gradients\n\t\tdouble[] gradRadiusTrue = {1.9839115843623915E-6, -4.022375220857291E-6, -0.003656604048942139};\n\t\tdouble[] gradNodeTrue = {4.756547818175395E-6, -9.62857379398759E-6, -0.0033950085275608875};\n\t\tdouble[] gradPointTrue = {4.756547818175395E-6, -9.62857379398759E-6, -0.0033950085275608875};\n \n\t\tdouble[] gradRadius = new double [3];\n\t\tdouble[] gradNode = new double [3];\n\t\tdouble[] gradPoint = new double [3];\n\n\t\t// perform the vertexIndex/layerId/nodeIndex gradient method and test for\n\t\t// the true result\n\t\tmodel.getGradient(vertexIndex, layerId, nodeIndex, attributeIndex, reciprocal, gradNode);\n\t\tassertEquals(gradNode[0], gradNodeTrue[0], 1e-12);\n\t\tassertEquals(gradNode[1], gradNodeTrue[1], 1e-12);\n\t\tassertEquals(gradNode[2], gradNodeTrue[2], 1e-12);\n\n\t\t// perform the pointIndex gradient method and test for\n\t\t// the true result\n\t\tmodel.getPointGradient(pointIndex, attributeIndex, reciprocal, gradPoint);\n\t\tassertEquals(gradPoint[0], gradPointTrue[0], 1e-12);\n\t\tassertEquals(gradPoint[1], gradPointTrue[1], 1e-12);\n\t\tassertEquals(gradPoint[2], gradPointTrue[2], 1e-12);\n\n\t\t// perform the vertexIndex/layerId/radius gradient method and test for\n\t\t// the true result\n\t\tmodel.getGradient(vertexIndex, layerId, radius, attributeIndex, reciprocal, gradRadius);\n\t\tassertEquals(gradRadius[0], gradRadiusTrue[0], 1e-12);\n\t\tassertEquals(gradRadius[1], gradRadiusTrue[1], 1e-12);\n\t\tassertEquals(gradRadius[2], gradRadiusTrue[2], 1e-12);\n\t}", "public void applyBackpropagation( float expectedOutput[] ) {\n\t\t// The code for updating weights goes here \n\t\t// NOTE: if using a single perceptron, this is not technically back-propagation, despite the function name \n }", "@Test\n public void testGetGradient() throws GeoTessException {\n // set the active region and get a set of layers for which gradients are to\n // be calculated\n int[] layers = {2, 3, 4, 5, 6, 7, 8};\n model.setActiveRegion();\n\n // set grid node location index\n int attributeIndex = 0;\n\n // define the linear and natural-neighbor gradients for both nominal and\n // reciprocal attributes and initialize the true result\n\n double[] gradLin = new double[3];\n double[] gradNN = new double[3];\n double[] gradLinTrue = {4.6692626774685944E-5, 4.502074915240648E-6, 4.543854613827687E-6};\n double[] gradNNTrue = {4.666681310690614E-5, 4.4985383090366614E-6, 4.544030614580206E-6};\n double[] gradLinRecip = new double[3];\n double[] gradNNRecip = new double[3];\n double[] gradLinRecipTrue = {-0.003672532846243307, -3.547138101101814E-4,\n -3.5962254850115913E-4};\n double[] gradNNRecipTrue = {-0.0036705409599509485, -3.5443843094769983E-4,\n -3.5962403554295927E-4};\n\n // get the linear and natural-neighbor interpolators\n GeoTessPosition gtpLin, gtpNN;\n gtpLin = GeoTessPosition.getGeoTessPosition(model, InterpolatorType.LINEAR,\n InterpolatorType.LINEAR);\n gtpNN = GeoTessPosition.getGeoTessPosition(model, InterpolatorType.NATURAL_NEIGHBOR,\n InterpolatorType.LINEAR);\n\n // compute and store non-reciprocal gradients and set the linear position\n // ... interpolate the linear result and compare against the true values\n model.computeGradients(attributeIndex, false, layers);\n gtpLin.set(5.5, 5.5, 369.0);\n gtpLin.getGradient(0, false, gradLin);\n assertEquals(gradLin[0], gradLinTrue[0], 1e-12);\n assertEquals(gradLin[1], gradLinTrue[1], 1e-12);\n assertEquals(gradLin[2], gradLinTrue[2], 1e-12);\n\n // set the natural-neighbor position ... interpolate the natural-neighbor\n // result and compare against the true values\n gtpNN.set(5.5, 5.5, 369.0);\n gtpNN.getGradient(0, false, gradNN);\n assertEquals(gradNN[0], gradNNTrue[0], 1e-12);\n assertEquals(gradNN[1], gradNNTrue[1], 1e-12);\n assertEquals(gradNN[2], gradNNTrue[2], 1e-12);\n\n // compute and store reciprocal gradients ... interpolate the linear\n // result and compare against the true values\n model.computeGradients(attributeIndex, true, layers);\n gtpLin.getGradient(0, true, gradLinRecip);\n assertEquals(gradLinRecip[0], gradLinRecipTrue[0], 1e-12);\n assertEquals(gradLinRecip[1], gradLinRecipTrue[1], 1e-12);\n assertEquals(gradLinRecip[2], gradLinRecipTrue[2], 1e-12);\n\n // interpolate the natural-neighbor result and compare against the true\n // values\n gtpNN.getGradient(0, true, gradNNRecip);\n assertEquals(gradNNRecip[0], gradNNRecipTrue[0], 1e-12);\n assertEquals(gradNNRecip[1], gradNNRecipTrue[1], 1e-12);\n assertEquals(gradNNRecip[2], gradNNRecipTrue[2], 1e-12);\n }", "public void testLBFGS() throws Exception {\n\t\tList<? extends TrainingSequence<?>> data = IntInput.prepareData(\"001111\\n001111\\n001111\\n001111\\n001111\\n001111\\n001111\\n001111\\n\");\n\t\tModelManager m = new TestFeatureManager(1);\n\n\t\tStandardOptimizer opt = new StandardOptimizer();\n\t\topt.setStarts(new double[] {0.1});\n\t\topt.setEpsForConvergence(0.001);\n\t\topt.setObjectiveFunction(new MaximumLikelihoodGradient());\n\t\tdouble[] weights = opt.optimize(m, data);\n\t\tassertEquals(2.0, weights[0], 0.01);\n\t}", "public float getGradPoint() { return gradientPoint; }", "@Override\n\tpublic Object backward(Object grad_output) {\n\t\t\n\t\tdouble[] grads=(double[])grad_output;\n\t\t\n\t\t//for weights\n\t\tweights_gradients=new double[weights.length][];\n\t\tfor(int i=0;i<weights.length;i++)\n\t\t{\n\t\t\tweights_gradients[i]=grads;\n\t\t}\n\t\t\n\t\t//for grad_inputs\n\t\tdouble[] grad_inputs=MatrixTool.MatrixRightDotVector(weights, grads);\n\t\treturn grad_inputs;\n\t}", "@Override\r\n public void getValueGradient(double[] gradient) {\n double[] llhGrad = new double[N];\r\n for (int n = 0; n < N; n++) {\r\n llhGrad[n] = ZTy[n];\r\n for (int m = 0; m < N; m++) {\r\n llhGrad[n] -= ZTZ[n][m] * parameters[m];\r\n }\r\n llhGrad[n] /= (rhoSquare);\r\n }\r\n\r\n // gradient of the log prior\r\n double[] lprior = new double[N];\r\n for (int n = 0; n < N; n++) {\r\n // uplink\r\n double uplinkPrior = 0.0;\r\n int parentIndex = upwardLink.get(n);\r\n if (parentIndex == -1) {\r\n uplinkPrior += parameters[n] - mu;\r\n } else {\r\n uplinkPrior += parameters[n] - parameters[parentIndex];\r\n }\r\n uplinkPrior /= (-sigmaSquares[n]);\r\n\r\n // downlinks\r\n double downlinkPrior = 0.0;\r\n for (int child : downwardLinks.get(n)) {\r\n downlinkPrior += (parameters[n] - parameters[child]) / (-sigmaSquares[child]);\r\n }\r\n\r\n lprior[n] = uplinkPrior + downlinkPrior;\r\n }\r\n// for(int n=0; n<N; n++)\r\n// lprior[n] = - (parameters[n] - mus[n]) / sigmaSquares[n];\r\n\r\n // combine\r\n for (int n = 0; n < N; n++) {\r\n gradient[n] = llhGrad[n] + lprior[n];\r\n }\r\n }", "@Override\n\tpublic void backProp() {\n\t\tdouble dOut = 0;\n\t\tfor (Node n : outputs) {\n\t\t\tdOut += n.dInputs.get(this);\n\t\t}\n\t\tdouble dTotal = activationFunction.derivative(total)*dOut;\n\t\tfor (Node n : inputs) {\n\t\t\tdInputs.put(n, dTotal * weights.get(n).getWeight());\n\t\t\tweights.get(n).adjustWeight(dTotal * n.output);\n\t\t}\n\t\tbiasWeight.adjustWeight(bias * dTotal);\n\t}", "public void useGradient(final boolean state) {\n this.useGradient = state;\n }", "@Override\r\n\tpublic FloatMat gradient() { return this.gradient; }", "@Test\n public void gradientFieldExample() {\n try {\n GradientFieldExample.run(true);\n } catch (final RuntimeException e) {\n // find the root cause of the exception\n Throwable cur = e;\n while (cur.getCause() != null) {\n cur = cur.getCause();\n }\n // verify that the exception was caused by the early termination of the\n // simulation\n assertTrue(cur instanceof IllegalStateException);\n assertTrue(cur.getMessage().contains(\n \"The simulation did not result in a valid result\"));\n }\n }", "void addGradient(Vector gradientVector, double gradient);", "final public boolean isGradientsUsed()\n {\n return ComponentUtils.resolveBoolean(getProperty(GRADIENTS_USED_KEY), true);\n }", "void backpropagate(float[] inputs, float... targets);", "private void backwardCalculation(double[] trainingOutput) {\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\terrorOutput[i] = output[i] * (1 - output[i]) * (trainingOutput[i] - output[i]);\n\t\t}\n\n\t\t// computer error at every hidden node\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tdouble sum = 0;\n\n\t\t\tfor (int j = 0; j < numberOfOutputs; j++) {\n\t\t\t\tsum += matrixOutput[i][j] * errorOutput[j];\n\t\t\t}\n\n\t\t\terrorMiddle[i] = middle[i] * (1 - middle[i]) * sum;\n\t\t}\n\n\t\t// update weights between hidden and output nodes\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tfor (int j = 0; j < numberOfOutputs; j++) {\n\t\t\t\tmatrixOutput[i][j] += rate * middle[i] * errorOutput[j];\n\t\t\t}\n\t\t}\n\n\t\t// update weights between input and hidden nodes\n\t\tfor (int i = 0; i < numberOfInputs; i++) {\n\t\t\tfor (int j = 0; j < numberOfMiddle; j++) {\n\t\t\t\tmatrixMiddle[i][j] += rate * input[i] * errorMiddle[j];\n\t\t\t}\n\t\t}\n\n\t\t// update thetas at output nodes\n\t\tfor (int i = 0; i < numberOfOutputs; i++) {\n\t\t\tthetaOutput[i] += rate * errorOutput[i];\n\t\t}\n\n\t\t// update thetas at hidden nodes\n\t\tfor (int i = 0; i < numberOfMiddle; i++) {\n\t\t\tthetaMiddle[i] += rate * errorMiddle[i];\n\t\t}\n\t}", "private void SGDForNegativeInstance(Instance instance) {\n\t\tint lengthOfDocument = 0;\r\n\t\tfor (int frequency : instance.mpFeatureToFrequency.values()) {\r\n\t\t\tlengthOfDocument += frequency;\r\n\t\t}\r\n\t\t// double gValue = getGFunctionValue(lengthOfDocument);\r\n\t\t// double gGradientWithPositiveClass =\r\n\t\t// getGFunctionGradientWithPositiveClass(lengthOfDocument);\r\n\t\t// double gGradientWithNegativeClass =\r\n\t\t// getGFunctionGradientWithNegativeClass(lengthOfDocument);\r\n\r\n\t\tdouble positiveClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[0]);\r\n\t\tdouble negativeClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[1]);\r\n\t\tdouble ratioOfClasses = positiveClassSum / negativeClassSum;\r\n\r\n\t\t// Compute R.\r\n\t\tBigDecimal R = BigDecimal.ONE;\r\n\t\t// Pr(-) / Pr(+).\r\n\t\tR = R.multiply(BigDecimal\r\n\t\t\t\t.valueOf(getProbOfClass(1) / getProbOfClass(0)));\r\n\t\t// ratioOfClasses ^ |d|.\r\n\t\tR = R.multiply(BigDecimal.valueOf(ratioOfClasses).pow(lengthOfDocument));\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\t\t\tdouble ratio = (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]);\r\n\t\t\tR = R.multiply(BigDecimal.valueOf(ratio).pow(frequency));\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the positive class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithPositiveClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator1 = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]));\r\n\t\t\tBigDecimal numerator2 = R.multiply(BigDecimal\r\n\t\t\t\t\t.valueOf(lengthOfDocument / positiveClassSum));\r\n\t\t\tBigDecimal numerator = numerator1.add(numerator2);\r\n\t\t\tBigDecimal denominator = R.add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator.divide(denominator, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).doubleValue()\r\n\t\t\t\t\t- lengthOfDocument / positiveClassSum;\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithPositiveClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the negative class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithNegativeClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t\t\t- lengthOfDocument / negativeClassSum);\r\n\t\t\tBigDecimal denominator = BigDecimal.ONE.divide(R, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator\r\n\t\t\t\t\t.divide(denominator, 30, RoundingMode.HALF_UP)\r\n\t\t\t\t\t.subtract(numerator).doubleValue();\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithNegativeClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Note that we need to compute all of the gradients first and then\r\n\t\t// update the counts.\r\n\t\t// Update the count of each feature in this document for positive class.\r\n\t\tupdateXs(instance, gradientOfFeatureWithPositiveClass,\r\n\t\t\t\tgradientOfFeatureWithNegativeClass);\r\n\t}", "@Override\n\tpublic void train(DataSet data) {\n\t\tArrayList<Example> examples = data.getCopyWithBias().getData();\n\t\t// initialize both weight vectors with random values between -0.1 ad 0.1\n\t\tinitWeights(examples.size());\n\n\t\t// store outputs from forward calculation for each example\n\t\t// array will have size # examples.\n\t\tArrayList<Double> nodeOutputs = calculateForward(examples);\n\n\t\t// now take error and back-propagate from output to hidden nodes\n\n\t\tfor (int j = 0; j < examples.size(); j++) {\n\t\t\tExample ex = examples.get(j);\n\n\t\t\t// get hidden node outputs for single example\n\t\t\tfor (int num = 0; num < numHidden; num++) {\n\t\t\t\tArrayList<Double> h_outputs = hiddenOutputs.get(num);\n\t\t\t\tdouble vDotH = dotProduct(h_outputs, layerTwoWeights); // calculate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// v dot\n\t\t\t\t// h for\n\t\t\t\t// this node\n\n\t\t\t\tfor (int i = 0; i < numHidden - 1; i++) {\n\t\t\t\t\tdouble oldV = layerTwoWeights.get(i);\n\t\t\t\t\tdouble hk = h_outputs.get(i);\n\t\t\t\t\t// Equation describing line below:\n\t\t\t\t\t// v_k = v_k + eta*h_k(y-f(v dot h)) f'(v dot h)\n\t\t\t\t\tlayerTwoWeights.set(i, oldV + eta * hk * (ex.getLabel() - Math.tanh(vDotH)) * derivative(vDotH));\n\t\t\t\t}\n\n\t\t\t\tSet<Integer> features = ex.getFeatureSet();\n\t\t\t\tIterator<Integer> iter = features.iterator();\n\t\t\t\tArrayList<Double> featureVals = new ArrayList<Double>();\n\t\t\t\tfor (int f : features) {\n\t\t\t\t\tfeatureVals.add((double) f);\n\t\t\t\t}\n\n\t\t\t\t// take that error and back-propagate one more time\n\t\t\t\tfor (int x = 0; x < numHidden; x++) {\n\t\t\t\t\tArrayList<Double> initWeights = hiddenWeights.get(x);\n\t\t\t\t\t// List<Object> features =\n\t\t\t\t\t// Arrays.asList(ex.getFeatureSet().toArray());\n\n\t\t\t\t\t// for (int i = 0; i < featureVals.size()-1; i++) {\n\t\t\t\t\tdouble oldWeight = initWeights.get(j);\n\t\t\t\t\tdouble thisInput = ex.getFeature(featureVals.get(x).intValue());\n\t\t\t\t\t// w_kj = w_kj + eta*xj(input)*f'(w_k dot x)*v_k*f'(v dot\n\t\t\t\t\t// h)(y-f(v dot h))\n\t\t\t\t\tdouble updateWeight = oldWeight + eta * thisInput * derivative(dotProduct(featureVals, initWeights))\n\t\t\t\t\t\t\t* layerTwoWeights.get(x) * derivative(vDotH) * (ex.getLabel() - Math.tanh(vDotH));\n\t\t\t\t\tinitWeights.set(j, updateWeight);\n\t\t\t\t\t// }\n\t\t\t\t\thiddenWeights.set(x, initWeights); // update weights for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// current\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// example\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "Gradient gradientAt(Point point);", "@Override\r\n\tpublic DataContainer backProp(DataContainer backPropError, double learningRate) {\n\t\tif (lastInputBiased == null) {\r\n\t\t\tthrow new RuntimeException(\"Invalid operation\"); \r\n\t\t}\r\n\t\tMat error = backPropError.getVec(); \r\n\t\t\r\n\t\tMat dW = lastInputBiased.T().mul(error).scale(learningRate); \r\n\t\t\r\n\t\tMat temp = error.mul(inputWeight.T()); \r\n Mat output = new Mat(temp.size[0], temp.size[1] - 1); \r\n for (int i = 0; i < output.size[1]; i++) {\r\n \toutput.matrix[0][i] = temp.matrix[0][i]; \r\n }\r\n \r\n\t\tinputWeight = inputWeight.add(dW); \r\n\t\t\r\n\t\treturn new DataContainer(output); \r\n\t}", "private static float computeGradientScore(GameModel model) {\n\n float bestScore = Float.NEGATIVE_INFINITY;\n int numEmptyCells = 0;\n for (int i = 0; i < 4; i++) {\n float score = 0;\n int[] gradientArray = gradients[i];\n for (int j = 0; j < model.getGrid().length; j++) {\n byte b = model.getGrid()[j];\n if (b < 0) {\n numEmptyCells++;\n } else {\n int gradient = gradientArray[j];\n score += (1 << b) * gradient;\n }\n }\n score *= (1 + numEmptyCells * EMPTY_CELL_SCORE_BONUS);\n bestScore = max(bestScore, score);\n }\n return bestScore;\n }", "private boolean checkTrainingCondition(){\n //if one sample validation was negative, so trainingCondition will be false.\n for(Sample s: samples){\n if(!s.getValidation())\n return false;\n }\n return true;\n }", "boolean hasFunctionApproximation();", "@Override\n public Vector2d gradient(Vector2d p) {\n\n return null;\n }", "private double[] computeFiniteDifferenceGradient(double[] point, double[] step, int[] batch) {\n double[] fd = new double[point.length];\n\n for (int i = 0; i < point.length; i++) {\n double[] upper = new double[point.length];\n System.arraycopy(point, 0, upper, 0, point.length);\n upper[i] += step[i];\n double[] lower = new double[point.length];\n System.arraycopy(point, 0, lower, 0, point.length);\n lower[i] -= step[i];\n fd[i] = (evaluate(upper, batch) - evaluate(lower, batch)) / 2.0 / step[i];\n }\n\n return fd;\n }", "@Override\n public void backward() {\n Tensor x = modInX.getOutput();\n Tensor tmp = new Tensor(yAdj); // copy\n tmp.elemDivide(x);\n modInX.getOutputAdj().elemAdd(tmp);\n }", "private void checkLeakyEpsilon() {\r\n if (cbUseLeakyLearning.isSelected()) {\r\n tfLeakyEpsilon.setEnabled(true);\r\n } else {\r\n tfLeakyEpsilon.setEnabled(false);\r\n }\r\n }", "private void backwardPropagation(int[] trainingData, int[] trainingLabel, double[] outputActivations, double[] hiddenActiv) {\n\t\tdouble[] delta = new double[SIZE_OUTPUT_LAYER];\n\t\t// Update OutputLayer weights\n\t\tfor(int indexOutput = 0; indexOutput < SIZE_OUTPUT_LAYER; indexOutput++) {\n\t\t\t// We define delta as the difference between the real label and the softmax probability\n\t\t\tdelta[indexOutput] = trainingLabel[indexOutput] - outputActivations[indexOutput];\n\n\t\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\t\tweightsOfOutputLayer[indexOutput][indexHidden] += learningRate * delta[indexOutput] * hiddenActiv[indexHidden] / datasetSize;\n\t\t\t}\t\n\t\t\tbiasOfOutputLayer[indexOutput] += learningRate * delta[indexOutput] / datasetSize;\n\t\t}\t\n\t\t// Create delta2 \n\t\tdouble[] delta2 = new double[SIZE_HIDDEN_LAYER];\n\t\tfor(int i = 0; i < SIZE_HIDDEN_LAYER; i++) {\n\t\t\tdelta2[i] = 0;\n\t\t\tfor(int j = 0; j < SIZE_OUTPUT_LAYER; j++) {\n\t\t\t\t// Why is it multiplying the weights for delta1?\n\t\t\t\tdelta2[i] += delta[j] * weightsOfOutputLayer[j][i];\n\t\t\t}\n\t\t\tdelta2[i] *= dtanh(hiddenActiv[i]);\n\t\t}\n\t\t// Update HiddenLayer weights\n\t\tfor(int i = 0; i < SIZE_HIDDEN_LAYER; i++) {\n\t\t\tfor(int j = 0; j < SIZE_INPUT_LAYER; j++) {\n weightsOfHiddenLayer[i][j] += learningRate * delta2[i] * (double)trainingData[j] / datasetSize;\n\t\t\t}\n biasOfHiddenLayer[i] += learningRate * delta2[i] / datasetSize;\n\t\t}\t\n\t}", "protected abstract HashMap<String,MyPair<Double, SparseVector>> calc_grad_loss(Map<String, SparseVector> weight,\n\t\t\tint iter);", "@Override\n public int[] run(double[][] examples)\n {\n //System.out.println(\"Starting backprop\");\n if(verbose)\n {\n System.out.println(\"---------------------Begin Competitive Learning---------------------\");\n }\n maxClusters = (int)Math.round(parameters[2]);\n FeedForwardNeuralNetwork net = new FeedForwardNeuralNetwork(0,\n new int[]{examples[0].length, maxClusters}, ActivationFunction.LINEAR,\n ActivationFunction.LINEAR);\n lastDeltas = new double[net.getWeights().length];\n learningRate = parameters[0];\n momentum = parameters[1];\n maxIterations = parameters[3];\n\n int[] sizes = net.getSizes();\n\n int[] last = calculateWinners(examples, net);\n\n if(verbose)\n {\n System.out.println(\"Initial weights\");\n double[] weights = net.getWeights();\n for(int k = 0; k < weights.length; k++)\n {\n System.out.print(weights[k] + \", \");\n }\n System.out.println(\"Initial labels\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(\"Cluster \" + k + \": \");\n for(int a = 0; a < last.length; a++)\n {\n if(last[a] == k)\n {\n System.out.print(a + \", \");\n }\n }\n System.out.println();\n }\n System.out.println();\n }\n\n int index = 0;\n for(int i = 1; i < maxIterations; i++)\n {\n double[] input = new double[sizes[0]];\n\n //separate input and output\n for(int a = 0; a < input.length; a++)\n {\n input[a] = examples[index][a];\n }\n index = (index + 1) % examples.length;\n\n //run backprop on it\n if(i % 1000 == 0 && verbose)\n {\n System.out.println(\"Iteration: \" + i);\n }\n if(verbose)\n {\n backprop(input, net, i % 1000 == 0);\n }\n else\n {\n backprop(input, net, false);\n }\n\n if(i % 1000 == 0)\n {\n int[] temp = calculateWinners(examples, net);\n if(verbose)\n {\n //System.out.println(\"Iteration: \" + i);\n /*System.out.println(\"Current labels\");\n for(int k = 0; k < last.length; k++)\n {\n System.out.println(k + \": \" + temp[k]);\n }\n System.out.println();*/\n }\n boolean same = true;\n for(int j = 0; j < temp.length; j++)\n {\n if(last != temp)\n {\n same = false;\n break;\n }\n }\n\n if(same)\n {\n if(verbose)\n {\n System.out.println(\"Final weights\");\n double[] weights = net.getWeights();\n for(int k = 0; k < weights.length; k++)\n {\n System.out.print(weights[k] + \", \");\n }\n System.out.println(\"Final labels\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(\"Cluster \" + k + \": \");\n for(int a = 0; a < last.length; a++)\n {\n if(last[a] == k)\n {\n System.out.print(a + \", \");\n }\n }\n System.out.println();\n }\n System.out.println();\n System.out.println(\"----------------------End Competitive Learning----------------------\");\n }\n return temp;\n }\n else\n {\n last = temp;\n }\n }\n }\n if(verbose)\n {\n System.out.println(\"Final weights\");\n double[] weights = net.getWeights();\n for(int k = 0; k < weights.length; k++)\n {\n System.out.print(weights[k] + \", \");\n }\n System.out.println(\"Final labels\");\n for(int k = 0; k < maxClusters; k++)\n {\n System.out.print(\"Cluster \" + k + \": \");\n for(int a = 0; a < last.length; a++)\n {\n if(last[a] == k)\n {\n System.out.print(a + \", \");\n }\n }\n System.out.println();\n }\n System.out.println();\n System.out.println(\"----------------------End Competitive Learning----------------------\");\n }\n\n return calculateWinners(examples, net);\n }", "boolean isBackwardPredicted()\n {\n return (mbType & BACKWARD)!=0;\n }", "@Override\r\n\t\tpublic double[] gradient(double x, double... parameters) {\n\t\t\tfinal double a = parameters[0];\r\n\t\t\tfinal double b = parameters[1];\r\n\t\t\tfinal double c = parameters[2];\r\n\t\t\tfinal double d = parameters[3];\r\n\t\t\tfinal double e = parameters[4];\r\n\t\t\t\r\n\t\t\tdouble[] gradients = new double[5];\r\n\t\t\t//double den = 1 + Math.pow((x+e)/c, b);\r\n\t\t\t//gradients[0] = 1 / den; // Yes a Derivation \r\n\t\t\t//gradients[1] = -((a - d) * Math.pow(x / c, b) * Math.log(x / c)) / (den * den); // Yes b Derivation \r\n\t\t\t//gradients[2] = (b * Math.pow(x / c, b - 1) * (x / (c * c)) * (a - d)) / (den * den); // Yes c Derivation \r\n\t\t\t//gradients[3] = 1 - (1 / den); // Yes d Derivation \r\n\t\t\t\r\n\t\t\t//Derivation\r\n\t\t\tfinal double c_b = Math.pow(c, b);\r\n\t\t\tfinal double c_b1 = Math.pow(c, b+1.);\r\n\t\t\tfinal double c_2b = Math.pow(c, 2.*b);\r\n\t\t\tfinal double c_2b1 = Math.pow(c, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tfinal double xe_b = Math.pow(x+e, b);\r\n\t\t\tfinal double xe_2b = Math.pow(x+e, 2.*b);\r\n\t\t\tfinal double xe_2b1 = Math.pow(x+e, 2.*b+1.);\r\n\t\t\t\r\n\t\t\tgradients[0] = c_b/(xe_b+c_b);\r\n\t\t\tgradients[1] = ((c_b*d-a*c_b)*xe_b*Math.log(x+e)+(a*c_b*Math.log(c)-c_b*Math.log(c)*d)*xe_b)/(xe_2b+2*c_b*xe_b+c_2b);\r\n\t\t\tgradients[2] = -((b*c_b*d-a*b*c_b)*xe_b)/(c*xe_2b+2*c_b1*xe_b+c_2b1);\r\n\t\t\tgradients[3] = xe_b/(xe_b+c_b);\r\n\t\t\tgradients[4] = ((b*c_b*d-a*b*c_b)*xe_b)/(xe_2b1+xe_b*(2*c_b*x+2*c_b*e)+c_2b*x+c_2b*e);\r\n\t\t\treturn gradients;\r\n\t\t}", "private void SGDForPositiveInstance(Instance instance) {\n\t\tint lengthOfDocument = 0; // |d|.\r\n\t\tfor (int frequency : instance.mpFeatureToFrequency.values()) {\r\n\t\t\tlengthOfDocument += frequency;\r\n\t\t}\r\n\t\t// double gValue = getGFunctionValue(lengthOfDocument);\r\n\t\t// double gGradientWithPositiveClass =\r\n\t\t// getGFunctionGradientWithPositiveClass(lengthOfDocument);\r\n\t\t// double gGradientWithNegativeClass =\r\n\t\t// getGFunctionGradientWithNegativeClass(lengthOfDocument);\r\n\r\n\t\tdouble positiveClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[0]);\r\n\t\tdouble negativeClassSum = (param.smoothingPriorForFeatureInNaiveBayes\r\n\t\t\t\t* V + sum_x[1]);\r\n\t\tdouble ratioOfClasses = positiveClassSum / negativeClassSum;\r\n\r\n\t\t// Compute R.\r\n\t\tBigDecimal R = BigDecimal.ONE;\r\n\t\t// Pr(-) / Pr(+).\r\n\t\tR = R.multiply(BigDecimal\r\n\t\t\t\t.valueOf(getProbOfClass(1) / getProbOfClass(0)));\r\n\t\t// ratioOfClasses ^ |d|.\r\n\t\tR = R.multiply(BigDecimal.valueOf(ratioOfClasses).pow(lengthOfDocument));\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\t\t\tdouble ratio = (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]);\r\n\t\t\tR = R.multiply(BigDecimal.valueOf(ratio).pow(frequency));\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the positive class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithPositiveClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator1 = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]));\r\n\t\t\tBigDecimal numerator2 = R.multiply(BigDecimal\r\n\t\t\t\t\t.valueOf(lengthOfDocument / positiveClassSum));\r\n\t\t\tBigDecimal numerator = numerator1.add(numerator2);\r\n\t\t\tBigDecimal denominator = R.add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator.divide(denominator, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).doubleValue()\r\n\t\t\t\t\t- frequency\r\n\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][0]);\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithPositiveClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Compute the gradient of each feature for the negative class.\r\n\t\tMap<Integer, Double> gradientOfFeatureWithNegativeClass = new HashMap<Integer, Double>();\r\n\t\tfor (Map.Entry<Integer, Integer> entry : instance.mpFeatureToFrequency\r\n\t\t\t\t.entrySet()) {\r\n\t\t\tint featureId = entry.getKey();\r\n\t\t\tint frequency = entry.getValue();\r\n\r\n\t\t\tBigDecimal numerator = BigDecimal\r\n\t\t\t\t\t.valueOf(frequency\r\n\t\t\t\t\t\t\t/ (param.smoothingPriorForFeatureInNaiveBayes + x[featureId][1])\r\n\t\t\t\t\t\t\t- lengthOfDocument / negativeClassSum);\r\n\t\t\tBigDecimal denominator = BigDecimal.ONE.divide(R, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).add(BigDecimal.ONE);\r\n\t\t\tdouble gradient = numerator.divide(denominator, 30,\r\n\t\t\t\t\tRoundingMode.HALF_UP).doubleValue();\r\n\t\t\tif (Double.isNaN(gradient)) {\r\n\t\t\t\tSystem.out.println(\"Nan\");\r\n\t\t\t}\r\n\t\t\tgradientOfFeatureWithNegativeClass.put(featureId, gradient);\r\n\t\t}\r\n\r\n\t\t// Note that we need to compute all of the gradients first and then\r\n\t\t// update\r\n\t\t// the counts.\r\n\t\t// Update the count of each feature in this document for positive class.\r\n\t\tupdateXs(instance, gradientOfFeatureWithPositiveClass,\r\n\t\t\t\tgradientOfFeatureWithNegativeClass);\r\n\t}", "public interface FunctionGradient {\n\n /**\n * Gradient vector at the given point.\n *\n * @param point where the gradient is evaluated\n * @return the calculated gradient\n */\n Gradient gradientAt(Point point);\n}", "public void getGradient(Surface srf)\r\n {\r\n srf.x1 = firstPoint.x;\r\n srf.y1 = firstPoint.y;\r\n srf.x2 = secondPoint.x;\r\n srf.y2 = secondPoint.y;\r\n srf.gradientColor = secondColor;\r\n srf.cyclic = cyclic;\r\n srf.reversed = reversed;\r\n }", "public float gradientMethod(Slice slice) \n\t{\n\t\t//\n\t\t// Intialize variables.\n\t\t//\n\t\tint nrows = slice.getNRows();\n\t\tint ncols = slice.getNCols();\n\n\t\tfloat[] v = new float[nrows*ncols]; int v_numset = 0;\n\t\tfloat t = (float)0.0; \n\t\tfloat sig_y = (float)0.0;\n\t\tfloat sig_x = (float)0.0;\n\n\t\t//\n\t\t// Compute the column gradient\n\t\t//\n\t\tfor(int row=0; row<nrows; row++) {\n\t\t\tfor(int col=1; col<ncols-1; col++) {\n\t\t\t\tt = slice.getData(row,col+1) - (float)2.0 * slice.getData(row,col) + slice.getData(row,col-1);\n\n\t\t\t\tif( t != (float)0.0 || slice.getData(row,col) != (float)0.0 ) {\n\t\t\t\t\tv[v_numset] = t; v_numset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( v_numset <= 10 ) {\n\t\t\tsig_y = (float)0.0;\n\t\t}\n\t\telse {\n\t\t\tsig_y = vec_stdDevMod(v, v_numset);\n\t\t}\n\n\t\tv_numset = 0;\n\n\t\t//\n\t\t// Compute the row gradient\n\t\t//\n\t\tfor(int col=0; col<ncols; col++) {\n\t\t\tfor(int row=1; row<nrows-1; row++) {\n\t\t\t\tt = slice.getData(row+1,col) - (float)2.0 * slice.getData(row,col) + slice.getData(row-1,col);\n\n\t\t\t\tif( t != (float)0.0 || slice.getData(row,col) != (float)0.0 ) {\n\t\t\t\t\tv[v_numset] = t; v_numset++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif( v_numset <= 10 ) {\n\t\t\tsig_x = (float)0.0;\n\t\t}\n\t\telse {\n\t\t\tsig_x = vec_stdDevMod(v, v_numset);\n\t\t}\n\n\t\treturn (float)Math.sqrt( (double)(sig_x * sig_x + sig_y * sig_y) ) / (float)2.0;\n\t}", "private void trainPerceptron() {\n\t\t// Creates a log of that contains the percentage each epoch got correct\n\t\tint numWrong = images.size();\n\t\tint numReps = 0;\n\n\t\t// Repeat the training process TIMES_TO_REPEAT number of times or until\n\t\t// there are none wrong\n\t\tfor (int repetition = 0; repetition < TIMES_TO_REPEAT && numWrong != 0; repetition++) {\n\t\t\tint numCorrect = 0;\n\n\t\t\t// Iterate through each image in the set of image\n\t\t\tfor (PerceptronImage image : images) {\n\t\t\t\tdouble netInput = 0;\n\n\t\t\t\t// Work out the net input by evaluating each feature on the\n\t\t\t\t// image\n\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\tnetInput += feature.evaluate(image) * feature.getWeight();\n\t\t\t\t}\n\n\t\t\t\t// If the image is evaluated to be an X\n\t\t\t\tif (netInput <= 0) {\n\t\t\t\t\t// If it actually is an X then record it\n\t\t\t\t\tif (image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t+ feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the image is evaluated to be not an X\n\t\t\t\t\t// If it actually not an X then record it\n\t\t\t\t\tif (!image.isX()) {\n\t\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it is not then re-weight features\n\t\t\t\t\t\tfor (Feature feature : features) {\n\t\t\t\t\t\t\tdouble newWeight = feature.getWeight()\n\t\t\t\t\t\t\t\t\t- feature.evaluate(image) * learningRate;\n\t\t\t\t\t\t\tfeature.setWeight(newWeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Update the number of images wrong for this epoch\n\t\t\tnumWrong = images.size() - numCorrect;\n\n\t\t\t// Modify the learning rate\n\t\t\tif (learningRate > LEARNING_RATE_MINIMUM) {\n\t\t\t\tlearningRate *= LEARNING_RATE_MODIFIER;\n\t\t\t}\n\n\t\t\tnumReps++;\n\t\t}\n\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(\"output.txt\");\n\t\t\t\n\t\t\t// Print out the number of repetitions if the perceptron converged,\n\t\t\t// otherwise print out the number of images that are still classified\n\t\t\t// incorrectly\n\t\t\tif (numWrong == 0) {\n\t\t\t\twriter.println(\"Perceptron converged\");\n\t\t\t\twriter.println(\"Number of repetitions: \" + numReps);\n\t\t\t\tSystem.out.println(\"Perceptron converged\");\n\t\t\t\tSystem.out.println(\"Number of repetitions: \" + numReps);\n\t\t\t} else {\n\t\t\t\twriter.println(\"Perceptron did not converge\");\n\t\t\t\twriter.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t\tSystem.out.println(\"Perceptron did not converge\");\n\t\t\t\tSystem.out.println(\"Number of images still incorrect: \" + numWrong);\n\t\t\t}\n\n\t\t\twriter.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\tSystem.out.println(\"\\nEnding learning Rate: \" + learningRate + \"\\n\");\n\t\t\t\n\t\t\tfor (Feature feature : features){\n\t\t\t\tSystem.out.println(feature.toString());\n\t\t\t\twriter.println(feature.toString());\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private double processImg() {\n\n\t\ttry {\n\t\t\timgPreview.setVisibility(View.VISIBLE);\n\n\t\t\t// bitmap factory\n\t\t\tBitmapFactory.Options options = new BitmapFactory.Options();\n\n\t\t\t// downsizing image as it throws OutOfMemory Exception for larger\n\t\t\t// images\n\t\t\toptions.inSampleSize = 8;\n\n\t\t\tbitmap_ref = BitmapFactory.decodeFile(fileUriSafe.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\tbitmap_sample = BitmapFactory.decodeFile(fileUriMole.getPath(),\n\t\t\t\t\toptions);\n\n\t\t\t//convert from bitmap to Mat\n\t\t\tMat ref = new Mat(bitmap_ref.getHeight(), bitmap_ref.getWidth(), CvType.CV_8UC4);\n\t\t\tMat sample = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\t\t\tMat mask = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC4);\n\t\t\tMat sample2calcgrad = new Mat(bitmap_sample.getHeight(), bitmap_sample.getWidth(), CvType.CV_8UC4);\n\n\t\t\tUtils.bitmapToMat(bitmap_ref, ref);\n\t\t\tUtils.bitmapToMat(bitmap_sample, sample);\n\t\t\tUtils.bitmapToMat(bitmap_sample,sample2calcgrad);\n\n\t\t\t//normalize image based on reference\t\t\t\n\t\t\t//sample = normalizeImg(sample, ref);\n\n\t\t\t//Using Sobel filter to calculate gradient\n\t\t\tMat grad_x = new Mat();\n\t\t\tMat grad_y = new Mat();\n\t\t\tMat abs_grad_x = new Mat();\n\t\t\tMat abs_grad_y = new Mat();\n\t\t\tMat gradVals = new Mat();\n\t\t\tMat sample_gray = new Mat(bitmap_sample.getHeight(),bitmap_sample.getWidth(),CvType.CV_8UC1);\n\t\t\tImgproc.cvtColor(sample2calcgrad, sample_gray, Imgproc.COLOR_BGRA2GRAY);\n\t\t\tImgproc.GaussianBlur(sample_gray, sample_gray, new Size(5,5), 0);\n\n\t\t\t//Gradient X\n\t\t\tImgproc.Sobel(sample_gray, grad_x, CvType.CV_8UC1, 1, 0);\n\t\t\tCore.convertScaleAbs(grad_x, abs_grad_x,10,0);\n\n\t\t\t//Gradient Y\n\t\t\tImgproc.Sobel(sample_gray, grad_y, CvType.CV_8UC1, 0, 1);\n\t\t\tCore.convertScaleAbs(grad_y,abs_grad_y, 10, 0);\n\n\t\t\t//combine with grad = sqrt(gx^2 + gy^2)\n\t\t\tCore.addWeighted(abs_grad_x, .5, abs_grad_y, .5, 0, gradVals);\n\n\n\t\t\t//Using CANNY to further smooth Gaussian blurred image; extract contours\n\t\t\tImgproc.Canny(sample_gray, mIntermediateMat, 80, 90);\n\n\t\t\t//find contours of filtered image\n\t\t\tList <MatOfPoint> contours = new ArrayList<MatOfPoint>();\n\t\t\tImgproc.findContours(mIntermediateMat, contours, mHierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);\n\n\t\t\t// Find max contour area\n\t\t\tdouble maxArea = 0;\n\t\t\tIterator<MatOfPoint> each = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint wrapper = each.next();\n\t\t\t\tdouble area = Imgproc.contourArea(wrapper);\n\t\t\t\tif (area > maxArea)\n\t\t\t\t\tmaxArea = area;\n\t\t\t}\n\n\t\t\t// Filter contours by area and only keep those above thresh value\n\t\t\tmContours.clear();\n\t\t\teach = contours.iterator();\n\t\t\twhile (each.hasNext()) {\n\t\t\t\tMatOfPoint contour = each.next();\n\t\t\t\tif (Imgproc.contourArea(contour) > mMinContourArea*maxArea) {\n\t\t\t\t\tmContours.add(contour);\n\t\t\t\t\tborder.addAll(contour.toList());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//segment border into 8 parts \n\t\t\t//calc gradient along contour segment & normalize based on number of points in border\n\t\t\t//upto 7 points at end of border list ignored\n\t\t\tdouble [] seg_val = new double [8];\n\t\t\tint seg_len = border.size()/8;\n\t\t\tfor(int i = 0; i<8; i++){\n\t\t\t\tdouble contourGradientSum = 0;\n\t\t\t\tfor(int j=i*seg_len; j<(i+1)*seg_len;j++){\n\t\t\t\t\tPoint pt = border.get(j);\n\t\t\t\t\tint x = (int) pt.x;\n\t\t\t\t\tint y = (int) pt.y;\t\t\t\n\t\t\t\t\tcontourGradientSum += Core.mean(gradVals.submat(y-1, y+1, x-1, x+1)).val[0];\n\t\t\t\t}\n\t\t\t\tseg_val[i]=contourGradientSum/seg_len;\n\t\t\t}\n\n\n\t\t\tLog.v(TAG, \"grad vals: [\" + seg_val[0] + \",\" + seg_val[1] + \",\" \n\t\t\t\t\t+ seg_val[2] + \",\"+ seg_val[3] + \",\"\n\t\t\t\t\t+ seg_val[4] + \",\"+ seg_val[5] + \",\"\n\t\t\t\t\t+ seg_val[6] + \",\"+ seg_val[7] + \"]\");\n\t\t\t\n\t\t\tdouble thresh = 140;\n\t\t\tdouble score = 0;\n\n\t\t\tfor(double val:seg_val){\n\t\t\t\tif (val<=thresh){\n\t\t\t\t\tscore++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(score<8){\n\t\t\t\tscore += mContours.size()/7;\n\t\t\t\tscore = Math.min(8,score);\n\t\t\t}\n\n\n\n\t\t\tLog.v(TAG, \"score: \" +score);\n\t\t\tLog.v(TAG, \"Contours count: \" + mContours.size());\n\t\t\tLog.v(TAG, \"Border size: \" + border.size());\n\t\t\tImgproc.drawContours(sample, mContours, -1, CONTOUR_COLOR);\n\t\t\tImgproc.drawContours(mask, mContours, -1, COLOR_WHITE, -1);\n\t\t\tborders = mask;\n\n\t\t\t//display image with contours\n\t\t\tUtils.matToBitmap(sample, bitmap_sample);\n\t\t\timgPreview.setImageBitmap(bitmap_sample);\n\t\t\timgPreview.setFocusable(true);\n\n\t\t\treturn score;\n\n\t\t\t//\t\t\t\n\t\t} catch (NullPointerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn -1;\n\t}", "@java.lang.Override\n public boolean hasFeatureNoiseSigma() {\n return gradientNoiseSigmaCase_ == 2;\n }", "private void testWithBacktrackingInput(LcssAlgorithm algorithm) {\n\t}", "private void compute() {\r\n int i, j, k;\r\n float gx, gy, gz;\r\n for (int q = 0; q < data.length; q++) {\r\n data[q] = new VoxelGradient();\r\n }\r\n\r\n\r\n // gradient at extremes, 0 and dim-1\r\n i = 0;\r\n j = 0;\r\n k = 0;\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * k)))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n i = dimX - 1;\r\n j = dimY - 1;\r\n k = dimZ - 1;\r\n gx = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 1;\r\n gy = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 1;\r\n gz = (volume.data[i + (dimX * (j + (dimY * k)))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 1;\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n //gradient in non-extreme points\r\n for (i = 1; i < dimX - 1; i++) {\r\n for (j = 1; j < dimY - 1; j++) {\r\n for (k = 1; k < dimZ - 1; k++) {\r\n\r\n gx = (volume.data[(i + 1) + (dimX * (j + (dimY * k)))] - volume.data[(i - 1) + (dimX * (j + (dimY * k)))]) / 2;\r\n\r\n gy = (volume.data[i + (dimX * ((j + 1) + (dimY * k)))] - volume.data[i + (dimX * ((j - 1) + (dimY * k)))]) / 2;\r\n\r\n gz = (volume.data[i + (dimX * (j + (dimY * (k + 1))))] - volume.data[i + (dimX * (j + (dimY * (k - 1))))]) / 2;\r\n\r\n data[i + dimX * (j + dimY * k)] = new VoxelGradient(gx, gy, gz);\r\n\r\n\r\n }\r\n }\r\n }\r\n }", "public static void runDecayingRatePerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\nint t=0;\r\ndouble LearningRates[] = {1, 0.1, 0.01};\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n\tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n\tdouble LearningRate = LearningRates[randomNum];\r\n\t\r\n\t\r\nfor(int i=0;i<LearningRates.length;i++)\r\n{\r\nLearningRate = LearningRates[i];\r\ndouble devAccuracyTotal = (double)0;\r\nint noOfEpochs= 20;\r\nint decreaseRate = 0;\r\n\r\n\tDouble w[] = new Double[74500];\r\n\tDouble min =-0.01; // Set To Your Desired Min Value\r\nDouble max = 0.01;\r\n\t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\r\nfor(int epoch=0;epoch<noOfEpochs;epoch++)\r\n{\r\n\t \tw = learnDecayingPerceptron(data,index,LearningRate,decreaseRate,w);\r\n\t \tdecreaseRate = decreaseRate + index;\r\n\r\n}\r\n// \tfor(int i=0;i<w.length;i++)\r\n// \t\t\tSystem.out.println(w[i]);\r\n//print data \t\r\n// \tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n// System.out.println(\"\"+entry.getKey() + \" \" + entry.getValue());\r\n//\t \t}\r\n \t \t\r\n\t//keep decreaseRate increasing across epochs, by increasing 1 for each example.\r\n\tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n\t\r\n//\tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n\r\n\r\nSystem.out.println(\" ** Cv Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\nSystem.out.println(\" \");\r\n}\r\n\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public void backpropagate (FlatLayer flat){\n\t\tDouble [] err = flat.getErrors();\n\t\tDouble [][] weights = flat.getOldWeights();\n\t\tDouble sum;\n\t\tint index;\n\n\t\tfor ( int i = 0; i < poolMaps.size() ; i++){\n\n\t\t\tPoolMap pmap = poolMaps.get(i);\n\n\t\t\tDouble [][] error = pmap.getErrors();\n\n\t\t\tfor(int row = 0; row < error.length; row++){\n\t\t\t\tfor(int col = 0; col < error[0].length; col++){\n\t\t\t\t\t\n\t\t\t\t\tsum = 0.0;\n\t\t\t\t\t\n\t\t\t\t\tfor(int j = 0; j < weights.length; j++){\n\t\t\t\t\t\t\n\t\t\t\t\t\tindex = i * error.length * error[0].length + row * error.length + col;\n\t\t\t\t\t\tsum += weights[j][index]*err[j];\n\n\t\t\t\t\t}\n\t\t\t\t\terror[row][col] = sum;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public void train(double learningR, int index, int i){\n\t\t \n\t\tdouble output = outputL.getIntermediateData(i)[index];\n\t\terrorGradient = output *(1-output) * outputL.getErrorGradient() * outputL.getWeights()[index];\n\t\t\t\t \n\t\t\t\t\n\t\tfor (int j = 0; j < inputs; j++) {\n\t\t\tweights[j] += delta(learningR, data[i][j], errorGradient);\n\t\t}\n\t\t\t\n\t\tthreshold += delta(learningR, -1, errorGradient);\n\t\t\t\n\t\t\t\t\n\t}", "@java.lang.Override\n public boolean hasNoiseSigma() {\n return gradientNoiseSigmaCase_ == 1;\n }", "private void finaliseLinearGradient() {\n\n\t\tif (currentGradient.stopColours.size() > 0) {\n\t\t\tfinal int[] ia = new int[currentGradient.stopColours.size()];\n\n\t\t\tfor (int i = 0; i < ia.length; i++) {\n\t\t\t\tia[i] = currentGradient.stopColours.get(i);\n\t\t\t}\n\n\t\t\tcurrentGradient.shader = new LinearGradient(\n\t\t\t\t\tcurrentGradient.x1,\n\t\t\t\t\tcurrentGradient.y1,\n\t\t\t\t\tcurrentGradient.x2,\n\t\t\t\t\tcurrentGradient.y2,\n\t\t\t\t\tia,\n\t\t\t\t\tnull,\n\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t);\n\n\t\t\t// The shader needs to have a matrix even if no transform was specified in the attributes\n\t\t\t// for the gradient. This is because the gradient's Matrix, even if 'empty', is needed\n\t\t\t// to concatenate the current cumulative transform to during evaluation/drawing.\n\t\t\tif (currentGradient.matrix != null) {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(currentGradient.matrix);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrentGradient.shader.setLocalMatrix(new Matrix());\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentGradient.isRadial = false;\n\t\tgradientList.add(currentGradient);\n\t\tcurrentGradient = new Gradient();\n\n\t}", "@Procedure(value = \"mlp.train\", mode = WRITE)\n @Description(\"Backward pass through NN\")\n public void train(@Name(value = \"no. of passes\") long nPasses) {\n\n DataLogger logger = new DataLogger(\"proto1\", \"error\");\n\n for (int i = 0; i < nPasses; i++) {\n updateTrainRate(i + 1);\n forwardPass();\n\n double error = calculateError();\n\n double reward = 1.0 - error;\n\n// if (Math.random() > 0.9) reward = error;\n\n backwardPass(reward);\n moveNext();\n\n\n// System.out.println(String.format(\"Error: %f\", error));\n// if (i % 100 == 0 && i > 0) {\n// double meanError = errors.stream().reduce(0.0, Double::sum) / 100;\n// System.out.println(String.format(\n// \"Mean error: %f, eta: %f\", meanError, eta));\n// errors.clear();\n// }\n// errors.add(error);\n logger.append(error);\n\n\n }\n\n forwardPass();\n logger.close();\n }", "public ModelParams optimize() throws Exception {\n\t\tint iterCount = 0;\n\t\tdivergence = KLDivergenceCalculator.calculate(cState, tState);\n\t\tSystem.out.println(\"KL Divergence : \" + divergence);\n\t\t// ((DivergenceChart) BeanFinder\n\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t// iterCount, divergence);\n\t\tdouble delta[] = null;\n\t\tdouble theta[] = data.getParams().getParams();\n\t\tdouble newDivergence = 0.0d;\n\t\tdouble initialStep = data.getInitialStepSize();\n\t\tboolean optimized = false;\n\t\tdo {\n\t\t\tdelta = computeGradient(theta);\n\t\t\tfor (double step = initialStep; iterCount < data.getMaxIterations(); step /= 10) {\n\t\t\t\tSystem.out.println(\"Step size : \" + step);\n\t\t\t\tSystem.out.println(\"KL divergence before taking a step : \"\n\t\t\t\t\t\t+ KLDivergenceCalculator.calculate(cState, tState));\n\t\t\t\tfor (int i = 0; i < delta.length; i++) {\n\t\t\t\t\tif (Double.isNaN(delta[i]))\n\t\t\t\t\t\tSystem.out.print(\"delta is NAN!!\" + delta[i] + \", \");\n\t\t\t\t\ttheta[i] -= step * delta[i];\n\t\t\t\t\tSystem.out.print((theta[i]) + \", \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tgetNewState(theta);\n\t\t\t\titerCount++;\n\t\t\t\tnewDivergence = KLDivergenceCalculator\n\t\t\t\t\t\t.calculate(cState, tState);\n\t\t\t\tSystem.out.println(\"KL Divergence : \" + newDivergence);\n\t\t\t\t// ((DivergenceChart) BeanFinder\n\t\t\t\t// .findBean(MetaConstants.BEAN_DIVERGENCE_CHART)).update(\n\t\t\t\t// iterCount, newDivergence);\n\t\t\t\tif (newDivergence < divergence) {\n\t\t\t\t\tdivergence = newDivergence;\n\t\t\t\t\tinitialStep = step;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// before taking the next step size, reset theta to what it was\n\t\t\t\tfor (int i = 0; i < delta.length; i++)\n\t\t\t\t\ttheta[i] += step * delta[i];\n\t\t\t\tgetNewState(theta); // Added for checking. Not required.\n\t\t\t}\n\t\t\toptimized = optimized(theta);\n\t\t} while (!optimized && iterCount < data.getMaxIterations());\n\t\tModelParams optimParams = null;\n\t\tif (optimized) {\n\t\t\toptimParams = new ModelParams();\n\t\t\toptimParams.setParams(theta);\n\t\t}\n\t\treturn optimParams;\n\t}", "public boolean floodCheck() {\r\n return true;\r\n }", "public boolean hasConverged (final NeuralNetwork anotherNet) {\n final double weightDiff = averDiff(anotherNet);\n final double convergeThreshold = learnRate * CONVERGE_FACTOR;\n if (Double.compare(weightDiff, convergeThreshold) < 0) {\n return true;\n } else {\n return false;\n }\n }", "private void completeHrefs() {\n\t\t// Process the gradients\n\t\tfinal Iterator<Gradient> gi = gradientList.iterator();\n\t\tGradient g;\n\t\tint idx;\n\t\twhile (gi.hasNext()) {\n\t\t\tg = gi.next();\n\t\t\tif (g.href != null) {\n\t\t\t\tidx = this.getGradientByIdString(g.href.substring(1));\n\t\t\t\tif (idx != -1) {\n\t\t\t\t\tfinal Gradient xlinkGrad = this.gradientList.get(idx);\n\t\t\t\t\tg.stopColours = xlinkGrad.stopColours;\n\n\t\t\t\t}\n\n\t\t\t\t// TODO: Can't we just insert an object reference to the same shader?\n\n\t\t\t\tfinal int[] ia = new int[g.stopColours.size()];\n\n\t\t\t\tfor (int i = 0; i < ia.length; i++) {\n\t\t\t\t\tia[i] = g.stopColours.get(i);\n\t\t\t\t}\n\n\t\t\t\tif (g.isRadial) {\n\t\t\t\t\tg.shader = new RadialGradient(\n\t\t\t\t\t\t\tg.cx,\n\t\t\t\t\t\t\tg.cy,\n\t\t\t\t\t\t\tg.radius,\n\t\t\t\t\t\t\tia,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse { // linear\n\t\t\t\t\tg.shader = new LinearGradient(\n\t\t\t\t\t\t\tg.x1,\n\t\t\t\t\t\t\tg.y1,\n\t\t\t\t\t\t\tg.x2,\n\t\t\t\t\t\t\tg.y2,\n\t\t\t\t\t\t\tia,\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\tShader.TileMode.CLAMP\n\t\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// The shader needs to have a matrix even if no transform was specified in the attributes\n\t\t\t\t// for the gradient. This is because the gradient's Matrix, even if 'empty', is needed\n\t\t\t\t// to concatenate the current cumulative transform to during evaluation/drawing.\n\t\t\t\tif (g.matrix != null) {\n\t\t\t\t\tg.shader.setLocalMatrix(g.matrix);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tg.shader.setLocalMatrix(new Matrix());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "@Override\n\tpublic Vector3d gradient(Particle p_j) {\n\t\treturn null;\n\t}", "@java.lang.Override\n public boolean hasFeatureNoiseSigma() {\n return gradientNoiseSigmaCase_ == 2;\n }", "private boolean computeSearchDirection() {\n\t\t// Compute the function's gradient\n\t\tfunction.computeGradient(temp0_Nx1.data);\n\n\t\t// compute the change in gradient\n\t\tfor( int i = 0; i < N; i++ ) {\n\t\t\ty.data[i] = temp0_Nx1.data[i] - g.data[i];\n\t\t\tg.data[i] = temp0_Nx1.data[i];\n\t\t}\n\n\t\t// Update the inverse Hessian matrix\n\t\tif( iterations != 0 ) {\n\t\t\tEquationsBFGS.inverseUpdate(B, s, y, temp0_Nx1, temp1_Nx1);\n\t\t}\n\n\t\t// compute the search direction\n\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\n\t\t// use the line search to find the next x\n\t\tif( !setupLineSearch(fx, x.data, g.data, searchVector.data) ) {\n\t\t\t// the search direction has a positive derivative, meaning the B matrix is\n\t\t\t// no longer SPD. Attempt to fix the situation by resetting the matrix\n\t\t\tresetMatrixB();\n\t\t\t// do the search again, it can't fail this time\n\t\t\tCommonOps_DDRM.mult(-1,B,g, searchVector);\n\t\t\tsetupLineSearch(fx, x.data, g.data, searchVector.data);\n\t\t} else if(Math.abs(derivAtZero) <= gtol ) {\n\t\t\tif( verbose != null ) {\n\t\t\t\tverbose.printf(\"finished select direction, gtest=%e\\n\",Math.abs(derivAtZero));\n\t\t\t}\n\n\t\t\t// the input might have been modified by the function. So copy it\n\t\t\tSystem.arraycopy(function.getCurrentState(),0,x.data,0,N);\n\t\t\treturn terminateSearch(true);\n\t\t}\n\n\t\tmode = 1;\n\t\titerations++;\n\t\treturn false;\n\t}", "private static boolean bayesian() {\n\t\tSystem.out.println(\"BAYESIAN\");\n\t\t\n//\t\tFFNeuralNetwork ffnn = new FFNeuralNetwork(ActivationFunction.SIGMOID0p5,5,5);\n\t\tModelLearner modeler = new ModelLearnerHeavy(100, new int[] {}, new int[] {5},\n\t\t\t\tnew int[] {}, ActivationFunction.SIGMOID0p5, 10);\n\t\t\n\t\tCollection<DataPoint> data = new ArrayList<DataPoint>();\n\t\tdata.add(new DataPoint(new double[] {0,0,1,0,0}, new double[] {0,0,0,1,0})); // move right\n\t\tdata.add(new DataPoint(new double[] {0,0,1,0,0}, new double[] {0,1,0,0,0})); // move left\n\t\tdata.add(new DataPoint(new double[] {0,1,0,0,0}, new double[] {1,0,0,0,0})); // move left again\n\t\tdata.add(new DataPoint(new double[] {0,0,0,1,0}, new double[] {0,0,1,0,0})); // move back to center\n\t\tdata.add(new DataPoint(new double[] {0,0,0,1,0}, new double[] {0,0,0,0,0})); // disappear\n\t\t\n//\t\tControlPanel.learnFromBackPropagation(ffnn.getInputNodes(), ffnn.getOutputNodes(), data,\n//\t\t\t\t10000, 1,1,0,0,0,0);\n\t\tfor (DataPoint dp : data) {\n\t\t\tmodeler.observePreState(dp.getInput());\n\t\t\tmodeler.observePostState(dp.getOutput());\n\t\t\tmodeler.saveMemory();\n\t\t}\n\t\tmodeler.learnFromMemory(1.5,0.5,0, false, 1000);\n\t\tmodeler.getTransitionsModule().getNeuralNetwork().report(data);\n\t\t\n\t\tdouble[] foresight = Foresight.montecarlo(modeler, new double[] {0,0,1,0,0}, null, null, 1, 10000, 10, 0.1);\n\t\tfor (double d : foresight) System.out.print(d + \"\t\");\n\t\tSystem.out.println(near(foresight[0],0) && near(foresight[1],0.5) && near(foresight[2],0)\n\t\t\t\t&& near(foresight[3],0.5) && near(foresight[4],0)\n\t\t\t\t? \"montecarlo 1 ok\" : \"montecarlo 1 sucks\");\n\t\tforesight = Foresight.montecarlo(modeler, new double[] {0,0,1,0,0}, null, null, 2, 10000, 10, 0.1);\n\t\tfor (double d : foresight) System.out.print(d + \"\t\");\n\t\tSystem.out.println(near(foresight[0],0.5) && near(foresight[1],0) && near(foresight[2],0.25)\n\t\t\t\t&& near(foresight[3],0) && near(foresight[4],0)\n\t\t\t\t? \"montecarlo 2 ok\" : \"montecarlo 2 sucks\");\n\n\t\treturn false;\n\t}", "public void train(double[] inputs, double[] outputsTarget) {\n assert(outputsTarget.length == weights.get(weights.size() - 1).length);\n \n ArrayList<double[]> layersOutputs = new ArrayList<double[]>(); \n classify(inputs, layersOutputs);\n\n // Calculate sensitivities for the output nodes\n int outputNeuronCount = this.weights.get(this.weights.size() - 1).length;\n double[] nextLayerSensitivities = new double[outputNeuronCount];\n assert(layersOutputs.get(layersOutputs.size() - 1).length == outputNeuronCount);\n for (int i = 0; i < outputNeuronCount; i++) {\n nextLayerSensitivities[i] = calculateErrorPartialDerivitive(\n layersOutputs.get(layersOutputs.size() - 1)[i],\n outputsTarget[i]\n ) * calculateActivationDerivitive(layersOutputs.get(layersOutputs.size() - 1)[i]);\n assert(!Double.isNaN(nextLayerSensitivities[i]));\n }\n\n for (int weightsIndex = this.weights.size() - 1; weightsIndex >= 0; weightsIndex--) {\n int previousLayerNeuronCount = this.weights.get(weightsIndex)[0].length;\n int nextLayerNeuronCount = this.weights.get(weightsIndex).length;\n assert(nextLayerSensitivities.length == nextLayerNeuronCount);\n\n double[] previousLayerOutputs = layersOutputs.get(weightsIndex);\n double[] previousLayerSensitivities = new double[previousLayerNeuronCount];\n\n // Iterate over neurons in the previous layer\n for (int j = 0; j < previousLayerNeuronCount; j++) {\n\n // Calculate the sensitivity of this node\n double sensitivity = 0;\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n sensitivity += nextLayerSensitivities[i] * this.weights.get(weightsIndex)[i][j];\n }\n sensitivity *= calculateActivationDerivitive(previousLayerOutputs[j]);\n assert(!Double.isNaN(sensitivity));\n previousLayerSensitivities[j] = sensitivity;\n\n for (int i = 0; i < nextLayerNeuronCount; i++) {\n double weightDelta = learningRate * nextLayerSensitivities[i] * calculateActivation(previousLayerOutputs[j]);\n this.weights.get(weightsIndex)[i][j] += weightDelta;\n assert(!Double.isNaN(this.weights.get(weightsIndex)[i][j]) && !Double.isInfinite(this.weights.get(weightsIndex)[i][j]));\n }\n }\n\n nextLayerSensitivities = previousLayerSensitivities;\n }\n }", "public interface EmbebbedValidation {\r\n\r\n\tpublic static final int HISTOGRAM_TYPE_A = 0;\r\n\t\r\n\tpublic static final int HISTOGRAM_TYPE_B = 1;\r\n\r\n\tpublic static final int HISTOGRAM_TYPE_C = 2;\r\n\t\r\n\tpublic static final int HISTOGRAM_TYPE_D = 3;\r\n\t\r\n\t/**\r\n\t * Metodo para calcular si un conjunto de bytes cabe en una imagen dada\r\n\t * \r\n\t * @param img la imagen original\r\n\t * @param data los datos a ser embebidos\r\n\t * @return boolean cierto si el conjunto de bytes cabe en la imagen, falso en caso contrario\r\n\t */\r\n\tpublic boolean isValidSize(ImagePlus img, byte[] data);\r\n\t\r\n\t/**\r\n\t * Metodo para calcular el parametro Beta1\r\n\t * \r\n\t * @param g int umbral G\r\n\t * @param t int umbral T\r\n\t * @param m int numero de filas de la matriz M\r\n\t * @param n int numero de columnas de la matriz M\r\n\t * @return int beta1\r\n\t */\r\n\tpublic int getBeta1(int g, int t, int m, int n);\r\n\t\r\n\t/**\r\n\t * Metodo para calcular el parametro Beta2\r\n\t * \r\n\t * @param g int umbral G\r\n\t * @param t int umbral T\r\n\t * @param m int numero de filas de la matriz M\r\n\t * @param n int numero de columnas de la matriz M\r\n\t * @return int beta2 \r\n\t */\r\n\tpublic int getBeta2(int g, int t, int m, int n);\r\n\t\r\n\t\r\n\t/**\r\n\t * Metodo para determinar el tipo de histograma de la imagen y asi definir delta\r\n\t * y modificar el histograma en caso de que sea necesario\r\n\t * \r\n\t * @param img ImagePlus imagen original\r\n\t * @param beta1 int parametro beta1\r\n\t * @param beta2 int parametro beta2\r\n\t * @return int tipo de histograma\r\n\t */\r\n\tpublic int getHistogramType(ImagePlus img, int beta1, int beta2);\r\n\t\r\n\t\r\n\t/**\r\n\t * Metodo para calcular delta, que sera 1 o -1 dependiendo del tipo de histograma\r\n\t * \r\n\t * @param histogramType int el tipo de histograma\r\n\t * @return int el valor de delta\r\n\t */\r\n\tpublic int getDelta(int histogramType);\r\n\t\r\n\t/**\r\n\t * Metodo para reescalar la imagen en caso de que sea tipo D, asi le hacemos el espacio\r\n\t * suficiente para permitir el embebido de datos sumando beta1 y beta2\r\n\t * \r\n\t * @param img ImagePlus la imagen original\r\n\t * @param type int el tipo de histograma de la imagen\r\n\t * @param beta1 int parametro beta1\r\n\t * @param beta2 int parametro beta2\r\n\t * @return ImagePlus la imagen reescalada\r\n\t */\r\n\tpublic ImagePlus reescaleHistogram(ImagePlus img, int type, int beta1, int beta2);\r\n\t\r\n\t\r\n\t/**\r\n\t * Metodo para crear la matriz M de 1's y -1's para un tamaņo dado\r\n\t * \r\n\t * @param m int numero de filas de la matriz M\r\n\t * @param n int numero de columnas de la matriz M\r\n\t * @return int[][] matriz M\r\n\t */\r\n\tpublic int[][] getMatrixM(int m, int n);\r\n\t\r\n\t/**\r\n\t * Numero de bloques en que queda dividida la imagen\r\n\t * \r\n\t * @param img ImagePlus imagen original\r\n\t * @param m int numero de filas de la matriz M\r\n\t * @param n int numero de columnas de la matriz M\r\n\t * @return int numero de bloques\r\n\t */\r\n\tpublic int getNumberOfBlocks(ImagePlus img, int m, int n);\r\n\t\r\n}", "public boolean shouldUpdate() {\n\t\tBinaryInstance binInst = (BinaryInstance) (this._instance);\n\t\tBinaryFeatures binFeats = (BinaryFeatures) binInst.getFeatures();\n\t\tFeatureVector instFeaturesVector = binFeats.getFeatureVector();\n\t\tdouble prediction = MathTools.dotProduct(instFeaturesVector, this._mu);\n\n\t\t// Should we make an update?\n\t\t// Sigma * X\n\t\tthis._sigma_x = MathTools.product(this._sigma, instFeaturesVector);\n\t\t// B = x' * sigma * x;\n\t\tdouble B = FeatureVector.dotProduct(this._sigma_x, instFeaturesVector);\n\t\tBinaryLabel binLabel = (BinaryLabel) binInst.getLabel();\n\t\tdouble Y = binLabel.tag;\n\n\t\tdouble m = prediction * Y;\n\n\t\t// update?\n\t\tthis._update = (m <= this._phi * B) && (B != 0);\n\n\t\tif (this._update) {\n\t\t\tdouble term1 = 1 + 2 * this._phi * m;\n\t\t\tdouble term2 = m - this._phi * B;\n\t\t\tthis._alpha = (-term1 + Math.sqrt(Math.pow(term1, 2) - 8\n\t\t\t\t\t* this._phi * term2))\n\t\t\t\t\t/ (4 * this._phi * B);\n\t\t\tthis._factor = (2 * this._alpha * this._phi)\n\t\t\t\t\t/ (1 + 2 * this._alpha * this._phi * B);\n\t\t}\n\n\t\treturn this._update;\n\t}", "private double calcErrForNeighbour(GNode node) {\n return 0.0;\n }", "private boolean evaluateForFeatureDependency(BaseFeature feature) {\n\t\tif (!feature.getClass().getSuperclass().equals(BaseFeature.class)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (BaseFeature featureBase : features) {\n\t\t\tif (CollectionUtils.isNotEmpty(featureBase.getRequiredFeatures())) {\n\t\t\t\tfor (BaseFeature requiredFeature : featureBase.getRequiredFeatures()) {\n\t\t\t\t\tif (feature == requiredFeature) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public void doValidation(int currentRound)\n {\n getData(currentRound);\n// System.out.println(\"training unterminated ones\");\n kMeans.setItems(trainingData.get(0));\n kMeans.k=k1;\n kMeans.init();\n List<Cluster> unterminatedClusters=kMeans.doCluster();\n for (int i=0;i<unterminatedClusters.size();i++)\n {\n unterminatedClusters.get(i).label=0;\n }\n \n// System.out.println(\"training terminated ones\");\n kMeans.setItems(trainingData.get(1));\n kMeans.k=k2;\n kMeans.init();\n List<Cluster> terminatedClusters=kMeans.doCluster();\n for (int i=0;i<terminatedClusters.size();i++)\n {\n terminatedClusters.get(i).label=1;\n }\n \n List<Cluster> clusters=new ArrayList<Cluster>();\n clusters.addAll(unterminatedClusters);\n clusters.addAll(terminatedClusters);\n kMeans.setClusters(clusters);\n int[] corrects=new int[2];\n int[] counts=new int[2];\n for (int i=0;i<2;i++)\n {\n corrects[i]=0;\n counts[i]=0;\n }\n for (Item item:testData)\n {\n int label=kMeans.getNearestCluster(item).label;\n counts[label]++;\n if (label==item.type)\n {\n corrects[item.type]++;\n }\n }\n correctness+=corrects[1]*1.0/counts[1];\n correctCount+=corrects[1];\n// for (int i=0;i<2;i++)\n// System.out.println(\"for type \"+i+\": \" +corrects[i]+\" correct out of \"+counts[i]+\" in total (\"+corrects[i]*1.0/counts[i]+\")\");\n }", "@Override\n\tpublic Object backward(Object grad_output) {\n\t\treturn null;\n\t}", "public void iteration() {\n\n\t\tfinal ErrorCalculation errorCalculation = new ErrorCalculation();\n\n\t\tfinal Layer inputLayer = this.network.getLayer(BasicNetwork.TAG_INPUT);\n\t\tfinal Layer outputLayer = this.network\n\t\t\t\t.getLayer(BasicNetwork.TAG_OUTPUT);\n\n\t\tfor (final NeuralDataPair pair : this.training) {\n\t\t\t// calculate the error\n\t\t\tfinal NeuralData output = this.network.compute(pair.getInput());\n\n\t\t\tfor (int currentAdaline = 0; currentAdaline < output.size(); \n\t\t\t\tcurrentAdaline++) {\n\t\t\t\tfinal double diff = pair.getIdeal().getData(currentAdaline)\n\t\t\t\t\t\t- output.getData(currentAdaline);\n\n\t\t\t\t// weights\n\t\t\t\tfor (int i = 0; i < inputLayer.getNeuronCount(); i++) {\n\t\t\t\t\tfinal double input = pair.getInput().getData(i);\n\t\t\t\t\tthis.synapse.getMatrix().add(i, currentAdaline,\n\t\t\t\t\t\t\tthis.learningRate * diff * input);\n\t\t\t\t}\n\n\t\t\t\t// threshold (bias)\n\t\t\t\tdouble t = outputLayer.getThreshold(currentAdaline);\n\t\t\t\tt += this.learningRate * diff;\n\t\t\t\toutputLayer.setThreshold(currentAdaline, t);\n\t\t\t}\n\n\t\t\terrorCalculation.updateError(output, pair.getIdeal());\n\t\t}\n\n\t\t// set the global error\n\t\tsetError(errorCalculation.calculateRMS());\n\t}", "public static Mat computeXGradient(Mat mat) {\n\t Mat output = new Mat(mat.rows(), mat.cols(), CvType.CV_32F);\r\n\t for (byte y = 0; y < mat.rows(); ++y) {\r\n\t Mat mr = mat.row(y);\r\n\t output.put(y,0, mr.get(0,1)[0] - mr.get(0,0)[0]);\r\n\t for (byte x = 1; x < mat.cols() - 1; ++x) {\r\n\t output.put(y,x, (mr.get(0,x+1)[0] - mr.get(0,x-1)[0])/2.0);\r\n\t }\r\n\t }\r\n\t return output;\r\n\t}", "public FFANNAdaptiveBackPropagationJSP()\n\t{\n\t\t//run(network, numberInputNeurons, numberHiddenNeurons, numberOutputNeurons, trainingSet);\n\t}", "protected float computeModelScoreOnValidation() {\n/* 549 */ float score = computeModelScoreOnValidation(0, this.validationSamples.size() - 1);\n/* 550 */ return score / this.validationSamples.size();\n/* */ }", "boolean addHardLoss();", "public boolean applyErrors() {\n\t\t/*\n\t\tdouble erreur = Math.random(); // on genere un nombre entre 0 et 1\n\t\tSystem.out.print(this.error*erreur + \"\\n\");\n\t\tif (erreur * this.error < 0.07) { // on multiplie l'erreur aleatoire par l'error de la sonde (qui sera aussi compris entre 0 et 1)\n\t\t\treturn true;\t\t\t\t// si l'erreur finle (produit des deux erreur) est inferieur a 20%\n\t\t}\n\t\treturn false;\n\t\t*/\n\t\treturn true;\n\t}", "public double Learn()\n\t{\n\t\t// initialize the data structures\n\t\tInitialize();\n\t\tfor(int iter = 0; iter < 1000; iter++)\n\t\t\tLearnFOnlyW();\n\t\t\n\t\tList<Double> lossHistory = new ArrayList<Double>();\n\t\tlossHistory.add(Double.MIN_VALUE);\n\t\t\n\t\t// apply the stochastic gradient descent in a series of iterations\n\t\tfor(int iter = 0; iter < maxIter; iter++)\n\t\t{\n\t\t\t// learn the shapelets and the weights\n\t\t\tLearnF();\n\t\t\t\n\t\t\t// measure the loss\n\t\t\tif( iter % 500 == 0)\n\t\t\t{\n\t\t\t\tdouble mcrTrain = GetMCRTrainSet();\n\t\t\t\tdouble mcrTest = GetMCRTestSet();\n\t\t\t\t\n\t\t\t\tdouble lossTrain = AccuracyLossTrainSet();\n\t\t\t\tdouble lossTest = AccuracyLossTestSet();\n\t\t\t\t\n\t\t\t\tlossHistory.add(lossTrain);\n\t\t\t\t\n\t\t\t\tLogging.println(\"It=\" + iter + \", lossTrain=\"+ lossTrain + \", lossTest=\"+ lossTest +\n\t\t\t\t\t\t\t\t\", MCRTrain=\" +mcrTrain + \", MCRTest=\" +mcrTest , LogLevel.DEBUGGING_LOG);\n\t\t\t\t\n\t\t\t\tif( Double.isNaN(lossTrain) )\n\t\t\t\t{\n\t\t\t\t\titer = 0;\n\t\t\t\t\teta /= 3;\n\t\t\t\t\t\n\t\t\t\t\tInitialize();\n\t\t\t\t\t\n\t\t\t\t\tLogging.println(\"Divergence detected. Restarting at eta=\" + eta, LogLevel.DEBUGGING_LOG);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//eta *= 0.9;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t// print shapelets for debugging purposes\n\t\t//PrintShapelets();\n\t\t\n\t\t//Logging.print(M_i, System.out, LogLevel.DEBUGGING_LOG); \n\t\t\n\t\treturn GetMCRTestSet(); \n\t}", "@Override\n public void calculate(double[] x) {\n\n double prob = 0.0; // the log prob of the sequence given the model, which is the negation of value at this point\n Triple<double[][], double[][], double[][]> allParams = separateWeights(x);\n double[][] linearWeights = allParams.first();\n double[][] W = allParams.second(); // inputLayerWeights \n double[][] U = allParams.third(); // outputLayerWeights \n\n double[][] Y = null;\n if (flags.softmaxOutputLayer) {\n Y = new double[U.length][];\n for (int i = 0; i < U.length; i++) {\n Y[i] = ArrayMath.softmax(U[i]);\n }\n }\n\n double[][] What = emptyW();\n double[][] Uhat = emptyU();\n\n // the expectations over counts\n // first index is feature index, second index is of possible labeling\n double[][] E = empty2D();\n double[][] eW = emptyW();\n double[][] eU = emptyU();\n\n // iterate over all the documents\n for (int m = 0; m < data.length; m++) {\n int[][][] docData = data[m];\n int[] docLabels = labels[m];\n\n // make a clique tree for this document\n CRFCliqueTree cliqueTree = CRFCliqueTree.getCalibratedCliqueTree(docData, labelIndices, numClasses, classIndex,\n backgroundSymbol, new NonLinearCliquePotentialFunction(linearWeights, W, U, flags));\n\n // compute the log probability of the document given the model with the parameters x\n int[] given = new int[window - 1];\n Arrays.fill(given, classIndex.indexOf(backgroundSymbol));\n int[] windowLabels = new int[window];\n Arrays.fill(windowLabels, classIndex.indexOf(backgroundSymbol));\n\n if (docLabels.length>docData.length) { // only true for self-training\n // fill the given array with the extra docLabels\n System.arraycopy(docLabels, 0, given, 0, given.length);\n System.arraycopy(docLabels, 0, windowLabels, 0, windowLabels.length);\n // shift the docLabels array left\n int[] newDocLabels = new int[docData.length];\n System.arraycopy(docLabels, docLabels.length-newDocLabels.length, newDocLabels, 0, newDocLabels.length);\n docLabels = newDocLabels;\n }\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n int label = docLabels[i];\n double p = cliqueTree.condLogProbGivenPrevious(i, label, given);\n if (VERBOSE) {\n System.err.println(\"P(\" + label + \"|\" + ArrayMath.toString(given) + \")=\" + p);\n }\n prob += p;\n System.arraycopy(given, 1, given, 0, given.length - 1);\n given[given.length - 1] = label;\n }\n\n // compute the expected counts for this document, which we will need to compute the derivative\n // iterate over the positions in this document\n for (int i = 0; i < docData.length; i++) {\n // for each possible clique at this position\n System.arraycopy(windowLabels, 1, windowLabels, 0, window - 1);\n windowLabels[window - 1] = docLabels[i];\n for (int j = 0; j < docData[i].length; j++) {\n Index<CRFLabel> labelIndex = labelIndices[j];\n // for each possible labeling for that clique\n int[] cliqueFeatures = docData[i][j];\n double[] As = null;\n double[] fDeriv = null;\n double[][] yTimesA = null;\n double[] sumOfYTimesA = null;\n\n if (j == 0) {\n As = NonLinearCliquePotentialFunction.hiddenLayerOutput(W, cliqueFeatures, flags);\n fDeriv = new double[inputLayerSize];\n double fD = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (useSigmoid) {\n fD = As[q] * (1 - As[q]); \n } else {\n fD = 1 - As[q] * As[q]; \n }\n fDeriv[q] = fD;\n }\n\n // calculating yTimesA for softmax\n if (flags.softmaxOutputLayer) {\n double val = 0;\n\n yTimesA = new double[outputLayerSize][numHiddenUnits];\n for (int ii = 0; ii < outputLayerSize; ii++) {\n yTimesA[ii] = new double[numHiddenUnits];\n }\n sumOfYTimesA = new double[outputLayerSize];\n\n for (int k = 0; k < outputLayerSize; k++) {\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Yk = Y[0];\n } else {\n Yk = Y[k];\n }\n double sum = 0;\n for (int q = 0; q < inputLayerSize; q++) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n val = As[q] * Yk[hiddenUnitNo];\n yTimesA[k][hiddenUnitNo] = val;\n sum += val;\n }\n }\n sumOfYTimesA[k] = sum;\n }\n }\n\n // calculating Uhat What\n int[] cliqueLabel = new int[j + 1];\n System.arraycopy(windowLabels, window - 1 - j, cliqueLabel, 0, j + 1);\n\n CRFLabel crfLabel = new CRFLabel(cliqueLabel);\n int givenLabelIndex = labelIndex.indexOf(crfLabel);\n double[] Uk = null;\n double[] UhatK = null;\n double[] Yk = null;\n double[] yTimesAK = null;\n double sumOfYTimesAK = 0;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n UhatK = Uhat[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[givenLabelIndex];\n UhatK = Uhat[givenLabelIndex];\n if (flags.softmaxOutputLayer) {\n Yk = Y[givenLabelIndex];\n }\n }\n\n if (flags.softmaxOutputLayer) {\n yTimesAK = yTimesA[givenLabelIndex];\n sumOfYTimesAK = sumOfYTimesA[givenLabelIndex];\n }\n\n for (int k = 0; k < inputLayerSize; k++) {\n double deltaK = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n int hiddenUnitNo = k / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n UhatK[hiddenUnitNo] += (yTimesAK[hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesAK);\n deltaK *= Yk[hiddenUnitNo];\n } else {\n UhatK[hiddenUnitNo] += As[k];\n deltaK *= Uk[hiddenUnitNo];\n }\n }\n } else {\n UhatK[k] += As[k];\n if (useOutputLayer) {\n deltaK *= Uk[k];\n }\n }\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n if (useOutputLayer) {\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (k % outputLayerSize == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n } else {\n if (k == givenLabelIndex) {\n double[] WhatK = What[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n WhatK[cliqueFeatures[n]] += deltaK;\n }\n }\n }\n }\n }\n\n for (int k = 0; k < labelIndex.size(); k++) { // labelIndex.size() == numClasses\n int[] label = labelIndex.get(k).getLabel();\n double p = cliqueTree.prob(i, label); // probability of these labels occurring in this clique with these features\n if (j == 0) { // for node features\n double[] Uk = null;\n double[] eUK = null;\n double[] Yk = null;\n if (flags.tieOutputLayer) {\n Uk = U[0];\n eUK = eU[0];\n if (flags.softmaxOutputLayer) {\n Yk = Y[0];\n }\n } else {\n Uk = U[k];\n eUK = eU[k];\n if (flags.softmaxOutputLayer) {\n Yk = Y[k];\n }\n }\n if (useOutputLayer) {\n for (int q = 0; q < inputLayerSize; q++) {\n double deltaQ = 1;\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n int hiddenUnitNo = q / outputLayerSize;\n if (flags.softmaxOutputLayer) {\n eUK[hiddenUnitNo] += (yTimesA[k][hiddenUnitNo] - Yk[hiddenUnitNo] * sumOfYTimesA[k]) * p;\n deltaQ = Yk[hiddenUnitNo];\n } else {\n eUK[hiddenUnitNo] += As[q] * p;\n deltaQ = Uk[hiddenUnitNo];\n }\n }\n } else {\n eUK[q] += As[q] * p;\n deltaQ = Uk[q];\n }\n if (useHiddenLayer)\n deltaQ *= fDeriv[q];\n if (flags.sparseOutputLayer || flags.tieOutputLayer) {\n if (q % outputLayerSize == k) {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n } else {\n double[] eWq = eW[q];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWq[cliqueFeatures[n]] += deltaQ * p;\n }\n }\n }\n } else {\n double deltaK = 1;\n if (useHiddenLayer)\n deltaK *= fDeriv[k];\n double[] eWK = eW[k];\n for (int n = 0; n < cliqueFeatures.length; n++) {\n eWK[cliqueFeatures[n]] += deltaK * p;\n }\n }\n } else { // for edge features\n for (int n = 0; n < cliqueFeatures.length; n++) {\n E[cliqueFeatures[n]][k] += p;\n }\n }\n }\n }\n }\n }\n\n if (Double.isNaN(prob)) { // shouldn't be the case\n throw new RuntimeException(\"Got NaN for prob in CRFNonLinearLogConditionalObjectiveFunction.calculate()\");\n }\n\n value = -prob;\n if(VERBOSE){\n System.err.println(\"value is \" + value);\n }\n\n // compute the partial derivative for each feature by comparing expected counts to empirical counts\n int index = 0;\n for (int i = 0; i < E.length; i++) {\n int originalIndex = edgeFeatureIndicesMap.get(i);\n\n for (int j = 0; j < E[i].length; j++) {\n derivative[index++] = (E[i][j] - Ehat[i][j]);\n if (VERBOSE) {\n System.err.println(\"linearWeights deriv(\" + i + \",\" + j + \") = \" + E[i][j] + \" - \" + Ehat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n if (index != edgeParamCount)\n throw new RuntimeException(\"after edge derivative, index(\"+index+\") != edgeParamCount(\"+edgeParamCount+\")\");\n\n for (int i = 0; i < eW.length; i++) {\n for (int j = 0; j < eW[i].length; j++) {\n derivative[index++] = (eW[i][j] - What[i][j]);\n if (VERBOSE) {\n System.err.println(\"inputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eW[i][j] + \" - \" + What[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n\n\n if (index != beforeOutputWeights)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != beforeOutputWeights(\"+beforeOutputWeights+\")\");\n\n if (useOutputLayer) {\n for (int i = 0; i < eU.length; i++) {\n for (int j = 0; j < eU[i].length; j++) {\n derivative[index++] = (eU[i][j] - Uhat[i][j]);\n if (VERBOSE) {\n System.err.println(\"outputLayerWeights deriv(\" + i + \",\" + j + \") = \" + eU[i][j] + \" - \" + Uhat[i][j] + \" = \" + derivative[index - 1]);\n }\n }\n }\n }\n\n if (index != x.length)\n throw new RuntimeException(\"after W derivative, index(\"+index+\") != x.length(\"+x.length+\")\");\n\n int regSize = x.length;\n if (flags.skipOutputRegularization || flags.softmaxOutputLayer) {\n regSize = beforeOutputWeights;\n }\n\n // incorporate priors\n if (prior == QUADRATIC_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w / 2.0 / sigmaSq;\n derivative[i] += k * w / sigmaSq;\n }\n } else if (prior == HUBER_PRIOR) {\n double sigmaSq = sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double w = x[i];\n double wabs = Math.abs(w);\n if (wabs < epsilon) {\n value += w * w / 2.0 / epsilon / sigmaSq;\n derivative[i] += w / epsilon / sigmaSq;\n } else {\n value += (wabs - epsilon / 2) / sigmaSq;\n derivative[i] += ((w < 0.0) ? -1.0 : 1.0) / sigmaSq;\n }\n }\n } else if (prior == QUARTIC_PRIOR) {\n double sigmaQu = sigma * sigma * sigma * sigma;\n for (int i = 0; i < regSize; i++) {\n double k = 1.0;\n double w = x[i];\n value += k * w * w * w * w / 2.0 / sigmaQu;\n derivative[i] += k * w / sigmaQu;\n }\n }\n }", "public static void test(ArrayList<Image> img){\n\t\t\n\t\tdouble avCutoff = 0;\n\t\tdouble avAcc = 0 ;\n\t\tdouble adjCut = 0;\n\t\tint n = 100;\n\t\tfor(int i = 0; i < n; i++){\n\t\t\tPerceptron p = new Perceptron(img);\n\t\t\tp.start();\n\t\t\tavCutoff = avCutoff + p.cuttoff;\n\t\t\tavAcc = avAcc + p.Acc;\n\t\t\tif(p.cuttoff < 1000){adjCut = adjCut + p.cuttoff;}\n\t\t}\n\t\tSystem.out.println(\"Average cut-off of all runs: \" + (avCutoff/n));\n\t\tSystem.out.println(\"Average accuracy: \" + (avAcc/n));\n\t\tSystem.out.println(\"Average accuracy of successful runs: \" + (adjCut/n));\n\t}", "boolean isDegraded();", "boolean addEasyLoss();", "boolean isSkipCalculations();", "boolean isForwardPredicted()\n {\n return ((mbType & FORWARD) != 0);\n }", "public static Double[] learnSimplePerceptronRound2(Data data1[],int index,double LearningRate,Double w[],HashMap<Integer, Integer> words)\r\n \t{\r\n \t\t//Double w[] = new Double[20]; \r\n \t/*\tDouble min =-0.01; // Set To Your Desired Min Value\r\n\t Double max = 0.01;\r\n \t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n \t\tArrays.fill(w, smallRandNumber);*/\r\n \t\t\r\n \t\tData data[] = Arrays.copyOf(data1,index);\r\n \t\t\r\n \t\t//shuffle the data..\r\n \t \tArrayList<Data> arrayList = new ArrayList<Data>(Arrays.asList(Arrays.copyOf(data,index))); \r\n \t\tCollections.shuffle(arrayList,new Random(10));\r\n \t\tdata = arrayList.toArray(new Data[arrayList.size()]);\r\n \t\tfor(int i=0;i<index;i++)\r\n \t\t{\r\n \t\t\tdouble trueLabel;\r\n \t\t\tdouble predictedLabel;\r\n \t\t\tdouble dotProduct_wT_x = 0.0f;\r\n \t\t\tHashMap<Integer, Double> x = new HashMap<Integer, Double>();\r\n \t\t \r\n \t\t\ttrueLabel = data[i].getY();\r\n \t\t\tx= data[i].getX();\r\n \t\t\tboolean correct=false;\r\n \t\t\t// loop till its corrects..\r\n \t\t\t\r\n \t\t\twhile(correct==false)\r\n \t\t\t{\r\n \t\t\t//wT*x (contains bias)\r\n \t\t\tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n \t\t\t\tdotProduct_wT_x = dotProduct_wT_x + w[entry.getKey()] * entry.getValue();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//predict the label\r\n \t\t\tif(dotProduct_wT_x < 0)\r\n \t\t\t\tpredictedLabel = -1;\r\n \t\t\telse\t\r\n \t\t\t\tpredictedLabel = +1;\r\n \t\t\t\r\n \t\t\t//check if prediction is correct, if not update the weight vector and bias.\r\n \t\t\tif(predictedLabel != trueLabel)\r\n \t\t//\tif(dotProduct_wT_x<0)\r\n \t\t\t{\r\n \t\t\t\t//update bias\r\n \t\t\t\tw[0]=w[0]+trueLabel*LearningRate;\r\n \t\t\t\t\r\n \t\t\t\t//update all other weights only if those words are worthy tracking\r\n \t\t\t\r\n \t\t\t\tfor(int j=1;j<w.length;j++)\r\n \t\t\t\t{\r\n \t\t\t\t\t// if(x.containsKey(j))\r\n \t\t\t\t if(x.containsKey(j))\r\n \t\t\t\t//\t if(words.containsKey(j)) //give more weightage to words that matter\r\n \t\t\t//\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*(x.get(j));\r\n \t\t\t\t//\t else\r\n\t\t\t\t\t\t\tw[j]=w[j]+LearningRate*trueLabel*x.get(j);\r\n\r\n \t\t\t\t//\telse\r\n \t\t\t//\t\t\tw[j]=(double)0;\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\telse\r\n \t\t\t\tcorrect=true;\r\n \t\t }\r\n \t\t}\r\n \t\treturn w;\r\n \t}", "public boolean checkChangeDetection() throws Exception{\n\t\t\tint length = -1 ;\n\t\t\tFuzzyRule ruleRemove = null ;\n\t\t\tfor (FuzzyRule rule: rs){\n\t\t\t\tif (rule.getChangeStatus()){\n\t\t\t\t\tif (rule.getHistory().size()>length){\n\t\t\t\t\t\tlength = rule.getHistory().size() ;\n\t\t\t\t\t\tif (rule!=defaultRule)\n\t\t\t\t\t\t\truleRemove = rule ;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tboolean drift = false ;\n\t\t\tif (ruleRemove!=null && rs.size()>1){\n\t\t\t\tif (chooseSingleRuleOption.isSet()) {\n\t\t\t\t\trs.remove(ruleRemove) ;\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tfor (FuzzyRule rule: rs){ \n\t\t\t\t\t\tif (rule!=ruleRemove){\n\t\t\t\t\t\t\tboolean tempDrift = rule.mergeWithSibling(ruleRemove) ;\n\t\t\t\t\t\t\tif (tempDrift){\n\t\t\t\t\t\t\t\trule.clearExtendedCandidates();\n\t\t\t\t\t\t\t\trule.clearStats();\n\t\t\t\t\t\t\t\trule.buildExtendedCandidates();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t drift = drift || tempDrift ;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trs.remove(ruleRemove) ;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\treturn drift ;\n\t\t}", "public void checkStopGraphAndNextStep() {\r\n\t\tif (this.stopGraph != null)\r\n\t\t\tthis.stepPanel.setStep(StepPanel.STEP_CRITICAL_PAIRS);\r\n\t}", "public static void completeEvaluation(NeuralNetwork<BackPropagation> neuralNet, DataSet dataSet) {\n\n NeuralNetworkEvaluationService neuralNetworkEvaluationService = new NeuralNetworkEvaluationService();\n neuralNetworkEvaluationService.add(ErrorEvaluator.class, new ErrorEvaluator(new MeanSquaredError()));\n neuralNetworkEvaluationService.add(MetricsEvaluator.class, MetricsEvaluator.createEvaluator(dataSet));\n\n neuralNetworkEvaluationService.evaluate(neuralNet, dataSet);\n\n LOG.info(\"#################################################\");\n LOG.info(\"Errors: \");\n LOG.info(\"MeanSquare Error: \" + neuralNetworkEvaluationService.resultFor(ErrorEvaluator.class).getEvaluationResult());\n LOG.info(\"#################################################\");\n LOG.info(\"Metrics: \");\n MetricResult result = neuralNetworkEvaluationService.resultFor(MetricsEvaluator.class).getEvaluationResult();\n LOG.info(\"Accuracy: \" + result.getAccuracy());\n LOG.info(\"Error Rate: \" + result.getError());\n LOG.info(\"Precision: \" + result.getPrecision());\n LOG.info(\"Recall: \" + result.getRecall());\n LOG.info(\"FScore: \" + result.getFScore());\n LOG.info(\"#################################################\");\n }", "boolean hasScaler();", "public static void gbpusdDEbest(String dir) {\n \n /**\n * Settings of the evolutionary algorithm - Differential Evolution\n */\n \n Algorithm de;\n int dimension = dim; //Length of an individual - when using functions in GFS with maximum number of required arguments max_arg = 2, 2/3 are designated for program, 1/3 for constant values - for 60 it is 40 and 20\n int NP = 75; //Size of the population - number of competitive solutions\n int generations = gen; //Stopping criterion - number of generations in evolution\n int MAXFES = generations * NP; //Number of fitness function evaluations\n double f = 0.5, cr = 0.8; //Scaling factor f and crossover rate cr\n AP.util.random.Random generator = new AP.util.random.UniformRandom(); //Random number generator\n \n /**\n * Symbolic regression part\n * \n * Settings of the dataset which is regressed\n * Example: Sextic problem\n */\n \n // 50 points from range <-1, 1>, another type of data providing is possible\n double[][] dataset_points = dataset;\n ArrayList<AP_object> GFS = new ArrayList<>();\n GFS.add(new AP_Plus()); //Addition\n GFS.add(new AP_Sub()); //Subtraction\n GFS.add(new AP_Multiply()); //Mulitplication\n GFS.add(new AP_Div()); //Divison\n GFS.add(new AP_Abs());\n GFS.add(new AP_Cos());\n GFS.add(new AP_Cubic());\n GFS.add(new AP_Exp());\n GFS.add(new AP_Ln());\n GFS.add(new AP_Log10());\n GFS.add(new AP_Mod());\n GFS.add(new AP_Quad());\n GFS.add(new AP_Sin());\n GFS.add(new AP_Sigmoid());\n GFS.add(new AP_Sqrt());\n GFS.add(new AP_Tan());\n GFS.add(new AP_aTOb());\n GFS.add(new AP_x1()); //Independent variable x1\n// GFS.add(new AP_Const_static()); //Constant object - value is evolved in the extension of the individuals\n //More functions and terminals for GFS can be found or added to model.ap.objects\n \n double const_min = -10; //Minimum value of constants\n double const_max = 10; //Maximum value of constants\n \n APtf tf = new APdataset(dataset_points, GFS, const_min, const_max); //Dataset constructor\n\n /**\n * Additional variables\n */\n \n int runs = run_count; //Number of runs of the regression\n \n double min; //Helping variable for best individual in terms of fitness function value\n double[] bestArray = new double[runs]; //Array for statistics\n int i, best; //Additional helping variables\n\n /**\n * Runs of the algorithm with statistical analysis\n */\n for (int k = 0; k < runs; k++) {\n\n best = 0;\n i = 0;\n min = Double.MAX_VALUE;\n \n de = new AP_DEbest(dimension, NP, MAXFES, tf, generator, f, cr, null);\n\n de.run();\n\n PrintWriter writer;\n\n try {\n writer = new PrintWriter(dir + tf.name() + \"-DEbest\" + k + \".txt\", \"UTF-8\");\n\n writer.print(\"{\");\n \n for (int ii = 0; ii < ((AP_DEbest)de).getBestHistory().size(); ii++) {\n\n writer.print(String.format(Locale.US, \"%.10f\", ((AP_DEbest)de).getBestHistory().get(ii).fitness));\n\n if (ii != ((AP_DEbest)de).getBestHistory().size() - 1) {\n writer.print(\",\");\n }\n\n }\n\n writer.print(\"}\");\n\n writer.close();\n\n } catch (FileNotFoundException | UnsupportedEncodingException ex) {\n Logger.getLogger(AP_LSHADE.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n bestArray[k] = de.getBest().fitness - tf.optimum();\n\n /**\n * AP best result value and equation.\n */\n\n System.out.println(\"=================================\");\n System.out.println(\"Best obtained fitness function value: \\n\" + (de.getBest().fitness - tf.optimum()));\n System.out.println(\"Equation: \\n\" + ((AP_Individual) de.getBest()).equation);\n System.out.println(\"Vector: \\n\" + Arrays.toString(((AP_Individual) de.getBest()).vector));\n System.out.println(\"=================================\");\n \n for(AP_Individual ind : ((AP_DEbest)de).getBestHistory()){\n i++;\n if(ind.fitness < min){\n min = ind.fitness;\n best = i;\n }\n if(ind.fitness == 0){\n System.out.println(\"Solution found in \" + i + \" CFE\");\n break;\n }\n }\n System.out.println(\"Best solution found in \" + best + \" CFE\");\n \n System.out.println(\"\\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\n\");\n \n \n }\n\n System.out.println(\"=================================\");\n System.out.println(\"Min: \" + DoubleStream.of(bestArray).min().getAsDouble());\n System.out.println(\"Max: \" + DoubleStream.of(bestArray).max().getAsDouble());\n System.out.println(\"Mean: \" + new Mean().evaluate(bestArray));\n System.out.println(\"Median: \" + new Median().evaluate(bestArray));\n System.out.println(\"Std. Dev.: \" + new StandardDeviation().evaluate(bestArray));\n System.out.println(\"=================================\");\n \n }", "public void updateAdaGrad(double learningRate, int batchsize) {\n\t}", "public double[] feedForward(BufferedImage img) {\n\n double[] out = new double[3];\n try {\n double[][][] input = MathTools.mapArray(ImageManager.convertRGB2D(ImageManager.getSquaredImage(img, imageSize)), 0, 255, 0, 1);\n\n Matrix[] in = new Matrix[3];\n\n for (int i = 0; i < in.length; i++) {\n in[i] = new Matrix(input[i]);\n }\n\n cnn.setInputs(in);\n\n out = cnn.feedForward();\n } catch (IOException e) {\n System.out.println(\"Erreur lors du chargement de l'image\");\n }\n\n repaint();\n\n return out;\n\n }", "@Override\n\tpublic boolean validateTrustworthiness(MFeatureVersion fv_official,\tMFeatureVersion fv2, String graph) {\n\t\tMTrustworthinessTandr trustworthiness = (MTrustworthinessTandr) fv2.getTrustworthiness();\n\t\t\n\t\tdouble dirEffectWeight = 1;\n\t\tdouble indEffectWeight = 0;\n\t\tdouble tempEffectWeight = 0;\n\t\t\n//\t\tdouble dirEffectWeight = 0.3333333;\n//\t\tdouble indEffectWeight = 0.3333333;\n//\t\tdouble tempEffectWeight = 0.3333333;\n\t\tdouble trustValue = 0.0;\n\t\t\t\n\t\ttrustValue = trustValue + (dirEffectWeight * trustworthiness.getDirectEffect().validateTrustworthiness(fv_official, fv2)) ;\n//\t\ttrustValue = trustValue + (indEffectWeight * trustworthiness.getIndirectEffect().validateTrustworthiness(fv1, fv2));\n//\t\ttrustValue = trustValue + (tempEffectWeight * trustworthiness.getTemporalEffect().validateTrustworthiness(fv1, fv2));\n\t\t\n\t\ttrustworthiness.setValue(trustValue);\n\t\ttrustworthiness.setComputedAt(fv2.getIsValidFrom());\n\t\t\n\t\tfoundation.create(trustworthiness, graph);\n\t\t\n\t\treturn true;\n\t}", "void BP(Double learningRate){ //call BP() on each neuron except Bias Neuron\n for (int i = 0; i < neurons.size() -1; i++){\n neurons.get(i).BP(learningRate);\n }\n }", "public ArrayList<Double> calculateForward(ArrayList<Example> data) {\n\t\t// store outputs from hidden layer for each example\n\t\t// array will have size # examples.\n\t\tArrayList<Double> nodeOutputs = new ArrayList<Double>();\n\n\t\t// randomly shuffle training data\n\t\tCollections.shuffle(data);\n\n\t\t// go through each example and calculate forwards\n\t\tfor (Example ex : data) {\n\t\t\t// get associated weight in hiddenWeights & calculate dot product,\n\t\t\t// run through tanh function\n\t\t\tdouble bias = ex.getFeature(ex.getFeatureSet().size() - 1);\n\t\t\tArrayList<Double> thisNodeOutputs = new ArrayList<Double>();\n\t\t\t// loop through features, and the weight vector for each feature\n\t\t\tfor (int n = 0; n < numHidden; n++) {\n\t\t\t\tdouble thisNode = 0.0; // get dot product of f & h for each node\n\t\t\t\tArrayList<Double> weightVec = hiddenWeights.get(n);\n\t\t\t\tSet<Integer> features = ex.getFeatureSet();\n\t\t\t\tIterator<Integer> iter = features.iterator();\n\t\t\t\tfor (int i = 0; i < features.size(); i++) {\n\t\t\t\t\tdouble featureVal = ex.getFeature(iter.next());\n\t\t\t\t\tdouble weight = weightVec.get(i);\n\t\t\t\t\tthisNode += weight * featureVal;\n\t\t\t\t}\n\t\t\t\tthisNodeOutputs.add(Math.tanh(thisNode * bias));\n\t\t\t}\n\t\t\thiddenOutputs.add(thisNodeOutputs);\n\t\t\t// now do same for output layer\n\t\t\tdouble outSum = 0.0;\n\t\t\tfor (int i = 0; i < numHidden; i++) {\n\t\t\t\tdouble w = layerTwoWeights.get(i);\n\t\t\t\tdouble output = thisNodeOutputs.get(i);\n\t\t\t\toutSum += w * output;\n\t\t\t}\n\t\t\tnodeOutputs.add(Math.tanh(outSum * bias));\n\t\t}\n\t\treturn nodeOutputs;\n\t}", "public void fit(double[][] data) {\n double n = data.length;\n\n double sum1 = 0;\n double sum2 = 0;\n\n // gradient descent\n for (int i = 0; i < epochs; i++) {\n\n for (double[] d : data) {\n double x = d[0];\n double y = d[1];\n double yPredicted = sigmoid((m * x) + b);\n\n sum1 += x * (y - yPredicted);\n sum2 += y - yPredicted;\n }\n\n // calculate the derivative\n double dm = (-2/n) * sum1;\n double db = (-2/n) * sum2;\n\n // update m and b\n m = m - (learningRate * dm);\n b = b - (learningRate * db);\n }\n\n }", "private static void sgdElement(int i , int j, float xij, double stepSize, int globalWorkerId,\n ClientTable tableL, ClientTable tableR, ClientTable tableLoss) {\n DenseRow li = (DenseRow)tableL.threadGet(i);\n DenseRow rj = (DenseRow)tableR.threadGet(j);\n //compute L(i, : ) * R(:, j)\n float liRj = 0;\n for(int k = 0; k < K; k++) {\n liRj += li.get(k) * rj.get(k);\n\n }\n // Update the loss function (does not include L2 regularizer term)\n tableLoss.inc(0, globalWorkerId, Math.pow(xij - liRj, 2));\n // Now update L(i,:) and R(:,j) based on the loss function at X(i,j).\n // The non-regularized loss function at X(i,j) is ( X(i,j) - L(i,:)*R(:,j) )^2.\n //\n // The non-regularized gradient w.r.t. L(i,k) is -2*X(i,j)R(k,j) + 2*L(i,:)*R(:,j)*R(k,j).\n // The non-regularized gradient w.r.t. R(k,j) is -2*X(i,j)L(i,k) + 2*L(i,:)*R(:,j)*L(i,k).\n Map<Integer, Double> liUpdate = new HashMap<Integer, Double>();\n Map<Integer, Double> rjUpdate = new HashMap<Integer, Double>();\n for(int k = 0; k < K; k++) {\n double gradient = 0;\n //compute update for L(i,k)\n gradient = -2 * (xij - liRj) * rj.get(k) + lambda * 2 * li.get(k);\n liUpdate.put(k, -gradient * stepSize);\n //compute update for R(k, j)\n gradient = -2 * (xij - liRj) * li.get(k) + lambda * 2 * rj.get(k);\n rjUpdate.put(k, -gradient * stepSize);\n }\n //commit updates to Petuum PS\n tableL.batchInc(i, liUpdate);\n tableR.batchInc(j, rjUpdate);\n }", "public static void main(String[] args) {\n\t\tfinal int input1 = 1;\r\n\t\tfinal int input2 = 1;\r\n\t\t\r\n\t\t// One output in layer 3\r\n\t\tdouble targetOutput = 0;\r\n\t\t\r\n\t\t// Input to Hidden (IH) weights\r\n\t\tdouble IH1 = 0.8;\r\n\t\tdouble IH2 = 0.4;\r\n\t\tdouble IH3 = 0.3;\r\n\t\tdouble IH4 = 0.2;\r\n\t\tdouble IH5 = 0.9;\r\n\t\tdouble IH6 = 0.5;\r\n\t\t\r\n\t\t// second iteration of weights: Hidden to Output (HO) weights\r\n\t\tdouble HO1 = 0.3;\r\n\t\tdouble HO2 = 0.5;\r\n\t\tdouble HO3 = 0.9;\r\n\t\t\r\n\t\t// initialization\r\n\t\tdouble weightedSum1;\r\n\t\tdouble weightedSum2;\r\n\t\tdouble weightedSum3;\r\n\t\t\r\n\t\tdouble hiddenOutput1;\r\n\t\tdouble hiddenOutput2;\r\n\t\tdouble hiddenOutput3;\r\n\t\t\r\n\t\tdouble calculatedOutput;\r\n\t\t\r\n\t\tdouble secondWeightedSum;\r\n\t\t\r\n\t\tdouble outputSumError;\r\n\t\t\r\n\t\tdouble deltaSum;\r\n\t\t\r\n\t\tdouble deltaHO1;\r\n\t\tdouble deltaHO2;\r\n\t\tdouble deltaHO3;\r\n\t\t\r\n\t\tdouble deltaIH1;\r\n\t\tdouble deltaIH2;\r\n\t\tdouble deltaIH3;\r\n\t\tdouble deltaIH4;\r\n\t\tdouble deltaIH5;\r\n\t\tdouble deltaIH6;\r\n\t\t\r\n\t\tfor (int i=0;i<10000;i++){\r\n\t\t\t// Three inputs in layer 2 (hidden layer)\r\n\t\t\tweightedSum1 = input1*IH1+input2*IH4;\r\n\t\t\tweightedSum2 = input1*IH2+input2*IH5;\r\n\t\t\tweightedSum3 = input1*IH3+input2*IH6;\r\n\t\t\t\r\n\t\t\t// weighted sums converted into probabilities by sigmoid\r\n\t\t\thiddenOutput1 = sigmoid(weightedSum1);\r\n\t\t\thiddenOutput2 = sigmoid(weightedSum2);\r\n\t\t\thiddenOutput3 = sigmoid(weightedSum3);\r\n\t\t\t// second iteration of weighted sum\r\n\t\t\tsecondWeightedSum = hiddenOutput1*HO1+hiddenOutput2*HO2+hiddenOutput3*HO3;\r\n\t\t\t\r\n\t\t\t// applying sigmoid on secondWeightedSum to get calculatedOutput\r\n\t\t\tcalculatedOutput = sigmoid(secondWeightedSum);\r\n\t\t\tSystem.out.println(calculatedOutput);\r\n\t\t\t// Back Propagation \r\n\t\t\t\r\n\t\t\t//output sum error = target output - calculated output\r\n\t\t\toutputSumError = targetOutput - calculatedOutput;\r\n\t\t\t\r\n\t\t\t// delta sum = S'(sum)*outputSumError \r\n\t\t\tdeltaSum = sigmoidPrime(secondWeightedSum)*outputSumError;\r\n\t\t\t\t\r\n\t\t/* deltaIHWeights (1,2,3 are equal to 4,5,6 respectively \r\n\t\t because input1 and input2 are both 1) */\r\n\t\tdeltaIH1 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH2 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH3 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\tdeltaIH4 = deltaSum / HO1 * sigmoidPrime(weightedSum1);\r\n\t\tdeltaIH5 = deltaSum / HO2 * sigmoidPrime(weightedSum2);\r\n\t\tdeltaIH6 = deltaSum / HO3 * sigmoidPrime(weightedSum3);\r\n\t\t\r\n\t\t// deltaHOWeights\r\n\t\tdeltaHO1 = deltaSum / hiddenOutput1;\r\n\t\tdeltaHO2 = deltaSum / hiddenOutput2;\r\n\t\tdeltaHO3 = deltaSum / hiddenOutput3;\r\n\t\t\r\n\t\t// Modifying Old Weights \r\n\t\t\r\n\t\t// modifying IH weights\r\n\t\tIH1 += deltaIH1;\r\n\t\tIH2 += deltaIH2;\r\n\t\tIH3 += deltaIH3;\r\n\t\tIH4 += deltaIH4;\r\n\t\tIH5 += deltaIH5;\r\n\t\tIH6 += deltaIH6;\r\n\t\t\r\n\t\t// modifying HO weights\r\n\t\tHO1 += deltaHO1;\r\n\t\tHO2 += deltaHO2;\r\n\t\tHO3 += deltaHO3;\r\n\t\t\r\n\t\t}\r\n\t}", "public void checkNeighbour() {\r\n for (int y = 0; y < table.length; y++){\r\n for (int x = 0; x < table.length; x++){\r\n rule(y, x);\r\n }\r\n }\r\n for (int i = 0; i < table.length; i++)\r\n System.arraycopy(temp_table[i], 0, table[i], 0, table.length);\r\n }" ]
[ "0.69652015", "0.6588957", "0.64950675", "0.6318016", "0.60232943", "0.5967998", "0.59228104", "0.5834867", "0.5824204", "0.5815341", "0.57865536", "0.5719061", "0.5693136", "0.5643774", "0.55852866", "0.55613816", "0.5440196", "0.53961915", "0.53841", "0.5369686", "0.5360792", "0.5279044", "0.52759767", "0.5256448", "0.5185408", "0.51835394", "0.5170619", "0.5168798", "0.5140034", "0.51372904", "0.5107348", "0.5079274", "0.5039931", "0.5029189", "0.5002845", "0.49676943", "0.49491435", "0.49245462", "0.49063838", "0.49057665", "0.49021903", "0.48815957", "0.48759365", "0.48678797", "0.48405176", "0.48333704", "0.48218626", "0.48049334", "0.47989717", "0.4794653", "0.4742263", "0.47344184", "0.47247878", "0.4716096", "0.4715971", "0.4703538", "0.46899024", "0.46870402", "0.46857503", "0.4675997", "0.4675344", "0.46624896", "0.46624848", "0.46507508", "0.46363872", "0.46326062", "0.46245286", "0.46108258", "0.4608129", "0.46022514", "0.45893338", "0.45790347", "0.4577727", "0.45608622", "0.45539823", "0.45465332", "0.45434797", "0.45432818", "0.4539553", "0.4538843", "0.45351908", "0.45318693", "0.45190746", "0.4515847", "0.45157", "0.45145965", "0.45143062", "0.45056224", "0.44981954", "0.44898117", "0.4489621", "0.4487595", "0.44795418", "0.44786996", "0.4478235", "0.44751915", "0.44653672", "0.4460859", "0.44568366", "0.4450725" ]
0.734022
0
This will build the sort clause. At present it supports only one param (1st)
public static JsonArray buildSort(String[] sortParams) { JsonArray sortArray = new JsonArray(); for (String param : sortParams) { String order = "asc"; if (param.startsWith(Constants.HYPHEN)) { param = param.substring(1); order = "desc"; } JsonObject sortObject = new JsonObject(); sortObject.addProperty(param, order); sortArray.add(sortObject); } return sortArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Sort asc(QueryParameter parameter);", "Sort desc(QueryParameter parameter);", "OrderByClause createOrderByClause();", "OrderByClauseArg createOrderByClauseArg();", "private DBObject buildSortSpec(final GetObjectInformationParameters params) {\n\t\tfinal DBObject sort = new BasicDBObject();\n\t\tif (params.isObjectIDFiltersOnly()) {\n\t\t\tsort.put(Fields.VER_WS_ID, 1);\n\t\t\tsort.put(Fields.VER_ID, 1);\n\t\t\tsort.put(Fields.VER_VER, -1);\n\t\t}\n\t\treturn sort;\n\t}", "OrderByClauseArgs createOrderByClauseArgs();", "private void sortiranje(SelectConditionStep<?> select, UniverzalniParametri parametri) {\n select.orderBy(ROBA.STANJE.desc());\n }", "Map<String, org.springframework.batch.item.database.Order> genBatchOrderByFromSort(TableFields tableFields, Sort sort);", "private String getOrderBy( List<Integer> listSortBy )\n {\n StringBuffer strOrderBy = new StringBuffer( );\n String strReturn = SuggestUtils.EMPTY_STRING;\n int ncpt = 0;\n\n if ( ( listSortBy != null ) && ( listSortBy.size( ) != 0 ) )\n {\n strOrderBy.append( SQL_ORDER_BY );\n\n for ( Integer sort : listSortBy )\n {\n ncpt++;\n\n switch ( sort )\n {\n case SubmitFilter.SORT_BY_DATE_RESPONSE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_DATE_RESPONSE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_DATE_RESPONSE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_DATE_RESPONSE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_SCORE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_SCORE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_SCORE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_SCORE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_COMMENT_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_COMMENT_ENABLE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_COMMENT_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_COMMENT_ENABLE_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VIEW_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VIEW_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VIEW_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VIEW_DESC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VOTE_ASC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VOTE_ASC );\n\n break;\n\n case SubmitFilter.SORT_BY_NUMBER_VOTE_DESC:\n strOrderBy.append( SQL_FILTER_SORT_BY_NUMBER_VOTE_DESC );\n\n break;\n\n case SubmitFilter.SORT_MANUALLY:\n strOrderBy.append( SQL_FILTER_SORT_MANUALLY );\n\n break;\n\n default:\n break;\n }\n\n if ( ncpt < listSortBy.size( ) )\n {\n strOrderBy.append( \",\" );\n }\n }\n\n strReturn = strOrderBy.toString( );\n\n if ( strReturn.endsWith( \",\" ) )\n {\n strReturn = strReturn.substring( 0, strReturn.length( ) - 1 );\n }\n }\n\n return strReturn;\n }", "public QueryResultBuilder<T> applySort(Option<Sort> sort);", "private static void DoOrderBy()\n\t{\n\t\tArrayList<Attribute> inAtts = new ArrayList<Attribute>();\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_nationkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_name\"));\n\t\tinAtts.add(new Attribute(\"Int\", \"n_n_regionkey\"));\n\t\tinAtts.add(new Attribute(\"Str\", \"n_n_comment\"));\n\n\t\tArrayList<Attribute> outAtts = new ArrayList<Attribute>();\n\t\toutAtts.add(new Attribute(\"Int\", \"att1\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att2\"));\n\t\toutAtts.add(new Attribute(\"Int\", \"att3\"));\n\t\toutAtts.add(new Attribute(\"Str\", \"att4\"));\n\n\t\t// These could be more complicated expressions than simple input columns\n\t\tMap<String, String> exprsToCompute = new HashMap<String, String>();\n\t\texprsToCompute.put(\"att1\", \"n_n_nationkey\");\n\t\texprsToCompute.put(\"att2\", \"n_n_name\");\n\t\texprsToCompute.put(\"att3\", \"n_n_regionkey\");\n\t\texprsToCompute.put(\"att4\", \"n_n_comment\");\n\t\t\n\t\t// Order by region key descending then nation name ascending\n\t\tArrayList<SortKeyExpression> sortingKeys = new ArrayList<SortKeyExpression>();\n\t\tsortingKeys.add(new SortKeyExpression(\"Int\", \"n_n_regionkey\", false));\n\t\tsortingKeys.add(new SortKeyExpression(\"Str\", \"n_n_name\", true));\n\t\t\n\t\t// run the selection operation\n\t\ttry\n\t\t{\n\t\t\tnew Order(inAtts, outAtts, exprsToCompute, sortingKeys, \"nation.tbl\", \"out.tbl\", \"g++\", \"cppDir/\");\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "void sort(OrderBy orderBy);", "private String getSrhQueSortSQL() {\n String[] sortArr = { \"que_title\", \"que_create_timestamp\", \"kca_title\", \"ans_vote_total\" };\n sort_vec = cwUtils.String2vector(sortArr, false);\n String defaultSort = \"que_create_timestamp\";\n String defaultDir = \"DESC\";\n \n // popular defalut sort\n if(srhCriteriaBean != null && this.sort == null) {\n String queType = srhCriteriaBean.getSrh_tab_que_type();\n if (Know.TAB_QUE_POPULAR_LST.equalsIgnoreCase(queType)) {\n this.sort = \"ans_vote_total\";\n } else {\n this.sort = defaultSort;\n }\n this.dir = defaultDir;\n // normal deaflut sort\n } else if (this.sort == null) {\n this.sort = defaultSort;\n }\n \n String sortSQL = dbUtils.getSortSQL(sort_vec, sort, dir, defaultSort, defaultDir);\n\n return sortSQL;\n }", "protected void prepareOrderBy(String query, QueryConfig config) {\n }", "public static void doSort ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t//get the ParameterParser from RunData\n\t\tParameterParser params = data.getParameters ();\n\n\t\t// save the current selections\n\t\tSet selectedSet = new TreeSet();\n\t\tString[] selectedItems = data.getParameters ().getStrings (\"selectedMembers\");\n\t\tif(selectedItems != null)\n\t\t{\n\t\t\tselectedSet.addAll(Arrays.asList(selectedItems));\n\t\t}\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, selectedSet);\n\n\t\tString criteria = params.getString (\"criteria\");\n\n\t\tif (criteria.equals (\"title\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_DISPLAY_NAME;\n\t\t}\n\t\telse if (criteria.equals (\"size\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_CONTENT_LENGTH;\n\t\t}\n\t\telse if (criteria.equals (\"created by\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_CREATOR;\n\t\t}\n\t\telse if (criteria.equals (\"last modified\"))\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_MODIFIED_DATE;\n\t\t}\n\t\telse if (criteria.equals(\"priority\") && ContentHostingService.isSortByPriorityEnabled())\n\t\t{\n\t\t\t// if error, use title sort\n\t\t\tcriteria = ResourceProperties.PROP_CONTENT_PRIORITY;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcriteria = ResourceProperties.PROP_DISPLAY_NAME;\n\t\t}\n\n\t\tString sortBy_attribute = STATE_SORT_BY;\n\t\tString sortAsc_attribute = STATE_SORT_ASC;\n\t\tString comparator_attribute = STATE_LIST_VIEW_SORT;\n\t\t\n\t\tif(state.getAttribute(STATE_MODE).equals(MODE_REORDER))\n\t\t{\n\t\t\tsortBy_attribute = STATE_REORDER_SORT_BY;\n\t\t\tsortAsc_attribute = STATE_REORDER_SORT_ASC;\n\t\t\tcomparator_attribute = STATE_REORDER_SORT;\n\t\t}\n\t\t// current sorting sequence\n\t\tString asc = NULL_STRING;\n\t\tif (!criteria.equals (state.getAttribute (sortBy_attribute)))\n\t\t{\n\t\t\tstate.setAttribute (sortBy_attribute, criteria);\n\t\t\tasc = Boolean.TRUE.toString();\n\t\t\tstate.setAttribute (sortAsc_attribute, asc);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// current sorting sequence\n\t\t\tasc = (String) state.getAttribute (sortAsc_attribute);\n\n\t\t\t//toggle between the ascending and descending sequence\n\t\t\tif (asc.equals (Boolean.TRUE.toString()))\n\t\t\t{\n\t\t\t\tasc = Boolean.FALSE.toString();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tasc = Boolean.TRUE.toString();\n\t\t\t}\n\t\t\tstate.setAttribute (sortAsc_attribute, asc);\n\t\t}\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\tComparator comparator = ContentHostingService.newContentHostingComparator(criteria, Boolean.getBoolean(asc));\n\t\t\tstate.setAttribute(comparator_attribute, comparator);\n\t\t\t\n\t\t\t// sort sucessful\n\t\t\t// state.setAttribute (STATE_MODE, MODE_LIST);\n\n\t\t}\t// if-else\n\n\t}", "private String getQueSortSQL() {\n String[] sortArr = {\"kca_title\", \"que_title\", \"ans_count\", \"que_type\", \"que_create_timestamp\", \"ans_vote_for\"};\n sort_vec = cwUtils.String2vector(sortArr, false);\n String defaultSortColumn = \"que_create_timestamp\";\n String defaultOrder = \"desc\";\n String sortSQL = dbUtils.getSortSQL(sort_vec, sort, dir, defaultSortColumn.toLowerCase(), defaultOrder);\n if (this.sort == null) {\n this.sort = defaultSortColumn;\n }\n if (this.dir == null) {\n this.dir = defaultOrder;\n }\n\n return sortSQL;\n }", "public String doSort();", "protected String sortToSql(QuestionService.FindQuestionsSort sort)\n\t{\n\t\tswitch (sort)\n\t\t{\n\t\t\tcase type_a:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"Q.TYPE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase type_d:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"Q.TYPE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase title_a:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"QT.TITLE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase title_d:\n\t\t\t{\n\t\t\t\t// TODO: localized\n\t\t\t\treturn \"QT.TITLE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase description_a:\n\t\t\t{\n\t\t\t\treturn \"Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase description_d:\n\t\t\t{\n\t\t\t\treturn \"Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_difficulty_a:\n\t\t\t{\n\t\t\t\treturn \"P.DIFFICULTY ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_difficulty_d:\n\t\t\t{\n\t\t\t\treturn \"P.DIFFICULTY DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_points_a:\n\t\t\t{\n\t\t\t\treturn \"P.POINTS ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_points_d:\n\t\t\t{\n\t\t\t\treturn \"P.POINTS DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase pool_title_a:\n\t\t\t{\n\t\t\t\treturn \"P.TITLE ASC, Q.DESCRIPTION ASC, Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase pool_title_d:\n\t\t\t{\n\t\t\t\treturn \"P.TITLE DESC, Q.DESCRIPTION DESC, Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t\tcase cdate_a:\n\t\t\t{\n\t\t\t\treturn \"Q.CREATED_BY_DATE ASC\";\n\t\t\t}\n\t\t\tcase cdate_d:\n\t\t\t{\n\t\t\t\treturn \"Q.CREATED_BY_DATE DESC\";\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}", "private void constructExecuteSql() {\n getMetaData();\n // Validate that the primary keys are present in the underlying SQL\n StringBuilder orderBySql = new StringBuilder(super.getExecuteSql()).append(\"\\n order by \");\n switch (metaData.getDbType()) {\n case ORACLE:\n orderBySql.append(createOracleOrderedByClause ());\n break;\n case SQL_SERVER:\n orderBySql.append(createSqlServerOrderedByClause());\n break;\n case UNKNOWN:\n default:\n orderBySql.append(createUnknownDBOrderedByClause());\n }\n this.executeSql = orderBySql.toString();\n }", "private void createSortLink() {\n\n String newGrouping;\n\n if (\"plugin\".equals(grouping)) {\n newGrouping = \"publisher\";\n } else {\n newGrouping = \"plugin\";\n }\n String timeString = \"\";\n if (\"accurate\".equals(timeKey)) {\n timeString = \"&amp;timeKey=\" + timeKey;\n }\n\n String linkHref = \"/DisplayContentStatus?group=\" + newGrouping + timeString;\n String linkText = \"Order by \" + newGrouping;\n Link sortLink = new Link(linkHref);\n sortLink.attribute(\"class\", \"filters\");\n sortLink.add(linkText);\n page.add(sortLink);\n }", "private String doSortOrder(SlingHttpServletRequest request) {\n RequestParameter sortOnParam = request.getRequestParameter(\"sortOn\");\n RequestParameter sortOrderParam = request.getRequestParameter(\"sortOrder\");\n String sortOn = \"sakai:filename\";\n String sortOrder = \"ascending\";\n if (sortOrderParam != null\n && (sortOrderParam.getString().equals(\"ascending\") || sortOrderParam.getString()\n .equals(\"descending\"))) {\n sortOrder = sortOrderParam.getString();\n }\n if (sortOnParam != null) {\n sortOn = sortOnParam.getString();\n }\n return \" order by @\" + sortOn + \" \" + sortOrder;\n }", "java.lang.String getOrderBy();", "@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}", "OrderByColumnFull createOrderByColumnFull();", "List<Employee> sort(Sorting selectedSortColoumn) throws SQLException;", "public void sort() {\n }", "private void sortBy(Query query, DimensionDescriptor timeDimension, DimensionDescriptor elevationDimension) {\n final List<SortBy> clauses = new ArrayList<SortBy>();\n // TODO: Check sortBy clause is supported\n if (timeDimension != null) {\n clauses.add(new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(timeDimension.getStartAttribute()),\n SortOrder.DESCENDING));\n }\n if (elevationDimension != null) {\n clauses.add(new SortByImpl(FeatureUtilities.DEFAULT_FILTER_FACTORY.property(elevationDimension.getStartAttribute()),\n SortOrder.ASCENDING));\n }\n final SortBy[] sb = clauses.toArray(new SortBy[] {});\n query.setSortBy(sb);\n \n }", "public String sortBy();", "private Sort(SortBuilder builder) {\n this.field = builder.field;\n this.direction = builder.direction;\n }", "String convertToSortProperty(String sortParameter) throws ValidationFailureException;", "protected String setOrderParameterToSqlOrHql(final String hql, final PageRequest pageRequest) {\n\t\tStringBuilder builder = new StringBuilder(hql);\n\t\tbuilder.append(\" order by\");\n\t\tfor (Order order : pageRequest.getSort()) {\n\t\t\tbuilder.append(String.format(\" %s %s,\", order.getProperty(), order.getDirection().name()));\n\t\t}\n\t\tbuilder.deleteCharAt(builder.length() - 1);\n\t\treturn builder.toString();\n\t}", "private void addSortingPagination(Map params, String entity, String dir, String sort, int start, int limit,\n\t\t\tint page) {\n\n\t\tparams.put(IReportDAO.ENTITY, entity);\n\t\tparams.put(IReportDAO.DIR, dir);\n\t\tparams.put(IReportDAO.SORT_COLUMN, sort);\n\t\tparams.put(IReportDAO.START_INDEX, start);\n\t\tparams.put(IReportDAO.LIMIT, limit);\n\t\tparams.put(IReportDAO.PAGE, page);\n\t}", "protected String buildOrderBy(String sort, String order) {\n\t\tStringBuffer buffer = new StringBuffer(\"\");\n\t\tif (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {\n\t\t\tbuffer.append(\" order by \").append(sort).append(\" \").append(order);\n\t\t}\n\t\treturn buffer.toString();\n\t}", "private Sort() { }", "protected void generateOrderBy( SQLQueryModel query, LogicalModel model, List<Order> orderBy,\n DatabaseMeta databaseMeta, String locale, Map<LogicalTable, String> tableAliases, Map<String, String> columnsMap,\n Map<String, Object> parameters, boolean genAsPreparedStatement ) {\n if ( orderBy != null ) {\n for ( Order orderItem : orderBy ) {\n LogicalColumn businessColumn = orderItem.getSelection().getLogicalColumn();\n String alias = null;\n if ( columnsMap != null ) {\n // The column map is a unique mapping of Column alias to the column ID\n // Here we have the column ID and we need the alias.\n // We need to do the order by on the alias, not the column name itself.\n // For most databases, it can be both, but the alias is more standard.\n //\n // Using the column name and not the alias caused an issue on Apache Derby.\n //\n for ( String key : columnsMap.keySet() ) {\n String value = columnsMap.get( key );\n if ( value.equals( businessColumn.getId() ) ) {\n // Found it: the alias is the key\n alias = key;\n break;\n }\n }\n }\n SqlAndTables sqlAndTables =\n getBusinessColumnSQL( model, orderItem.getSelection(), tableAliases, parameters, genAsPreparedStatement,\n databaseMeta, locale );\n query.addOrderBy( sqlAndTables.getSql(), databaseMeta.quoteField( alias ), orderItem.getType() != Type.ASC\n ? OrderType.DESCENDING : null );\n }\n }\n }", "public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}", "@Override\n\tpublic void onToggleSort(String header) {\n\t\tsynapseClient.toggleSortOnTableQuery(this.startingQuery.getSql(), header, new AsyncCallback<String>(){\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tshowError(caught);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String sql) {\n\t\t\t\trunSql(sql);\n\t\t\t}});\n\t}", "public static void setSortCriteria(String method)\n \t{\n \t\tsortCriteria = method;\n \t}", "protected Sort getSortASC() {\n Sort.Order order = new Sort.Order(Sort.Direction.ASC, \"id\");\n return Sort.by(order);\n }", "SortOperator(String databaseDir, HashMap<String,String[]> schema, String fromTableName, String[] joinTableNames, String[] columnsInfo, Expression whereExpression, String[] orderBy){\n this.orderBy = columnsInfo2TableColumnsArray(orderBy);\n if (whereExpression == null) {\n projectOperator = new ProjectOperator(databaseDir, schema, fromTableName, columnsInfo);\n }\n else if(joinTableNames == null) {\n projectOperator = new ProjectOperator(databaseDir, schema, fromTableName, columnsInfo, whereExpression);\n }\n else {\n projectOperator = new ProjectOperator(databaseDir, schema, fromTableName, joinTableNames, columnsInfo, whereExpression);\n }\n }", "String getSortColumn();", "@VTID(28)\n boolean getSortUsingCustomLists();", "Results sortResults(FilterSpecifier.ListBy listBy, SortSpecifier sortspec) throws SearchServiceException;", "public static void setOrderBy (String columnList){\n fetchAllOrderBy=columnList;\n }", "public SortBuilder(String field) {\n if (field == null) {\n field = \"\";\n }\n switch (field) {\n case \"name\":\n this.field = \"name\";\n break;\n case \"introduced\":\n this.field = \"introduced\";\n break;\n case \"discontinued\":\n this.field = \"discontinued\";\n break;\n case \"company_id\":\n this.field = \"company\";\n break;\n case \"id\":\n default:\n this.field = \"id\";\n break;\n }\n }", "public final void orderby() throws RecognitionException {\r\n try {\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:209:2: ( ORDER_BY fieldname ( comma fieldname )* ( ASC | DESC )? )\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:209:4: ORDER_BY fieldname ( comma fieldname )* ( ASC | DESC )?\r\n {\r\n match(input,ORDER_BY,FOLLOW_ORDER_BY_in_orderby1272); \r\n out(\" order by \");\r\n pushFollow(FOLLOW_fieldname_in_orderby1276);\r\n fieldname();\r\n\r\n state._fsp--;\r\n\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:209:44: ( comma fieldname )*\r\n loop58:\r\n do {\r\n int alt58=2;\r\n int LA58_0 = input.LA(1);\r\n\r\n if ( (LA58_0==COMMA) ) {\r\n alt58=1;\r\n }\r\n\r\n\r\n switch (alt58) {\r\n \tcase 1 :\r\n \t // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:209:45: comma fieldname\r\n \t {\r\n \t pushFollow(FOLLOW_comma_in_orderby1279);\r\n \t comma();\r\n\r\n \t state._fsp--;\r\n\r\n \t pushFollow(FOLLOW_fieldname_in_orderby1281);\r\n \t fieldname();\r\n\r\n \t state._fsp--;\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop58;\r\n }\r\n } while (true);\r\n\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:210:3: ( ASC | DESC )?\r\n int alt59=3;\r\n int LA59_0 = input.LA(1);\r\n\r\n if ( (LA59_0==ASC) ) {\r\n alt59=1;\r\n }\r\n else if ( (LA59_0==DESC) ) {\r\n alt59=2;\r\n }\r\n switch (alt59) {\r\n case 1 :\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:210:4: ASC\r\n {\r\n match(input,ASC,FOLLOW_ASC_in_orderby1289); \r\n out(\" asc \");\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:210:26: DESC\r\n {\r\n match(input,DESC,FOLLOW_DESC_in_orderby1295); \r\n out(\" desc \");\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n finally {\r\n }\r\n return ;\r\n }", "@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}", "private void constructOrder(CriteriaBuilderImpl cb, CriteriaQueryImpl<?> q, Tree orderBy) {\n \t\tfinal List<Order> orders = Lists.newArrayList();\n \n \t\tfor (int i = 0; i < orderBy.getChildCount(); i++) {\n \t\t\tfinal Tree orderByItem = orderBy.getChild(i);\n \t\t\tfinal Order order = orderByItem.getChildCount() == 2 ? //\n \t\t\t\tcb.desc(this.getExpression(cb, q, orderByItem.getChild(0), null)) : //\n \t\t\t\tcb.asc(this.getExpression(cb, q, orderByItem.getChild(0), null));\n \n \t\t\torders.add(order);\n \t\t}\n \n \t\tq.orderBy(orders);\n \t}", "public void sort() // sort according to primary key defined in RecordTemplate\n\t{\n\t\trecordList.sort((Record r1, Record r2)->r1.getValue(PRIMARY_KEY_FIELD_INDEX).compareTo(r2.getValue(PRIMARY_KEY_FIELD_INDEX))); \n //recordList.forEach((r)->System.out.println(r)); \n\t}", "public void testMultipass_Sort() throws Exception\n \t{\n \t\tccName = new String[]{\n \t\t\t\t\"cc1\", \"cc2\"\n \t\t};\n \t\tccExpr = new String[]{\n \t\t\t\t\"Total.sum(row.COL1)\", \"Total.sum(row.cc1)\"\n \t\t};\n \n \t\tfor ( int i = 0; i < ccName.length; i++ )\n \t\t{\n \t\t\tComputedColumn computedColumn = new ComputedColumn( ccName[i],\n \t\t\t\t\tccExpr[i],\n \t\t\t\t\tDataType.INTEGER_TYPE );\n \t\t\t( (BaseDataSetDesign) this.dataSet ).addComputedColumn( computedColumn );\n \t\t}\n \t\t\n \t\tString[] bindingNameSort = new String[2];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION_1\";\n \t\tbindingNameSort[1] = \"SORT_DEFINITION_2\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[2];\n \t\tbindingExprSort[0] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.COL1/(Total.ave(dataSetRow.cc1)+dataSetRow.cc1)\");\n \t\tbindingExprSort[1] = new ScriptExpression(\n \t\t\t\t\"dataSetRow.cc2-dataSetRow.COL2\");\n \t\tSortDefinition[] sortDefn = new SortDefinition[] {\n \t\t\t\tnew SortDefinition(), new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION_1\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \t\tsortDefn[1].setColumn(\"SORT_DEFINITION_2\");\n \t\tsortDefn[1].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[6];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc1\";\n \t\tbindingNameRow[5] = \"ROW_cc2\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[]{\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL0\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL1\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL2\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + \"COL3\", 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[0], 0 ),\n \t\t\t\tnew ScriptExpression( \"dataSetRow.\" + ccName[1], 0 ),\n \t\t};\n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\t\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "public PbReturnObject sort(int sortType, String colName, String dataType) {\r\n // sortType: 0-ascending, 1-descending\r\n // dataType: C-characters, D-Date, N-Number\r\n retSort = new PbReturnObject();\r\n retSort.setColumnNames(cols);\r\n\r\n int compIndex = 0;\r\n int index = 0;\r\n if (dataType.equals(\"N\")) {\r\n BigDecimal currVal; //getFieldValueBigDecimal\r\n for (int i = 0; i\r\n < rowCount; i++) {\r\n index = 0;\r\n currVal= this.getFieldValueBigDecimal(i, colName);\r\n\r\n if (sortType == 0) //Ascending\r\n {\r\n index = 0;\r\n for (int j = 0; j\r\n < retSort.getRowCount(); j++) {\r\n if (currVal.subtract(retSort.getFieldValueBigDecimal(j, colName)).floatValue() > 0) {\r\n index = j + 1;\r\n }\r\n\r\n }\r\n } else //Descending\r\n {\r\n index = 0; //retSort.getRowCount();\r\n for (int j = retSort.getRowCount() - 1; j\r\n >= 0; j--) {\r\n if (currVal.subtract(retSort.getFieldValueBigDecimal(j, colName)).floatValue() < 0) {\r\n index = j + 1;\r\n break;\r\n\r\n }\r\n\r\n }\r\n }\r\n for (int a = 0; a\r\n < cols.length; a++) {\r\n retSort.setFieldValue(cols[a], this.getFieldValue(i, cols[a]));\r\n }\r\n\r\n retSort.addSortRow(index);\r\n }\r\n\r\n } else if (dataType.equals(\"C\")) {\r\n String currVal = null;\r\n for (int i = 0; i\r\n < rowCount; i++) {\r\n index = 0;\r\n currVal =this.getFieldValueString(i, colName);\r\n\r\n if (sortType == 0) //Ascending\r\n {\r\n index = 0;\r\n for (int j = 0; j\r\n < retSort.getRowCount(); j++) {\r\n if (currVal.compareTo(retSort.getFieldValueString(j, colName)) > 0) {\r\n index = j + 1;\r\n }\r\n\r\n }\r\n } else //Descending\r\n {\r\n index = 0; //retSort.getRowCount();\r\n for (int j = retSort.getRowCount() - 1; j\r\n >= 0; j--) {\r\n if (currVal.compareTo(retSort.getFieldValueString(j, colName)) < 0) {\r\n index = j + 1;\r\n break;\r\n\r\n }\r\n\r\n }\r\n }\r\n for (int a = 0; a < cols.length; a++) {\r\n retSort.setFieldValue(cols[a], this.getFieldValue(i, cols[a]));\r\n }\r\n\r\n retSort.addSortRow(index);\r\n }\r\n\r\n } else if (dataType.equals(\"D\")) {\r\n java.util.Date currVal = null;\r\n for (int i = 0; i\r\n < rowCount; i++) {\r\n index = 0;\r\n currVal =this.getFieldValueDate(i, colName);\r\n\r\n if (sortType == 0) //Ascending\r\n {\r\n index = 0;\r\n for (int j = 0; j\r\n < retSort.getRowCount(); j++) {\r\n if (currVal.compareTo(retSort.getFieldValueDate(j, colName)) > 0) {\r\n index = j + 1;\r\n }\r\n\r\n }\r\n } else //Descending\r\n {\r\n index = 0; //retSort.getRowCount();\r\n for (int j = retSort.getRowCount() - 1; j\r\n >= 0; j--) {\r\n if (currVal.compareTo(retSort.getFieldValueDate(j, colName)) < 0) {\r\n index = j + 1;\r\n break;\r\n\r\n }\r\n\r\n }\r\n }\r\n for (int a = 0; a\r\n < cols.length; a++) {\r\n retSort.setFieldValue(cols[a], this.getFieldValue(i, cols[a]));\r\n }\r\n\r\n retSort.addSortRow(index);\r\n }\r\n\r\n }\r\n\r\n return retSort;\r\n }", "private void addFilterSortConfigToUrl( UrlItem urlRedirectionDetails )\n {\n if ( _formItemSortConfig != null )\n {\n String strSortPosition = Integer.toString( _formItemSortConfig.getColumnToSortPosition( ) );\n String strAttributeName = _formItemSortConfig.getSortAttributeName( );\n String strAscSort = String.valueOf( _formItemSortConfig.isAscSort( ) );\n\n urlRedirectionDetails.addParameter( FormsConstants.PARAMETER_SORT_COLUMN_POSITION, strSortPosition );\n urlRedirectionDetails.addParameter( FormsConstants.PARAMETER_SORT_ATTRIBUTE_NAME, strAttributeName );\n urlRedirectionDetails.addParameter( FormsConstants.PARAMETER_SORT_ASC_VALUE, strAscSort );\n }\n }", "private String getOrderByQuery(List<SQLiteColumn> list, boolean orderByPk) {\r\n StringBuilder builder = new StringBuilder();\r\n String separator = SQL_COLUMN_SEPARATOR;\r\n for (SQLiteColumn column : list) {\r\n if (!(orderByPk ^ column.isPrimaryKey())) {\r\n builder.append(column.getColumnName()).append(separator);\r\n }\r\n }\r\n String result = \"\";\r\n if (builder.length() > 1) {\r\n builder.delete(builder.length() - separator.length(),\r\n builder.length());\r\n result = \" ORDER BY \" + builder.toString();\r\n }\r\n return result;\r\n }", "@Override\n\tprotected String getDefaultOrderBy() {\n\t\treturn \"date asc\";\n\t}", "private void sort(final OrderBy orderBy) {\n callback.orderByProperty().set(orderBy);\n\n sort();\n }", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "@Override\n\tpublic void setSorting(Object[] propertyIds, boolean[] ascending) {\n\t\t\n\t}", "@Override\n\tpublic String sort() {\n\t\tString s=\"Insertionsort Function\";\n\t\treturn s;\n\t}", "public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }", "private Sort sortByLastNameAsc() {\n return new Sort(Sort.Direction.ASC, \"remName\");\n }", "private void sort()\n {\n pd = new ProgressDialog(this);\n pd.setMessage(\"Sorting movies...\");\n pd.setCancelable(false);\n pd.show();\n\n movieList.clear();\n if(show.equals(\"notWatched\"))\n watched(false);\n else if(show.equals(\"watched\"))\n watched(true);\n else movieList.addAll(baseMovieList);\n\n if(orderBy.equals(\"alphabet\"))\n sortAlphabet();\n else if(orderBy.equals(\"date\"))\n sortDate();\n else sortRating();\n\n if(orderType)\n Collections.reverse(movieList);\n\n recyclerView.setAdapter(movieAdapter);\n pd.dismiss();\n }", "public void changeSortOrder();", "public DefaultSortParameters() {\n\t\tthis(null, null, null, null, null);\n\t}", "public static Sort getSortColumnAndOrderFromRequest(Request request) {\n ParameterValue sort = request.getQueryParameter(\"sort\");\n return Arrays.stream(sort.getValues()).findFirst()\n .map(sortColumnAndOrderStr -> {\n String[] sortColumnAndOrder = sortColumnAndOrderStr.split(\",\");\n String sortColumn = sortColumnAndOrder[0];\n\n Sort.SortOrder sortOrder = Sort.SortOrder.ASC;\n if (sortColumnAndOrder.length == 2) {\n String sortOrderStr = sortColumnAndOrder[1];\n if (sortOrderStr.equals(\"ASC\") || sortOrderStr.equals(\"DESC\")) {\n sortOrder = Sort.SortOrder.valueOf(sortOrderStr);\n }\n }\n return new Sort(sortColumn, sortOrder);\n }).orElse(null);\n }", "OrderExpression<T> asc();", "public void setSort(Short sort) {\n this.sort = sort;\n }", "protected void sortAndFilterAnnotationData() {\n SortColumn sortType = (SortColumn) sortAction.getValue(COLUMN_PROPERTY);\r\n FilterSubTypeColumn filterType = (FilterSubTypeColumn) filterTypeAction.getValue(COLUMN_PROPERTY);\r\n FilterAuthorColumn filterAuthor = (FilterAuthorColumn) filterAuthorAction.getValue(COLUMN_PROPERTY);\r\n Color filterColor = (Color) filterColorAction.getValue(COLUMN_PROPERTY);\r\n FilterVisibilityColumn filterVisibility = (FilterVisibilityColumn) filterVisibilityAction.getValue(COLUMN_PROPERTY);\r\n filterDropDownButton.setSelected(!filterAuthor.equals(FilterAuthorColumn.ALL) ||\r\n !filterType.equals(FilterSubTypeColumn.ALL) ||\r\n filterColor != null);\r\n\r\n // setup search pattern\r\n Pattern searchPattern = null;\r\n String searchTerm = searchTextField.getText();\r\n boolean caseSensitive = caseSensitiveMenutItem.isSelected();\r\n if (searchTerm != null && !searchTerm.isEmpty()) {\r\n searchPattern = Pattern.compile(caseSensitive ? searchTerm : searchTerm.toLowerCase());\r\n // todo we can add search flags at a later date, via drop down on search or checkboxes.\r\n }\r\n\r\n markupAnnotationHandlerPanel.sortAndFilterAnnotationData(\r\n searchPattern, sortType, filterType, filterAuthor, filterVisibility, filterColor,\r\n regexMenuItem.isSelected(), caseSensitive);\r\n }", "public interface SortType {\n int ASC=1;\n int DESC=-1;\n int INFO =3;\n int POINT=4;\n int ACTIVE=5;\n}", "private void sort(){\r\n\t\tCollections.sort(people,new PeopleComparator(columnSelect.getSelectedIndex(),(String)sortOrder.getSelectedItem()));\r\n\t\tpersonTableModel.fireTableDataChanged();\r\n\t}", "public void setSortby(String sortby) {\n\t\tparameters.put(\"sortby\", sortby);\n\t}", "public Sort build() {\n return new Sort(this);\n }", "private void doSort (Column A, int [] i, int p, int r, int begin) {//double[] A, int p, int r, MutableTable t) {\n\t\tif (p < r) {\n\t\t\tint q = partition(A, i, p, r, begin);\n\t\t\tdoSort(A, i, p, q, begin);\n\t\t\tdoSort(A, i, q + 1, r, begin);\n\t\t}\n\t}", "public MethodSortMatcher(Sort sort) {\n this.sort = sort;\n }", "public void testSortOnComputedColumn1() throws Exception {\n \t\tccName = new String[] { \"cc\" };\n \t\tccExpr = new String[] { \"(row.COL0%2==0?1:2)\" };\n \n \t\tfor (int i = 0; i < ccName.length; i++) {\n \t\t\tComputedColumn computedColumn = new ComputedColumn(ccName[i],\n \t\t\t\t\tccExpr[i], DataType.ANY_TYPE);\n \t\t\t((BaseDataSetDesign) this.dataSet)\n \t\t\t\t\t.addComputedColumn(computedColumn);\n \t\t}\n \n \t\tString[] bindingNameSort = new String[1];\n \t\tbindingNameSort[0] = \"SORT_DEFINITION\";\n \t\tIBaseExpression[] bindingExprSort = new IBaseExpression[1];\n \t\tbindingExprSort[0] = new ScriptExpression(\"dataSetRow.cc\");\n \n \t\tSortDefinition[] sortDefn = new SortDefinition[] { new SortDefinition() };\n \t\tsortDefn[0].setColumn(\"SORT_DEFINITION\");\n \t\tsortDefn[0].setSortDirection(ISortDefinition.SORT_DESC);\n \n \t\tString[] bindingNameRow = new String[5];\n \t\tbindingNameRow[0] = \"ROW_COL0\";\n \t\tbindingNameRow[1] = \"ROW_COL1\";\n \t\tbindingNameRow[2] = \"ROW_COL2\";\n \t\tbindingNameRow[3] = \"ROW_COL3\";\n \t\tbindingNameRow[4] = \"ROW_cc\";\n \t\tScriptExpression[] bindingExprRow = new ScriptExpression[] {\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL0\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL1\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL2\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + \"COL3\", 0),\n \t\t\t\tnew ScriptExpression(\"dataSetRow.\" + ccName[0], 0), };\n \n \t\tIResultIterator resultIt = this.executeQuery(this.createQuery(null,\n \t\t\t\tnull, null, bindingNameSort, bindingExprSort, sortDefn, null,\n \t\t\t\tnull, null, bindingNameRow, bindingExprRow));\n \n \t\tprintResult(resultIt, bindingNameRow, bindingExprRow);\n \t\t// assert\n \t\tcheckOutputFile();\n \t}", "private int getSortValue() {\n\t\tint sortBy = DisplaySpecServices.ORDERDATESORT; // default sort option -\n\t\t// ORDERDATE\n\t\tif (this.searchNotSort == false) {\n\t\t\ttry {\n\t\t\t\tsortBy = Integer.parseInt(this.sortOption);\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default sort\n\t\t\t\t// option\n\t\t\t}\n\t\t} else {\n\t\t\tString searchOption = this.getSearchOption();\n\n\t\t\ttry {\n\t\t\t\tint searchOptValue = Integer.parseInt(searchOption);\n\t\t\t\tswitch (searchOptValue) {\n\t\t\t\tcase DisplaySpecServices.ORDERDATEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONDATEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PUBLICATIONTITLEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PUBLICATIONTITLESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.ORDERDETAILIDFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDETAILIDSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PERMISSIONTYPEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PERMISSIONTYPESORT; // 2ndary\n\t\t\t\t\t// sort\n\t\t\t\t\t// Order\n\t\t\t\t\t// Date\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.PERMISSIONSTATUSFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.PERMISSIONSTATUSSORT; // 2ndary\n\t\t\t\t\t// sort\n\t\t\t\t\t// Order\n\t\t\t\t\t// Date\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.BILLINGSTATUSFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.YOURREFERENCEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.YOURREFERENCESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.INVOICENUMBERFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.INVOICENUMBERSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONTITLEFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONTITLESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.REPUBLICATIONPUBLISHERFILTER:\n\t\t\t\t\tsortBy = DisplaySpecServices.REPUBLICATIONPUBLISHERSORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DisplaySpecServices.LASTUPDATEDATESORT:\n\t\t\t\t\tsortBy = DisplaySpecServices.LASTUPDATEDATESORT;\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default\n\t\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException nfe) {\n\t\t\t\tsortBy = DisplaySpecServices.ORDERDATESORT; // default\n\t\t\t\tthis.sortOption = String.valueOf(sortBy);\n\t\t\t}\n\t\t}\n\t\treturn sortBy;\n\t}", "@Override\n public Query customizeQuery(Object anObject, PersistenceBroker broker, CollectionDescriptor cod, QueryByCriteria query) {\n boolean platformMySQL = broker.serviceSqlGenerator().getPlatform() instanceof PlatformMySQLImpl;\n\n Map<String, String> attributes = getAttributes();\n for (String attributeName : attributes.keySet()) {\n if (!attributeName.startsWith(ORDER_BY_FIELD)) {\n continue;\n }\n\n String fieldName = attributeName.substring(ORDER_BY_FIELD.length());\n ClassDescriptor itemClassDescriptor = broker.getClassDescriptor(cod.getItemClass());\n FieldDescriptor orderByFieldDescriptior = itemClassDescriptor.getFieldDescriptorByName(fieldName);\n\n // the column to sort on derived from the property name\n String orderByColumnName = orderByFieldDescriptior.getColumnName();\n\n // ascending or descending\n String fieldValue = attributes.get(attributeName);\n boolean ascending = (StringUtils.equals(fieldValue, ASCENDING));\n // throw an error if not ascending or descending\n if (!ascending && StringUtils.equals(fieldValue, DESCENDING)) {\n throw new RuntimeException(\"neither ASC nor DESC was specified in ojb file for \" + fieldName);\n }\n\n if (platformMySQL) {\n // by negating the column name in MySQL we can get nulls last (ascending or descending)\n String mysqlPrefix = (ascending) ? MYSQL_NEGATION : \"\";\n query.addOrderBy(mysqlPrefix + orderByColumnName, false);\n } else {\n query.addOrderBy(orderByColumnName, ascending);\n }\n }\n return query;\n }", "public SmartSorting() {\n this(DSL.name(\"smart_sorting\"), null);\n }", "public static void orderAction(QueryHelper qhelp, String listHeaderId, RestState pageState, String defaultOrder) {\r\n\r\n String orderBy = pageState.getEntry(Form.FLD_FORM_ORDER_BY + listHeaderId).stringValueNullIfEmpty();\r\n if (orderBy==null) {\r\n orderBy = defaultOrder;\r\n pageState.addClientEntry(Form.FLD_FORM_ORDER_BY + listHeaderId,defaultOrder);\r\n }\r\n\r\n if (JSP.ex(orderBy)){\r\n int pos = qhelp.getHqlString().toLowerCase().indexOf(\" order by \");\r\n if (pos >-1 ){\r\n String hql=qhelp.getHqlString().substring(0,pos);\r\n qhelp.setHqlString(hql);\r\n }\r\n qhelp.addToHqlString(\" order by \" + orderBy);\r\n }\r\n\r\n }", "public SortOrdering() {\n\t\tthis( new String[0] );\n\t}", "JDKSort() {\n }", "public static String addOrder(String queryString, String propertyPath, boolean asc) {\n\n\tif (StringUtils.containsIgnoreCase(queryString, \"order by\")) {\n\t return queryString;\n\t}\n\n\tStringBuilder sb = new StringBuilder(queryString);\n\tsb.append(\" ORDER BY \");\n\tsb.append(getAlias(queryString));\n\tsb.append(\".\");\n\tsb.append(propertyPath);\n\tsb.append(\" \");\n\tsb.append(asc ? \"ASC\" : \"DESC\");\n\n\treturn sb.toString();\n }", "public String getSortCondition()\n\t{\n\t\tKey[] karray = new Key[_searchKeyList.size()] ;\n\n\t\t_searchKeyList.copyInto(karray) ;\n\t\tfor (int i = 0; i < karray.length; i++)\n\t\t{\n\t\t\tfor (int j = i; j < karray.length; j++)\n\t\t\t{\n\t\t\t\tif (karray[i].getTableOrder() > karray[j].getTableOrder())\n\t\t\t\t{\n\t\t\t\t\tKey ktmp = karray[i] ;\n\t\t\t\t\tkarray[i] = karray[j] ;\n\t\t\t\t\tkarray[j] = ktmp ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tStringBuffer stbf = new StringBuffer(256) ;\n\t\tboolean existFlg = false ;\n\n\t\tfor (int i = 0; i < karray.length; i++)\n\t\t{\n\t\t\tif (karray[i].getTableOrder() > 0)\n\t\t\t{\n\t\t\t\tstbf.append(karray[i].getTableColumn()) ;\n\t\t\t\t//#CM708958\n\t\t\t\t// The descending key word is set for the descending order. \n\t\t\t\tif (karray[i].getTableDesc() == false)\n\t\t\t\t{\n\t\t\t\t\tstbf.append(\" DESC\") ;\n\t\t\t\t}\n\t\t\t\tstbf.append(\", \") ;\n\t\t\t\tif (existFlg == false)\n\t\t\t\t\texistFlg = true ;\n\t\t\t}\n\t\t}\n\t\t//#CM708959\n\t\t// Return null when data is not set in the key value. \n\t\tif (existFlg == false)\n\t\t\treturn null ;\n\n\t\t//#CM708960\n\t\t// The last \"\"is removed because it is extra. \n\t\tint ep = stbf.toString().lastIndexOf(\",\") ;\n\t\treturn stbf.toString().substring(0, ep) ;\n\t}", "public void initializeSortModel()\r\n {\r\n oldSortColumnProperty = sortColumnProperty;\r\n oldAscending = !ascending; // To make sure Sort happens on first render \r\n }", "OrOrderByColumn createOrOrderByColumn();", "public final void mORDERPARAM() throws RecognitionException {\r\n try {\r\n final int _type = SparqlMarcoLexer.ORDERPARAM;\r\n final int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\r\n // /Users/Marco/Desktop/Tesi Davide/Antlr-doc/SparqlMarco.g:48:4: ( 'DESC' |\r\n // 'ASC' )\r\n int alt2 = 2;\r\n final int LA2_0 = this.input.LA(1);\r\n if (LA2_0 == 'D') {\r\n alt2 = 1;\r\n } else if (LA2_0 == 'A') {\r\n alt2 = 2;\r\n } else {\r\n final NoViableAltException nvae = new NoViableAltException(\"\", 2, 0, this.input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt2) {\r\n case 1:\r\n // /Users/Marco/Desktop/Tesi Davide/Antlr-doc/SparqlMarco.g:48:5: 'DESC'\r\n {\r\n this.match(\"DESC\");\r\n\r\n }\r\n break;\r\n case 2:\r\n // /Users/Marco/Desktop/Tesi Davide/Antlr-doc/SparqlMarco.g:48:12: 'ASC'\r\n {\r\n this.match(\"ASC\");\r\n\r\n }\r\n break;\r\n\r\n }\r\n this.state.type = _type;\r\n this.state.channel = _channel;\r\n } finally {\r\n }\r\n }", "protected final List<T> findSortedByQuery(String query, String sort, Object... params) {\n return this.findSortedByQuery(query, sort, (Integer) null, (Integer) null, params);\n }", "@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> orderAscBy(String field);", "public void setSortFunction(JSFunction sortFunction) {\r\n this.sortFunction = sortFunction;\r\n }", "public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }", "public void setSort(boolean sort) {\n this.sort = sort;\n }", "public void sort(int sortColumn, int sortDir) {\r\n\t\tsort(sortColumn,TreeBuffer.SORT_ANY,sortDir);\r\n\t}", "@Override\n public void onColumnSort(ColumnSortEvent event) {\n if (column.equals(event.getColumn())) {\n gridPanel.sortColumn(i, event.isSortAscending());\n grid.redrawHeaders();\n }\n }", "void onPositiveResult(@Nullable Sort sort, boolean isSortAsc, @Nullable ArrayList<String> selectedFilters);", "public String getSortOrder();", "public void setSort(Integer sort) {\r\n this.sort = sort;\r\n }", "private void sort(int[] fields) {\n\t\tsort(fields, (currentSort.length == 1 && currentSort[0] == fields[0]) ? !reverseSort : false);\r\n\t}", "private void parseQuery(String str) {\n String[] parts = str.split(\"orderby\");\n String[] elements = parts[0].split(\"\\\\s+\");\n\n // Use two-stack algorithm to parse prefix notation\n Stack<Comparable<String>> terms = new Stack<Comparable<String>>();\n Stack<Comparable<String>> helper = new Stack<Comparable<String>>();\n\n for (String el : elements) { terms.push(el); }\n while (!terms.isEmpty()) {\n Comparable<String> term = terms.pop();\n String operands = \"+|-\";\n if (operands.contains(term.toString())) {\n Comparable<String> leftSide = helper.pop();\n Comparable<String> rightSide = helper.pop();\n helper.push(new Subquery(leftSide, term.toString(), rightSide));\n } else {\n helper.push(term);\n }\n }\n\n Comparable<String> resultQuery = helper.pop();\n parsedQuery = resultQuery instanceof String ? new Subquery(resultQuery) : (Subquery) resultQuery;\n computeUniqueNotation(parsedQuery);\n\n if (parts.length < 2) {\n return;\n }\n\n // Parse sorting properties\n if (parts[1].contains(\"relevance\")) {\n property = \"RELEVANCE\";\n } else if (parts[1].contains(\"popularity\")) {\n property = \"POPULARITY\";\n }\n\n if (parts[1].contains(\"asc\")) {\n direction = 1;\n } else if (parts[1].contains(\"desc\")) {\n direction = -1;\n }\n }", "void setOrderBy(DriveRequest<?> request, String orderBy);", "boolean isSortAscending();", "void sort();" ]
[ "0.75634336", "0.68594795", "0.67994404", "0.67938286", "0.6742503", "0.6667226", "0.66263115", "0.6616304", "0.66087073", "0.6537316", "0.650014", "0.6457589", "0.6425041", "0.63327146", "0.62569976", "0.61934024", "0.61691713", "0.6139815", "0.6067875", "0.6062326", "0.6057651", "0.60480857", "0.6045853", "0.6024687", "0.59809285", "0.5926396", "0.59201455", "0.5915593", "0.586708", "0.58473516", "0.58392465", "0.5828965", "0.5806418", "0.5785013", "0.5771163", "0.5763444", "0.5739285", "0.57392216", "0.57081074", "0.5677272", "0.5672224", "0.56638885", "0.56514585", "0.56499773", "0.5635809", "0.5601312", "0.5587264", "0.55719423", "0.55672526", "0.55575514", "0.55461395", "0.5504496", "0.5503113", "0.550204", "0.5501692", "0.5497693", "0.5493835", "0.5485264", "0.5485015", "0.54840976", "0.5477201", "0.5476942", "0.5444799", "0.5442029", "0.5434052", "0.54308176", "0.54283977", "0.5421456", "0.54177463", "0.5412183", "0.54096586", "0.5402539", "0.53986865", "0.5397018", "0.53958166", "0.53831106", "0.5380933", "0.5378121", "0.53709656", "0.5361909", "0.53507376", "0.5344114", "0.5343613", "0.5342902", "0.53377515", "0.53368187", "0.53289735", "0.53268546", "0.53184044", "0.5316896", "0.52991", "0.5295138", "0.5293128", "0.5287999", "0.5279289", "0.5277005", "0.52748734", "0.52715755", "0.5271022", "0.52657765" ]
0.6294605
14
Sends message to given address, with given title and content
public void sendMsg(String address, String title, String content);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendMail(String address, String content) {\n }", "public void send(Address from, String message);", "public abstract void send(String data, String toAddress);", "public void sendMessage(String content, String toUser) throws IOException, BadLocationException{\r\n\t\tdataSending.sendMessage(content, toUser);\r\n\t\tuserModel.getArchive().getArchiveWriter().addNewTalk(toUser,\"Messeage sent to user\" +toUser + System.lineSeparator() + content);\r\n\t\tclientView.addNewMesseage(content, \"sent to user: \"+toUser);\r\n\t\t\r\n\t}", "private void sendMessage(String content, String room) {\n }", "void send(String message, String uri);", "<T> Promise<Message<T>> send(String address, Character message);", "void sendText(String content);", "public void send(final String username, final String password, String recipientEmail, String title, String message) throws AddressException, MessagingException {\r\n \tsend(username, password, recipientEmail, \"\", title, message);\r\n }", "protected void sendMessage(String addr, Object[] args) {\n\t\ttry {\n\t\t\t_sender.send(args == null ? new OSCMessage(addr) : new OSCMessage(\n\t\t\t\t\taddr, args));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "<T> Promise<Message<T>> send(String address, Short message);", "public void setMessageAddress(String address);", "<T> Promise<Message<T>> send(String address, String message);", "@Override\n public void sendMessage(String to, String content)\n {\n if (to.equals(\"all\"))\n {\n agent.sendBroadcast(content);\n return;\n }\n agent.sendMessage(to, content);\n }", "<T> Promise<Message<T>> send(String address, Buffer message);", "<T> Promise<Message<T>> send(String address, JsonObject message);", "public void message(String from,String msg,String to);", "@Override\n\tpublic void pushBroadcast(String title, String content) {\n\t\tMessageEntity me=new MessageEntity(title,content,\"1\",new Date(),\"1\",\"suibaitiande\");\n\t\tmessageDAO.insertMessage(me);\n\t\tPush.testSendPush(content);\n\t\t\n\t}", "public void sendMessage(String message) {}", "public static void sendAction(Action act, String hubAddress, Context c) {\n try {\n \t// Loading my identity from preferences\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(c);\n\n // for saving the last time the device sent a message to any device\n SharedPreferences.Editor editor = sharedPref.edit();\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\tString curTime = sdf.format(calendar.getTime());\n\t\t\teditor.putString(\"lastDeviceMsg\", curTime);\n\t\t\teditor.commit();\n\n\t\t\tString myIdentity = sharedPref.getString(\"my_identity\", \"\");\n \tact.addArgument(\"fromUser\", myIdentity);\n \t\n \tString msg = serializeAction(act);\n \n \tIntent i = new Intent(c, GenericService.class);\n \n i.setAction(Constants.SEND_MSG_INTENT);\n i.putExtra(\"action\", msg); // msgTextToSend\n i.putExtra(\"hub_address\", hubAddress);\n \n Log.v(\"Helper\", \"Sending: \" + msg + \"To: \" + hubAddress);\n \n c.startService(i);\n } catch(Exception e) {\n \tLog.e(\"sendAction\", \"Something goofy:\" + e.getMessage());\n }\n\t}", "public void sendMessage(String message);", "void send(String message);", "public void send(String recipientEmail, String title, String message) throws AddressException, MessagingException {\r\n \tsend(mailUserName, mailPassword, recipientEmail, \"\", title, message);\r\n }", "<T> Promise<Message<T>> send(String address, Integer message);", "void sendMessage(String msg);", "<T> Promise<Message<T>> send(String address, Byte message);", "public void send(Message msg);", "void sendPost(String title, String body);", "@Override\n\tprotected final void sendMessage(Object content, Performative performative, AgentAddress to){\n\n\t\tACLMessage message = new ACLMessage(content, performative);\n\t\t\n\t\tmessage.setProtocol(EnumFipaProtocol.FIPA_REQUEST);\n\t\tmessage.setConversationId( getConversationId() );\n\t\t\n\t\tgetRefAclAgent().sendACLMessage(message, to);\n\t\t\n\t\t//System.out.println(\"\\n=> MESSAGE envoyé via REQUEST PROTOCOL : \\n\" + message.toString());\n\t}", "public void sendTitle ( String title , String subtitle ) {\n\t\tsendTitle ( title , subtitle , 10 , 70 , 20 );\n\t}", "public void sendMsgToGUI(String content) {\n\t\tlogger.debug(\"Sending a message to \" + QUEUE_NAME);\n\t\tSQSUtil.sendMsg(content, sqs, queueURL);\n\t}", "<T> Promise<Message<T>> send(String address, Long message);", "void sendRequest(String message);", "@Override\r\n public void onClick(View v) {\n String msg = ed_msg.getText().toString();\r\n try {\r\n\t\t\t\t\tsend(HOST, PORT, msg.getBytes());\r\n\t\t\t\t\t\r\n\t \tmHandler.sendMessage(mHandler.obtainMessage()); \r\n\t \tcontent =HOST +\":\"+ msg +\"\\n\";\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n }", "<T> Promise<Message<T>> send(String address, byte[] message);", "@Override\r\n\tpublic void sendMessage(String message) {\n\t\t\r\n\t}", "void sendTo(String from, String to, String m_id);", "<T> Promise<Message<T>> send(String address, Boolean message);", "private void postMsg(double latitude, double longitude, String address){\n\t\tif (null != locationListener) {\n\t\t\tlocationListener.onLocation(latitude, longitude, address);\n\t\t}\n\t}", "<T> Promise<Message<T>> send(String address, Double message);", "public static void sendAsHtml(String to, String title, String mensagemAEnviar) {\n try{\n System.out.println(\"Enviar email para \" + to);\n System.out.println(\"A criar sessao\");\n Session session = createSession();\n System.out.println(\"Sessao criada\");\n System.out.println(\"Preparar mensagem\");\n MimeMessage message = new MimeMessage(session);\n prepareEmailMessage(message, to, title, mensagemAEnviar);\n System.out.println(\"Mensagem \"+ message.toString() + \" preparada\");\n System.out.println(\"A mandar mensagem\");\n Transport.send(message);\n System.out.println(\"Done\");\n }catch(Exception e){\n e.printStackTrace();\n }\n\n }", "<T> Promise<Message<T>> sendWithTimeout(String address, Character message, long timeout);", "public void send(String destination, String message, String identifier){\n return;\n }", "public void sendMessage(View v) {\n // retrieve the text typed in by the user in the EditText\n String message = ((EditText)(findViewById(R.id.editText_message))).getText().toString();\n // create an implicit intent to any app with SENDTO capability\n // set the destination (5556 is the phone number of the second emulator instance)\n Uri destination = Uri.parse(\"smsto:5556\");\n Intent smsIntent = new Intent(Intent.ACTION_SENDTO, destination);\n // pass the composed message to the messaging activity\n smsIntent.putExtra(\"sms_body\", message);\n // launch the intent\n startActivity(smsIntent);\n }", "public void sendmessage(View v){\n \tIntent intent =new Intent();//意图\n \tintent.setAction(Intent.ACTION_SENDTO);//设置发短信意图\n \tintent.setData(Uri.parse(\"smsto:\"+1358752546));//设置拨号的信息\n \t//问题:怎么不能用11位电话号码\n \tString message=\"我是水哥,有妹子么\";\n \tintent.putExtra(\"sms_body\", message);\n \tstartActivity(intent);//开启意图\t \n }", "public void sendEmailToclient(String content) throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException, TemplateException;", "public void sendMessagePacket(String to, String message, Message.Type type) {\n Message msg = new Message(to, type);\n msg.setBody(message);\n xmppConnection.sendPacket(msg);\n// receiveMessage(connection);\n }", "public void sendTextMessageViaHANBExample(String message) \n throws InstanceNotFoundException, MBeanException, ReflectionException;", "private void sendMessage(int tabnumber, String to) {\n\n\t\t/* check if we're connected */\n\t\tif (ElvinConsumerAction.connected) {\n\t\t\tElvinProducer producer = new ElvinProducer();\n\t\t\tproducer.send(server, \"chat\", chatinput[tabnumber].getText(), to);\n\n\t\t\tchathistory[tabnumber].append(\"\\n\"\n\t\t\t\t\t+ System.getProperty(\"user.name\") + \": \"\n\t\t\t\t\t+ chatinput[tabnumber].getText());\n\t\t} else {\n\t\t\tchathistory[tabnumber].append(\"\\n\"\n\t\t\t\t\t+ \"You are not connected to the server!\");\n\t\t}\n\t\tchatinput[tabnumber].setText(\"\");\n\t\tchatinput[tabnumber].setFocus();\n\t}", "private void sendCustomMessage(String message, String alli) {\n String frontA = \"V\" + alli;\n String gobbleDeGuck = \"<ID 0><CLR><WIN 0 0 287 31><POS 0 0><SL><S S><BL N><CS 3><GRN><T>\";\n String mid = message;\n String ender = \"</T>\";\n String sendableMsgString = frontA + gobbleDeGuck + mid + ender;\n //\n sendRawMessage(sendableMsgString);\n }", "@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}", "private void sendCommand(int recipient, int action, int parameter) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + parameter + \";\"\r\n\t\t\t\t+ \"0\" + \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\t}", "void transmit(String protocol, String message);", "public void sendMessage(NetMessage message) {\n ClientDirector.getDataManager().sendMessage(message);\n }", "void sendHtmlMail(String to, String subject, String content);", "void sendUnicast(InetAddress hostname, String message);", "private void sendEmail(String emailAddress, String subject, String body) {\n\t\t\n\t}", "private void sendMessage(String body, String toJid) {\n Log.d(TAG, \"Sending message to :\" + toJid);\n\n EntityBareJid jid = null;\n\n toJid = toJid + \"@\" + mApplicationContext.getString(R.string.txt_domain_name) + \"/\" + mApplicationContext.getString(R.string.txt_resource);\n ChatManager chatManager = ChatManager.getInstanceFor(mConnection);\n\n try {\n jid = JidCreate.entityBareFrom(toJid);\n Log.e(TAG, \"sendMessage: jid : \" + jid);\n } catch (XmppStringprepException e) {\n e.printStackTrace();\n }\n Chat chat = chatManager.chatWith(jid);\n try {\n Message message = new Message(jid, Message.Type.chat);\n message.setBody(body);\n chat.send(message);\n\n } catch (SmackException.NotConnectedException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "private void sendMessage(String message){\n\t\ttry{\n\t\t\toutput.writeObject(\"Punk Ass Server: \" + message);\n\t\t\toutput.flush();\n\t\t\tshowMessage(\"\\nPunk Ass Server: \" + message); \n\t\t}catch(IOException ioe){\n\t\t\tchatWindow.append(\"\\n Message not sent, try again or typing something else\");\n\t\t\t\n\t\t}\n\t\t\n\t}", "public void sendMsg(OutputStream os, String s) throws IOException {\r\n\t byte[] bytes = s.getBytes();\r\n\t os.write(bytes);\r\n\t os.flush();\r\n\t }", "boolean sendMimeMessage(String to, String subject, String htmlContent);", "public void sendMessage(final String message) {\n\n Runnable runnable = new Runnable() {\n @Override\n public void run() {\n\n if (null != sendBuffer) {\n Log.d(TAG, \"Sending: \" + message);\n sendBuffer.println(message);\n sendBuffer.flush();\n }\n }\n };\n\n Thread thread = new Thread(runnable);\n thread.start();\n }", "public void send(String recipientEmail, String ccEmail, String title, String message) throws AddressException, MessagingException {\r\n \tsend(mailUserName, mailPassword, recipientEmail, ccEmail, title, message);\r\n }", "private void sendMessage(String message){\n PostTask pt = new PostTask();\n pt.execute();\n }", "@Override\n\tpublic void send(String msg) {\n\t}", "@Override\n\tpublic void Send(String message) {\n\t\tgetReceiveArea().append(\"我:\"+message + \"\\n\");\n\t\tgetMediator().sendMessage(getName(), message);\n\t}", "public void sendMessage(String message) {\n try {\n bos.write(message);\n bos.newLine();\n bos.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void sendTitle(Player player, String titleText) {\n\t\tplayer.sendMessage(\"\");\n\t\tplayer.sendMessage(titleText);\n\t\tplayer.sendMessage(\"\");\n\t}", "public static void sendMessage(String message) {\r\n\t\tbtService.write(message.getBytes());\r\n\t}", "void sendMessageToClient(long clientId, byte[] content, int prio) throws IOException, MlmqException;", "void sendCommonMail(String to, String subject, String content);", "private void sendCommand(int recipient, int action, int parameter,\r\n\t\t\tint options) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + parameter + \";\"\r\n\t\t\t\t+ options + \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\r\n\t}", "public void sendButtonClick(View v){\n String title = getText(R.string.mail_title).toString();\n String mailto = \"mailto:\" + emailAdress;\n Intent openEmailApp = new Intent(Intent.ACTION_SENDTO);\n openEmailApp.setType(\"plain/text\");\n openEmailApp.setData(Uri.parse(mailto));\n openEmailApp.putExtra(Intent.EXTRA_SUBJECT, userName + title);\n openEmailApp.putExtra(Intent.EXTRA_TEXT, evaluationMessage);\n startActivity(openEmailApp);\n }", "@Override\n public void sendToProxy(String message) {\n }", "public void sendMail(String to, String subject, String text);", "@Override\n\tpublic void sendMsg(String msg) {\n\n\t}", "private void sendMessageToClient(String messageToClient){\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n output.println(\"\\n\" + \"Server: \" + messageToClient);\n output.flush();\n }\n });\n }", "private void sendMessage(String text)\n {\n Message msg = mHandler.obtainMessage();\n Bundle bundle = new Bundle();\n bundle.putString(\"text\",text);\n msg.setData(bundle);\n msg.what = 1;\n mHandler.sendMessage(msg);\n }", "<T> Promise<Message<T>> send(String address, Float message);", "public void smsSendMessage(String phoneNumber, String messageContent) {\n try {\n //EditText editText = (EditText) findViewById(R.id.editText_main);\n // Set the destination phone number to the string in editText.\n String destinationAddress = \"07956765611\";\n // Find the sms_message view.\n //EditText smsEditText = (EditText) findViewById(R.id.sms_message);\n // Get the text of the SMS message.\n String smsMessage = \"Hi Kobi\";\n // Set the service center address if needed, otherwise null.\n String scAddress = null;\n // Set pending intents to broadcast\n // when message sent and when delivered, or set to null.\n PendingIntent sentIntent = null, deliveryIntent = null;\n // Use SmsManager.\n SmsManager smsManager = SmsManager.getDefault();\n\n smsManager.sendTextMessage\n (destinationAddress, scAddress, smsMessage,\n sentIntent, deliveryIntent);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void send(final String username, final String password, String recipientEmail, String ccEmail, String title, String message) throws AddressException, MessagingException {\r\n Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\r\n \r\n LOG.debug(\"Prepare to send email with parameters: username = \" + username + \", password=\" +password+ \", recipientEmail=\" +recipientEmail+ \", ccEmail=\" +ccEmail+ \", title=\" +title+ \", message=\" + message);\r\n \r\n Session session = Session.getInstance(props, null);\r\n\r\n // -- Create a new message --\r\n final MimeMessage msg = new MimeMessage(session);\r\n\r\n // -- Set the FROM and TO fields --\r\n msg.setFrom(new InternetAddress(username));\r\n msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipientEmail, false));\r\n\r\n if (ccEmail.length() > 0) {\r\n msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(ccEmail, false));\r\n }\r\n\r\n msg.setSubject(title);\r\n msg.setText(message, Config.getInstance().getProperty(Config.SMTP_ENCODING));\r\n msg.setSentDate(new Date());\r\n\r\n SMTPTransport t = (SMTPTransport)session.getTransport(Config.getInstance().getProperty(Config.SMTPS_TRANSPORT));\r\n\r\n t.connect(Config.getInstance().getProperty(Config.SMTP_HOST), username, password);\r\n t.sendMessage(msg, msg.getAllRecipients()); \r\n t.close();\r\n \r\n LOG.debug(\"Message successfully sent\");\r\n }", "public void sendMessage(String message) {\n\t\tsocketTextOut.println(message);\n\t\tsocketTextOut.flush();\n\t}", "public void sendMessage(String message){\n pw.print(message);\n pw.flush();\n }", "public void send(Message dmsg) throws IOException {\n\tString phoneNumber = null;\n\tString address = null;\n\n\tif (dmsg == null) {\n\t throw new NullPointerException();\n\t}\n\n if (dmsg.getAddress() == null) {\n throw new IllegalArgumentException();\n\t}\n\n /*\n * parse name into host and port\n */\n\tString addr = dmsg.getAddress();\n HttpUrl url = new HttpUrl(addr);\n if (url.port == -1) {\n /* no port supplied */\n url.port = 0;\n }\n\n\t/* Can not send to cbs address. */\n\tif (addr.startsWith(\"cbs:\")) {\n\t // Can't send a CBS message.\n\t throw new IllegalArgumentException(\"Can't send CBS msg.\");\n\t}\n\n int numSeg = numberOfSegments(dmsg);\n\tif ((numSeg <= 0) || (numSeg > 3)) {\n throw new IOException(\"Error: message is too large\");\n\t}\n\n try {\n midletSuite.checkForPermission(Permissions.SMS_SEND,\n url.host,\n Integer.toString(numSeg));\n } catch (InterruptedException ie) {\n throw new InterruptedIOException(\"Interrupted while trying \" +\n \"to ask the user permission\");\n }\n\n\tensureOpen();\n\n\tif ((m_mode & Connector.WRITE) == 0) {\n\n\t throw new IOException(\"Invalid mode\");\n\t}\n\n int sourcePort = 0;\n if ((m_mode & Connector.READ) != 0 && host == null) {\n sourcePort = m_iport;\n }\n\n for (int restrictedPortIndex = 0;\n restrictedPortIndex < restrictedPorts.length;\n restrictedPortIndex++) {\n if (url.port == restrictedPorts[restrictedPortIndex]) {\n throw new SecurityException(\n \"not allowed to send SMS messages to the restricted ports\");\n }\n }\n\n\tint messageType = GSM_BINARY;\n\tbyte[] msgBuffer = null;\n\n if (dmsg instanceof TextObject)\t {\n byte[] gsm7bytes;\n msgBuffer = ((TextObject)dmsg).getBytes();\n\t if (msgBuffer != null) {\n /*\n * Attempt to encode the UCS2 bytes as GSM 7-bit.\n */\n gsm7bytes = TextEncoder.encode(msgBuffer);\n if (gsm7bytes != null) {\n\t\t msgBuffer = gsm7bytes;\n\t\t messageType = GSM_TEXT;\n } else {\n /*\n * Encoding attempt failed. Send UCS2 bytes.\n */\n\t\t messageType = GSM_UCS2;\n }\n\t }\n\n } else if (dmsg instanceof BinaryObject) {\n msgBuffer = ((BinaryObject)dmsg).getPayloadData();\n\t} else {\n throw new IllegalArgumentException(\"Message type not supported\");\n\t}\n\n try {\n send0(connHandle, messageType,\n url.host,\n url.port,\n\t\t\t sourcePort,\n msgBuffer);\n } catch (IOException ex) {\n io2InterruptedIOExc(ex, \"sending\");\n }\n }", "void sendMessage(String message) throws SocketIOException;", "<T> Promise<Message<T>> send(String address, JsonArray message);", "private void sendToBtAct(String msg) {\n Intent intent = new Intent(\"getTextToSend\");\n // You can also include some extra data.\n intent.putExtra(\"tts\", msg);\n LocalBroadcastManager.getInstance(this).sendBroadcast(intent);\n }", "private void sendCommand(int recipient, int action) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + \"0\" + \";\" + \"0\"\r\n\t\t\t\t+ \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\t}", "private String SendMessage(String host, int port, String userName, String password, String number, String message) throws IOException {\n String uri = \"http://\" + host + \":\" + Integer.toString(port) + \"/http/send-message/\";\n // Add the HTTP query to the base URI\n uri += \"?username=\" + URLEncoder.encode(userName, \"UTF-8\");\n uri += \"&password=\" + URLEncoder.encode(password, \"UTF-8\");\n uri += \"&to=\" + URLEncoder.encode(number, \"UTF-8\");\n uri += \"&message=\" + URLEncoder.encode(message, \"UTF-8\");\n\n\n URL url = new URL(uri);\n HttpURLConnection uc = (HttpURLConnection)url.openConnection();\n uc.disconnect();\n\n return uc.getResponseMessage();\n }", "void sendMessageToTarget(@ParamName(\"message\") String message);", "@Override\npublic int sendToAddress(InetSocketAddress isa, byte[] msg) throws IOException {\n\treturn 0;\n}", "<T> Promise<Message<T>> sendWithTimeout(String address, Short message, long timeout);", "public void sendTo(P2PUser dest, Object msg) throws IOException;", "private void sendPacket(InetAddress address, byte[] data) {\n try {\n send.setAddress(address);\n send.setData(Encryption.encrypt(data));\n socket.send(send);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void SendMessage(String message) {\n\t\t\n\t\ttry\n\t\t{\n\t\tprintWriters.get(clients.get(0)).println(message);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}", "public void sendTitle(float fadein, float fadeout, float stay, CommandSender receiver, String title, String subtitle, SoundType sound) {\r\n \tif(receiver instanceof ProxiedPlayer) {\r\n\t \tProxiedPlayer player = (ProxiedPlayer)receiver;\r\n\t \tTitle title_ = ProxyServer.getInstance().createTitle();\r\n\t \ttitle_.fadeIn((int)fadein * 20);\r\n\t \ttitle_.fadeOut((int)fadeout * 20);\r\n\t \ttitle_.stay((int)stay * 20);\r\n\t \ttitle_.title(TextComponent.fromLegacyText(title));\r\n\t \ttitle_.subTitle(TextComponent.fromLegacyText(subtitle));\r\n\t\t\tplayer.sendTitle(title_);\r\n \t\t\r\n\t\t\t// send sounds\r\n\t KaranteeniCore.getSoundHandler().playSound((ProxiedPlayer)receiver, sound);\r\n \t} else {\r\n \t\tif(title != null && !title.isEmpty())\r\n \t\t\tsendMessage(receiver, sound, title);\r\n \t\tif(title != null && !title.isEmpty())\r\n \t\t\tsendMessage(receiver, sound, subtitle);\r\n \t}\r\n }", "public abstract void sendMessage(String message);", "@MessageMapping(\"/send/msg\")\n @SendTo(\"/sometopic\")\n public String sendToTopic(String content) {\n return content;\n }", "private <T extends QMessage> void sendTestMsg(T msg) {\n\n\t\ttry {\n\t\t\tString token = KeycloakUtils.getAccessToken(\"http://keycloak.genny.life\", \"genny\", \"genny\",\n\t\t\t\t\t\"056b73c1-7078-411d-80ec-87d41c55c3b4\", \"user1\", \"password1\");\n\t\t\tmsg.setToken(token);\n\n\t\t\t/* get the bridge url to publish the message to webcmd channel */\n\t\t\tString bridgetUrl = ENV_GENNY_BRIDGE_URL + \"/api/service?channel=webdata\";\n\n\t\t\tQwandaUtils.apiPostEntity(bridgetUrl, JsonUtils.toJson(msg), token);\n\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}", "<T> Promise<Message<T>> sendWithTimeout(String address, Buffer message, long timeout);" ]
[ "0.7290522", "0.6924511", "0.67030054", "0.6531404", "0.651106", "0.64461887", "0.6444167", "0.6430403", "0.63408023", "0.63031", "0.62896657", "0.6194059", "0.6154452", "0.6150533", "0.6144897", "0.6080728", "0.6076449", "0.6061209", "0.6027413", "0.6001156", "0.5998739", "0.5994747", "0.5971044", "0.5951991", "0.5951845", "0.5945989", "0.59441924", "0.59286207", "0.59011483", "0.58784944", "0.58774495", "0.587261", "0.5820488", "0.581638", "0.5780074", "0.5779596", "0.5773408", "0.57514817", "0.5744129", "0.5741121", "0.573154", "0.57177985", "0.57170683", "0.5711263", "0.5687101", "0.5674717", "0.5670717", "0.5662", "0.56605643", "0.56567687", "0.5651564", "0.5651399", "0.56428945", "0.5640892", "0.56382304", "0.5637825", "0.56372845", "0.56164354", "0.5615423", "0.5613489", "0.56008595", "0.5600429", "0.55982107", "0.5583924", "0.5579559", "0.557598", "0.5570502", "0.556614", "0.5563904", "0.55631614", "0.5561282", "0.5561238", "0.55580866", "0.55557543", "0.5555306", "0.5547871", "0.5537778", "0.5535841", "0.5534961", "0.55329806", "0.5518643", "0.55154353", "0.5510875", "0.55072576", "0.55056876", "0.55053294", "0.5501924", "0.54933417", "0.5493126", "0.54877734", "0.5487414", "0.54831105", "0.54804015", "0.5469866", "0.5469722", "0.546938", "0.5463694", "0.54514074", "0.5449089", "0.54486257" ]
0.9107185
0
TODO Use my noise
public static @NotNull Image genNoiseWhite(int width, int height, double factor) { Color.Buffer pixels = Color.malloc(ColorFormat.RGBA, width * height); Random random = new Random(); for (int i = 0, n = width * height; i < n; i++) pixels.put(i, random.nextDouble() < factor ? Color.WHITE : Color.BLACK); return new Image(pixels, width, height, 1, ColorFormat.RGBA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink \");\n\t}", "private double noise(SpIterNoiseObs noise) {\n return 3.0 * 60.0;\n }", "M generateNoise();", "java.lang.String getNoise();", "@Override\r\n\tpublic String makeANoise() {\n\t\treturn \"deer noise\";\r\n\t}", "public abstract void makeNoise();", "@Override\n\tpublic String makeNoise() {\n\t\treturn \"Meoooooow\";\n\t\t\n\t\n\n}", "private void random() {\n\n\t}", "boolean hasNoise();", "public void highscorenoise()\n {\n if(!mute)\n {\n try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Darkmoon Caverns.wav\");\n double c = Math.random();\n if(c<=.25)\n url = this.getClass().getClassLoader().getResource(\"Mario Kart Win.wav\");\n else if(c<=.50)\n url = this.getClass().getClassLoader().getResource(\"Pirate Lagoon.wav\");\n else if(c<=.75)\n url = this.getClass().getClassLoader().getResource(\"Crescent Island.wav\"); \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n hclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n hclip.open(audioIn); \n \n hclip.start();\n hclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n }\n }", "@Override\n\tString makeNoise() {\n\t\treturn \"moooooo\";\n\t}", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"mammals are making noise\");\n\t}", "@Override\n public void makeNoise() {\n System.out.println(getName()+ \" Oink Oink\");\n }", "public String makeNoise(){\n return \"Feline: make noise. \";\n }", "double sample();", "public void setup()\n{\n noiseDetail(6);\n noiseScale = 0.01f;\n c1 = new Car(250, 250);\n}", "@Override\r\n\tvoid makeNoise() {\n\t\tSystem.out.println(\"Moo\");\r\n\t}", "public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}", "void calcWave() {\n yoff += 0.01f;\n \n //For every x value, calculate a y value based on sine or cosine\n float x = yoff; //**OPTION #1****/\n //float x = 0.0f; //**OPTION #2****/\n for (int i = 0; i < yvalues.length; i++) {\n float n = 2*noise(x)-1.0f; //**OPTION #1****/ //scale noise to be between 1 and -1\n //float n = 2*noise(x,yoff)-1.0f; //**OPTION #2****/ //scale noise to be between 1 and -1\n yvalues[i] = n*amplitude;\n x+=dx;\n }\n }", "public void makeNoise() {\n System.out.println(this.name + \" the \" + this.toString() + \" wails\");\n }", "public void makeNoise() {\n\t\tSystem.out.println(toString() + \" grunted\");\n\t}", "private ToneDetection() { }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void newSpeechNoise(long ms, int n);", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public int noise(int xin, int yin, int zin);", "double passer();", "public abstract double sample();", "public String noise() {\n return \"not overridden\";\n }", "double sample()\n\t{\n\t\treturn rb.peek();\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Dog goes bark!!! \");\n\n}", "private float noise(Vector2 point) {\n\t\tVector2 bottomLeft = randomGrid[(int) point.x][(int) point.y];\n\t\tVector2 topLeft = randomGrid[(int) point.x][(int) point.y + 1];\n\t\tVector2 bottomRight = randomGrid[(int) point.x + 1][(int) point.y];\n\t\tVector2 topRight = randomGrid[(int) point.x + 1][(int) point.y + 1];\n\n\t\tfloat bottomLeftValue = bottomLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y));\n\t\tfloat topLeftValue = topLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y + 1));\n\t\tfloat bottomRightValue = bottomRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y));\n\t\tfloat topRightValue = topRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y + 1));\n\n\t\tfloat bottomValue = bottomLeftValue * (1 - point.x % 1) + bottomRightValue * (point.x % 1);\n\t\tfloat topValue = topLeftValue * (1 - point.x % 1) + topRightValue * (point.x % 1);\n\t\tfloat value = bottomValue * (1 - point.y % 1) + topValue * (point.y % 1);\n\n\t\treturn value;\n\t}", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "int sampleOffset();", "Randomizer getRandomizer();", "public static int offset_infos_valid_noise_samples() {\n return (88 / 8);\n }", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "@Override\r\n\tpublic float getSample(long us) {\n\t\treturn 0;\r\n\t}", "Boolean getRandomize();", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "@Override\n public double ringNotes(){\n double ret = 0;\n for (int i = 0; i < pStrings.length; i++){\n for (int a = 0; a < pStrings[i].length; a++){\n pStrings[i][a].tic();\n ret += pStrings[i][a].sample();\n \n }\n }\n return ret;\n }", "private double readPressureSample() {\n return 6 * randomPressureSampleSimulator.nextDouble() * randomPressureSampleSimulator.nextDouble();\n }", "public void makeNoise() {\n\t\tfor (Animal a : animals) {\n\t\t\ta.makeNoise();\n\t\t}\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public final double getEstimatedNoise() {\r\n return noise;\r\n }", "float genChance();", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "@Override\n public double tuition(){\n return 2500;\n }", "BlueSphere() {\n Random random = new Random();\n value[0] = random.nextInt(16) + 1;\n }", "private static void runNoise() throws GameActionException {\n\t\t\n\t}", "public double getYNoise(double x, double z)\n {\n double var11 = 0.5D * (square3 - 1.0D);\n double var13 = (x + z) * var11;\n int var15 = fastFloor(x + var13);\n int var16 = fastFloor(z + var13);\n double var17 = (3.0D - square3) / 6.0D;\n double var19 = (double)(var15 + var16) * var17;\n double var21 = (double)var15 - var19;\n double var23 = (double)var16 - var19;\n double var25 = x - var21;\n double var27 = z - var23;\n byte var29;\n byte var30;\n\n if (var25 > var27)\n {\n var29 = 1;\n var30 = 0;\n }\n else\n {\n var29 = 0;\n var30 = 1;\n }\n\n double var31 = var25 - (double)var29 + var17;\n double var33 = var27 - (double)var30 + var17;\n double var35 = var25 - 1.0D + 2.0D * var17;\n double var37 = var27 - 1.0D + 2.0D * var17;\n int var39 = var15 & 255;\n int var40 = var16 & 255;\n int var41 = this.permutationTable[var39 + this.permutationTable[var40]] % 12;\n int var42 = this.permutationTable[var39 + var29 + this.permutationTable[var40 + var30]] % 12;\n int var43 = this.permutationTable[var39 + 1 + this.permutationTable[var40 + 1]] % 12;\n double var44 = 0.5D - var25 * var25 - var27 * var27;\n double var5;\n\n if (var44 < 0.0D)\n {\n var5 = 0.0D;\n }\n else\n {\n var44 *= var44;\n var5 = var44 * var44 * dot(grad3[var41], var25, var27);\n }\n\n double var46 = 0.5D - var31 * var31 - var33 * var33;\n double var7;\n\n if (var46 < 0.0D)\n {\n var7 = 0.0D;\n }\n else\n {\n var46 *= var46;\n var7 = var46 * var46 * dot(grad3[var42], var31, var33);\n }\n\n double var48 = 0.5D - var35 * var35 - var37 * var37;\n double var9;\n\n if (var48 < 0.0D)\n {\n var9 = 0.0D;\n }\n else\n {\n var48 *= var48;\n var9 = var48 * var48 * dot(grad3[var43], var35, var37);\n }\n\n return 70.0D * (var5 + var7 + var9);\n }", "public int storrelse();", "private int genRandomWaveNum(int waveNum){\n return genRandomWaveNum(1, waveNum);\n }", "private double noisyRt(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getRtStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "int pauseSample() {\n return 0;\n }", "public static int offsetBits_infos_valid_noise_samples() {\n return 88;\n }", "public void jitter() {\n // jitter +- 20% of the value\n double amount = 0.20;\n double change = 1.0 - amount + (Evolve.getRandomNumber() * amount * 2); \n value *= change;\n }", "private static void test3() {\n for (int noteNumber = 0; noteNumber < 128; noteNumber++) {\n double frequency = 440 * Math.pow(2, (noteNumber - 69) / 12.0);\n \n boolean clipMax = false;\n int block = 0;\n \n if (frequency <= 48.503) {\n block = 0;\n }\n else if (frequency <= 97.006) {\n block = 1;\n }\n else if (frequency <= 194.013) {\n block = 2;\n }\n else if (frequency <= 388.026) {\n block = 3;\n }\n else if (frequency <= 776.053) {\n block = 4;\n }\n else if (frequency <= 1552.107) {\n block = 5;\n }\n else if (frequency <= 3104.215) {\n block = 6;\n }\n else if (frequency <= 6208.431) {\n block = 7;\n \n }\n else {\n //throw new RuntimeException(\"invalid frequency !\");\n //System.out.println(\"unsupported frequency \" + frequency + \" !\");\n //System.exit(-1);\n block = 7;\n clipMax = true;\n }\n \n double f_num = frequency * Math.pow(2, (20 - block)) / 49716;\n if (clipMax) {\n f_num = 1023;\n }\n String f_num_hex = \"0000\" + Integer.toHexString((int) f_num);\n f_num_hex = f_num_hex.substring(f_num_hex.length() - 4, f_num_hex.length());\n //System.out.println(noteNumber + \" = \" + frequency + \" ---> block: \" + block + \" f_num_hex = \" + f_num_hex);\n //System.out.println(noteNumber + \" = \" + frequency);\n \n String block_hex = \"000\" + Integer.toHexString(block);\n block_hex = block_hex.substring(block_hex.length() - 3, block_hex.length());\n\n if (noteNumber % 4 == 0) {\n System.out.print(\"\\r\\n\\t\\t\\tdb \");\n }\n System.out.print(block_hex + \"h, 000h, 0\" + f_num_hex.subSequence(2, 4) + \"h, 0\" + f_num_hex.substring(0, 2) + \"h\" + ((noteNumber % 4 != 3) ? \", \" : \"\"));\n \n }\n System.out.println(\"\");\n }", "public abstract void randomize();", "private double noisyMass(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getMassStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private long getSampleTime() {\n return System.currentTimeMillis();\n\n }", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "float getFixedHotwordGain();", "int pauseSamples() {\n return 0;\n }", "public void spin () {\n //Decide outcome.\n Random rand=new Random();\n result=rand.nextInt(100)+1+prevSpin;\n\n /**\n * Set the images\n * Image 1-11 are pictures listed bellow. 12 is wild.\n */\n //Loss\n if (result<=10) {\n //Prevention of loss streak\n prevSpin+=1;\n spinsLeft-=1;\n\n img1=rand.nextInt(12)+1;\n if (img1==12) {\n img2=rand.nextInt(11)+1;\n }\n else {\n img2=rand.nextInt(12)+1;\n }\n\n if (img1==img2) {\n img3=rand.nextInt(11)+1;\n while (img1==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else if (img1==12 || img2==12) {\n img3=rand.nextInt(11)+1;\n while (img1==img3 || img2==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else {\n img3=rand.nextInt(12)+1;\n }\n }\n\n //Cherry (1)\n else if (11<=result && result<=27) {\n prevSpin=0;\n spinsLeft-=1;\n score+=10;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=1;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=1;\n if (rand.nextInt(wildChance)+1==1 && (img1==1 || img2==1))\n img3=12;\n else\n img3=1;\n }\n\n //Pine tree (2)\n else if (28<=result && result<=38) {\n prevSpin=0;\n spinsLeft-=1;\n score+=20;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=2;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=2;\n if (rand.nextInt(wildChance)+1==1 && (img1==2 || img2==2))\n img3=12;\n else\n img3=2;\n }\n\n //\"Bar\" (3)\n else if (39<=result && result<=49) {\n prevSpin=0;\n spinsLeft-=1;\n score+=40;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=3;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=3;\n if (rand.nextInt(wildChance)+1==1 && (img1==3 || img2==3))\n img3=12;\n else\n img3=3;\n }\n\n //Bell (4)\n else if (50<=result && result<=58) {\n prevSpin=0;\n spinsLeft-=1;\n score+=60;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=4;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=4;\n if (rand.nextInt(wildChance)+1==1 && (img1==4 || img2==4))\n img3=12;\n else\n img3=4;\n }\n\n //Snowflake (5)\n else if (59<=result && result<=67) {\n prevSpin=0;\n spinsLeft-=1;\n score+=100;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=5;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=5;\n if (rand.nextInt(wildChance)+1==1 && (img1==5 || img2==5))\n img3=12;\n else\n img3=5;\n }\n\n //Mead tankard (6)\n else if (68<=result && result<=75) {\n prevSpin=0;\n spinsLeft-=1;\n score+=150;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=6;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=6;\n if (rand.nextInt(wildChance)+1==1 && (img1==6 || img2==6))\n img3=12;\n else\n img3=6;\n }\n\n //Snowball (7)\n else if (76<=result && result<=82) {\n prevSpin=0;\n spinsLeft-=1;\n score+=250;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=7;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=7;\n if (rand.nextInt(wildChance)+1==1 && (img1==7 || img2==7))\n img3=12;\n else\n img3=7;\n }\n\n //Moose (8)\n else if (83<=result && result<=88) {\n prevSpin=0;\n spinsLeft-=1;\n score+=350;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=8;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=8;\n if (rand.nextInt(wildChance)+1==1 && (img1==8 || img2==8))\n img3=12;\n else\n img3=8;\n }\n\n //Coin (9)\n else if (89<=result && result<=93) {\n prevSpin=0;\n score+=500;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=9;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=9;\n if (rand.nextInt(wildChance)+1==1 && (img1==9 || img2==9))\n img3=12;\n else\n img3=9;\n }\n\n //\"7\" (10)\n else if (94<=result && result<=98) {\n prevSpin=0;\n spinsLeft+=2;\n score+=777;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=10;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=10;\n if (rand.nextInt(wildChance)+1==1 && (img1==10 || img2==10))\n img3=12;\n else\n img3=10;\n }\n\n //Barbarian \"Bar\" (11)\n else if (99<=result) {\n //Prevention of \"high win\" streak\n prevSpin-=1;\n spinsLeft+=9;\n score+=1000;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=11;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=11;\n if (rand.nextInt(wildChance)+1==1)\n img3=12;\n else\n img3=11;\n }\n\n else {\n System.out.println(\"Result Error.\");\n }\n }", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "static final int fast_rand()\n\t{\n\t\tRz = 36969 * (Rz & 65535) + (Rz >>> 16);// ((Rz >>> 16) & 65535);\n\t\tRw = 18000 * (Rw & 65535) + (Rw >>> 16);// ((Rw >>> 16) & 65535);\n\t\treturn (Rz << 16) + Rw;\n\t}", "private boolean needXray() {\n\t\treturn Math.random() < XRAY_PROBABILITY;\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static void main(String[] args) {\n\n // Declaracao da variaveis;\n float media;\n int soma;\n\n // Declaracao das variveis que recebem os numeros aleatorios;\n double alea1 = Math.random();\n byte n1 = (byte)(0 + alea1 * (29-0));\n double alea2 = Math.random();\n byte n2 = (byte)(0 + alea2 * (29-0));\n double alea3 = Math.random();\n byte n3 = (byte)(0 + alea3 * (29-0));\n\n // Operacoes matematicas para calculo da media e soma;\n media = (n1 + n2 + n3)/3;\n soma = (n1 + n2 + n3);\n\n // Impressao dos resultdos\n System.out.println(\"Os tres numeros aleatorios escolhidos sao: \"+n1+\", \"+n2+\" e \"+n3);\n System.out.println(\"A media dos tres numeros e igual a: \"+media+\"\\nO somatorio dos tres numeros e igual a: \"+soma);\n }", "public static ArrayList<Double> generate(int n1, int n2, int ton, int phrase) throws MidiUnavailableException, InterruptedException, InvalidMidiDataException, IOException {\n Synthesizer synth = MidiSystem.getSynthesizer();\n synth.open();\n final MidiChannel[] channels = synth.getChannels();\n ArrayList<Double> normalizedResult=new ArrayList<>();\n\n int fn=n1,sn=n2,nn,tr;\n Sequence seq= new Sequence(Sequence.PPQ,10,2);\n Track track=seq.getTracks()[0];\n Track track2=seq.getTracks()[1];\n\n for(int i=0;i<phrase;i++)\n {\n nn=Weights.nextNote(fn,sn);\n\n channels[0].noteOn(nn+ton,127);\n //tr=nn+4;\n //if(Math.random()<0.5) channels[0].noteOn(tr+ton,127);\n //channels[0].noteOn(tr+3+ton,127);\n //if(Math.random()<0.2) channels[0].noteOn(tr+8+ton,127);\n\n ShortMessage sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn,100);\n track.add(new MidiEvent(sm,i*4));sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn+3,90);\n track.add(new MidiEvent(sm,i*4));\n\n\n\n if(i%2==0) {\n Thread.sleep(350);\n }\n else {\n Thread.sleep(150);\n }\n\n normalizedResult.add(1./nn);\n\n\n channels[0].noteOff(nn+ton);\n //channels[0].noteOff(tr+ton);\n //channels[0].noteOff(tr+3+ton);\n //channels[0].noteOff(tr+8+ton);\n fn=sn;\n sn=nn;\n }\n\n MidiSystem.write(seq, 1,new File(\"src/sample/result.mid\"));\n System.out.println(\"GG end\");\n return normalizedResult;\n }", "private double noise(final double xin, final double yin, final double zin) {\n double n0, n1, n2, n3;\n double s = (xin + yin + zin) * F3;\n int i = fastfloor(xin + s);\n int j = fastfloor(yin + s);\n int k = fastfloor(zin + s);\n double t = (i + j + k) * G3;\n double x0 = xin - (i - t);\n double y0 = yin - (j - t);\n double z0 = zin - (k - t);\n int i1, j1, k1;\n int i2, j2, k2;\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n }\n } else {\n if (y0 < z0) {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else if (x0 < z0) {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n }\n }\n double x1 = x0 - i1 + G3;\n double y1 = y0 - j1 + G3;\n double z1 = z0 - k1 + G3;\n double x2 = x0 - i2 + 2.0 * G3;\n double y2 = y0 - j2 + 2.0 * G3;\n double z2 = z0 - k2 + 2.0 * G3;\n double x3 = x0 - 1.0 + 3.0 * G3;\n double y3 = y0 - 1.0 + 3.0 * G3;\n double z3 = z0 - 1.0 + 3.0 * G3;\n int ii = i & (SUPPLY_LENGTH - 1);\n int jj = j & (SUPPLY_LENGTH - 1);\n int kk = k & (SUPPLY_LENGTH - 1);\n int gi0 = permMod12[ii + perm[jj + perm[kk]]];\n int gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]];\n int gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]];\n int gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]];\n double t0 = CONTRIBUTION_FACTOR - x0 * x0 - y0 * y0 - z0 * z0;\n if (t0 < 0) {\n n0 = 0.0;\n } else {\n t0 *= t0;\n n0 = t0 * t0 * dot(GTAB[gi0], x0, y0, z0);\n }\n double t1 = CONTRIBUTION_FACTOR - x1 * x1 - y1 * y1 - z1 * z1;\n if (t1 < 0) {\n n1 = 0.0;\n } else {\n t1 *= t1;\n n1 = t1 * t1 * dot(GTAB[gi1], x1, y1, z1);\n }\n double t2 = CONTRIBUTION_FACTOR - x2 * x2 - y2 * y2 - z2 * z2;\n if (t2 < 0) {\n n2 = 0.0;\n } else {\n t2 *= t2;\n n2 = t2 * t2 * dot(GTAB[gi2], x2, y2, z2);\n }\n double t3 = CONTRIBUTION_FACTOR - x3 * x3 - y3 * y3 - z3 * z3;\n if (t3 < 0) {\n n3 = 0.0;\n } else {\n t3 *= t3;\n n3 = t3 * t3 * dot(GTAB[gi3], x3, y3, z3);\n }\n return NORMALIZE_FACTOR * (n0 + n1 + n2 + n3);\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "void mosaic(int seed);", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}", "public void driver() {\r\n \t// At the last time point assume exponentials are largely decayed and most of what is\r\n \t// left is the constant a[0] term.\r\n gues[0] = ySeries[ySeries.length-1];\r\n for (int i = 0; i < (a.length-1)/2; i++) {\r\n \tgues[2*i+1] = 1.0;\r\n \tgues[2*i+2] = -1.0;\r\n }\r\n super.driver();\r\n }", "void dither();", "void dither();", "private void initialiseWeights() {\n\n threshold = -1+2*Math.random();\n thresholdDiff = 0;\n\n for(int i = 0; i < weight.length; i++) {\n weight[i]= -1+2*Math.random();\n weightDiff[i] = 0;\n }\n\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "long random(long ws) {\r\n\t\treturn (System.currentTimeMillis() % ws);\r\n\t}", "public void step() {\n // method 1 of Temperature randomness\n enPrice = 1.1 * enPrice;\n\n TempChange = Temperature * (0.1 * (1 - 2 * r.nextDouble()));\n // method 2 of Temperature\n// TempChange = temperature_list.get(count);\n// count+=1;\n\n Temperature += TempChange;\n year_num+=1;\n }", "double seBlesser();", "protected abstract void nextWave();", "public static int numElements_infos_noise() {\n return 3;\n }", "public abstract void newGuiNoise(long ms, int n);", "public void makeSomeNoise(IntegerMath math) {\n\n }", "public void mo4359a() {\n }", "public static int nextNote(int n1,int n2) {\n double rnd,sum=0;\n rnd=Math.random();\n for(int i=0;i<12;i++)\n {\n sum+=weights[n1-60][n2-60][i];\n\n if(rnd<=sum)\n return i+60;\n }\n return 62;\n }", "public void snare();", "protected double samplesOnePixelF() {\r\n\t\tif (getGraphWidth() > 1) {\r\n\t\t\t// avoid division by zero\r\n\t\t\treturn ((double) section.getLength()) / getGraphWidth();\r\n\t\t}\r\n\t\treturn 1.0;\r\n\t}", "public static int size_infos_valid_noise_samples() {\n return (8 / 8);\n }" ]
[ "0.6488574", "0.6425282", "0.63332796", "0.6199816", "0.6183697", "0.6152466", "0.6124789", "0.6081928", "0.59939843", "0.59937423", "0.59171516", "0.588145", "0.58596987", "0.58524966", "0.58491826", "0.58364564", "0.5835778", "0.5808904", "0.57405454", "0.57383394", "0.573021", "0.57246983", "0.57161987", "0.5707901", "0.56456727", "0.5603162", "0.5592959", "0.557009", "0.5550669", "0.55191255", "0.55138093", "0.55075306", "0.5491038", "0.54792976", "0.54768807", "0.5467531", "0.54508215", "0.54472834", "0.54336137", "0.5426434", "0.54101515", "0.54052603", "0.5351587", "0.53425956", "0.5334999", "0.5323061", "0.53130025", "0.53013456", "0.52882284", "0.52771264", "0.52688736", "0.5268833", "0.5268355", "0.52648914", "0.5254441", "0.525193", "0.52423215", "0.5240327", "0.5231121", "0.5230201", "0.52240175", "0.5215505", "0.5198452", "0.51979405", "0.5197641", "0.51957536", "0.5185176", "0.5178896", "0.5178343", "0.5177648", "0.51722276", "0.51631314", "0.5162761", "0.5162457", "0.5161157", "0.5160777", "0.5149608", "0.5144487", "0.5144487", "0.5143914", "0.5143785", "0.5138316", "0.51334345", "0.5132292", "0.5132292", "0.5131394", "0.51259625", "0.5125058", "0.51237774", "0.5123054", "0.51193553", "0.51186204", "0.51150805", "0.5114498", "0.5103284", "0.5102054", "0.5100344", "0.51001906", "0.50999874", "0.5093597", "0.509098" ]
0.0
-1
TODO Use my noise
public static @NotNull Image genNoisePerlin(int width, int height, int offsetX, int offsetY, double scale) { Color.Buffer pixels = Color.malloc(ColorFormat.RGBA, width * height); for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) { float nx = (i + offsetX) * (float) scale / width; float ny = (j + offsetY) * (float) scale / height; // Typical values to start playing with: // lacunarity = ~2.0 -- spacing between successive octaves (use exactly 2.0 for wrapping output) // gain = 0.5 -- relative weighting applied to each successive octave // octaves = 6 -- number of "octaves" of noise3() to sum // NOTE: We need to translate the data from [-1..1] to [0..1] float p = (stb_perlin_fbm_noise3(nx, ny, 1.0F, 2.0F, 0.5F, 6) + 1.0F) / 2.0F; pixels.put(j * width + i, (int) (p * 255), 255); } } return new Image(pixels, width, height, 1, ColorFormat.RGBA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink \");\n\t}", "private double noise(SpIterNoiseObs noise) {\n return 3.0 * 60.0;\n }", "M generateNoise();", "java.lang.String getNoise();", "@Override\r\n\tpublic String makeANoise() {\n\t\treturn \"deer noise\";\r\n\t}", "public abstract void makeNoise();", "@Override\n\tpublic String makeNoise() {\n\t\treturn \"Meoooooow\";\n\t\t\n\t\n\n}", "private void random() {\n\n\t}", "boolean hasNoise();", "public void highscorenoise()\n {\n if(!mute)\n {\n try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Darkmoon Caverns.wav\");\n double c = Math.random();\n if(c<=.25)\n url = this.getClass().getClassLoader().getResource(\"Mario Kart Win.wav\");\n else if(c<=.50)\n url = this.getClass().getClassLoader().getResource(\"Pirate Lagoon.wav\");\n else if(c<=.75)\n url = this.getClass().getClassLoader().getResource(\"Crescent Island.wav\"); \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n hclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n hclip.open(audioIn); \n \n hclip.start();\n hclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n }\n }", "@Override\n\tString makeNoise() {\n\t\treturn \"moooooo\";\n\t}", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"mammals are making noise\");\n\t}", "@Override\n public void makeNoise() {\n System.out.println(getName()+ \" Oink Oink\");\n }", "public String makeNoise(){\n return \"Feline: make noise. \";\n }", "double sample();", "public void setup()\n{\n noiseDetail(6);\n noiseScale = 0.01f;\n c1 = new Car(250, 250);\n}", "@Override\r\n\tvoid makeNoise() {\n\t\tSystem.out.println(\"Moo\");\r\n\t}", "public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}", "void calcWave() {\n yoff += 0.01f;\n \n //For every x value, calculate a y value based on sine or cosine\n float x = yoff; //**OPTION #1****/\n //float x = 0.0f; //**OPTION #2****/\n for (int i = 0; i < yvalues.length; i++) {\n float n = 2*noise(x)-1.0f; //**OPTION #1****/ //scale noise to be between 1 and -1\n //float n = 2*noise(x,yoff)-1.0f; //**OPTION #2****/ //scale noise to be between 1 and -1\n yvalues[i] = n*amplitude;\n x+=dx;\n }\n }", "public void makeNoise() {\n System.out.println(this.name + \" the \" + this.toString() + \" wails\");\n }", "public void makeNoise() {\n\t\tSystem.out.println(toString() + \" grunted\");\n\t}", "private ToneDetection() { }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void newSpeechNoise(long ms, int n);", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public int noise(int xin, int yin, int zin);", "double passer();", "public abstract double sample();", "public String noise() {\n return \"not overridden\";\n }", "double sample()\n\t{\n\t\treturn rb.peek();\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Dog goes bark!!! \");\n\n}", "private float noise(Vector2 point) {\n\t\tVector2 bottomLeft = randomGrid[(int) point.x][(int) point.y];\n\t\tVector2 topLeft = randomGrid[(int) point.x][(int) point.y + 1];\n\t\tVector2 bottomRight = randomGrid[(int) point.x + 1][(int) point.y];\n\t\tVector2 topRight = randomGrid[(int) point.x + 1][(int) point.y + 1];\n\n\t\tfloat bottomLeftValue = bottomLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y));\n\t\tfloat topLeftValue = topLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y + 1));\n\t\tfloat bottomRightValue = bottomRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y));\n\t\tfloat topRightValue = topRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y + 1));\n\n\t\tfloat bottomValue = bottomLeftValue * (1 - point.x % 1) + bottomRightValue * (point.x % 1);\n\t\tfloat topValue = topLeftValue * (1 - point.x % 1) + topRightValue * (point.x % 1);\n\t\tfloat value = bottomValue * (1 - point.y % 1) + topValue * (point.y % 1);\n\n\t\treturn value;\n\t}", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "int sampleOffset();", "Randomizer getRandomizer();", "public static int offset_infos_valid_noise_samples() {\n return (88 / 8);\n }", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "@Override\r\n\tpublic float getSample(long us) {\n\t\treturn 0;\r\n\t}", "Boolean getRandomize();", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "@Override\n public double ringNotes(){\n double ret = 0;\n for (int i = 0; i < pStrings.length; i++){\n for (int a = 0; a < pStrings[i].length; a++){\n pStrings[i][a].tic();\n ret += pStrings[i][a].sample();\n \n }\n }\n return ret;\n }", "private double readPressureSample() {\n return 6 * randomPressureSampleSimulator.nextDouble() * randomPressureSampleSimulator.nextDouble();\n }", "public void makeNoise() {\n\t\tfor (Animal a : animals) {\n\t\t\ta.makeNoise();\n\t\t}\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public final double getEstimatedNoise() {\r\n return noise;\r\n }", "float genChance();", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "@Override\n public double tuition(){\n return 2500;\n }", "BlueSphere() {\n Random random = new Random();\n value[0] = random.nextInt(16) + 1;\n }", "private static void runNoise() throws GameActionException {\n\t\t\n\t}", "public double getYNoise(double x, double z)\n {\n double var11 = 0.5D * (square3 - 1.0D);\n double var13 = (x + z) * var11;\n int var15 = fastFloor(x + var13);\n int var16 = fastFloor(z + var13);\n double var17 = (3.0D - square3) / 6.0D;\n double var19 = (double)(var15 + var16) * var17;\n double var21 = (double)var15 - var19;\n double var23 = (double)var16 - var19;\n double var25 = x - var21;\n double var27 = z - var23;\n byte var29;\n byte var30;\n\n if (var25 > var27)\n {\n var29 = 1;\n var30 = 0;\n }\n else\n {\n var29 = 0;\n var30 = 1;\n }\n\n double var31 = var25 - (double)var29 + var17;\n double var33 = var27 - (double)var30 + var17;\n double var35 = var25 - 1.0D + 2.0D * var17;\n double var37 = var27 - 1.0D + 2.0D * var17;\n int var39 = var15 & 255;\n int var40 = var16 & 255;\n int var41 = this.permutationTable[var39 + this.permutationTable[var40]] % 12;\n int var42 = this.permutationTable[var39 + var29 + this.permutationTable[var40 + var30]] % 12;\n int var43 = this.permutationTable[var39 + 1 + this.permutationTable[var40 + 1]] % 12;\n double var44 = 0.5D - var25 * var25 - var27 * var27;\n double var5;\n\n if (var44 < 0.0D)\n {\n var5 = 0.0D;\n }\n else\n {\n var44 *= var44;\n var5 = var44 * var44 * dot(grad3[var41], var25, var27);\n }\n\n double var46 = 0.5D - var31 * var31 - var33 * var33;\n double var7;\n\n if (var46 < 0.0D)\n {\n var7 = 0.0D;\n }\n else\n {\n var46 *= var46;\n var7 = var46 * var46 * dot(grad3[var42], var31, var33);\n }\n\n double var48 = 0.5D - var35 * var35 - var37 * var37;\n double var9;\n\n if (var48 < 0.0D)\n {\n var9 = 0.0D;\n }\n else\n {\n var48 *= var48;\n var9 = var48 * var48 * dot(grad3[var43], var35, var37);\n }\n\n return 70.0D * (var5 + var7 + var9);\n }", "public int storrelse();", "private int genRandomWaveNum(int waveNum){\n return genRandomWaveNum(1, waveNum);\n }", "private double noisyRt(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getRtStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "int pauseSample() {\n return 0;\n }", "public static int offsetBits_infos_valid_noise_samples() {\n return 88;\n }", "public void jitter() {\n // jitter +- 20% of the value\n double amount = 0.20;\n double change = 1.0 - amount + (Evolve.getRandomNumber() * amount * 2); \n value *= change;\n }", "private static void test3() {\n for (int noteNumber = 0; noteNumber < 128; noteNumber++) {\n double frequency = 440 * Math.pow(2, (noteNumber - 69) / 12.0);\n \n boolean clipMax = false;\n int block = 0;\n \n if (frequency <= 48.503) {\n block = 0;\n }\n else if (frequency <= 97.006) {\n block = 1;\n }\n else if (frequency <= 194.013) {\n block = 2;\n }\n else if (frequency <= 388.026) {\n block = 3;\n }\n else if (frequency <= 776.053) {\n block = 4;\n }\n else if (frequency <= 1552.107) {\n block = 5;\n }\n else if (frequency <= 3104.215) {\n block = 6;\n }\n else if (frequency <= 6208.431) {\n block = 7;\n \n }\n else {\n //throw new RuntimeException(\"invalid frequency !\");\n //System.out.println(\"unsupported frequency \" + frequency + \" !\");\n //System.exit(-1);\n block = 7;\n clipMax = true;\n }\n \n double f_num = frequency * Math.pow(2, (20 - block)) / 49716;\n if (clipMax) {\n f_num = 1023;\n }\n String f_num_hex = \"0000\" + Integer.toHexString((int) f_num);\n f_num_hex = f_num_hex.substring(f_num_hex.length() - 4, f_num_hex.length());\n //System.out.println(noteNumber + \" = \" + frequency + \" ---> block: \" + block + \" f_num_hex = \" + f_num_hex);\n //System.out.println(noteNumber + \" = \" + frequency);\n \n String block_hex = \"000\" + Integer.toHexString(block);\n block_hex = block_hex.substring(block_hex.length() - 3, block_hex.length());\n\n if (noteNumber % 4 == 0) {\n System.out.print(\"\\r\\n\\t\\t\\tdb \");\n }\n System.out.print(block_hex + \"h, 000h, 0\" + f_num_hex.subSequence(2, 4) + \"h, 0\" + f_num_hex.substring(0, 2) + \"h\" + ((noteNumber % 4 != 3) ? \", \" : \"\"));\n \n }\n System.out.println(\"\");\n }", "public abstract void randomize();", "private double noisyMass(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getMassStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private long getSampleTime() {\n return System.currentTimeMillis();\n\n }", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "float getFixedHotwordGain();", "int pauseSamples() {\n return 0;\n }", "public void spin () {\n //Decide outcome.\n Random rand=new Random();\n result=rand.nextInt(100)+1+prevSpin;\n\n /**\n * Set the images\n * Image 1-11 are pictures listed bellow. 12 is wild.\n */\n //Loss\n if (result<=10) {\n //Prevention of loss streak\n prevSpin+=1;\n spinsLeft-=1;\n\n img1=rand.nextInt(12)+1;\n if (img1==12) {\n img2=rand.nextInt(11)+1;\n }\n else {\n img2=rand.nextInt(12)+1;\n }\n\n if (img1==img2) {\n img3=rand.nextInt(11)+1;\n while (img1==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else if (img1==12 || img2==12) {\n img3=rand.nextInt(11)+1;\n while (img1==img3 || img2==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else {\n img3=rand.nextInt(12)+1;\n }\n }\n\n //Cherry (1)\n else if (11<=result && result<=27) {\n prevSpin=0;\n spinsLeft-=1;\n score+=10;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=1;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=1;\n if (rand.nextInt(wildChance)+1==1 && (img1==1 || img2==1))\n img3=12;\n else\n img3=1;\n }\n\n //Pine tree (2)\n else if (28<=result && result<=38) {\n prevSpin=0;\n spinsLeft-=1;\n score+=20;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=2;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=2;\n if (rand.nextInt(wildChance)+1==1 && (img1==2 || img2==2))\n img3=12;\n else\n img3=2;\n }\n\n //\"Bar\" (3)\n else if (39<=result && result<=49) {\n prevSpin=0;\n spinsLeft-=1;\n score+=40;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=3;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=3;\n if (rand.nextInt(wildChance)+1==1 && (img1==3 || img2==3))\n img3=12;\n else\n img3=3;\n }\n\n //Bell (4)\n else if (50<=result && result<=58) {\n prevSpin=0;\n spinsLeft-=1;\n score+=60;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=4;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=4;\n if (rand.nextInt(wildChance)+1==1 && (img1==4 || img2==4))\n img3=12;\n else\n img3=4;\n }\n\n //Snowflake (5)\n else if (59<=result && result<=67) {\n prevSpin=0;\n spinsLeft-=1;\n score+=100;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=5;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=5;\n if (rand.nextInt(wildChance)+1==1 && (img1==5 || img2==5))\n img3=12;\n else\n img3=5;\n }\n\n //Mead tankard (6)\n else if (68<=result && result<=75) {\n prevSpin=0;\n spinsLeft-=1;\n score+=150;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=6;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=6;\n if (rand.nextInt(wildChance)+1==1 && (img1==6 || img2==6))\n img3=12;\n else\n img3=6;\n }\n\n //Snowball (7)\n else if (76<=result && result<=82) {\n prevSpin=0;\n spinsLeft-=1;\n score+=250;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=7;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=7;\n if (rand.nextInt(wildChance)+1==1 && (img1==7 || img2==7))\n img3=12;\n else\n img3=7;\n }\n\n //Moose (8)\n else if (83<=result && result<=88) {\n prevSpin=0;\n spinsLeft-=1;\n score+=350;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=8;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=8;\n if (rand.nextInt(wildChance)+1==1 && (img1==8 || img2==8))\n img3=12;\n else\n img3=8;\n }\n\n //Coin (9)\n else if (89<=result && result<=93) {\n prevSpin=0;\n score+=500;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=9;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=9;\n if (rand.nextInt(wildChance)+1==1 && (img1==9 || img2==9))\n img3=12;\n else\n img3=9;\n }\n\n //\"7\" (10)\n else if (94<=result && result<=98) {\n prevSpin=0;\n spinsLeft+=2;\n score+=777;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=10;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=10;\n if (rand.nextInt(wildChance)+1==1 && (img1==10 || img2==10))\n img3=12;\n else\n img3=10;\n }\n\n //Barbarian \"Bar\" (11)\n else if (99<=result) {\n //Prevention of \"high win\" streak\n prevSpin-=1;\n spinsLeft+=9;\n score+=1000;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=11;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=11;\n if (rand.nextInt(wildChance)+1==1)\n img3=12;\n else\n img3=11;\n }\n\n else {\n System.out.println(\"Result Error.\");\n }\n }", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "static final int fast_rand()\n\t{\n\t\tRz = 36969 * (Rz & 65535) + (Rz >>> 16);// ((Rz >>> 16) & 65535);\n\t\tRw = 18000 * (Rw & 65535) + (Rw >>> 16);// ((Rw >>> 16) & 65535);\n\t\treturn (Rz << 16) + Rw;\n\t}", "private boolean needXray() {\n\t\treturn Math.random() < XRAY_PROBABILITY;\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static void main(String[] args) {\n\n // Declaracao da variaveis;\n float media;\n int soma;\n\n // Declaracao das variveis que recebem os numeros aleatorios;\n double alea1 = Math.random();\n byte n1 = (byte)(0 + alea1 * (29-0));\n double alea2 = Math.random();\n byte n2 = (byte)(0 + alea2 * (29-0));\n double alea3 = Math.random();\n byte n3 = (byte)(0 + alea3 * (29-0));\n\n // Operacoes matematicas para calculo da media e soma;\n media = (n1 + n2 + n3)/3;\n soma = (n1 + n2 + n3);\n\n // Impressao dos resultdos\n System.out.println(\"Os tres numeros aleatorios escolhidos sao: \"+n1+\", \"+n2+\" e \"+n3);\n System.out.println(\"A media dos tres numeros e igual a: \"+media+\"\\nO somatorio dos tres numeros e igual a: \"+soma);\n }", "public static ArrayList<Double> generate(int n1, int n2, int ton, int phrase) throws MidiUnavailableException, InterruptedException, InvalidMidiDataException, IOException {\n Synthesizer synth = MidiSystem.getSynthesizer();\n synth.open();\n final MidiChannel[] channels = synth.getChannels();\n ArrayList<Double> normalizedResult=new ArrayList<>();\n\n int fn=n1,sn=n2,nn,tr;\n Sequence seq= new Sequence(Sequence.PPQ,10,2);\n Track track=seq.getTracks()[0];\n Track track2=seq.getTracks()[1];\n\n for(int i=0;i<phrase;i++)\n {\n nn=Weights.nextNote(fn,sn);\n\n channels[0].noteOn(nn+ton,127);\n //tr=nn+4;\n //if(Math.random()<0.5) channels[0].noteOn(tr+ton,127);\n //channels[0].noteOn(tr+3+ton,127);\n //if(Math.random()<0.2) channels[0].noteOn(tr+8+ton,127);\n\n ShortMessage sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn,100);\n track.add(new MidiEvent(sm,i*4));sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn+3,90);\n track.add(new MidiEvent(sm,i*4));\n\n\n\n if(i%2==0) {\n Thread.sleep(350);\n }\n else {\n Thread.sleep(150);\n }\n\n normalizedResult.add(1./nn);\n\n\n channels[0].noteOff(nn+ton);\n //channels[0].noteOff(tr+ton);\n //channels[0].noteOff(tr+3+ton);\n //channels[0].noteOff(tr+8+ton);\n fn=sn;\n sn=nn;\n }\n\n MidiSystem.write(seq, 1,new File(\"src/sample/result.mid\"));\n System.out.println(\"GG end\");\n return normalizedResult;\n }", "private double noise(final double xin, final double yin, final double zin) {\n double n0, n1, n2, n3;\n double s = (xin + yin + zin) * F3;\n int i = fastfloor(xin + s);\n int j = fastfloor(yin + s);\n int k = fastfloor(zin + s);\n double t = (i + j + k) * G3;\n double x0 = xin - (i - t);\n double y0 = yin - (j - t);\n double z0 = zin - (k - t);\n int i1, j1, k1;\n int i2, j2, k2;\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n }\n } else {\n if (y0 < z0) {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else if (x0 < z0) {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n }\n }\n double x1 = x0 - i1 + G3;\n double y1 = y0 - j1 + G3;\n double z1 = z0 - k1 + G3;\n double x2 = x0 - i2 + 2.0 * G3;\n double y2 = y0 - j2 + 2.0 * G3;\n double z2 = z0 - k2 + 2.0 * G3;\n double x3 = x0 - 1.0 + 3.0 * G3;\n double y3 = y0 - 1.0 + 3.0 * G3;\n double z3 = z0 - 1.0 + 3.0 * G3;\n int ii = i & (SUPPLY_LENGTH - 1);\n int jj = j & (SUPPLY_LENGTH - 1);\n int kk = k & (SUPPLY_LENGTH - 1);\n int gi0 = permMod12[ii + perm[jj + perm[kk]]];\n int gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]];\n int gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]];\n int gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]];\n double t0 = CONTRIBUTION_FACTOR - x0 * x0 - y0 * y0 - z0 * z0;\n if (t0 < 0) {\n n0 = 0.0;\n } else {\n t0 *= t0;\n n0 = t0 * t0 * dot(GTAB[gi0], x0, y0, z0);\n }\n double t1 = CONTRIBUTION_FACTOR - x1 * x1 - y1 * y1 - z1 * z1;\n if (t1 < 0) {\n n1 = 0.0;\n } else {\n t1 *= t1;\n n1 = t1 * t1 * dot(GTAB[gi1], x1, y1, z1);\n }\n double t2 = CONTRIBUTION_FACTOR - x2 * x2 - y2 * y2 - z2 * z2;\n if (t2 < 0) {\n n2 = 0.0;\n } else {\n t2 *= t2;\n n2 = t2 * t2 * dot(GTAB[gi2], x2, y2, z2);\n }\n double t3 = CONTRIBUTION_FACTOR - x3 * x3 - y3 * y3 - z3 * z3;\n if (t3 < 0) {\n n3 = 0.0;\n } else {\n t3 *= t3;\n n3 = t3 * t3 * dot(GTAB[gi3], x3, y3, z3);\n }\n return NORMALIZE_FACTOR * (n0 + n1 + n2 + n3);\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "void mosaic(int seed);", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}", "public void driver() {\r\n \t// At the last time point assume exponentials are largely decayed and most of what is\r\n \t// left is the constant a[0] term.\r\n gues[0] = ySeries[ySeries.length-1];\r\n for (int i = 0; i < (a.length-1)/2; i++) {\r\n \tgues[2*i+1] = 1.0;\r\n \tgues[2*i+2] = -1.0;\r\n }\r\n super.driver();\r\n }", "void dither();", "void dither();", "private void initialiseWeights() {\n\n threshold = -1+2*Math.random();\n thresholdDiff = 0;\n\n for(int i = 0; i < weight.length; i++) {\n weight[i]= -1+2*Math.random();\n weightDiff[i] = 0;\n }\n\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "long random(long ws) {\r\n\t\treturn (System.currentTimeMillis() % ws);\r\n\t}", "public void step() {\n // method 1 of Temperature randomness\n enPrice = 1.1 * enPrice;\n\n TempChange = Temperature * (0.1 * (1 - 2 * r.nextDouble()));\n // method 2 of Temperature\n// TempChange = temperature_list.get(count);\n// count+=1;\n\n Temperature += TempChange;\n year_num+=1;\n }", "double seBlesser();", "protected abstract void nextWave();", "public static int numElements_infos_noise() {\n return 3;\n }", "public abstract void newGuiNoise(long ms, int n);", "public void makeSomeNoise(IntegerMath math) {\n\n }", "public void mo4359a() {\n }", "public static int nextNote(int n1,int n2) {\n double rnd,sum=0;\n rnd=Math.random();\n for(int i=0;i<12;i++)\n {\n sum+=weights[n1-60][n2-60][i];\n\n if(rnd<=sum)\n return i+60;\n }\n return 62;\n }", "public void snare();", "protected double samplesOnePixelF() {\r\n\t\tif (getGraphWidth() > 1) {\r\n\t\t\t// avoid division by zero\r\n\t\t\treturn ((double) section.getLength()) / getGraphWidth();\r\n\t\t}\r\n\t\treturn 1.0;\r\n\t}", "public static int size_infos_valid_noise_samples() {\n return (8 / 8);\n }" ]
[ "0.6488574", "0.6425282", "0.63332796", "0.6199816", "0.6183697", "0.6152466", "0.6124789", "0.6081928", "0.59939843", "0.59937423", "0.59171516", "0.588145", "0.58596987", "0.58524966", "0.58491826", "0.58364564", "0.5835778", "0.5808904", "0.57405454", "0.57383394", "0.573021", "0.57246983", "0.57161987", "0.5707901", "0.56456727", "0.5603162", "0.5592959", "0.557009", "0.5550669", "0.55191255", "0.55138093", "0.55075306", "0.5491038", "0.54792976", "0.54768807", "0.5467531", "0.54508215", "0.54472834", "0.54336137", "0.5426434", "0.54101515", "0.54052603", "0.5351587", "0.53425956", "0.5334999", "0.5323061", "0.53130025", "0.53013456", "0.52882284", "0.52771264", "0.52688736", "0.5268833", "0.5268355", "0.52648914", "0.5254441", "0.525193", "0.52423215", "0.5240327", "0.5231121", "0.5230201", "0.52240175", "0.5215505", "0.5198452", "0.51979405", "0.5197641", "0.51957536", "0.5185176", "0.5178896", "0.5178343", "0.5177648", "0.51722276", "0.51631314", "0.5162761", "0.5162457", "0.5161157", "0.5160777", "0.5149608", "0.5144487", "0.5144487", "0.5143914", "0.5143785", "0.5138316", "0.51334345", "0.5132292", "0.5132292", "0.5131394", "0.51259625", "0.5125058", "0.51237774", "0.5123054", "0.51193553", "0.51186204", "0.51150805", "0.5114498", "0.5103284", "0.5102054", "0.5100344", "0.51001906", "0.50999874", "0.5093597", "0.509098" ]
0.0
-1
TODO Use my noise
public static @NotNull Image genNoiseCellular(int width, int height, int tileSize) { Color.Buffer pixels = Color.malloc(ColorFormat.RGBA, width * height); Random random = new Random(); int seedsPerRow = width / tileSize; int seedsPerCol = height / tileSize; int seedsCount = seedsPerRow * seedsPerCol; int[] seeds = new int[seedsCount << 1]; for (int i = 0; i < seedsCount; i++) { seeds[2 * i] = i % seedsPerRow * tileSize + random.nextInt(tileSize); seeds[2 * i + 1] = i / seedsPerRow * tileSize + random.nextInt(tileSize); } for (int j = 0; j < height; j++) { int tileY = j / tileSize; for (int i = 0; i < width; i++) { int tileX = i / tileSize; double minDistance = Double.MAX_VALUE; // Check all adjacent tiles for (int x = -1; x < 2; x++) { if (tileX + x < 0 || tileX + x >= seedsPerRow) continue; for (int y = -1; y < 2; y++) { if (tileY + y < 0 || tileY + y >= seedsPerCol) continue; int index = (tileY + y) * seedsPerRow + tileX + x; int seedX = seeds[2 * index]; int seedY = seeds[2 * index + 1]; double dist = Math.hypot(i - seedX, j - seedY); minDistance = Math.min(minDistance, dist); } } // I made this up but it seems to give good results at all tile sizes int intensity = (int) Math.round(minDistance * 256 / tileSize); pixels.put(j * width + i, Math.min(intensity, 255), 255); } } return new Image(pixels, width, height, 1, ColorFormat.RGBA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink Oink oink \");\n\t}", "private double noise(SpIterNoiseObs noise) {\n return 3.0 * 60.0;\n }", "M generateNoise();", "java.lang.String getNoise();", "@Override\r\n\tpublic String makeANoise() {\n\t\treturn \"deer noise\";\r\n\t}", "public abstract void makeNoise();", "@Override\n\tpublic String makeNoise() {\n\t\treturn \"Meoooooow\";\n\t\t\n\t\n\n}", "private void random() {\n\n\t}", "public void highscorenoise()\n {\n if(!mute)\n {\n try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Darkmoon Caverns.wav\");\n double c = Math.random();\n if(c<=.25)\n url = this.getClass().getClassLoader().getResource(\"Mario Kart Win.wav\");\n else if(c<=.50)\n url = this.getClass().getClassLoader().getResource(\"Pirate Lagoon.wav\");\n else if(c<=.75)\n url = this.getClass().getClassLoader().getResource(\"Crescent Island.wav\"); \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n hclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n hclip.open(audioIn); \n \n hclip.start();\n hclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n }\n }", "boolean hasNoise();", "@Override\n\tString makeNoise() {\n\t\treturn \"moooooo\";\n\t}", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"mammals are making noise\");\n\t}", "@Override\n public void makeNoise() {\n System.out.println(getName()+ \" Oink Oink\");\n }", "public String makeNoise(){\n return \"Feline: make noise. \";\n }", "double sample();", "public void setup()\n{\n noiseDetail(6);\n noiseScale = 0.01f;\n c1 = new Car(250, 250);\n}", "@Override\r\n\tvoid makeNoise() {\n\t\tSystem.out.println(\"Moo\");\r\n\t}", "public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}", "void calcWave() {\n yoff += 0.01f;\n \n //For every x value, calculate a y value based on sine or cosine\n float x = yoff; //**OPTION #1****/\n //float x = 0.0f; //**OPTION #2****/\n for (int i = 0; i < yvalues.length; i++) {\n float n = 2*noise(x)-1.0f; //**OPTION #1****/ //scale noise to be between 1 and -1\n //float n = 2*noise(x,yoff)-1.0f; //**OPTION #2****/ //scale noise to be between 1 and -1\n yvalues[i] = n*amplitude;\n x+=dx;\n }\n }", "public void makeNoise() {\n System.out.println(this.name + \" the \" + this.toString() + \" wails\");\n }", "public void makeNoise() {\n\t\tSystem.out.println(toString() + \" grunted\");\n\t}", "private ToneDetection() { }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public abstract void newSpeechNoise(long ms, int n);", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public int noise(int xin, int yin, int zin);", "double passer();", "public abstract double sample();", "public String noise() {\n return \"not overridden\";\n }", "double sample()\n\t{\n\t\treturn rb.peek();\n\t}", "int randomPoint() { return 1 + (int)Math.round((Math.random()*20) % (size - 2)); }", "@Override\n\tpublic void makeNoise() {\n\t\tSystem.out.println(\"Dog goes bark!!! \");\n\n}", "private float noise(Vector2 point) {\n\t\tVector2 bottomLeft = randomGrid[(int) point.x][(int) point.y];\n\t\tVector2 topLeft = randomGrid[(int) point.x][(int) point.y + 1];\n\t\tVector2 bottomRight = randomGrid[(int) point.x + 1][(int) point.y];\n\t\tVector2 topRight = randomGrid[(int) point.x + 1][(int) point.y + 1];\n\n\t\tfloat bottomLeftValue = bottomLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y));\n\t\tfloat topLeftValue = topLeft.dot(point.cpy().scl(-1).add((int) point.x, (int) point.y + 1));\n\t\tfloat bottomRightValue = bottomRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y));\n\t\tfloat topRightValue = topRight.dot(point.cpy().scl(-1).add((int) point.x + 1, (int) point.y + 1));\n\n\t\tfloat bottomValue = bottomLeftValue * (1 - point.x % 1) + bottomRightValue * (point.x % 1);\n\t\tfloat topValue = topLeftValue * (1 - point.x % 1) + topRightValue * (point.x % 1);\n\t\tfloat value = bottomValue * (1 - point.y % 1) + topValue * (point.y % 1);\n\n\t\treturn value;\n\t}", "private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}", "private double getRandom() {\n return 2*Math.random() - 1;\n }", "int sampleOffset();", "Randomizer getRandomizer();", "public static int offset_infos_valid_noise_samples() {\n return (88 / 8);\n }", "public void kast() {\n\t\t// vaelg en tilfaeldig side\n\t\tdouble tilfaeldigtTal = Math.random();\n\t\tvaerdi = (int) (tilfaeldigtTal * 6 + 1);\n\t}", "@Override\r\n\tpublic float getSample(long us) {\n\t\treturn 0;\r\n\t}", "Boolean getRandomize();", "private double randn(){\r\n\t\t//* http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html\r\n\t\t//RandomNumber rnd = new RandomNumber(System.currentTimeMillis());\r\n\t\t//return rnd.normal();\r\n\t\treturn rnd.nextGaussian();\r\n\t\t//return 0;\r\n\t}", "@Override\n public double ringNotes(){\n double ret = 0;\n for (int i = 0; i < pStrings.length; i++){\n for (int a = 0; a < pStrings[i].length; a++){\n pStrings[i][a].tic();\n ret += pStrings[i][a].sample();\n \n }\n }\n return ret;\n }", "private double readPressureSample() {\n return 6 * randomPressureSampleSimulator.nextDouble() * randomPressureSampleSimulator.nextDouble();\n }", "public void makeNoise() {\n\t\tfor (Animal a : animals) {\n\t\t\ta.makeNoise();\n\t\t}\n\t}", "public int generateRoshambo(){\n ;]\n\n }", "SimulatedAnnealing() {\n generator = new Random(System.currentTimeMillis());\n }", "RedSphere() {\n Random random = new Random();\n for (int i = 0; i < 6; i++) {\n value[i] = random.nextInt(33) + 1;\n }\n }", "public final double getEstimatedNoise() {\r\n return noise;\r\n }", "float genChance();", "@Override\n public double tuition(){\n return 2500;\n }", "BlueSphere() {\n Random random = new Random();\n value[0] = random.nextInt(16) + 1;\n }", "@Override\n public int orinar() {\n\n return (int) (Math.random() * 400) + 400;\n }", "private static void runNoise() throws GameActionException {\n\t\t\n\t}", "public double getYNoise(double x, double z)\n {\n double var11 = 0.5D * (square3 - 1.0D);\n double var13 = (x + z) * var11;\n int var15 = fastFloor(x + var13);\n int var16 = fastFloor(z + var13);\n double var17 = (3.0D - square3) / 6.0D;\n double var19 = (double)(var15 + var16) * var17;\n double var21 = (double)var15 - var19;\n double var23 = (double)var16 - var19;\n double var25 = x - var21;\n double var27 = z - var23;\n byte var29;\n byte var30;\n\n if (var25 > var27)\n {\n var29 = 1;\n var30 = 0;\n }\n else\n {\n var29 = 0;\n var30 = 1;\n }\n\n double var31 = var25 - (double)var29 + var17;\n double var33 = var27 - (double)var30 + var17;\n double var35 = var25 - 1.0D + 2.0D * var17;\n double var37 = var27 - 1.0D + 2.0D * var17;\n int var39 = var15 & 255;\n int var40 = var16 & 255;\n int var41 = this.permutationTable[var39 + this.permutationTable[var40]] % 12;\n int var42 = this.permutationTable[var39 + var29 + this.permutationTable[var40 + var30]] % 12;\n int var43 = this.permutationTable[var39 + 1 + this.permutationTable[var40 + 1]] % 12;\n double var44 = 0.5D - var25 * var25 - var27 * var27;\n double var5;\n\n if (var44 < 0.0D)\n {\n var5 = 0.0D;\n }\n else\n {\n var44 *= var44;\n var5 = var44 * var44 * dot(grad3[var41], var25, var27);\n }\n\n double var46 = 0.5D - var31 * var31 - var33 * var33;\n double var7;\n\n if (var46 < 0.0D)\n {\n var7 = 0.0D;\n }\n else\n {\n var46 *= var46;\n var7 = var46 * var46 * dot(grad3[var42], var31, var33);\n }\n\n double var48 = 0.5D - var35 * var35 - var37 * var37;\n double var9;\n\n if (var48 < 0.0D)\n {\n var9 = 0.0D;\n }\n else\n {\n var48 *= var48;\n var9 = var48 * var48 * dot(grad3[var43], var35, var37);\n }\n\n return 70.0D * (var5 + var7 + var9);\n }", "public int storrelse();", "private int genRandomWaveNum(int waveNum){\n return genRandomWaveNum(1, waveNum);\n }", "private double noisyRt(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getRtStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "int pauseSample() {\n return 0;\n }", "public static int offsetBits_infos_valid_noise_samples() {\n return 88;\n }", "public void jitter() {\n // jitter +- 20% of the value\n double amount = 0.20;\n double change = 1.0 - amount + (Evolve.getRandomNumber() * amount * 2); \n value *= change;\n }", "private static void test3() {\n for (int noteNumber = 0; noteNumber < 128; noteNumber++) {\n double frequency = 440 * Math.pow(2, (noteNumber - 69) / 12.0);\n \n boolean clipMax = false;\n int block = 0;\n \n if (frequency <= 48.503) {\n block = 0;\n }\n else if (frequency <= 97.006) {\n block = 1;\n }\n else if (frequency <= 194.013) {\n block = 2;\n }\n else if (frequency <= 388.026) {\n block = 3;\n }\n else if (frequency <= 776.053) {\n block = 4;\n }\n else if (frequency <= 1552.107) {\n block = 5;\n }\n else if (frequency <= 3104.215) {\n block = 6;\n }\n else if (frequency <= 6208.431) {\n block = 7;\n \n }\n else {\n //throw new RuntimeException(\"invalid frequency !\");\n //System.out.println(\"unsupported frequency \" + frequency + \" !\");\n //System.exit(-1);\n block = 7;\n clipMax = true;\n }\n \n double f_num = frequency * Math.pow(2, (20 - block)) / 49716;\n if (clipMax) {\n f_num = 1023;\n }\n String f_num_hex = \"0000\" + Integer.toHexString((int) f_num);\n f_num_hex = f_num_hex.substring(f_num_hex.length() - 4, f_num_hex.length());\n //System.out.println(noteNumber + \" = \" + frequency + \" ---> block: \" + block + \" f_num_hex = \" + f_num_hex);\n //System.out.println(noteNumber + \" = \" + frequency);\n \n String block_hex = \"000\" + Integer.toHexString(block);\n block_hex = block_hex.substring(block_hex.length() - 3, block_hex.length());\n\n if (noteNumber % 4 == 0) {\n System.out.print(\"\\r\\n\\t\\t\\tdb \");\n }\n System.out.print(block_hex + \"h, 000h, 0\" + f_num_hex.subSequence(2, 4) + \"h, 0\" + f_num_hex.substring(0, 2) + \"h\" + ((noteNumber % 4 != 3) ? \", \" : \"\"));\n \n }\n System.out.println(\"\");\n }", "public abstract void randomize();", "private double noisyMass(double value) {\n\n\t\t// then add additive noise as well\n\t\tdouble additiveNoise = randomData.nextGaussian(noiseLevel.getNoiseMean(), \n\t\t\t\tnoiseLevel.getMassStdev());\n\t\tvalue += additiveNoise;\n\t\t\n\t\t// value must always be >= 0\n\t\tif (value < 0) {\n\t\t\tvalue = 0;\n\t\t}\n\t\treturn value;\n\n\t}", "private Random rand()\n\t{\n\t\treturn new Random();\n\t}", "private long getSampleTime() {\n return System.currentTimeMillis();\n\n }", "private void init() {\r\n\t\tx = (float) (Math.random() * 2 - 1);\r\n\t\ty = (float) (Math.random() * 2 - 1);\r\n\t\tz[0] = (float) (Math.random() * 3f);\r\n\t\tz[1] = z[0];\r\n\t}", "int pauseSamples() {\n return 0;\n }", "public void spin () {\n //Decide outcome.\n Random rand=new Random();\n result=rand.nextInt(100)+1+prevSpin;\n\n /**\n * Set the images\n * Image 1-11 are pictures listed bellow. 12 is wild.\n */\n //Loss\n if (result<=10) {\n //Prevention of loss streak\n prevSpin+=1;\n spinsLeft-=1;\n\n img1=rand.nextInt(12)+1;\n if (img1==12) {\n img2=rand.nextInt(11)+1;\n }\n else {\n img2=rand.nextInt(12)+1;\n }\n\n if (img1==img2) {\n img3=rand.nextInt(11)+1;\n while (img1==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else if (img1==12 || img2==12) {\n img3=rand.nextInt(11)+1;\n while (img1==img3 || img2==img3) {\n img3=rand.nextInt(11)+1;\n }\n }\n else {\n img3=rand.nextInt(12)+1;\n }\n }\n\n //Cherry (1)\n else if (11<=result && result<=27) {\n prevSpin=0;\n spinsLeft-=1;\n score+=10;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=1;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=1;\n if (rand.nextInt(wildChance)+1==1 && (img1==1 || img2==1))\n img3=12;\n else\n img3=1;\n }\n\n //Pine tree (2)\n else if (28<=result && result<=38) {\n prevSpin=0;\n spinsLeft-=1;\n score+=20;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=2;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=2;\n if (rand.nextInt(wildChance)+1==1 && (img1==2 || img2==2))\n img3=12;\n else\n img3=2;\n }\n\n //\"Bar\" (3)\n else if (39<=result && result<=49) {\n prevSpin=0;\n spinsLeft-=1;\n score+=40;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=3;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=3;\n if (rand.nextInt(wildChance)+1==1 && (img1==3 || img2==3))\n img3=12;\n else\n img3=3;\n }\n\n //Bell (4)\n else if (50<=result && result<=58) {\n prevSpin=0;\n spinsLeft-=1;\n score+=60;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=4;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=4;\n if (rand.nextInt(wildChance)+1==1 && (img1==4 || img2==4))\n img3=12;\n else\n img3=4;\n }\n\n //Snowflake (5)\n else if (59<=result && result<=67) {\n prevSpin=0;\n spinsLeft-=1;\n score+=100;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=5;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=5;\n if (rand.nextInt(wildChance)+1==1 && (img1==5 || img2==5))\n img3=12;\n else\n img3=5;\n }\n\n //Mead tankard (6)\n else if (68<=result && result<=75) {\n prevSpin=0;\n spinsLeft-=1;\n score+=150;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=6;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=6;\n if (rand.nextInt(wildChance)+1==1 && (img1==6 || img2==6))\n img3=12;\n else\n img3=6;\n }\n\n //Snowball (7)\n else if (76<=result && result<=82) {\n prevSpin=0;\n spinsLeft-=1;\n score+=250;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=7;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=7;\n if (rand.nextInt(wildChance)+1==1 && (img1==7 || img2==7))\n img3=12;\n else\n img3=7;\n }\n\n //Moose (8)\n else if (83<=result && result<=88) {\n prevSpin=0;\n spinsLeft-=1;\n score+=350;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=8;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=8;\n if (rand.nextInt(wildChance)+1==1 && (img1==8 || img2==8))\n img3=12;\n else\n img3=8;\n }\n\n //Coin (9)\n else if (89<=result && result<=93) {\n prevSpin=0;\n score+=500;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=9;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=9;\n if (rand.nextInt(wildChance)+1==1 && (img1==9 || img2==9))\n img3=12;\n else\n img3=9;\n }\n\n //\"7\" (10)\n else if (94<=result && result<=98) {\n prevSpin=0;\n spinsLeft+=2;\n score+=777;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=10;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=10;\n if (rand.nextInt(wildChance)+1==1 && (img1==10 || img2==10))\n img3=12;\n else\n img3=10;\n }\n\n //Barbarian \"Bar\" (11)\n else if (99<=result) {\n //Prevention of \"high win\" streak\n prevSpin-=1;\n spinsLeft+=9;\n score+=1000;\n if (rand.nextInt(wildChance)+1==1)\n img1=12;\n else\n img1=11;\n if (rand.nextInt(wildChance)+1==1)\n img2=12;\n else\n img2=11;\n if (rand.nextInt(wildChance)+1==1)\n img3=12;\n else\n img3=11;\n }\n\n else {\n System.out.println(\"Result Error.\");\n }\n }", "float getFixedHotwordGain();", "@Override\n public void init()\n {\n out = mul(num(100.0/Math.log10(length)), log10(div(sum(truerange(), length), diff(highest(length), lowest(length)))));\n }", "static final int fast_rand()\n\t{\n\t\tRz = 36969 * (Rz & 65535) + (Rz >>> 16);// ((Rz >>> 16) & 65535);\n\t\tRw = 18000 * (Rw & 65535) + (Rw >>> 16);// ((Rw >>> 16) & 65535);\n\t\treturn (Rz << 16) + Rw;\n\t}", "private boolean needXray() {\n\t\treturn Math.random() < XRAY_PROBABILITY;\n\t}", "private int randomWeight()\n {\n return dice.nextInt(1000000);\n }", "public static void main(String[] args) {\n\n // Declaracao da variaveis;\n float media;\n int soma;\n\n // Declaracao das variveis que recebem os numeros aleatorios;\n double alea1 = Math.random();\n byte n1 = (byte)(0 + alea1 * (29-0));\n double alea2 = Math.random();\n byte n2 = (byte)(0 + alea2 * (29-0));\n double alea3 = Math.random();\n byte n3 = (byte)(0 + alea3 * (29-0));\n\n // Operacoes matematicas para calculo da media e soma;\n media = (n1 + n2 + n3)/3;\n soma = (n1 + n2 + n3);\n\n // Impressao dos resultdos\n System.out.println(\"Os tres numeros aleatorios escolhidos sao: \"+n1+\", \"+n2+\" e \"+n3);\n System.out.println(\"A media dos tres numeros e igual a: \"+media+\"\\nO somatorio dos tres numeros e igual a: \"+soma);\n }", "public static ArrayList<Double> generate(int n1, int n2, int ton, int phrase) throws MidiUnavailableException, InterruptedException, InvalidMidiDataException, IOException {\n Synthesizer synth = MidiSystem.getSynthesizer();\n synth.open();\n final MidiChannel[] channels = synth.getChannels();\n ArrayList<Double> normalizedResult=new ArrayList<>();\n\n int fn=n1,sn=n2,nn,tr;\n Sequence seq= new Sequence(Sequence.PPQ,10,2);\n Track track=seq.getTracks()[0];\n Track track2=seq.getTracks()[1];\n\n for(int i=0;i<phrase;i++)\n {\n nn=Weights.nextNote(fn,sn);\n\n channels[0].noteOn(nn+ton,127);\n //tr=nn+4;\n //if(Math.random()<0.5) channels[0].noteOn(tr+ton,127);\n //channels[0].noteOn(tr+3+ton,127);\n //if(Math.random()<0.2) channels[0].noteOn(tr+8+ton,127);\n\n ShortMessage sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn,100);\n track.add(new MidiEvent(sm,i*4));sm=new ShortMessage();\n sm.setMessage(ShortMessage.NOTE_ON,nn+3,90);\n track.add(new MidiEvent(sm,i*4));\n\n\n\n if(i%2==0) {\n Thread.sleep(350);\n }\n else {\n Thread.sleep(150);\n }\n\n normalizedResult.add(1./nn);\n\n\n channels[0].noteOff(nn+ton);\n //channels[0].noteOff(tr+ton);\n //channels[0].noteOff(tr+3+ton);\n //channels[0].noteOff(tr+8+ton);\n fn=sn;\n sn=nn;\n }\n\n MidiSystem.write(seq, 1,new File(\"src/sample/result.mid\"));\n System.out.println(\"GG end\");\n return normalizedResult;\n }", "private double noise(final double xin, final double yin, final double zin) {\n double n0, n1, n2, n3;\n double s = (xin + yin + zin) * F3;\n int i = fastfloor(xin + s);\n int j = fastfloor(yin + s);\n int k = fastfloor(zin + s);\n double t = (i + j + k) * G3;\n double x0 = xin - (i - t);\n double y0 = yin - (j - t);\n double z0 = zin - (k - t);\n int i1, j1, k1;\n int i2, j2, k2;\n if (x0 >= y0) {\n if (y0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n } else if (x0 >= z0) {\n i1 = 1;\n j1 = 0;\n k1 = 0;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 1;\n j2 = 0;\n k2 = 1;\n }\n } else {\n if (y0 < z0) {\n i1 = 0;\n j1 = 0;\n k1 = 1;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else if (x0 < z0) {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 0;\n j2 = 1;\n k2 = 1;\n } else {\n i1 = 0;\n j1 = 1;\n k1 = 0;\n i2 = 1;\n j2 = 1;\n k2 = 0;\n }\n }\n double x1 = x0 - i1 + G3;\n double y1 = y0 - j1 + G3;\n double z1 = z0 - k1 + G3;\n double x2 = x0 - i2 + 2.0 * G3;\n double y2 = y0 - j2 + 2.0 * G3;\n double z2 = z0 - k2 + 2.0 * G3;\n double x3 = x0 - 1.0 + 3.0 * G3;\n double y3 = y0 - 1.0 + 3.0 * G3;\n double z3 = z0 - 1.0 + 3.0 * G3;\n int ii = i & (SUPPLY_LENGTH - 1);\n int jj = j & (SUPPLY_LENGTH - 1);\n int kk = k & (SUPPLY_LENGTH - 1);\n int gi0 = permMod12[ii + perm[jj + perm[kk]]];\n int gi1 = permMod12[ii + i1 + perm[jj + j1 + perm[kk + k1]]];\n int gi2 = permMod12[ii + i2 + perm[jj + j2 + perm[kk + k2]]];\n int gi3 = permMod12[ii + 1 + perm[jj + 1 + perm[kk + 1]]];\n double t0 = CONTRIBUTION_FACTOR - x0 * x0 - y0 * y0 - z0 * z0;\n if (t0 < 0) {\n n0 = 0.0;\n } else {\n t0 *= t0;\n n0 = t0 * t0 * dot(GTAB[gi0], x0, y0, z0);\n }\n double t1 = CONTRIBUTION_FACTOR - x1 * x1 - y1 * y1 - z1 * z1;\n if (t1 < 0) {\n n1 = 0.0;\n } else {\n t1 *= t1;\n n1 = t1 * t1 * dot(GTAB[gi1], x1, y1, z1);\n }\n double t2 = CONTRIBUTION_FACTOR - x2 * x2 - y2 * y2 - z2 * z2;\n if (t2 < 0) {\n n2 = 0.0;\n } else {\n t2 *= t2;\n n2 = t2 * t2 * dot(GTAB[gi2], x2, y2, z2);\n }\n double t3 = CONTRIBUTION_FACTOR - x3 * x3 - y3 * y3 - z3 * z3;\n if (t3 < 0) {\n n3 = 0.0;\n } else {\n t3 *= t3;\n n3 = t3 * t3 * dot(GTAB[gi3], x3, y3, z3);\n }\n return NORMALIZE_FACTOR * (n0 + n1 + n2 + n3);\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "void genTone() {\n for (int i = 0; i < numSamples; ++i) {\n sample[i] = Math.sin(2 * Math.PI * i / (sampleRate / freqOfTone));\n }\n\n // convert to 16 bit pcm sound array\n // assumes the sample buffer is normalised.\n int idx = 0;\n for (final double dVal : sample) {\n // scale to maximum amplitude\n final short val = (short) ((dVal * 32767));\n // in 16 bit wav PCM, first byte is the low order byte\n generatedSnd[idx++] = (byte) (val & 0x00ff);\n generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);\n\n }\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\t\t\n\t}", "void mosaic(int seed);", "private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}", "public void driver() {\r\n \t// At the last time point assume exponentials are largely decayed and most of what is\r\n \t// left is the constant a[0] term.\r\n gues[0] = ySeries[ySeries.length-1];\r\n for (int i = 0; i < (a.length-1)/2; i++) {\r\n \tgues[2*i+1] = 1.0;\r\n \tgues[2*i+2] = -1.0;\r\n }\r\n super.driver();\r\n }", "void dither();", "void dither();", "private void initialiseWeights() {\n\n threshold = -1+2*Math.random();\n thresholdDiff = 0;\n\n for(int i = 0; i < weight.length; i++) {\n weight[i]= -1+2*Math.random();\n weightDiff[i] = 0;\n }\n\n }", "private void compose() {\n \tnumSamples = duration * sampleRate;\n \tsample = new double[numSamples];\n \tgeneratedSnd = new byte[2 * numSamples];\n\t}", "@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}", "public static void Random() {\n\t\tRandom ran =new Random();\r\n\t\trandom=ran.nextInt(6)+1;\r\n\t\t//random=1;\r\n\t\twho=A1063307_GUI.who2;\r\n\t\tif((ch[who].status)>0) {\r\n\t\t\tch[who].location=(ch[who].location)+random;\r\n\t\t\tch[who].status=(ch[who].status)-1;\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t\treturn;\r\n\t\t\t}\t\t\r\n\t}", "long random(long ws) {\r\n\t\treturn (System.currentTimeMillis() % ws);\r\n\t}", "public void step() {\n // method 1 of Temperature randomness\n enPrice = 1.1 * enPrice;\n\n TempChange = Temperature * (0.1 * (1 - 2 * r.nextDouble()));\n // method 2 of Temperature\n// TempChange = temperature_list.get(count);\n// count+=1;\n\n Temperature += TempChange;\n year_num+=1;\n }", "double seBlesser();", "protected abstract void nextWave();", "public static int numElements_infos_noise() {\n return 3;\n }", "public abstract void newGuiNoise(long ms, int n);", "public void makeSomeNoise(IntegerMath math) {\n\n }", "public static int nextNote(int n1,int n2) {\n double rnd,sum=0;\n rnd=Math.random();\n for(int i=0;i<12;i++)\n {\n sum+=weights[n1-60][n2-60][i];\n\n if(rnd<=sum)\n return i+60;\n }\n return 62;\n }", "public void mo4359a() {\n }", "public void snare();", "protected double samplesOnePixelF() {\r\n\t\tif (getGraphWidth() > 1) {\r\n\t\t\t// avoid division by zero\r\n\t\t\treturn ((double) section.getLength()) / getGraphWidth();\r\n\t\t}\r\n\t\treturn 1.0;\r\n\t}", "public static int size_infos_valid_noise_samples() {\n return (8 / 8);\n }" ]
[ "0.6489156", "0.6425995", "0.633323", "0.6199022", "0.6183338", "0.6152377", "0.61242193", "0.60823864", "0.59944785", "0.59939986", "0.5916151", "0.5881513", "0.5859648", "0.5852069", "0.5850201", "0.5837779", "0.5835436", "0.58099973", "0.5742614", "0.5738286", "0.57301134", "0.57262903", "0.5716525", "0.57080287", "0.5646247", "0.5603671", "0.5593595", "0.55706275", "0.5550351", "0.55202633", "0.5513968", "0.5507464", "0.5491353", "0.5477905", "0.54769915", "0.54682434", "0.5451155", "0.54477036", "0.54335016", "0.5427296", "0.5410146", "0.5405418", "0.5351662", "0.53429484", "0.5335567", "0.53222513", "0.53136206", "0.53019506", "0.52884173", "0.5277217", "0.52690506", "0.52690434", "0.5268804", "0.526483", "0.5254157", "0.52510417", "0.52432567", "0.5239968", "0.5232206", "0.5230659", "0.5224967", "0.52162385", "0.5198667", "0.5197876", "0.519783", "0.51974577", "0.5186058", "0.5180022", "0.51794714", "0.51794666", "0.51723063", "0.51637495", "0.5163444", "0.5162504", "0.516106", "0.5160894", "0.51505756", "0.5146022", "0.5146022", "0.5144959", "0.5144305", "0.51375884", "0.51350117", "0.51336485", "0.51336485", "0.5132636", "0.51270986", "0.5126069", "0.5124263", "0.51232165", "0.5119988", "0.51186126", "0.511666", "0.51147145", "0.51035255", "0.5102329", "0.5100397", "0.51002806", "0.51001024", "0.5094765", "0.5091414" ]
0.0
-1
Unloads the data in this image.
public void delete() { if (this.data != null) { this.data.free(); this.data = null; } this.width = 0; this.height = 0; this.mipmaps = 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void unloaded(){\n\t\tloaded=false;\n\t}", "void unsetValueSampledData();", "public void unLoad() {\n try{\n deInitialize();\n iMenu.unLoad();\n }catch(Exception e){\n Logger.loggerError(\"Menu canvas unload Error\"+e.toString());\n }\n }", "public void unsetWeatherImage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(WEATHERIMAGE$2, 0);\n }\n }", "public void unloadGameTextures()\r\n {\n }", "public final void restore() {\r\n\t\tbi_image.restore();\r\n\t}", "protected abstract void onUnloadedCustom();", "public void unload(){ \n load.unloadFirst(); \n }", "@Override\n\tpublic void unloadResources() {\n\t\ttextureManager.unLoadTextures();\n\t}", "public void clearData() {\r\n\t\tdata = null;\r\n\t}", "@Override\n protected void onReset() {\n onStopLoading();\n\n // At this point we can release the resources associated with 'mData'.\n if (mData != null) {\n releaseResources(mData);\n mData = null;\n }\n }", "void unloadUserData();", "private void clearData() {}", "void unsetValueAttachment();", "public void removeFileInstance()\n {\n this.source = null;\n this.data = null;\n }", "public void removeImage() {\n setFileImage(null);\n getSelected().setUrlImage(null);\n RequestContext.getCurrentInstance().update(\"image\");\n }", "public void cleanupData() {\n\t}", "public void eraseImage() {\n\t\timage = null;\n\t}", "public void unload() {\n releasePressureToReturn();\n releasePressureToShooter();\n latch(false);\n// reloaded = false;\n }", "@Override\n public void clearData() {\n }", "public void unload() throws IOException;", "@Override\n\tpublic void onReset() {\n\t\tonStopLoading();\n\n\t\t// At this point we can release the resources associated with 'mData'.\n\t\tif (mData != null) {\n\t\t\tonReleaseResources(mData);\n\t\t\tmData = null;\n\t\t}\n\t\t// The Loader is being reset so we need to unregister Observer\n\t\tunregisterObserver();\n\t}", "public void Clean(View image)\n {\n \ttry\n \t{\n \t\tfor(int j=0 ;j<photosToLoad.size();){\n if(photosToLoad.get(j).imageView==image)\n photosToLoad.remove(j);\n else\n ++j;\n }\t\n \t}\n \tcatch(Exception e)\n \t{ }\n }", "@Override\n protected void onReset() {\n onStopLoading();\n\n // At this point we can release resources\n if( mData != null ) {\n releaseResources( mData );\n mData = null;\n }\n\n // The loader is being reset, so we should stop monitoring for changes\n if( mObserver != null ) {\n resolver.unregisterContentObserver( mObserver );\n mObserver = null;\n }\n }", "public void finalize(){\r\n srcImage = null;\r\n sigmas = null;\r\n xDataRound = null;\r\n yDataRound = null;\r\n zDataRound = null;\r\n super.finalize();\r\n }", "public void recycleBitmapData(){\n\t\tif(bmpData != null){\n\t\t\tbmpData.recycle();\n\t\t\tbmpData = null;\n\t\t}\n\t}", "public void clearImage() {\n IntStream.range(0, bytes.length).forEach(i -> bytes[i] = CLEAR_BYTE);\n }", "public void finalize() {\r\n destImage = null;\r\n srcImage = null;\r\n super.finalize();\r\n }", "public static void clearData() {\n cutPoints.clear();\n data.delete(0, data.length());\n }", "public synchronized void clearImage()\r\n\t{\r\n\t\treferenceImage.clearImage();\r\n\t\tdisplayedImage.clearImage();\r\n\t}", "public void unloadTexture(Texture texture, int entityGroupUid) {\r\n\t\tif (texture == null)\r\n\t\t\treturn; // already lost reference\r\n\r\n\t\tTextureGroup lTextureGroup = mTextureGroupMap.get(entityGroupUid);\r\n\t\tif (lTextureGroup == null) {\r\n\t\t\treturn;\r\n\r\n\t\t} else if (lTextureGroup.mTextureMap.containsValue(texture)) {\r\n\t\t\tString lTextureName = texture.name();\r\n\t\t\tDebug.debugManager().logger().i(getClass().getSimpleName(), String.format(\"unloading texture: %s from texture group %d\", lTextureName, entityGroupUid));\r\n\r\n\t\t\tTexture.unloadTexture(texture);\r\n\r\n\t\t\tlTextureGroup.mTextureMap.remove(lTextureName);\r\n\t\t\ttexture = null;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t}", "@Override\n public void clear() {\n isLoaded = false;\n }", "public void unInit() {\n this.bdv = null;\n this.brz = null;\n }", "@Override\n\t\t\tpublic void unloadViewData(DemoData item) {\n\t\t\t\t\n\t\t\t}", "public void finalize() {\r\n destImage = null;\r\n srcImage = null;\r\n sliceBuffer = null;\r\n super.finalize();\r\n }", "void minecraftChunkUnloaded() {\n\t\tthis.lastUnloadingTime = System.currentTimeMillis();\n\t}", "public TailoredImage uncompress() {\n\t\t\tsetPrimaryImg(snappyUnCompress(getPrimaryImg()));\n\t\t\tsetBlockImg(snappyUnCompress(getBlockImg()));\n\t\t\treturn this;\n\t\t}", "void clearDataAndProceed() {\n\t\tclearData();\n\t\tfileCounter++;\n\t\tif (fileCounter >= fileNames.size()){\n\t\t\tSystem.exit(0);\n\t\t\tSystem.out.println(\"Images over\");\n\t\t}\n\t\tloadImage();\n\t}", "public void clearData()\r\n {\r\n \r\n }", "public void Clean(ImageView image) {\n for( int j = 0; j < photosToLoad.size(); ) {\n if( photosToLoad.get(j).imageView == image )\n photosToLoad.remove(j);\n else\n j++;\n }\n }", "public void onUnFinishFetching() {\n\t\t\t\tinitializeDataWithMessage(message);\n\t\t\t}", "public void destroy(){\n\t\tcimg.destroy();\n\t}", "public void finalize() {\r\n\t\tdestImage = null;\r\n\t\tsrcImage = null;\r\n\t\tsuper.finalize();\r\n\t}", "void clearData();", "public void unload() {\n plugin.getEngine().getWorldProvider().getHeartbeat().unsubscribe(WIND);\n plugin.getRootConfig().unsubscribe(TEMPERATURES);\n }", "public void reload() {\n mHandle = new Texture(mBitmap, mMinMode, mMagMode, mWrapS, mWrapT).getHandle();\n }", "public void eraseData() {\n\t\tname = \"\";\n\t\tprice = 0.0;\n\t\tquantity = 0;\n\t}", "public void clearImages() {\n\t images.clear();\n\t}", "private void reset() {\n\t\tdata.clear();\n\t}", "public void clearData(){\n\r\n\t}", "public abstract void removeExternalData(String dataID);", "void clear() {\n data = new Data(this);\n }", "public void unsetDataCustom()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(DATACUSTOM$2, 0);\n }\n }", "public void unsetDataCustom()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(DATACUSTOM$2, 0);\n }\n }", "void delData();", "public void releaseTexture(URL url)\n {\n String file_path = url.toExternalForm();\n textureMap.remove(file_path);\n componentMap.remove(file_path);\n \n }", "public void clear() {\r\n\t\tdata.clear();\r\n\r\n\t}", "@Override\n protected void onReset() {\n onStopLoading();\n\n // At this point we can release the resources associated with 'mData'.\n if (mResult != null) {\n mResult = null;\n }\n\n }", "public void cleanUp(){\n glDeleteTextures(ID);\n }", "public void loadObjData() {\n this.updateGeometryAndUVs(SquareCoords, UVCoords, DrawOrder);\n SquareCoords = new float[0];\n UVCoords = new float[0];\n DrawOrder = new int[0];\n }", "public void releaseTexture(String filename)\n {\n textureMap.remove(filename);\n componentMap.remove(filename);\n }", "public void unget() {}", "public void performUninitialisation() {\n \t\t// subclasses can override the behaviour for this method\n \t}", "public void unsetDataMsng()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(DATAMSNG$18, 0);\n }\n }", "public void onChunkUnload()\n {\n //RadioMod.logger.info(\"Unload\");\n RadioMod.instance.musicManager.radioSources.get(this.uuid).stopMusic();\n }", "void remove(ReferenceData instance) throws DataException;", "public void removeData(@NotNull String key) {\n data.remove(key);\n }", "public void run() {\n sight.setImageBitmap(bmp);\n // old = null;\n }", "public void clean(ImageView view) {\n for (int i = 0; i < photosToLoad.size(); ) {\n if (photosToLoad.get(i).imageView == view) {\n photosToLoad.remove(i);\n }\n else {\n ++i;\n }\n }\n }", "public void unbind()\n {\n glBindTexture(GL_TEXTURE_2D, 0);\n }", "public void removeData(String dataName){\r\n this.mData.remove(dataName);\r\n }", "public void clear() { drawData.clear(); }", "protected void reset()\n {\n this.shapeDataCache.removeAllEntries();\n this.sector = null;\n }", "@Override\n protected void onReset() {\n super.onReset();\n\n // Ensure the loader is stopped\n onStopLoading();\n\n // At this point we can release the resources associated with 'apps' if needed.\n if (mData != null) {\n onReleaseResources(mData);\n mData = null;\n }\n }", "protected void clearData() {\n getValues().clear();\n getChildIds().clear();\n getBTreeMetaData().setDirty(this);\n }", "public void unsetFrame()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(FRAME$24);\n }\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (imageLoader != null) {\n\t\t\timageLoader.clearMemoryCache();\n\t\t}\n\t}", "protected synchronized void clearURLLoader() {\r\n currentLoader = null;\r\n }", "public void finalize() {\r\n destImage = null;\r\n srcImage = null;\r\n mask = null;\r\n\r\n if (keepProgressBar == false) {\r\n disposeProgressBar();\r\n }\r\n\r\n try {\r\n super.finalize();\r\n } catch (Throwable er) { }\r\n }", "public void Unload() {\n\t\tsceneLoaded = false;\n\t\tfor (GameObject gO : gameObjects) {\n\t\t\tEngine.Instance.RemoveObject(gO);\n\t\t}\n\t\tEngine.Instance.currentScenes.remove(this);\n\t}", "public void restore() {\n currentIm= originalIm.copy();\n }", "public synchronized ContentObject popData() {\n ContentObject result = this.data;\n this.data = null;\n return result;\n }", "public void clear() {\n this.data().clear();\n }", "public ImageObj delImage() {\n model.removeImageFromImageList(position);\n if (model.getImageList().size() != 0) {\n if (position == model.getImageList().size()) {\n position = 0;\n }\n return model.getImageList().get(position);\n }\n else {\n position = 0;\n noImages = true;\n return new ImageObj(\"http://www.xn--flawiler-fachgeschfte-n2b.ch/wp-content/uploads/2016/09/sample-image.jpg\", \"No Image\");\n }\n }", "@Override\n public void unLoad(double amount) throws InvalidDataException, CannotFitException {\n if (amount < 0) {\n throw new InvalidDataException(\"Negative unLoad amount: \" + amount);\n }\n\n if ((currentLoadWeight - amount) < 0.0) {\n throw new CannotFitException(\"UnLoading \" + amount + \" will make the load weight negative: \"\n + (currentLoadWeight + amount));\n }\n\n currentLoadWeight -= amount;\n }", "public void reset() {\n _valueLoaded = false;\n _value = null;\n }", "public void finalize() {\r\n byteBuffer2 = null;\r\n byteBuffer4 = null;\r\n byteBuffer8 = null;\r\n progressBar = null;\r\n tagBuffer = null;\r\n\r\n if (raFile != null) {\r\n\r\n try {\r\n raFile.close();\r\n } catch (final IOException ioe) {\r\n // Do nothing\r\n }\r\n }\r\n\r\n raFile = null;\r\n }", "public void finalize() {\r\n srcImage = null;\r\n destImage = null;\r\n buffer = null;\r\n validBuffer = null;\r\n idealBuffer = null;\r\n objectBuffer = null;\r\n super.finalize();\r\n }", "public void unset(){\n\t\tcurrentInst = -1;\n\t}", "@Override\n protected void onReset() {\n super.onReset();\n // Ensure the loader is stopped\n onStopLoading();\n // At this point we can release the resources associated with 'apps'\n // if needed.\n if (mData != null) {\n onReleaseResources(mData);\n mData = null;\n }\n unregisterObserver();\n }", "public void clear() {\n\n\t\tdata = null;\n\t\tnumRows = 0;\n\t\tnumCols = 0;\n\t\tsize = 0L;\n\n\t}", "private Storage_Area unloadAGV (Storage_Area storage) throws Exception\r\n {\r\n return unloadContainer(0,0, storage);\r\n }", "public void reset() {\n cancelTaskLoadOIFits();\n\n userCollection = new OiDataCollection();\n oiFitsCollection = new OIFitsCollection();\n oiFitsCollectionFile = null;\n selectedDataPointer = null;\n\n fireOIFitsCollectionChanged();\n }", "public void clearData() {\n\t\tdrawnRect.clear();\n\t\tboxList.setListData(drawnRect);\n\t\tcurrRect = null;\n\t\ttextField.setText(\"\");\n\t}", "@Override\r\n\tpublic void unexecute() {\n\t\t\r\n\t}", "private void m6558i() {\n if (this.f5072i != null) {\n this.f5072i.recycle();\n this.f5072i = null;\n }\n if (this.f5071h != null) {\n this.f5071h.recycle();\n this.f5071h = null;\n }\n }", "public void clear() throws Exceptions.OsoException {\n loadedNames.clear();\n loadedContent.clear();\n ffiPolar = Ffi.get().polarNew();\n }", "public void unpin();", "public void unpin();", "@Override\n public void onDetach() {\n super.onDetach();\n adapter.notifyDataSetChanged();\n Bimp.tempSelectBitmap.clear();\n Bimp.max = 0;\n }" ]
[ "0.65172243", "0.64430356", "0.6209442", "0.60370624", "0.6026142", "0.60237837", "0.6006943", "0.5983662", "0.59408814", "0.59356076", "0.5925269", "0.5920383", "0.5905751", "0.5897025", "0.5882582", "0.5865132", "0.5824402", "0.5817466", "0.5811024", "0.57384413", "0.57301307", "0.5729844", "0.569464", "0.56922996", "0.5679072", "0.5668958", "0.564883", "0.5633461", "0.5606702", "0.5601807", "0.5596948", "0.55955815", "0.5591444", "0.55855405", "0.5582459", "0.5577358", "0.5573996", "0.5570245", "0.55544174", "0.55536985", "0.55322117", "0.5516224", "0.5512237", "0.55039275", "0.5503736", "0.550276", "0.5490772", "0.54895383", "0.5429537", "0.5410196", "0.5409062", "0.54002964", "0.5390048", "0.5390048", "0.53896064", "0.5388453", "0.53800493", "0.53603053", "0.53514415", "0.5341925", "0.5331326", "0.5322682", "0.531746", "0.53136116", "0.53127724", "0.5305315", "0.53046125", "0.5282284", "0.5278285", "0.5276943", "0.52666414", "0.5263833", "0.52572995", "0.5256861", "0.5256392", "0.52548707", "0.5249757", "0.5244145", "0.5240968", "0.52398574", "0.5234173", "0.5233089", "0.5224236", "0.5215694", "0.5214178", "0.5210988", "0.51966643", "0.51918596", "0.5191234", "0.51858425", "0.517649", "0.5168634", "0.51672626", "0.5158632", "0.5157982", "0.5156739", "0.51560086", "0.51543766", "0.51543766", "0.5153952" ]
0.62818384
2
Exports this image to file. If specified, then the mipmaps will be exported to separate files if the image has them.
public boolean export(@NotNull String fileName, boolean withMipmaps) { if (this.data == null) return false; String extension = getExtension(fileName); ByteBuffer buffer = this.data.toBuffer(); buffer.limit(this.width * this.height * this.format.sizeof); boolean success = export(extension, fileName, this.width, this.height, this.format.sizeof, this.mipmaps, this.format, buffer); if (withMipmaps) { int nextMip = this.width * this.height * this.format.sizeof; int mipWidth = this.width >> 1; int mipHeight = this.height >> 1; int mipSize = mipWidth * mipHeight * this.format.sizeof; String mipFileBase = fileName.substring(0, fileName.length() - ".png".length()); for (int i = 1; i < this.mipmaps; i++) { String mipFileName = mipFileBase + "_" + i + extension; buffer.position(nextMip); buffer.limit(nextMip + mipSize); boolean mipSuccess = export(extension, mipFileName, mipWidth, mipHeight, this.format.sizeof, 1, this.format, buffer); success = mipSuccess && success; nextMip += mipSize; if ((mipWidth >>= 1) < 1) mipWidth = 1; if ((mipHeight >>= 1) < 1) mipHeight = 1; mipSize = mipWidth * mipHeight * this.format.sizeof; } } return success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeToImage() {\n imageWriter.writeToImage();\n }", "public void writeToImage() {\r\n\t\t_imageWriter.writeToImage();\r\n\t}", "public void exportPuzzle () {\r\n fileManager.exportPuzzle (puzzle);\r\n }", "private void appendTextures(ZipOutputStream out) throws IOException {\n\t\tfor (UV uv : exportTexCoords)\n\t\t{\n\t\t\tBigDecimal uRound = new BigDecimal(uv.u).setScale(9, RoundingMode.HALF_UP);\n\t\t\tBigDecimal vRound = new BigDecimal(uv.v).setScale(9, RoundingMode.HALF_UP);\n\t\t\tout.write((\"vt \" + uRound.toPlainString() + \" \" + vRound.toPlainString() + \"\\n\").getBytes());\n\t\t}\n\t}", "public void exportMap(){\n\t\tString toSave = \"\";\r\n\t\tfor(int i=0;i<map.getH();i++){\r\n\t\t\tfor(int j=0;j<map.getL();i++){\r\n\t\t\t\tif(j == map.getL()-2)\r\n\t\t\t\t\ttoSave += map.getCase(i, j).toString();\r\n\t\t\t\telse\r\n\t\t\t\t\ttoSave += map.getCase(i, j).toString()+\"|\";\r\n\t\t\t}\r\n\t\t\ttoSave += \"\\n\";\r\n\t\t}\r\n\t\t//ecriture d'un fichier\r\n\t}", "private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }", "public void writeToFile() {\n\t\ttry {\n\t\t\tFileOutputStream file = new FileOutputStream(pathName);\n\t\t\tObjectOutputStream output = new ObjectOutputStream(file);\n\n\t\t\tMap<String, HashSet<String>> toSerialize = tagToImg;\n\t\t\toutput.writeObject(toSerialize);\n\t\t\toutput.close();\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void exportMap() {\n\r\n\t}", "public boolean saveMapAsImage(File imageFile)\n {\n try {\n BufferedImage mapImage = new BufferedImage((int) mapComponent.getPreferredSize().getWidth(),\n (int) mapComponent.getPreferredSize().getHeight(),\n BufferedImage.TYPE_INT_ARGB);\n Graphics2D mapImageGraphics = mapImage.createGraphics();\n FileWriter\t\t\tmapWriter;\n \n if (!imageFile.canWrite())\n {\n ErrorHandler.displayError(\"Could not write to image file. Maybe it's locked.\", ErrorHandler.ERR_SAVE_FAIL);\n return false;\n }\n \n mapComponent.paint2d(mapImageGraphics);\n \n ImageIO.write(mapImage, \"png\", imageFile); \n return true;\n \n } catch (Exception e) {\n ErrorHandler.displayError(\"Could not write data to map file:\\n\" + e, ErrorHandler.ERR_SAVE_FAIL);\n return false;\n }\n }", "public @NotNull Image genMipmaps()\n {\n if (this.data != null)\n {\n // TODO - LWJGL-ify\n int mipCount = 1; // Required mipmap levels count (including base level)\n int mipWidth = this.width; // Base image width\n int mipHeight = this.height; // Base image height\n \n int mipSize = mipWidth * mipHeight * this.format.sizeof; // Image data size (in bytes)\n \n // Count mipmap levels required\n while (mipWidth != 1 || mipHeight != 1)\n {\n if (mipWidth != 1) mipWidth >>= 1;\n if (mipHeight != 1) mipHeight >>= 1;\n \n // Security check for NPOT textures\n if (mipWidth < 1) mipWidth = 1;\n if (mipHeight < 1) mipHeight = 1;\n \n Image.LOGGER.fine(\"Next mipmap level: %s x %s - current size %s\", mipWidth, mipHeight, mipSize);\n \n mipCount++;\n mipSize += mipWidth * mipHeight * this.format.sizeof; // Add mipmap size (in bytes)\n }\n \n if (this.mipmaps < mipCount)\n {\n Color.Buffer temp = Color.realloc(this.data, mipSize);\n \n if (temp.address() != 0)\n {\n this.data = temp; // Assign new pointer (new size) to store mipmaps data\n }\n else\n {\n Image.LOGGER.warning(\"IMAGE: Mipmaps required memory could not be allocated\");\n }\n \n // Pointer to allocated memory point where store next mipmap level data\n long nextMip = this.data.address() + (long) this.width * this.height * this.format.sizeof;\n \n mipWidth = this.width >> 1;\n mipHeight = this.height >> 1;\n mipSize = mipWidth * mipHeight * this.format.sizeof;\n Image imCopy = copy();\n \n for (int i = 1; i < mipCount; i++)\n {\n Image.LOGGER.fine(\"IMAGE: Generating mipmap level: %s (%s x %s) - size: %s - offset: 0x%x\", i, mipWidth, mipHeight, mipSize, nextMip);\n \n imCopy.resize(mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter\n \n if (imCopy.data != null) MemoryUtil.memCopy(imCopy.data.address(), nextMip, mipSize);\n nextMip += mipSize;\n this.mipmaps++;\n \n // Security check for NPOT textures\n if ((mipWidth >>= 1) < 1) mipWidth = 1;\n if ((mipHeight >>= 1) < 1) mipHeight = 1;\n \n mipSize = mipWidth * mipHeight * this.format.sizeof;\n }\n \n imCopy.delete();\n }\n else\n {\n Image.LOGGER.warning(\"Mipmaps already available\");\n }\n }\n return this;\n }", "@Override\n public String exportImage() throws IllegalArgumentException {\n BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < this.width; x++) {\n for (int y = 0; y < this.height; y++) {\n int r = this.pixels[x][y][0];\n int g = this.pixels[x][y][1];\n int b = this.pixels[x][y][2];\n int color = (r << 16) | (g << 8) | b;\n img.setRGB(x, y, color);\n }\n }\n return exportHelp(img);\n }", "public void writeImage() {\n // Write generated image to a file\n try {\n // Save as JPEG\n File file = new File(\"Images/\" + name + \"INS\" + System.currentTimeMillis() + \".jpg\");\n ImageIO.write(bufferedImage, \"jpg\", file);\n\t\t\t\t\n\n } catch (IOException e) {\n }\n }", "@FXML\n public void onExportButtonClick() throws MatrixSizeException {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Save As\");\n fileChooser.getExtensionFilters().addAll(\n\t\t\t\tnew FileChooser.ExtensionFilter(\"PNG File\", \"*.png\"),\n new FileChooser.ExtensionFilter(\"JPG File\", \"*.jpg\"),\n new FileChooser.ExtensionFilter(\"JPEG File\", \"*.jpeg\")\n\t\t);\n\n // The directory the user chooses to save the file\n File file = fileChooser.showSaveDialog(root.getScene().getWindow());\n\n // Saves the image in the output directory\n if(file != null) {\n System.out.println(file.getAbsolutePath());\n\n BufferedImage bImage = SwingFXUtils.fromFXImage(Main.getRectifiedImage().getImage(), null);\n try {\n ImageIO.write(bImage, \"png\", file);\n }\n catch (IOException e) {\n Logger.getLogger(RectifierGUIController.class.getName()).log(Level.SEVERE, null, e);\n }\n }\n }", "@Override\n\tpublic void export(URNspec urn, HashMap mapDiagrams, FileOutputStream fos) throws InvocationTargetException {\n\t}", "@Override\n public void writeToParcel(Parcel out, int flags){\n out.writeParcelable(history, flags);\n out.writeParcelable(historyValues, flags);\n out.writeParcelable(redoEffects, flags);\n out.writeParcelable(redoParams, flags);\n out.writeMap(images);\n }", "public static void codeAllImages(Args args) throws FileNotFoundException, IOException{\n BufferedImage tempI=null, tempP=null;\n BufferedImage[] codeOut = null;\n FileOutputStream fos = new FileOutputStream(args.output);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n int j = 0;\n //Iterate through all the images dividing them into frameP or frameI\n for(int i= 0; i < imageNames.size(); i++){ \n //j is a counter of the gop\n if(j >= (args.gop)){\n j=0;\n }\n if(j==0){\n // Frame I\n tempI = imageDict.get(imageNames.get(i));\n imgToZip(tempI, i, zipOS, \"image_coded_\");\n }else{\n //Frame P\n codeOut = createCodedImg(tempI, imageDict.get(imageNames.get(i)), args.thresh, args.tileSize, args.seekRange, args.comparator);\n imgToZip(codeOut[0], i, zipOS, \"image_coded_\");\n tempI = codeOut[1];\n //showImage(tempP);\n }\n j++;\n }\n //Get the gop, its always the first position of the coded data\n dataList.get(0).gop = args.gop;\n //Store into a .gz file all the info of every tile of every image, info that is stored into our dataList\n try {\n FileOutputStream out = new FileOutputStream(\"codedData.gz\");\n GZIPOutputStream gos = new GZIPOutputStream(out);\n ObjectOutputStream oos = new ObjectOutputStream(gos);\n oos.writeObject(dataList);\n oos.flush();\n gos.flush();\n out.flush();\n \n oos.close();\n gos.close();\n out.close();\n } catch (Exception e) {\n System.out.println(\"Problem serializing: \" + e);\n }\n \n FileInputStream fis = new FileInputStream(\"codedData.gz\");\n ZipEntry e = new ZipEntry(\"codedData.gz\");\n zipOS.putNextEntry(e);\n\n byte[] bytes = new byte[1024];\n int length;\n while ((length = fis.read(bytes)) >= 0) {\n zipOS.write(bytes, 0, length);\n }\n zipOS.closeEntry();\n fis.close();\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "public void saveMap(String name){\n\t\tString path = new File (\".\").getAbsolutePath();\n\t\t//System.out.println(path);\n\t\tObjectOutputStream outputStream=null;\n\t\t\n\t\tString fileName=path.concat(\"//Maps//\"+name+\".txt\");\n\t\tFile file = new File(fileName);\n\t\t\n\t\n\t\t\n\t\ttry {\n\t\t\tFileOutputStream fileOutputStream =new FileOutputStream(file);\n\t\t\toutputStream = new ObjectOutputStream(fileOutputStream);\n\t\t\n\t\t\toutputStream.writeInt(getWidth());\n\t\t\toutputStream.writeInt(getHeight());\n\t\t\t\n\t\t\tfor (Path p : temp){\n\t\t\t\toutputStream.writeInt(p.getPos());\n\t\t\t}\n\t\t\toutputStream.writeInt(-1);\n\t\t\t\n\t\t\toutputStream.flush();\n\t\t\toutputStream.close();\n\t\t\tsaveMapName(name);\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Problem opening the file \"+name+\".txt\");\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Problem with output to file \"+name+\".txt\");\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\n\n\n\t}", "public void writeOutputSettings(File file) throws IOException\n{\n if (file != null && m.getOutputImageManager().getMosaic() != null)\n {\n boolean[][] vFlip = m.getOutputImageManager().getMosaic().getFlipV();\n boolean[][] hFlip = m.getOutputImageManager().getMosaic().getFlipH();\n String[] lines = new String[8];\n lines[0] = \"output\";\n lines[1] = new Integer((int)cp5.getController(\"sizeOfTiles\").getValue()).toString(); //size of cells\n lines[2] = new Integer((int)cp5.getController(\"evenRowShift\").getValue()).toString(); //even row shift\n lines[3] = new Integer((int)cp5.getController(\"oddRowShift\").getValue()).toString(); //odd row shift\n lines[4] = new Integer(vFlip[0].length-1).toString(); //number of x cells\n lines[5] = new Integer(vFlip.length).toString(); //number of y cells\n int i = 6;\n \n boolean[][] array = vFlip;\n while(i < lines.length)\n {\n lines[i] = \"\";\n for (int j = 0; j < array[0].length; j++)\n {\n for (int k = 0; k < array.length; k++)\n {\n if (array[k][j])\n {\n lines[i] += \"t\";\n } else\n {\n lines[i] += \"f\";\n }\n lines[i] += \"-\";\n }\n lines[i] = lines[i].substring(0,lines[i].length()-1);\n lines[i] += \";\";\n }\n array = hFlip;\n i++;\n }\n \n // list the files in the data folder\n String[] filenames = file.list();\n int fileNumber = 1;\n \n for(String f: filenames)\n {\n if(f.endsWith(\".config\") && f.startsWith(\"OutputConfiguration\"))\n {\n f = f.substring(f.length()-8,f.length()-7);\n if(isParsable(f))\n {\n fileNumber = max(Integer.parseInt(f),fileNumber);\n fileNumber++;\n }\n \n }\n }\n \n saveStrings(file+\"/\"+\"OutputConfiguration\"+fileNumber+\".config\", lines);\n }\n}", "public void outputToFile(String filemame)\n {\n }", "@FXML public void saveToFile()throws java.io.IOException {\n Highgui.imwrite( this.originalImagePath, this.image );\n System.out.println(\"Saving\");\n }", "public void renderImage()\n {\n for (int i = 0; i < _imageWriter.getNx(); i++)\n {\n for (int j = 0; j < _imageWriter.getNy(); j++)\n {\n Ray ray;\n ray = new Ray(_scene.getCamera().constructRayThroughPixel(_imageWriter.getNx(), _imageWriter.getNy(),j,i,\n _scene.getScreenDistance(), _imageWriter.getWidth(),_imageWriter.getHeight()));\n\n if(i==255 && j==255)\n System.out.print(\"111\");\n Map<Geometry, List<Point3D>> intersectionPoints = new HashMap<>(getSceneRayIntersections(ray));\n\n if(intersectionPoints.isEmpty())\n _imageWriter.writePixel(j, i, _scene.getBackground());\n else\n {\n Map<Geometry, Point3D> closestPoint = getClosestPoint(intersectionPoints);\n Map.Entry<Geometry,Point3D> entry;\n Iterator<Entry<Geometry, Point3D>> it = closestPoint.entrySet().iterator();\n entry = it.next();\n _imageWriter.writePixel(j, i, calcColor(entry.getKey(), entry.getValue(), ray));\n }\n\n }\n }\n //printGrid(1);\n\n }", "public void WritePredictionImages() {\r\n\r\n\t\tString str = new String();\r\n\r\n\t\tModelSimpleImage img = new ModelSimpleImage();\r\n\t\tCDVector texture = new CDVector();\r\n\t\tint n = m_pModel.Rc().NRows();\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\r\n\t\t\tm_pModel.Rc().Row(n - i - 1, texture); // take largest first\r\n\t\t\timg = m_pModel.ShapeFreeImage(texture, img);\r\n\t\t\t// str.format(\"Rc_image%02i.bmp\", i );\r\n\t\t\tstr = \"Rc_image\" + i + \".xml\";\r\n\t\t\tModelImage image = new ModelImage(img, str);\r\n\t\t\timage.saveImage(\"\", str, FileUtility.XML, false);\r\n\t\t}\r\n\t\tn = m_pModel.Rt().NRows();\r\n\t\tfor (int i = 0; i < n; i++) {\r\n\r\n\t\t\tm_pModel.Rt().Row(i, texture);\r\n\t\t\timg = m_pModel.ShapeFreeImage(texture, img);\r\n\t\t\t// str.format(\"Rt_image%02i.bmp\", i );\r\n\t\t\tstr = \"Rt_image\" + i + \".xml\";\r\n\t\t\tModelImage image = new ModelImage(img, str);\r\n\t\t\timage.saveImage(\"\", str, FileUtility.XML, false);\r\n\t\t}\r\n\t}", "void saveAs() {\n writeFile.Export();\n }", "public void write(File dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, new FileOutputStream(dest), writeAlpha);\r\n\t}", "@Override\n\tpublic void writeFile(String file_out) {\n\t\tthis.writeFile(Mode.POINT_ONLY, 0, DEFAULT_AND_LOAD_FACTOR, file_out);\n\t}", "BufferedImage outputImage();", "public void write(String filename) throws IOException {\n \t\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t \tos = new FileOutputStream(new File(\"./OutputImage.txt\"));\n\t\t\tString header = (\"P6\\n\" + width + \"\\n\" + height + \"\\n255\\n\")//.getBytes() missing for converting the string into bytes;\n\t\t\t// For P6 there is no \\n after each spec. Use: new (\"P6 \"+width+\" \"+h+\" 255\\n\").getBytes())\n\t\t\tos.write(header);\n\t\t\tos.write(data);\n\t\t} catch (IOException e) {\n\t\t \t e.printStackTrace();\n\t\t}finally{\n\t\t try {\n\t\t\tos.close();\n\t\t } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t \t}\n \t}\n \n\n}", "public void exportFiles() \r\n\t{\r\n\t\tif(!fDictionaryFile().exists())\r\n\t\t{\r\n\t\t\texportDictionary();\r\n\t\t}\r\n\t}", "void exportGame();", "public void toFile(String filename) {\n\t\tString serialized = Serializer.serializeLevelPack(this);\n\t\tSerializer.writeToFile(filename, serialized.getBytes());\n\t}", "@Override\r\n\tpublic void output(File outFile, Collection<RoleAnimationInfo> collection) throws Exception {\n\t\t\r\n\t}", "public native boolean writeImage(ImageInfo imageInfo)\n\t\t\tthrows MagickException;", "@Override\n public void convert(final List<OutputPayload> outputPayloadList) throws Exception {\n\n for (final OutputPayload payload : outputPayloadList) {\n System.out.println(strings.getString(\"status_exporting_file\", payload.getTargetFile()));\n\n final String svgPath = payload.getSvgPath();\n final String svgURI = new File(svgPath).toURL().toString();\n final TranscoderInput input = new TranscoderInput(svgURI);\n\n // Create a JPEG transcoder\n final PNGTranscoder t = new PNGTranscoder();\n\n final float floatWidth = Float.valueOf(payload.getWidth());\n final float floatHeight = Float.valueOf(payload.getHeight());\n\n t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, floatWidth);\n t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, floatHeight);\n\n // Create the transcoder output.\n final OutputStream ostream = new FileOutputStream(payload.getTargetFile());\n final TranscoderOutput output = new TranscoderOutput(ostream);\n // Save the image.\n t.transcode(input, output);\n\n // Flush and close the stream.\n ostream.flush();\n ostream.close();\n }\n }", "public void saveMap() {\n this.scanMap();\n String userHome = System.getProperty(\"user.home\");\n BinaryExporter export = BinaryExporter.getInstance();\n File file = new File(userHome + \"world.j3o\");\n try {\n export.save(this.testNode, file); \n } catch (IOException ex) {\n Logger.getLogger(mapDevAppState_2.class.getName()).log(Level.SEVERE, \"File write error\");\n }\n }", "public void exportMedia(){\r\n \r\n }", "static void write_section_file ( String image_file_name, int width, int height ) {\n }", "public String toFileFormat()\n\t{\n\t\t\n\t\treturn startx + \" \" + starty + \"; \" + endx + \" \" + endy + \"; \"+ texture + \";\\r\\n\";\n\t\t\n\t}", "private void actionExportImageSampleArea ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t{\r\n\t\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\t\tFileNameExtensionFilter fileTypeBMP = new FileNameExtensionFilter(\"BMP\", \"bmp\", \"BMP\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeBMP);\t \r\n\t\t\t\t\tFileNameExtensionFilter fileTypeJPG = new FileNameExtensionFilter(\"JPEG\", \"jpg\", \"jpeg\", \"JPG\", \"JPEG\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeJPG);\r\n\r\n\t\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\t\tsaveFileChooser.setFileFilter(fileTypeBMP);\r\n\r\n\t\t\t\t\tint isSelectedFile = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\t\tif (isSelectedFile == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString outputFilePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(fileTypeBMP)) { outputFilePath += \".bmp\"; }\r\n\t\t\t\t\t\telse if (saveFileChooser.getFileFilter().equals(fileTypeJPG)) { outputFilePath += \".jpg\"; }\r\n\r\n\t\t\t\t\t\tOutputController.exportImageSampleArea(outputFilePath, DataController.getTable().getElement(indexImage));\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "public static void imgToZip(BufferedImage image, int number, ZipOutputStream zipOS, String path){\n try {\n File tempImage = new File(path+ number +\".jpg\");\n ImageIO.write(image,\"jpg\",tempImage);\n createFileToZip(image, path, number, zipOS);\n tempImage.delete();\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void saveBitmapToDisk(String fileName) throws FileNotFoundException, IOException {\n // serialize\n // save to disk\n FileOutputStream fout = new FileOutputStream(\"assets/\"+fileName+\".bitmap\");\n ObjectOutputStream oos = new ObjectOutputStream(fout);\n oos.writeObject(this);\n }", "private void outputToFile() {\n\t\tPath filePath = Paths.get(outputFile);\n\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tRowIterator iterator = currentGen.iterateRows();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tElemIterator elem = iterator.next();\n\t\t\t\twhile (elem.hasNext()) {\n\t\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\t\twriter.write(mElem.rowIndex() + \",\" + mElem.columnIndex());\n\t\t\t\t\twriter.newLine();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to write to the provided file\");\n\t\t}\n\n\t}", "private void writeToFiles(Context resultContext) throws IOException {\n\t\tMap<String, Map<Object, ArrayList<Object>>> keyValMappingByBaseOutputPath = resultContext.getKeyValMappingsByBaseOutputPath(); \n\t\t//Write key & value to each baseOutputPath's \n\t\tPath targetOutputDir = null;\n\t\tMap<Object, ArrayList<Object>> keyValMapping = null;\n\t\tPath finalOutputBaseDir = this.config.getFinalOutputDir();\n\t\tfor (String baseOutputPath: keyValMappingByBaseOutputPath.keySet()) {\n\t\t\tif (baseOutputPath.equals(\"\")) {\n\t\t\t\t//Regular output goes into the mapper output buffer directory.\n\t\t\t\ttargetOutputDir = this.config.getMapOutputBufferDir();\n\t\t\t}else {\n\t\t\t\t//Multiple output to a particular outputPath which was \n\t\t\t\t//specified by user goes into the final output directory. \n\t\t\t\ttargetOutputDir = Paths.get(finalOutputBaseDir.toString(), baseOutputPath);\n\t\t\t}\n\t\t\tkeyValMapping = keyValMappingByBaseOutputPath.get(baseOutputPath);\n\t\t\tthis.writeEachMapping(targetOutputDir, keyValMapping);\n\t\t};\n\t}", "void export(Context target){\n for (String str : export.keySet()){\n if (export(str)){\n target.export(str, get(str));\n }\n }\n }", "public void write(JmeExporter ex) throws IOException {\r\n OutputCapsule capsule = ex.getCapsule(this);\r\n capsule.write(someIntValue, \"someIntValue\", 1);\r\n capsule.write(someFloatValue, \"someFloatValue\", 0f);\r\n //capsule.write(someJmeObject, \"someJmeObject\", new Material());\r\n }", "public void write(JmeExporter ex) throws IOException {\r\n OutputCapsule capsule = ex.getCapsule(this);\r\n capsule.write(someIntValue, \"someIntValue\", 1);\r\n capsule.write(someFloatValue, \"someFloatValue\", 0f);\r\n //capsule.write(someJmeObject, \"someJmeObject\", new Material());\r\n }", "public void save(){\n try {\n FileOutputStream outputStream = getContext().openFileOutput(\"com_petros_cmsc434doodler_imageFile\", Context.MODE_PRIVATE);\n for(int i = 0; i<pathStack.size(); i++){\n outputStream.write((int)paintStack.get(i).getStrokeWidth()); //One byte is enough, max if 50\n outputStream.write(paintStack.get(i).getAlpha());\n //Red, Green, Blue\n outputStream.write((paintStack.get(i).getColor() & 0xFF0000) >> (4*4));\n outputStream.write((paintStack.get(i).getColor() & 0xFF00) >> (2*4));\n outputStream.write(paintStack.get(i).getColor() & 0xFF);\n\n outputStream.write(NEXT_LINE);\n for(int j = 0; j < pathPointsStack.get(i).size(); j+=2){\n //First point - have to save points byte at a time.\n outputStream.write(pathPointsStack.get(i).get(j) >> (6*4));\n outputStream.write(pathPointsStack.get(i).get(j) >> (4*4));\n outputStream.write(pathPointsStack.get(i).get(j) >> (2*4));\n outputStream.write(pathPointsStack.get(i).get(j));\n //Second point\n outputStream.write(pathPointsStack.get(i).get(j+1) >> (6*4));\n outputStream.write(pathPointsStack.get(i).get(j+1) >> (4*4));\n outputStream.write(pathPointsStack.get(i).get(j+1) >> (2*4));\n outputStream.write(pathPointsStack.get(i).get(j+1));\n if(j+2 == pathPointsStack.get(i).size()){\n outputStream.write(NEXT_PATH);\n }\n else{\n outputStream.write(NEXT_LINE);\n }\n }\n }\n outputStream.write(END_OF_PATHS);\n outputStream.close();\n } catch (Exception e) {\n Toast.makeText(getContext(), \"Error saving the file\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(image);\n\t\tdest.writeString(name);\n\t\t\n\t}", "static public void write(String filename, Image image) throws IOException\n {\n MyBMPFile reader = new MyBMPFile();\n \n reader.saveBitmap(filename, image, image.getWidth(reader), image.getHeight(reader));\n }", "public static void saveImage(int[][][] imagePixels, String saveName){\n int height = imagePixels.length;\n int width = imagePixels[0].length;\n int[][] flat = new int[width*height][4];\n \n // Ask the user for the name of the output file.\n// try{\n// saveName = imageMain.console.readLine();\n// }\n// catch(IOException e){ \n// System.out.println(e);\n// System.exit(1);\n// }\n\n // If saveName does not already end in .bmp, then add .bmp to saveName.\n saveName=bmpTack(saveName);\n\n // Flatten the image into a 2D array.\n int index=0;\n for(int row=0; row<height; row++) {\n for(int col=0; col<width; col++) {\n for(int rgbo=0; rgbo<4; rgbo++) {\n flat[index][rgbo]=imagePixels[row][col][rgbo];\n }\n index++;\n } // for col\n } // for row\n\n // Combine the 8-bit red, green, blue, offset values into 32-bit words.\n int[] outPixels = new int[flat.length];\n for(int j=0; j<flat.length; j++) {\n outPixels[j] = ((flat[j][0]&0xff)<<16) | ((flat[j][1]&0xff)<<8)\n | (flat[j][2]&0xff) | ((flat[j][3]&0xff)<<24);\n } // for j\n\n // Write the data out to file with the name given by string saveName.\n BMPFile bmpf = new BMPFile();\n bmpf.saveBitmap(saveName, outPixels, width, height);\n System.out.println(\"Saved \" + saveName);\n }", "public void renderScene(String outputFileName)\r\n {\r\n long startTime = System.currentTimeMillis();\r\n\r\n // Create a byte array to hold the pixel data:\r\n byte[] rgbData = new byte[this.imageWidth * this.imageHeight * 3];\r\n\r\n\r\n for(int i = 0; i < this.imageWidth; i++) {\r\n for (int j = 0; j < this.imageHeight; j++) {\r\n Ray ray = constructRayThroughPixel(this.camera, i, j);\r\n TreeMap<Intersection, Surface> intersections = findIntersections(ray, this.scene);\r\n CustomColor pixelColor = getColor(this.scene, intersections, ray);\r\n UpdateRgbData(rgbData, pixelColor, i , j);\r\n }\r\n }\r\n\r\n long endTime = System.currentTimeMillis();\r\n Long renderTime = endTime - startTime;\r\n\r\n // The time is measured for your own convenience, rendering speed will not affect your score\r\n // unless it is exceptionally slow (more than a couple of minutes)\r\n System.out.println(\"Finished rendering scene in \" + renderTime.toString() + \" milliseconds.\");\r\n\r\n // This is already implemented, and should work without adding any code.\r\n saveImage(this.imageWidth, rgbData, outputFileName);\r\n\r\n System.out.println(\"Saved file \" + outputFileName);\r\n }", "private void exportGraphic(ExportableGraphic p_exportable)\r\n {\r\n // Create a few simple file filters.\r\n SimpleFileFilter[] filters = new SimpleFileFilter[] {\r\n new SimpleFileFilter(\"png\", \"Portable Network Graphics (*.png)\"),\r\n new SimpleFileFilter(\"jpg\", \"JPEG file (*.jpg)\")\r\n };\r\n\r\n // Save the file.\r\n String filePath = openFileChooser(false, filters);\r\n \r\n // Process the file\r\n if(filePath != null)\r\n {\r\n // Get the file the user selected.\r\n File selectedFile = new File(filePath);\r\n \r\n // Determine the file type.\r\n String fileType = IOLib.getExtension(selectedFile);\r\n if (fileType == null)\r\n {\r\n fileType = ((SimpleFileFilter) m_fc.getFileFilter()).getExtension();\r\n selectedFile = new File(selectedFile.toString() + \".\" + fileType);\r\n }\r\n \r\n // If the file already exists the user has to confirm that it may be \r\n // replaced by the new export.\r\n boolean doExport = true;\r\n if (selectedFile.exists())\r\n {\r\n int response = JOptionPane.showConfirmDialog(m_frame, \"The file \\\"\" + selectedFile.getName() + \"\\\" already exists.\\nDo you want to replace it?\", \"Confirm Save\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n if (response == JOptionPane.NO_OPTION) doExport = false;\r\n }\r\n \r\n // Do the export.\r\n if (doExport) p_exportable.export(selectedFile, fileType);\r\n }\r\n }", "private void batchExport(){\r\n \t \t\r\n \t// Retrieve all the rsml files\r\n \tFile f = new File(batchSourceFolder.getText());\r\n \tFile[] rsml = f.listFiles(new FilenameFilter() {\r\n \t\tpublic boolean accept(File directory, String fileName) {\r\n \t\t\treturn fileName.endsWith(\".rsml\");\r\n \t\t}\r\n \t});\r\n \t \t\r\n \tif(rsml.length < 100){\r\n\t \tSR.write(\"Batch export started for \"+rsml.length+\" files\");\r\n\t\r\n\t \t// Open the different RSML files, retriev their data and get their size.\r\n\t \tRootModel[] models = new RootModel[rsml.length];\r\n\t \tint w = 0; int h = 0;\r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\tmodels[i] = new RootModel(rsml[i].getAbsolutePath());\r\n\t \t \t\tif(models[i].getWidth(true) > w) w = models[i].getWidth(true);\r\n\t \t \t\tif(models[i].getHeight(true) > h) h = models[i].getHeight(true);\r\n\t \t \t}\r\n\t \t \t\r\n\t \t \tResultsTable rt = new ResultsTable();\r\n\t \t \tImageStack is= new ImageStack(w, h);\r\n\t \t \r\n\t \t \r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\t// Send the imagr to the stack\r\n\t \t \t\tif(batchImage.isSelected()) {\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),models[i].createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), w, h, batchConvex.isSelected())); \r\n\t \t \t\t\tis.addSlice(ip.getProcessor());\r\n\t \t \t \t\t// Save a single image\r\n\t \t \t \t\tif(batchSave.isSelected()){\r\n\t \t \t \t\t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\r\n\t \t \t \t\t}\r\n\t \t \t\t}\r\n\t\t \t \tif(!batchImage.isSelected() && batchSave.isSelected()){\r\n\t\t \t \t\tSR.write(rsml[i].getName());\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),models[i].createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), batchConvex.isSelected())); \r\n\t\t \t \t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\t \t \t}\t \t \t\t\r\n\t \t \t\t\r\n\t \t \t\t// Send the results to the Result Table\r\n\t \t \t\tif(batchResults.isSelected()){\r\n\t \t \t\t\tint sel = batchJCB.getSelectedIndex();\r\n\t \t \t\t\tswitch (sel) { \r\n\t \t \t\t\t\tcase 0: models[i].sendImageData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 1: models[i].sendRootData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 2: models[i].sendNodeData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t}\r\n\t \t \t\t}\r\n\t \t \t}\r\n\t \t \r\n\t \t \tif(batchResults.isSelected()) rt.show(batchJCB.getSelectedItem().toString()+\" data\");\r\n\t \t \tif(batchImage.isSelected()){\r\n\t \t \t\tImagePlus ip = new ImagePlus(\"RSML images\");\r\n\t \t \t\tip.setStack(is);\r\n\t \t \t\tip.show();\r\n\t \t \t}\t\t\t\r\n \t}\r\n \telse{\r\n\t \tSR.write(\"Batch export started for \"+rsml.length+\" files\");\r\n\t \t \tResultsTable rt = new ResultsTable();\r\n\t \t// Open the different RSML files, retriev their data and get their size.\r\n\t \tRootModel model;\r\n\t \t \tfor(int i = 0; i < rsml.length; i++){\r\n\t \t \t\tmodel = new RootModel(rsml[i].getAbsolutePath());\r\n\t\t \t \tif(batchSave.isSelected()){\r\n\t \t \t\t\tImagePlus ip = new ImagePlus(rsml[i].getName(),model.createImage(batchColorJCB.getSelectedIndex() == 0, Integer.valueOf(batchLineWidth.getText()), batchRealWidth.isSelected(), batchConvex.isSelected())); \r\n\t\t \t \t\tIJ.save(ip, this.batchSourceFolder.getText()+\"/images/\"+rsml[i].getName()+\".jpg\");\r\n\t\t \t \t}\t \t \t\t\r\n\t \t \t\t\r\n\t \t \t\t// Send the results to the Result Table\r\n\t \t \t\tif(batchResults.isSelected()){\r\n\t \t \t\t\tint sel = batchJCB.getSelectedIndex();\r\n\t \t \t\t\tswitch (sel) { \r\n\t \t \t\t\t\tcase 0: model.sendImageData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 1: model.sendRootData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t\tcase 2: model.sendNodeData(rt, rsml[i].getName()); break;\r\n\t \t \t\t\t}\r\n\t \t \t\t}\r\n\t \t \t}\r\n \t\trt.show(batchJCB.getSelectedItem().toString());\r\n \t}\r\n \t\r\n \t \tSR.write(\"Export done for \"+rsml.length+\" files\"); \r\n }", "public boolean saveImage(String outPath){\n if (saveLocation == null || saveLocation.isEmpty()){\n System.err.println(\"ERROR: No image destination path given.\");\n return false;\n }\n\n try {\n File output = new File(outPath);\n// if (output.exists() && !overwrite){\n// System.err.println(\"ERROR: Attempting to overwritable existing file when the overwriting option is off.\");\n// return false;\n// }\n// else {\n// ImageIO.write(image, \"png\", output);\n// return true;\n// }\n ImageIO.write(image, \"png\", output);\n return true;\n }\n catch (Exception e){\n System.err.println(\"ERROR: Could not save file.\");\n return false;\n }\n }", "public void renderOutputImageManager()\n {\n if(input != null)\n {\n if(toRerender)\n {\n background(background);\n mosaic.newCanvas();\n mosaic.setPreviewCanvas();\n mosaic.drawImage();\n renderPreview();\n renderHover();\n image(infoGraphics,10,270);\n toRerender = false;\n }\n }\n else\n {\n background(background);\n image(infoGraphics,40,270);\n }\n }", "public static void saveToZip(String path) throws FileNotFoundException, IOException {\n //File and Zip Outoput Streams \n FileOutputStream fos = new FileOutputStream(path);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n //For every image, we create a temporally jpeg file\n //Then, with the createFileToZip function, we include it to the output zip file\n //Finally, we delete the jpeg image\n for (int i =0; i< imageNames.size(); i++) {\n File tempImage = new File(\"image_\"+Integer.toString(i)+\".jpg\");\n ImageIO.write(imageDict.get(imageNames.get(i)),\"jpg\",tempImage);\n createFileToZip(imageDict.get(imageNames.get(i)),\"image_\",i,zipOS);\n tempImage.delete();\n }\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "@Override\n public Stream<ImList<String>> export() {\n return map.entrySet().stream().flatMap(me -> {\n final ImList<String> key = me.getKey().export();\n return me.getValue().stream().map(cal -> key.append(cal.export()));\n });\n }", "@Test\n void writeToImage() {\n String imagename = \"img\";\n int width = 1600;\n int height = 1000;\n int nx =500;\n int ny =800;\n ImageWriter imageWriter = new ImageWriter(imagename, width, height, nx, ny);\n for (int col = 0; col < ny; col++) {\n for (int row = 0; row < nx; row++) {\n if (col % 10 == 0 || row % 10 == 0) {\n imageWriter.writePixel(row, col, Color.blue);\n }\n }\n }\n imageWriter.writeToImage();\n }", "Map<File, File> getOutputFileMap();", "public void tempSaveToFile() {\n try {\n ObjectOutputStream outputStream = new ObjectOutputStream(\n this.openFileOutput(MenuActivity2048.TEMP_SAVE_FILENAME, MODE_PRIVATE));\n outputStream.writeObject(boardManager);\n outputStream.close();\n } catch (IOException e) {\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\n }\n }", "public static void saveImage2(int[][] flat, String saveName, int width, int height){\n \n // Ask the user for the name of the output file.\n// try{\n// saveName = imageMain.console.readLine();\n// }\n// catch(IOException e){ \n// System.out.println(e);\n// System.exit(1);\n// }\n\n // If saveName does not already end in .bmp, then add .bmp to saveName.\n saveName=bmpTack(saveName);\n\n // Combine the 8-bit red, green, blue, offset values into 32-bit words.\n int[] outPixels = new int[flat.length];\n for(int j=0; j<flat.length; j++) {\n outPixels[j] = ((flat[j][0]&0xff)<<16) | ((flat[j][1]&0xff)<<8)\n | (flat[j][2]&0xff) | ((flat[j][3]&0xff)<<24);\n } // for j\n\n // Write the data out to file with the name given by string saveName.\n BMPFile bmpf = new BMPFile();\n bmpf.saveBitmap(saveName, outPixels, width, height);\n System.out.println(\"Saved \" + saveName);\n }", "public static void exportPNGFile(AlignFrame alignFrame, ActionEvent evt) {\n\t JFileChooser chooser = new JFileChooser(lastSelectedFolder);\n\t chooser.setFileFilter(new PngFileFilter());\n\t chooser.setMultiSelectionEnabled(false);\n\t chooser.setDialogTitle(\"Export PNG File Details\");\n\t chooser.requestFocusInWindow();\n\n\t File selectedFile;\n\t chooser.requestFocusInWindow();\n\t int returnVal = chooser.showSaveDialog(alignFrame);\n\n\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\n\t while (selectedFile.exists()) {\n\t int option = JOptionPane.showConfirmDialog(alignFrame,\n\t \"The file \" + chooser.getSelectedFile().getName() +\n\t \" already exists. Replace file?\",\n\t \"Replace File?\", JOptionPane.YES_NO_CANCEL_OPTION);\n\n\t if (option == JOptionPane.NO_OPTION) {\n\t chooser = new JFileChooser(lastSelectedFolder);\n\t chooser.setFileFilter(new PngFileFilter());\n\t chooser.setMultiSelectionEnabled(false);\n\t chooser.setDialogTitle(\"Export PNG File Details\");\n\n\t returnVal = chooser.showSaveDialog(alignFrame);\n\n\t if (returnVal == JFileChooser.CANCEL_OPTION) {\n\t return;\n\t } else {\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\t }\n\t } else { // YES option\n\t break;\n\t }\n\t }\n\n\t alignFrame.setCursor(new Cursor(Cursor.WAIT_CURSOR));\n\n\t try {\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\n\t if (selectedFile.exists()) {\n\t selectedFile.delete();\n\t }\n\n\t selectedFile.createNewFile();\n\t // Here comes the actual PNG file export! \n\t alignFrame.getAlignPanel().exportPNGFile(selectedFile);\n\t lastSelectedFolder = selectedFile.getPath();\n\n\t } catch (IOException ex) {\n\t JOptionPane.showMessageDialog(alignFrame,\n\t \"An error occured when exporting the PNG file.\",\n\t \"Error Exporting PNG File\",\n\t JOptionPane.ERROR_MESSAGE);\n\t ex.printStackTrace();\n\t }\n\n\t alignFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n\t }\n\t }", "public void createAlbedoMap(String filename) {\n\t\ttry {\n\t\t\t// Read in the image.\n\t\t\tBufferedImage img = new BufferedImage(I1.getRowDimension(), \n\t\t\t\t\tI1.getColumnDimension(),\n\t\t\t\t BufferedImage.TYPE_INT_RGB);\n\t\t\t\n\t\t\tdouble p[][] = this.P.getData();\n\t\t\t\n\t\t\t// Transform the image into a grayscale image.\n\t\t\tfor (int i=0; i < this.P.getRowDimension(); i++) {\n\t\t\t\tfor (int j=0; j < this.P.getColumnDimension(); j++) {\n\t\t\t\t\tint albedo = (int)(p[i][j] * 255);\n\t\t\t\t\timg.setRGB(i, j, new Color(albedo, albedo, albedo).getRGB());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tImageIO.write(img, \"png\", new File(filename));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading \" + \"yeah\");\n\t\t}\n\t}", "@Override\r\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeString(mFile.toString());\r\n\t\tdest.writeDouble(mLatitude);\r\n\t\tdest.writeDouble(mLongitude);\r\n\t}", "public void write(OutputStream dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, dest, writeAlpha);\r\n\t}", "public boolean shouldCombineTextures() {\n/* 210 */ return false;\n/* */ }", "public OutputImageManager(PImage img, Tile[] tiles, int tileSize, int pdfScale, float evenRowShift, float oddRowShift, int background)\n {\n this.mosaic = null;\n this.background = background;\n this.tiles = tiles;\n this.evenRowShift = evenRowShift;\n this.oddRowShift = oddRowShift;\n this.tileSize = tileSize;\n this.pdfScale = pdfScale;\n this.infoGraphics = loadImage(\"keys.png\");\n toRerender = true;\n }", "public void write(String dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, new FileOutputStream(dest), writeAlpha);\r\n\t}", "public boolean exportAllProjectsToZip() {\n @SuppressWarnings(\"unchecked\")\n List<PlanProperties> ppList = em.createQuery(\"select p from PlanProperties p order by p.id\").getResultList();\n\n return exportPPListToZip(ppList);\n }", "public void exportDotAndPng(String filename) throws IOException {\n // finalizeAlphabet();\n String dot = toGraphviz();\n Writer output = new BufferedWriter(new FileWriter(new File(filename)));\n try {\n output.write(dot);\n } finally {\n output.close();\n }\n GraphExporter.generatePngFileFromDotFile(filename);\n }", "@Override\r\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tdest.writeInt(Id);\r\n\t\tdest.writeString(Name);\r\n\t\tdest.writeFloat(Mark);\r\n\t\tdest.writeString(Type);\r\n\t\tdest.writeParcelable(Image, flags);\r\n\t\tdest.writeString(City);\r\n\t\tdest.writeDouble(Latitude);\r\n\t\tdest.writeDouble(Longitude);\r\n\t}", "public void saveAs() {\n MimsJFileChooser fileChooser = new MimsJFileChooser(ui);\n fileChooser.setSelectedFile(new File(ui.getLastFolder(), ui.getImageFilePrefix() + \".png\"));\n ResourceBundle localizationResources = ResourceBundleWrapper.getBundle(\"org.jfree.chart.LocalizationBundle\");\n ExtensionFileFilter filter = new ExtensionFileFilter(\n localizationResources.getString(\"PNG_Image_Files\"), \".png\");\n fileChooser.addChoosableFileFilter(filter);\n fileChooser.setFileFilter(filter);\n int option = fileChooser.showSaveDialog(chartpanel);\n if (option == MimsJFileChooser.APPROVE_OPTION) {\n String filename = fileChooser.getSelectedFile().getPath();\n if (!filename.endsWith(\".png\")) {\n filename = filename + \".png\";\n }\n try {\n ChartUtils.saveChartAsPNG(new File(filename), chartpanel.getChart(), getWidth(), getHeight());\n } catch (IOException ioe) {\n IJ.error(\"Unable to save file.\\n\\n\" + ioe.toString());\n }\n }\n }", "private void writeImage(BufferedImage image, String fileName) {\n try {\n File outputFile = new File(fileName + \".\" + FILE_EXTENSION);\n ImageIO.write(image, FILE_EXTENSION, outputFile);\n\n } catch (IOException ioexp) {\n System.err.println(\"No contact with outside world\");\n }\n }", "public void output2File(String outputName, ArrayList<Integer> source){\n this.outputContent = new StringBuilder();\n Iterator<Integer> itr = source.iterator();\n\n while(itr.hasNext()){\n this.outputContent.append((itr.next().intValue()));\n this.outputContent.append(\" \");\n }\n\n try {\n FileWriter fileWriter = new FileWriter(outputName, true);\n fileWriter.write(this.outputContent.toString());\n fileWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void writeImage(Context context, Bitmap bitmap, String filename){\n FileOutputStream fos = null;\n try {\n fos = context.openFileOutput(filename, Context.MODE_PRIVATE);\n bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n closeOutputStream(fos);\n }\n }", "private void saveComponentsToFile(String fileName) {\n\t\tFile fileToSave = new File(\"./saved/\" + fileName);\n\t\ttry {\n\t\t\tif (!fileToSave.createNewFile()) {\n\t\t\t\tDialogsUtil.showErrorMessage(\"File already exists.\");\n\t\t\t} else {\n\t\t\t\tFileWriter fileWriter = new FileWriter(\"./saved/\" + fileName);\n\n\t\t\t\tList<Component> canvasItems = Arrays.asList(CanvasPanel.getInstance().getComponents());\n\n\t\t\t\tfor (Component item : canvasItems) {\n\t\t\t\t\tTransferableItemButton designElement = (TransferableItemButton) item;\n\n\t\t\t\t\tString elementImageAddress = FileUtil.designElementsDirectory + \"\\\\\" + designElement.getName()\n\t\t\t\t\t\t\t+ FileUtil.imageExtension;\n\n\t\t\t\t\tDesignElement elementToSave = new DesignElement(designElement.getX(), designElement.getY(),\n\t\t\t\t\t\t\tdesignElement.getWidth(), designElement.getHeight());\n\t\t\t\t\telementToSave.setLayer(CanvasPanel.getLayer(designElement));\n\t\t\t\t\telementToSave.setImageAddress(elementImageAddress);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.write(elementToSave.toString() + \"\\n\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tDialogsUtil.showErrorMessage(\"Something went wrong.\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfileWriter.close();\n\t\t\t\tDialogsUtil.showMessage(\"Success!\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tDialogsUtil.showErrorMessage(\"Something went wrong.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n public void draw(INode root, Stack<Matrix4f> modelView) {\n GL3 gl = glContext.getGL().getGL3();\n gl.glEnable(GL.GL_TEXTURE_2D);\n gl.glActiveTexture(GL.GL_TEXTURE0);\n int loc = -1;\n loc = shaderLocations.getLocation(\"image\");\n if (loc >= 0) {\n gl.glUniform1i(loc, 0);\n }\n root.draw(this, modelView);\n }", "private static native boolean imwrite_0(String filename, long img_nativeObj, long params_mat_nativeObj);", "public boolean export(@NotNull String fileName)\n {\n return export(fileName, false);\n }", "public void produceOutputs() {\n\t\tgetOutputs().putIn(getInventory(),getEnchantments(), getEnchantmentOptions());\n\t}", "HashMap<String, ?> getOutputFiles();", "public void writeToParcel(Parcel parcel, int n10) {\n Object object;\n int n11;\n int n12;\n block6: {\n Object object2 = this.zalg;\n if (object2 == null) {\n Throwable throwable2222222;\n OutputStream outputStream;\n block5: {\n object2 = this.zalh;\n n12 = object2.getRowBytes();\n n11 = object2.getHeight();\n Object object3 = ByteBuffer.allocate(n12 *= n11);\n object2.copyPixelsToBuffer((Buffer)object3);\n object3 = ((ByteBuffer)object3).array();\n outputStream = this.zabz();\n object = new BufferedOutputStream(outputStream);\n outputStream = new DataOutputStream((OutputStream)object);\n n11 = ((Object)object3).length;\n ((DataOutputStream)outputStream).writeInt(n11);\n n11 = object2.getWidth();\n ((DataOutputStream)outputStream).writeInt(n11);\n n11 = object2.getHeight();\n ((DataOutputStream)outputStream).writeInt(n11);\n object2 = object2.getConfig();\n object2 = object2.toString();\n ((DataOutputStream)outputStream).writeUTF((String)object2);\n ((FilterOutputStream)outputStream).write((byte[])object3);\n {\n catch (Throwable throwable2222222) {\n break block5;\n }\n catch (IOException iOException) {}\n {\n object2 = \"Could not write into unlinked file\";\n IllegalStateException illegalStateException = new IllegalStateException((String)object2, iOException);\n throw illegalStateException;\n }\n }\n BitmapTeleporter.zaa(outputStream);\n break block6;\n }\n BitmapTeleporter.zaa(outputStream);\n throw throwable2222222;\n }\n }\n int n13 = 1;\n n12 = SafeParcelWriter.beginObjectHeader(parcel);\n n11 = this.zalf;\n SafeParcelWriter.writeInt(parcel, n13, n11);\n object = this.zalg;\n SafeParcelWriter.writeParcelable(parcel, 2, (Parcelable)object, n10 |= n13, false);\n n13 = this.mType;\n SafeParcelWriter.writeInt(parcel, 3, n13);\n SafeParcelWriter.finishObjectHeader(parcel, n12);\n this.zalg = null;\n }", "public void write(File path) throws IOException{\n\t\tif(this.picture != null){ // in cazul in care poza are continut null se arunca exceptie\n\t\t\t//File output = new File(path);\n\t\t\tImageIO.write(zoomed,\"bmp\",path);\n\t\t\tSystem.out.println(path);\n\t\t\tSystem.out.println(\"\\nS-a scris in fisier cu succes\");\n\t\t}\n\t}", "public interface OutputFile extends VariantOutput {\n\n /**\n * Returns the output file for this artifact's output.\n * Depending on whether the project is an app or a library project, this could be an apk or\n * an aar file. If this {@link com.android.build.OutputFile} has filters, this is a split\n * APK.\n *\n * For test artifact for a library project, this would also be an apk.\n *\n * @return the output file.\n */\n @NonNull\n File getOutputFile();\n}", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public boolean saveMap()\n {\n // This should probably write all the data to a temporary file, then copy it over the old one at the end\n try {\n \n StringBuffer\t\tbuf = new StringBuffer();\n FileWriter\t\t\tmapWriter;\n \n if (!file.canWrite())\n {\n ErrorHandler.displayError(\"Could not write to map file. Maybe it's locked.\", ErrorHandler.ERR_SAVE_FAIL);\n return false;\n }\n \n file.createNewFile();\n mapWriter = new FileWriter(file);\n \n // Write the size in x, y\n buf.append(map.getSizeX());\n buf.append(\" \");\n buf.append(map.getSizeY());\n buf.append(\"\\n\");\n \n // Write all of the data\n for (int y = 0; y < map.getSizeY(); y++)\n {\n for (int x = 0; x < map.getSizeX(); x++)\n {\n buf.append(MUXHex.terrainForId(map.getHexTerrain(x, y)));\n buf.append(map.getHexAbsoluteElevation(x, y));\n }\n \n buf.append(\"\\n\");\n }\n \n // Now write it to the file\n mapWriter.write(buf.toString());\n mapWriter.close();\n \n // Musta been okay...\n map.setChanged(false);\n \n // Change our name\n setTitle(file.getName() + sizeString());\n \n return true;\n \n } catch (Exception e) {\n ErrorHandler.displayError(\"Could not write data to map file:\\n\" + e, ErrorHandler.ERR_SAVE_FAIL);\n return false;\n }\n }", "private void actionExportImageColoredCells ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t{\r\n\t\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\t\tFileNameExtensionFilter fileTypeBMP = new FileNameExtensionFilter(\"BMP\", \"bmp\", \"BMP\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeBMP);\t \r\n\t\t\t\t\tFileNameExtensionFilter fileTypeJPG = new FileNameExtensionFilter(\"JPEG\", \"jpg\", \"jpeg\", \"JPG\", \"JPEG\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeJPG);\r\n\r\n\t\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\t\tsaveFileChooser.setFileFilter(fileTypeBMP);\r\n\r\n\t\t\t\t\tint isSelectedFile = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\t\tif (isSelectedFile == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString outputFilePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(fileTypeBMP)) { outputFilePath += \".bmp\"; }\r\n\t\t\t\t\t\telse if (saveFileChooser.getFileFilter().equals(fileTypeJPG)) { outputFilePath += \".jpg\"; }\r\n\r\n\t\t\t\t\t\tOutputController.exportImageColoredCells(outputFilePath, DataController.getTable().getElement(indexImage));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "public int toGL( GL gl, GLU glu, boolean mipmap ) {\n\t\t\t// Generate the texture ID\n\t\t\tint[] temp = new int[1];\n\t\t\tint name;\n\t\t\tgl.glGenTextures(1, temp, 0);\n\t\t\tname = temp[0];\n\t\t\t\n\t\t\tgl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);\n\t\t\t\n\t\t\t// Bind the texture\n\t\t\tgl.glBindTexture( GL.GL_TEXTURE_2D, name );\n\n\t\t\t// Build Mipmaps \n\t\t\tif( mipmap ) {\n\t\t\t\tswitch(this.type) {\n\t\t\t\tcase TEXTURE_3BYTE_RGB:\n\t\t\t\t\tglu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\tGL.GL_RGB8, \n\t\t\t\t\t\t\tthis.width, this.height, \n\t\t\t\t\t\t\tGL.GL_RGB,\n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t \n\t\t\t\tcase TEXTURE_4BYTE_RGBA:\n\t\t\t\t\tglu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\tGL.GL_RGBA, \n\t\t\t\t\t\t\tthis.width, this.height, \n\t\t\t\t\t\t\tGL.GL_RGBA, \n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException(\"Unknown texture type: \" + this.type);\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t// Assign the mip map levels and texture info\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR );\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, \n\t\t\t\t GL.GL_LINEAR_MIPMAP_NEAREST);\n\t\t\t\tgl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);\n\t\t\t} else {\n\t\t\t\tswitch(this.type) {\n\t\t\t\tcase TEXTURE_3BYTE_RGB:\n\t\t\t\t\tgl.glTexImage2D(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\t0, GL.GL_RGB, \n\t\t\t\t\t\t\tthis.width, this.height, 0,\n\t\t\t\t\t\t\tGL.GL_RGB, \n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t \n\t\t\t\tcase TEXTURE_4BYTE_RGBA:\n\t\t\t\t\tgl.glTexImage2D(GL.GL_TEXTURE_2D,\n\t\t\t\t\t\t\t0, GL.GL_RGBA,\n\t\t\t\t\t\t\tthis.width, this.height, 0,\n\t\t\t\t\t\t\tGL.GL_RGBA,\n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE,\n\t\t\t\t\t\t\tthis.pixels \n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException(\"Unknown texture type: \" + this.type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Assign the mip map levels and texture info\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR );\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, \n\t\t\t\t GL.GL_LINEAR);\n\t\t\t\tgl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);\n\t\t\t}\n\t\t\t\n\t\t\treturn name;\n\t\t}", "private static void exportResource(String resourcePathName, File outFolder) throws Exception {\n InputStream stream = null;\n try {\n // note that each / is a directory down in the \"jar tree\" been the jar the root of the\n // tree\n stream = DeployManagementModuleFlow.class.getResourceAsStream(resourcePathName);\n if (stream == null) {\n throw new Exception(\"Cannot get resource \\\"\" + resourcePathName\n + \"\\\" from Jar file.\");\n }\n File outFile = new File(outFolder, new File(resourcePathName).getName());\n outFile.getParentFile().mkdirs();\n Files.copy(stream, outFile.toPath());\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n }", "public void writeToFile(String mapName, int tRemains, int oRemains) {\r\n\t\ttry {\r\n\t\t\tFileWriter fstream = new FileWriter(mapName);\r\n\t\t\tBufferedWriter out = new BufferedWriter(fstream);\r\n\t\t\tout.write(\"\" + tRemains + \" \" + oRemains);\r\n\t\t\tout.newLine();\r\n\t\t\tfor (int i = 0; i < drawList.size(); i++) {\r\n\t\t\t\tImage im = drawList.get(i);\r\n\t\t\t\tint w = im.getWidth(null) / 2;\r\n\t\t\t\tint h = im.getHeight(null) / 2;\r\n\t\t\t\tout.write(savingList.get(i) + \" \" + (drawXList.get(i) + w)\r\n\t\t\t\t\t\t+ \" \" + (drawYList.get(i) + h));\r\n\t\t\t\tout.newLine();\r\n\t\t\t}\r\n\t\t\tout.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t}\r\n\r\n\t}", "private void exportFiles()\n\t{\n\t\tloading.setVisibility(View.VISIBLE);\n\t\t\n\t\t// Report String\n\t\t//----------------\n\t\tString reportString = \"Date,Location Latitude, Location Longitude,Vehicle,Description\\n\";\t\n\t\t\n\t\tStringBuilder reportBuilder = new StringBuilder();\n\t\treportBuilder.append(reportString);\n\t\t\n\t\tString objectString = \"\"+ \n\t\t\t\tincident.getDate()+\",\" +\n\t\t\t\tincident.getLatitude() + \",\" +\n\t\t\t\tincident.getLongitude()+\",\" +\n\t\t\t\tincident.getVehicleReg()+\",\" +\n\t\t\t\tincident.getDescription()+\",\" + \"\\n\";\n\t\t\n\t\treportBuilder.append(objectString);\n\t\t\n\t\t// Witnesses String\n\t\t//----------------\n\t\tString witnessString = \"witnessName,witnessEmail,witnessNumber,witnessStatement\\n\";\n\t\t\n\t\tStringBuilder witnessesBuilder = new StringBuilder();\n\t\twitnessesBuilder.append(witnessString);\n\t\t\n\t\tfor(int i=0; i<incident.getWitnesses().size(); i++)\n\t\t{\n\t\t\tobjectString = \"\"+ \n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessName\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessEmail\") + \",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessNumber\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessStatement\")+\",\" + \"\\n\";\n\t\t\t\n\t\t\twitnessesBuilder.append(objectString);\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Create file\n\t\t//===========================================\n\t\t// Incident Report\n\t\t//-------------------------------------------------\n\t\tfinal File reportFile = new File(getFilesDir() + \"/\" + \"incident_report.csv\");\n\t\treportFile.setReadable(true,false);\n\t\t\n\t\tif( reportFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"incident_report.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(reportBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Witnesses file\n\t\t//-------------------------------------------------\n\t\tfinal File witnessesFile = new File(getFilesDir() + \"/\" + \"witnesses.csv\");\n\t\twitnessesFile.setReadable(true,false);\n\t\t\n\t\tif( witnessesFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"witnesses.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(witnessesBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Media files\n\t\t//-------------------------------------------------\t\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCIncident\");\n\t\tquery.getInBackground(incident.getId(),new GetCallback<ParseObject>() \n\t\t{\n\t\t\t@Override\n\t\t\tpublic void done(final ParseObject parseIncident, ParseException e) \n\t\t\t{\n\t\t\t\tif(e == null)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// Get number of photos attached\n\t\t\t\t\tParseQuery<ParseObject> queryPhotos = parseIncident.getRelation(\"incidentPhotos\").getQuery();\n\t\t\t\t\tqueryPhotos.findInBackground(new FindCallback<ParseObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void done(List<ParseObject> parsePhotos, ParseException e) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tArrayList<byte[]> bytes = new ArrayList<byte[]>();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int i=0; i<parsePhotos.size(); i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\t\t\tParseFile photo = (ParseFile) parsePhotos.get(i).get(\"photoFile\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tbytes.add(photo.getData());\n\t\t\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tphotoFiles = AssetsUtilities.saveIncidentPhoto(ReviewReportActivity.this, bytes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Video\n\t\t\t\t\t\t\tParseFile parseVideo = (ParseFile) parseIncident.get(\"incidentVideo\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(parseVideo != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparseVideo.getDataInBackground(new GetDataCallback()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void done(byte[] data, ParseException e) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(e == null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Save file\n\t\t\t\t\t\t\t\t\t\t\tvideoFile = AssetsUtilities.saveIncidentVideo(ReviewReportActivity.this,data);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public FileExporter(DataModel dataModel) {\r\n\t\tthis.dataModel = dataModel;\r\n\t\tthis.idList1 = dataModel.getKeys1();\r\n\t\tthis.idList2 = dataModel.getKeys2();\r\n\t\tthis.outAtts = new HashSet<String>();\r\n\t}", "@Override\r\n\tpublic void exportShape()\r\n\t{\r\n\t\tMWC.Utilities.ReaderWriter.ImportManager\r\n\t\t\t\t.exportThis(\";;Layer: \" + getName());\r\n\r\n\t\tEditable pl = this;\r\n\t\tif (pl instanceof Exportable)\r\n\t\t{\r\n\t\t\tExportable e = (Exportable) pl;\r\n\t\t\te.exportThis();\r\n\t\t}\r\n\t}", "public void saveBitmapAsPng(Bitmap bitmap, String fileName) {\n\t\tFileOutputStream out = null;\n\t\ttry {\n\t\t\tout = new FileOutputStream(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).toString(), fileName));\n\t\t\tbitmap.compress(Bitmap.CompressFormat.PNG, 90, out);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (out != null) {\n\t\t\t\ttry {\n\t\t\t\t\tout.flush();\n\t\t\t\t\tout.close();\n\t\t\t\t} catch (Exception e) {}\n\t\t\t}\n\t\t}\n\t}", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "public void save() throws ModuleJarException {\n try {\n logger.debug(\"Saving Module JAR \" + filename);\n \n byte[] icon16 = module.getIcon16();\n byte[] icon32 = module.getIcon32();\n \n icon16 = icon16 == null ? Utilities.getBytes(IconLibrary._icoIcon16.getImage(), DcImageIcon._TYPE_PNG) : icon16;\n icon32 = icon32 == null ? Utilities.getBytes(IconLibrary._icoIcon32.getImage(), DcImageIcon._TYPE_PNG) : icon32;\n\n net.datacrow.util.zip.ZipFile zf = new net.datacrow.util.zip.ZipFile(DataCrow.moduleDir, filename);\n \n module.setIcon16Filename(\"icon16.png\");\n module.setIcon32Filename(\"icon32.png\");\n \n XmlModuleWriter writer = new XmlModuleWriter(module);\n byte[] xml = writer.getXML();\n \n writer.close();\n \n zf.addEntry(\"module.xml\", xml);\n zf.addEntry(\"icon16.png\", icon16);\n zf.addEntry(\"icon32.png\", icon32);\n zf.close();\n\n } catch (Exception exp) {\n throw new ModuleJarException(exp);\n }\n }", "public void toFile(String filename) {\n\t\tsortPool();\n\t\ttry (BufferedWriter bw = new BufferedWriter(new FileWriter(filename))) {\n\t\t\tfor(int i = 0; i < genepool.size(); i++) {\n\t\t\t\tbw.write(genepool.get(i).toWrite());\n\t\t\t\tbw.newLine();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void imagesaver(String name){\n\tthis.new_image_name = name;\n\t try{\n\t\tImageIO.write(new_buff_image, \"png\", new File(new_image_name));\n\t }\n\t catch(IOException e){\n\t\tSystem.out.println(\"The desired output file is invalid. Please try running the program again.\");\n\t\tSystem.exit(0);\n\t }\n }", "public void render(String filename) throws FileNotFoundException {\r\n int pix_h, pix_w;\r\n pix_h = (int) window.getPix_h();\r\n pix_w = (int) window.getPix_w();\r\n \r\n Pixel[][] grid = new Pixel[pix_h][pix_w];\r\n \r\n for(int i = 0; i < pix_h; i++) {\r\n for(int j = 0; j < pix_w; j++) {\r\n \r\n Point p = window.getDelta_h().const_mult(j).vec_add(window.getDelta_w().const_mult(i)).point_add(window.getUl());\r\n Vec d = p.point_sub(window.getEye()).normalize();\r\n Ray r = new Ray(d, window.getEye());\r\n Color c = ray_trace(r);\r\n \r\n grid[i][j] = new Pixel(p, c);\r\n }\r\n }\r\n \r\n try(\r\n PrintWriter toFile = new PrintWriter(filename);\r\n ){\r\n toFile.println(\"P3\");\r\n toFile.println(pix_w + \" \" + pix_h);\r\n toFile.println(255);\r\n \r\n for(int i = 0; i < pix_h; i++) {\r\n int k = 0;\r\n for(int j = 0; j < pix_w; j++) {\r\n if(k>10) {\r\n toFile.println();\r\n k = 0;\r\n }\r\n toFile.print(\r\n (int) Math.ceil(grid[i][j].getColor().getR()*255) + \" \" +\r\n (int) Math.ceil(grid[i][j].getColor().getG()*255) + \" \" +\r\n (int) Math.ceil(grid[i][j].getColor().getB()*255) + \" \");\r\n k++;\r\n }\r\n \r\n }\r\n \r\n }\r\n \r\n }", "private void toFile(OutputData data) {\n if(data == null) {\r\n JOptionPane.showMessageDialog(this, \"Dane wynikowe nie zostały jeszcze umieszczone w pamieci\");\r\n return;\r\n }\r\n\r\n // Sprawdzenie sciezki zapisu\r\n String filePath = this.outputFileSelector.getPath();\r\n if(filePath.length() <= 5) {\r\n JOptionPane.showMessageDialog(this, \"Nie można zapisać wyniku w wybranej lokacji!\");\r\n return;\r\n }\r\n\r\n // Zapisujemy plik na dysk\r\n try{\r\n PrintWriter writer = new PrintWriter(filePath, \"UTF-8\");\r\n OutputDataFormatter odf = new OutputDataFormatter(this.outputData);\r\n\r\n String userPattern = this.outputFormatPanel.getPattern();\r\n writer.write(odf.getParsedString(userPattern.length() < 2 ? defaultFormatting : userPattern));\r\n\r\n writer.close();\r\n } catch (IOException e) {\r\n JOptionPane.showMessageDialog(this, \"Wystąpił błąd IO podczas zapisu.\");\r\n }\r\n\r\n }", "private void writeMapFile(\r\n\t\t\tGDMSMain theMainHomePage,\r\n\t\t\tArrayList listOfAllMapInfo) throws GDMSException {\n\t\tString strFlapjackMapFile = \"Flapjack\";\r\n\t\tFile baseDirectory = theMainHomePage.getMainWindow().getApplication().getContext().getBaseDirectory();\r\n\t\tFile absoluteFile = baseDirectory.getAbsoluteFile();\r\n\r\n\t\tFile[] listFiles = absoluteFile.listFiles();\r\n\t\tFile fileExport = baseDirectory;\r\n\t\tfor (File file : listFiles) {\r\n\t\t\tif(file.getAbsolutePath().endsWith(\"Flapjack\")) {\r\n\t\t\t\tfileExport = file;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tString strFilePath = fileExport.getAbsolutePath();\r\n\t\tgeneratedMapFile = new File(strFilePath + \"\\\\\" + strFlapjackMapFile + \".map\");\r\n\t\t\r\n\t\t/**\twriting tab delimited .map file for FlapJack \r\n\t\t * \tconsisting of marker chromosome & position\r\n\t\t * \r\n\t\t * **/\r\n\t\t//System.out.println(\"............:\"+listOfAllMapInfo);\r\n\t\ttry {\r\n\t\t\tFileWriter flapjackMapFileWriter = new FileWriter(generatedMapFile);\r\n\t\t\tBufferedWriter flapjackBufferedWriter = new BufferedWriter(flapjackMapFileWriter);\r\n\t\t\t//flapjackBufferedWriter.write(\"\\n\");\r\n\t\t\t//flapjackBufferedWriter.write(\"Marker-Name\\tLinkage-Group\\tStarting-Position\\n\");\r\n\t\t\t\r\n\t\t\tfor (int m=0; m<listOfAllMapInfo.size();m++){\r\n\t\t\t\tString[] MapInfo=listOfAllMapInfo.get(m).toString().split(\"!~!\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tflapjackBufferedWriter.write(MapInfo[0]);\r\n\t\t\t\tflapjackBufferedWriter.write(\"\\t\");\r\n\t\t\t\tflapjackBufferedWriter.write(MapInfo[1]);\r\n\t\t\t\tflapjackBufferedWriter.write(\"\\t\");\r\n\t\t\t\tflapjackBufferedWriter.write(MapInfo[2]);\r\n\t\t\t\tflapjackBufferedWriter.write(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tflapjackBufferedWriter.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new GDMSException(e.getMessage());\r\n\t\t}\r\n\t}" ]
[ "0.58813405", "0.5793027", "0.5637652", "0.5616936", "0.5611436", "0.5512046", "0.5452124", "0.5311157", "0.529988", "0.5262108", "0.5194467", "0.5093886", "0.5024297", "0.49196684", "0.49087116", "0.48885575", "0.4846917", "0.483618", "0.48271242", "0.48071367", "0.48035467", "0.4766362", "0.47489545", "0.47450927", "0.47108743", "0.47053242", "0.468167", "0.46748996", "0.46739691", "0.46650833", "0.46584007", "0.46579385", "0.46556333", "0.4644702", "0.46347627", "0.4629153", "0.46263975", "0.46193224", "0.4611422", "0.46019796", "0.46001866", "0.45994112", "0.45980525", "0.45895752", "0.45895752", "0.45869064", "0.4579344", "0.45686927", "0.4546534", "0.45456147", "0.45363253", "0.45335573", "0.4521804", "0.45083383", "0.4494198", "0.44821104", "0.4475556", "0.44624788", "0.44598904", "0.44546455", "0.44476965", "0.444263", "0.44225165", "0.44191954", "0.44156435", "0.43825886", "0.43705845", "0.43700612", "0.4364837", "0.43622282", "0.4357115", "0.4349351", "0.43487412", "0.43480644", "0.43431106", "0.4340277", "0.43394202", "0.4338399", "0.43359932", "0.43347582", "0.43311477", "0.4327821", "0.43217486", "0.43175688", "0.43166354", "0.43141255", "0.43096343", "0.43070883", "0.43059084", "0.43012577", "0.42996708", "0.42983568", "0.42978153", "0.42884165", "0.4287903", "0.42830107", "0.4277765", "0.42638293", "0.42423514", "0.4241007" ]
0.64424086
0
Exports this image to file.
public boolean export(@NotNull String fileName) { return export(fileName, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeToImage() {\n imageWriter.writeToImage();\n }", "public void writeToImage() {\r\n\t\t_imageWriter.writeToImage();\r\n\t}", "@FXML public void saveToFile()throws java.io.IOException {\n Highgui.imwrite( this.originalImagePath, this.image );\n System.out.println(\"Saving\");\n }", "void saveAs() {\n writeFile.Export();\n }", "private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }", "public void writeImage() {\n // Write generated image to a file\n try {\n // Save as JPEG\n File file = new File(\"Images/\" + name + \"INS\" + System.currentTimeMillis() + \".jpg\");\n ImageIO.write(bufferedImage, \"jpg\", file);\n\t\t\t\t\n\n } catch (IOException e) {\n }\n }", "@FXML\n public void onExportButtonClick() throws MatrixSizeException {\n FileChooser fileChooser = new FileChooser();\n fileChooser.setTitle(\"Save As\");\n fileChooser.getExtensionFilters().addAll(\n\t\t\t\tnew FileChooser.ExtensionFilter(\"PNG File\", \"*.png\"),\n new FileChooser.ExtensionFilter(\"JPG File\", \"*.jpg\"),\n new FileChooser.ExtensionFilter(\"JPEG File\", \"*.jpeg\")\n\t\t);\n\n // The directory the user chooses to save the file\n File file = fileChooser.showSaveDialog(root.getScene().getWindow());\n\n // Saves the image in the output directory\n if(file != null) {\n System.out.println(file.getAbsolutePath());\n\n BufferedImage bImage = SwingFXUtils.fromFXImage(Main.getRectifiedImage().getImage(), null);\n try {\n ImageIO.write(bImage, \"png\", file);\n }\n catch (IOException e) {\n Logger.getLogger(RectifierGUIController.class.getName()).log(Level.SEVERE, null, e);\n }\n }\n }", "public void writeToFile() {\n\t\ttry {\n\t\t\tFileOutputStream file = new FileOutputStream(pathName);\n\t\t\tObjectOutputStream output = new ObjectOutputStream(file);\n\n\t\t\tMap<String, HashSet<String>> toSerialize = tagToImg;\n\t\t\toutput.writeObject(toSerialize);\n\t\t\toutput.close();\n\t\t\tfile.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void saveAs() {\n MimsJFileChooser fileChooser = new MimsJFileChooser(ui);\n fileChooser.setSelectedFile(new File(ui.getLastFolder(), ui.getImageFilePrefix() + \".png\"));\n ResourceBundle localizationResources = ResourceBundleWrapper.getBundle(\"org.jfree.chart.LocalizationBundle\");\n ExtensionFileFilter filter = new ExtensionFileFilter(\n localizationResources.getString(\"PNG_Image_Files\"), \".png\");\n fileChooser.addChoosableFileFilter(filter);\n fileChooser.setFileFilter(filter);\n int option = fileChooser.showSaveDialog(chartpanel);\n if (option == MimsJFileChooser.APPROVE_OPTION) {\n String filename = fileChooser.getSelectedFile().getPath();\n if (!filename.endsWith(\".png\")) {\n filename = filename + \".png\";\n }\n try {\n ChartUtils.saveChartAsPNG(new File(filename), chartpanel.getChart(), getWidth(), getHeight());\n } catch (IOException ioe) {\n IJ.error(\"Unable to save file.\\n\\n\" + ioe.toString());\n }\n }\n }", "public void exportPuzzle () {\r\n fileManager.exportPuzzle (puzzle);\r\n }", "@Override\n public void save() {\n graphicsEnvironmentImpl.save(canvas);\n }", "private void saveFile() {\r\n\t\tFile file = new File(this.picture.getFileName());\r\n\r\n\t\ttry {\r\n\t\t\tImageIO.write(this.picture.getBufferedImage(),\r\n\t\t\t\t\tthis.picture.getExtension(), file);\r\n\t\t} catch (IOException e) {\r\n\t\t\tJOptionPane.showMessageDialog(this.pictureFrame,\r\n\t\t\t\t \"Could not save file.\",\r\n\t\t\t\t \"Save Error\",\r\n\t\t\t\t JOptionPane.WARNING_MESSAGE);\r\n\t\t}\r\n\r\n\t}", "@Override\n public String exportImage() throws IllegalArgumentException {\n BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n for (int x = 0; x < this.width; x++) {\n for (int y = 0; y < this.height; y++) {\n int r = this.pixels[x][y][0];\n int g = this.pixels[x][y][1];\n int b = this.pixels[x][y][2];\n int color = (r << 16) | (g << 8) | b;\n img.setRGB(x, y, color);\n }\n }\n return exportHelp(img);\n }", "private void exportGraphic(ExportableGraphic p_exportable)\r\n {\r\n // Create a few simple file filters.\r\n SimpleFileFilter[] filters = new SimpleFileFilter[] {\r\n new SimpleFileFilter(\"png\", \"Portable Network Graphics (*.png)\"),\r\n new SimpleFileFilter(\"jpg\", \"JPEG file (*.jpg)\")\r\n };\r\n\r\n // Save the file.\r\n String filePath = openFileChooser(false, filters);\r\n \r\n // Process the file\r\n if(filePath != null)\r\n {\r\n // Get the file the user selected.\r\n File selectedFile = new File(filePath);\r\n \r\n // Determine the file type.\r\n String fileType = IOLib.getExtension(selectedFile);\r\n if (fileType == null)\r\n {\r\n fileType = ((SimpleFileFilter) m_fc.getFileFilter()).getExtension();\r\n selectedFile = new File(selectedFile.toString() + \".\" + fileType);\r\n }\r\n \r\n // If the file already exists the user has to confirm that it may be \r\n // replaced by the new export.\r\n boolean doExport = true;\r\n if (selectedFile.exists())\r\n {\r\n int response = JOptionPane.showConfirmDialog(m_frame, \"The file \\\"\" + selectedFile.getName() + \"\\\" already exists.\\nDo you want to replace it?\", \"Confirm Save\", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);\r\n if (response == JOptionPane.NO_OPTION) doExport = false;\r\n }\r\n \r\n // Do the export.\r\n if (doExport) p_exportable.export(selectedFile, fileType);\r\n }\r\n }", "public static void exportPNGFile(AlignFrame alignFrame, ActionEvent evt) {\n\t JFileChooser chooser = new JFileChooser(lastSelectedFolder);\n\t chooser.setFileFilter(new PngFileFilter());\n\t chooser.setMultiSelectionEnabled(false);\n\t chooser.setDialogTitle(\"Export PNG File Details\");\n\t chooser.requestFocusInWindow();\n\n\t File selectedFile;\n\t chooser.requestFocusInWindow();\n\t int returnVal = chooser.showSaveDialog(alignFrame);\n\n\t if (returnVal == JFileChooser.APPROVE_OPTION) {\n\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\n\t while (selectedFile.exists()) {\n\t int option = JOptionPane.showConfirmDialog(alignFrame,\n\t \"The file \" + chooser.getSelectedFile().getName() +\n\t \" already exists. Replace file?\",\n\t \"Replace File?\", JOptionPane.YES_NO_CANCEL_OPTION);\n\n\t if (option == JOptionPane.NO_OPTION) {\n\t chooser = new JFileChooser(lastSelectedFolder);\n\t chooser.setFileFilter(new PngFileFilter());\n\t chooser.setMultiSelectionEnabled(false);\n\t chooser.setDialogTitle(\"Export PNG File Details\");\n\n\t returnVal = chooser.showSaveDialog(alignFrame);\n\n\t if (returnVal == JFileChooser.CANCEL_OPTION) {\n\t return;\n\t } else {\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\t }\n\t } else { // YES option\n\t break;\n\t }\n\t }\n\n\t alignFrame.setCursor(new Cursor(Cursor.WAIT_CURSOR));\n\n\t try {\n\t selectedFile = chooser.getSelectedFile();\n\n\t if (!selectedFile.getName().toLowerCase().endsWith(\".png\")) {\n\t selectedFile = new File(selectedFile.getAbsolutePath() + \".png\");\n\t }\n\n\t if (selectedFile.exists()) {\n\t selectedFile.delete();\n\t }\n\n\t selectedFile.createNewFile();\n\t // Here comes the actual PNG file export! \n\t alignFrame.getAlignPanel().exportPNGFile(selectedFile);\n\t lastSelectedFolder = selectedFile.getPath();\n\n\t } catch (IOException ex) {\n\t JOptionPane.showMessageDialog(alignFrame,\n\t \"An error occured when exporting the PNG file.\",\n\t \"Error Exporting PNG File\",\n\t JOptionPane.ERROR_MESSAGE);\n\t ex.printStackTrace();\n\t }\n\n\t alignFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));\n\t }\n\t }", "public Action getSaveImageAction() {\n return new AbstractAction(\"Save Image\") {\n private static final long serialVersionUID = 1943785041287184839L;\n\n public void actionPerformed(ActionEvent e) {\n mGraphSaver.getGraphicsRenderer().setRendererConfig(mGraphicsRenderer);\n if (mPlainSave) {\n // Explicitly remove the background gradient / shadow to save \"plain\" images.\n mGraphSaver.getGraphicsRenderer().setGraphBGColor(null, null);\n mGraphSaver.getGraphicsRenderer().setGraphShadowWidth(0);\n }\n mGraphSaver.saveGraph(getGraph());\n }\n };\n }", "static public void write(String filename, Image image) throws IOException\n {\n MyBMPFile reader = new MyBMPFile();\n \n reader.saveBitmap(filename, image, image.getWidth(reader), image.getHeight(reader));\n }", "public void write(String filename) throws IOException {\n \t\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t \tos = new FileOutputStream(new File(\"./OutputImage.txt\"));\n\t\t\tString header = (\"P6\\n\" + width + \"\\n\" + height + \"\\n255\\n\")//.getBytes() missing for converting the string into bytes;\n\t\t\t// For P6 there is no \\n after each spec. Use: new (\"P6 \"+width+\" \"+h+\" 255\\n\").getBytes())\n\t\t\tos.write(header);\n\t\t\tos.write(data);\n\t\t} catch (IOException e) {\n\t\t \t e.printStackTrace();\n\t\t}finally{\n\t\t try {\n\t\t\tos.close();\n\t\t } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t \t}\n \t}\n \n\n}", "public void write(File dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, new FileOutputStream(dest), writeAlpha);\r\n\t}", "void save(Images image);", "void takeSnapShot(File fileToSave) {\n try {\n /*Construct a new BufferedImage*/\n BufferedImage exportImage = new BufferedImage(this.getSize().width,\n this.getSize().height,\n BufferedImage.TYPE_INT_RGB);\n\n \n /*Get the graphics from JPanel, use paint()*/\n this.paint(exportImage.createGraphics());\n \n fileToSave.createNewFile();\n ImageIO.write(exportImage, \"PNG\", fileToSave);\n } catch(Exception exe){\n System.out.println(\"DrawCanvas.java - Exception\");\n }//catch\n}", "public void exportMedia(){\r\n \r\n }", "private final void exportAll() {\n\t\tfinal JFileChooser chooser = new JFileChooser(System.getProperty(\"user.home\"));\n\t\tint returnVal = chooser.showSaveDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = chooser.getSelectedFile();\n\t\t\tserializeToFile(file);\n\t }\t\n\t}", "private void actionExportImageSampleArea ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t{\r\n\t\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\t\tFileNameExtensionFilter fileTypeBMP = new FileNameExtensionFilter(\"BMP\", \"bmp\", \"BMP\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeBMP);\t \r\n\t\t\t\t\tFileNameExtensionFilter fileTypeJPG = new FileNameExtensionFilter(\"JPEG\", \"jpg\", \"jpeg\", \"JPG\", \"JPEG\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeJPG);\r\n\r\n\t\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\t\tsaveFileChooser.setFileFilter(fileTypeBMP);\r\n\r\n\t\t\t\t\tint isSelectedFile = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\t\tif (isSelectedFile == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString outputFilePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(fileTypeBMP)) { outputFilePath += \".bmp\"; }\r\n\t\t\t\t\t\telse if (saveFileChooser.getFileFilter().equals(fileTypeJPG)) { outputFilePath += \".jpg\"; }\r\n\r\n\t\t\t\t\t\tOutputController.exportImageSampleArea(outputFilePath, DataController.getTable().getElement(indexImage));\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void exportar(ActionEvent actionEvent) {\n\t\t\r\n\t}", "static public void saveAs(BufferedImage img, String name) {\n\t\ttry {\n\t\t\tString type = name.substring(name.length()-3);\n\t\t\tImageIO.write(img, type, new File(name));\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void toFile() throws IOException {\n toFile(null);\n }", "public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public abstract void saveToFile(PrintWriter out);", "public void save(File f, int posX, int posY) throws IOException {\n\t\tGraphics g = internalImage.createGraphics();\n\t\tImageIO.write(internalImage, \"jpg\", f);\n\n\t}", "public static void savePngImageFile(Image im, File fImage) throws IOException {\r\n if (im instanceof RenderedImage) {\r\n ImageIO.write((RenderedImage) im, \"png\", fImage);\r\n } else {\r\n BufferedImage bim = new BufferedImage(im.getWidth(null), im.getHeight(null), BufferedImage.TYPE_INT_RGB);\r\n Graphics g = bim.getGraphics();\r\n g.drawImage(im, 0, 0, null);\r\n bim.flush();\r\n ImageIO.write(bim, \"png\", fImage);\r\n }\r\n }", "public void saveAsset() throws IOException {\n file.saveAsset();\n }", "@FXML\r\n void btnSave(ActionEvent event) throws IOException {\r\n \tdos.writeInt(server.ServerConstants.DRAW_SAVE);\r\n \tString fileName = \"D://image/snapshot\" + new Date().getTime() + \".png\";\r\n \tFile file = new File(fileName);\r\n \tWritableImage writableImage = new WritableImage(768, 431);\r\n canvas.snapshot(null, writableImage);\r\n RenderedImage renderedImage = SwingFXUtils.fromFXImage(writableImage, null);\r\n ImageIO.write(renderedImage, \"png\", file);\r\n \r\n OutputStream outputStream = client.getOutputStream();\r\n FileInputStream fileInputStream = new FileInputStream(file);\r\n byte[] buf = new byte[1024];\r\n int length = 0;\r\n while((length = fileInputStream.read(buf))!=-1){\r\n \toutputStream.write(buf);\r\n }\r\n fileInputStream.close();\r\n }", "public void Save( String saveImgAs )\n {\n saveImage(image, saveImgAs); \n }", "public void saveScreenshot() {\n if (ensureSDCardAccess()) {\n Bitmap bitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n doDraw(1, canvas);\n File file = new File(mScreenshotPath + \"/\" + System.currentTimeMillis() + \".jpg\");\n FileOutputStream fos;\n try {\n fos = new FileOutputStream(file);\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);\n fos.close();\n } catch (FileNotFoundException e) {\n Log.e(\"Panel\", \"FileNotFoundException\", e);\n } catch (IOException e) {\n Log.e(\"Panel\", \"IOEception\", e);\n }\n }\n }", "static void write(Image image, String filename) {\n try {\n image.write(filename);\n System.out.println(\"Wrote image: \" + filename);\n } catch (IOException err) {\n System.out.printf(\"Something went wrong writing: %n\", filename, err);\n }\n }", "public void save(String name) throws IOException {\n\t\tFile outputfile = new File(name+\".jpg\");\n\t\tImageIO.write(this.img, \"jpg\", outputfile);\n\t}", "public FileData export() {\n\t\ttry(Workbook workbook = createWorkbook();\n\t\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();) {\n\t\t\tsheet = workbook.createSheet();\n\t\t\tcreateRows();\n\t\t\tworkbook.write(outputStream);\n\t\t\treturn getExportedFileData(outputStream.toByteArray());\n\t\t} catch (IOException ex) {\n\t\t\tthrow new RuntimeException(\"error while exporting file\",ex);\n\t\t}\n\t}", "private void actionSaveOutput ()\r\n\t{\r\n\t\ttry\r\n\t\t{\t\t\t\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t{\r\n\t\t\t\t\tString filePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\t\t/*!*/DebugLogger.logMessage(\"Saving output of a single image \" + indexImage + \" to file \" + filePath, LOG_MESSAGE_TYPE.INFO);\r\n\r\n\t\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(typeCSV))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".csv\")) { filePath += \".csv\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a CSV format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.CSV);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".txt\")) { filePath += \".txt\"; }\r\n\r\n\t\t\t\t\t\t\t//---- Save file in a txt format\r\n\t\t\t\t\t\t\tOutputController.saveFile(filePath, DataController.getTable(), indexImage, OutputController.OUTPUT_FORMAT.TXT);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void exportShape()\r\n\t{\r\n\t\tMWC.Utilities.ReaderWriter.ImportManager\r\n\t\t\t\t.exportThis(\";;Layer: \" + getName());\r\n\r\n\t\tEditable pl = this;\r\n\t\tif (pl instanceof Exportable)\r\n\t\t{\r\n\t\t\tExportable e = (Exportable) pl;\r\n\t\t\te.exportThis();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void export(URNspec urn, HashMap mapDiagrams, FileOutputStream fos) throws InvocationTargetException {\n\t}", "private void actionExportImageColoredCells ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t{\r\n\t\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\t\tFileNameExtensionFilter fileTypeBMP = new FileNameExtensionFilter(\"BMP\", \"bmp\", \"BMP\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeBMP);\t \r\n\t\t\t\t\tFileNameExtensionFilter fileTypeJPG = new FileNameExtensionFilter(\"JPEG\", \"jpg\", \"jpeg\", \"JPG\", \"JPEG\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeJPG);\r\n\r\n\t\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\t\tsaveFileChooser.setFileFilter(fileTypeBMP);\r\n\r\n\t\t\t\t\tint isSelectedFile = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\t\tif (isSelectedFile == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString outputFilePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(fileTypeBMP)) { outputFilePath += \".bmp\"; }\r\n\t\t\t\t\t\telse if (saveFileChooser.getFileFilter().equals(fileTypeJPG)) { outputFilePath += \".jpg\"; }\r\n\r\n\t\t\t\t\t\tOutputController.exportImageColoredCells(outputFilePath, DataController.getTable().getElement(indexImage));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "public void SaveActionPerformed(java.awt.event.ActionEvent evt) {\n if (jfcSave.showSaveDialog(this) == JFileChooser.APPROVE_OPTION){\r\n //get selected file name\r\n File fileSave = jfcSave.getSelectedFile();\r\n String fileSaveName = fileSave.toString();\r\n\r\n try {\r\n SaveScreenShot(drawingPanel,fileSaveName);\r\n } catch (Exception e){\r\n System.out.println(\"image failed to save!\");\r\n }\r\n }\r\n }", "public void saveAsImage(){\n\t\tif(currentView == null){\r\n\t\t\tJOptionPane.showMessageDialog(this, \"A tab must be open before an image can be saved\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcurrentView.saveAsImage();\r\n\t}", "public void writeImage(String fname) throws java.io.IOException {\n System.out.println(\"Writing the image.\");\n \n File f= new File(fname);\n if (f.exists()) {\n System.out.println(\"File \" + f.getAbsolutePath() + \" exists. It was not overwritten.\");\n return;\n }\n \n int r= currentIm.getRows();\n int c= currentIm.getCols();\n int roa[]= currentIm.getRmoArray();\n \n // Obtain a buffered image with the right size and format to save out this image\n // (only the RGB components, not alpha).\n BufferedImage bimage= new BufferedImage(c, r, BufferedImage.TYPE_INT_RGB);\n \n // Copy the image data into that BufferedImage.\n bimage.setRGB(0, 0, c, r, roa, 0, c);\n \n // Finally, write the image onto the file and give the appropriate message\n ImageIO.write(bimage, \"png\", f);\n System.out.println(\"Image written to \" + f.getAbsolutePath());\n }", "public BufferedImage getExport() {\n int ebackw = Integer.parseInt\n (main.myProps.getProperty(\"export.back\"));\n int efrontw = main.forecast;\n main.display.setBounds(ebackw, efrontw);\n\n Dimension dim = main.display.getPreferredSize(); \n BufferedImage img = new BufferedImage\n (dim.width, dim.height, BufferedImage.TYPE_INT_ARGB);\n Graphics gc = img.getGraphics();\n main.display.paintComponent(gc);\n int d[] = main.display.getExportSize(); \n gc.dispose();\n\n main.display.resetBounds();\n return img.getSubimage(d[0], d[1], d[2], d[3]);\n }", "public boolean saveImage() throws IOException\n\t{\n\t\tConfiguration config = GlobalConfiguration.CONFIG;\n\t\tString rootPath = config.get(GlobalConfiguration.CRAWL_IMAGE_ROOT, \"/export/public_html/image\");\n\t\tFile imageDir = new File(rootPath);\n\t\tif(!imageDir.exists())\n\t\t{\n\t\t\timageDir.mkdirs();\n\t\t}\n\t\t///image name is image data hash in hex format\n\t\tString fullPath = rootPath + \"/\" + this.getImageFileName();\n\t\tFileOutputStream fos = new FileOutputStream(fullPath);\n\t\tfos.write(this.getImageData());\n\t\tfos.close();\n\t\treturn true;\n\t}", "private void actionTimelapseExport ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\r\n\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t{\r\n\t\t\t\tString folderPath = saveFileChooser.getSelectedFile().getPath();\r\n\t\t\t\t\r\n\t\t\t\tOutputController.exportTimelapseImage(folderPath, DataController.getTable());\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage e)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(e);\r\n\t\t}\r\n\t}", "BufferedImage outputImage();", "void exportGame();", "@Override\n\tpublic void doSaveAs() {\n\n\t}", "private void outputToFile() {\n\t\tPath filePath = Paths.get(outputFile);\n\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tRowIterator iterator = currentGen.iterateRows();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tElemIterator elem = iterator.next();\n\t\t\t\twhile (elem.hasNext()) {\n\t\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\t\twriter.write(mElem.rowIndex() + \",\" + mElem.columnIndex());\n\t\t\t\t\twriter.newLine();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to write to the provided file\");\n\t\t}\n\n\t}", "private JButton getCmdExport() {\r\n\t\tif (cmdExport == null) {\r\n\t\t\tcmdExport = new JButton();\r\n\t\t\tcmdExport.setIcon(new ImageIcon(getClass().getResource(\"/Export-48.png\")));\r\n\t\t\tcmdExport.setToolTipText(\"Export current alive proxy.\");\r\n\t\t\tcmdExport.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tString filename = getFilename();\r\n\r\n\t\t\t\t\tFileWriter fstream = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tfstream = new FileWriter(filename);\r\n\t\t\t\t\t} catch (IOException e2) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tlblDebug.setText(e2.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBufferedWriter out = new BufferedWriter(fstream);\r\n\r\n\t\t\t\t\tfor (int i = 1;i<jTable.getRowCount();i++) {\r\n\t\t\t\t\t\tif (jTable.getModel().getValueAt(i, 0).toString().contains(\"check.png\")) {\r\n\t\t\t\t\t\t\tString toWrite = ((String)jTable.getModel().getValueAt(i, 1)+\":\"+jTable.getModel().getValueAt(i, 2));\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tout.write(toWrite);\r\n\t\t\t\t\t\t\t\tout.newLine();\r\n\r\n\r\n\t\t\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tlblDebug.setText(e1.getMessage());\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlblDebug.setText(e1.getMessage());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlblDebug.setText(filename+ \" Exported\");\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn cmdExport;\r\n\t}", "public boolean saveImage(String outPath){\n if (saveLocation == null || saveLocation.isEmpty()){\n System.err.println(\"ERROR: No image destination path given.\");\n return false;\n }\n\n try {\n File output = new File(outPath);\n// if (output.exists() && !overwrite){\n// System.err.println(\"ERROR: Attempting to overwritable existing file when the overwriting option is off.\");\n// return false;\n// }\n// else {\n// ImageIO.write(image, \"png\", output);\n// return true;\n// }\n ImageIO.write(image, \"png\", output);\n return true;\n }\n catch (Exception e){\n System.err.println(\"ERROR: Could not save file.\");\n return false;\n }\n }", "public void write(File path) throws IOException{\n\t\tif(this.picture != null){ // in cazul in care poza are continut null se arunca exceptie\n\t\t\t//File output = new File(path);\n\t\t\tImageIO.write(zoomed,\"bmp\",path);\n\t\t\tSystem.out.println(path);\n\t\t\tSystem.out.println(\"\\nS-a scris in fisier cu succes\");\n\t\t}\n\t}", "public void saveImagePanel() throws IOException, ClassNotFoundException {\n\t\tFile archiveImage = null;\n\t\tarchiveImage = new File(\"CAMBIAR NOMBRE \");\n\t\tfile_chooser.setSelectedFile(archiveImage);\n\t\tif (file_chooser.showDialog(null, \"Guardar\") == JFileChooser.APPROVE_OPTION) {\n\t\t\tarchiveImage = file_chooser.getSelectedFile();\n\t\t\tif (archiveImage.getName().endsWith(\"jpg\") || archiveImage.getName().endsWith(\"png\")) {\n\t\t\t\t// realizar accion\n\t\t\t\tfileSeralization.saveFile(archiveImage);\n\t\t\t}\n\t\t}\n\t}", "private void actionExportImageChart (boolean isFrequency)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tint indexImage = mainFormLink.getComponentPanelLeft().getComponentComboboxFileName().getSelectedIndex();\r\n\r\n\t\t\t\tif (indexImage >= 0 && indexImage < tableSize)\r\n\t\t\t\t{\r\n\t\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\t\tFileNameExtensionFilter fileTypeBMP = new FileNameExtensionFilter(\"BMP\", \"bmp\", \"BMP\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeBMP);\t \r\n\t\t\t\t\tFileNameExtensionFilter fileTypeJPG = new FileNameExtensionFilter(\"JPEG\", \"jpg\", \"jpeg\", \"JPG\", \"JPEG\");\r\n\t\t\t\t\tsaveFileChooser.addChoosableFileFilter(fileTypeJPG);\r\n\r\n\t\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\t\tsaveFileChooser.setFileFilter(fileTypeBMP);\r\n\r\n\t\t\t\t\tint isSelectedFile = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\t\tif (isSelectedFile == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString outputFilePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(fileTypeBMP)) { outputFilePath += \".bmp\"; }\r\n\t\t\t\t\t\telse if (saveFileChooser.getFileFilter().equals(fileTypeJPG)) { outputFilePath += \".jpg\"; }\r\n\r\n\t\t\t\t\t\thelperDisplayChart(isFrequency);\r\n\r\n\t\t\t\t\t\t//Save displayed cjart directly from the panel\r\n\t\t\t\t\t\tmainFormLink.getComponentPanelRight().getComponentPanelChart().saveChart(outputFilePath);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "private void actionSaveOutputAll ()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t\tif (tableSize != 0)\r\n\t\t\t{\r\n\t\t\t\tJFileChooser saveFileChooser = new JFileChooser();\r\n\r\n\t\t\t\tFileNameExtensionFilter typeCSV = new FileNameExtensionFilter(\"CSV\", \"csv\", \"CSV\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeCSV);\r\n\r\n\t\t\t\tFileNameExtensionFilter typeTXT = new FileNameExtensionFilter(\"TXT\", \"txt\", \"TXT\");\r\n\t\t\t\tsaveFileChooser.addChoosableFileFilter(typeTXT);\r\n\r\n\t\t\t\tsaveFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\t\t\tsaveFileChooser.setFileFilter(typeCSV);\r\n\r\n\t\t\t\tint isOpen = saveFileChooser.showOpenDialog(saveFileChooser);\r\n\r\n\t\t\t\tif (isOpen == JFileChooser.APPROVE_OPTION) \r\n\t\t\t\t{\r\n\t\t\t\t\tString filePath = saveFileChooser.getSelectedFile().getPath();\r\n\r\n\t\t\t\t\t/*!*/DebugLogger.logMessage(\"Saving output of all images to file \" + filePath, LOG_MESSAGE_TYPE.INFO);\r\n\r\n\t\t\t\t\tif (saveFileChooser.getFileFilter().equals(typeCSV))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".csv\")) { filePath += \".csv\"; }\r\n\r\n\t\t\t\t\t\tOutputController.saveFileAll(filePath, DataController.getTable(), OUTPUT_FORMAT.CSV);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (!filePath.substring(filePath.length() - 4).equals(\".txt\")) { filePath += \".txt\"; }\r\n\r\n\t\t\t\t\t\tOutputController.saveFileAll(filePath, DataController.getTable(), OUTPUT_FORMAT.TXT);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (ExceptionMessage exception)\r\n\t\t{\r\n\t\t\tExceptionHandler.processException(exception);\r\n\t\t}\r\n\t}", "public native boolean writeImage(ImageInfo imageInfo)\n\t\t\tthrows MagickException;", "@Override\n\tpublic void doSaveAs() {\n\t}", "private void jMenuItem2ActionPerformed(ActionEvent evt) {\n\t\tif (outputFile == null) {\n\t\t\tSystem.err.println(\"Error!! No file to save\");\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tBufferedImage bi = (BufferedImage) entry.getImage();\n\t\t\tImageIO.write(bi, fileExtension, outputFile);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Error!! File not saved\");\n\t\t}\n\t}", "public void outputToFile(String filemame)\n {\n }", "public void write(OutputStream dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, dest, writeAlpha);\r\n\t}", "public void exportToFile(Grid grid, String filePath) throws IOException {\n\n File file = new File(filePath);\n FileOutputStream fileOutputStream = null;\n try {\n fileOutputStream = new FileOutputStream(file);\n writeGridAndCloseStream(grid, fileOutputStream);\n \n if (this instanceof EsriASCIIGridExporter) {\n WKTProjectionFile.write(grid.getPrjFileContent(), filePath);\n }\n } catch (Exception exc) {\n // Delete the file if an exception is thrown. Before the file can be \n // deleted, the output stream needs to be closed.\n closeQuietly(fileOutputStream);\n fileOutputStream = null;\n if (file.exists()) {\n file.delete();\n }\n throw exc;\n } finally {\n closeQuietly(fileOutputStream);\n\n // delete the file if the user cancelled the operation\n if (progressIndicator != null\n && progressIndicator.isCancelled()) {\n if (file.exists()) {\n file.delete();\n }\n }\n }\n }", "private void writeImage(BufferedImage image, String fileName) {\n try {\n File outputFile = new File(fileName + \".\" + FILE_EXTENSION);\n ImageIO.write(image, FILE_EXTENSION, outputFile);\n\n } catch (IOException ioexp) {\n System.err.println(\"No contact with outside world\");\n }\n }", "@Override\n public void closeExportWriter() {\n }", "private void exportFile()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdrinkListFileOutput = new BufferedWriter(new FileWriter(drinkListFile));\n\t\t\tdrinkListFileOutput.write(exportDrinkList);//insert string of drinks\n\t\t\tdrinkListFileOutput.close();\n\t\t\tJOptionPane.showMessageDialog(null, \"Successfully saved drinks\");\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.toString();//change this\n\t\t\tJOptionPane.showMessageDialog(null, \"Drink save error: \" + e.toString());//change this);\n\t\t}\n\n\n\n\t}", "public ActionSaveAs() {\r\n putValue(SMALL_ICON, IconFactory.get().create(\"fa:floppy-o\"));\r\n Messages.get().message(\"saveAs\").subscribe((msg) -> {\r\n putValue(NAME, msg);\r\n });\r\n }", "public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }", "@Override\n public void close(TaskAttemptContext context) throws IOException,\n InterruptedException {\n mergedCanvas.write(outFile);\n outFile.close();\n }", "public void saveBitmapToDisk(String fileName) throws FileNotFoundException, IOException {\n // serialize\n // save to disk\n FileOutputStream fout = new FileOutputStream(\"assets/\"+fileName+\".bitmap\");\n ObjectOutputStream oos = new ObjectOutputStream(fout);\n oos.writeObject(this);\n }", "public void exportMap(){\n\t\tString toSave = \"\";\r\n\t\tfor(int i=0;i<map.getH();i++){\r\n\t\t\tfor(int j=0;j<map.getL();i++){\r\n\t\t\t\tif(j == map.getL()-2)\r\n\t\t\t\t\ttoSave += map.getCase(i, j).toString();\r\n\t\t\t\telse\r\n\t\t\t\t\ttoSave += map.getCase(i, j).toString()+\"|\";\r\n\t\t\t}\r\n\t\t\ttoSave += \"\\n\";\r\n\t\t}\r\n\t\t//ecriture d'un fichier\r\n\t}", "public static void writeImage(Image image, File imageFile) throws IOException {\n\t\tImageUtils.writeFile(image, imageFile);\n\t\tMsg.info(AbstractDockingTest.class, \"Wrote image to \" + imageFile.getCanonicalPath());\n\t}", "@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"recaudado-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}", "protected abstract void writeFile();", "public void write(String dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, new FileOutputStream(dest), writeAlpha);\r\n\t}", "@Override\n\tpublic void writeFile(String file_out) {\n\t\tthis.writeFile(Mode.POINT_ONLY, 0, DEFAULT_AND_LOAD_FACTOR, file_out);\n\t}", "public void saveToFile(File outputFile) throws IOException {\n PrintWriter writer = new PrintWriter(outputFile);\n\n writer.write(\"# Exported by FrogLord\" + Constants.NEWLINE);\n for (Tuple3<Float, Float, Float> vertex : this.vertices)\n writer.write(\"v \" + vertex.getA() + \" \" + vertex.getB() + \" \" + vertex.getC() + Constants.NEWLINE);\n\n for (Tuple2<Float, Float> normal : this.normals)\n writer.write(\"vt \" + normal.getA() + \" \" + normal.getB() + Constants.NEWLINE);\n\n writer.close();\n }", "DataFrameExport export();", "public void save() {\n\t\tWriteFile data = new WriteFile( this.name + \".txt\" );\n\t\ttry {\n\t\t\t data.writeToFile(this.toString());\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Couldn't print to file\");\n\t\t}\n\t}", "@Override\n public void exportToFile(SpreadsheetTable focusOwner) {\n try {\n File dire = new File(dir);\n File file = new File(dire, filename);\n\n FileWriter writer = new FileWriter(file, false);\n int start = 0;\n if (this.header) {\n start++;\n }\n\n this.selectedCells = focusOwner.getSelectedCells();\n\n for (int i = start; i < selectedCells.length; i++) {\n for (int j = 0; j < selectedCells[i].length; j++) {\n if (j != 0) {\n writer.append(delimiter);\n }\n writer.append(selectedCells[i][j].getContent());\n }\n writer.append('\\r');\n writer.append('\\n');\n }\n writer.flush();\n writer.close();\n } catch (IOException e) {\n System.out.println(\"Error exporting file!\");\n }\n }", "@FXML\n void exportFile(ActionEvent event) {\n \tFileChooser chooser = new FileChooser();\n\t\tchooser.setTitle(\"Open Target File for the Export\");\n\t\tchooser.getExtensionFilters().addAll(new ExtensionFilter(\"Text Files\", \"*.txt\"),\n\t\t\t\tnew ExtensionFilter(\"All Files\", \"*.*\"));\n\t\tStage stage = new Stage();\n\t\t\n\t\t//get the reference of the target file\n\t\tFile targeFile = chooser.showSaveDialog(stage); \n\t\t\n\t\t\n\t\t//writes accounts to text file and exports\n\t\ttry {\n\t\t\t\n\t\t\tBufferedWriter bf = new BufferedWriter(new FileWriter(targeFile));\n\t\t\tbf.write(db.printFormattedAccounts());\n\t\t\tbf.flush();\n\t\t\tbf.close();\n\t\t\t\n\t\t\tmessageArea.appendText(\"File successfully exported.\\n\");\n\t\t\t\n\t\t} catch (IOException e) {\n \t\tmessageArea.appendText(\"Unable to export transactions to file.\\n\");\n\t\t}\n\t\tcatch (NullPointerException e) {\n\t\t\tmessageArea.appendText(\"File not selected, unable to export transactions to file.\\n\");\n\t\t}\n\t\t\n\t\t\n }", "public abstract void writeToFile( );", "public void writeToFile(Mat img, String fname) {\n\t\tSystem.err.println(\"Writing image to file \" + fname);\n\t\tMatOfByte matOfByte = new MatOfByte();\n\t\tHighgui.imencode(\".jpg\", img, matOfByte);\n\t\tbyte[] byteArray = matOfByte.toArray();\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(fname);\n\t\t\tfos.write(byteArray);\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface ExportFile {\r\n\r\n void export();\r\n}", "public void SaveScreenShot(Component component, String filename) throws Exception{\r\n BufferedImage imag = getScreenShot(component);\r\n ImageIO.write(imag, \"png\", new File(filename));\r\n }", "private static void saveImage(final Image image, final File file) {\n try {\n WriteFxImage.savePng(image, file);\n } catch (IOException e) {\n LOGGER.atError().addArgument(file.getName()).log(\"Error saving screenshot to {}\");\n }\n }", "public String toFileFormat()\n\t{\n\t\t\n\t\treturn startx + \" \" + starty + \"; \" + endx + \" \" + endy + \"; \"+ texture + \";\\r\\n\";\n\t\t\n\t}", "protected void actionPerformedExport ()\n {\n Preferences root = Preferences.userRoot ();\n Preferences node = root.node (OpenMarkovPreferences.OPENMARKOV_NODE_PREFERENCES);\n System.out.println (\"Export selected\");\n if (chooser.showSaveDialog (PreferencesDialog.this) == JFileChooser.APPROVE_OPTION)\n {\n try\n {\n OutputStream out = new FileOutputStream (chooser.getSelectedFile ());\n node.exportSubtree (out);\n out.close ();\n }\n catch (Exception e)\n {\n e.printStackTrace ();\n JOptionPane.showMessageDialog (this, stringDatabase.getString (e.getMessage ()),\n stringDatabase.getString (e.getMessage ()),\n JOptionPane.ERROR_MESSAGE);\n }\n }\n }", "@FXML\n public void saveFile(Event e) {\n String outputData = output.getText();\n\n File file = chooser.showSaveDialog(save.getScene().getWindow());\n\n if(file != null) {\n createFile(outputData, file);\n }\n }", "@Override\n public void saveFile(Object o, File file, String ext)\n throws IOException {\n dest = file;\n }", "public void screenshotToFile(final boolean showDialog) {\n Image image = getScreenshot();\n File file = showDialog ? showFileDialog(generateScreenshotName())\n : new File(getDirectory(), generateScreenshotName());\n if (file == null)\n return;\n saveImage(image, file);\n LOGGER.atInfo().addArgument(file.getName()).log(\"Saved screenshot to {}\");\n }", "public void exportFile() {\n\t\ttry {\n\t\t\tFileWriter file_write = new FileWriter(\"accounts/CarerAccounts.txt\", false);\n\t\t\tString s = System.getProperty(\"line.separator\");\n\t\t\tfor (int i=0; i < CarerAccounts.size();i++) {\n\t\t\t\tString Users = new String();\n\t\t\t\tfor (int user: CarerAccounts.get(i).getUsers()) {\n\t\t\t\t\tUsers += Integer.toString(user) + \"-\";\n\t\t\t\t}\n\t\t\t\tString individual_user = CarerAccounts.get(i).getID() + \",\" + CarerAccounts.get(i).getUsername() + \",\" + CarerAccounts.get(i).getPassword() + \",\" + CarerAccounts.get(i).getFirstName() + \",\" + CarerAccounts.get(i).getLastName() + \",\" + CarerAccounts.get(i).getEmailAddress() + \",\" + Users;\n\t\t\t\tfile_write.write(individual_user + s);\n\t\t\t}\n\t\t\tfile_write.close();\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to export file.\");\n\t\t}\n\t}", "@Override\r\n\tpublic void exportThis()\r\n\t{\n\t\tsuper.exportThis();\r\n\t}", "@Override\n\tpublic void event(PictureEvent e) {\n\t\ttry {\n\t\t\tif (null != fname) {\n\t\t\t\tImageIO.write(e.getImage(), \"jpg\", new File(fname));\n\t\t\t}\n\t\t} catch (Exception ex) { SewerSender.println(ex.toString()); }\n\t}", "public void save(OutputStream os) throws IOException;", "synchronized public void saveToFile() {\n try {\n saveObjToFile(this, saveFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n log(\"error saving resource to file\");\n }\n }", "public abstract String FileOutput();", "private void exportFiles()\n\t{\n\t\tloading.setVisibility(View.VISIBLE);\n\t\t\n\t\t// Report String\n\t\t//----------------\n\t\tString reportString = \"Date,Location Latitude, Location Longitude,Vehicle,Description\\n\";\t\n\t\t\n\t\tStringBuilder reportBuilder = new StringBuilder();\n\t\treportBuilder.append(reportString);\n\t\t\n\t\tString objectString = \"\"+ \n\t\t\t\tincident.getDate()+\",\" +\n\t\t\t\tincident.getLatitude() + \",\" +\n\t\t\t\tincident.getLongitude()+\",\" +\n\t\t\t\tincident.getVehicleReg()+\",\" +\n\t\t\t\tincident.getDescription()+\",\" + \"\\n\";\n\t\t\n\t\treportBuilder.append(objectString);\n\t\t\n\t\t// Witnesses String\n\t\t//----------------\n\t\tString witnessString = \"witnessName,witnessEmail,witnessNumber,witnessStatement\\n\";\n\t\t\n\t\tStringBuilder witnessesBuilder = new StringBuilder();\n\t\twitnessesBuilder.append(witnessString);\n\t\t\n\t\tfor(int i=0; i<incident.getWitnesses().size(); i++)\n\t\t{\n\t\t\tobjectString = \"\"+ \n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessName\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessEmail\") + \",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessNumber\")+\",\" +\n\t\t\t\t\tincident.getWitnesses().get(i).get(\"witnessStatement\")+\",\" + \"\\n\";\n\t\t\t\n\t\t\twitnessesBuilder.append(objectString);\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Create file\n\t\t//===========================================\n\t\t// Incident Report\n\t\t//-------------------------------------------------\n\t\tfinal File reportFile = new File(getFilesDir() + \"/\" + \"incident_report.csv\");\n\t\treportFile.setReadable(true,false);\n\t\t\n\t\tif( reportFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"incident_report.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(reportBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Witnesses file\n\t\t//-------------------------------------------------\n\t\tfinal File witnessesFile = new File(getFilesDir() + \"/\" + \"witnesses.csv\");\n\t\twitnessesFile.setReadable(true,false);\n\t\t\n\t\tif( witnessesFile != null )\n\t\t{\n\t\t try \n\t\t {\n\t\t \tFileOutputStream fOut = openFileOutput(\"witnesses.csv\", Context.MODE_WORLD_READABLE);\n\t\t \tOutputStreamWriter osw = new OutputStreamWriter(fOut); \n\t\t \tosw.write(witnessesBuilder.toString());\n\t\t\t\tosw.flush();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t//-------------------------------------------------\n\t\t\n\t\t// Media files\n\t\t//-------------------------------------------------\t\n\t\tParseQuery<ParseObject> query = ParseQuery.getQuery(\"DCIncident\");\n\t\tquery.getInBackground(incident.getId(),new GetCallback<ParseObject>() \n\t\t{\n\t\t\t@Override\n\t\t\tpublic void done(final ParseObject parseIncident, ParseException e) \n\t\t\t{\n\t\t\t\tif(e == null)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t// Get number of photos attached\n\t\t\t\t\tParseQuery<ParseObject> queryPhotos = parseIncident.getRelation(\"incidentPhotos\").getQuery();\n\t\t\t\t\tqueryPhotos.findInBackground(new FindCallback<ParseObject>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void done(List<ParseObject> parsePhotos, ParseException e) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tArrayList<byte[]> bytes = new ArrayList<byte[]>();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor(int i=0; i<parsePhotos.size(); i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Get photo from the parse\n\t\t\t\t\t\t\t\tParseFile photo = (ParseFile) parsePhotos.get(i).get(\"photoFile\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tbytes.add(photo.getData());\n\t\t\t\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tphotoFiles = AssetsUtilities.saveIncidentPhoto(ReviewReportActivity.this, bytes);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Video\n\t\t\t\t\t\t\tParseFile parseVideo = (ParseFile) parseIncident.get(\"incidentVideo\");\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(parseVideo != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tparseVideo.getDataInBackground(new GetDataCallback()\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void done(byte[] data, ParseException e) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(e == null)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Save file\n\t\t\t\t\t\t\t\t\t\t\tvideoFile = AssetsUtilities.saveIncidentVideo(ReviewReportActivity.this,data);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfinishSendingEmail(reportFile, witnessesFile);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void toFile(String filename) {\n\t\tString serialized = Serializer.serializeLevelPack(this);\n\t\tSerializer.writeToFile(filename, serialized.getBytes());\n\t}", "private void saveOutputFile() {\n FileChooser fileChooser = new FileChooser();\n if (textMergeScript.hasCurrentDirectory()) {\n fileChooser.setInitialDirectory (textMergeScript.getCurrentDirectory());\n }\n chosenOutputFile = fileChooser.showSaveDialog (ownerWindow);\n if (fileChooser != null) {\n writeOutput();\n openOutputDataName.setText (tabNameOutput);\n }\n }" ]
[ "0.74523395", "0.7415175", "0.6945819", "0.6901474", "0.6901392", "0.658972", "0.6577365", "0.6477454", "0.63372314", "0.61432827", "0.6133306", "0.61272347", "0.6125889", "0.6104008", "0.6080992", "0.6072301", "0.59629166", "0.5956791", "0.59331536", "0.59114957", "0.5909468", "0.5864572", "0.5862991", "0.58242726", "0.5802706", "0.5783474", "0.57805383", "0.57759726", "0.5763554", "0.57613426", "0.57572114", "0.5747432", "0.57473695", "0.5746533", "0.5746043", "0.57284635", "0.5723099", "0.57008946", "0.5682151", "0.56632996", "0.56381345", "0.5637663", "0.56371516", "0.56357706", "0.56300634", "0.5626743", "0.56266934", "0.5621573", "0.5607707", "0.55985177", "0.5576049", "0.55709225", "0.5562106", "0.555641", "0.5549785", "0.55469185", "0.554679", "0.55383927", "0.55287796", "0.5523681", "0.55121267", "0.5497844", "0.54976976", "0.54912835", "0.54727894", "0.54509735", "0.5444952", "0.54435724", "0.5423503", "0.54156274", "0.54122794", "0.54073983", "0.53997624", "0.53986895", "0.5398629", "0.5383271", "0.53803974", "0.53755236", "0.5375282", "0.5366219", "0.53656757", "0.53612053", "0.5356251", "0.53397065", "0.53371084", "0.5332894", "0.5332839", "0.5329038", "0.53274095", "0.53207535", "0.5320581", "0.5308721", "0.5285191", "0.5276856", "0.5275861", "0.52755785", "0.52648675", "0.52574605", "0.525522", "0.52542835", "0.5249967" ]
0.0
-1
Utility Functions Convert image data to desired format Mipmap data will be lost.
public @NotNull Image reformat(ColorFormat format) { if (format != ColorFormat.GRAY && format != ColorFormat.GRAY_ALPHA && format != ColorFormat.RGB && format != ColorFormat.RGBA) {throw new UnsupportedOperationException("invalid format: " + format);} if (this.data != null && this.format != format) { Color.Buffer output = this.data.copy(format); this.data.free(); this.data = output; this.format = format; this.mipmaps = 1; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Bitmap convertToMutable(Bitmap imgIn) {\n try {\n //this is the file going to use temporally to save the bytes.\n // This file will not be a imageView, it will store the raw imageView data.\n File file = new File(Environment.getExternalStorageDirectory() + File.separator + \"temp.tmp\");\n\n //Open an RandomAccessFile\n //Make sure you have added uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"\n //into AndroidManifest.xml file\n RandomAccessFile randomAccessFile = new RandomAccessFile(file, \"rw\");\n\n // get the width and height of the source bitmap.\n int width = imgIn.getWidth();\n int height = imgIn.getHeight();\n Bitmap.Config type = imgIn.getConfig();\n\n //Copy the byte to the file\n //Assume source bitmap loaded using options.inPreferredConfig = Config.ARGB_8888;\n FileChannel channel = randomAccessFile.getChannel();\n MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0, imgIn.getRowBytes()*height);\n imgIn.copyPixelsToBuffer(map);\n //recycle the source bitmap, this will be no longer used.\n imgIn.recycle();\n System.gc();// try to force the bytes from the imgIn to be released\n\n //Create a new bitmap to load the bitmap again. Probably the memory will be available.\n imgIn = Bitmap.createBitmap(width, height, type);\n map.position(0);\n //load it back from temporary\n imgIn.copyPixelsFromBuffer(map);\n //close the temporary file and channel , then delete that also\n channel.close();\n randomAccessFile.close();\n\n // delete the temp file\n file.delete();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return imgIn;\n }", "private void reanderImage(ImageData data) {\n \n }", "private Bitmap decodeMapBitmap() {\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inJustDecodeBounds = false;\n options.inScaled = false;\n options.outWidth = 2048;\n options.outHeight = 2048;\n\n return BitmapFactory.decodeResource(getResources(), R.drawable.map, options);\n }", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == 7 && resultCode == RESULT_OK) {\n\n Bitmap bitmap = (Bitmap) data.getExtras().get(\"data\");\n currentBitMap = bitmap;\n imageView.setImageBitmap(bitmap);\n }\n\n try {\n if (requestCode == IMG_RESULT && resultCode == RESULT_OK && data != null) {\n Uri URI = data.getData();\n String[] FILE = {MediaStore.Images.Media.DATA};\n\n Cursor cursor = getContentResolver().query(URI, FILE, null, null, null);\n cursor.moveToFirst();\n\n int columnIndex = cursor.getColumnIndex(FILE[0]);\n String ImageDecode = cursor.getString(columnIndex);\n cursor.close();\n\n currentBitMap = BitmapFactory.decodeFile(ImageDecode);\n imageView.setImageBitmap(currentBitMap);\n }\n } catch (Exception e) {\n Toast.makeText(this, \"Please try again\", Toast.LENGTH_LONG)\n .show();\n }\n }", "@SuppressWarnings( \"unchecked\" )\n\t@Test\n\tpublic void testImgToMatConversion() throws IOException {\n\t\tDataset dataset = getScifio().datasetIO().open( input );\n\t\tMat convertedImg = new ImgToMatConverter().convert( ( RandomAccessibleInterval< UnsignedByteType > ) dataset.getImgPlus().getImg(), Mat.class );\n\t\topencv_imgcodecs.imwrite( img2mat, convertedImg );\n\n\t\t//Read image with OpenCV\n\t\tMat mat = imread( input, opencv_imgcodecs.IMREAD_GRAYSCALE );\n\t\tif ( mat.empty() )\n\t\t\tfail( \"Couldn't load image: \" + input );\n\n\t\t//Compare data\n\t\tcheckData( convertedImg, mat );\n\t}", "private void preprocess(Bitmap bitmap) {\n convertBitmapToByteBuffer(bitmap);\n }", "private void decodeImageData() throws IOException {\n\t\t\tfinal int nullCode = -1;\n\t\t\tfinal int npix = getMetadata().getIw() * getMetadata().getIh();\n\n\t\t\tbyte[] pixels = getMetadata().getPixels();\n\n\t\t\tif (pixels == null || pixels.length < npix) pixels = new byte[npix];\n\n\t\t\tshort[] prefix = getMetadata().getPrefix();\n\t\t\tbyte[] suffix = getMetadata().getSuffix();\n\t\t\tbyte[] pixelStack = getMetadata().getPixelStack();\n\n\t\t\tif (prefix == null) prefix = new short[MAX_STACK_SIZE];\n\t\t\tif (suffix == null) suffix = new byte[MAX_STACK_SIZE];\n\t\t\tif (pixelStack == null) pixelStack = new byte[MAX_STACK_SIZE + 1];\n\n\t\t\tgetMetadata().setPrefix(prefix);\n\t\t\tgetMetadata().setSuffix(suffix);\n\t\t\tgetMetadata().setPixelStack(pixelStack);\n\n\t\t\t// initialize GIF data stream decoder\n\n\t\t\tfinal int read = getSource().read();\n\t\t\tfinal int dataSize = read & 0xff;\n\n\t\t\tfinal int clear = 1 << dataSize;\n\t\t\tfinal int eoi = clear + 1;\n\t\t\tint available = clear + 2;\n\t\t\tint oldCode = nullCode;\n\t\t\tint codeSize = dataSize + 1;\n\t\t\tint codeMask = (1 << codeSize) - 1;\n\t\t\tint code = 0, inCode = 0;\n\t\t\tfor (code = 0; code < clear; code++) {\n\t\t\t\tprefix[code] = 0;\n\t\t\t\tsuffix[code] = (byte) code;\n\t\t\t}\n\n\t\t\t// decode GIF pixel stream\n\n\t\t\tint datum = 0, first = 0, top = 0, pi = 0, bi = 0, bits = 0, count = 0;\n\t\t\tint i = 0;\n\n\t\t\tfor (i = 0; i < npix;) {\n\t\t\t\tif (top == 0) {\n\t\t\t\t\tif (bits < codeSize) {\n\t\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\t\tcount = readBlock();\n\t\t\t\t\t\t\tif (count <= 0) break;\n\t\t\t\t\t\t\tbi = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdatum += (getMetadata().getdBlock()[bi] & 0xff) << bits;\n\t\t\t\t\t\tbits += 8;\n\t\t\t\t\t\tbi++;\n\t\t\t\t\t\tcount--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// get the next code\n\t\t\t\t\tcode = datum & codeMask;\n\t\t\t\t\tdatum >>= codeSize;\n\t\t\t\t\tbits -= codeSize;\n\n\t\t\t\t\t// interpret the code\n\n\t\t\t\t\tif ((code > available) || (code == eoi)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (code == clear) {\n\t\t\t\t\t\t// reset the decoder\n\t\t\t\t\t\tcodeSize = dataSize + 1;\n\t\t\t\t\t\tcodeMask = (1 << codeSize) - 1;\n\t\t\t\t\t\tavailable = clear + 2;\n\t\t\t\t\t\toldCode = nullCode;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oldCode == nullCode) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tfirst = code;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tinCode = code;\n\t\t\t\t\tif (code == available) {\n\t\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\t\tcode = oldCode;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (code > clear) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\tcode = prefix[code];\n\t\t\t\t\t}\n\t\t\t\t\tfirst = suffix[code] & 0xff;\n\n\t\t\t\t\tif (available >= MAX_STACK_SIZE) break;\n\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\tprefix[available] = (short) oldCode;\n\t\t\t\t\tsuffix[available] = (byte) first;\n\t\t\t\t\tavailable++;\n\n\t\t\t\t\tif (((available & codeMask) == 0) && (available < MAX_STACK_SIZE)) {\n\t\t\t\t\t\tcodeSize++;\n\t\t\t\t\t\tcodeMask += available;\n\t\t\t\t\t}\n\t\t\t\t\toldCode = inCode;\n\t\t\t\t}\n\t\t\t\ttop--;\n\t\t\t\tpixels[pi++] = pixelStack[top];\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tfor (i = pi; i < npix; i++)\n\t\t\t\tpixels[i] = 0;\n\t\t\tgetMetadata().setPixels(pixels);\n\t\t\tsetPixels();\n\t\t}", "private Bitmap stringToBitmap(String datos) {\n\n\t\tBitmap foto = null;\n\t\t\n\t\ttry {\n\t\t\tbyte[] byteData = Base64.decode(datos, Base64.DEFAULT);\n\t\t\tfoto = BitmapFactory.decodeByteArray(byteData, 0, byteData.length);\n\t\t\tLog.e(\"ImgArticulos\", \"Imagen convertida\");\n\t\t} catch (Exception e) {\n\t\t\tLog.e(\"ImgArticulos\", e.toString());\n\t\t}\n\n\t\treturn getScaledImage(foto);\n\n\t}", "public static void decodeAllImages(Args args){\n \t//Now those arrays will contain 'decoded' images\n \timageNames.clear();\n imagesToZip.clear();\n imageDict.clear();\n ArrayList<CodedData> recoveredData = null;\n\n //Read the coded images\n try {\n System.out.println(\"Reading zip file...\");\n readZip(args.codedInput, false);\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n BufferedImage tempFrame=null, tempFrameI=null;\n WritableRaster tempBitmap=null;\n WritableRaster tempDecoded=null;\n CodedData tempData=null;\n int gop = dataList.get(0).gop;\n //System.out.println(gop);\n BufferedImage tempBufferedImage = null;\n int z = 0;\n //recoveredData[0] contains the info of the image 0, and so on\n int recoveredDataCounter = 0;\n //For every image,\n for(int i= 0; i < imageNames.size(); i++){\n \t//z is a counter of the gop so we can decide if its a frameI or P\n if(z >= (gop)){\n z=0;\n }\n if(z == 0){//Frame I\n \t//Store it\n tempFrameI = imageDict.get(imageNames.get(i));\n imageDict.put(imageNames.get(i), tempFrameI);\n }else{\n //Frame P, decode it\n tempFrame = imageDict.get(imageNames.get(i)); \n tempBitmap = (WritableRaster) tempFrame.getData();\n tempDecoded = tempBitmap.createWritableChild(tempFrame.getMinX(), tempFrame.getMinY(), tempFrame.getWidth(), tempFrame.getHeight(), 0,0, null);\n \t//Get his info\n tempData = dataList.get(recoveredDataCounter);\n recoveredDataCounter++;\n int[] tempColor;\n //Iterate through the tile and replace its pixels\n for(int k = 0; k < tempData.bestTilesX.size(); k++){\n for (int baseX = 0; baseX < tempData.tileWidth ; baseX++) {\n for (int baseY = 0; baseY < tempData.tileHeight; baseY++) {\n tempColor = getPixelColor(tempFrameI, tempData.bestOriginX.get(k)+baseX, tempData.bestOriginY.get(k)+baseY);\n tempDecoded.setPixel(tempData.bestTilesX.get(k)+baseX, tempData.bestTilesY.get(k)+baseY, tempColor);\n }\n }\n }\n //Store the new decoded image\n tempBufferedImage = new BufferedImage(tempFrame.getColorModel(),tempDecoded,tempFrame.isAlphaPremultiplied(),null);\n imageDict.put(imageNames.get(i), tempBufferedImage);\n tempFrameI = tempBufferedImage;\n }\n z++;\n }\n }", "public TE doInBackground(byte[]... data) {\n return PhotoModule.this.convertN21ToBitmap(data[0]);\n }", "protected void setImageData(BufferedImage img) {\n \t\tif (format == null || format == Format.TEXT || format == Format.COLOR16_8x8)\n \t\t\treturn;\n \t\n \t\tequalize(img);\n \t\t\n \t\t//denoise(img);\n \t\t\n \t\tupdatePaletteMapping();\n \t\n \t\tflatten(img);\n \t\t\n \t\tif (!importDirectMappedImage(img)) {\n \t\t\tconvertImageToColorMap(img);\n \t\t}\n \t\n \t\treplaceImageData(img);\n \t}", "List<List<Pixel>> transform(Image img, String operation);", "public static boolean mergeUserData(String inMpg, Map<String, Object> map) throws IOException{\n if(null == inMpg) { \n throw new IllegalArgumentException(\"Empty Mpeg4 path!\");\n }\n\n if(null == map) { \n throw new IllegalArgumentException(\"Empty map!\");\n }\n\n byte[] bytes = (byte[]) map.get(HtcZoeMetadata.HTC_DATA_SEMIVIDEO_MD);\t\t\t\n Object bitRate = map.get(HtcZoeMetadata.HTC_METADATA_BITRATE);\n Object frameDropRatio = map.get(HtcZoeMetadata.HTC_METADATA_FRAME_DROP_RATIO);\n\n if(0 == bytes.length){\n throw new IllegalArgumentException(\"Empty bytes!\");\n }\n\t\t\n File ori = new File(inMpg);\t\n if(!ori.exists()){\n throw new IllegalArgumentException(inMpg + \" not exists!\");\n }\n \n //Init \n sUSE_32BIT_OFFSET = false;\n sHMTA_Offset = -1;\n sHMTA_Size = -1;\n sHtcTableOffset = -1;\n \n long fileLength = ori.length();\n RandomAccessFile raf = new RandomAccessFile(ori, \"rws\");\n\n //*****Open file channel to read byte\n FileChannel fc = raf.getChannel();\n\n //*****Get HMTA table offset and size\n long offset[] = new long[1];\n boolean err = false;\n\n offset[0] = 0;\n\n while (true) {\n try {\n err = parseChunk(fc, offset, 0);\n }catch (IOException e){\n err = false;\n }\n \n if (err) {\n continue;\n }\n break;\n }\n\t \n if( -1 == sHMTA_Offset || - 1 == sHMTA_Size){\n if(null != raf){\n raf.close();\n raf = null;\n }\t \t \n\n throw new IllegalArgumentException(\"Not support MPEG4 format!\");\t \t\n } else {\n Log.d(TAG, \"sHMTA_Offset is = \" + sHMTA_Offset + \" sHMTA_Size is = \" + sHMTA_Size);\n }\n\n //*****Restore all table byte info and fill ori region as 0\n byte[] oriHMTA = Util.read(fc, sHMTA_Offset, sHMTA_Size);\t \t \n\n byte emptyHMTA[] = new byte[oriHMTA.length]; \n Arrays.fill( emptyHMTA, (byte) 0 );\n\n Log.d(TAG, \"Empty HMTA: write bytes \" + Util.writeBytes(fc, emptyHMTA, sHMTA_Offset));\n\n //*****Append motion data in file end\n Util.setCurrentOffset(fileLength);\n //*****Append pseudo box info(HTC_INFO_BOX) \n //put 0 at first\n Log.d(TAG, \"HTC_INFO_BOX(fake size) write bytes \" + Util.writeInt(fc, 0));\n Log.d(TAG, \"HTC_INFO_BOX(name) write bytes \" + Util.writeString(fc, HTC_INFO_BOX)); \n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(header) write bytes \" + Util.writeString(fc, HtcZoeMetadata.HTC_DATA_SEMIVIDEO_MD));\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(content) write bytes \" + Util.writeBytes(fc, bytes));\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(footer) write bytes \" + Util.writeString(fc, HtcZoeMetadata.HTC_DATA_SEMIVIDEO_MD));\n long motionDataOffset = Util.getCurrentOffset();\n //*****Append HMTA table and add HTC Data(Motion Data key) from HMTA footer\n //HMTA table ori data\n Log.d(TAG, \"Append ori HMTA write bytes \" + Util.writeBytes(fc, oriHMTA));\n long oriHMTAEndOffset = Util.getCurrentOffset();\n //Key: overwrite HMTA footer to add Motion Data section \n long hMTaOffset = oriHMTAEndOffset - 4;\n Util.setCurrentOffset(hMTaOffset);\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(key name) write bytes \" + Util.writeString(fc, HtcZoeMetadata.HTC_DATA_SEMIVIDEO_MD));\n //IsData \n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(IsData) write bytes \" + Util.writeInt(fc, 1));\n //VALUE_SIZE\n int valSize = sUSE_32BIT_OFFSET?12:16;\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(valSize) write bytes \" + Util.writeInt(fc, valSize));\n //VALUE\n //VALUE_Index\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(VALUE_Index) write bytes \" + Util.writeInt(fc, 0));\n //VALUE_offset:bitscheck(sUSE_32BIT_OFFSET) to know if use putlong\n //fileLength + 8 is for pseudo box header\n if(sUSE_32BIT_OFFSET){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(VALUE_offset) write bytes \" + Util.writeInt(fc, (int) (fileLength + 8)));\n } else {\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(VALUE_offset_long) write bytes \" + Util.writeLong(fc, fileLength + 8));\n }\n\n //VALUE_size:MotionData size = input bytes + header/footer size\n Log.d(TAG, \"HTC_DATA_SEMIVIDEO_MD(VALUE_size) write bytes \" + Util.writeInt(fc, bytes.length + 8));\n //MetaData Key:Bit rate key\n if(null != bitRate){\n Log.d(TAG, \"HTC_METADATA_BITRATE(key name) write bytes \" + Util.writeString(fc, HtcZoeMetadata.HTC_METADATA_BITRATE));\n //IsData(0)\n Log.d(TAG, \"HTC_METADATA_BITRATE(IsData) write bytes \" + Util.writeInt(fc, 0));\n //VALUE_SIZE(HTC_METADATA vale size is 4)\n Log.d(TAG, \"HTC_METADATA_BITRATE(VALUE_size) write bytes \" + Util.writeInt(fc, 4));\n //VALUE\n Log.d(TAG, \"HTC_METADATA_BITRATE(VALUE) write bytes \" + Util.writeInt(fc, (Integer) bitRate));\n }\n \n //MetaData Key:Frame drop ratio key\n if(null != frameDropRatio){\n Log.d(TAG, \"HTC_METADATA_FRAME_DROP_RATIO(key name) write bytes \" + Util.writeString(fc, HtcZoeMetadata.HTC_METADATA_FRAME_DROP_RATIO));\n //IsData(0)\n Log.d(TAG, \"HTC_METADATA_FRAME_DROP_RATIO(IsData) write bytes \" + Util.writeInt(fc, 0));\n //VALUE_SIZE(HTC_METADATA vale size is 4)\n Log.d(TAG, \"HTC_METADATA_FRAME_DROP_RATIO(VALUE_size) write bytes \" + Util.writeInt(fc, 4));\n //VALUE\n Log.d(TAG, \"HTC_METADATA_FRAME_DROP_RATIO(VALUE) write bytes \" + Util.writeInt(fc, (Integer) frameDropRatio));\n }\n \n //HMTA footer\n Log.d(TAG, \"HMTA(footer) write bytes \" + Util.writeString(fc, HTC_TABLE_TAG));\n hMTaOffset = Util.getCurrentOffset();\n\n //*****Update HMTA table offset and size\n //offset\n //+8 is htcb header rule\n long localShift = sHtcTableOffset + 8;\n Util.setCurrentOffset(localShift); \n if(sUSE_32BIT_OFFSET){\n Log.d(TAG, \"HMTA(offset) write bytes \" + Util.writeInt(fc, (int) motionDataOffset));\n } else {\n Log.d(TAG, \"HMTA(offset_long) write bytes \" + Util.writeLong(fc, motionDataOffset));\n } \n long hMTAEnhanceSize = hMTaOffset - oriHMTAEndOffset;\n //size\n Log.d(TAG, \"HMTA(size) write bytes \" + Util.writeInt(fc, (int)(oriHMTA.length + hMTAEnhanceSize)));\n\n //*****Update pseudo box size (int)(oriHMTA.length + hMTAEnhanceSize + bytes.length(motion data size) + 8(motion data header/footer) + 8(HTC_INFO_BOX size/name)) \n Util.setCurrentOffset(fileLength); \n Log.d(TAG, \"HTC_INFO_BOX(real size) write bytes \" + Util.writeInt(fc, (int)(oriHMTA.length + hMTAEnhanceSize + bytes.length + 8 + 8)));\n \n //*****Save file and return true\n if(null != raf){\n raf.close();\n raf = null;\n }\n return true;\t\t\n }", "@Override\n \t protected void onPostExecute(Bitmap result)\n \t {\n \t\t\tMapImageView imageView = (MapImageView)this.getActivity().findViewById(com.example.chronolocalization.R.id.mapImage);\n \t \n \t\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n \t\t\tresult.compress(Bitmap.CompressFormat.PNG, 100, baos);\n \t\t\tInputStream is = new ByteArrayInputStream( baos.toByteArray());\n \t \t\t\n \t\t\t //decode with inSampleSize\n BitmapFactory.Options o2 = new BitmapFactory.Options();\n Bitmap resizedbitmap = BitmapFactory.decodeStream(is, null, o2);\n\t \n \t\t imageView.setImageBitmap(resizedbitmap);\n \t\t \n \t\t int bitmapHeight = resizedbitmap.getHeight();\n \t\t int bitmapWidth = resizedbitmap.getWidth();\n \t\t \n \t\t int imageViewHeight = imageView.getHeight();\n \t\t int imageViewWidth = imageView.getWidth();\n \t\t \n \t\t float additionalRatioX = (float) imageViewWidth / (float) bitmapWidth;\n \t\t float additionalRatioY = (float) imageViewHeight / (float) bitmapHeight;\n \t\t \n \t\t float additionalRatio = 1.0f;\n\t\t if( Math.abs(additionalRatioX - 1.0f) < Math.abs(additionalRatioY -1.0f) )\n \t\t {\n \t\t \tadditionalRatio = additionalRatioX;\n \t\t }\n \t\t else\n \t\t {\n \t\t \tadditionalRatio = additionalRatioY;\n \t\t }\n\t\t \n\t\t float heightInMeter = mapRecord.getHeight();\n\t\t float widthInMeter = mapRecord.getWidth();\n\t\t \n\t\t int heightInPixel = (int)heightInMeter * (int)mapRecord.getScalingY();\n\t\t int widthInPixel = (int)widthInMeter * (int)mapRecord.getScalingX();\n\t\t \n \t\t float scalingX = mapRecord.getScalingX() * additionalRatio;\n \t \tfloat scalingY = mapRecord.getScalingY() * additionalRatio;\n\t \t\n\t \tfloat offsetX = mapRecord.getOffsetX();\n\t \tfloat offsetY = mapRecord.getOffsetY();\n\t \t\n \t \tPoint oldZero = new Point(0.0f, 0.0f);\n\t \tPoint newZero = new Point(0.0f, -offsetY*additionalRatio);\n \t \t\n \t \tCoordinateTransformation coordinateTransformation = new CoordinateTransformation(oldZero, newZero);\n \t\t \n \t \timageView.clearReceiverPositions();\n \t\t for(ReceiverRecord receiverRecord : receiverRecords)\n \t\t {\n \t\t \tPoint receiverPosition = receiverRecord.getReceiverPosition();\n \t\t \treceiverPosition.scale(scalingX, scalingY);\n \t\t \treceiverPosition = coordinateTransformation.transformPosition(receiverPosition);\n \t\t \t\n \t\t \timageView.addReceiver(receiverRecord.getReceiverId(), receiverPosition);\n \t\t }\n \t\t \t\t \n \t\t imageView.invalidate();\n \n \t }", "public Matrix convertPGMtoMatrix(String address) throws IOException {\n FileInputStream fileInputStream = new FileInputStream(address);\n Scanner scan = new Scanner(fileInputStream);\n\n // Discard the magic number\n scan.nextLine();\n scan.nextLine();\n // Read pic width, height and max value\n int picWidth = scan.nextInt();\n int picHeight = scan.nextInt();\n\n fileInputStream.close();\n\n // Now parse the file as binary data\n fileInputStream = new FileInputStream(address);\n DataInputStream dis = new DataInputStream(fileInputStream);\n\n // look for 4 lines (i.e.: the header) and discard them\n int numnewlines = 3;\n while (numnewlines > 0) {\n char c;\n do {\n c = (char) (dis.readUnsignedByte());\n } while (c != '\\n');\n numnewlines--;\n }\n\n // read the image data\n double[][] data2D = new double[picHeight][picWidth];\n for (int row = 0; row < picHeight; row++) {\n for (int col = 0; col < picWidth; col++) {\n\n try {\n data2D[row][col] = dis.readUnsignedByte();\n } catch (Exception e) {\n mensagemErro = \"Erro ao ler byte na posição: linha: \" + row + \" coluna: \" + col;\n }\n }\n }\n\n return new Matrix(data2D);\n }", "public String convertImage(ImageView itemImage){\n Bitmap bmp = ((BitmapDrawable)itemImage.getDrawable()).getBitmap();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);\n byte[] byteArray = stream.toByteArray();\n String imageFile = Base64.encodeToString(byteArray, Base64.DEFAULT);\n return imageFile;\n }", "private void calculateMaps() {\n\tsrcrows = new int[destHeight + 1];\n\tfor (int y = 0; y <= destHeight; y++) {\n\t srcrows[y] = (2 * y * srcHeight + srcHeight) / (2 * destHeight);\n\t}\n\tsrccols = new int[destWidth + 1];\n\tfor (int x = 0; x <= destWidth; x++) {\n\t srccols[x] = (2 * x * srcWidth + srcWidth) / (2 * destWidth);\n\t}\n\n float xscale = ( ( float ) srcWidth - 1 ) / ( ( float ) destWidth );\n float yscale = ( ( float ) srcHeight - 1 ) / ( ( float ) destHeight ) ;\n\n srcxlarr = new int[destWidth+1];\n srcxuarr = new int[destWidth+1];\n srcxarr = new int[destWidth+1];\n\n for (int x = 0 ; x <= destWidth;x++) {\n float tmp = x * xscale ;\n srcxlarr[x] = (int) Math.floor( tmp ) ;\n srcxuarr[x] = (int) Math.ceil( tmp ) ;\n srcxarr[x] = (int) ( ( tmp - srcxlarr[x] ) * 255f );\n }\n\n srcylarr = new int[destHeight+1];\n srcyuarr = new int[destHeight+1];\n srcyarr = new int[destHeight+1];\n\n for (int y = 0 ; y <= destHeight;y++) {\n float tmp = y * yscale ;\n srcylarr[y] = (int) Math.floor( tmp ) ;\n srcyuarr[y] = (int) Math.ceil( tmp ) ;\n srcyarr[y] = (int) ( ( tmp - srcylarr[y] ) * 255f );\n }\n\n /*\n System.out.println( \"srcrows\" );\n for (int i=0;i<srcrows.length;i++) {\n System.out.print( srcrows[i] + \" \" );\n }\n\n System.out.println( \"\\nsrccols\" );\n for (int i=0;i<srccols.length;i++) {\n System.out.print( srccols[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxlarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcxlarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcxuarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcylarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcylarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcyuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcyuarr[i] + \" \" );\n }\n */\n }", "PointerByReference wkhtmltoimage_create_converter(PointerByReference settings, String data);", "@Override\n\tpublic boolean baseToImg() {\n\t\tList<Image> imgList = imageRepository.findAll();\n\t\tfor (Image img : imgList) {\n\t\t\tString base = img.getSource();\n\t\t\tFiles file = new Files(img.getSaegimId(), \"jpg\");\n\t\t\tfile = fileRepository.save(file);\n\t\t\tLong fileId = file.getId();\n\t\t\t\n\t\t\tBase64ToImgDecoder.decoder(base, dir + fileId + '.' + \"jpg\");\n\t\t}\n\t\treturn true;\n\t}", "static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}", "private static BufferedImage transformImage(BufferedImage image) {\n // Scale image to desired dimension (28 x 28)\n Image tmp = image.getScaledInstance(28, 28, Image.SCALE_SMOOTH);\n BufferedImage scaledImage = new BufferedImage(28, 28, BufferedImage.TYPE_INT_ARGB);\n\n Graphics2D g2d = scaledImage.createGraphics();\n g2d.drawImage(tmp, 0, 0, null);\n\n // Loop through each pixel of the new image\n for (int x = 0; x < 28; x++) {\n for (int y = 0; y < 28; y++) {\n // Get original color\n Color color = new Color(scaledImage.getRGB(x, y));\n\n // Ignore white values\n if (color.getRGB() == -1) {\n continue;\n }\n\n // 'Boost' the grey values so they become more black\n float[] hsv = new float[3];\n Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsv);\n hsv[2] = (float) 0.5 * hsv[2];\n int newColor = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);\n\n // Save new color\n scaledImage.setRGB(x, y, newColor);\n }\n }\n\n // Free resources\n g2d.dispose();\n\n return scaledImage;\n }", "private Bitmap translateImgToBitmap(String filepath){\n File imgFile = new File(filepath);\n\n if (imgFile.exists()) {\n Bitmap bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\n\n float imgScale = (float) bitmap.getHeight() / 1620;\n bitmap = Bitmap.createScaledBitmap(bitmap,\n Math.round(bitmap.getWidth() / imgScale),\n Math.round(bitmap.getHeight() / imgScale), true);\n\n return bitmap;\n\n } else {\n Toast.makeText(getApplicationContext(), \"Die Datei wurde nicht gefunden.\", Toast.LENGTH_SHORT).show();\n return null;\n }\n }", "private Bitmap convertToBitmap(byte[] b){\n\n return BitmapFactory.decodeByteArray(b, 0, b.length);\n\n }", "public static void convert( ImageBase input, ImageBase output ) {\n\n\t\tImageType typeIn = input.getImageType();\n\t\tImageType typeOut = output.getImageType();\n\n\t\tif (input instanceof ImageGray) {\n\t\t\tImageGray sb = (ImageGray)input;\n\t\t\tif (output instanceof ImageGray) {\n\t\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\t\toutput.setTo(input);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (output instanceof Planar) {\n\t\t\t\tPlanar ms = (Planar)output;\n\t\t\t\tfor (int i = 0; i < ms.getNumBands(); i++) {\n\t\t\t\t\tconvert(input, ms.getBand(i));\n\t\t\t\t}\n\t\t\t} else if (output instanceof ImageInterleaved) {\n\t\t\t\tImageInterleaved il = (ImageInterleaved)output;\n\t\t\t\tfor (int i = 0; i < il.getNumBands(); i++) {\n\t\t\t\t\tGImageMiscOps.insertBand(sb, i, il);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageInterleaved) {\n\t\t\tif (input.getClass() == output.getClass()) {\n\t\t\t\toutput.setTo(input);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tMethod m = ConvertImage.class.getMethod(\"convert\", input.getClass(), output.getClass());\n\t\t\t\t\tm.invoke(null, input, output);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageGray) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mi.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mi.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mi, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mi, so);\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof ImageInterleaved) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof Planar && output instanceof Planar) {\n\t\t\tPlanar mi = (Planar)input;\n\t\t\tPlanar mo = (Planar)output;\n\n\t\t\tif (mi.getBandType() == mo.getBandType()) {\n\t\t\t\tmo.setTo(mi);\n\t\t\t} else {\n\t\t\t\tfor (int i = 0; i < mi.getNumBands(); i++) {\n\t\t\t\t\tconvert(mi.getBand(i), mo.getBand(i));\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof Planar) {\n\t\t\tString functionName;\n\t\t\tif (typeIn.getDataType() == typeOut.getDataType()) {\n\t\t\t\tfunctionName = \"convert\";\n\t\t\t} else {\n\t\t\t\tfunctionName = \"convert\" + typeIn.getDataType() + typeOut.getDataType();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tMethod m = ConvertImage.class.getMethod(functionName, input.getClass(), output.getClass());\n\t\t\t\tm.invoke(null, input, output);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new IllegalArgumentException(\"Unknown conversion. \" +\n\t\t\t\t\t\tinput.getClass().getSimpleName() + \" to \" + output.getClass().getSimpleName());\n\t\t\t}\n\t\t} else if (input instanceof ImageInterleaved && output instanceof ImageGray) {\n\t\t\tImageInterleaved mb = (ImageInterleaved)input;\n\t\t\tImageGray so = (ImageGray)output;\n\n\t\t\tif (mb.getImageType().getDataType() != so.getDataType()) {\n\t\t\t\tint w = output.width;\n\t\t\t\tint h = output.height;\n\t\t\t\tImageGray tmp = GeneralizedImageOps.createSingleBand(mb.getImageType().getDataType(), w, h);\n\t\t\t\taverage(mb, tmp);\n\t\t\t\tconvert(tmp, so);\n\t\t\t} else {\n\t\t\t\taverage(mb, so);\n\t\t\t}\n\t\t} else {\n\t\t\tString nameInput = input.getClass().getSimpleName();\n\t\t\tString nameOutput = output.getClass().getSimpleName();\n\t\t\tthrow new IllegalArgumentException(\"Don't know how to convert between input types. \" + nameInput + \" \" + nameOutput);\n\t\t}\n\t}", "public @NotNull Image flipH()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n if (this.format != ColorFormat.RGBA)\n {\n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n // OPTION 1: Move pixels with memCopy()\n long src = Integer.toUnsignedLong(y * this.width + this.width - 1 - x) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, bytesPerLine);\n \n // OPTION 2: Just copy data pixel by pixel\n // output.put(y * this.width + x, this.data.getBytes(y * this.width + (this.width - 1 - x)));\n }\n }\n \n this.data.free();\n \n this.data = output;\n }\n else\n {\n // OPTION 3: Faster implementation (specific for 32bit pixels)\n // NOTE: It does not require additional allocations\n IntBuffer ptr = this.data.toBuffer().asIntBuffer();\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width / 2; x++)\n {\n int backup = ptr.get(y * this.width + x);\n ptr.put(y * this.width + x, ptr.get(y * this.width + this.width - 1 - x));\n ptr.put(y * this.width + this.width - 1 - x, backup);\n }\n }\n }\n this.mipmaps = 1;\n }\n \n return this;\n }", "@SuppressWarnings(\"unused\")\n private void toDataURL(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n this.map.snapshot(new GoogleMap.SnapshotReadyCallback() {\n \n @Override\n public void onSnapshotReady(Bitmap image) {\n float density = Resources.getSystem().getDisplayMetrics().density;\n image = PluginUtil.resizeBitmap(image,\n (int)(image.getWidth() / density),\n (int)(image.getHeight() / density));\n \n ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); \n image.compress(Bitmap.CompressFormat.PNG, 100, outputStream);\n byte[] byteArray = outputStream.toByteArray();\n String imageEncoded = \"data:image/png;base64,\" + \n Base64.encodeToString(byteArray, Base64.NO_WRAP);\n \n callbackContext.success(imageEncoded);\n }\n });\n \n }", "@Override\n public IIOMetadata getImageData() {\n return super.imageData;\n }", "@Override\n public void onPictureTaken(byte[] data, Camera camera) {\n Log.e(TAG, \"Saving a bitmap to file\");\n mCamera.startPreview();// The camera preview was automatically stopped. Start it again.\n mCamera.setPreviewCallback(this);\n Bitmap bmpOriginal = BitmapFactory.decodeByteArray(data, 0, data.length);\n Bitmap bmpGrayscale = convertToGrayscale(bmpOriginal);//\n try {\n File file = new File(mPictureFile);\n if (!file.exists()) file.createNewFile();\n FileOutputStream fos = new FileOutputStream(file);\n //is other format ok? ok!!! PNG is much clear than JPEG, but image file is also much larger\n bmpGrayscale.compress(Bitmap.CompressFormat.PNG, 0, fos);\n //fos.write(data);// Write the image in a file (in jpeg format)\n fos.flush();\n fos.close();\n } catch (java.io.IOException e) {\n Log.e(TAG, \"Exception in taking picture\", e);\n }\n// saveImageToGallery();\n }", "void mo12205a(Bitmap bitmap);", "PointerByReference wkhtmltoimage_create_converter(PointerByReference settings, Pointer data);", "public Map<String, Object> toMap(Object data) {\n\n try {\n String dataF = null;\n if (!(data instanceof String)) {\n dataF = toString(data);\n }\n// else {\n// dataF = objectMapper.writeValueAsString(data);\n// }\n return objectMapper.readValue(dataF, new TypeReference<Map<String, Object>>() {\n });\n } catch (IOException e) {\n logger.error(e.getMessage(), e);\n }\n return null;\n }", "@SuppressWarnings(\"unchecked\")\n private Object convertToDataTransferObject(Object data, Class<?> dtoType) {\n if (Map.class.isAssignableFrom(data.getClass())) {\n return ObjectUtils.convertMapToObject((Map<String, ?>) data, dtoType);\n }\n throw new ParamInvalidException(\"Cannot parse '\" + data.getClass().getName() + \"' to '\" + dtoType.getName() + \"'\");\n }", "public ImageConverter() {\n this.source = new Mat();\n this.convertedImage = new Mat();\n }", "Imagem getImagem();", "public void recycleBitmapData(){\n\t\tif(bmpData != null){\n\t\t\tbmpData.recycle();\n\t\t\tbmpData = null;\n\t\t}\n\t}", "public Output convertImage(final BufferedImage source) {\n\t\t// dimension of each tile\n\t\tDimension tileSize = this.characterCache.getCharacterImageSize();\n\n\t\t// round the width and height so we avoid partial characters\n\t\tint outputImageWidth = (source.getWidth() / tileSize.width)\n\t\t\t\t* tileSize.width;\n\t\tint outputImageHeight = (source.getHeight() / tileSize.height)\n\t\t\t\t* tileSize.height;\n\n\t\t// extract pixels from source image\n\t\tint[] imagePixels = source.getRGB(0, 0, outputImageWidth,\n\t\t\t\toutputImageHeight, null, 0, outputImageWidth);\n\n\t\t// process the pixels to a grayscale matrix\n\t\tGrayscaleMatrix sourceMatrix = new GrayscaleMatrix(imagePixels,\n\t\t\t\toutputImageWidth, outputImageHeight);\n\n\t\t// divide matrix into tiles for easy processing\n\t\tTiledGrayscaleMatrix tiledMatrix = new TiledGrayscaleMatrix(\n\t\t\t\tsourceMatrix, tileSize.width, tileSize.height);\n\n\t\tthis.output = initializeOutput(outputImageWidth, outputImageHeight);\n\n\t\t// compare each tile to every character to determine best fit\n\t\tfor (int i = 0; i < tiledMatrix.getTileCount(); i++) {\n\n\t\t\tGrayscaleMatrix tile = tiledMatrix.getTile(i);\n\n\t\t\tfloat minError = Float.MAX_VALUE;\n\t\t\tEntry<Character, GrayscaleMatrix> bestFit = null;\n\n\t\t\tfor (Entry<Character, GrayscaleMatrix> charImage : characterCache) {\n\t\t\t\tGrayscaleMatrix charPixels = charImage.getValue();\n\n\t\t\t\tfloat error = this.characterFitStrategy.calculateError(\n\t\t\t\t\t\tcharPixels, tile);\n\n\t\t\t\tif (error < minError) {\n\t\t\t\t\tminError = error;\n\t\t\t\t\tbestFit = charImage;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint tileX = ArrayUtils.convert1DtoX(i, tiledMatrix.getTilesX());\n\t\t\tint tileY = ArrayUtils.convert1DtoY(i, tiledMatrix.getTilesX());\n\n\t\t\t// copy character to output\n\t\t\taddCharacterToOutput(bestFit, imagePixels, tileX, tileY,\n\t\t\t\t\toutputImageWidth);\n\t\t}\n\n\t\tfinalizeOutput(imagePixels, outputImageWidth, outputImageHeight);\n\n\t\treturn this.output;\n\n\t}", "private static void removePadding(ImageWrapper image, Type type, ByteBuffer output) {\n int sizeLuma = image.y.width * image.y.height;\n int sizeChroma = image.u.width * image.u.height;\n\n if (image.y.rowStride > image.y.width) {\n removePaddingCompact(image.y, output, 0);\n } else {\n output.position(0);\n output.put(image.y.buffer);\n }\n\n if (type.equals(Type.YUV_420)) {\n if (image.u.rowStride > image.u.width) {\n removePaddingCompact(image.u, output, sizeLuma);\n removePaddingCompact(image.v, output, sizeLuma + sizeChroma);\n } else {\n output.position(sizeLuma);\n output.put(image.u.buffer);\n output.position(sizeLuma + sizeChroma);\n output.put(image.v.buffer);\n }\n } else {\n if (image.u.rowStride > image.u.width * 2) {\n removePaddingNotCompact(image, output, sizeLuma);\n } else {\n output.position(sizeLuma);\n output.put(image.u.buffer);\n byte lastOne = image.v.buffer.get(image.v.buffer.capacity() - 1);\n output.put(lastOne);\n }\n }\n output.rewind();\n }", "@Override\n public ImageData createFromParcel(Parcel source) {\n return new ImageData(source); // using parcelable constructor\n }", "@Override\r\n\tpublic BufferedImage transform(BufferedImage image){\n\t\tMat mat = Mat2BufImg.BufImg2Mat(image, BufferedImage.TYPE_3BYTE_BGR, CvType.CV_8UC3);\r\n\t\t//人脸识别\r\n\t\ttry {\r\n\t\t\t//mat --> bufferimage\r\n\t\t\treturn Mat2BufImg.Mat2BufImg(detectFace(mat),\".png\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn image;\r\n\t}", "private static int[][][] convertToArray(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n int[][][] result = new int[width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }", "private Bitmap decodeBitmapImage(int image) {\n int targetW = 300;\n int targetH = 300;\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n\n BitmapFactory.decodeResource(getResources(), image,\n bmOptions);\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW / targetW, photoH / targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n return BitmapFactory.decodeResource(getResources(), image,\n bmOptions);\n }", "private static Bitmap getImage(byte[] image) {\n /**\n * @brief convert from byte array to bitmap\n */\n return BitmapFactory.decodeByteArray(image, 0, image.length);\n }", "public static Map<String, Object> mapData(Object data) {\n\t\tMap<String, Object> modelMap = new HashMap<String,Object>(2);\n\t\tmodelMap.put(\"data\", data);\n\t\tmodelMap.put(\"success\", true);\n\t\t\n\t\treturn modelMap;\n\t}", "public abstract BufferedImage transform();", "private TileType[][] imageToWorld(BufferedImage image) {\n if (image == null) {\n return null;\n }\n\n width = image.getWidth();\n height = image.getHeight();\n int[] rgbWorld = image.getRGB(0, 0, width, height, null, 0, width);\n\n TileType[][] tileWorld = new TileType[width][height];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int index = twoDimIndexToOneDimIndex(x, y);\n tileWorld[x][y] = TileType.rgbColorToTile(rgbWorld[index]);\n if (tileWorld[x][y] == TileType.UNKNOWN) {\n System.err.println(\"Locaetion: \" + index + \" (\" + x + \",\" + y + \")\");\n }\n }\n }\n return tileWorld;\n }", "private Bitmap convertCursorRowToUXFormat(Cursor cursor) {\n // get row indices for our cursor\n int idx_poster_img = cursor.getColumnIndex(MoviesContract.MovieEntry.COLUMN_POSTER);\n\n byte[] blob = cursor.getBlob(idx_poster_img);\n ByteArrayInputStream inputStream = new ByteArrayInputStream(blob);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n\n return bitmap;\n }", "private javaxt.io.Image _transform(javaxt.io.Image src_img, double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n //Use GeoTools to reproject src_img to the output projection.\n try{\n\n //Compute geodetic w/h in degrees (used to specify the Envelope2D)\n double x1 = x(src_bbox[0]);\n double x2 = x(src_bbox[2]);\n double w = 0;\n if (x1>x2) w = x1-x2;\n else w = x2-x1;\n //System.out.println(x1 + \" to \" + x2 + \" = \" + (w));\n\n double y1 = y(src_bbox[1]);\n double y2 = y(src_bbox[3]);\n double h = 0;\n if (y1>y2) h = y1-y2;\n else h = y2-y1;\n //System.out.println(y1 + \" to \" + y2 + \" = \" + (h));\n\n\n System.out.println(src_bbox[0] + \", \" + src_bbox[1] + \", \" + src_bbox[2] + \", \" + src_bbox[3]);\n System.out.println(dst_bbox[0] + \", \" + dst_bbox[1] + \", \" + dst_bbox[2] + \", \" + dst_bbox[3]);\n \n Envelope2D envelope =\n new Envelope2D(this.src_srs.crs, src_bbox[0], src_bbox[1], w, h);\n\n GridCoverage2D gc2d =\n new GridCoverageFactory().create(\"BMImage\", src_img.getBufferedImage(), envelope);\n\n GridCoverage2D gc2dProj =\n (GridCoverage2D)Operations.DEFAULT.resample(gc2d, this.dst_srs.crs);\n\n //TODO: Crop Output?\n /* \n final AbstractProcessor processor = new DefaultProcessor(null);\n final ParameterValueGroup param = processor.getOperation(\"CoverageCrop\").getParameters();\n \n final GeneralEnvelope crop = new GeneralEnvelope( ... ); //<--Define new extents\n param.parameter(\"Source\").setValue( gc2dProj );\n param.parameter(\"Envelope\").setValue( crop );\n\n gc2dProj = (GridCoverage2D) processor.doOperation(param); \n */\n\n src_img = new javaxt.io.Image(gc2dProj.getRenderedImage());\n src_img.resize(dst_size[0], dst_size[1], false);\n\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n\n /*\n //Start port of original python code...\n src_bbox = this.src_srs.align_bbox(src_bbox);\n dst_bbox = this.dst_srs.align_bbox(dst_bbox);\n int[] src_size = new int[]{src_img.getWidth(), src_img.getHeight()}; //src_img.size\n double[] src_quad = new double[]{0, 0, src_size[0], src_size[1]};\n double[] dst_quad = new double[]{0, 0, dst_size[0], dst_size[1]};\n \n SRS.transf to_src_px = SRS.make_lin_transf(src_bbox, src_quad);\n SRS.transf to_dst_w = SRS.make_lin_transf(dst_quad, dst_bbox);\n\n //This segment still needs to be ported to java\n meshes = []; \n def dst_quad_to_src(quad):\n src_quad = []\n for dst_px in [(quad[0], quad[1]), (quad[0], quad[3]),\n (quad[2], quad[3]), (quad[2], quad[1])]:\n dst_w = to_dst_w(dst_px)\n src_w = self.dst_srs.transform_to(self.src_srs, dst_w)\n src_px = to_src_px(src_w)\n src_quad.extend(src_px)\n return quad, src_quad\n */\n\n /*\n int mesh_div = this.mesh_div;\n while (mesh_div > 1 && ((dst_size[0] / mesh_div) < 10 || (dst_size[1] / mesh_div) < 10))\n mesh_div -= 1;\n for (int[] quad : griddify(dst_quad, mesh_div))\n meshes.append(dst_quad_to_src(quad));\n result = src_img.as_image().transform(dst_size, Image.MESH, meshes,\n image_filter[self.resampling])\n */\n return src_img;\n }", "public abstract float scaleIntensityData(float rawData);", "public List<MapImage> convertMetdataToMapImages(PreparedQuery trackedMetadata) {\n List<MapImage> formLocationOptions = new ArrayList<>();\n for (Entity entity : trackedMetadata.asIterable()) {\n String location = (String) entity.getProperty(\"cityName\");\n double latitude = (double) entity.getProperty(\"latitude\");\n double longitude = (double) entity.getProperty(\"longitude\");\n\n formLocationOptions.add(new MapImage(latitude, longitude, location));\n }\n return formLocationOptions;\n }", "private Bitmap flipImage(byte[] input, FileOutputStream fos){\n\n\t\t\t\tMatrix rotate_matrix = new Matrix();\n\t\t\t\trotate_matrix.preScale(-1.0f, 1.0f);\n\t\t\t\tBitmapFactory bmf = new BitmapFactory();\n\t\t\t\tBitmap raw_bitmap = bmf.decodeByteArray(input, 0, input.length);\n\t\t\t\tBitmap result = Bitmap.createBitmap(raw_bitmap, 0, 0, raw_bitmap.getWidth(), raw_bitmap.getHeight(), rotate_matrix, true);\n\t\t\t\treturn result;\n\t\t\t\t/*\n\t\t\t\tresult.compress(Bitmap.CompressFormat.JPEG, 90, fos);\n\t\t\t\ttry {\n\t\t\t\t\tfos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}", "public static void setAdFormatInCache(Map<String,String> dataMap){ \t\n \tif(memcache !=null && memcache.contains(MEDIA_PLAN_ADFORMAT_KEY)){\n \t\tmemcache.delete(MEDIA_PLAN_ADFORMAT_KEY);\n \t}\n \tmemcache.put(MEDIA_PLAN_ADFORMAT_KEY, dataMap);\n\t}", "private javaxt.io.Image _transform_simple(javaxt.io.Image src_img, \n double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n double[] src_quad = new double[]{0, 0, src_img.getWidth(), src_img.getHeight()};\n SRS.transf to_src_px =SRS.make_lin_transf(src_bbox, src_quad);\n\n //minx, miny = to_src_px((dst_bbox[0], dst_bbox[3]));\n double[] min = to_src_px.transf(dst_bbox[0], dst_bbox[3]);\n double minx = min[0];\n double miny = min[1];\n\n //maxx, maxy = to_src_px((dst_bbox[2], dst_bbox[1]));\n double[] max = to_src_px.transf(dst_bbox[2], dst_bbox[1]);\n double maxx = max[0];\n double maxy = max[1];\n\n double src_res = (src_bbox[0]-src_bbox[2])/src_img.getWidth();\n double dst_res = (dst_bbox[0]-dst_bbox[2])/dst_size[0];\n\n double tenth_px_res = Math.abs(dst_res/(dst_size[0]*10));\n javaxt.io.Image img = new javaxt.io.Image(src_img.getBufferedImage());\n if (Math.abs(src_res-dst_res) < tenth_px_res){\n img.crop(cint(minx), cint(miny), dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(minx)+dst_size[0], cint(miny)+dst_size[1]);\n return img; //src_img;\n }\n else{\n img.crop(cint(minx), cint(miny), cint(maxx)-cint(minx), cint(maxy)-cint(miny));\n img.resize(dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(maxx), cint(maxy));\n //src_img.resize(dst_size[0], dst_size[1]);\n return img; //src_img;\n }\n //ImageSource(result, size=dst_size, transparent=src_img.transparent)\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n long imagename = System.currentTimeMillis();\n params.put(\"pic\", new DataPart(imagename + \".jpg\", getFileDataFromDrawable(bitmap)));\n return params;\n }", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "public static void saveImage(int[][][] imagePixels, String saveName){\n int height = imagePixels.length;\n int width = imagePixels[0].length;\n int[][] flat = new int[width*height][4];\n \n // Ask the user for the name of the output file.\n// try{\n// saveName = imageMain.console.readLine();\n// }\n// catch(IOException e){ \n// System.out.println(e);\n// System.exit(1);\n// }\n\n // If saveName does not already end in .bmp, then add .bmp to saveName.\n saveName=bmpTack(saveName);\n\n // Flatten the image into a 2D array.\n int index=0;\n for(int row=0; row<height; row++) {\n for(int col=0; col<width; col++) {\n for(int rgbo=0; rgbo<4; rgbo++) {\n flat[index][rgbo]=imagePixels[row][col][rgbo];\n }\n index++;\n } // for col\n } // for row\n\n // Combine the 8-bit red, green, blue, offset values into 32-bit words.\n int[] outPixels = new int[flat.length];\n for(int j=0; j<flat.length; j++) {\n outPixels[j] = ((flat[j][0]&0xff)<<16) | ((flat[j][1]&0xff)<<8)\n | (flat[j][2]&0xff) | ((flat[j][3]&0xff)<<24);\n } // for j\n\n // Write the data out to file with the name given by string saveName.\n BMPFile bmpf = new BMPFile();\n bmpf.saveBitmap(saveName, outPixels, width, height);\n System.out.println(\"Saved \" + saveName);\n }", "private void makeImgToTag() {\n\t\timgToTag = new HashMap<String, HashSet<String>>();\n\t\t// Goes through the tagtoimg map to create this map\n\t\tfor (String tag : tagToImg.keySet()) {\n\t\t\tfor (String pathName : tagToImg.get(tag)) {\n\t\t\t\tif (imgToTag.containsKey(pathName))\n\t\t\t\t\timgToTag.get(pathName).add(tag);\n\t\t\t\telse {\n\t\t\t\t\tHashSet<String> tags = new HashSet<String>();\n\t\t\t\t\ttags.add(tag);\n\t\t\t\t\timgToTag.put(pathName, tags);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic void testImageFromWindowsPhotoEditor2() throws IOException, ImageProcessingException, MetadataException {\n\t\tURL url = new URL(\"https://dbis-thure.uibk.ac.at/f/Get?id=BTCMSAGPZYLKPPLZWWQLSMKY\");\n\t\tRotatedBufferedImage bi = (RotatedBufferedImage) TrpImageIO.read(url);\n\t\tlogger.info(\"TrpImageIO result = \" + bi.getImageTransformation().toString());\n\t\t\n\t\tImageTransformation t = TrpImgMdParser.readImageDimension(url);\n\t\tlogger.info(\"TrpImgMdParser result = \" + t.toString());\n\t}", "public static Bitmap decodeBitmapSize(Bitmap bm, int IMAGE_BIGGER_SIDE_SIZE) {\n Bitmap b = null;\r\n\r\n\r\n //convert Bitmap to byte[]\r\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n bm.compress(Bitmap.CompressFormat.JPEG, 100, stream);\r\n byte[] byteArray = stream.toByteArray();\r\n\r\n //We need to know image width and height, \r\n //for it we create BitmapFactory.Options object and do BitmapFactory.decodeByteArray\r\n //inJustDecodeBounds = true - means that we do not need load Bitmap to memory\r\n //but we need just know width and height of it\r\n BitmapFactory.Options opt = new BitmapFactory.Options();\r\n opt.inJustDecodeBounds = true;\r\n BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length, opt);\r\n int CurrentWidth = opt.outWidth;\r\n int CurrentHeight = opt.outHeight;\r\n\r\n\r\n //there is function that can quick scale images\r\n //but we need to give in scale parameter, and scale - it is power of 2\r\n //for example 0,1,2,4,8,16...\r\n //what scale we need? for example our image 1000x1000 and we want it will be 100x100\r\n //we need scale image as match as possible but should leave it more then required size\r\n //in our case scale=8, we receive image 1000/8 = 125 so 125x125, \r\n //scale = 16 is incorrect in our case, because we receive 1000/16 = 63 so 63x63 image \r\n //and it is less then 100X100\r\n //this block of code calculate scale(we can do it another way, but this way it more clear to read)\r\n int scale = 1;\r\n int PowerOf2 = 0;\r\n int ResW = CurrentWidth;\r\n int ResH = CurrentHeight;\r\n if (ResW > IMAGE_BIGGER_SIDE_SIZE || ResH > IMAGE_BIGGER_SIDE_SIZE) {\r\n while (1 == 1) {\r\n PowerOf2++;\r\n scale = (int) Math.pow(2, PowerOf2);\r\n ResW = (int) ((double) opt.outWidth / (double) scale);\r\n ResH = (int) ((double) opt.outHeight / (double) scale);\r\n if (Math.max(ResW, ResH) < IMAGE_BIGGER_SIDE_SIZE) {\r\n PowerOf2--;\r\n scale = (int) Math.pow(2, PowerOf2);\r\n ResW = (int) ((double) opt.outWidth / (double) scale);\r\n ResH = (int) ((double) opt.outHeight / (double) scale);\r\n break;\r\n }\r\n\r\n }\r\n }\r\n\r\n\r\n //Decode our image using scale that we calculated\r\n BitmapFactory.Options opt2 = new BitmapFactory.Options();\r\n opt2.inSampleSize = scale;\r\n //opt2.inScaled = false;\r\n b = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length, opt2);\r\n\r\n\r\n //calculating new width and height\r\n int w = b.getWidth();\r\n int h = b.getHeight();\r\n if (w >= h) {\r\n w = IMAGE_BIGGER_SIDE_SIZE;\r\n h = (int) ((double) b.getHeight() * ((double) w / b.getWidth()));\r\n } else {\r\n h = IMAGE_BIGGER_SIDE_SIZE;\r\n w = (int) ((double) b.getWidth() * ((double) h / b.getHeight()));\r\n }\r\n\r\n\r\n //if we lucky and image already has correct sizes after quick scaling - return result\r\n if (opt2.outHeight == h && opt2.outWidth == w) {\r\n return b;\r\n }\r\n\r\n\r\n //we scaled our image as match as possible using quick method\r\n //and now we need to scale image to exactly size\r\n b = Bitmap.createScaledBitmap(b, w, h, true);\r\n\r\n\r\n return b;\r\n }", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "private boolean importDirectMappedImage(BufferedImage img) {\n \t\tif (format == Format.COLOR256_1x1 || isMono)\n \t\t\treturn false;\n \t\t\n \t\tint numColors = format == Format.COLOR4_1x1 ? 4\n \t\t\t\t: 16;\n \t\t\n \t\t// effective minimum distance for any mode\n \t\tint maxDist = 0xf*0xf * 3;\n \t\tint numPixels = img.getWidth() * img.getHeight();\n \t\t\n \t\tboolean matched = false;\n \t\tHistogram hist = new Histogram(img);\n \t\t\n \t\tList<byte[][]> palettes = new ArrayList<byte[][]>();\n \t\tpalettes.add(thePalette);\n \t\tif (isStandardPalette)\n \t\t\tpalettes.addAll(Arrays.asList(VdpCanvas.palettes()));\n \t\t\n \t\tfor (byte[][] palette : palettes) {\n \t\t\tint matchedC = hist.generate(new FixedPaletteMapColor(palette, firstColor, numColors), maxDist, ~0); \n \t\t\tif (matchedC == numPixels) {\n \t\t\t\tmatched = true;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\t\n \t\tif (matched) {\n \t\t\tfor (int c = 0; c < numColors; c++) {\n \t\t\t\treplaceColor(img, hist, c, rgb8ToPixel(thePalette[c]), Integer.MAX_VALUE);\n \t\t\t}\n \t\t\t\n \t\t\treturn true;\n \t\t}\n \t\t\n \t\treturn false;\n \t}", "private static Bitmap m8222a(URLConnection uRLConnection) {\n InputStream inputStream = uRLConnection.getInputStream();\n try {\n Bitmap a = C2995v.f8235a.m8223a(inputStream);\n return a;\n } finally {\n inputStream.close();\n }\n }", "public static void saveImage2(int[][] flat, String saveName, int width, int height){\n \n // Ask the user for the name of the output file.\n// try{\n// saveName = imageMain.console.readLine();\n// }\n// catch(IOException e){ \n// System.out.println(e);\n// System.exit(1);\n// }\n\n // If saveName does not already end in .bmp, then add .bmp to saveName.\n saveName=bmpTack(saveName);\n\n // Combine the 8-bit red, green, blue, offset values into 32-bit words.\n int[] outPixels = new int[flat.length];\n for(int j=0; j<flat.length; j++) {\n outPixels[j] = ((flat[j][0]&0xff)<<16) | ((flat[j][1]&0xff)<<8)\n | (flat[j][2]&0xff) | ((flat[j][3]&0xff)<<24);\n } // for j\n\n // Write the data out to file with the name given by string saveName.\n BMPFile bmpf = new BMPFile();\n bmpf.saveBitmap(saveName, outPixels, width, height);\n System.out.println(\"Saved \" + saveName);\n }", "public static void main (String[] args) throws FitsException, IOException, ClassNotFoundException {\n inFits = FileLoader.loadFits(ImageDataTest.class , fileName);\n frArray = FitsRead.createFitsReadArray(inFits);\n rangeValues = FitsRead.getDefaultRangeValues();\n ImageData imageData = new ImageData(frArray, IMAGE_TYPE,COLROID, rangeValues, 0,0, 100, 100, true );\n BufferedImage bufferedImage = imageData.getImage(frArray);\n File outputfile = new File(FileLoader.getDataPath(ImageDataTest.class)+\"imageDataTest.png\");\n ImageIO.write(bufferedImage, \"png\", outputfile);\n\n\n\n //test ImageData with mask\n imageData = new ImageData(frArray, IMAGE_TYPE,imageMasks,rangeValues, 0,0, 100, 100, true );\n bufferedImage = imageData.getImage(frArray);\n outputfile = new File(FileLoader.getDataPath(ImageDataTest.class)+\"imageDataWithMaskTest.png\");\n ImageIO.write(bufferedImage, \"png\", outputfile);\n\n }", "public void decodeImage(String completeImageData, ImageView imageView) {\n if (completeImageData == null) { return; }\n\n // Incase you're storing into aws or other places where we have extension stored in the starting.\n String imageDataBytes = completeImageData.substring(completeImageData.indexOf(\",\")+1);\n InputStream stream = new ByteArrayInputStream(Base64.decode(imageDataBytes.getBytes(), Base64.DEFAULT));\n Bitmap bitmap = BitmapFactory.decodeStream(stream);\n imageView.setImageBitmap(bitmap);\n }", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\r\n Bitmap b=(Bitmap)data.getExtras().get(\"data\");\r\n i1.setImageBitmap(b);\r\n\r\n }", "private static byte[] m17790a(Bitmap bitmap) {\n int i;\n int i2;\n int i3;\n int width = bitmap.getWidth();\n int height = bitmap.getHeight();\n OutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n for (i = 0; i < 32; i++) {\n byteArrayOutputStream.write(0);\n }\n int[] iArr = new int[(width - 2)];\n bitmap.getPixels(iArr, 0, width, 1, 0, width - 2, 1);\n Object obj = iArr[0] == -16777216 ? 1 : null;\n Object obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n int length = iArr.length;\n width = 0;\n int i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n int i5 = i4;\n int i6 = i5 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i3 = i - 1;\n } else {\n i3 = i;\n }\n iArr = new int[(height - 2)];\n bitmap.getPixels(iArr, 0, 1, 0, 1, 1, height - 2);\n obj = iArr[0] == -16777216 ? 1 : null;\n obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n length = iArr.length;\n width = 0;\n i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n i6 = i4 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i--;\n }\n for (i6 = 0; i6 < i3 * i; i6++) {\n C5225r.m17788a(byteArrayOutputStream, 1);\n }\n byte[] toByteArray = byteArrayOutputStream.toByteArray();\n toByteArray[0] = (byte) 1;\n toByteArray[1] = (byte) i5;\n toByteArray[2] = (byte) i4;\n toByteArray[3] = (byte) (i * i3);\n C5225r.m17787a(bitmap, toByteArray);\n return toByteArray;\n }", "private static final byte[] pkgload_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 0, 0,\n\t\t\t\t0, -91, 42, 42, -128, -128, -128, 94, 94, 94, -1, -1, -1, -1,\n\t\t\t\t-1, 0, -64, -64, -64, 94, 24, 24, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, 33, -2, 14, 77, 97, 100, 101, 32, 119, 105, 116, 104, 32,\n\t\t\t\t71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0, 8, 0, 44, 0, 0, 0, 0,\n\t\t\t\t16, 0, 16, 0, 0, 4, 88, 16, 73, 32, 103, -67, 8, -128, 64, 51,\n\t\t\t\t-17, -43, 22, -116, -38, 72, 98, -101, 38, 12, 37, 120, 1, 66,\n\t\t\t\t60, -60, 84, 44, -124, -33, -38, 18, -4, 45, -110, 63, 78, -63,\n\t\t\t\t64, -16, -91, 14, -100, -49, 112, 120, -53, 108, -112, 74, -61,\n\t\t\t\t-14, 102, -85, 90, -103, 8, 1, 111, -53, 45, 2, 10, 84, -62,\n\t\t\t\t82, 74, 30, -62, -102, -38, -79, 90, 0, -109, 104, -53, -16,\n\t\t\t\t66, -37, 77, -120, -109, -39, 21, -85, -98, 29, 1, 0, 59 };\n\t\treturn data;\n\t}", "private void decodeBase64AndSetImage(String completeImageData, ImageView imageView) {\n String imageDataBytes = completeImageData.substring(completeImageData.indexOf(\",\")+1);\n\n InputStream stream = new ByteArrayInputStream(Base64.decode(imageDataBytes.getBytes(), Base64.DEFAULT));\n\n Bitmap bitmap = BitmapFactory.decodeStream(stream);\n\n imageView.setImageBitmap(bitmap);\n }", "@Test\n\tvoid testToPixel() {\n\t\t\n\t\t// read the image map of ariel \n\t\tBufferedImage map = null;\n\t\ttry {\n\t\t\tmap = ImageIO.read(new File(\"Ariel1.png\"));\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tMap m= new Map(map,Width,Height,start,end);\n\n\n\t\tPoint3D ans1 =m.toPixel(start);\n\t\tassertTrue(ans1.equals(pixelStart));\n\n\t\tPoint3D ans2 =m.toPixel(end);\n\t\tassertTrue(ans2.equals(pixelEnd));\n\n\n\t\tPoint3D ans3 = m.toPixel(p);\n\t\tassertTrue(ans3.equals(p1));\n\n\t}", "public void gettingImageInput(){\n Bitmap bm = getYourInputImage();\n int z;\n if(res==2) { z=50; }\n else { z=224; }\n Bitmap bitmap = Bitmap.createScaledBitmap(bm, z, z, true);\n input = ByteBuffer.allocateDirect(z * z * 3 * 4).order(ByteOrder.nativeOrder());\n for (int y = 0; y < z; y++) {\n for (int x = 0; x < z; x++) {\n int px = bitmap.getPixel(x, y);\n\n // Get channel values from the pixel value.\n int r = Color.red(px);\n int g = Color.green(px);\n int b = Color.blue(px);\n\n // Normalize channel values to [-1.0, 1.0]. This requirement depends\n // on the model. For example, some models might require values to be\n // normalized to the range [0.0, 1.0] instead.\n float rf = (r) / 255.0f;\n float gf = (g) / 255.0f;\n float bf = (b) / 255.0f;\n\n input.putFloat(rf);\n input.putFloat(gf);\n input.putFloat(bf);\n }\n }\n }", "private static final byte[] pkg_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, -1,\n\t\t\t\t-6, -51, 0, 0, 0, -91, 42, 42, -128, -128, -128, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100,\n\t\t\t\t101, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4,\n\t\t\t\t1, 10, 0, 0, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 3, 64, 8, -86,\n\t\t\t\t-79, -48, 110, -123, 32, 32, -99, 110, -118, 93, 41, -57, -34,\n\t\t\t\t54, 13, 83, 88, 61, -35, -96, 6, -21, 37, -87, 48, 27, 75, -23,\n\t\t\t\t-38, -98, -26, 88, 114, 120, -18, 75, -102, 96, 7, -62, 16, 85,\n\t\t\t\t-116, 39, -38, -121, -105, 44, 46, 121, 68, -122, 39, -124,\n\t\t\t\t-119, 72, 47, 81, -85, 84, -101, 0, 0, 59 };\n\t\treturn data;\n\t}", "public @NotNull Image genMipmaps()\n {\n if (this.data != null)\n {\n // TODO - LWJGL-ify\n int mipCount = 1; // Required mipmap levels count (including base level)\n int mipWidth = this.width; // Base image width\n int mipHeight = this.height; // Base image height\n \n int mipSize = mipWidth * mipHeight * this.format.sizeof; // Image data size (in bytes)\n \n // Count mipmap levels required\n while (mipWidth != 1 || mipHeight != 1)\n {\n if (mipWidth != 1) mipWidth >>= 1;\n if (mipHeight != 1) mipHeight >>= 1;\n \n // Security check for NPOT textures\n if (mipWidth < 1) mipWidth = 1;\n if (mipHeight < 1) mipHeight = 1;\n \n Image.LOGGER.fine(\"Next mipmap level: %s x %s - current size %s\", mipWidth, mipHeight, mipSize);\n \n mipCount++;\n mipSize += mipWidth * mipHeight * this.format.sizeof; // Add mipmap size (in bytes)\n }\n \n if (this.mipmaps < mipCount)\n {\n Color.Buffer temp = Color.realloc(this.data, mipSize);\n \n if (temp.address() != 0)\n {\n this.data = temp; // Assign new pointer (new size) to store mipmaps data\n }\n else\n {\n Image.LOGGER.warning(\"IMAGE: Mipmaps required memory could not be allocated\");\n }\n \n // Pointer to allocated memory point where store next mipmap level data\n long nextMip = this.data.address() + (long) this.width * this.height * this.format.sizeof;\n \n mipWidth = this.width >> 1;\n mipHeight = this.height >> 1;\n mipSize = mipWidth * mipHeight * this.format.sizeof;\n Image imCopy = copy();\n \n for (int i = 1; i < mipCount; i++)\n {\n Image.LOGGER.fine(\"IMAGE: Generating mipmap level: %s (%s x %s) - size: %s - offset: 0x%x\", i, mipWidth, mipHeight, mipSize, nextMip);\n \n imCopy.resize(mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter\n \n if (imCopy.data != null) MemoryUtil.memCopy(imCopy.data.address(), nextMip, mipSize);\n nextMip += mipSize;\n this.mipmaps++;\n \n // Security check for NPOT textures\n if ((mipWidth >>= 1) < 1) mipWidth = 1;\n if ((mipHeight >>= 1) < 1) mipHeight = 1;\n \n mipSize = mipWidth * mipHeight * this.format.sizeof;\n }\n \n imCopy.delete();\n }\n else\n {\n Image.LOGGER.warning(\"Mipmaps already available\");\n }\n }\n return this;\n }", "@Override\n protected Map<String, DataPart> getByteData()\n {\n Map<String, DataPart> params = new HashMap<>();\n long imagename = System.currentTimeMillis();\n params.put(Keys.message, new DataPart(imagename + \".png\", getFileDataFromDrawable(bitmap)));\n return params;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK) {\n if (requestCode == CommenString.TAKE_PHOTO) {\n cameraUtil.photoZoomFromTake(CropperImageScale.square);\n } else if (requestCode == CommenString.LOCAL_PHOTO) {\n List<String> selectedImage = data.getStringArrayListExtra(\"paths\");\n cameraUtil.photoZoomFromMapStorage(selectedImage.get(0),\n CropperImageScale.square);\n } else if (requestCode == CommenString.PHOTO_RESULT) {\n Bundle extras = data.getExtras();\n if (extras != null) {\n headBitmap = extras.getParcelable(\"data\");\n image_up.setImageBitmap(headBitmap);\n }\n } else {\n }\n }\n }", "public static BufferedImage makePPM(byte[] aux) {\n int w = 0, h = 0;\n boolean fin = true;\n\n char[] iaux = new char[aux.length];\n for (int j = 0; j < aux.length; j++) {\n iaux[j] = (char) (aux[j] & 0xFF);\n }\n\n for (int i = 3; iaux[i] != '\\n'; ++i) {\n if (iaux[i] == ' ') fin = false;\n else {\n if (fin) {\n int a = Character.getNumericValue(iaux[i]);\n w *= 10;\n w += a;\n } else {\n int a = Character.getNumericValue(iaux[i]);\n h *= 10;\n h += a;\n }\n }\n }\n\n BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n int r, g, b, k = 0, pixel;\n for (int y = 0; y < h; y++) {\n for (int x = 0; (x < w) && ((k + 3) < aux.length); x++) {\n r = aux[k++] & 0xFF;\n g = aux[k++] & 0xFF;\n b = aux[k++] & 0xFF;\n pixel = 0xFF000000 + (r << 16) + (g << 8) + b;\n image.setRGB(x, y, pixel);\n }\n }\n\n return image;\n }", "@Override\n\tpublic void convertitMap(Map<String, Object> map) {\n\t\t\n\t}", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == Activity.RESULT_OK) {\n Uri selectedImageUri = data.getData();\n ParcelFileDescriptor parcelFileDescriptor;\n try {\n parcelFileDescriptor = getActivity().getContentResolver().openFileDescriptor(selectedImageUri, \"r\");\n FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();\n Bitmap mealImage = BitmapFactory.decodeFileDescriptor(fileDescriptor);\n parcelFileDescriptor.close();\n\n\n Bitmap mealImageScaled = Bitmap.createScaledBitmap(mealImage,\n LTAPIConstants.IMAGE_WIDTH_SIZE, LTAPIConstants.IMAGE_WIDTH_SIZE\n * mealImage.getHeight() / mealImage.getWidth(), false);\n\n Matrix matrix = new Matrix();\n //matrix.postRotate(90);\n Bitmap rotatedScaledMealImage = Bitmap.createBitmap(mealImageScaled, 0,\n 0, mealImageScaled.getWidth(), mealImageScaled.getHeight(),\n matrix, true);\n\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n rotatedScaledMealImage.compress(Bitmap.CompressFormat.JPEG, 100, bos);\n\n byte[] scaledData = bos.toByteArray();\n photoFile = new ParseFile(\"tripcard_photo.jpg\", scaledData);\n addPhotoToMealAndReturn(photoFile);\n\n photoFile.saveInBackground(new SaveCallback() {\n\n public void done(ParseException e) {\n if (e != null) {\n Toast.makeText(getActivity(),\n \"Error saving: \" + e.getMessage(),\n Toast.LENGTH_LONG).show();\n } else {\n debugShowToast(\"Saved???? \");\n }\n }\n });\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n // Override Android default landscape orientation and save portrait\n }\n }", "public native MagickImage magnifyImage() throws MagickException;", "private static double [][][] convertToArray1(BufferedImage image) {\n int width = image.getWidth();\n int height = image.getHeight();\n\n double [][][] result = new double [width][height][4];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int p = image.getRGB(x, y);\n int a = (p >> 24) & 0xff;\n int r = (p >> 16) & 0xff;\n int g = (p >> 8) & 0xff;\n int b = p & 0xff;\n\n result[x][y][0] = a;\n result[x][y][1] = r;\n result[x][y][2] = g;\n result[x][y][3] = b;\n }\n }\n return result;\n }", "public static Bitmap parseToBnW(byte[] data, int length){\n int valueIndex = 0;\n int width = data[valueIndex++] & 0xFF;\n int height = data[valueIndex++] & 0xFF;\n int numOfPixels = width*height;\n\n int[] pixels = new int[numOfPixels];\n\n int pixelIndex = 0;\n int bitIndex = 7;\n byte currentByte = 0x00;\n while (pixelIndex < numOfPixels) {\n // reassign data and index for every byte (8 bits).\n if (pixelIndex % 8 == 0) {\n currentByte = data[valueIndex++];\n bitIndex = 7;\n }\n pixels[pixelIndex++] = bitToRGB((currentByte >> bitIndex-- ) & 0x01);\n }\n\n if (pixelIndex != numOfPixels) {\n Rlog.e(LOG_TAG, \"parse end and size error\");\n }\n return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888);\n }", "public void adjustMap(MapData mapd){\n int[][] map = mapd.getMap();\n int mx=mapd.getX();\n int my=mapd.getY();\n for(int y=0;y<my;y++){\n for(int x=0;x<mx;x++){\n boolean l = false;\n boolean r = false;\n boolean t = false;\n boolean b = false;\n boolean tl = false;\n boolean tr = false;\n boolean bl = false;\n boolean br = false;\n \n\n if(map[x][y]>0 && map[x][y]<26) {\n int mustSet = 0;\n //LEFT\n if (x > 0 && map[x - 1][y] > 0 && map[x-1][y]<26) {\n l = true;\n }\n //RIGHT\n if (x < mx - 1 && map[x + 1][y] > 0 && map[x+1][y]<26) {\n r = true;\n }\n //TOP\n if (y > 0 && map[x][y - 1] > 0 && map[x][y-1]<26) {\n t = true;\n }\n //Bottom\n if (y < my - 1 && map[x][y + 1] > 0 && map[x][y+1]<26) {\n b = true;\n }\n //TOP LEFT\n if (x > 0 && y > 0 && map[x - 1][y - 1] > 0 && map[x-1][y-1]<26) {\n tl = true;\n }\n //TOP RIGHT\n if (x < mx - 1 && y > 0 && map[x + 1][y - 1] > 0 && map[x+1][y-1]<26) {\n tr = true;\n }\n //Bottom LEFT\n if (x > 0 && y < my - 1 && map[x - 1][y + 1] > 0 && map[x-1][y+1]<26) {\n bl = true;\n }\n //Bottom RIGHT\n if (x < mx - 1 && y < my - 1 && map[x + 1][y + 1] > 0 && map[x+1][y+1]<26) {\n br = true;\n }\n\n //Decide Image to View\n if (!r && !l && !t && !b) {\n mustSet = 23;\n }\n if (r && !l && !t && !b) {\n mustSet = 22;\n }\n if (!r && l && !t && !b) {\n mustSet = 25;\n }\n if (!r && !l && t && !b) {\n mustSet = 21;\n }\n if (!r && !l && !t && b) {\n mustSet = 19;\n }\n if (r && l && !t && !b) {\n mustSet = 24;\n }\n if (!r && !l && t && b) {\n mustSet = 20;\n }\n if (r && !l && t && !b && !tr) {\n mustSet = 11;\n }\n if (r && !l && t && !b && tr) {\n mustSet = 2;\n }\n if (!r && l && t && !b && !tl) {\n mustSet = 12;\n }\n if (!r && l && t && !b && tl) {\n mustSet = 3;\n }\n if (r && !l && !t && b && br) {\n mustSet = 1;\n }\n if (r && !l && !t && b && !br) {\n mustSet = 10;\n }\n if (!r && l && !t && b && bl) {\n mustSet = 4;\n }\n if (r && !l && t && b && !tr) {\n mustSet = 15;\n }\n if (r && !l && t && b && tr) {\n mustSet = 6;\n }\n if (!r && l && t && b && !tl) {\n mustSet = 17;\n }\n if (!r && l && t && b && tl) {\n mustSet = 8;\n }\n if (r && l && !t && b && !br) {\n mustSet = 14;\n }\n if (r && l && !t && b && br) {\n mustSet = 5;\n }\n if (r && l && t && !b && !tr) {\n mustSet = 16;\n }\n if (r && l && t && !b && tr) {\n mustSet = 7;\n }\n if (!r && l && !t && b && !bl) {\n mustSet = 13;\n }\n if (r && l && t && b && br && tl) {\n mustSet = 9;\n }\n if (r && l && t && b && !br && !tl) {\n mustSet = 18;\n }\n\n //System.out.println(\"MAP SEGMENT : \" + mustSet);\n map[x][y] = mustSet;\n }\n mapd.setMap(map);\n }\n }\n System.out.println(\"Map Adjust OK !\");\n }", "public native void constituteImage(int width, int height, String map,\n\t\t\tbyte[] pixels) throws MagickException;", "void parseMap(String mapData)\n {\n try {\n \n StringTokenizer\tst = new StringTokenizer(mapData);\n \n int\t\tsizeX, sizeY;\n int\t\tx = 0;\n int\t\ty = 0;\n int\t\te;\n char\tt;\n \n // Get the size of the map\n sizeX = Integer.parseInt(st.nextToken());\n sizeY = Integer.parseInt(st.nextToken());\n \n map = new MUXMap(sizeX, sizeY);\n \n // Loop thru each line\n while (st.hasMoreTokens())\n {\n String\t\t\tthisLine = st.nextToken();\n \n // Think the map is over if we hit this thing\n if (thisLine.equals(\"-1\") || thisLine.startsWith(\"-1 \"))\n break;\n \n for (x = 0; x < sizeX * 2; x+=2)\n {\n // Get terrain and elevation, then set the data in the map\n t = thisLine.charAt(x);\n e = Character.digit(thisLine.charAt(x + 1), 10);\n map.setHex(x/2, y, t, e);\n }\n \n // One more line down in y\n y++;\n } \n } catch (Exception e) {\n System.out.println(\"Error: readMap: \" + e);\n }\n \n }", "public Bitmap decodeImage() {\n\t\treturn image == null ? null : image.decodeBitmap();\n\t}", "private boolean setImageData(DataBuffer db) {\r\n AwtImageBackdoorAccessor dbAccess = AwtImageBackdoorAccessor.getInstance();\r\n try {\r\n imageData = dbAccess.getData(db);\r\n } catch (IllegalArgumentException e) {\r\n return false; // Unknown data buffer type\r\n }\r\n\r\n return true;\r\n }", "public byte[] readImagePNG(BufferedImage bufferedimage) throws IOException{\n byte[] data = ImageUtil.toByteArray(bufferedimage);\r\n /* \r\n for (int i = 0; i < data.length; i++) {\r\n if(i!=0&&i%4==0)\r\n System.out.println();\r\n System.out.format(\"%02X \",data[i]);\r\n }\r\n */ \r\n \r\n \r\n \r\n \r\n byte[] stximage = getStximage();\r\n byte[] etximage = getEtximage();\r\n \r\n byte[] stxdata = new byte[stximage.length];\r\n byte[] etxdata = new byte[etximage.length];\r\n byte[] length = new byte[4];\r\n \r\n boolean stxsw=false;\r\n boolean etxsw=false;\r\n byte[] full_data=null;\r\n byte[] only_data=null;\r\n try{\r\n for (int i = 0; i < data.length; i++) {\r\n System.arraycopy(data, i, stxdata,0, stxdata.length);\r\n stxsw = ByteUtil.equals(stximage, stxdata);\r\n int subindex=i+stxdata.length;\r\n if(stxsw){\r\n System.arraycopy(data, subindex, length,0, length.length);\r\n int length_fulldata = ConversionUtil.toInt(length);\r\n // System.out.format(\"%02X %d subIndex[%d]\",data[subindex],length_fulldata,subindex);\r\n \r\n \r\n subindex+=i+length.length;\r\n int etx_index= subindex+ length_fulldata;\r\n // System.out.println(\"subindex : \"+subindex+\" etx_index : \"+etx_index);\r\n System.arraycopy(data, etx_index, etxdata,0, etxdata.length);\r\n \r\n// for (int j = 0; j < etxdata.length; j++) {\r\n// System.out.format(\"%02X \",etxdata[j]);\r\n// }\r\n \r\n etxsw = ByteUtil.equals(etximage, etxdata);\r\n if(etxsw){\r\n full_data = new byte[etx_index-subindex];\r\n System.arraycopy(data, subindex, full_data,0, full_data.length); //fulldata\r\n break;\r\n }else{\r\n continue;\r\n }\r\n }\r\n \r\n \r\n }\r\n \r\n /////only data search\r\n System.arraycopy(full_data, 0, length,0, length.length);\r\n int length_onlydata = ConversionUtil.toInt(length); \r\n only_data = new byte[length_onlydata];\r\n System.arraycopy(full_data, length.length, only_data,0, only_data.length);\r\n \r\n \r\n \r\n }catch (Exception e) {\r\n return null;\r\n }\r\n \r\n return only_data;\r\n \r\n }", "Bitmap m7900a(Bitmap bitmap);", "public static void convertBinaryElevationMap(File root, boolean delete, boolean jpg) throws IOException {\n Queue<File> toProcess = new LinkedList<>();\n toProcess.add(root);\n while (!toProcess.isEmpty()) {\n File current = toProcess.poll();\n if (current.isDirectory()) {\n toProcess.addAll(Arrays.asList(current.listFiles()));\n System.out.println(\"> Explore \" + current);\n continue;\n }\n\n if (current.getName().endsWith(\"bin\")) {\n System.out.println(\"> converting \" + current);\n BufferedImage original = loadMapBinary16(current, 512, 512);\n BufferedImage replacement = convertG16ToRGB24(original);\n ImageIO.write(replacement, \"png\", new File(current.getAbsolutePath().replace(\"bin\", \"png\")));\n if (jpg) {\n ImageIO.write(replacement, \"jpg\", new File(current.getAbsolutePath().replace(\"bin\", \"jpg\")));\n }\n if (delete) {\n current.delete();\n }\n }\n\n }\n }", "int wkhtmltoimage_convert(PointerByReference converter);", "public PgmImage() {\r\n int[][] defaultPixels = {{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}};\r\n pixels = new int[defaultPixels.length][defaultPixels[0].length];\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[0].length; ++col) {\r\n pixels[row][col] = (int) (defaultPixels[row][col] * 255.0 / 12);\r\n }\r\n }\r\n pix2img();\r\n }", "public byte[] convertImage(Image image) {\n BufferedImage bytesImage = SwingFXUtils.fromFXImage(image, null);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] bytesArray = null;\n try {\n ImageIO.write(bytesImage, \"png\", baos);\n //coloca los bytes de la imagen en un arreglo de bytes\n bytesArray = baos.toByteArray();\n baos.close();\n return bytesArray;\n } catch (IOException ex) {\n Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public void setDeserializedIconData(List<MapItemData> deserializedData) {\n\n\t\tfor(MapItemData item : deserializedData) {\n\n\t\t\tString name = item.getAttributeString();\n\t\t\tString description = item.getDescriptionString();\n\t\t\tadditionalData.add(new MapItemData(name, description));\n\n\t\t}\n\n\t}", "public static Map<String, ArrayList<ImageDataModel>> getImageFolderMap(Activity activity) {\r\n imageFolderMap.clear();\r\n keyList.clear();\r\n imageDataModelList.clear();\r\n String BUCKET_ORDER_BY;\r\n Uri uri;\r\n Cursor cursor;\r\n int columnIndexDataPath, columnIndexFolderName, columnIndexTitleName,\r\n columnIndexDate, columnIndexSize, columnIndexBucketId, columnIndexAlbumId, columnIndexDuration;\r\n String absolutePathOfImage, folderName, imageTitle, fileDate, bucketId, AlbumId, fileSize, duration;\r\n\r\n /**\r\n * Fetching Audio type of files through content provider\r\n */\r\n /**\r\n * Fetching audio type of files through content provider\r\n */\r\n uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\r\n BUCKET_ORDER_BY = MediaStore.Audio.Media.DATE_MODIFIED + \" DESC\";\r\n String selection = MediaStore.Audio.Media.IS_MUSIC + \" != 0\";\r\n String[] projection1 = new String[]{MediaStore.Audio.AudioColumns.ALBUM,\r\n MediaStore.Audio.AudioColumns.ALBUM_ID,\r\n MediaStore.Audio.AudioColumns.DISPLAY_NAME,\r\n MediaStore.Audio.AudioColumns.DATA,\r\n MediaStore.Audio.AudioColumns.SIZE,\r\n MediaStore.Audio.AudioColumns.DATE_MODIFIED,\r\n\r\n MediaStore.Audio.AudioColumns.DURATION};\r\n\r\n cursor = activity.getContentResolver().query(uri, projection1, selection, null, BUCKET_ORDER_BY);\r\n if (cursor != null) {\r\n columnIndexFolderName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM);\r\n columnIndexAlbumId = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.ALBUM_ID);\r\n columnIndexTitleName = cursor\r\n .getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DISPLAY_NAME);\r\n\r\n columnIndexDataPath = cursor.getColumnIndexOrThrow(MediaStore.Audio.AudioColumns.DATA);\r\n while (cursor.moveToNext()) {\r\n absolutePathOfImage = cursor.getString(columnIndexDataPath);\r\n folderName = Constant.AUDIO_FOLDER_NAME;\r\n imageTitle = cursor.getString(columnIndexTitleName);\r\n\r\n ImageDataModel imageDataModel = new ImageDataModel();\r\n imageDataModel.setFile(new File(absolutePathOfImage));\r\n imageDataModel.setFolderName(folderName);\r\n imageDataModel.setPath(absolutePathOfImage);\r\n imageDataModel.setImageTitle(imageTitle);\r\n imageDataModel.setBucketId(\"1\");\r\n imageDataModel.setTimeDuration(\"0\");\r\n imageDataModel.setSelected(false);\r\n if (FileUtils.isImageFile(absolutePathOfImage)) {\r\n imageDataModel.setImage(true);\r\n } else if (FileUtils.isVideoFile(absolutePathOfImage)) {\r\n imageDataModel.setVideo(true);\r\n } else if (FileUtils.isAudioFile(absolutePathOfImage)) {\r\n imageDataModel.setAudio(true);\r\n }\r\n if (imageDataModel.getFile().length() > 0) {\r\n imageDataModelList.add(imageDataModel);\r\n if (imageFolderMap.containsKey(folderName)) {\r\n imageFolderMap.get(folderName).add(imageDataModel);\r\n } else {\r\n ArrayList<ImageDataModel> listOfAllImages = new ArrayList<ImageDataModel>();\r\n listOfAllImages.add(imageDataModel);\r\n imageFolderMap.put(folderName, listOfAllImages);\r\n }\r\n }\r\n }\r\n cursor.close();\r\n }\r\n keyList.addAll(imageFolderMap.keySet());\r\n //Send notification through main thread\r\n new Handler(Looper.getMainLooper()).post(new Runnable() {\r\n @Override\r\n public void run() {\r\n GlobalBus.getBus().post(new LandingFragmentNotification(Constant.UPDATE_UI));\r\n }\r\n });\r\n return imageFolderMap;\r\n }", "public static void codeAllImages(Args args) throws FileNotFoundException, IOException{\n BufferedImage tempI=null, tempP=null;\n BufferedImage[] codeOut = null;\n FileOutputStream fos = new FileOutputStream(args.output);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n int j = 0;\n //Iterate through all the images dividing them into frameP or frameI\n for(int i= 0; i < imageNames.size(); i++){ \n //j is a counter of the gop\n if(j >= (args.gop)){\n j=0;\n }\n if(j==0){\n // Frame I\n tempI = imageDict.get(imageNames.get(i));\n imgToZip(tempI, i, zipOS, \"image_coded_\");\n }else{\n //Frame P\n codeOut = createCodedImg(tempI, imageDict.get(imageNames.get(i)), args.thresh, args.tileSize, args.seekRange, args.comparator);\n imgToZip(codeOut[0], i, zipOS, \"image_coded_\");\n tempI = codeOut[1];\n //showImage(tempP);\n }\n j++;\n }\n //Get the gop, its always the first position of the coded data\n dataList.get(0).gop = args.gop;\n //Store into a .gz file all the info of every tile of every image, info that is stored into our dataList\n try {\n FileOutputStream out = new FileOutputStream(\"codedData.gz\");\n GZIPOutputStream gos = new GZIPOutputStream(out);\n ObjectOutputStream oos = new ObjectOutputStream(gos);\n oos.writeObject(dataList);\n oos.flush();\n gos.flush();\n out.flush();\n \n oos.close();\n gos.close();\n out.close();\n } catch (Exception e) {\n System.out.println(\"Problem serializing: \" + e);\n }\n \n FileInputStream fis = new FileInputStream(\"codedData.gz\");\n ZipEntry e = new ZipEntry(\"codedData.gz\");\n zipOS.putNextEntry(e);\n\n byte[] bytes = new byte[1024];\n int length;\n while ((length = fis.read(bytes)) >= 0) {\n zipOS.write(bytes, 0, length);\n }\n zipOS.closeEntry();\n fis.close();\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public Bitmap processCapturedImage(Intent intentData){\n Bitmap processedImage = (Bitmap) intentData.getExtras().get(\"data\");\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n processedImage.compress(Bitmap.CompressFormat.JPEG, 90, bytes);\n File destination = new File(Environment.getExternalStorageDirectory(),\n System.currentTimeMillis() + \".jpg\");\n FileOutputStream fo;\n try {\n destination.createNewFile();\n fo = new FileOutputStream(destination);\n fo.write(bytes.toByteArray());\n fo.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return processedImage;\n }", "private void convertBitmapToFile(Bitmap response, CustomRepoListener<File> listener) {\n //create a file to write bitmap data\n\n File f = new File(getFilename());\n try {\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n//Convert bitmap to byte array\n Bitmap bitmap = response;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);\n byte[] bitmapdata = bos.toByteArray();\n\n//write the bytes in file\n FileOutputStream fos = null;\n try {\n fos = new FileOutputStream(f);\n fos.write(bitmapdata);\n fos.flush();\n fos.close();\n listener.onSuccess(f);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "interface WorldmapBuffer2 {\n final static byte[] image2 = {\n -125, 47, -3, 77, 51, 29, -45, -103, -120, 119, 76, -122, -82, -22, -106, 61, 113, 4, -59, 124, -116, 59, 115, -26, -44,\n 56, -115, 34, 106, -124, 98, 83, -115, 70, 9, -67, -116, 99, 92, -127, 89, -23, -68, -11, -41, 72, -15, -68, -48, 4,\n 29, 85, -30, 4, -79, -56, -20, 126, 69, 119, -119, -115, -116, 60, -37, -53, -107, 68, 90, -45, 79, -99, 108, 109, 45,\n 84, -65, -93, -44, -79, -23, -40, 23, -40, -48, 98, -92, -50, 125, -104, -52, -58, 50, -97, -119, 13, -78, -81, 82, -86,\n 15, -71, -92, 77, -115, -48, 48, 77, -88, 6, 61, 104, -117, -51, 103, -90, 5, -71, -52, 42, 76, -68, 113, 79, -7,\n 43, -42, -84, 38, -56, -100, 93, -44, 34, 71, -113, 100, -116, 64, 42, 88, -40, 94, 93, -83, -118, -115, 99, -32, -27,\n 72, -26, 43, -104, 35, 7, 37, 101, 12, -66, 107, -104, -128, -106, -116, 54, -93, -83, -119, -50, 23, -47, -117, 39, 89,\n 6, -9, 41, 47, 10, -37, -124, -2, 115, -40, -55, -67, -37, -118, -118, 92, 108, 24, -41, 35, -43, -61, 45, 44, 118,\n 87, 92, 70, -14, 108, -37, -22, -106, -41, -127, 124, -92, -70, -99, -42, 22, -38, 106, 43, -8, -84, -97, -99, -39, -48,\n -6, -62, 78, -10, -98, -38, 109, -98, -23, -87, -45, 112, -67, 73, 42, 21, 99, -25, 109, -40, -21, 10, 120, -88, -110,\n -99, 105, -37, -97, 68, -70, -112, 15, 54, -99, 111, 77, 37, 108, 52, -33, 113, 93, 59, -33, 56, -78, 124, -85, 42,\n 107, -3, -54, -94, 29, -37, 97, -53, -54, -24, 8, -113, -18, 45, 108, 61, 122, -124, 19, 102, 118, -65, -14, -31, 32,\n 30, -30, -8, 35, -40, 102, -106, -109, -33, -115, -58, -27, 38, -37, 43, 88, 106, -11, -104, -51, -16, 11, -39, 116, 24,\n -123, -48, -6, 107, 73, -39, -31, -107, 109, -98, 85, -36, 39, 115, 61, -37, -33, 53, -61, -49, 103, -119, -73, 84, -35,\n -64, -6, 97, -72, -85, -98, -94, 58, -33, 127, 77, -34, 96, 90, -127, 58, -22, -118, -61, -83, 58, 96, 59, 95, 27,\n 11, -29, -123, 76, 79, -108, 11, -48, -35, -100, -40, 82, 4, 97, 57, -18, -36, -63, -94, -28, -105, -87, -76, -57, -84,\n 122, -13, -40, -60, -37, -6, -28, -105, -42, -34, -105, 76, 61, 59, -2, -27, -103, -125, -76, 111, 39, -39, 118, -88, -119,\n 56, 43, 116, 50, 22, -87, 44, 43, -91, 63, -21, -51, -2, -14, -26, -38, -76, 36, -26, -52, -122, -26, 100, -61, -75,\n -108, 7, 24, -24, 92, -37, -28, -116, -51, 52, 126, -33, -103, -102, 114, -27, 77, -24, -124, 87, 68, -13, -119, -28, 99,\n -71, -33, 25, 88, -49, 120, 41, -24, -125, -82, -62, 102, -25, -49, -119, 25, -82, 111, 38, 63, -52, 76, 26, 81, 71,\n 118, -115, 39, 125, -58, -94, -26, 29, -109, -25, -4, -92, -80, 43, -42, -83, -108, -66, -86, -65, 43, -25, 19, 70, -23,\n -80, -68, -54, -72, -3, -43, 32, -117, -93, 102, -93, 27, -29, -77, 56, -70, -38, -34, 27, -67, -94, 52, -75, -119, -73,\n -5, -45, 58, 120, -48, 107, 125, -112, 109, -84, -25, 40, 78, -21, -8, 69, -27, -117, -36, 108, 57, 93, -114, 52, 120,\n -32, 100, 68, -48, -51, 65, -35, -42, 78, 82, 58, -88, 96, -121, 126, -39, 104, 34, -123, -6, 9, 66, -35, 40, 107,\n 66, -120, -65, 127, -125, -19, -75, 6, 122, -30, -21, -74, 42, 126, -121, 2, 3, -19, 22, 20, 53, 85, 89, 61, -21,\n -25, -95, 94, 18, -18, -35, 70, -101, 33, 10, -80, 18, 35, 94, 99, -98, -18, 40, -66, 87, 54, -18, -23, -36, 107,\n -24, 8, 47, -28, -113, -61, -87, -20, -98, -19, -71, 45, -35, -128, -82, -80, -23, -121, -38, 99, -117, -70, 7, 104, -20,\n 52, 122, -18, 76, -115, -40, 36, -6, -16, 88, -59, -72, 127, -58, -111, 59, 126, -2, 82, -17, -68, -49, -18, -63, -118,\n 111, -109, -33, 120, -118, -50, -52, 52, -29, -121, -2, -62, 126, 26, -124, -46, -18, -112, -115, 92, -65, 117, 125, -16, -74,\n 74, 90, -9, 27, -61, 0, 111, 110, 2, -72, -125, -102, 30, 22, 42, -33, 115, 23, -6, -24, 124, -102, -57, -16, 78,\n -62, 76, -119, 91, -48, -87, -65, -71, 126, -118, -123, -89, -18, -31, -92, -13, -95, -68, -35, -63, -100, 55, 88, -68, -47,\n -69, 55, -12, 99, 33, -16, -34, -22, -63, 66, 78, -11, -93, 78, 66, 17, 12, -75, -115, 6, -109, 34, 9, 114, -108,\n -72, -103, 8, -76, 112, 58, 126, -16, -74, -34, 102, 29, -56, -64, 88, 103, 123, -91, 100, 55, 61, -55, -50, 59, -33,\n -22, 90, 55, -90, -106, -3, -20, -79, -35, 53, -112, -2, -47, 49, -114, -23, 30, 95, -16, 25, 70, -17, 75, 53, -9,\n -38, 73, 109, 53, 38, -10, 106, -102, 55, -17, -31, 76, -26, -6, -128, -110, -1, -44, 25, 7, -56, 86, -56, -9, -6,\n 9, -10, -57, -66, -20, 5, 125, -8, 106, -83, -8, -1, -89, -13, -114, 31, -97, -88, -120, 75, -21, 42, -22, -19, -111,\n 101, -117, 107, -30, -71, 121, -11, -99, 23, 88, -68, -8, -88, -85, 25, -128, 72, 47, -95, -122, -125, -87, 50, -82, 50,\n -14, -34, -92, 112, 102, -29, -87, -113, -106, -64, -18, 108, 26, 107, 32, 69, -37, 120, 10, -113, 118, -20, -2, 38, -46,\n 93, -116, -63, 23, 126, -19, 25, -55, -113, -95, -99, 121, -55, 106, -122, 29, 72, -32, 117, 103, -106, 86, -52, 104, -37,\n 15, -14, -122, -27, -33, 77, 79, 96, 4, 27, 34, -87, -6, 69, -69, -69, -93, 113, 3, -49, 69, -75, 56, 101, 106,\n 78, 57, 62, -15, -16, 92, -8, -63, -114, -48, -59, -82, 95, 52, 116, 108, 104, 11, -69, 78, 6, 16, 1, 4, 14,\n 36, 88, -48, -32, 65, -124, 9, 21, 46, 100, 56, 80, 0, 0, 1, 7, 35, 10, -96, 8, 49, 98, -61, -126, 15,\n 1, 108, -28, -40, -47, -29, 71, -112, 33, 69, -114, 36, 89, -46, -28, 73, -108, 41, 47, 98, 76, -88, 113, 100, -59,\n -115, 43, 9, -62, -20, 72, 49, -128, 77, -121, 11, 93, -106, -92, 72, 83, -92, -52, -101, 61, 29, -6, -12, -120, 51,\n -88, -48, -116, 10, -127, 74, 100, 57, 115, 105, 83, -88, 45, -97, 10, -20, 57, 53, 42, 84, -93, 59, 85, 62, 20,\n -86, 53, -27, 87, -80, 97, -59, -114, 37, 91, -42, 108, 88, -85, 87, -43, -82, 101, -120, 52, -93, 70, -93, 87, -67,\n -98, -91, 91, -41, -82, -39, -86, 108, -25, 22, -35, 25, 119, -24, -57, -117, 50, -105, 86, 37, 10, 56, 110, -31, -102,\n 84, -111, 30, -2, -23, 23, -95, 85, -57, 65, 115, 98, -115, -52, 118, 109, 86, -73, -106, -43, 10, 30, -37, -109, 35,\n -30, -69, -2, -95, 69, -113, 38, 93, 58, 100, 90, -51, -87, 85, 27, -52, -85, 23, -76, 105, -40, -79, -47, 14, 69,\n -51, 122, 47, 95, -61, -84, 1, 83, 117, 74, -8, -90, 83, -117, 46, 43, 7, -83, 73, 24, -13, -17, -103, -89, 99,\n 54, -100, -24, -72, -7, 98, -29, -61, 21, -41, 94, -51, 50, 115, 117, -21, -103, 111, -13, -12, 44, -37, -5, 119, -16,\n -31, 65, 82, -57, 94, -34, -68, -50, -18, -30, -43, -81, 79, 60, 25, -29, -21, -94, 55, 79, -21, 110, -1, -5, -16,\n 68, -38, -48, -87, -73, 126, 59, 84, -30, 120, -72, -104, -29, -115, 53, -34, -116, -21, -17, 49, -14, -50, 83, -80, 41,\n -56, -2, -21, 108, 34, -10, 34, -108, 112, 66, -80, 18, 92, -16, -62, -43, -46, -93, 112, 67, -39, 4, -77, 78, 37,\n -86, 78, 3, -118, -90, -107, 112, 10, 44, -90, -86, -118, -77, -112, -71, 18, 31, -37, 77, -70, -57, -108, -102, 46, 58,\n 4, 49, -76, -47, -75, -89, 42, -37, -114, 39, -30, 56, -12, -15, 71, 9, 87, -68, 113, 72, -84, -128, 52, 114, 52,\n 15, -33, -5, -22, -60, -58, 104, 91, 14, 57, -59, -28, -5, -52, 64, 5, 3, 67, 48, -66, -53, 90, -126, 18, 61,\n 24, -119, -12, 50, -71, 39, -35, 123, -85, -84, 18, -113, 52, -13, 76, -46, -124, -4, 114, 77, 7, -47, 116, -77, -77,\n -103, 62, 4, 81, -54, -105, 66, -2, -124, 9, 63, -121, 32, -30, 107, -56, -25, -24, -29, 75, -51, 40, 9, -108, -18,\n 58, 54, 11, 5, 46, -52, -93, 108, -61, 11, -52, 55, 27, 117, 116, 73, 67, 35, 109, -53, -90, 29, 31, -75, 52,\n -52, 4, 43, 125, -47, 36, 38, -21, -53, 19, 75, 27, -97, -93, -76, 83, 80, 47, 27, 49, 63, 26, 37, 85, -107,\n -50, 39, 73, 100, -108, -52, 87, 47, -107, 117, 86, 64, 87, 93, -112, 43, -8, 102, -75, -76, 69, 37, -105, -52, -75,\n -43, -15, 14, 45, -11, -42, 1, 41, 101, 117, 79, -53, -4, 66, -83, 86, 91, 85, 35, -86, -71, 97, 53, -27, 49,\n 68, 93, -85, -107, -107, -39, 102, -85, -85, 8, 66, 107, -83, 53, -111, 65, -76, 78, -30, 118, -73, -93, -126, -67, 49,\n 48, -63, -74, -61, -42, 63, 49, 109, 91, 55, -37, -88, -26, 42, 108, -80, -77, -54, -20, -10, -34, 55, -33, -123, 87,\n -77, -82, -16, -11, 118, 75, -99, 68, 51, -18, 37, 19, -5, -22, -46, -39, -106, -22, -20, 109, -77, 1, -37, 117, 120,\n -33, 42, 81, 26, 76, -38, -97, 62, -11, -9, -30, 35, -7, -125, -40, 75, 13, 49, -34, 21, -32, -124, -21, -30, -17,\n -41, -32, -114, -123, -24, 92, -91, 42, 30, 89, -56, -26, -100, -118, 113, -29, 80, -59, 45, -40, 100, 72, -87, -11, -8,\n 102, 31, -11, -123, -103, 50, -118, 113, -34, -48, 74, -26, -2, 66, 51, -111, 83, 81, -55, 13, 85, 42, 17, -91, 34,\n 15, -49, -55, -46, -43, 121, -25, -128, -125, 123, -115, -79, 37, 17, -19, -39, 103, -84, -45, -124, -102, -29, -85, -77, -114,\n -80, -27, -74, -46, 36, -103, -44, -8, 8, -115, 55, 58, -115, 37, -14, -86, 54, -77, 103, 76, 21, 74, -96, -73, -66,\n 80, -39, -67, 56, -37, 74, 89, -81, -13, 86, -17, 105, -71, 83, -42, -37, -51, 59, -89, -22, -72, 49, -76, 83, 28,\n 79, 102, -102, -91, 62, 85, 109, -76, -109, 114, 92, 41, -31, 14, -114, 44, -45, -103, -5, 38, 114, -22, -116, 36, 6,\n 57, -15, -65, 59, 23, -38, 114, 12, -69, -10, -4, 107, 116, 65, 43, -4, 101, -50, 125, 37, -102, -72, -126, -17, -44,\n -119, 41, 22, 87, 84, -106, 103, 116, 65, -97, 123, -57, 17, 53, 119, 113, 116, -34, -111, -76, -3, -68, -63, 123, -49,\n -8, -74, -74, -75, -76, -7, 59, -83, -26, 125, 29, 118, -32, -29, -52, -82, 70, -105, 127, -41, 107, -38, -52, -87, -9,\n 83, 120, -20, -21, -107, 30, -8, -20, -49, 36, 12, 89, -84, 98, 37, 51, 120, -18, -124, 91, -98, -7, -14, -66, 101,\n 16, 61, -55, 54, -33, 62, 108, -21, -113, 87, 88, -47, -18, -21, 39, -117, 111, -23, 73, -74, 95, -68, 17, -45, 94,\n 95, -4, 7, 125, -81, 124, -84, 74, 75, 1, -101, -41, -66, -1, 65, -18, 113, -2, -17, -21, 21, 73, 114, 7, 32,\n -33, 108, -55, 112, -5, -93, -96, -18, 24, -104, -84, 10, 2, 73, 112, 122, 1, 96, 120, -58, -123, 40, 2, 25, 47,\n 125, 28, -20, -115, -1, -16, -73, 49, 105, -107, 14, 64, 74, -109, -110, -24, 50, 88, -65, -30, 93, 48, 106, 47, -4,\n -103, 8, -49, 102, -79, 32, -127, -49, 54, 54, -44, 22, 9, -99, -57, 67, 25, -50, -112, 96, 117, 43, -99, 91, -32,\n 66, 67, 36, 110, 37, -120, -17, 113, 97, 18, 5, 38, -93, 120, 9, 43, 103, 13, 99, 23, 16, 17, 38, 23, -25,\n 64, 113, -119, 65, -69, -33, 4, -115, -24, 68, 48, 90, 112, -117, 109, 10, -29, 122, 96, 4, -88, -2, -3, -120, 105,\n -127, 58, 31, 118, -48, -120, 58, -12, -115, -47, 111, 104, 73, 79, 119, -56, 87, 70, 60, 126, 70, -114, -41, -53, 35,\n 120, -10, -109, -91, -73, 52, -15, 46, -38, -79, -48, -63, -62, 119, -74, 28, 105, 113, -113, 33, -85, -48, -119, -122, -90,\n -89, 62, 70, -46, 92, 123, -44, -97, 36, 69, -74, 52, 64, -70, 103, -126, 14, 20, 100, -46, 2, 37, 59, 55, -54,\n 69, -127, 112, 92, 36, 25, 37, 118, 50, -55, 84, -46, -110, 97, 124, -37, -5, 58, -71, -54, -102, 89, 39, -109, -101,\n -53, -107, 10, -75, -89, 49, -106, -123, -14, -112, -118, -100, 78, 41, -123, 40, 46, 84, 114, 5, -106, -61, -2, 4, 85,\n -23, -74, -9, 74, 98, -118, 107, 82, -2, -5, 95, 1, 43, 22, -56, -15, 49, -82, -112, -70, 124, 30, 47, -87, -24,\n -53, 64, -118, -114, 108, -55, 36, -90, 49, -39, -120, -86, 19, -14, -117, -101, -90, 97, 91, 15, -35, 39, 63, 79, 101,\n 115, -120, 125, -111, -32, 125, 100, -103, -95, -3, 116, 105, -125, -40, 68, -112, 42, -127, 53, 78, 110, 50, -55, 105, -124,\n 10, -25, 101, -16, 89, -102, 114, 102, -24, -100, 127, 25, 86, 8, 55, -103, 21, 20, -127, -19, -102, -67, 108, -29, 21,\n -95, 39, 32, 82, -46, -77, -125, -100, -76, -25, 63, -111, -88, -49, 4, -50, -115, -117, 22, -3, 28, -5, -32, -55, 68,\n -72, 24, -48, 93, -3, 3, 90, -110, 30, 26, 71, 126, 89, -77, 45, -11, -108, 40, -3, 56, -6, -46, 105, 5, 40,\n -93, -38, 58, -35, -18, 96, 42, -78, 81, -102, -109, 65, 1, -35, -52, 96, 60, -54, 56, -121, -94, -76, -95, -46, -108,\n 104, 69, 111, -118, -49, 113, -127, -110, 123, -122, -71, 14, 50, -113, 42, 56, 67, 70, -47, 60, -52, -102, -35, 74, -43,\n 6, 66, 44, 102, 83, -87, -25, 99, -90, 12, 7, 118, 84, -80, 98, -55, 124, 9, -116, 33, 56, 35, 88, 41, -124,\n -122, -11, 126, 59, 36, -42, 84, 119, -7, -55, -91, -111, 52, -99, 88, -20, 42, 68, -83, 122, 32, -41, 64, -52, -87,\n 106, -59, -2, 99, 29, 17, -7, -80, -22, -119, 40, -123, 56, -28, 43, -30, -94, -89, 81, -73, -18, 114, 84, -120, -52,\n 11, 59, 125, -8, 88, -107, 2, -106, 69, 3, 53, -44, 94, 11, 91, 70, 87, 37, 11, 114, 56, 69, -25, 101, -97,\n -7, -61, -48, 29, 112, -89, 11, -107, -86, 98, -26, 90, 90, -122, 49, -47, -118, 92, 2, -19, -86, 44, -21, 89, 86,\n -114, 21, -78, -90, -75, -117, -35, 96, -21, -55, 5, -74, 53, -79, -76, -101, -22, 105, -33, -6, -37, -55, 10, -107, -95,\n 8, 92, -104, -83, 94, 123, 91, 26, 62, 18, -107, -77, -20, -47, 32, 39, 10, -37, 8, -110, 86, -76, 35, -116, -105,\n 69, 122, -21, -37, -103, 114, -87, 86, -109, 107, -36, 112, 89, 42, -87, -29, 34, 55, -125, -117, -63, -18, 123, -98, -69,\n -42, -13, -14, -107, -92, 101, 21, -24, 116, -63, -75, 92, 109, -23, 16, -75, 67, 53, 85, -125, 22, 39, -62, 126, 54,\n 80, -68, 96, -91, 84, 121, -19, 26, 94, -85, -19, 87, -113, 44, 68, -20, 110, -85, 11, -33, 12, -27, 102, 70, -26,\n -67, 43, 77, 103, 87, -94, -74, 25, 49, 82, 0, 22, -16, 11, 63, -120, 45, -27, 58, -105, -80, -73, 21, 41, 101,\n 83, -22, -34, -9, 34, 56, 53, 68, 116, 108, 100, 67, 88, -91, -82, -12, 73, 42, 39, 94, 19, -123, 43, 108, 97,\n 2, -14, -53, -88, -54, 76, 93, -2, 97, 33, 76, 37, -23, 6, -107, -102, 114, 25, 112, 124, -43, 37, 98, 22, -45,\n 119, -86, 107, -116, 104, -114, 67, -9, -30, -53, -6, 68, 95, 20, -34, 38, 116, 91, -85, -74, 42, 69, -39, -97, 64,\n -106, 113, 99, 18, 90, -28, -43, 38, 118, 89, -62, 61, 23, -110, 109, 76, -89, 119, -71, 56, 56, 21, 54, -87, -112,\n 71, 12, -30, 16, -29, -49, 116, -57, -117, -18, -115, 35, -52, 39, -17, 2, 54, -65, -65, -12, -14, 83, 109, -74, 46,\n 49, 35, -7, -66, -11, -116, 42, 112, 117, 124, 96, 42, -69, 6, -126, -60, -5, -22, 105, -25, -20, 48, -19, 112, 57,\n 102, 9, -83, 51, 76, -19, 21, -24, -115, 54, 90, -61, 79, 94, 96, -97, -33, -71, 99, 30, -9, -40, 89, 107, 67,\n -50, -116, -105, 27, -35, 2, -117, 105, -98, 45, 30, 112, -98, 37, -35, 59, 82, 89, 122, -61, -89, 94, 84, 110, -125,\n -20, 97, 81, 98, 58, -45, 88, 77, 22, -114, 33, 44, 22, 34, -93, -84, -75, -119, 84, 117, -83, 19, 99, 106, 86,\n -13, -82, -65, -2, -75, 105, -80, 91, 125, -40, 34, -97, 16, -44, -20, 125, 53, -96, 105, -51, 92, 68, -29, -102, 77,\n -89, -118, 91, 127, 14, 77, -48, 82, 27, -5, -91, -54, 115, -10, 32, 55, -23, -39, 61, -81, -74, -41, 39, 61, 10,\n -124, -77, -37, 109, -66, -31, -46, -108, -70, 27, 119, -84, -2, -93, -73, -27, -97, -10, -44, 92, -64, -42, -10, -24, -28,\n -43, -19, 122, -47, -51, -55, -82, 86, 116, -104, 121, 105, 72, -86, 126, 16, -46, 56, 18, 92, 0, 57, -106, 31, 88,\n 67, -75, 118, -17, -124, -113, -64, -21, 109, -25, 16, -25, -69, -36, 99, -6, 50, -65, -5, -67, 93, 120, -29, 53, -53,\n 13, 46, 49, -102, 59, -53, 41, -74, 74, 57, 64, -110, 115, -77, -94, -109, -13, 43, 79, 63, 92, -110, -78, -69, 100,\n -32, 8, -87, -42, 68, -38, 117, -29, 51, -49, -15, -96, 10, 119, 115, -25, 104, -38, -29, 77, -28, 76, 63, 83, -68,\n -100, 66, -30, 9, -86, 124, -82, -102, -54, -43, 91, 36, -94, 21, -70, 124, -24, -30, 47, -86, 24, 28, -17, 6, -101,\n -8, -101, -108, -34, -116, -50, 13, -68, -22, 57, 109, 107, -87, -49, -54, -22, 64, -47, 102, -12, 122, -77, 28, -28, -127,\n 85, 98, 115, 45, 10, -22, 75, 71, -99, -36, 102, -82, -94, 100, -99, 61, 103, 122, -31, 69, -74, -15, -3, 108, -38,\n -35, 103, 48, -80, -121, 125, -42, 117, -1, 56, -115, -51, -114, -44, -39, 74, 29, -42, -51, 14, -7, -32, 35, -99, -33,\n -72, 79, -102, -18, 124, -49, 41, -78, 77, 70, -17, -68, 3, 6, -77, 123, -97, 15, -39, 99, 41, -64, 127, 110, -105,\n 50, 80, 118, -9, 50, -37, 77, -58, -49, -1, -37, 119, 110, 28, -5, 40, 71, -2, 45, -81, -56, -17, 45, -27, 127,\n 83, -109, -70, -42, 45, -79, -114, 21, 14, -106, -102, 71, -19, -25, -73, -102, -32, -126, 18, -36, -14, -100, -59, 125, -4,\n 52, 14, -78, 71, -85, 8, -14, -87, 63, -39, -22, -11, 102, 105, -41, -13, -111, 46, -58, -62, 118, 31, 105, -49, -40,\n 15, -37, 125, -60, 70, -21, 105, -15, 0, -84, 51, 85, 54, 40, -73, -63, -49, 54, -15, -3, -24, -4, -96, 79, 50,\n -67, -72, 110, -22, -16, -15, -11, -4, -50, -89, -10, -36, 24, -92, 62, 72, 115, 45, -59, -114, -78, 63, -106, -108, -10,\n -23, -29, 29, -82, 58, -17, -13, 55, -24, 56, -98, -114, -73, -65, 117, -48, 111, -125, 49, -11, 75, 63, 2, 84, -69,\n -23, -53, -67, 21, -77, -72, 60, -61, 48, -98, 107, 54, 115, 75, -91, -61, -127, 21, -29, -53, 63, 48, 10, -67, 68,\n -103, 64, -63, 34, -94, -66, -126, -74, -11, -21, 64, -102, -85, 58, 4, 36, -68, 28, -119, 13, -86, -126, -107, 87, 3,\n -101, -1, -117, 63, -13, -93, 64, 97, 107, -67, 20, 124, 56, -86, -30, 64, 63, 99, -69, -22, 107, 63, 44, 3, 24,\n 12, -12, 61, 57, 65, -81, -100, -104, 24, -125, -86, -79, 10, 25, 63, 22, -20, -90, 92, -94, 45, -67, 11, -68, -89,\n -109, 65, -63, 43, 45, 78, 91, 48, -73, -77, -113, 28, 44, -67, -99, -46, 30, 118, -7, 35, 35, 92, -2, 62, 33,\n 28, 66, 34, -52, -88, 21, -76, 36, 111, -14, 64, 26, 52, 64, 49, -52, 36, 78, 115, 39, -54, -118, 66, 49, -46,\n 47, 19, 108, -95, -63, -77, -110, -67, -78, 45, 45, 12, -85, -5, -96, -101, -32, -61, 60, 61, -53, -118, 25, -108, -71,\n -7, -110, 62, -51, -38, 48, 94, -93, 51, -17, 8, -65, 75, 2, 51, 35, -45, 36, 32, -12, -69, 46, -116, 67, -20,\n 57, -88, -121, 73, -101, 68, 20, -64, -57, 57, -93, 1, -36, 67, -43, 106, 47, 63, -28, -68, 57, -30, 31, 53, 20,\n -103, -10, -64, -92, 78, -93, -62, 67, 84, 68, 57, 92, 40, 103, 122, -79, 13, 42, -94, -18, 114, -65, 62, -52, 67,\n 104, 75, 30, -109, 67, -61, -39, -128, 31, 114, 50, 60, 94, 65, -90, -5, 19, 69, 14, -117, -71, -111, 34, -77, 37,\n 116, -65, 37, 43, -64, -24, -117, -107, 112, -21, 13, 10, -39, -113, 14, -15, 68, -14, 90, -108, 71, -60, -59, 10, -86,\n 42, -68, 90, -58, -3, -47, -66, -68, 122, -102, 94, 83, -74, 98, 27, -58, -65, -101, 16, -74, 57, 70, -91, 57, -85,\n -66, -125, -108, 59, 98, 70, 27, 51, -106, -61, -40, 61, 14, -21, -59, -121, -62, 62, 92, 1, -61, 73, -92, -72, -2,\n 113, 18, 13, -110, -59, 89, -44, 69, -40, 113, -86, -42, -127, 70, 113, -20, 30, 3, -55, 57, 83, -76, -75, -82, -93,\n 58, -10, -2, 74, -58, 76, -71, -70, -1, 48, -73, 0, -100, 34, 64, 124, -94, 106, 19, 41, 91, -60, -107, 97, -53,\n 71, 61, 43, 54, -15, -22, -86, -96, 75, 64, 77, -62, 37, -68, 25, 72, -126, 44, 72, 59, -12, -98, -124, 124, 34,\n 40, -84, -74, 19, 107, -56, -104, -80, 8, -120, -84, -77, 17, -108, -69, 97, -62, 57, -24, -24, 69, -95, -29, 51, -117,\n 28, 67, 36, 100, -100, 107, -55, 68, -40, -128, -106, 86, -63, -81, 124, 43, -118, -109, 68, 73, -27, -13, -107, 22, 90,\n -91, -38, -15, -63, 14, 123, 29, -37, -101, 38, -99, 90, 38, -40, -29, -112, 82, -20, 16, 54, -45, -111, 44, -28, -92,\n -98, 100, -75, -60, 107, -92, 79, -127, 69, -42, -29, 21, 44, -117, -89, 39, 52, 74, 62, 84, -62, -85, -94, -88, 91,\n 52, 35, 70, 34, 65, 116, -14, -63, -88, -92, -88, -87, -108, -76, 7, 2, -54, -65, 120, -56, 72, 82, -88, -83, 28,\n 41, 34, -93, 61, -92, 60, 51, -43, 34, 49, 115, 100, 15, -56, 64, -98, 108, -124, -81, 52, -70, -97, 78, 92, -53,\n 70, 83, 58, -65, -93, 13, 0, -6, 58, 124, 100, -54, -89, -61, -56, 22, -87, 63, 38, 100, -57, 36, 52, 47, -105,\n 43, 56, -124, -4, 73, -128, -86, 27, 81, 123, -91, 103, 17, 38, -62, -116, -56, -88, -100, 24, -47, -60, 72, 20, 105,\n 70, 1, -63, 67, 68, -61, -58, -2, 36, -116, 43, -68, 84, -84, 109, -68, -52, -67, 20, 27, -62, 73, 75, 17, -111,\n 60, -84, -4, 76, 47, 76, -85, -61, -76, -113, -127, -109, -90, -15, -6, 61, -32, 83, -97, 30, -92, 58, -114, 99, 27,\n -111, 4, 70, -103, -116, -51, -81, 113, -87, 99, 116, -96, 43, -124, 19, 121, 73, 30, -36, 20, -80, -126, -103, 18, 110,\n -117, 19, -82, -112, -73, -33, 108, 31, -43, 76, 20, -20, 36, -50, -27, -111, 28, -16, -100, -52, -81, 124, 61, 109, 4,\n -114, -37, -100, 15, -41, -13, -52, -15, -87, -51, 41, -103, 78, 50, -13, 38, 47, 26, -55, -23, -79, -80, 50, 59, -61,\n -92, -72, -49, -43, -20, 70, -62, 43, -49, 101, -6, -56, -13, 36, 68, 96, 107, -78, -30, 88, 62, 7, -22, 62, -8,\n -100, 72, -6, 72, 17, 122, -84, -81, -59, 100, -52, 3, -111, 68, -115, 107, 61, -128, -124, 58, -55, -44, -82, -86, 84,\n -93, 24, 27, 80, -84, 43, -55, 122, -31, -114, 79, 75, 80, -22, -84, 67, -30, 26, -49, -25, 121, -48, 26, 26, 78,\n 15, -13, 41, -83, -108, 62, -76, 12, 67, -109, -93, -85, 111, 44, 70, -79, 50, -53, 25, 117, 74, 9, 18, -47, -8,\n 60, -106, -116, -101, 37, 20, 13, -48, 78, 43, 81, -108, 122, -55, 61, 44, -94, 11, 109, 59, 75, -4, 81, 101, 26,\n 80, 2, -11, -53, -74, -44, -47, -3, -46, 16, -29, -116, -2, -63, 14, 109, -63, 78, 123, 63, -6, 11, -46, 25, 108,\n 55, -106, -95, -58, 42, 53, -109, 38, -3, -100, -12, 76, -70, 79, 83, 82, 40, -75, 31, -54, -23, 41, -38, -52, 26,\n -56, -100, 75, 44, -91, -53, 27, 36, 79, 61, 36, 67, 90, -71, -47, -38, 58, 72, 3, -3, -119, 30, 27, -45, 51,\n 21, 74, -38, -111, -89, -108, -116, -58, -18, -68, -69, 84, -20, -49, -82, 76, -50, 56, 77, 59, 51, -107, -103, -31, -61,\n 15, -84, -84, 36, 8, 89, -44, 62, 93, -60, -103, 4, -56, 112, -12, -100, 114, -116, 40, -52, 49, -44, 67, 69, -44,\n 24, 109, 35, 73, -27, 20, -43, 11, 83, -85, -4, 75, 0, -103, -44, 83, 67, 63, 43, -38, 39, 24, 58, -50, -51,\n 116, 78, 78, 53, 60, 79, -75, -72, -55, 12, 85, 51, -38, 84, 59, -35, 77, 83, -27, 73, 84, 45, 76, -80, 68,\n 76, 57, -29, -45, 70, 33, 36, -33, -48, -97, 116, -103, 83, -57, -29, -77, -37, -85, -90, 47, 21, -98, -25, 104, 63,\n -50, -124, -86, 94, -115, -68, 55, -126, 28, -83, -100, 39, 97, -51, -105, -125, -20, 25, -90, -77, 46, 33, 91, 56, -73,\n -95, 67, -49, 83, 69, -52, -124, -95, 75, 108, 86, 78, 10, -53, 105, -51, -69, 106, 37, 48, -72, 121, -103, 108, 5,\n -100, 109, -51, -70, -112, 18, 67, 112, 45, -73, -14, -101, -46, -72, -102, -100, -117, -2, 58, -41, 92, 109, 18, -26, 92,\n 87, -107, 107, 87, -89, 115, 28, 105, 12, -59, 60, -70, -50, -71, 68, -72, 74, 44, 88, 39, 116, 88, -13, -116, 70,\n -62, -126, -61, 32, 68, 69, -127, -91, -42, 86, -76, 33, 122, 28, 75, -64, 11, -49, -70, -6, 83, -55, -14, 70, -101,\n 76, -82, -26, -93, 88, 49, -30, -66, -117, -123, -63, -116, 37, 37, -56, 36, -43, 124, 90, 41, -3, -28, 64, -115, -108,\n -56, 36, -78, 45, -109, -27, -114, 74, 75, 89, -93, -93, 82, 5, 116, -75, 107, 109, -70, -88, -13, 82, 90, 29, 90,\n 91, -115, 71, -117, -55, 48, -100, -35, 62, -99, 29, -40, -22, 19, -51, 56, 114, 51, -68, -71, -87, -101, 3, -83, 116,\n -5, -44, -66, -116, 75, 97, -31, 88, 27, 4, -66, -50, 88, 90, -104, -5, 43, 82, 60, 61, -76, 43, -41, -105, -107,\n -96, 11, 52, -47, 115, -13, 68, -78, 117, -94, -64, -68, 84, -83, 19, 65, 81, -27, 85, -81, -107, 90, 10, 125, -73,\n 101, 81, -75, -94, -83, -106, -123, 124, -64, 66, -12, 51, -75, 93, 83, 10, -102, 24, 15, 37, -100, 23, 13, 44, 59,\n -20, -52, -68, -99, -37, 107, 113, 85, -6, -78, -64, -78, -28, 40, 19, 74, -44, -76, 117, -47, 110, -94, 89, 114, 41,\n 84, 104, 90, -81, 50, 84, -36, -77, 27, 90, 119, -71, -100, -89, 58, 88, -76, -83, -43, -88, 122, -46, -2, -39, 115,\n 23, 88, -115, 56, -100, 99, 42, -50, -51, 60, 56, 69, -57, -34, 115, 52, -47, -19, -37, 75, -13, 43, -103, 75, -36,\n 124, -79, 92, 98, -13, 19, -83, 45, -48, -42, 29, -89, -69, -123, -35, 3, -108, -38, -58, 77, 82, -7, 66, 29, -36,\n 29, -42, -120, -75, -70, 76, -20, 93, -21, -124, -96, -33, 77, 88, 40, 42, -54, 35, -5, -109, -28, 5, -45, -30, 61,\n 51, 70, 100, -80, -21, 85, 94, -27, 124, 54, 83, -46, -89, 112, 76, -98, 91, -117, -34, 10, -44, -94, -39, -67, -107,\n 82, -119, 87, -84, -95, 94, 89, 101, -97, -92, 18, 82, -90, -24, 94, -17, -3, -34, 76, 17, 43, 60, 5, 88, -84,\n 99, 95, -13, 69, -109, -94, 28, -75, 80, 25, -37, 93, 101, 37, 40, 27, 84, -87, -30, -106, -104, 93, -37, -107, 92,\n -34, -91, 89, 95, -98, -93, -40, -22, -20, -33, 69, -52, -111, -47, 28, -35, 17, 19, 78, 5, 102, 91, -125, 77, 96,\n -122, -7, -71, 119, 124, 92, -56, 101, -32, 72, 3, 76, -71, -109, -46, -128, -107, 96, 76, 77, -42, -111, -46, -85, -114,\n 36, -32, -102, -93, -87, 2, -71, 59, -35, 117, -35, -120, 21, -32, -57, -117, 18, -118, -23, -52, -109, -125, -116, 25, -93,\n 95, 20, -74, -102, -47, -38, 26, -61, 36, 89, 25, -42, 37, -82, 4, -36, -107, -101, 97, 61, -46, -114, -53, 117, 94,\n -91, 43, -2, 41, -104, -67, 84, -61, -8, -31, -113, -95, 93, 96, -75, 29, 31, -10, -93, 115, 82, 51, 89, -67, -39,\n 109, 83, -30, -46, 68, -111, -65, 68, -63, -69, 89, -30, -103, 125, 78, 16, -91, 98, 121, -19, 84, 36, -75, 28, -2,\n -83, -55, 15, -36, -68, -51, -53, -30, 58, -51, 96, -55, 83, -49, -30, 35, 19, 49, 54, -64, 28, 54, 73, 53, -58,\n 94, -26, 107, 88, 87, -46, -32, -62, -77, 68, 124, 27, -59, -17, -83, -40, -30, 123, -61, 65, 1, -29, -46, 124, -29,\n 63, -66, 60, -42, 92, 34, 41, 118, 86, -2, -109, -75, 29, 76, 50, 47, -122, -50, -63, -11, -74, 27, 36, -76, -2,\n -94, 99, -50, 93, -42, 45, -126, 100, 109, -43, -75, 67, -82, 56, -124, 101, 84, 18, 108, 83, -44, -107, 26, 36, -114,\n 100, -65, 60, -46, -33, 17, 101, -128, -126, -40, 77, -93, 60, -24, 26, 98, -63, -60, -47, 67, 117, -71, 127, -107, -27,\n -27, -108, -45, 82, 78, -82, -90, 114, -93, -42, 51, -59, 18, -86, -28, 32, -119, 85, 30, -75, -27, -2, -75, 66, 108,\n -126, 102, -112, 124, 90, 102, -61, -60, 76, 86, 80, 107, 13, 85, 3, 94, 101, 97, 54, 90, 24, -67, 32, 106, -82,\n -26, 74, -77, 96, 21, -106, -57, -119, 52, 70, -28, 73, -61, -41, -4, -26, 58, -114, 99, 113, 38, -30, 122, -20, 102,\n 108, -34, -60, 116, -74, 62, 102, -2, -18, 34, 70, 125, -78, 47, 114, 103, 93, 113, 95, 74, -22, -41, -104, 100, -29,\n 115, 6, -48, 123, 94, -74, 20, 93, -116, -84, -19, 86, 127, -66, 20, -128, 30, -93, 113, 38, 103, -1, -28, 60, -28,\n -37, 89, 0, -52, 95, -42, -19, -94, -56, 65, -39, 16, 109, -24, 42, -42, 84, -120, -82, 89, 74, 4, 42, -32, 28,\n 89, 106, 77, -95, 22, 94, 62, -14, -39, 100, -113, -50, 24, -45, 107, 100, 55, 38, -28, 11, 29, 14, 102, -117, 104,\n -74, 101, -24, -67, -127, -65, -106, -58, 94, -113, 82, -72, -104, -106, -23, -119, 110, 99, 21, 69, 103, 113, -60, -55, 32,\n 73, -58, -99, -10, 95, 23, 101, -36, 125, -79, -23, 91, -98, -23, 2, 2, -44, -75, 92, 84, -116, 78, -22, 98, -52,\n -114, -59, 50, -25, 66, 113, -22, -89, 102, -72, 8, -117, -22, -88, -10, -26, 81, -74, -22, -117, -23, -46, 79, 5, -81,\n 13, -36, 41, 55, 44, 92, 69, -39, 39, -114, -18, -45, 124, -58, 13, -78, -10, 23, 82, -98, 58, 120, -31, 106, -83,\n -15, 33, 35, -126, 74, -121, -44, -111, -117, -75, 88, -112, -61, -21, -99, 46, -62, 122, 54, 46, -23, -99, -83, 76, -51,\n -49, -34, -20, 26, -63, 14, 92, -25, 104, 56, 116, -99, -21, -36, 101, 69, -7, -83, 44, -25, 91, -59, 64, -94, 37,\n -7, 104, 103, -103, -55, -57, -78, 74, 62, -79, -106, 108, -2, -105, 14, 106, -69, -98, -74, -53, 102, -84, 51, -86, -65,\n -20, 52, -23, 58, 105, -20, -20, 81, -25, -49, 114, -19, -122, -66, -53, -32, -78, -20, -61, -90, -20, -1, 90, -106, 57,\n 9, -19, 35, 52, -24, -73, 22, 109, -121, 38, 109, -83, -66, -82, -55, 67, 78, -84, -10, 78, 71, -82, 15, -39, 102,\n 83, -82, 27, 97, -22, 91, 110, 119, 62, 99, 98, -26, -109, -37, -58, 109, -104, 116, 27, 16, -98, 31, -24, -58, -103,\n -14, -19, -51, 26, 11, 76, -32, -42, 91, -98, -94, 101, -30, 118, -31, -111, 110, -68, 31, -78, -52, -92, 13, 102, -97,\n -36, 97, -40, -82, 60, -118, 11, -17, 127, 14, 107, -21, -114, -104, -76, 54, -18, 79, -106, 51, 41, 68, -29, -34, 118,\n 30, -110, 99, 60, -10, -106, 111, 35, -111, 86, -62, -2, -110, -19, -58, -62, 118, -60, -48, 31, 92, -34, -110, 57, -31,\n -2, 38, -24, -3, -51, 110, 1, 127, 20, -88, 68, 109, -114, -87, -18, -6, -50, -41, -90, 97, -32, -85, 29, -40, 6,\n -33, -76, -83, 13, -16, 9, 7, -25, -31, -10, -36, -12, -71, 111, -4, 22, -22, 118, 114, -16, -14, 58, -16, 110, 105,\n 25, 53, 11, 65, 23, -9, -25, -60, -2, -43, 19, -57, 44, -52, 69, -17, -110, -90, -38, 68, -42, 109, -90, 117, 92,\n -101, -14, -15, 17, -9, 22, -71, -76, -15, -59, 59, 95, 105, 26, 91, 37, 71, -2, 86, 59, 21, -14, 35, 68, -68,\n -43, -106, -16, 33, 15, 110, 127, -93, 110, 20, -9, -68, -77, -78, 97, -72, -35, -17, 68, 110, -17, -93, 49, -24, 41,\n -9, 94, 60, -77, -14, 43, 23, 100, 12, 70, -42, 28, 102, -19, 84, -67, -21, 48, -1, -105, -9, 61, -21, -31, 45,\n -13, 49, -92, 109, -2, -98, 31, 59, -26, 69, 54, 111, -13, 127, -122, -16, -58, 34, 115, 12, 103, 114, 43, -58, -63,\n 88, -68, 115, 60, -65, -21, 25, -113, -18, 78, 37, 36, 63, -1, 115, 26, -4, 91, 23, 82, -17, 96, -69, -26, -83,\n 62, 116, 97, 102, 106, 126, -69, 54, 17, 55, 87, 118, -108, -26, 71, -105, -14, 40, -3, -40, 60, -41, 115, 71, -79,\n 116, 57, -21, 50, 63, 13, -22, -15, -18, -12, -28, 30, 71, 76, 47, 111, 81, 7, 28, -38, 5, 96, -11, 61, -11,\n -23, 30, 79, -106, 6, -16, 76, 119, 52, -81, 122, -11, -6, 109, 81, -30, 60, 52, 74, 87, -68, 112, -114, -36, 46,\n -105, -15, 59, 12, -94, 96, 87, -29, 90, -28, -50, 55, 69, 110, 87, 79, -30, -1, -28, -103, 104, -37, 109, 6, -105,\n 67, -17, -2, 105, 94, -9, -56, 98, -87, -62, 35, 38, -67, 100, 26, -17, 102, -30, 87, 106, 47, -10, -48, -107, -93,\n -72, -50, 118, 45, -66, 98, 42, -110, -89, 11, -82, 106, 70, 55, -15, 66, 14, -44, 52, -116, 108, -120, -2, 11, 104,\n 116, 39, -15, -66, 5, 119, -54, -48, -11, 112, 110, -60, 85, 103, 94, -34, -18, -40, 82, 74, 118, -13, 117, -27, -75,\n 43, 104, 48, 95, -32, 126, -81, 112, 66, -89, 50, -126, -65, 106, 95, 122, -8, -33, -3, -32, -38, -122, -13, 58, 23,\n -8, 56, 126, 104, -58, 110, -8, 47, -98, -26, 123, -65, -52, 106, -124, -25, -128, -57, 90, -105, 12, 90, 109, -30, -8,\n 16, -90, 39, -119, 87, 92, 95, 15, 98, 120, 31, -32, -50, -43, 113, 120, -65, -11, -44, 53, 101, 72, -12, -8, -113,\n 111, 102, 8, 63, 65, -25, 6, -38, -127, -66, 100, -29, 49, 62, -25, 85, 101, -100, -49, 121, -78, -36, 121, -97, 61,\n 35, 112, -13, -54, 64, 87, -20, 60, 61, -10, -94, 50, 122, -66, 44, 113, 68, 43, -60, -107, 79, 119, 45, 105, -7,\n -55, -70, 122, -113, 105, 118, 74, -106, -6, -93, 111, 122, -98, 63, -61, 125, -117, 17, 80, 55, 123, -101, -105, -61, 86,\n -97, 48, -80, -49, 105, -79, 95, -31, 119, -11, 116, -30, 21, -7, -96, -9, -20, -106, 26, -7, -74, -105, -74, -73, 39,\n 48, 39, 39, 122, 103, -74, -25, 56, 92, 123, -74, -49, -5, 64, 68, 122, 64, -89, -9, -104, -73, -8, -124, -49, 63,\n -63, -33, 106, -62, 47, -4, -67, -9, 84, -82, -41, 68, -125, -97, 50, -69, -113, -6, -57, -73, -47, 55, -105, 124, -22,\n 52, -37, -2, 27, 34, 119, -17, 107, 124, -45, -50, -4, -101, -116, 124, -105, -60, -13, -77, -81, 71, -48, 15, 125, -52,\n 39, -3, -89, -82, -38, -98, 47, 123, -11, -93, 121, 45, 20, 125, 3, 119, -3, 89, -36, -4, -116, 7, -51, 1, 68,\n 90, -120, -76, -3, 11, -57, -3, -68, -58, -66, -54, 70, 124, 68, 22, -91, 126, 38, 76, -32, 95, 116, -31, -81, 45,\n -35, 71, 94, -71, -105, -3, 34, -59, -51, -27, 55, -11, -26, 23, -45, -92, -124, 116, -34, 23, -89, -23, -84, -2, -22,\n -67, 126, -25, 34, -2, -33, -101, 124, 8, -27, -2, -18, 31, 50, 73, 127, 118, -16, -65, 37, 67, 78, -17, 72, 55,\n -1, -13, -105, -79, 111, 75, -3, 35, 95, 127, -100, 18, 127, -125, 122, 127, 65, 19, -47, -128, -53, -31, -54, 7, -120,\n 0, 2, 7, 18, 44, 104, 112, -96, 0, 0, 10, 23, 50, 108, -24, -16, 33, -60, -120, 18, 39, 82, -84, 104, -15,\n 34, -58, -116, 26, 55, 114, -20, -24, -15, 35, -56, -123, 2, 4, -114, 60, 104, -14, 100, -128, -110, 7, 71, 38, 12,\n -23, -14, 37, -52, -104, 27, 85, -94, 60, -39, 82, 38, -50, -100, 58, 119, -30, -92, 89, -45, -96, -128, -101, 24, 125,\n 6, -3, 105, 20, 40, -49, -92, 74, -105, 50, 109, -22, 84, 105, 73, -97, 71, -127, -94, 12, -6, -12, 42, -42, -105,\n 82, -89, 10, -51, -22, -11, 43, -2, 88, -122, 91, 127, 90, -19, 72, -77, -24, -44, -93, 93, -61, -78, 109, -21, -10,\n -19, 85, -107, 99, -45, -90, -84, 10, -9, 46, -40, -71, 85, -41, -30, -19, -21, 87, -93, -34, -96, -126, 7, -125, -108,\n 11, 64, 47, 93, -110, 127, 23, 51, 110, -36, 88, 110, -30, -107, 104, 11, -14, 117, 108, 57, 36, 98, -54, -107, 47,\n 115, -10, 59, -103, -14, -50, -88, -103, 19, 111, -18, 108, -6, 52, 106, -114, 103, 35, 35, 61, 44, 88, 113, -22, -40,\n 67, 7, -45, -82, 93, 90, 54, 110, -84, -97, -53, -22, 20, 124, -72, 46, -21, -107, 95, 121, -25, 46, 110, -4, 35,\n -28, -32, -96, -59, -34, 62, -18, -4, 57, 116, -73, 69, -101, 107, 117, 61, 90, 109, 88, -33, -47, -73, 115, -1, -115,\n 80, -7, -14, -18, -30, -57, -109, 127, 74, 61, -26, -21, -49, -84, -49, -13, -116, 90, -2, 125, -22, -43, -32, 9, -78,\n -121, 111, -1, 62, -2, -20, 9, -81, -37, -51, -98, 50, 63, -128, -98, 81, 54, 31, 125, 1, 26, 120, 32, -126, -70,\n -127, 87, 95, 123, 12, 38, -8, 32, 122, -12, 17, 24, 30, -124, 21, 90, 120, -31, 80, 11, 74, -73, 31, -122, 29,\n -54, 68, -44, -124, 5, 122, 56, 34, -119, 24, -14, -41, 90, 91, -124, -107, -72, -30, 76, 3, -122, -8, 31, -117, 49,\n -54, 120, -33, -119, 20, -78, 53, -35, -116, 57, 70, 4, -2, 98, -120, 14, -22, -8, 35, -112, -114, -115, 53, -105, 118,\n -46, -111, 68, 91, -112, 51, -14, 56, -95, -113, 73, 58, -7, 100, -118, 72, -99, 85, 36, 92, 91, 53, 9, 37, -115,\n 18, 46, -88, 34, -106, 93, 122, -23, 25, 90, 55, -79, 116, 37, 83, 86, 126, 57, -94, 124, 116, 33, 121, 38, -101,\n 109, -34, 69, -100, 107, -116, -103, -23, -90, -123, 105, -90, 69, 38, -99, 121, -22, 25, -38, 98, 86, -30, -71, -25, 113,\n 75, -34, 9, 40, -95, -123, -42, -87, -103, -95, 7, 10, -54, 85, -94, -115, 58, -118, -33, 89, -113, 2, -72, 40, 118,\n -110, 90, 122, 41, 116, -122, 97, 106, 31, -91, -110, -123, -71, 41, -88, -95, 50, 39, -26, -97, -24, 53, -28, -98, -88,\n -28, 117, -118, 34, -107, -87, -70, -22, -88, 104, 44, 25, -39, 82, 122, -81, -114, 87, 91, -91, -74, -22, 42, -23, -100,\n -2, -91, 52, 38, -100, -69, 58, 71, 106, -91, -91, 10, 123, -84, -116, 82, 25, 91, 24, -118, -56, 102, -86, 16, 75,\n -40, 5, -21, 44, -75, 94, 42, 123, 35, 125, -53, 86, 91, 37, -83, -64, -111, -43, -22, -74, -31, 62, 25, -87, -81,\n -80, -119, 27, 104, -73, -4, 77, 123, 46, -69, 57, 106, 58, 28, -71, -19, 26, -105, 110, -82, -14, -38, -85, 35, -72,\n 113, 53, 123, 47, 110, -55, -43, -92, 45, -65, 1, -17, -87, -34, -111, 2, -9, -2, -5, 29, 89, 6, 43, -84, -85,\n -97, 11, -53, -26, -81, 77, 14, 75, 28, -22, -112, 19, -57, 22, 109, -62, 22, 107, 12, -85, 73, 0, 111, -36, 84,\n 84, -33, 126, 60, 50, -95, 21, -109, 124, 89, -56, 54, 121, 124, 50, -53, -121, 10, -41, -14, 95, 86, 65, 108, 35,\n -52, 53, -113, -37, -80, -51, 111, 30, -119, 112, -57, 57, -5, 124, -77, 104, 63, -65, -7, 26, -49, 61, 11, 125, -12,\n -113, -21, 34, -99, -105, -117, -3, 45, -3, 52, -44, -37, -38, -23, 116, -44, 85, 91, -3, 106, -104, 70, -83, 124, 53,\n -41, 93, 39, 61, -104, -42, 94, -117, 61, -74, -95, -109, -115, -74, 53, -39, 105, -85, -99, -96, -39, 25, -81, -3, 54,\n -36, 73, -18, -25, 109, -60, 113, -37, 125, 119, -78, -45, -3, -117, 55, -33, 125, -93, 73, 55, 85, 104, -5, 61, 56,\n -31, -90, 17, -35, -79, -32, -123, 43, -66, -72, -100, -121, 35, -60, 56, -28, -111, -33, 90, -76, -71, -110, 91, 126, 121,\n 110, -47, 18, 53, -45, -102, -104, 123, -2, -71, 110, 41, 87, 126, -111, -52, -7, -126, 126, 58, -22, -24, 77, 71, 52,\n -125, -76, 38, -98, 58, -20, -96, 59, -2, -85, -46, -79, -37, 126, 59, 84, -23, 117, -114, 59, -17, -67, -73, 71, -69,\n 92, -81, -5, 62, 124, -22, -91, 3, -1, 43, -15, -55, 43, 111, 86, -23, -34, -115, -71, 60, -12, -47, 59, 83, -124,\n -85, -73, -75, 75, 127, 61, -15, -70, 3, 110, 61, -10, -35, -13, -98, 30, 66, 92, 122, 63, -66, -14, -69, -109, 127,\n 126, -10, -74, -95, -65, 126, -7, -36, -77, -1, 62, -4, -15, -53, 63, 63, -3, -11, -37, 127, 63, -2, -7, -21, -65,\n 63, -1, -3, -81, 24, 16, 0, 0, 59\n };\n}", "public Layer[] reconstruct(){\r\n ArrayList<String[]> rawData = pullFromText(location);\r\n return rawData != null ? reformat(rawData) : null;\r\n }", "@Override\r\n public Object createImage(Object data) {\r\n\t // N/A in JS\r\n\t return null;\r\n\t}", "public static void testDecodePicture(){\n\t Picture wall = new Picture(\"wall.jpg\");\n\t Picture caterpillar = new Picture(\"caterpillar.jpg\");\n\t wall.hidePicture(caterpillar);\n\t wall.explore();\n\t wall.decodePicture();\n\t wall.explore();\n }" ]
[ "0.55706245", "0.5517017", "0.5444865", "0.53232265", "0.5262187", "0.5238578", "0.51885", "0.5167108", "0.5158316", "0.5106747", "0.5081657", "0.4993196", "0.49686748", "0.49685073", "0.49671087", "0.4966355", "0.49643737", "0.4928195", "0.490172", "0.49009496", "0.4892272", "0.48903877", "0.48872086", "0.48261344", "0.4824126", "0.48200125", "0.4798438", "0.47849935", "0.4765933", "0.47628337", "0.47612682", "0.47512758", "0.47441152", "0.47387356", "0.4732965", "0.47277245", "0.47181717", "0.47151905", "0.4707551", "0.4703223", "0.47015482", "0.47001535", "0.46991083", "0.46961322", "0.46901473", "0.46826383", "0.46822307", "0.46821105", "0.46752384", "0.46620852", "0.46549457", "0.4645799", "0.46435484", "0.46435258", "0.4636842", "0.46360394", "0.4632863", "0.4632244", "0.4631159", "0.4629451", "0.46252605", "0.46191904", "0.46164298", "0.46004984", "0.4599529", "0.45994177", "0.45956782", "0.4594242", "0.45917204", "0.45916367", "0.4590082", "0.45805976", "0.45786053", "0.45772228", "0.45698082", "0.45697933", "0.45691827", "0.45631588", "0.4563053", "0.45629308", "0.45623454", "0.45623094", "0.4557677", "0.45566192", "0.45565084", "0.4555126", "0.45550025", "0.45476392", "0.45443377", "0.45404476", "0.45398164", "0.4537789", "0.453535", "0.45333344", "0.45317125", "0.453095", "0.45298514", "0.4526848", "0.45264956", "0.4525334", "0.45239708" ]
0.0
-1
Generate all mipmap levels for a provided image NOTE 1: Supports POT and NPOT images NOTE 2: image.data is scaled to include mipmap levels NOTE 3: Mipmaps format is the same as base image
public @NotNull Image genMipmaps() { if (this.data != null) { // TODO - LWJGL-ify int mipCount = 1; // Required mipmap levels count (including base level) int mipWidth = this.width; // Base image width int mipHeight = this.height; // Base image height int mipSize = mipWidth * mipHeight * this.format.sizeof; // Image data size (in bytes) // Count mipmap levels required while (mipWidth != 1 || mipHeight != 1) { if (mipWidth != 1) mipWidth >>= 1; if (mipHeight != 1) mipHeight >>= 1; // Security check for NPOT textures if (mipWidth < 1) mipWidth = 1; if (mipHeight < 1) mipHeight = 1; Image.LOGGER.fine("Next mipmap level: %s x %s - current size %s", mipWidth, mipHeight, mipSize); mipCount++; mipSize += mipWidth * mipHeight * this.format.sizeof; // Add mipmap size (in bytes) } if (this.mipmaps < mipCount) { Color.Buffer temp = Color.realloc(this.data, mipSize); if (temp.address() != 0) { this.data = temp; // Assign new pointer (new size) to store mipmaps data } else { Image.LOGGER.warning("IMAGE: Mipmaps required memory could not be allocated"); } // Pointer to allocated memory point where store next mipmap level data long nextMip = this.data.address() + (long) this.width * this.height * this.format.sizeof; mipWidth = this.width >> 1; mipHeight = this.height >> 1; mipSize = mipWidth * mipHeight * this.format.sizeof; Image imCopy = copy(); for (int i = 1; i < mipCount; i++) { Image.LOGGER.fine("IMAGE: Generating mipmap level: %s (%s x %s) - size: %s - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextMip); imCopy.resize(mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter if (imCopy.data != null) MemoryUtil.memCopy(imCopy.data.address(), nextMip, mipSize); nextMip += mipSize; this.mipmaps++; // Security check for NPOT textures if ((mipWidth >>= 1) < 1) mipWidth = 1; if ((mipHeight >>= 1) < 1) mipHeight = 1; mipSize = mipWidth * mipHeight * this.format.sizeof; } imCopy.delete(); } else { Image.LOGGER.warning("Mipmaps already available"); } } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native boolean levelImage(String levels) throws MagickException;", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "public void loadLevel(BufferedImage image) {\n\n\t\tif (stage == 1) {\n\t\t\tlevelLoader.loadLevel(image, ssTiles, ssPlayer, ssMonster, ssKeys);\n\t\t}\n\n\t\t/*\n\t\t * System.out.println(\"Hello from loadLevel\");\n\t\t * \n\t\t * \n\t\t * int w = image.getWidth();\n\t\t * int h = image.getHeight();\n\t\t * \n\t\t * \n\t\t * for(int xx = 0; xx < w; xx++) {\n\t\t * for (int yy = 0; yy < h; yy++) {\n\t\t * int pixel = image.getRGB(xx,yy);\n\t\t * int red = (pixel >> 16 ) & 0xff;\n\t\t * int green = (pixel >> 8) & 0xff;\n\t\t * int blue = (pixel) & 0xff;\n\t\t * //System.out.println(\"at x\" + xx + \" and y \"+ yy);\n\t\t * \n\t\t * \n\t\t * //if a pixel in the picture is red we render it as a block.\n\t\t * if(red == 255) {\n\t\t * handler.addObject(new Block(xx*32, yy*32, ID.Block,ssTiles));\n\t\t * }\n\t\t * \n\t\t * //if a pixel in the picture is blue, we render it as a player.\n\t\t * if(blue == 255 && green == 0) {\n\t\t * System.out.println(\"player object added\");\n\t\t * handler.addObject(new Wizard(xx*32,yy*32,ID.Player,handler,this,ssPlayer));\n\t\t * }\n\t\t * \n\t\t * if(green == 255 && blue == 0) {\n\t\t * \n\t\t * \n\t\t * handler.addObject(new Enemy(xx*32, yy*32, ID.Enemy, handler,ssMonster));\n\t\t * enemies++;\n\t\t * System.out.println(\"added enemy, total enemies: \" + enemies);\n\t\t * }\n\t\t * \n\t\t * \n\t\t * if(green == 255 && blue == 255) {\n\t\t * System.out.println(\"crate found\");\n\t\t * handler.addObject(new Crate(xx*32, yy*32, ID.Crate,ssTiles));\n\t\t * }\n\t\t * \n\t\t * //System.out.println(\"There is \" + handler.object.size() +\n\t\t * \" objects loaded! \");\n\t\t * \n\t\t * }\n\t\t * \n\t\t * }\n\t\t */\n\n\t}", "public void setMipLevel(int level) {\r\n if (mipLevel != level) {\r\n synchronized (bitmaps) {\r\n if (getDrawable() != null && ((BitmapDrawable) getDrawable()).getBitmap() != null) {\r\n if (!((BitmapDrawable) getDrawable()).getBitmap().isRecycled())\r\n ((BitmapDrawable) getDrawable()).getBitmap().recycle();\r\n bitmaps.remove(((BitmapDrawable) getDrawable()).getBitmap());\r\n super.setImageBitmap(null);\r\n }\r\n this.mipLevel = Math.max(0, Math.min(level, mipLevels - 1));\r\n }\r\n }\r\n }", "@Override\n\tpublic String generateLevel(GameDescription game, ElapsedCpuTimer elapsedTimer) {\n\t\tString result = \"\";\n\t\tArrayList<SpriteData> sprites = game.getAllSpriteData();\n\t\tArrayList<SpriteData> avatars = game.getAvatar();\n\t\t\n\t\t//Get a random width and random height value based on the length of game sprites\n\t\t//and it should be in between maxSize and minSize\n\t\tint width = (int)Math.max(minSize, sprites.size() * (1 + 0.25 * random.nextDouble()));\n\t\tint length = (int)Math.max(minSize, sprites.size() * (1 + 0.25 * random.nextDouble()));\n\t\twidth = (int)Math.min(width, maxSize);\n\t\tlength = (int)Math.min(length, maxSize);\n\t\t\n\t\tArrayList<Character> avatar = new ArrayList<Character>();\n\t\tArrayList<Character> choices = new ArrayList<Character>();\n\t\tfor(Map.Entry<Character, ArrayList<String>> pair:game.getLevelMapping().entrySet()){\n\t\t\tboolean avatarExists = false;\n\t\t\t//check if the avatar is found in this level mapping\n\t\t\tfor (SpriteData avatarName:avatars){\n\t\t\t\tif(pair.getValue().contains(avatarName.name)){\n\t\t\t\t\tavatarExists = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(!avatarExists){\n\t\t\t\t//if not avatar add to other symbols\n\t\t\t\tif(!pair.getValue().contains(\"avatar\")){\n\t\t\t\t\tchoices.add(pair.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//add the avatar symbol if it exist\n\t\t\t\tavatar.add(pair.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<DataPoint> dataPoints = new ArrayList<DataPoint>();\n\n\t\t//add level borders based on static variable includeBorders\n\t\tif(includeBorders){\n\t\t\tincludeBorders = buildLayout(game, dataPoints, width, length);\n\t\t}\n\t\t\n\t\t//Add only one of all objects in the choices array\n\t\tfor(Character c:choices){\n\t\t\taddUnique(dataPoints, width, length, c);\n\t\t}\n\t\t\n\t\t//if no avatar is defined in the level mapping section use 'A' to add it\n\t\tif(avatar.size() == 0){\n\t\t\tavatar.add('A');\n\t\t}\n\t\taddUnique(dataPoints, width, length, avatar.get(random.nextInt(avatar.size())));\n\t\t\n\t\t//construct the result string from the array of datapoints\n\t\tfor(int y=0; y < length; y++){\n\t\t\tfor(int x=0; x < width; x++){\n\t\t\t\t//check if the position (x, y) is defined in the list of points\n\t\t\t\tDataPoint p = isUnique(dataPoints, x, y);\n\t\t\t\t//if yes then add the result\n\t\t\t\tif(p != null){\n\t\t\t\t\tresult += p.c;\n\n\t\t\t\t}\n\t\t\t\t//add empty space\n\t\t\t\telse if(random.nextDouble() < emptyPercentage){\n\t\t\t\t\tresult += \" \";\n\t\t\t\t}\n\t\t\t\t//add random object\n\t\t\t\telse{\n\t\t\t\t\tresult += choices.get(random.nextInt(choices.size()));\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += \"\\n\";\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public int toGL( GL gl, GLU glu, boolean mipmap ) {\n\t\t\t// Generate the texture ID\n\t\t\tint[] temp = new int[1];\n\t\t\tint name;\n\t\t\tgl.glGenTextures(1, temp, 0);\n\t\t\tname = temp[0];\n\t\t\t\n\t\t\tgl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);\n\t\t\t\n\t\t\t// Bind the texture\n\t\t\tgl.glBindTexture( GL.GL_TEXTURE_2D, name );\n\n\t\t\t// Build Mipmaps \n\t\t\tif( mipmap ) {\n\t\t\t\tswitch(this.type) {\n\t\t\t\tcase TEXTURE_3BYTE_RGB:\n\t\t\t\t\tglu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\tGL.GL_RGB8, \n\t\t\t\t\t\t\tthis.width, this.height, \n\t\t\t\t\t\t\tGL.GL_RGB,\n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t \n\t\t\t\tcase TEXTURE_4BYTE_RGBA:\n\t\t\t\t\tglu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\tGL.GL_RGBA, \n\t\t\t\t\t\t\tthis.width, this.height, \n\t\t\t\t\t\t\tGL.GL_RGBA, \n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException(\"Unknown texture type: \" + this.type);\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t// Assign the mip map levels and texture info\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR );\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, \n\t\t\t\t GL.GL_LINEAR_MIPMAP_NEAREST);\n\t\t\t\tgl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);\n\t\t\t} else {\n\t\t\t\tswitch(this.type) {\n\t\t\t\tcase TEXTURE_3BYTE_RGB:\n\t\t\t\t\tgl.glTexImage2D(GL.GL_TEXTURE_2D, \n\t\t\t\t\t\t\t0, GL.GL_RGB, \n\t\t\t\t\t\t\tthis.width, this.height, 0,\n\t\t\t\t\t\t\tGL.GL_RGB, \n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE, \n\t\t\t\t\t\t\tthis.pixels\n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t \n\t\t\t\tcase TEXTURE_4BYTE_RGBA:\n\t\t\t\t\tgl.glTexImage2D(GL.GL_TEXTURE_2D,\n\t\t\t\t\t\t\t0, GL.GL_RGBA,\n\t\t\t\t\t\t\tthis.width, this.height, 0,\n\t\t\t\t\t\t\tGL.GL_RGBA,\n\t\t\t\t\t\t\tGL.GL_UNSIGNED_BYTE,\n\t\t\t\t\t\t\tthis.pixels \n\t\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new RuntimeException(\"Unknown texture type: \" + this.type);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Assign the mip map levels and texture info\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR );\n\t\t\t\tgl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, \n\t\t\t\t GL.GL_LINEAR);\n\t\t\t\tgl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);\n\t\t\t}\n\t\t\t\n\t\t\treturn name;\n\t\t}", "static int[] createVisualToLogicalMap(byte[] levels) {\n int len = levels.length;\n int[] mapping = new int[len];\n\n byte lowestOddLevel = (byte)(NUMLEVELS + 1);\n byte highestLevel = 0;\n\n // initialize mapping and levels\n\n for (int i = 0; i < len; i++) {\n mapping[i] = i;\n\n byte level = levels[i];\n if (level > highestLevel) {\n highestLevel = level;\n }\n\n if ((level & 0x01) != 0 && level < lowestOddLevel) {\n lowestOddLevel = level;\n }\n }\n\n while (highestLevel >= lowestOddLevel) {\n int i = 0;\n for (;;) {\n while (i < len && levels[i] < highestLevel) {\n i++;\n }\n int begin = i++;\n\n if (begin == levels.length) {\n break; // no more runs at this level\n }\n\n while (i < len && levels[i] >= highestLevel) {\n i++;\n }\n int end = i - 1;\n\n while (begin < end) {\n int temp = mapping[begin];\n mapping[begin] = mapping[end];\n mapping[end] = temp;\n ++begin;\n --end;\n }\n }\n\n --highestLevel;\n }\n\n return mapping;\n }", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public String getLevelImagePatternName() {\n\t\treturn level_image_pattern;\n\t}", "public void generateLevel() {\n\t\tfor (int y = 0; y < this.height; y++) {\n\t\t\tfor (int x = 0; x < this.width; x++) {\n\t\t\t\tif (x * y % 10 < 5)\n\t\t\t\t\ttiles[x + y * width] = Tile.GRASS.getId();\n\t\t\t\telse\n\t\t\t\t\ttiles[x + y * width] = Tile.STONE.getId();\n\t\t\t}\n\t\t}\n\t}", "public String getLevelImagePatternFolder() {\n\t\treturn \"../resources/images/tilesets/\" + level_image_pattern + \"/\";\n\t}", "public void setLevelImagePatternName(String pattern) {\n\t\tlevel_image_pattern = pattern;\n\t}", "private void createImage (String image_name, int filename){\n\n\t\tString image_folder = getLevelImagePatternFolder();\n\t\t\n\t\tString resource = filename+\".png\";\n\t\tImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(image_name, ii.getImage());\n\t}", "private void createImage(BufferedImage image) {\n texId.setId(glGenTextures());\n loaded = true;\n\n try {\n int[] pixels = new int[image.getHeight() * image.getWidth()];\n\n image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth());\n\n Window.console.println(\"Texture num : \" + texId.getId() + \" , loaded with path : \" + texId.getPath());\n\n ByteBuffer buffer = BufferUtils.createByteBuffer(image.getHeight() * image.getWidth() * 4);\n\n for (int i = 0; i < image.getHeight(); i++) {\n for (int j = 0; j < image.getWidth(); j++) {\n int pixel = pixels[i * image.getWidth() + j];\n buffer.put((byte) ((pixel >> 16) & 0xFF)); // RED\n buffer.put((byte) ((pixel >> 8) & 0xFF)); // GREEN\n buffer.put((byte) (pixel & 0xFF)); // BLUE\n buffer.put((byte) ((pixel >> 24) & 0xFF)); // ALPHA\n }\n }\n\n buffer.flip();\n\n this.width = image.getWidth();\n this.height = image.getHeight();\n\n setParam(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);\n setParam(GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);\n setParam(GL_TEXTURE_MIN_FILTER, GL_LINEAR);\n setParam(GL_TEXTURE_MAG_FILTER, GL_LINEAR);\n\n upload(buffer);\n GameManager.texManager.add(texId);\n } catch (Exception e) {\n e.printStackTrace();\n unload();\n }\n }", "public MapGen()//Collect images, create Platform list, create grassy array and generate a random integer as the map wideness\n\t{\n\t\tblocksWide= ThreadLocalRandom.current().nextInt(32, 64 + 1);\n\t\tclouds=kit.getImage(\"Resources/SkyBackground.jpg\");\n\t\tdirt=kit.getImage(\"Resources/Dirt.png\");\n\t\tgrass[0]=kit.getImage(\"Resources/Grass.png\");\n\t\tgrass[1]=kit.getImage(\"Resources/Grass1.png\");\n\t\tgrass[2]=kit.getImage(\"Resources/Grass2.png\");\n\t\tplatforms=new ArrayList<Platform>();\n\t\tgrassy=new int[blocksWide];\n\t\tgrassT=new int[blocksWide];\n\t\tgenerateTerrain();\n\t\t\n\t\t\n\t\t\n\t}", "public Level()\n {\n //Initialise Tile Types\n try \n {\n //Dynamically assign texture paints\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/surface.jpg\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rover.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/rock.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/mineral.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/target.png\")), tile));\n texturePaints.add(new TexturePaint(ImageIO.read(new File(\"Images/warning.png\")), tile));\n } catch(FileNotFoundException fnfe) {\n System.out.println(\"ERROR: Invalid texture paint, file not found\" + fnfe);\n }\n catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "private static Image[][] getTileBases()\n\t{\n\t\tImage[][] tileBases = new Image[2][4];\n\t\tfor (int type = 0; type < 4; type++) {\n\t\t\ttry {\n\t\t\t\ttileBases[0][type] = ImageIO.read(new File(tileDirectory\n\t\t\t\t\t\t+ \"tile_\" + tileColours[type] + \".png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t}\n\t\t}\n\t\tfor (int type = 0; type < 4; type++) {\n\t\t\ttry {\n\t\t\t\ttileBases[1][type] = ImageIO.read(new File(tileDirectory\n\t\t\t\t\t\t+ \"tile_\" + tileColours[type] + \"_trans.png\"));\n\t\t\t} catch (IOException ioe) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn tileBases;\n\t}", "private void calculateMaps() {\n\tsrcrows = new int[destHeight + 1];\n\tfor (int y = 0; y <= destHeight; y++) {\n\t srcrows[y] = (2 * y * srcHeight + srcHeight) / (2 * destHeight);\n\t}\n\tsrccols = new int[destWidth + 1];\n\tfor (int x = 0; x <= destWidth; x++) {\n\t srccols[x] = (2 * x * srcWidth + srcWidth) / (2 * destWidth);\n\t}\n\n float xscale = ( ( float ) srcWidth - 1 ) / ( ( float ) destWidth );\n float yscale = ( ( float ) srcHeight - 1 ) / ( ( float ) destHeight ) ;\n\n srcxlarr = new int[destWidth+1];\n srcxuarr = new int[destWidth+1];\n srcxarr = new int[destWidth+1];\n\n for (int x = 0 ; x <= destWidth;x++) {\n float tmp = x * xscale ;\n srcxlarr[x] = (int) Math.floor( tmp ) ;\n srcxuarr[x] = (int) Math.ceil( tmp ) ;\n srcxarr[x] = (int) ( ( tmp - srcxlarr[x] ) * 255f );\n }\n\n srcylarr = new int[destHeight+1];\n srcyuarr = new int[destHeight+1];\n srcyarr = new int[destHeight+1];\n\n for (int y = 0 ; y <= destHeight;y++) {\n float tmp = y * yscale ;\n srcylarr[y] = (int) Math.floor( tmp ) ;\n srcyuarr[y] = (int) Math.ceil( tmp ) ;\n srcyarr[y] = (int) ( ( tmp - srcylarr[y] ) * 255f );\n }\n\n /*\n System.out.println( \"srcrows\" );\n for (int i=0;i<srcrows.length;i++) {\n System.out.print( srcrows[i] + \" \" );\n }\n\n System.out.println( \"\\nsrccols\" );\n for (int i=0;i<srccols.length;i++) {\n System.out.print( srccols[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxlarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcxlarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcxuarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcylarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcylarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcyuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcyuarr[i] + \" \" );\n }\n */\n }", "void texImage2D(int target, int level, int resourceId, int border);", "public static void codeAllImages(Args args) throws FileNotFoundException, IOException{\n BufferedImage tempI=null, tempP=null;\n BufferedImage[] codeOut = null;\n FileOutputStream fos = new FileOutputStream(args.output);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n int j = 0;\n //Iterate through all the images dividing them into frameP or frameI\n for(int i= 0; i < imageNames.size(); i++){ \n //j is a counter of the gop\n if(j >= (args.gop)){\n j=0;\n }\n if(j==0){\n // Frame I\n tempI = imageDict.get(imageNames.get(i));\n imgToZip(tempI, i, zipOS, \"image_coded_\");\n }else{\n //Frame P\n codeOut = createCodedImg(tempI, imageDict.get(imageNames.get(i)), args.thresh, args.tileSize, args.seekRange, args.comparator);\n imgToZip(codeOut[0], i, zipOS, \"image_coded_\");\n tempI = codeOut[1];\n //showImage(tempP);\n }\n j++;\n }\n //Get the gop, its always the first position of the coded data\n dataList.get(0).gop = args.gop;\n //Store into a .gz file all the info of every tile of every image, info that is stored into our dataList\n try {\n FileOutputStream out = new FileOutputStream(\"codedData.gz\");\n GZIPOutputStream gos = new GZIPOutputStream(out);\n ObjectOutputStream oos = new ObjectOutputStream(gos);\n oos.writeObject(dataList);\n oos.flush();\n gos.flush();\n out.flush();\n \n oos.close();\n gos.close();\n out.close();\n } catch (Exception e) {\n System.out.println(\"Problem serializing: \" + e);\n }\n \n FileInputStream fis = new FileInputStream(\"codedData.gz\");\n ZipEntry e = new ZipEntry(\"codedData.gz\");\n zipOS.putNextEntry(e);\n\n byte[] bytes = new byte[1024];\n int length;\n while ((length = fis.read(bytes)) >= 0) {\n zipOS.write(bytes, 0, length);\n }\n zipOS.closeEntry();\n fis.close();\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "static Texture loadCubeMap(String name) {\n\n GL4 gl = (GL4) GLContext.getCurrentGL(); // this gl context not appropriate?\n GLProfile glp = gl.getGLProfile();\n Texture cubeMap = TextureIO.newTexture(GL4.GL_TEXTURE_CUBE_MAP);\n\n // System.out.println(\"estimated memory \" + cubeMap.getEstimatedMemorySize());\n\n try {\n TextureData top = TextureIO.newTextureData(glp, new File(name + \"/top.png\"), false, \"png\");\n TextureData bot = TextureIO.newTextureData(glp, new File(name + \"/bot.png\"), false, \"png\");\n TextureData left = TextureIO.newTextureData(glp, new File(name + \"/left.png\"), false, \"png\");\n TextureData right = TextureIO.newTextureData(glp, new File(name + \"/right.png\"), false, \"png\");\n TextureData front = TextureIO.newTextureData(glp, new File(name + \"/front.png\"), false, \"png\");\n TextureData back = TextureIO.newTextureData(glp, new File(name + \"/back.png\"), false, \"png\");\n\n // System.out.println(\"front is null \" + (top == null));\n\n cubeMap.updateImage(gl, right, GL4.GL_TEXTURE_CUBE_MAP_POSITIVE_X);\n cubeMap.updateImage(gl, left, GL4.GL_TEXTURE_CUBE_MAP_NEGATIVE_X);\n cubeMap.updateImage(gl, top, GL4.GL_TEXTURE_CUBE_MAP_POSITIVE_Z);\n cubeMap.updateImage(gl, bot, GL4.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);\n cubeMap.updateImage(gl, front, GL4.GL_TEXTURE_CUBE_MAP_POSITIVE_Y);\n cubeMap.updateImage(gl, back, GL4.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);\n\n } catch (Exception e) {\n System.out.println(\"failed load \" + name + \" cubemap\");\n }\n\n // System.out.println(\"estimated memory \" + cubeMap.getEstimatedMemorySize());\n\n // gl.glTexParameteri(GL4.GL_TEXTURE_CUBE_MAP, GL4.GL_TEXTURE_WRAP_S, GL4.GL_CLAMP_TO_EDGE);\n // gl.glTexParameteri(GL4.GL_TEXTURE_CUBE_MAP, GL4.GL_TEXTURE_WRAP_T, GL4.GL_CLAMP_TO_EDGE);\n // gl.glTexParameteri(GL4.GL_TEXTURE_CUBE_MAP, GL4.GL_TEXTURE_WRAP_R, GL4.GL_CLAMP_TO_EDGE);\n\n return cubeMap;\n }", "public Texture getDepthMapTexture(){\n return depthMap;\n }", "private void generateLevel() {\n\t\tgenerateBorder();\n\t\tfor (int y = 1; y < height - 1; y++) {\n\t\t\tfor (int x = 1; x < height - 1; x++) {\n\t\t\t\tif (random.nextInt(2) == 1) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t\trandForest(x, y);\n\t\t\t\t} else {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getDirt(), false, x, y);\n\t\t\t\t\trandOre(x, y);\n\t\t\t\t}\n\t\t\t\tif (x == 4 && y == 4) {\n\t\t\t\t\ttiles[x + y * width] = new Tile(Sprite.getGrass(), false, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\tprotected BufferedImage getButtonImage(ArrayList<Double> phenotype, int width, int height,\n\t\t\tdouble[] inputMultipliers) {\n\t\tdouble[] doubleArray = ArrayUtil.doubleArrayFromList(phenotype);\n\t\tList<List<Integer>> level = levelListRepresentation(doubleArray);\n\t\t//sets the height and width for the rendered level to be placed on the button \n\t\tint width1 = LodeRunnerRenderUtil.RENDERED_IMAGE_WIDTH;\n\t\tint height1 = LodeRunnerRenderUtil.RENDERED_IMAGE_HEIGHT;\n\t\tBufferedImage image = null;\n\t\ttry {\n\t\t\t//if we are using the mapping with 7 tiles, other wise use 6 tiles \n\t\t\t// ACTUALLY: We can have extra unused tiles in the image array. Easier to have one method that keeps them all around\n\t\t\t//\t\t\tif(Parameters.parameters.booleanParameter(\"lodeRunnerDistinguishesSolidAndDiggableGround\")){\n\t\t\tList<Point> emptySpaces = LodeRunnerGANUtil.fillEmptyList(level);\n\t\t\tRandom rand = new Random(Double.doubleToLongBits(doubleArray[0]));\n\t\t\tLodeRunnerGANUtil.setSpawn(level, emptySpaces, rand);\n\t\t\tif(Parameters.parameters.booleanParameter(\"showInteractiveLodeRunnerSolutionPaths\")) {\n\t\t\t\tList<List<Integer>> originalLevel = ListUtil.deepCopyListOfLists(level);\n\t\t\t\tLodeRunnerState start = new LodeRunnerState(level);\n\t\t\t\t//\t\t\t\tSystem.out.println(level);\n\t\t\t\tSearch<LodeRunnerAction,LodeRunnerState> search = new AStarSearch<>(LodeRunnerState.manhattanToFarthestGold);\n\t\t\t\tHashSet<LodeRunnerState> mostRecentVisited = null;\n\t\t\t\tArrayList<LodeRunnerAction> actionSequence = null;\n\t\t\t\ttry {\n\t\t\t\t\t//tries to find a solution path to solve the level, tries as many time as specified by the last int parameter \n\t\t\t\t\t//represented by red x's in the visualization \n\t\t\t\t\tif(Parameters.parameters.integerParameter(\"interactiveLodeRunnerPathType\") == PATH_TYPE_ASTAR) {\n\t\t\t\t\t\t//\t\t\t\t\t\tSystem.out.println(level);\n\t\t\t\t\t\tactionSequence = ((AStarSearch<LodeRunnerAction, LodeRunnerState>) search).search(start, true, Parameters.parameters.integerParameter(\"aStarSearchBudget\"));\n\t\t\t\t\t} else if(Parameters.parameters.integerParameter(\"interactiveLodeRunnerPathType\") == PATH_TYPE_TSP){\n\t\t\t\t\t\tPair<ArrayList<LodeRunnerAction>, HashSet<LodeRunnerState>> tspInfo = LodeRunnerTSPUtil.getFullActionSequenceAndVisitedStatesTSPGreedySolution(originalLevel);\n\t\t\t\t\t\tactionSequence = tspInfo.t1;\n\t\t\t\t\t\tmostRecentVisited = tspInfo.t2;\n\t\t\t\t\t\t//System.out.println(\"actionSequence: \"+ actionSequence);\n\t\t\t\t\t\t//System.out.println(\"mostRecentVisited: \"+mostRecentVisited);\n\t\t\t\t\t} \n\t\t\t\t\telse throw new IllegalArgumentException(\"Parameter is not either 1 or 0\");\n\t\t\t\t} catch(IllegalStateException e) {\n\t\t\t\t\tSystem.out.println(\"search exceeded computation budget\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} catch(OutOfMemoryError e) {\n\t\t\t\t\tSystem.out.println(\"search ran out of memory\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t} finally {\n\t\t\t\t\t// Even if search fails, still try to get visited states.\n\t\t\t\t\t// Need this here because A* fails with Exception\n\t\t\t\t\tif(Parameters.parameters.integerParameter(\"interactiveLodeRunnerPathType\") == PATH_TYPE_ASTAR) {\n\t\t\t\t\t\t//get all of the visited states, all of the x's are in this set but the white ones are not part of solution path \n\t\t\t\t\t\tmostRecentVisited = ((AStarSearch<LodeRunnerAction, LodeRunnerState>) search).getVisited();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\t//visualizes the points visited with red and whit x's\n\t\t\t\t\timage = LodeRunnerState.vizualizePath(level,mostRecentVisited,actionSequence,start);\n\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tSystem.out.println(\"Image could not be displayed\");\n\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(Parameters.parameters.booleanParameter(\"showInteractiveLodeRunnerIceCreamYouVisualization\")) {\n\t\t\t\tBufferedImage[] iceCreamYouImages = LodeRunnerRenderUtil.loadIceCreamYouTiles(LodeRunnerRenderUtil.ICE_CREAM_YOU_TILE_PATH);\n\t\t\t\timage = LodeRunnerRenderUtil.createIceCreamYouImage(level, LodeRunnerRenderUtil.ICE_CREAM_YOU_IMAGE_WIDTH, LodeRunnerRenderUtil.ICE_CREAM_YOU_IMAGE_HEIGHT, iceCreamYouImages);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tBufferedImage[] images = LodeRunnerRenderUtil.loadImagesNoSpawnTwoGround(LodeRunnerRenderUtil.LODE_RUNNER_TILE_PATH); //all tiles \n\t\t\t\timage = LodeRunnerRenderUtil.createBufferedImage(level,width1,height1, images);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Image could not be displayed\");\n\t\t}\n\t\treturn image;\n\t}", "public static void decodeAllImages(Args args){\n \t//Now those arrays will contain 'decoded' images\n \timageNames.clear();\n imagesToZip.clear();\n imageDict.clear();\n ArrayList<CodedData> recoveredData = null;\n\n //Read the coded images\n try {\n System.out.println(\"Reading zip file...\");\n readZip(args.codedInput, false);\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n BufferedImage tempFrame=null, tempFrameI=null;\n WritableRaster tempBitmap=null;\n WritableRaster tempDecoded=null;\n CodedData tempData=null;\n int gop = dataList.get(0).gop;\n //System.out.println(gop);\n BufferedImage tempBufferedImage = null;\n int z = 0;\n //recoveredData[0] contains the info of the image 0, and so on\n int recoveredDataCounter = 0;\n //For every image,\n for(int i= 0; i < imageNames.size(); i++){\n \t//z is a counter of the gop so we can decide if its a frameI or P\n if(z >= (gop)){\n z=0;\n }\n if(z == 0){//Frame I\n \t//Store it\n tempFrameI = imageDict.get(imageNames.get(i));\n imageDict.put(imageNames.get(i), tempFrameI);\n }else{\n //Frame P, decode it\n tempFrame = imageDict.get(imageNames.get(i)); \n tempBitmap = (WritableRaster) tempFrame.getData();\n tempDecoded = tempBitmap.createWritableChild(tempFrame.getMinX(), tempFrame.getMinY(), tempFrame.getWidth(), tempFrame.getHeight(), 0,0, null);\n \t//Get his info\n tempData = dataList.get(recoveredDataCounter);\n recoveredDataCounter++;\n int[] tempColor;\n //Iterate through the tile and replace its pixels\n for(int k = 0; k < tempData.bestTilesX.size(); k++){\n for (int baseX = 0; baseX < tempData.tileWidth ; baseX++) {\n for (int baseY = 0; baseY < tempData.tileHeight; baseY++) {\n tempColor = getPixelColor(tempFrameI, tempData.bestOriginX.get(k)+baseX, tempData.bestOriginY.get(k)+baseY);\n tempDecoded.setPixel(tempData.bestTilesX.get(k)+baseX, tempData.bestTilesY.get(k)+baseY, tempColor);\n }\n }\n }\n //Store the new decoded image\n tempBufferedImage = new BufferedImage(tempFrame.getColorModel(),tempDecoded,tempFrame.isAlphaPremultiplied(),null);\n imageDict.put(imageNames.get(i), tempBufferedImage);\n tempFrameI = tempBufferedImage;\n }\n z++;\n }\n }", "private int optimizeForNColorsAndRebuildPalette(BufferedImage img, IMapColor mapColor) {\n \t\t\n \t\tint maxDist = 0;\n \t\tmaxDist = mapColor.getMinimalPaletteDistance();\n \n \t\tHistogram hist = new Histogram(img);\n \t\tint interestingColors = 0;\n \t\tint mappedColors = 0;\n \t\t\n \t\tint mostInterestingColors = 0;\n \t\t\n \t\t//int total = img.getWidth() * img.getHeight();\n \t\t\n \t\t//for (int mask = 4; mask < 7; mask++) {\n \t\t\tmappedColors = hist.generate(mapColor, maxDist, 0);\n \t\t\tinterestingColors = hist.size();\n \t\t\tif (interestingColors > mostInterestingColors)\n \t\t\t\tmostInterestingColors = interestingColors;\n \t\t\tSystem.out.println(\"For mask \" + Integer.toHexString(0) \n \t\t\t\t\t+\"; # interesting = \" + interestingColors\n \t\t\t\t\t+\"; # mapped = \" + mappedColors);\n \t\t\t//if (interestingColors <= 256)\n \t\t\t//\tbreak;\n \t\t\t//if (mappedColors > total / 2)\n \t\t\t//\tbreak;\n \t\t//} \n \t\t\n \t\tint usedColors = Math.min(mapColor.getNumColors(), interestingColors);\n \t\t\n \t\tSystem.out.println(\"interestingColors=\"+interestingColors\n \t\t\t\t+\"; usedColors=\"+usedColors\n \t\t\t\t+\"; mappedColors=\" + mappedColors);\n \t\t\n \t\tint replaceDist = mapColor.getMaximalReplaceDistance(mostInterestingColors);\n \n \t\tint[] paletteSelections = new int[usedColors];\n \t\t\n \t\tif (mapColor.getNumColors() >= 16) {\n \t\t\tselectExponential(interestingColors, usedColors, paletteSelections);\n \t\t} else {\n \t\t\tselectNovelColors(mapColor, hist, interestingColors, usedColors, paletteSelections);\n \t\t}\n \t\t\n \t\tfor (int c = 0; c < usedColors; c++) {\n \t\t\tint idx = hist.getColorIndex(paletteSelections[c]);\n \t\t\tint r = (idx>>6) & 0x7;\n \t\t\tint g = (idx>>3) & 0x7;\n \t\t\tint b = (idx>>0) & 0x7;\n \t\t\tcanvas.setGRB333(c, g, r, b);\n \t\t\t\n \t\t\treplaceColor(img, hist, idx, rgb8ToPixel(thePalette[c]), replaceDist);\n \t\t}\n \t\t\n \t\t\n \t\treturn maxDist;\n \t}", "static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}", "public Group renderLevel() {\n\t\tGroup levelGroup = new Group();\n\t\tNode background = renderBackground(level);\n\t\tlevelGroup.getChildren().add(background);\n\t\tList<Sprite> textSpriteList = level.sprites().stream().filter(sprite -> sprite.isText()).collect(Collectors.toList());\n\t\ttextSpriteList.stream().forEach(textSprite -> levelGroup.getChildren().add(renderText(textSprite)));\n\t\tList<Sprite> imageSpriteList = level.sprites().stream().filter((sprite -> !sprite.isText())).collect(Collectors.toList());\n\t\timageSpriteList.stream().filter(sprite -> sprite.isActive()).forEach(sprite -> levelGroup.getChildren().add(renderSprite(sprite)));\n\t\treturn levelGroup;\n\t}", "public synchronized void generateLevel(Game game, int levelPack, int levelNumber) {\n\t\tInputStream in = null;\n\t\tString levelCode = levelPack + \"-\" + levelNumber;\n\t\ttry {\n\t\t\tin = game.getFileIO().readAsset(\"level\" + levelCode + \".txt\");\n\t\t\tList<String> layers = readLines(in);\n\t\t\t//set world height\n\t\t\tWORLD_HEIGHT = layers.size();\n\t\t\t\n\t\t\tfor(float i = 0, y = 0.5f + layers.size() - 1; i < layers.size(); i++, y -= 1) {\n\t\t\t\tString layer = layers.get((int)i);\n\t\t\t\t\n\t\t\t\tfor(float j = 0, x = 0.5f; j < layer.length(); j++, x += 1) {\n\t\t\t\t\tif(x > tempWidth) {\n\t\t\t\t\t\ttempWidth = x + 0.5f;\n\t\t\t\t\t}\n\t\t\t\t\tchar tile = layer.charAt((int)j);\n\t\t\t\t\t\n\t\t\t\t\tif(tile == 'T') {\n\t\t\t\t\t\tRegTile regTile = new RegTile(x, y);\n\t\t\t\t\t\tregTiles.add(regTile);\n\t\t\t\t\t} else if(tile == 'L') {\n\t\t\t\t\t\tRegTile regTile = new RegTile(x, y);\n\t\t\t\t\t\tregTiles.add(regTile);\n\t\t\t\t\t\tleftXLimit = x - 0.5f;\n\t\t\t\t\t} else if(tile == 'l') {\n\t\t\t\t\t\tRegTile regTile = new RegTile(x, y);\n\t\t\t\t\t\tregTiles.add(regTile);\n\t\t\t\t\t\trightXLimit = x + 0.5f;\n\t\t\t\t\t} else if(tile == 'M') {\n\t\t\t\t\t\tRegTile regTile = new RegTile(x, y);\n\t\t\t\t\t\tregTiles.add(regTile);\n\t\t\t\t\t\tminXLimit = x - 0.5f;\n\t\t\t\t\t} else if(tile == 'U') {\n\t\t\t\t\t\tSpike upSpike = new Spike(x, y);\n\t\t\t\t\t\tupSpikes.add(upSpike);\n\t\t\t\t\t} else if(tile == 'V') {\n\t\t\t\t\t\tSpike downSpike = new Spike(x, y);\n\t\t\t\t\t\tdownSpikes.add(downSpike);\n\t\t\t\t\t} else if(tile == 'R') {\n\t\t\t\t\t\tSpike rightSpike = new Spike(x, y);\n\t\t\t\t\t\trightSpikes.add(rightSpike);\n\t\t\t\t\t} else if(tile == 'J') {\n\t\t\t\t\t\tSpike leftSpike = new Spike(x, y);\n\t\t\t\t\t\tleftSpikes.add(leftSpike);\n\t\t\t\t\t} else if(tile == 'D') {\n\t\t\t\t\t\tDiamond diamond = new Diamond(x, y);\n\t\t\t\t\t\tdiamondBlocks.add(diamond);\n\t\t\t\t\t} else if(tile == 'G') {\n\t\t\t\t\t\tGold gold = new Gold(x, y);\n\t\t\t\t\t\tgoldBlocks.add(gold);\n\t\t\t\t\t} else if(tile == 'S') {\n\t\t\t\t\t\tSilver silver = new Silver(x, y);\n\t\t\t\t\t\tsilverBlocks.add(silver);\n\t\t\t\t\t} else if(tile == 'P') {\n\t\t\t\t\t\tplayer = new Player(x, y);\n\t\t\t\t\t\tplayer.velocity.y = 1;\n\t\t\t\t\t\trespawnPoint = new Vector2(x, y);\n\t\t\t\t\t} else if(tile == 'C') {\n\t\t\t\t\t\tCheckpoint checkpoint = new Checkpoint(x, y);\n\t\t\t\t\t\tcheckpoints.add(checkpoint);\n\t\t\t\t\t} else if(tile == 'F') {\n\t\t\t\t\t\tEndingFlag eflag = new EndingFlag(x, y);\n\t\t\t\t\t\teflags.add(eflag);\n\t\t\t\t\t} else if(tile == '#') {\n\t\t\t\t\t\tworldNumberG = (int)Math.ceil(y);\n\t\t\t\t\t\tlevelNumberG = (int)Math.ceil(x);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\t//set max found width across map to permanent width for current world\n\t\t\tWORLD_WIDTH = tempWidth;\n\t\t} catch (Exception e) {\n\t\t\t\n\t\t}\n\t}", "public TiledMap createMap() {\n map_inter = new MapTile[g_logic.MAP_WIDTH][g_logic.MAP_HEIGHT];\n \n //drawing stuff\n tiles = new Texture(Gdx.files.internal(\"packed/terrain.png\"));\n TextureRegion[][] splitTiles = TextureRegion.split(tiles, 54, 54);\n map = new TiledMap();\n MapLayers layers = map.getLayers();\n TiledMapTileLayer new_layer = new TiledMapTileLayer(g_logic.MAP_WIDTH, g_logic.MAP_HEIGHT, g_logic.ISO_WIDTH, g_logic.ISO_HEIGHT);\n \n //actual generation\n for (int x = 0; x < g_logic.MAP_WIDTH; x++) \n {\n for (int y = 0; y < g_logic.MAP_HEIGHT; y++) \n {\n char chara = '.';\n int ty = 0;\n int tx;\n if (x == 0 || x == g_logic.MAP_WIDTH-1)\n {\n tx = 1;\n chara = '#';\n }\n else\n {\n tx = 0; \n chara = '.';\n }\n \n //set up map tiles\n MapTile tile = new MapTile(x, y, tx, ty, chara);\n Gdx.app.log(\"Map gen\", \"Created a map tile @\" + x + \",\" + y + \" \" + tx + \" \" + ty + \" \" + chara);\n \n //put them in the internal map\n putInterMap(tile, x, y);\n \n //set up renderer cells\n TiledMapTileLayer.Cell cell = new TiledMapTileLayer.Cell();\n //y,x\n cell.setTile(new StaticTiledMapTile(splitTiles[tile.getTextureY()][tile.getTextureX()]));\n new_layer.setCell(x, y, cell);\n }\n }\n \n \n float y_off = g_logic.getYOffset();\n new_layer.setOffsetY(y_off);\n layers.add(new_layer);\n \n g_logic.setInterMap(map_inter);\n\n return map;\n }", "private void initImageBitmaps(){\n imageUrls.add(\"https://i.redd.it/j6myfqglup501.jpg\");\n names.add(\"Rocky Mountains\");\n\n imageUrls.add(\"https://i.redd.it/0u1u2m73uoz11.jpg\");\n names.add(\"Mt. Baker, WA\");\n\n imageUrls.add(\"https://i.redd.it/xgd2lnk56mz11.jpg\");\n names.add(\"Falls Creek Falls, TN\");\n\n imageUrls.add(\"https://i.redd.it/o6jc7peiimz11.jpg\");\n names.add(\"Skogafoss, Iceland\");\n\n imageUrls.add(\"https://i.redd.it/zxd44dfbyiz11.jpg\");\n names.add(\"Black Forest, Germany\");\n\n imageUrls.add(\"https://www.mountainphotography.com/images/xl/20090803-Hermannsdalstinden-Sunset.jpg\");\n names.add(\"Lofoten Islands, Norway\");\n\n imageUrls.add(\"https://i.redd.it/6vdpsld78cz11.jpg\");\n names.add(\"Isle of Skye\");\n\n imageUrls.add(\"https://i.redd.it/i4xb66v5eyy11.jpg\");\n names.add(\"Lago di Carezza, Italy\");\n\n imageUrls.add(\"https://i.redd.it/ttl7f4pwhhy11.jpg\");\n names.add(\"Arches National Park, UT\");\n\n imageUrls.add(\"https://i.redd.it/mcsxhejtkqy11.jpg\");\n names.add(\"Northern Lights\");\n\n imageUrls.add(\"https://i.redd.it/0rhq46ve83z11.jpg\");\n names.add(\"Swiss Alps\");\n\n imageUrls.add(\"https://i.redd.it/0dfwwitwjez11.jpg\");\n names.add(\"Hunan, China\");\n\n //Initialize our recyclerView now that we have our images/names\n initRecyclerView();\n }", "Render() {\n int imgNum;\n SampleModel sm = baseImage.getSampleModel(); // Set up the attributes for the new image.\n newImage = new TiledImage(baseImage.getMinX(),\n baseImage.getMinY(),\n (pixWidth * hTiles),\n (pixHeight * vTiles),\n baseImage.getTileGridXOffset(),\n baseImage.getTileGridYOffset(),\n baseImage.getSampleModel(),\n baseImage.getColorModel());\n RenderedImage smallImage; // Variable for holding the scaled down image to be placed in the large image.\n int tileArray[][] = new int[hTiles][vTiles]; // The array of how the tiles are arranged.\n // First, we select what tiles go where...\n for (int x = 0; x < hTiles; x++) { // Cycle through the image tiles, horizontally.\n for (int y = 0; y < vTiles; y++) { // Cycle through the image tiles, vertically.\n try {\n tileArray[x][y] = findBestFit(mapArray[x][y], tileArray, x, y); // Find the tile to go there.\n setCurr((x * vTiles) + y); // Update task stuff.\n setMsg(\"Choosing Image For Tile #\" + ((x * vTiles) + y));\n } catch (Exception e) {}\n }\n }\n\n setCurr(0); // Task stuff, for progress indicators...\n setMsg(\"Done Selecting Tiles... Generating Image\");\n\n // Next, we actually build the image based on the tiles we chose.\n for (int x = 0; x < hTiles; x++) { // Again, cycle horizonally,\n for (int y = 0; y < vTiles; y++) { // And vertically. ( for every tile in the image )\n try {\n smallImage = imageLoader.getRenderedImage(tileLibrary.get(tileArray[x][y]).getFileName()); // Load the image from the tile we selected.\n smallImage = imageOps.scale(smallImage, pixWidth, pixHeight); // Scale the image to the appropriate size.\n // Create a region of interest on the large image to paste the small image into.\n ROIShape myROI = new ROIShape(new Rectangle((x*pixWidth), (y*pixHeight), smallImage.getWidth(), smallImage.getHeight()));\n ParameterBlock pb = new ParameterBlock(); // Move the image to the appropriate spot...\n pb.addSource(smallImage);\n pb.add((float)(x*pixWidth));\n pb.add((float)(y*pixHeight));\n pb.add(new InterpolationNearest());\n smallImage = JAI.create(\"translate\", pb, null); // Do the translation.\n newImage.setData(smallImage.getData(), myROI); // Stick the tile image into the large image.\n setCurr((x * vTiles) + y); // Update task stuff.\n setMsg(\"Building Tile# \" + ((x * vTiles) + y));\n } catch (Exception e) {}\n }\n }\n setCurr(lengthOfTask); // Finish up the task stuff.\n setMsg(\"DONE!\");\n }", "public void setTexture(PImage image) {\n //m_tImage = image;\n m_texture = image.pixels;\n TEX_WIDTH = image.width;\n TEX_HEIGHT = image.height;\n F_TEX_WIDTH = TEX_WIDTH-1;\n F_TEX_HEIGHT = TEX_HEIGHT-1;\n INTERPOLATE_UV = true;\n \n if (image.format == ARGB) {\n m_drawFlags |= R_TEXTURE32;\n } else if (image.format == RGB) {\n m_drawFlags |= R_TEXTURE24;\n } else if (image.format == ALPHA) {\n m_drawFlags |= R_TEXTURE8;\n }\n }", "public native void textureImage(MagickImage image) throws MagickException;", "private void loadTextures() {\r\n int[] imgData;\r\n int width;\r\n int height;\r\n\r\n BitmapFactory.Options options = new BitmapFactory.Options();\r\n //圖片質量,數字越大越差\r\n options.inSampleSize = 1;\r\n Bitmap bitmap = BitmapFactory.decodeByteArray(path, 0, path.length, options);\r\n width = bitmap.getWidth();\r\n height = bitmap.getHeight();\r\n imgData = new int[width * height * 4];\r\n bitmap.getPixels(imgData, 0, width, 0, 0, width, height);\r\n bitmap.recycle();\r\n System.gc();\r\n\r\n mTextures.add(Texture.loadTextureFromIntBuffer(imgData, width, height));\r\n }", "private void loadMapData(Context context, int pixelsPerMeter,int px,int py){\n\n char c;\n\n //keep track of where we load our game objects\n int currentIndex = -1;\n\n //calculate the map's dimensions\n mapHeight = levelData.tiles.size();\n mapWidth = levelData.tiles.get(0).length();\n\n //iterate over the map to see if the object is empty space or a grass\n //if it's other than '.' - a switch is used to create the object at this location\n //if it's '1'- a new Grass object it's added to the arraylist\n //if it's 'p' the player it's initialized at the location\n\n for (int i = 0; i < levelData.tiles.size(); i++) {\n for (int j = 0; j < levelData.tiles.get(i).length(); j++) {\n\n c = levelData.tiles.get(i).charAt(j);\n //for empty spaces nothing to load\n if(c != '.'){\n currentIndex ++;\n switch (c){\n case '1' :\n //add grass object\n gameObjects.add(new Grass(j,i,c));\n break;\n\n case 'p':\n //add the player object\n gameObjects.add(new Player(context,px,py,pixelsPerMeter));\n playerIndex = currentIndex;\n //create a reference to the player\n player = (Player)gameObjects.get(playerIndex);\n break;\n }\n\n //check if a bitmap is prepared for the object that we just added in the gameobjects list\n //if not (the bitmap is still null) - it's have to be prepared\n if(bitmapsArray[getBitmapIndex(c)] == null){\n //prepare it and put in the bitmap array\n bitmapsArray[getBitmapIndex(c)] =\n gameObjects.get(currentIndex).prepareBitmap(context,\n gameObjects.get(currentIndex).getBitmapName(),\n pixelsPerMeter);\n }\n\n }\n\n }\n\n }\n }", "private void bindTextures() {\n\t\ttry {\n//\t\t\tif (textureLoadIndex < maxNumTextures) {\n\t\t\tboundAll = true;\n\t\t\tfor (int n=0; n<sortedPanImageList.length; n++) {\n\t\t\t\tPanImageEntry panImageEntry = sortedPanImageList[n];\n\t\t\t\tif (panImageEntry.imageListEntry.enabled && (!panImageEntry.loaded)) {\n\t\t\t\t\tboundAll = false;\n\t\t\t\t}\n\t\t\t\tif (panImageEntry.loadImageBuffer != null) {\n\t\t\t\t\tif (panImageEntry.textureNumber < 0) {\n\t\t\t\t\t\t// find new texture number\n\t\t\t\t\t\tif (textureLoadIndex < maxNumTextures) {\n\t\t\t\t\t\t\tpanImageEntry.textureNumber = textures.get(textureLoadIndex);\n\t\t\t\t\t textureLoadIndex++;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// no more textures available\n\t\t\t\t\t\t\tSystem.out.println(\"out of available textures\");\n\t\t\t\t\t\t\tpanImageEntry.loadImageBuffer = null;\n\t\t\t\t\t\t\timageLoader.suspend();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n//\t\t\t\t System.out.println(\"*** binding texture \"+panImageEntry.textureNumber);\n//\t\t\t\t long startTime = System.currentTimeMillis();\n\t\t\t GL11.glBindTexture(GL11.GL_TEXTURE_2D, panImageEntry.textureNumber);\n/*\t\t\t \n\t\t\t if (mipmap) {\n\t\t\t GLU.gluBuild2DMipmaps(GL11.GL_TEXTURE_2D, GL11.GL_RGB8, panImageEntry.loadImageWidth, panImageEntry.loadImageHeight, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, panImageEntry.loadImageBuffer);\n\t\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);\n\t\t\t }\n\t\t\t else {\n\t\t\t GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB8, panImageEntry.loadImageWidth, panImageEntry.loadImageHeight, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, panImageEntry.loadImageBuffer);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);\n\t\t\t }\n*/\n\t\t\t int numLevels = panImageEntry.loadImageBuffer.size();\n\t\t\t if (numLevels == 1) {\n\t\t\t \tint width = ((Integer) panImageEntry.loadImageWidth.get(0)).intValue();\n\t\t\t \tint height = ((Integer) panImageEntry.loadImageHeight.get(0)).intValue();\n\t\t\t \tByteBuffer buffer = (ByteBuffer) panImageEntry.loadImageBuffer.get(0);\n\t\t\t GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB8, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);\n\t\t\t GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR/*GL11.GL_NEAREST*/);\n\t\t\t \tfor (int level=0; level<numLevels; level++) {\n\t\t\t\t \tint width = ((Integer) panImageEntry.loadImageWidth.get(level)).intValue();\n\t\t\t\t \tint height = ((Integer) panImageEntry.loadImageHeight.get(level)).intValue();\n\t\t\t\t \tByteBuffer buffer = (ByteBuffer) panImageEntry.loadImageBuffer.get(level);\n\t\t\t\t GL11.glTexImage2D(GL11.GL_TEXTURE_2D, level, GL11.GL_RGB8, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer);\n\t\t\t \t}\n\t\t\t }\n\t\t\t panImageEntry.loadImageBuffer = null;\n\t\t\t panImageEntry.loadImageHeight = null;\n\t\t\t panImageEntry.loadImageWidth = null;\n\t\t\t panImageEntry.loaded = true;\n//\t\t\t\t System.out.println(\"done\");\n//\t\t\t long time = System.currentTimeMillis() - startTime;\n//\t\t\t System.out.println(\"took \"+time+\" millis\");\n\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Throwable e) {\n\t\t\tUnknownExceptionDialog.openDialog(this.getShell(), \"Error loading image\", e);\n\t\t\te.printStackTrace(); \n\t\t}\n\t\t\n\t}", "public void create(int [][] arr) {\n //default background image\n gc.drawImage(bg0, 0, 0);\n gc.drawImage(bg0, 1024,0);\n\n // traverses 2D array to creat map\n for(int i = 0; i < arr.length; i++) {\n for(int j = 0; j < arr[0].length; j++) {\n if(arr[i][j] == 0) {\n //blank space, for reference\n } else if(arr[i][j] == 1) { // make IndestructibleObject\n IndestructibleObject object = new IndestructibleObject(img0, j*64, i*64);\n mapList.add(object);\n } else if(arr[i][j] == 2) { // make DestructibleObject\n DestructibleObject object = new DestructibleObject(img1, j*64, i*64);\n mapList.add(object);\n } else if(arr[i][j] == 3) { // make power up\n PowerUpObject object = new PowerUpObject(img2, j*64+1, i*64, 1);\n powerList.add(object);\n } else if(arr[i][j] == 4) { // make power up\n PowerUpObject object = new PowerUpObject(img3, j*64+1, i*64, 2);\n powerList.add(object);\n } else if(arr[i][j] == 5) { // make power up\n PowerUpObject object = new PowerUpObject(img4, j*64+1, i*64, 3);\n powerList.add(object);\n } else if(arr[i][j] == 6) { // make power up\n PowerUpObject object = new PowerUpObject(img5, j*64+1, i*64, 4);\n powerList.add(object);\n }\n }\n }\n }", "int[] getVisualToLogicalMap() {\n if (v2lMap == null) {\n v2lMap = createVisualToLogicalMap(levels);\n }\n return v2lMap;\n }", "public void loadTileImages() {\n // keep looking for tile A,B,C, etc. this makes it\n // easy to drop new tiles in the images/ directory\n tiles = new ArrayList();\n char ch = 'A';\n while (true) {\n String name = \"tile_\" + ch + \".png\";\n File file = new File(\"images/\" + name);\n if (!file.exists()) {\n break;\n }\n tiles.add(loadImage(name));\n ch++;\n }\n }", "private static AppImage scale(AppImage image) {\n\t\treturn scale(image, GraphicsConfig.getScaleWidth(), GraphicsConfig.getScaleHeight());\n\t}", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "public OutputImageManager(PImage img, Tile[] tiles, int tileSize, int pdfScale, float evenRowShift, float oddRowShift, int background)\n {\n this.mosaic = null;\n this.background = background;\n this.tiles = tiles;\n this.evenRowShift = evenRowShift;\n this.oddRowShift = oddRowShift;\n this.tileSize = tileSize;\n this.pdfScale = pdfScale;\n this.infoGraphics = loadImage(\"keys.png\");\n toRerender = true;\n }", "private TileType[][] imageToWorld(BufferedImage image) {\n if (image == null) {\n return null;\n }\n\n width = image.getWidth();\n height = image.getHeight();\n int[] rgbWorld = image.getRGB(0, 0, width, height, null, 0, width);\n\n TileType[][] tileWorld = new TileType[width][height];\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n int index = twoDimIndexToOneDimIndex(x, y);\n tileWorld[x][y] = TileType.rgbColorToTile(rgbWorld[index]);\n if (tileWorld[x][y] == TileType.UNKNOWN) {\n System.err.println(\"Locaetion: \" + index + \" (\" + x + \",\" + y + \")\");\n }\n }\n }\n return tileWorld;\n }", "public void drawImage()\n {\n imageMode(CORNERS);\n //image(grayImgToFit, firstCellPosition[0], firstCellPosition[1]);\n image(canvas, firstCellPosition[0], firstCellPosition[1]);\n //image(tileMiniaturesV[0],10,250);\n //if(avaragedImgs.length > 4)\n // image(avaragedImgs[3],200,200);\n //getTileIntensityAtIndex(15,15);\n //println(tiles[7].getEndBrightness());\n \n }", "public int loadCubeMap(int res[]) {\n int[] cubeMap = new int[1];\n\n GLES30.glGenTextures(1, cubeMap, 0);\n GLES30.glBindTexture(GLES30.GL_TEXTURE_CUBE_MAP, cubeMap[0]);\n\n if (cubeMap[0] != 0) {\n // decode the image file; openGL can't just take an image file\n final BitmapFactory.Options options = new BitmapFactory.Options();\n options.inScaled = false; // No pre-scaling\n\n for (int i = 0; i < 6; i++) {\n // Read in the resource\n final Bitmap bitmap = BitmapFactory.decodeResource(surfaceView.getResources(), res[i], options);\n GLUtils.texImage2D(GLES30.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, bitmap, 0);\n }\n\n GLES30.glTexParameteri(GLES30.GL_TEXTURE_CUBE_MAP, GLES30.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);\n GLES30.glTexParameteri(GLES30.GL_TEXTURE_CUBE_MAP, GLES30.GL_TEXTURE_MIN_FILTER, GLES30.GL_LINEAR);\n GLES30.glTexParameteri(GLES30.GL_TEXTURE_CUBE_MAP, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE);\n GLES30.glTexParameteri(GLES30.GL_TEXTURE_CUBE_MAP, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE);\n GLES30.glTexParameteri(GLES30.GL_TEXTURE_CUBE_MAP, GLES30.GL_TEXTURE_WRAP_R, GLES30.GL_CLAMP_TO_EDGE);\n }\n\n if (cubeMap[0] == 0) {\n throw new RuntimeException(\"Error loading texture\");\n }\n\n return cubeMap[0];\n }", "public static void main(String args[]) {\n double zoomLevel = 3;\n int iternumber = 100;\n for (int i = 0; i < 10; i++) {\n String fileName = \"Test\"+i+\".ppm\";\n Fractal.makeImage(-1.45,0,1000,zoomLevel,fileName,iternumber);\n zoomLevel = zoomLevel/10;\n iternumber += 100;\n }\n }", "private static BufferedImage getMap(int art, GameModel gameModel, Color mapC, Color skyC){\n\n BufferedImage image = new BufferedImage(2800,1800,BufferedImage.TYPE_4BYTE_ABGR);\n\n int genauigkeit = 400;\n\n int[] mapX = new int[genauigkeit + 2];\n int[] mapY = new int[genauigkeit + 2];\n\n mapX[genauigkeit + 1] = 0;\n mapX[genauigkeit] = GameLoop.imgW;\n\n mapY[genauigkeit + 1] = GameLoop.imgH;\n mapY[genauigkeit] = GameLoop.imgH;\n\n double[] rnd = new double[8];\n\n for(int i = 0;i < 4;i++){\n rnd[i] = Math.random() * 0.1;\n rnd[i+4] = Math.random();\n }\n\n for(int i = 0;i < genauigkeit;i++){\n mapX[i] = (int) (GameLoop.imgW/(double)genauigkeit * (i));\n\n switch(art){\n case 1:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.1) * gameModel.getHeight()/8);\n break;\n case 2:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.01) * gameModel.getHeight()/8);\n break;\n case 3:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.sin(i * 0.1) * gameModel.getHeight()/12 + i);\n break;\n case 4:\n mapY[i] = (int) (gameModel.getHeight()*0.8 - 1/(2000 + Math.pow(i - (genauigkeit - 2)/2.0,2)) * 1500000);\n break;\n case 5:\n mapY[i] = (int) (gameModel.getHeight()/(double)2 + Math.pow(Math.sin(i * 0.03),3) * gameModel.getHeight()/4);\n break;\n case 6:\n mapY[i] = (int) (gameModel.getHeight()/2.0);\n mapY[i] += Math.sin(i * (rnd[0])) * rnd[4] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[1])) * rnd[5] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[2])) * rnd[6] * gameModel.getHeight()*0.1;\n mapY[i] += Math.sin(i * (rnd[3])) * rnd[7] * gameModel.getHeight()*0.1;\n\n\n\n\n\n }\n\n }\n\n Polygon map = new Polygon(mapX,mapY,genauigkeit+2);\n\n Graphics2D g2d = image.createGraphics();\n\n g2d.setColor(skyC);\n\n g2d.fillRect(0,0,2800,1800);\n\n g2d.setColor(mapC);\n\n g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n g2d.fillPolygon(map);\n\n return image;\n }", "public Level(){\n\t\tlevel_image_pattern = \"default\";\n\t\t\n\t\timages = new HashMap <String, Image>();\n\t\tpickables = new ArrayList<Pickable>();\n\t\tplayer_initial_position = new int[2];\n\t\tplayer_initial_position[0] = 0;\n\t\tplayer_initial_position[1] = 0;\n\t\t\n\t\tconfig = Config.getInstance();\n\t\t\n\t}", "private static RenderedImage createImage(RegionReport rr) {\n BufferedImage bufferedImage = new BufferedImage(MAP_SIZE, MAP_SIZE,\n BufferedImage.TYPE_INT_RGB) ;\n // Create a graphics contents on the buffered image\n Graphics2D g2d = bufferedImage.createGraphics() ;\n g2d.setColor(Color.black);\n //TODO need to set default overflow to something other than black,\n // or set this default background to something else. colors colors colors.\n g2d.fillRect(0, 0, MAP_SIZE, MAP_SIZE);\n\n // SL coordinates work like math x/y graph\n // Java coordinates start at top left. Rotate 90 degrees\n // counterclockwise to compensate.\n AffineTransform at = new AffineTransform();\n at.concatenate(AffineTransform.getRotateInstance(CCW_90, MAP_SIZE/2.0, MAP_SIZE/2.0));\n at.scale(SCALE, SCALE);\n g2d.transform(at) ;\n \n String s = rr.getSubParcels() ;\n\n// \tGerstle\n// s = \"192,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,4,14,5,2,1,16,2,16,3,16,1,14,5,2,1,16,2,16,3,16,1,14,5,2,1,16,2,16,3,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,5,2,1,16,2,16,10,4,6,4,7,4,8,4,9,14,7,2,1,16,2,16,10,16,1,14,7,2,1,16,2,16,10,16,1,14,7,2,1,16,2,16,10,16,1,14,7,2,1,16,2,16,10,8,7,4,11,4,12,14,7,2,1,16,2,16,10,8,7,4,11,4,12,14,7,2,1,16,2,16,10,8,7,4,11,4,12,14,7,2,1,16,13,16,10,8,7,4,11,4,12,14,7,2,1,16,13,16,10,8,7,4,11,4,12,14,7,2,1,16,13,24,7,4,11,4,12,14,7,2,1,16,13,24,7,4,11,4,12,14,7,2,1,16,13,24,7,4,11,4,12,14,7,2,1,16,13,16,7,16,1,14,7,2,1,16,13,16,7,16,1,14,7,2,1,16,13,16,7,16,1,14,7,2,1,23,13,1,14,38,7,2,1,24,13,38,7,2,1,24,13,38,7,2,1,24,13,38,7,2,1,24,13,38,7,2,1,24,13,38,7,2,1,24,13,38,7,2,1,21,15,3,13,38,7,2,1,21,15,6,13,5,7,16,1,14,7,2,1,21,15,6,13,5,7,16,1,14,7,2,1,21,15,6,13,5,7,16,1,14,7,2,1,21,15,6,13,35,7,2,1,21,15,7,13,34,7,2,1,21,15,7,13,34,7,2,1,21,15,9,13,32,7,2,1,21,15,9,13,32,7,2,1,21,15,11,13,30,7,2,1,21,15,11,13,30,7,2,1,21,15,11,13,30,7,2,1,21,15,11,13,16,1,14,7,2,1,21,15,11,13,16,1,14,7,2,1,21,15,11,13,16,1,14,7,2,1,21,15,11,13,16,1,14,7,2,1,21,15,11,13,16,1,14,7,2,1,\" ;\n// // Palomarian\n// String s = \"8,1,4,2,4,3,11,4,20,5,17,4,8,1,4,2,4,3,12,4,19,5,17,4,8,1,4,2,4,3,13,4,18,5,17,4,8,1,4,2,4,3,14,4,17,5,17,4,8,1,4,2,4,3,14,4,17,5,17,4,8,1,4,2,4,3,15,4,16,5,17,4,8,1,4,2,4,3,16,4,15,5,11,4,2,6,4,4,8,1,4,2,4,3,16,4,15,5,11,4,2,6,4,4,4,5,4,7,8,8,17,4,16,5,9,4,2,6,4,4,4,5,4,7,8,8,18,4,16,5,8,4,2,6,4,4,4,5,4,7,8,8,22,4,14,5,6,4,2,6,4,4,4,5,4,7,8,8,25,4,12,5,5,4,2,6,4,4,4,5,4,7,8,8,30,4,9,5,3,9,2,6,4,4,4,5,4,7,8,8,31,4,9,5,2,9,2,6,8,5,4,7,8,8,32,4,9,5,1,9,2,6,8,5,4,7,8,8,34,4,8,5,2,6,4,5,17,8,35,4,12,5,17,8,35,4,12,5,17,8,37,4,10,5,17,8,37,4,10,5,17,8,37,4,10,5,17,8,38,4,9,5,17,8,38,4,9,5,18,8,36,4,10,5,18,8,35,4,11,5,18,8,34,4,12,5,18,8,33,4,13,5,18,8,32,4,14,5,18,8,32,4,8,5,6,4,18,8,30,4,9,5,7,4,18,8,30,4,8,5,8,4,18,8,30,4,7,5,9,4,12,5,36,4,7,5,9,4,12,5,36,4,6,5,10,4,12,5,35,4,6,5,11,4,12,5,35,4,5,5,12,4,12,5,34,4,5,5,13,4,14,5,31,4,6,5,13,4,6,10,9,5,30,4,5,5,14,4,6,10,11,5,27,4,5,5,15,4,6,10,4,4,8,5,25,4,5,5,16,4,6,10,6,4,8,5,2,4,1,5,20,4,5,5,16,4,6,10,8,4,12,5,16,4,6,5,16,4,6,10,8,4,12,5,15,4,7,5,16,4,6,10,8,4,15,5,12,4,7,5,16,4,6,10,10,4,16,5,8,4,8,5,16,11,6,10,10,4,18,5,5,4,9,5,16,11,6,10,10,4,32,5,16,11,8,12,8,4,32,5,16,11,8,12,8,4,32,5,16,11,8,12,8,4,32,5,16,11,8,12,8,4,32,5,16,11,8,12,8,4,16,5,1,11,15,5,16,11,8,12,8,4,16,5,3,11,13,5,16,11,8,12,8,4,16,5,6,11,10,5,16,11,8,12,8,4,16,5,7,11,9,5,16,11,8,12,8,13,4,14,4,15,8,4,9,11,7,5,16,11,8,12,8,13,4,14,4,15,8,4,10,11,6,5,16,11,8,12,8,13,4,14,4,15,8,4,11,11,6,5,15,11,8,12,8,13,4,14,4,15,8,4,12,11,5,5,15,11,8,12,8,4,4,14,4,15,8,4,13,11,5,5,14,11,8,12,8,4,4,14,4,15,8,4,14,11,5,5,13,11,8,12,8,4,4,14,4,15,8,4,14,11,6,5,12,11,8,12,8,4,4,14,4,15,8,4,15,11,6,5,11,11,\" ;\n// Clementina\n// String s = \"23,1,41,2,23,1,41,2,23,1,41,2,23,1,20,2,16,1,5,2,25,1,14,2,9,1,4,3,7,1,5,2,48,1,4,3,7,1,5,2,48,1,4,3,7,1,5,2,7,1,8,4,33,1,4,3,7,1,5,2,3,5,4,1,7,5,1,4,33,1,4,3,7,1,5,2,3,5,4,1,8,5,33,1,4,3,7,1,5,2,15,5,15,1,5,2,24,1,5,2,15,5,15,1,5,2,24,1,5,2,15,5,15,1,5,2,24,1,5,2,15,5,15,1,12,6,1,7,16,1,2,7,3,2,15,5,14,1,13,6,13,7,4,1,2,7,3,2,15,5,3,1,24,6,19,7,3,2,15,5,3,1,24,6,19,7,3,2,15,5,3,1,24,6,19,7,3,2,15,5,3,1,10,6,3,4,10,6,20,7,3,2,7,5,8,8,7,9,6,6,4,4,9,6,20,7,3,2,7,5,8,8,7,9,6,6,4,4,9,6,20,7,3,2,7,5,8,8,7,9,6,6,3,4,1,10,9,6,20,7,3,2,1,11,6,5,8,8,7,9,6,6,4,4,9,6,20,7,3,2,7,11,8,8,7,9,6,6,9,4,24,7,3,2,7,11,8,8,7,1,6,6,10,4,23,7,3,2,7,11,12,8,3,1,6,6,5,12,5,4,22,7,3,2,1,1,7,11,16,8,5,6,5,12,4,4,7,13,15,7,4,2,1,1,7,11,8,8,6,5,1,14,6,6,3,12,6,4,7,13,14,7,5,2,1,1,1,11,5,9,1,11,8,8,2,5,5,14,6,6,3,12,6,4,7,13,14,7,5,2,1,1,1,11,6,9,8,8,2,5,5,14,6,6,3,12,6,4,7,13,13,7,1,1,5,2,1,1,1,11,7,9,7,8,7,5,6,6,4,1,5,4,18,15,3,7,5,2,1,1,1,11,7,9,7,8,7,5,6,6,27,15,3,7,5,2,1,1,8,9,7,8,7,5,6,6,27,15,3,7,3,2,3,1,9,9,6,8,7,5,6,6,27,15,3,7,3,2,3,1,9,9,6,8,7,5,6,6,27,15,3,7,2,2,1,16,2,17,1,1,9,9,5,8,8,5,4,6,2,4,13,15,7,7,7,15,3,7,2,2,3,17,1,1,9,9,5,8,8,5,4,6,2,4,13,15,17,7,2,2,4,1,11,9,3,8,8,5,6,2,13,15,17,7,2,2,3,15,1,1,11,9,3,8,1,5,22,8,2,15,2,2,17,7,2,2,3,15,1,1,11,9,3,8,1,5,22,8,2,15,2,2,17,7,2,2,3,15,1,1,11,9,26,8,2,15,2,2,17,7,2,2,3,15,1,1,11,9,26,8,2,2,16,18,3,7,2,2,4,1,11,9,26,8,2,2,16,18,3,7,3,2,3,1,11,9,26,8,2,2,16,18,3,7,3,2,3,1,11,9,26,8,2,2,16,18,3,7,3,2,3,1,15,9,22,8,2,2,16,18,3,7,3,2,3,1,15,9,22,8,5,2,13,18,3,7,3,2,3,1,15,9,22,8,9,2,12,18,3,2,3,1,15,9,22,8,9,2,12,18,3,2,16,1,2,9,22,8,9,2,12,18,3,2,16,1,2,9,22,8,9,2,12,18,5,2,16,1,22,8,5,2,5,19,11,18,5,2,16,1,22,8,5,2,14,19,1,1,6,2,16,1,22,8,5,2,13,19,2,1,6,2,14,1,8,20,15,8,6,2,12,19,3,1,6,2,12,1,10,20,4,21,5,19,7,22,3,19,8,2,6,19,1,1,8,2,11,1,11,20,4,21,5,19,7,22,3,19,8,2,5,19,2,1,8,2,11,1,11,20,4,21,5,19,7,22,3,19,8,2,5,19,2,1,8,2,11,1,11,20,4,21,15,19,8,2,6,19,9,2,1,23,10,1,11,20,4,21,15,19,8,2,5,19,11,2,10,1,11,20,4,21,4,19,17,2,7,19,11,2,10,1,11,20,2,21,41,2,11,1,11,20,1,21,41,2,11,1,12,21,41,2,\" ;\n// Teal 8/08\n// String s = \"19,1,42,2,3,3,19,1,42,2,3,3,31,1,33,3,31,1,33,3,31,1,33,3,31,1,33,3,31,1,33,3,26,1,5,4,33,3,26,1,5,4,23,3,4,5,6,3,26,1,5,4,19,3,8,5,6,3,26,1,5,4,19,3,8,5,6,3,18,1,4,2,4,1,5,4,21,3,12,5,18,1,4,2,4,1,5,4,22,3,11,5,18,1,4,2,4,1,5,4,22,3,11,5,14,3,7,2,17,3,8,2,7,3,11,5,14,3,7,2,17,3,8,2,7,3,11,5,14,3,7,2,17,3,8,2,7,3,11,5,14,3,7,2,17,3,8,2,7,3,11,5,14,3,4,2,20,3,8,2,7,3,11,5,13,3,1,6,4,2,20,3,8,2,7,3,11,5,12,3,6,2,22,3,12,2,12,5,12,3,6,2,22,3,12,2,12,5,12,3,5,2,23,3,12,2,12,5,12,3,5,2,10,3,3,2,10,3,12,2,12,5,12,3,5,2,10,3,3,2,10,3,12,2,1,3,11,7,12,3,5,2,10,3,3,2,10,3,12,2,1,3,11,7,12,3,5,2,10,3,3,2,10,3,12,2,12,7,9,3,8,2,10,3,3,2,13,3,9,2,12,7,9,3,8,2,10,3,3,2,13,3,9,2,12,7,9,3,3,2,15,3,3,2,13,3,9,2,12,7,9,3,3,2,15,3,3,2,13,3,9,2,12,7,9,3,3,2,15,3,3,2,13,3,9,2,12,7,10,2,13,3,5,2,15,3,9,2,3,7,2,8,7,5,10,2,13,3,5,2,15,3,9,2,3,7,2,8,7,5,10,2,13,3,5,2,14,3,1,6,9,2,12,5,10,2,13,3,5,2,13,3,2,6,9,2,12,5,10,2,13,3,5,2,13,3,2,6,9,2,12,5,10,2,13,3,5,2,13,3,2,6,9,2,12,5,10,2,13,3,5,2,10,3,14,2,12,5,10,2,12,3,5,2,11,3,14,2,12,5,22,3,5,2,11,3,14,2,12,5,22,3,5,2,11,3,14,2,12,5,22,3,5,2,11,3,5,2,7,6,14,5,22,3,5,2,4,3,12,2,7,6,14,5,22,3,5,2,4,3,12,2,7,6,14,5,22,3,21,2,7,6,14,5,22,3,21,2,7,6,14,5,22,3,18,2,11,6,13,5,22,3,18,2,15,6,9,5,22,3,16,2,17,6,9,5,22,3,16,2,17,6,9,5,22,3,16,2,17,6,9,5,22,3,16,2,17,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,16,6,9,5,22,3,17,2,6,9,8,3,11,5,22,3,17,2,6,9,8,3,11,5,22,3,17,2,6,9,9,3,10,5,22,3,17,2,7,9,8,3,10,5,22,3,17,2,7,9,8,3,10,5,\" ;\n// Sage\n// String s = \"2,1,19,2,16,3,27,4,2,1,19,2,16,3,27,4,21,2,16,3,27,4,21,2,16,3,27,4,21,2,16,3,27,4,21,2,16,3,27,4,21,2,43,4,1,1,20,2,43,4,21,2,43,4,21,2,43,4,21,2,43,4,21,2,43,4,1,2,11,5,9,2,43,4,1,2,11,5,9,2,43,4,12,5,9,2,40,4,3,6,12,5,9,2,40,4,3,6,12,5,3,2,46,4,3,6,61,4,3,6,61,4,3,6,61,4,3,6,61,4,3,6,61,4,3,6,53,4,11,6,53,4,11,6,6,7,22,4,8,8,17,4,11,6,6,7,22,4,8,8,17,4,11,6,6,7,22,4,8,8,17,4,11,6,6,7,22,4,8,8,17,4,11,6,6,7,47,4,11,6,6,7,47,4,11,6,6,7,47,4,11,6,6,7,47,4,11,6,6,7,47,4,11,6,1,4,5,7,47,4,11,6,1,4,5,7,47,4,11,6,53,4,11,6,53,4,11,6,53,4,11,6,53,4,11,6,53,4,11,6,53,4,11,6,1,9,1,4,12,10,39,4,11,6,2,9,12,10,39,4,11,6,2,9,13,10,38,4,11,6,2,9,13,10,29,4,9,9,1,3,10,6,2,9,13,10,29,4,9,9,1,3,10,6,2,9,13,10,29,4,9,9,1,3,10,6,2,9,13,10,27,4,1,11,1,4,9,9,1,3,10,6,2,9,13,10,38,9,1,3,10,6,2,9,13,10,38,9,1,3,10,6,2,9,13,10,38,9,1,3,10,6,53,9,1,3,10,6,53,9,1,3,10,6,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,55,9,9,12,\" ;\n \n java.util.StringTokenizer st = new java.util.StringTokenizer(s, \",\\r\\n \") ;\n\n int xx = 0 ;\n int yy = 0 ;\n while (st.hasMoreTokens()) {\n int count = Integer.parseInt(st.nextToken()) ;\n //BUG: should really do something more about missing element.\n if (!st.hasMoreTokens()) continue ;\n int ownerNum = Integer.parseInt(st.nextToken()) ;\n Owner owner = rr.getOwner(ownerNum) ;\n Color cc ;\n if (owner.isLinden()) {\n cc = new Color(100,100,100) ;\n }\n else {\n cc = OwnerColors.getOwnerColor(ownerNum) ; \n }\n g2d.setColor(cc) ;\n\n while (xx + count >= ROW_SIZE) {\n int finishRow = ROW_SIZE - xx ;\n \n g2d.fillRect(xx, yy, finishRow, 1) ;\n \n // trial of svg\n // <rect x=\"0\" y=\"8\" width=\"512\" height=\"8\"\n // style=\"fill:rgb(255,255,255)\"/>\n// char q = '\"' ;\n// System.out.println(\n// \"<rect x=\" + q + xx + q + \" y=\" + q + yy + q +\n// \" width=\" + q + finishRow + q + \" height=\" + q + \"1\" + q +\n// \" style=\" + q + \"fill:rgb(\" + \n// cc.getRed() + \",\" + cc.getGreen() + \",\" + cc.getBlue() \n// + \")\" + q + \"/>\") ;\n \n count -= finishRow ;\n yy++ ;\n xx = 0 ;\n }\n if (count > 0) { \n g2d.fillRect(xx, yy, count, 1) ;\n \n// char q = '\"' ;\n// System.out.println(\n// \"<rect x=\" + q + xx + q + \" y=\" + q + yy + q +\n// \" width=\" + q + count + q + \" height=\" + q + \"1\" + q +\n// \" style=\" + q + \"fill:rgb(\" + \n// cc.getRed() + \",\" + cc.getGreen() + \",\" + cc.getBlue() \n// + \")\" + q + \"/>\") ;\n\n \n xx += count ;\n }\n\n } // while more tokens \n \n // Graphics context no longer needed so dispose it\n g2d.dispose() ;\n\n return bufferedImage ;\n }", "@Override\n\tpublic String getInfo()\n\t{\n\t\tString result = \"Adjust image levels, gamma, and/or change bit depth\";\n\t\treturn result;\n\t}", "public TiledImage(BufferedImage image, int tile_X, int tile_Y) {\n\t\t\t\n\t\tm_imageWidth = image.getWidth();\n\t\tm_imageHeight = image.getHeight();\n\t\t\n\t\t// Determine number of rows and columns required\n\t\tm_rows = (int) Math.ceil(image.getWidth() / (double) tile_X);\n\t\tm_columns = (int) Math.ceil(image.getHeight() / (double) tile_Y);\n\t\t\n\t\tif (m_rows > 0 && m_columns > 0) {\n\t\t\t\n\t\t\tint chunks = m_rows * m_columns;\n\t\t\tint count = 0;\n\t\t\t\n\t\t\t// The goal here is to divide\n\t m_sourceTiles = new BufferedImage[chunks]; //Image array to hold image chunks\n\t m_transforms = new Translate[chunks];\n\t m_imageTiles = new Image[chunks];\n\t for (int x = 0; x < m_rows; x++) {\n\t for (int y = 0; y < m_columns; y++) {\n\t // Initialize the image array with image chunks\n\t \t// https://stackoverflow.com/questions/5836128/how-do-i-make-javas-imagebuffer-to-read-a-png-file-correctly\n\t \tint imageType = image.getType();\n\t \tif (imageType == 0) imageType = 5;\n\t m_sourceTiles[count] = new BufferedImage(tile_X, tile_Y, imageType);\n\t\n\t // draws the image chunk\n\t Graphics2D gr = m_sourceTiles[count].createGraphics();\n\t gr.drawImage(image, 0, 0, tile_X, tile_Y, tile_X * y, tile_Y * x, tile_X * y + tile_X, tile_Y * x + tile_Y, null);\n\t gr.dispose();\n\t \n\t // Create the JavaFX Image tile\n\t \t\tm_imageTiles[count] = SwingFXUtils.toFXImage(m_sourceTiles[count], null);\n\t \n\t // assign a translate offset Transform for the tile.\n\t int shiftX = tile_X * y;\n\t int shiftY = tile_Y * x;\n\t \n\t Translate translate = new Translate();\n\t translate.setX(shiftX);\n\t translate.setY(shiftY);\n\t m_transforms[count] = translate;\n\t \n\t count++;\n\t }\n\t }\n\t\t}\n\t}", "public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }", "public static void load(){\n for(TextureHandler t : textures){\n if(t.texture!=null)t.texture.dispose();\n }\n textures.clear();\n \n //if the textures are corrupt or just arent there then the error TextureHandler will\n //be a placeholder which is generated programatically so it is always there\n int size = 64;\n Pixmap pixmap = new Pixmap(size,size, Format.RGBA8888 );\n pixmap.setColor(1f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,size/2);\n pixmap.setColor(0f,0f,0f,1f);\n pixmap.fillCircle(size/2,size/2,(size/2)-2);\n pixmap.setColor(1f,0f,0f,1f);\n int offset = size/6;\n int length = (size+size)/3;\n pixmap.drawLine(offset,offset,offset+length,offset+length);\n pixmap.drawLine(offset+length,offset,offset,offset+length);\n error = new Texture(pixmap);\n pixmap.dispose();\n //things that get rendered the most get put at the top so theyre the first in the list\n textures.add(new TextureHandler(\"Block\" ,\"Block.png\",true));\n textures.add(new TextureHandler(\"Block1\",\"Block1.png\",true));\n textures.add(new TextureHandler(\"Block2\",\"Block2.png\",true));\n textures.add(new TextureHandler(\"Block3\",\"Block3.png\",true));\n textures.add(new TextureHandler(\"Block4\",\"Block4.png\",true));\n textures.add(new TextureHandler(\"GameBackground\",\"GameBackground.png\",true));\n \n textures.add(new TextureHandler(\"Hints\",\"Hints.png\",false));\n textures.add(new TextureHandler(\"Left\" ,\"ButtonLeft.png\",true));\n textures.add(new TextureHandler(\"Right\" ,\"ButtonRight.png\",true));\n textures.add(new TextureHandler(\"Rotate\",\"ButtonRotate.png\",true));\n textures.add(new TextureHandler(\"Pause\" ,\"ButtonPause.png\",true));\n textures.add(new TextureHandler(\"Label\" ,\"TextBox.png\",true));\n \n textures.add(new TextureHandler(\"Locked\",\"levels/Locked.png\",false));\n textures.add(new TextureHandler(\"Timer\",\"levels/Clock.png\",false));\n \n textures.add(new TextureHandler(\"PauseSelected\",\"SelectedPause.png\",true));\n textures.add(new TextureHandler(\"LeftSelected\",\"SelectedLeft.png\",true));\n textures.add(new TextureHandler(\"RightSelected\",\"SelectedRight.png\",true));\n textures.add(new TextureHandler(\"RotateSelected\",\"SelectedRotate.png\",true));\n \n textures.add(new TextureHandler(\"Background\",\"Background.png\",false));\n textures.add(new TextureHandler(\"Title\",\"MainMenuTitle.png\",false));\n\n }", "@Override\n public void computeTileStack(Map<Band, Tile> targetTileMap, Rectangle targetRectangle, ProgressMonitor pm)\n throws OperatorException {\n try {\n \n int x0 = targetRectangle.x;\n int y0 = targetRectangle.y;\n int w = targetRectangle.width;\n int h = targetRectangle.height;\n // System.out.println(\"x0 = \" + x0 + \", y0 = \" + y0 + \", w = \" + w + \", h = \" + h);\n \n ComplexFloatMatrix cplxMatrixMaster = null;\n ComplexFloatMatrix cplxMatrixSlave = null;\n RenderedImage srcImage;\n float[] dataArray;\n \n // pm.beginTask(\"Computation of interferogram\", targetProduct.getNumBands());\n \n // these are not very optimal loops: redo the looping to a single for Band loop with using HashMaps\n for (Band sourceBand : sourceProduct.getBands()) {\n \n String sourceBandUnit = sourceBand.getUnit();\n \n if (sourceBand == masterBand1) {\n } else if (sourceBand == masterBand2) {\n \n Tile masterRasterI = getSourceTile(masterBand1, targetRectangle);\n srcImage = masterRasterI.getRasterDataNode().getSourceImage();\n dataArray = srcImage.getData(targetRectangle).getSamples(x0, y0, w, h, 0, (float[]) null);\n \n FloatMatrix dataRealMatrix = new FloatMatrix(masterRasterI.getHeight(), masterRasterI.getWidth(), dataArray);\n \n Tile masterRasterQ = getSourceTile(masterBand2, targetRectangle);\n srcImage = masterRasterQ.getRasterDataNode().getSourceImage();\n dataArray = srcImage.getData(targetRectangle).getSamples(x0, y0, w, h, 0, (float[]) null);\n \n // FloatMatrix dataImagMatrix = new FloatMatrix(masterRasterQ.getWidth(), masterRasterQ.getHeight(), dataArray);\n FloatMatrix dataImagMatrix = new FloatMatrix(masterRasterQ.getHeight(), masterRasterQ.getWidth(), dataArray);\n \n cplxMatrixMaster = new ComplexFloatMatrix(dataRealMatrix, dataImagMatrix);\n \n } else if (sourceBandUnit != null && sourceBandUnit.contains(Unit.REAL)) {\n \n Tile slaveRasterI = getSourceTile(sourceBand, targetRectangle);\n srcImage = slaveRasterI.getRasterDataNode().getSourceImage();\n dataArray = srcImage.getData(targetRectangle).getSamples(x0, y0, w, h, 0, (float[]) null);\n \n // FloatMatrix dataRealMatrix = new FloatMatrix(slaveRasterI.getWidth(), slaveRasterI.getHeight(), dataArray);\n FloatMatrix dataRealMatrix = new FloatMatrix(slaveRasterI.getHeight(), slaveRasterI.getWidth(), dataArray);\n \n Tile slaveRasterQ = getSourceTile(slaveRasterMap.get(sourceBand), targetRectangle, pm);\n srcImage = slaveRasterQ.getRasterDataNode().getSourceImage();\n dataArray = srcImage.getData(targetRectangle).getSamples(x0, y0, w, h, 0, (float[]) null);\n \n FloatMatrix dataImagMatrix = new FloatMatrix(slaveRasterQ.getHeight(), slaveRasterQ.getWidth(), dataArray);\n \n cplxMatrixSlave = new ComplexFloatMatrix(dataRealMatrix, dataImagMatrix);\n \n }\n }\n \n // TODO: integrate subtraction of Reference Phase\n ComplexFloatMatrix cplxIfg = cplxMatrixMaster.muli(cplxMatrixSlave.conji());\n \n // if flat earth phase flag is on\n // ------------------------------------------------\n \n // normalize pixel :: range_axis\n DoubleMatrix rangeAxisNormalized;\n rangeAxisNormalized = DoubleMatrix.linspace(x0, x0 + w - 1, cplxIfg.columns);\n rangeAxisNormalized.subi(0.5 * (1 + sourceImageWidth));\n rangeAxisNormalized.divi(0.25 * (sourceImageWidth-1));\n \n DoubleMatrix azimuthAxisNormalized;\n azimuthAxisNormalized = DoubleMatrix.linspace(y0, y0 + h - 1, cplxIfg.rows);\n azimuthAxisNormalized.subi(0.5 * (1 + sourceImageHeight));\n azimuthAxisNormalized.divi(0.25 * (sourceImageHeight - 1));\n \n DoubleMatrix realReferencePhase = polyValOnGrid(azimuthAxisNormalized, rangeAxisNormalized,\n flatEarthPolyCoefs, degreeFromCoefficients(flatEarthPolyCoefs.length));\n \n FloatMatrix realReferencePhaseFlt = MatrixFunctions.doubleToFloat(realReferencePhase);\n ComplexFloatMatrix cplxReferencePhase = new ComplexFloatMatrix(MatrixFunctions.cos(realReferencePhaseFlt),\n MatrixFunctions.sin(realReferencePhaseFlt));\n \n // cplxIfg = cplxIfg.muli(cplxReferencePhase.transpose().conji());\n cplxIfg.muli(cplxReferencePhase.transpose().conji());\n \n for (Band targetBand : targetProduct.getBands()) {\n \n String targetBandUnit = targetBand.getUnit();\n \n final Tile targetTile = targetTileMap.get(targetBand);\n \n // all bands except for virtual ones\n if (targetBandUnit.contains(Unit.REAL)) {\n \n dataArray = cplxIfg.real().toArray();\n targetTile.setRawSamples(ProductData.createInstance(dataArray));\n \n } else if (targetBandUnit.contains(Unit.IMAGINARY)) {\n \n dataArray = cplxIfg.imag().toArray();\n targetTile.setRawSamples(ProductData.createInstance(dataArray));\n \n }\n \n }\n \n } catch (Throwable e) {\n \n OperatorUtils.catchOperatorException(getId(), e);\n \n }\n }", "@Override\r\n public void init() {\n Image bgImage = assets().getImage(\"images/bg.png\");\r\n ImageLayer bgLayer = graphics().createImageLayer(bgImage);\r\n graphics().rootLayer().add(bgLayer);\r\n\r\n // Create tiles\r\n tiles = new int[BOARD_MAX_WIDTH][BOARD_MAX_HEIGHT];\r\n printTiles();\r\n\r\n // Place mines at random positions\r\n int placedMines = 0;\r\n Random r = new Random();\r\n while (placedMines < MINES) {\r\n int row = r.nextInt(BOARD_MAX_WIDTH);\r\n int col = r.nextInt(BOARD_MAX_HEIGHT);\r\n if (tiles[row][col] == TILE_EMPTY) {\r\n tiles[row][col] = TILE_MINE;\r\n placedMines++;\r\n }\r\n }\r\n printTiles();\r\n\r\n // Count number of mines around blank tiles\r\n for (int row = 0; row < BOARD_MAX_WIDTH; row++) {\r\n for (int col = 0; col < BOARD_MAX_WIDTH; col++) {\r\n // Check surrounding tiles if mine\r\n if (tiles[row][col] == TILE_MINE) {\r\n for (int rowCheck = -1; rowCheck <= 1; rowCheck++) {\r\n for (int colCheck = -1; colCheck <= 1; colCheck++) {\r\n if (tileExistAndNotMine(row+rowCheck, col+colCheck)) {\r\n tiles[row+rowCheck][col+colCheck]++;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n printTiles();\r\n\r\n // Create tile map\r\n Map<Integer, TileType> tileMap = new HashMap<Integer, TileType>();\r\n tileMap.put(0, TileType.EMPTY);\r\n tileMap.put(1, TileType.ONE);\r\n tileMap.put(2, TileType.TWO);\r\n tileMap.put(3, TileType.THREE);\r\n tileMap.put(4, TileType.FOUR);\r\n tileMap.put(5, TileType.FIVE);\r\n tileMap.put(6, TileType.SIX);\r\n tileMap.put(7, TileType.SEVEN);\r\n tileMap.put(8, TileType.EIGHT);\r\n tileMap.put(9, TileType.MINE);\r\n\r\n // Create a GroupLayer to hold the sprites\r\n GroupLayer groupLayer = graphics().createGroupLayer();\r\n graphics().rootLayer().add(groupLayer);\r\n\r\n // Create graphic tiles\r\n tileList = new ArrayList<Tile>();\r\n for (int row = 0; row < BOARD_MAX_WIDTH; row++) {\r\n for (int col = 0; col < BOARD_MAX_WIDTH; col++) {\r\n Tile tile = new Tile(groupLayer, col*Tile.SIZE, row*Tile.SIZE, tileMap.get(tiles[row][col]), row, col);\r\n tileList.add(tile);\r\n }\r\n }\r\n\r\n // Timer text\r\n CanvasImage canvasImage = graphics().createImage(160, 70);\r\n timerLabel = canvasImage.canvas();\r\n ImageLayer countDownLayer = graphics().createImageLayer(canvasImage);\r\n countDownLayer.setTranslation(180, 10);\r\n graphics().rootLayer().add(countDownLayer);\r\n\r\n // Cleared tiles text\r\n CanvasImage clearedTilesImage = graphics().createImage(160, 70);\r\n clearedTilesLabel = clearedTilesImage.canvas();\r\n ImageLayer clearedTilesLayer = graphics().createImageLayer(clearedTilesImage);\r\n clearedTilesLayer.setTranslation(180, 30);\r\n graphics().rootLayer().add(clearedTilesLayer);\r\n updateClearedTiles();\r\n }", "public List<ImageResourceWrapper> getMap() {\n // Declare a new list to hold the rendering info for the physics objects.\n List<ImageResourceWrapper> rtrnResources = new ArrayList<>();\n for(PhysicsEntity physicsEntity : this.physModel.getEntities()) {\n // Get the graphics entity corresponding to the current physics entity.\n GraphicsEntity graphicsEntity = this.graphModel.getEntityByID(physicsEntity.getId());\n String imgResource = graphicsEntity.getImgResId(physicsEntity.getOrientation());\n rtrnResources.add(new ImageResourceWrapper(new Point(physicsEntity.getPosition().x, physicsEntity.getPosition().y), imgResource));\n }\n for(Objective objective : this.gameStateModel.getObjectives()) {\n GraphicsEntity graphicsEntity = this.graphModel.getEntityByID(objective.getId());\n // TODO: Orientation for objectives\n String imgResource = graphicsEntity.getImgResId(0);\n rtrnResources.add(new ImageResourceWrapper(new Point(objective.getPosition().x, objective.getPosition().y), imgResource));\n }\n return rtrnResources;\n }", "private static DataCube generateDataCubeFromMonochromeImages(String filenameSpecifier) throws IOException {\n\t\t// Check the format of the string\n\t\tif (!filenameSpecifier.contains(\"%\") || \n\t\t\t\tfilenameSpecifier.indexOf(\"%\") != filenameSpecifier.lastIndexOf(\"%\")) {\n\t\t\tthrow new IllegalArgumentException(\"Filename specifier must contain exactly one '%'.\");\n\t\t}\n\t\t\n\t\t// Find the dimension (number of monochrome images) of the hyperspectral image\n\t\tint noImages = 0;\n\t\tFile file = new File(filenameSpecifier.replace(\"%\", Integer.toString(noImages+1)));\n\t\twhile (file.exists() && !file.isDirectory()) {\n\t\t\tnoImages++;\n\t\t\tfile = new File(filenameSpecifier.replace(\"%\", Integer.toString(noImages+1)));\n\t\t}\n\t\t\n\t\t// Check that we loaded at least one image\n\t\tif (noImages == 0) {\n\t\t\tthrow new FileNotFoundException(\"No images were found using the specifier provided.\");\n\t\t}\n\t\t\n\t\t// Get the width and height of the first image, to check that they have consistent dimensions\n\t\tfile = new File(filenameSpecifier.replace(\"%\", Integer.toString(1)));\n\t\tBufferedImage bi = ImageIO.read(file);\n\t\tint height = bi.getHeight();\n\t\tint width = bi.getWidth();\n\t\t\n\t\t// Create a data cube and load the images into the structure\n\t\tDataCube dc = new DataCube();\n\t\tdc.width = width;\n\t\tdc.height = height;\n\t\tdc.depth = noImages;\n\t\tdc.dataCube = new short[width][height][noImages];\n\t\t\n\t\t// Loop through each image, and add its contents to the data cube\n\t\t// We loop through images as our outer loop because we want to optimise memory management\n\t\t// (Avoid loading all images into memory at once)\n\t\tfor (int k = 0; k < noImages; k++) {\n\t\t\tFile imageFile = new File(filenameSpecifier.replace(\"%\", Integer.toString(k+1))); // images indexed from 1\n\t\t\tBufferedImage image = ImageIO.read(imageFile);\n\t\t\n\t\t\t// Check for consistent image dimension\n\t\t\tif (image.getHeight() != height || image.getWidth() != width) {\n\t\t\t\tthrow new IOException(\"Images have inconsistent dimensions.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Iterate through image adding its data to the datacube\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\t\tint colour = image.getRGB(i, j);\n\t\t\t\t\tdc.dataCube[i][j][k] = (short) (colour & 0xFF);\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t// Return the data cube\n\t\treturn dc;\n\t}", "void renderImages(String imageCategory) {\n\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n//\t\tboolean focusOnCmdSeq = true;\n//\t\tString selectedCmdSeq = MerUtils.cmdSeqFromFilename(selectedPanImageEntry.imageListEntry.getFilename());\t\t\n\t\tfor (int i=0; i<panImageList.length; i++) {\n\t\t\tPanImageEntry panEntry = panImageList[i];\n\t\t\tImageEntry entry = panEntry.imageListEntry;\n\t\t\tif ((!entry.enabled) || (!panEntry.draw))\n\t\t\t\tcontinue;\n\t\t\tif (!entry.getImageCategory().equalsIgnoreCase(imageCategory))\n\t\t\t\tcontinue;\n\t\t\tImageMetadataEntry metadataEntry = entry.getImageMetadataEntry();\n\t\t\tif (metadataEntry == null)\n\t\t\t\tcontinue;\n\t\t\tString filename = entry.getFilename();\n\t\t\tchar spacecraftIdChar = MerUtils.spacecraftIdCharFromFilename(filename);\n\t\t\tchar camera = MerUtils.cameraFromFilename(filename);\n\t\t\tchar cameraEye = MerUtils.cameraEyeFromFilename(filename);\n\t\t\tdouble twist = 0.0;\n\t\t\tdouble imageFOV = 10.0;\n\t\t\tdouble radius = 50.0;\n\t\t\tdouble toeInAz = 0.0;\n\t\t\tdouble\ttoeInEl = 0.0;\n\t\t\tint left = (metadataEntry.first_line_sample - 1) /* * metadataEntry.pixel_averaging_width*/;\n\t\t\tint width = metadataEntry.n_line_samples * metadataEntry.pixel_averaging_width;\n\t\t\tint top = (metadataEntry.first_line - 1) /* * metadataEntry.pixel_averaging_height*/;\n\t\t\tint height = metadataEntry.n_lines * metadataEntry.pixel_averaging_height;\n\t\t\t\n\t\t\t// Move downsampled images back\n\t\t\tif (metadataEntry.pixel_averaging_width > 1) {\n\t\t\t\tradius = 75.0;\n\t\t\t}\n/* needs to be activited by a key command\t\t\t\n\t\t\telse if ((focusOnCmdSeq) \n\t\t\t\t\t&& (!MerUtils.cmdSeqFromFilename(panEntry.imageListEntry.getFilename()).equalsIgnoreCase(selectedCmdSeq))) {\n\t\t\t\tradius = 75.0;\n\t\t\t}\t\t\t\n\t\t\t*/\n\t\t\t\n\t\t\tif (panEntry == selectedPanImageEntry) {\n\t\t\t\tif (focusMode)\n\t\t\t\t\tradius = 25.0;\n\t\t\t}\n\t\t\t\n\t\t\tif (camera == 'N') {\n\t\t\t\timageFOV = 45.1766; // the \"official\" FOV\n\t\t\t\tif (spacecraftIdChar == MerUtils.SPACECRAFT_ID_CHAR_OPPORTUNITY) {\n\t\t\t\t\tif (cameraEye == 'R' || cameraEye == 'r') {\n\t\t\t\t\t\ttwist = 0.25;\n\t\t\t\t\t\timageFOV = imageFOV * 1.012;\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttwist = -0.1;\n\t\t\t\t\t\timageFOV = imageFOV * 1.006;\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (spacecraftIdChar == MerUtils.SPACECRAFT_ID_CHAR_SPIRIT) {\n\t\t\t\t\t//if (params.viewMode != PanParams.VIEWMODE_RIGHT_RAW) {\n\t\t\t\t\t\ttwist = -0.7;\n\t\t\t\t\t//}\n\t\t\t\t\timageFOV = imageFOV * 1.012; //1.015;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (camera == 'P') {\n\t\t\t\timageFOV = 15.8412; // the official value\n\t\t\t\t/*if (params.viewMode != PanParams.VIEWMODE_RIGHT_RAW) {\n\t\t\t\t\t// compensate for toe-in left\n\t\t\t\t\tazimuthDeg += 1.0;\n\t\t\t\t\televationDeg += 0.3;\n\t\t\t\t}*/\t\t\t\t\t\n\t\t\t\t// TODO reverse toe in for right camera\n\t\t\t\t//toeInComp = 0.6;\n\t\t\t\tif (spacecraftIdChar == MerUtils.SPACECRAFT_ID_CHAR_OPPORTUNITY) {\n//\t\t\t\t\t\ttwistDeg = 0.3; // was 0.4;\n\t\t\t\t\ttwist = 0.3;\n\t\t\t\t\timageFOV = imageFOV * 1.015;\n\t\t\t\t\ttoeInAz = 1.1;\t\t\n\t\t\t\t\ttoeInEl = -0.35;\n\t\t\t\t}\n\t\t\t\telse if (spacecraftIdChar == MerUtils.SPACECRAFT_ID_CHAR_SPIRIT) {\n\t\t\t\t\ttwist = +0.0;\n\t\t\t\t\timageFOV = imageFOV * 1.015;\n\t\t\t\t\t//fovDeg = fovDeg * 1.015;\n\t\t\t\t\ttoeInAz = 0.0;\n\t\t\t\t\ttoeInEl = 0.0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble tranWidth = Math.sin(imageFOV * Math.PI / 360) * radius;\n\t\t\tfloat floatDistance = (float) (Math.cos(imageFOV * Math.PI / 360) * radius);\n\t\t\tfloat floatLeft = (float)(tranWidth * (left - 512) / 512);\n\t\t\tfloat floatTop = (float)(tranWidth * (512-(top+height)) / 512);\n\t\t\tfloat floatRight = (float)(tranWidth * (left+width-512) / 512);\n\t\t\tfloat floatBottom = (float)(tranWidth * (512-top) / 512);\n\t\t\t\n\t\t\tsetImageRotation((float)(metadataEntry.inst_az_rover + toeInAz), (float)(metadataEntry.inst_el_rover + toeInEl), (float)twist);\n\t\t\t\n\t\t\tif (panEntry.textureNumber >= 0) {\n\t\t\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, panEntry.textureNumber);\t\t\t\t\n\t\t\t\tGL11.glBegin(GL11.GL_QUADS);\n\t\t\t\tGL11.glTexCoord2f(0.0f, 0.0f);\n\t\t\t\tGL11.glVertex3f(floatLeft, floatTop, -floatDistance);\n\t\t\t\tGL11.glTexCoord2f(1.0f, 0.0f);\n\t\t\t\tGL11.glVertex3f(floatRight, floatTop, -floatDistance);\n\t\t\t\tGL11.glTexCoord2f(1.0f, 1.0f);\n\t\t\t\tGL11.glVertex3f(floatRight, floatBottom, -floatDistance);\n\t\t\t\tGL11.glTexCoord2f(0.0f, 1.0f);\n\t\t\t\tGL11.glVertex3f(floatLeft, floatBottom, -floatDistance);\t\t\t\t\n\t\t GL11.glEnd();\n\t\t \n\t\t if ((panEntry == selectedPanImageEntry) && focusMode) {\n\t\t\t\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);\t\t// no texture\n\t\t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n\t\t\t\t\tGL11.glBegin(GL11.GL_LINES);\n\t\t\t\t\tGL11.glVertex3f(floatLeft, floatTop, -floatDistance);\n\t\t\t\t\tGL11.glVertex3f(floatRight, floatTop, -floatDistance);\n\t\t\t\t\tGL11.glVertex3f(floatRight, floatTop, -floatDistance);\n\t\t\t\t\tGL11.glVertex3f(floatRight, floatBottom, -floatDistance);\n\t\t\t\t\tGL11.glVertex3f(floatRight, floatBottom, -floatDistance);\n\t\t\t\t\tGL11.glVertex3f(floatLeft, floatBottom, -floatDistance);\t\t\t\t\n\t\t\t\t\tGL11.glVertex3f(floatLeft, floatBottom, -floatDistance);\t\t\t\t\n\t\t\t\t\tGL11.glVertex3f(floatLeft, floatTop, -floatDistance);\n\t\t\t GL11.glEnd();\n\t\t }\n\t\t\t}\n\t\t\telse {\n\t\t\t\tGL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);\t\t// no texture\n\t\t\t\tGL11.glColor3f(1.0f, 1.0f, 1.0f);\n\t\t\t\tGL11.glBegin(GL11.GL_LINES);\n\t\t\t\tGL11.glVertex3f(floatLeft, floatTop, -floatDistance);\n\t\t\t\tGL11.glVertex3f(floatRight, floatTop, -floatDistance);\n\t\t\t\tGL11.glVertex3f(floatRight, floatTop, -floatDistance);\n\t\t\t\tGL11.glVertex3f(floatRight, floatBottom, -floatDistance);\n\t\t\t\tGL11.glVertex3f(floatRight, floatBottom, -floatDistance);\n\t\t\t\tGL11.glVertex3f(floatLeft, floatBottom, -floatDistance);\t\t\t\t\n\t\t\t\tGL11.glVertex3f(floatLeft, floatBottom, -floatDistance);\t\t\t\t\n\t\t\t\tGL11.glVertex3f(floatLeft, floatTop, -floatDistance);\n\t\t GL11.glEnd();\n\t\t\t}\n\t\t}\t\t\n\t}", "public static void createImages()\n {\n //Do if not done before\n if(!createdImages)\n {\n createdImages = true;\n for(int i=0; i<rightMvt.length; i++)\n {\n rightMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n leftMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n rightMvt[i].scale(rightMvt[i].getWidth()*170/100, rightMvt[i].getHeight()*170/100);\n leftMvt[i].scale(leftMvt[i].getWidth()*170/100, leftMvt[i].getHeight()*170/100);\n }\n for(int i=0; i<leftMvt.length; i++)\n {\n leftMvt[i].mirrorHorizontally();\n }\n for(int i=0; i<upMvt.length; i++)\n {\n upMvt[i] = new GreenfootImage(\"sniperEnemyUp\"+i+\".png\");\n downMvt[i] = new GreenfootImage(\"sniperEnemyDown\"+i+\".png\");\n upMvt[i].scale(upMvt[i].getWidth()*170/100, upMvt[i].getHeight()*170/100);\n downMvt[i].scale(downMvt[i].getWidth()*170/100, downMvt[i].getHeight()*170/100);\n }\n }\n }", "public void drawMap() {\r\n\t\tfor (int x = 0; x < map.dimensionsx; x++) {\r\n\t\t\tfor (int y = 0; y < map.dimensionsy; y++) {\r\n\t\t\t\tRectangle rect = new Rectangle(x * scalingFactor, y * scalingFactor, scalingFactor, scalingFactor);\r\n\t\t\t\trect.setStroke(Color.BLACK);\r\n\t\t\t\tif (islandMap[x][y]) {\r\n\t\t\t\t\tImage isl = new Image(\"island.jpg\", 50, 50, true, true);\r\n\t\t\t\t\tislandIV = new ImageView(isl);\r\n\t\t\t\t\tislandIV.setX(x * scalingFactor);\r\n\t\t\t\t\tislandIV.setY(y * scalingFactor);\r\n\t\t\t\t\troot.getChildren().add(islandIV);\r\n\t\t\t\t} else {\r\n\t\t\t\t\trect.setFill(Color.PALETURQUOISE);\r\n\t\t\t\t\troot.getChildren().add(rect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "List<Integer> downSampleLevels();", "protected abstract void applyLevel(Resources res);", "public Output convertImage(final BufferedImage source) {\n\t\t// dimension of each tile\n\t\tDimension tileSize = this.characterCache.getCharacterImageSize();\n\n\t\t// round the width and height so we avoid partial characters\n\t\tint outputImageWidth = (source.getWidth() / tileSize.width)\n\t\t\t\t* tileSize.width;\n\t\tint outputImageHeight = (source.getHeight() / tileSize.height)\n\t\t\t\t* tileSize.height;\n\n\t\t// extract pixels from source image\n\t\tint[] imagePixels = source.getRGB(0, 0, outputImageWidth,\n\t\t\t\toutputImageHeight, null, 0, outputImageWidth);\n\n\t\t// process the pixels to a grayscale matrix\n\t\tGrayscaleMatrix sourceMatrix = new GrayscaleMatrix(imagePixels,\n\t\t\t\toutputImageWidth, outputImageHeight);\n\n\t\t// divide matrix into tiles for easy processing\n\t\tTiledGrayscaleMatrix tiledMatrix = new TiledGrayscaleMatrix(\n\t\t\t\tsourceMatrix, tileSize.width, tileSize.height);\n\n\t\tthis.output = initializeOutput(outputImageWidth, outputImageHeight);\n\n\t\t// compare each tile to every character to determine best fit\n\t\tfor (int i = 0; i < tiledMatrix.getTileCount(); i++) {\n\n\t\t\tGrayscaleMatrix tile = tiledMatrix.getTile(i);\n\n\t\t\tfloat minError = Float.MAX_VALUE;\n\t\t\tEntry<Character, GrayscaleMatrix> bestFit = null;\n\n\t\t\tfor (Entry<Character, GrayscaleMatrix> charImage : characterCache) {\n\t\t\t\tGrayscaleMatrix charPixels = charImage.getValue();\n\n\t\t\t\tfloat error = this.characterFitStrategy.calculateError(\n\t\t\t\t\t\tcharPixels, tile);\n\n\t\t\t\tif (error < minError) {\n\t\t\t\t\tminError = error;\n\t\t\t\t\tbestFit = charImage;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint tileX = ArrayUtils.convert1DtoX(i, tiledMatrix.getTilesX());\n\t\t\tint tileY = ArrayUtils.convert1DtoY(i, tiledMatrix.getTilesX());\n\n\t\t\t// copy character to output\n\t\t\taddCharacterToOutput(bestFit, imagePixels, tileX, tileY,\n\t\t\t\t\toutputImageWidth);\n\t\t}\n\n\t\tfinalizeOutput(imagePixels, outputImageWidth, outputImageHeight);\n\n\t\treturn this.output;\n\n\t}", "private void makeImgToTag() {\n\t\timgToTag = new HashMap<String, HashSet<String>>();\n\t\t// Goes through the tagtoimg map to create this map\n\t\tfor (String tag : tagToImg.keySet()) {\n\t\t\tfor (String pathName : tagToImg.get(tag)) {\n\t\t\t\tif (imgToTag.containsKey(pathName))\n\t\t\t\t\timgToTag.get(pathName).add(tag);\n\t\t\t\telse {\n\t\t\t\t\tHashSet<String> tags = new HashSet<String>();\n\t\t\t\t\ttags.add(tag);\n\t\t\t\t\timgToTag.put(pathName, tags);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "@Override\n\tprotected void generateMap() {\n\t\t//read map from tmx\n\t\tmap = null;\n\t\tfinal String tmx = \"res/tiles/map.tmx\";\n\t\ttry {\n\t\t\tTMXMapReader mapReader = new TMXMapReader();\n\t\t\tmap = mapReader.readMap(tmx);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tTileLayer layer = (TileLayer)map.getLayer(0);\n\n\t\ttiles = new PropertyTile[layer.getWidth()][layer.getHeight()];\n\t\tfor(int x=0; x<layer.getWidth(); x++) {\n\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n\t\t\t\tTile tile = layer.getTileAt(x, y);\n\t\t\t\tString type = (String)tile.getProperties().get(\"type\");\n\t\t\t\ttiles[x][y] = new PropertyTile(tile, TileType.valueOf(type.toUpperCase()));\n\t\t\t\ttiles[x][y].setImage(tile.getImage());\n\t\t\t}\n\t\t}\n\t\t\n\t\t//generate animated tiles from river tileset\n\t\tTileSet riverset = map.getTileSets().get(1);\n\t\tList<AnimatedTile> animatedTiles = new ArrayList<>();\n\t\tfor(int i=0; i<5; i++) {\n\t\t\tTile[] frames = new Tile[3];\n\t\t\tIterator<Tile> iterator = riverset.iterator();\n\t\t\twhile(iterator.hasNext()) {\n\t\t\t\tTile tile = iterator.next();\n\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n\t\t\t\tint frame = Integer.parseInt(tile.getProperties().getProperty(\"frame\"));\n\t\t\t\tif(rtile == i+1) {\n\t\t\t\t\tframes[frame-1] = tile;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAnimatedTile aTile = new AnimatedTile(frames);\n\t\t\tanimatedTiles.add(aTile);\n\t\t}\n\n\t\t//replace tiles in map with animated tiles\n//\t\tfor(int x=0; x<layer.getWidth(); x++) {\n//\t\t\tfor(int y=0; y<layer.getHeight(); y++) {\n//\t\t\t\tTile tile = layer.getTileAt(x, y);\n//\t\t\t\tif(tile.getProperties().containsKey(\"animated\")) {\n//\t\t\t\t\tint rtile = Integer.parseInt(tile.getProperties().getProperty(\"tile\"));\n//\t\t\t\t\tlayer.setTileAt(x, y, animatedTiles.get(rtile-1));\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}", "private ImageMappings() {}", "byte[] getLevels() {\n return levels;\n }", "private void populateFromSprite() {\n long start = System.currentTimeMillis();\n int bitSetIndex = 0;\n BufferedImage bImage = (BufferedImage) sprite.m_image;\n //BufferedImage img = ImageIO.read(new File(\"assets/LoopBitmap.bmp\"));\n int color;\n // Loop through image according to scale\n for(int i = 0; i < sprite.getWidth(); i+=scale) {\n for(int j = 0; j < sprite.getHeight(); j+= scale) {\n // Get color at pixel i, j, if black set Bitmap index to true.\n color = bImage.getRGB(i, j);\n if(color == Color.BLACK.getRGB()) { //tempColor.equals(Color.black)) {\n this.set(bitSetIndex, true);\n //System.out.println(\"'BLACK' Color = \"+color + \" i=\"+ i + \", j=\"+j);\n }\n bitSetIndex++;\n }\n }\n long end = System.currentTimeMillis();\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n// System.out.println(\"BITMAP DONE :)\");\n// System.out.println(\"Time to build = \"+(end-start)+\"ms\");\n// System.out.println(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>\");\n }", "public BufferedImage generateTexture() {\n BufferedImage texture = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n WritableRaster raster = texture.getRaster();\n \n int[] rasterData = new int[width * height];\n for (int i = 0; i < width * height; i++) {\n rasterData[i] = Color.BLACK.getRGB();\n }\n \n Color color;\n \n double max = Math.min(upperZ, cache.max);\n double min = Math.max(lowerZ, cache.min);\n double dz = (max - min) / (double)contours;\n boolean matched;\n for (int i = 0; i < width; i++) {\n for (int j = 0; j < height; j++) {\n PointDouble in = graphToValue(new PointDouble(i, j));\n double val = cache.get(in.getX(), in.getY());\n matched = false;\n if (alternateContours && contours > 0) {\n for (int k = 0; k <= contours; k++) {\n if (val >= min + (k - 0.5 * contourWidth + contourOffset + 0.5) * dz && val <= min + (k + 0.5 * contourWidth + contourOffset + 0.5) * dz) {\n matched = true;\n break;\n }\n }\n }\n if (matched) {\n color = CONTOUR_COLOR;\n }\n else {\n color = interpolate(LOW_COLOR, HIGH_COLOR, Math.min(Math.max((val - min) / (max - min), 0), 1));\n }\n \n rasterData[j * width + i] = color.getRGB();\n /*val = new PointDouble(val.getX(), op.applyAsDouble(val.getX()));\n val = valueToGraph(val);\n if (i != 0) {\n g.drawLine(MARGIN_X + i - 1, prev, (int) Math.round(val.getX()), (int) Math.round(val.getY()));\n }\n prev = (int) Math.round(val.getY());*/\n \n }\n }\n //Draw contours\n if (!alternateContours) {\n for (int k = 0; k < contours; k++) {\n double target = min + (k + contourOffset + 0.5) * dz;\n \n //Map of all points higher/lower then the target\n ArrayList<ArrayList<Boolean>> data = new ArrayList<>(width);\n for (int i = 0; i < width; i++) {\n data.add(new ArrayList<>(height));\n for (int j = 0; j < height; j++) {\n PointDouble in = graphToValue(new PointDouble(i, j));\n double val = cache.get(in.getX(), in.getY());\n data.get(i).add(val > target);\n }\n }\n \n //Edge detection filter\n ArrayList<ArrayList<Boolean>> filteredData = new ArrayList<>(width);\n for (int i = 0; i < width; i++) {\n filteredData.add(new ArrayList<>(height));\n for (int j = 0; j < height; j++) {\n boolean tl = data.get(Math.max(Math.min(i - 1, width - 1), 0)).get(Math.max(Math.min(j + 1, height - 1), 0));\n boolean tc = data.get(Math.max(Math.min(i, width - 1), 0)).get(Math.max(Math.min(j + 1, height - 1), 0));\n boolean tr = data.get(Math.max(Math.min(i + 1, width - 1), 0)).get(Math.max(Math.min(j + 1, height - 1), 0));\n \n boolean cl = data.get(Math.max(Math.min(i - 1, width - 1), 0)).get(Math.max(Math.min(j, height - 1), 0));\n boolean cc = data.get(Math.max(Math.min(i, width - 1), 0)).get(Math.max(Math.min(j, height - 1), 0));\n boolean ct = data.get(Math.max(Math.min(i + 1, width - 1), 0)).get(Math.max(Math.min(j, height - 1), 0));\n \n boolean bl = data.get(Math.max(Math.min(i - 1, width - 1), 0)).get(Math.max(Math.min(j - 1, height - 1), 0));\n boolean bc = data.get(Math.max(Math.min(i, width - 1), 0)).get(Math.max(Math.min(j - 1, height - 1), 0));\n boolean br = data.get(Math.max(Math.min(i + 1, width - 1), 0)).get(Math.max(Math.min(j - 1, height - 1), 0));\n \n boolean res;\n if (contourWidth > 0.5) {\n res = (cc && (!tl || !tc || !tr || !cl || !ct || !bl || !bc || !br)) || (!cc && (tl || tc || tr || cl || ct || bl || bc || br));\n }\n else {\n if (contourWidth > 0.25) {\n res = (cc && (!tc || !cl || !ct || !bc)) || (!cc && (tc || cl || ct || bc));\n }\n else {\n res = cc && (!tc || !cl || !ct || !bc);\n }\n }\n filteredData.get(i).add(res);\n }\n }\n \n //Draw contour\n color = CONTOUR_COLOR;\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n if (filteredData.get(j).get(i)) {\n rasterData[i * width + j] = color.getRGB();\n }\n }\n }\n }\n }\n raster.setDataElements(0, 0, width, height, rasterData);\n return texture;\n }", "public BufferedImage[] powerSprite(){\n\t\tBufferedImage arr[] = new BufferedImage[4];\n\t\tarr[0] = img.getSubimage(724, 283, 71, 67);\n\t\tarr[1] = img.getSubimage(650, 286, 72, 64);\n\t\tarr[2] = img.getSubimage(484, 292, 83, 58);\n\t\tarr[3] = img.getSubimage(257, 281, 71, 69);\n\t\treturn arr;\n\t\t\t\n\t}", "private void createImageMap(final ValueMap properties) {\n if (!(properties.containsKey(\"imageMap\"))) {\n return;\n }\n try {\n final String mapDefinition = properties.get(\"imageMap\", \"\");\n if (StringUtils.isNotEmpty(mapDefinition)) {\n this.imageMap = ImageMap.fromString(mapDefinition);\n this.imageMapId = \"map_\" + Math.round(Math.random() * 2147483647.0D) + \"_\" + System.currentTimeMillis();\n }\n\n } catch (final IllegalArgumentException iae) {\n this.imageMap = null;\n this.imageMapId = null;\n }\n }", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}\n\t\t//System.out.println(img.getHeight());\n\t\t//System.out.println(img.getWidth());\n//\t\tfloat maxh = -10000.0f, minh = 10000.0f;\n//\n//\t\t// determine range of tempVals s\n//\t\tfor(int x=0; x < dimx; x++)\n//\t\t\tfor(int y=0; y < dimy; y++) {\n//\t\t\t\tfloat h = tempVals [x][y];\n//\t\t\t\tif(h > maxh)\n//\t\t\t\t\tmaxh = h;\n//\t\t\t\tif(h < minh)\n//\t\t\t\t\tminh = h;\n//\t\t\t}\n\t\t\n\t\tfor(int x=0; x < dimx; x++)\n\t\t\tfor(int y=0; y < dimy; y++) {\n\t\t\t\t \t\n\t\t\t\t// find normalized tempVals value in range\n\t\t\t\t//float val = (tempVals [x][y] - minh) / (maxh - minh);\n\t\t\t\tfloat val = tempVals[x][y];\n\n\t\t\t\t//System.out.println(val);\n\n\t\t\t\tColor c = new Color(img.getRGB(x,y));\n\n\t\t\t\tif((c.getRed() > 50 && c.getGreen() > 100 && c.getBlue() < 200)) {\n\n\t\t\t\t\tif (val != 0.0f) {\n\t\t\t\t\t\tColor col = new Color(val, 0, 0);\n\t\t\t\t\t\timg.setRGB(x, y, col.getRGB());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t}", "public ArrayList setImageTemplate() {\n imageTemplate = new ArrayList();\n imageTemplate.add(0,\"template\");//Integer : จำนวนเทมเพลต\n imageTemplate.add(1,\"marge_one_stroke\");//Float : marge one stroke in purcent\n imageTemplate.add(2,\"marge_one_color\");//String : color in hex\n imageTemplate.add(3,\"marge_two_stroke\");//Float : marge two stroke in purcent\n imageTemplate.add(4,\"marge_two_color\");//String : color in hex\n imageTemplate.add(5,\"top_value\");//Float : position of value top for the line\n imageTemplate.add(6,\"bottom_value\");//Float : position of value bottom for the line\n imageTemplate.add(7,\"right_value\");//Float : position of value right for the line\n imageTemplate.add(8,\"left_value\");//Float : position of value left for the line\n imageTemplate.add(9,\"center_x\");//Float : position of value x for the line\n imageTemplate.add(10,\"center_y\");//Float : position of value y for the line\n return (imageTemplate);\n }", "@SideOnly(Side.CLIENT)\n public static void drawTexture_Items(int x, int y, IIcon icon, int width, int height, float zLevel)\n {\n for(int i = 0; i < width; i += 16)\n for(int j = 0; j < height; j += 16)\n drawScaledTexturedRect_Items(x + i, y + j, icon, Math.min(width - i, 16), Math.min(height - j, 16),zLevel);\n \n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n }", "public void createList () {\n imageLocs = new ArrayList <Location> ();\n for (int i = xC; i < xLength * getPixelSize() + xC; i+=getPixelSize()) {\n for (int j = yC; j < yLength * getPixelSize() + yC; j+=getPixelSize()) {\n Location loc = new Location (i, j, LocationType.POWERUP, true);\n\n imageLocs.add (loc);\n getGridCache().add(loc);\n \n }\n }\n }", "interface WorldmapBuffer2 {\n final static byte[] image2 = {\n -125, 47, -3, 77, 51, 29, -45, -103, -120, 119, 76, -122, -82, -22, -106, 61, 113, 4, -59, 124, -116, 59, 115, -26, -44,\n 56, -115, 34, 106, -124, 98, 83, -115, 70, 9, -67, -116, 99, 92, -127, 89, -23, -68, -11, -41, 72, -15, -68, -48, 4,\n 29, 85, -30, 4, -79, -56, -20, 126, 69, 119, -119, -115, -116, 60, -37, -53, -107, 68, 90, -45, 79, -99, 108, 109, 45,\n 84, -65, -93, -44, -79, -23, -40, 23, -40, -48, 98, -92, -50, 125, -104, -52, -58, 50, -97, -119, 13, -78, -81, 82, -86,\n 15, -71, -92, 77, -115, -48, 48, 77, -88, 6, 61, 104, -117, -51, 103, -90, 5, -71, -52, 42, 76, -68, 113, 79, -7,\n 43, -42, -84, 38, -56, -100, 93, -44, 34, 71, -113, 100, -116, 64, 42, 88, -40, 94, 93, -83, -118, -115, 99, -32, -27,\n 72, -26, 43, -104, 35, 7, 37, 101, 12, -66, 107, -104, -128, -106, -116, 54, -93, -83, -119, -50, 23, -47, -117, 39, 89,\n 6, -9, 41, 47, 10, -37, -124, -2, 115, -40, -55, -67, -37, -118, -118, 92, 108, 24, -41, 35, -43, -61, 45, 44, 118,\n 87, 92, 70, -14, 108, -37, -22, -106, -41, -127, 124, -92, -70, -99, -42, 22, -38, 106, 43, -8, -84, -97, -99, -39, -48,\n -6, -62, 78, -10, -98, -38, 109, -98, -23, -87, -45, 112, -67, 73, 42, 21, 99, -25, 109, -40, -21, 10, 120, -88, -110,\n -99, 105, -37, -97, 68, -70, -112, 15, 54, -99, 111, 77, 37, 108, 52, -33, 113, 93, 59, -33, 56, -78, 124, -85, 42,\n 107, -3, -54, -94, 29, -37, 97, -53, -54, -24, 8, -113, -18, 45, 108, 61, 122, -124, 19, 102, 118, -65, -14, -31, 32,\n 30, -30, -8, 35, -40, 102, -106, -109, -33, -115, -58, -27, 38, -37, 43, 88, 106, -11, -104, -51, -16, 11, -39, 116, 24,\n -123, -48, -6, 107, 73, -39, -31, -107, 109, -98, 85, -36, 39, 115, 61, -37, -33, 53, -61, -49, 103, -119, -73, 84, -35,\n -64, -6, 97, -72, -85, -98, -94, 58, -33, 127, 77, -34, 96, 90, -127, 58, -22, -118, -61, -83, 58, 96, 59, 95, 27,\n 11, -29, -123, 76, 79, -108, 11, -48, -35, -100, -40, 82, 4, 97, 57, -18, -36, -63, -94, -28, -105, -87, -76, -57, -84,\n 122, -13, -40, -60, -37, -6, -28, -105, -42, -34, -105, 76, 61, 59, -2, -27, -103, -125, -76, 111, 39, -39, 118, -88, -119,\n 56, 43, 116, 50, 22, -87, 44, 43, -91, 63, -21, -51, -2, -14, -26, -38, -76, 36, -26, -52, -122, -26, 100, -61, -75,\n -108, 7, 24, -24, 92, -37, -28, -116, -51, 52, 126, -33, -103, -102, 114, -27, 77, -24, -124, 87, 68, -13, -119, -28, 99,\n -71, -33, 25, 88, -49, 120, 41, -24, -125, -82, -62, 102, -25, -49, -119, 25, -82, 111, 38, 63, -52, 76, 26, 81, 71,\n 118, -115, 39, 125, -58, -94, -26, 29, -109, -25, -4, -92, -80, 43, -42, -83, -108, -66, -86, -65, 43, -25, 19, 70, -23,\n -80, -68, -54, -72, -3, -43, 32, -117, -93, 102, -93, 27, -29, -77, 56, -70, -38, -34, 27, -67, -94, 52, -75, -119, -73,\n -5, -45, 58, 120, -48, 107, 125, -112, 109, -84, -25, 40, 78, -21, -8, 69, -27, -117, -36, 108, 57, 93, -114, 52, 120,\n -32, 100, 68, -48, -51, 65, -35, -42, 78, 82, 58, -88, 96, -121, 126, -39, 104, 34, -123, -6, 9, 66, -35, 40, 107,\n 66, -120, -65, 127, -125, -19, -75, 6, 122, -30, -21, -74, 42, 126, -121, 2, 3, -19, 22, 20, 53, 85, 89, 61, -21,\n -25, -95, 94, 18, -18, -35, 70, -101, 33, 10, -80, 18, 35, 94, 99, -98, -18, 40, -66, 87, 54, -18, -23, -36, 107,\n -24, 8, 47, -28, -113, -61, -87, -20, -98, -19, -71, 45, -35, -128, -82, -80, -23, -121, -38, 99, -117, -70, 7, 104, -20,\n 52, 122, -18, 76, -115, -40, 36, -6, -16, 88, -59, -72, 127, -58, -111, 59, 126, -2, 82, -17, -68, -49, -18, -63, -118,\n 111, -109, -33, 120, -118, -50, -52, 52, -29, -121, -2, -62, 126, 26, -124, -46, -18, -112, -115, 92, -65, 117, 125, -16, -74,\n 74, 90, -9, 27, -61, 0, 111, 110, 2, -72, -125, -102, 30, 22, 42, -33, 115, 23, -6, -24, 124, -102, -57, -16, 78,\n -62, 76, -119, 91, -48, -87, -65, -71, 126, -118, -123, -89, -18, -31, -92, -13, -95, -68, -35, -63, -100, 55, 88, -68, -47,\n -69, 55, -12, 99, 33, -16, -34, -22, -63, 66, 78, -11, -93, 78, 66, 17, 12, -75, -115, 6, -109, 34, 9, 114, -108,\n -72, -103, 8, -76, 112, 58, 126, -16, -74, -34, 102, 29, -56, -64, 88, 103, 123, -91, 100, 55, 61, -55, -50, 59, -33,\n -22, 90, 55, -90, -106, -3, -20, -79, -35, 53, -112, -2, -47, 49, -114, -23, 30, 95, -16, 25, 70, -17, 75, 53, -9,\n -38, 73, 109, 53, 38, -10, 106, -102, 55, -17, -31, 76, -26, -6, -128, -110, -1, -44, 25, 7, -56, 86, -56, -9, -6,\n 9, -10, -57, -66, -20, 5, 125, -8, 106, -83, -8, -1, -89, -13, -114, 31, -97, -88, -120, 75, -21, 42, -22, -19, -111,\n 101, -117, 107, -30, -71, 121, -11, -99, 23, 88, -68, -8, -88, -85, 25, -128, 72, 47, -95, -122, -125, -87, 50, -82, 50,\n -14, -34, -92, 112, 102, -29, -87, -113, -106, -64, -18, 108, 26, 107, 32, 69, -37, 120, 10, -113, 118, -20, -2, 38, -46,\n 93, -116, -63, 23, 126, -19, 25, -55, -113, -95, -99, 121, -55, 106, -122, 29, 72, -32, 117, 103, -106, 86, -52, 104, -37,\n 15, -14, -122, -27, -33, 77, 79, 96, 4, 27, 34, -87, -6, 69, -69, -69, -93, 113, 3, -49, 69, -75, 56, 101, 106,\n 78, 57, 62, -15, -16, 92, -8, -63, -114, -48, -59, -82, 95, 52, 116, 108, 104, 11, -69, 78, 6, 16, 1, 4, 14,\n 36, 88, -48, -32, 65, -124, 9, 21, 46, 100, 56, 80, 0, 0, 1, 7, 35, 10, -96, 8, 49, 98, -61, -126, 15,\n 1, 108, -28, -40, -47, -29, 71, -112, 33, 69, -114, 36, 89, -46, -28, 73, -108, 41, 47, 98, 76, -88, 113, 100, -59,\n -115, 43, 9, -62, -20, 72, 49, -128, 77, -121, 11, 93, -106, -92, 72, 83, -92, -52, -101, 61, 29, -6, -12, -120, 51,\n -88, -48, -116, 10, -127, 74, 100, 57, 115, 105, 83, -88, 45, -97, 10, -20, 57, 53, 42, 84, -93, 59, 85, 62, 20,\n -86, 53, -27, 87, -80, 97, -59, -114, 37, 91, -42, 108, 88, -85, 87, -43, -82, 101, -120, 52, -93, 70, -93, 87, -67,\n -98, -91, 91, -41, -82, -39, -86, 108, -25, 22, -35, 25, 119, -24, -57, -117, 50, -105, 86, 37, 10, 56, 110, -31, -102,\n 84, -111, 30, -2, -23, 23, -95, 85, -57, 65, 115, 98, -115, -52, 118, 109, 86, -73, -106, -43, 10, 30, -37, -109, 35,\n -30, -69, -2, -95, 69, -113, 38, 93, 58, 100, 90, -51, -87, 85, 27, -52, -85, 23, -76, 105, -40, -79, -47, 14, 69,\n -51, 122, 47, 95, -61, -84, 1, 83, 117, 74, -8, -90, 83, -117, 46, 43, 7, -83, 73, 24, -13, -17, -103, -89, 99,\n 54, -100, -24, -72, -7, 98, -29, -61, 21, -41, 94, -51, 50, 115, 117, -21, -103, 111, -13, -12, 44, -37, -5, 119, -16,\n -31, 65, 82, -57, 94, -34, -68, -50, -18, -30, -43, -81, 79, 60, 25, -29, -21, -94, 55, 79, -21, 110, -1, -5, -16,\n 68, -38, -48, -87, -73, 126, 59, 84, -30, 120, -72, -104, -29, -115, 53, -34, -116, -21, -17, 49, -14, -50, 83, -80, 41,\n -56, -2, -21, 108, 34, -10, 34, -108, 112, 66, -80, 18, 92, -16, -62, -43, -46, -93, 112, 67, -39, 4, -77, 78, 37,\n -86, 78, 3, -118, -90, -107, 112, 10, 44, -90, -86, -118, -77, -112, -71, 18, 31, -37, 77, -70, -57, -108, -102, 46, 58,\n 4, 49, -76, -47, -75, -89, 42, -37, -114, 39, -30, 56, -12, -15, 71, 9, 87, -68, 113, 72, -84, -128, 52, 114, 52,\n 15, -33, -5, -22, -60, -58, 104, 91, 14, 57, -59, -28, -5, -52, 64, 5, 3, 67, 48, -66, -53, 90, -126, 18, 61,\n 24, -119, -12, 50, -71, 39, -35, 123, -85, -84, 18, -113, 52, -13, 76, -46, -124, -4, 114, 77, 7, -47, 116, -77, -77,\n -103, 62, 4, 81, -54, -105, 66, -2, -124, 9, 63, -121, 32, -30, 107, -56, -25, -24, -29, 75, -51, 40, 9, -108, -18,\n 58, 54, 11, 5, 46, -52, -93, 108, -61, 11, -52, 55, 27, 117, 116, 73, 67, 35, 109, -53, -90, 29, 31, -75, 52,\n -52, 4, 43, 125, -47, 36, 38, -21, -53, 19, 75, 27, -97, -93, -76, 83, 80, 47, 27, 49, 63, 26, 37, 85, -107,\n -50, 39, 73, 100, -108, -52, 87, 47, -107, 117, 86, 64, 87, 93, -112, 43, -8, 102, -75, -76, 69, 37, -105, -52, -75,\n -43, -15, 14, 45, -11, -42, 1, 41, 101, 117, 79, -53, -4, 66, -83, 86, 91, 85, 35, -86, -71, 97, 53, -27, 49,\n 68, 93, -85, -107, -107, -39, 102, -85, -85, 8, 66, 107, -83, 53, -111, 65, -76, 78, -30, 118, -73, -93, -126, -67, 49,\n 48, -63, -74, -61, -42, 63, 49, 109, 91, 55, -37, -88, -26, 42, 108, -80, -77, -54, -20, -10, -34, 55, -33, -123, 87,\n -77, -82, -16, -11, 118, 75, -99, 68, 51, -18, 37, 19, -5, -22, -46, -39, -106, -22, -20, 109, -77, 1, -37, 117, 120,\n -33, 42, 81, 26, 76, -38, -97, 62, -11, -9, -30, 35, -7, -125, -40, 75, 13, 49, -34, 21, -32, -124, -21, -30, -17,\n -41, -32, -114, -123, -24, 92, -91, 42, 30, 89, -56, -26, -100, -118, 113, -29, 80, -59, 45, -40, 100, 72, -87, -11, -8,\n 102, 31, -11, -123, -103, 50, -118, 113, -34, -48, 74, -26, -2, 66, 51, -111, 83, 81, -55, 13, 85, 42, 17, -91, 34,\n 15, -49, -55, -46, -43, 121, -25, -128, -125, 123, -115, -79, 37, 17, -19, -39, 103, -84, -45, -124, -102, -29, -85, -77, -114,\n -80, -27, -74, -46, 36, -103, -44, -8, 8, -115, 55, 58, -115, 37, -14, -86, 54, -77, 103, 76, 21, 74, -96, -73, -66,\n 80, -39, -67, 56, -37, 74, 89, -81, -13, 86, -17, 105, -71, 83, -42, -37, -51, 59, -89, -22, -72, 49, -76, 83, 28,\n 79, 102, -102, -91, 62, 85, 109, -76, -109, 114, 92, 41, -31, 14, -114, 44, -45, -103, -5, 38, 114, -22, -116, 36, 6,\n 57, -15, -65, 59, 23, -38, 114, 12, -69, -10, -4, 107, 116, 65, 43, -4, 101, -50, 125, 37, -102, -72, -126, -17, -44,\n -119, 41, 22, 87, 84, -106, 103, 116, 65, -97, 123, -57, 17, 53, 119, 113, 116, -34, -111, -76, -3, -68, -63, 123, -49,\n -8, -74, -74, -75, -76, -7, 59, -83, -26, 125, 29, 118, -32, -29, -52, -82, 70, -105, 127, -41, 107, -38, -52, -87, -9,\n 83, 120, -20, -21, -107, 30, -8, -20, -49, 36, 12, 89, -84, 98, 37, 51, 120, -18, -124, 91, -98, -7, -14, -66, 101,\n 16, 61, -55, 54, -33, 62, 108, -21, -113, 87, 88, -47, -18, -21, 39, -117, 111, -23, 73, -74, 95, -68, 17, -45, 94,\n 95, -4, 7, 125, -81, 124, -84, 74, 75, 1, -101, -41, -66, -1, 65, -18, 113, -2, -17, -21, 21, 73, 114, 7, 32,\n -33, 108, -55, 112, -5, -93, -96, -18, 24, -104, -84, 10, 2, 73, 112, 122, 1, 96, 120, -58, -123, 40, 2, 25, 47,\n 125, 28, -20, -115, -1, -16, -73, 49, 105, -107, 14, 64, 74, -109, -110, -24, 50, 88, -65, -30, 93, 48, 106, 47, -4,\n -103, 8, -49, 102, -79, 32, -127, -49, 54, 54, -44, 22, 9, -99, -57, 67, 25, -50, -112, 96, 117, 43, -99, 91, -32,\n 66, 67, 36, 110, 37, -120, -17, 113, 97, 18, 5, 38, -93, 120, 9, 43, 103, 13, 99, 23, 16, 17, 38, 23, -25,\n 64, 113, -119, 65, -69, -33, 4, -115, -24, 68, 48, 90, 112, -117, 109, 10, -29, 122, 96, 4, -88, -2, -3, -120, 105,\n -127, 58, 31, 118, -48, -120, 58, -12, -115, -47, 111, 104, 73, 79, 119, -56, 87, 70, 60, 126, 70, -114, -41, -53, 35,\n 120, -10, -109, -91, -73, 52, -15, 46, -38, -79, -48, -63, -62, 119, -74, 28, 105, 113, -113, 33, -85, -48, -119, -122, -90,\n -89, 62, 70, -46, 92, 123, -44, -97, 36, 69, -74, 52, 64, -70, 103, -126, 14, 20, 100, -46, 2, 37, 59, 55, -54,\n 69, -127, 112, 92, 36, 25, 37, 118, 50, -55, 84, -46, -110, 97, 124, -37, -5, 58, -71, -54, -102, 89, 39, -109, -101,\n -53, -107, 10, -75, -89, 49, -106, -123, -14, -112, -118, -100, 78, 41, -123, 40, 46, 84, 114, 5, -106, -61, -2, 4, 85,\n -23, -74, -9, 74, 98, -118, 107, 82, -2, -5, 95, 1, 43, 22, -56, -15, 49, -82, -112, -70, 124, 30, 47, -87, -24,\n -53, 64, -118, -114, 108, -55, 36, -90, 49, -39, -120, -86, 19, -14, -117, -101, -90, 97, 91, 15, -35, 39, 63, 79, 101,\n 115, -120, 125, -111, -32, 125, 100, -103, -95, -3, 116, 105, -125, -40, 68, -112, 42, -127, 53, 78, 110, 50, -55, 105, -124,\n 10, -25, 101, -16, 89, -102, 114, 102, -24, -100, 127, 25, 86, 8, 55, -103, 21, 20, -127, -19, -102, -67, 108, -29, 21,\n -95, 39, 32, 82, -46, -77, -125, -100, -76, -25, 63, -111, -88, -49, 4, -50, -115, -117, 22, -3, 28, -5, -32, -55, 68,\n -72, 24, -48, 93, -3, 3, 90, -110, 30, 26, 71, 126, 89, -77, 45, -11, -108, 40, -3, 56, -6, -46, 105, 5, 40,\n -93, -38, 58, -35, -18, 96, 42, -78, 81, -102, -109, 65, 1, -35, -52, 96, 60, -54, 56, -121, -94, -76, -95, -46, -108,\n 104, 69, 111, -118, -49, 113, -127, -110, 123, -122, -71, 14, 50, -113, 42, 56, 67, 70, -47, 60, -52, -102, -35, 74, -43,\n 6, 66, 44, 102, 83, -87, -25, 99, -90, 12, 7, 118, 84, -80, 98, -55, 124, 9, -116, 33, 56, 35, 88, 41, -124,\n -122, -11, 126, 59, 36, -42, 84, 119, -7, -55, -91, -111, 52, -99, 88, -20, 42, 68, -83, 122, 32, -41, 64, -52, -87,\n 106, -59, -2, 99, 29, 17, -7, -80, -22, -119, 40, -123, 56, -28, 43, -30, -94, -89, 81, -73, -18, 114, 84, -120, -52,\n 11, 59, 125, -8, 88, -107, 2, -106, 69, 3, 53, -44, 94, 11, 91, 70, 87, 37, 11, 114, 56, 69, -25, 101, -97,\n -7, -61, -48, 29, 112, -89, 11, -107, -86, 98, -26, 90, 90, -122, 49, -47, -118, 92, 2, -19, -86, 44, -21, 89, 86,\n -114, 21, -78, -90, -75, -117, -35, 96, -21, -55, 5, -74, 53, -79, -76, -101, -22, 105, -33, -6, -37, -55, 10, -107, -95,\n 8, 92, -104, -83, 94, 123, 91, 26, 62, 18, -107, -77, -20, -47, 32, 39, 10, -37, 8, -110, 86, -76, 35, -116, -105,\n 69, 122, -21, -37, -103, 114, -87, 86, -109, 107, -36, 112, 89, 42, -87, -29, 34, 55, -125, -117, -63, -18, 123, -98, -69,\n -42, -13, -14, -107, -92, 101, 21, -24, 116, -63, -75, 92, 109, -23, 16, -75, 67, 53, 85, -125, 22, 39, -62, 126, 54,\n 80, -68, 96, -91, 84, 121, -19, 26, 94, -85, -19, 87, -113, 44, 68, -20, 110, -85, 11, -33, 12, -27, 102, 70, -26,\n -67, 43, 77, 103, 87, -94, -74, 25, 49, 82, 0, 22, -16, 11, 63, -120, 45, -27, 58, -105, -80, -73, 21, 41, 101,\n 83, -22, -34, -9, 34, 56, 53, 68, 116, 108, 100, 67, 88, -91, -82, -12, 73, 42, 39, 94, 19, -123, 43, 108, 97,\n 2, -14, -53, -88, -54, 76, 93, -2, 97, 33, 76, 37, -23, 6, -107, -102, 114, 25, 112, 124, -43, 37, 98, 22, -45,\n 119, -86, 107, -116, 104, -114, 67, -9, -30, -53, -6, 68, 95, 20, -34, 38, 116, 91, -85, -74, 42, 69, -39, -97, 64,\n -106, 113, 99, 18, 90, -28, -43, 38, 118, 89, -62, 61, 23, -110, 109, 76, -89, 119, -71, 56, 56, 21, 54, -87, -112,\n 71, 12, -30, 16, -29, -49, 116, -57, -117, -18, -115, 35, -52, 39, -17, 2, 54, -65, -65, -12, -14, 83, 109, -74, 46,\n 49, 35, -7, -66, -11, -116, 42, 112, 117, 124, 96, 42, -69, 6, -126, -60, -5, -22, 105, -25, -20, 48, -19, 112, 57,\n 102, 9, -83, 51, 76, -19, 21, -24, -115, 54, 90, -61, 79, 94, 96, -97, -33, -71, 99, 30, -9, -40, 89, 107, 67,\n -50, -116, -105, 27, -35, 2, -117, 105, -98, 45, 30, 112, -98, 37, -35, 59, 82, 89, 122, -61, -89, 94, 84, 110, -125,\n -20, 97, 81, 98, 58, -45, 88, 77, 22, -114, 33, 44, 22, 34, -93, -84, -75, -119, 84, 117, -83, 19, 99, 106, 86,\n -13, -82, -65, -2, -75, 105, -80, 91, 125, -40, 34, -97, 16, -44, -20, 125, 53, -96, 105, -51, 92, 68, -29, -102, 77,\n -89, -118, 91, 127, 14, 77, -48, 82, 27, -5, -91, -54, 115, -10, 32, 55, -23, -39, 61, -81, -74, -41, 39, 61, 10,\n -124, -77, -37, 109, -66, -31, -46, -108, -70, 27, 119, -84, -2, -93, -73, -27, -97, -10, -44, 92, -64, -42, -10, -24, -28,\n -43, -19, 122, -47, -51, -55, -82, 86, 116, -104, 121, 105, 72, -86, 126, 16, -46, 56, 18, 92, 0, 57, -106, 31, 88,\n 67, -75, 118, -17, -124, -113, -64, -21, 109, -25, 16, -25, -69, -36, 99, -6, 50, -65, -5, -67, 93, 120, -29, 53, -53,\n 13, 46, 49, -102, 59, -53, 41, -74, 74, 57, 64, -110, 115, -77, -94, -109, -13, 43, 79, 63, 92, -110, -78, -69, 100,\n -32, 8, -87, -42, 68, -38, 117, -29, 51, -49, -15, -96, 10, 119, 115, -25, 104, -38, -29, 77, -28, 76, 63, 83, -68,\n -100, 66, -30, 9, -86, 124, -82, -102, -54, -43, 91, 36, -94, 21, -70, 124, -24, -30, 47, -86, 24, 28, -17, 6, -101,\n -8, -101, -108, -34, -116, -50, 13, -68, -22, 57, 109, 107, -87, -49, -54, -22, 64, -47, 102, -12, 122, -77, 28, -28, -127,\n 85, 98, 115, 45, 10, -22, 75, 71, -99, -36, 102, -82, -94, 100, -99, 61, 103, 122, -31, 69, -74, -15, -3, 108, -38,\n -35, 103, 48, -80, -121, 125, -42, 117, -1, 56, -115, -51, -114, -44, -39, 74, 29, -42, -51, 14, -7, -32, 35, -99, -33,\n -72, 79, -102, -18, 124, -49, 41, -78, 77, 70, -17, -68, 3, 6, -77, 123, -97, 15, -39, 99, 41, -64, 127, 110, -105,\n 50, 80, 118, -9, 50, -37, 77, -58, -49, -1, -37, 119, 110, 28, -5, 40, 71, -2, 45, -81, -56, -17, 45, -27, 127,\n 83, -109, -70, -42, 45, -79, -114, 21, 14, -106, -102, 71, -19, -25, -73, -102, -32, -126, 18, -36, -14, -100, -59, 125, -4,\n 52, 14, -78, 71, -85, 8, -14, -87, 63, -39, -22, -11, 102, 105, -41, -13, -111, 46, -58, -62, 118, 31, 105, -49, -40,\n 15, -37, 125, -60, 70, -21, 105, -15, 0, -84, 51, 85, 54, 40, -73, -63, -49, 54, -15, -3, -24, -4, -96, 79, 50,\n -67, -72, 110, -22, -16, -15, -11, -4, -50, -89, -10, -36, 24, -92, 62, 72, 115, 45, -59, -114, -78, 63, -106, -108, -10,\n -23, -29, 29, -82, 58, -17, -13, 55, -24, 56, -98, -114, -73, -65, 117, -48, 111, -125, 49, -11, 75, 63, 2, 84, -69,\n -23, -53, -67, 21, -77, -72, 60, -61, 48, -98, 107, 54, 115, 75, -91, -61, -127, 21, -29, -53, 63, 48, 10, -67, 68,\n -103, 64, -63, 34, -94, -66, -126, -74, -11, -21, 64, -102, -85, 58, 4, 36, -68, 28, -119, 13, -86, -126, -107, 87, 3,\n -101, -1, -117, 63, -13, -93, 64, 97, 107, -67, 20, 124, 56, -86, -30, 64, 63, 99, -69, -22, 107, 63, 44, 3, 24,\n 12, -12, 61, 57, 65, -81, -100, -104, 24, -125, -86, -79, 10, 25, 63, 22, -20, -90, 92, -94, 45, -67, 11, -68, -89,\n -109, 65, -63, 43, 45, 78, 91, 48, -73, -77, -113, 28, 44, -67, -99, -46, 30, 118, -7, 35, 35, 92, -2, 62, 33,\n 28, 66, 34, -52, -88, 21, -76, 36, 111, -14, 64, 26, 52, 64, 49, -52, 36, 78, 115, 39, -54, -118, 66, 49, -46,\n 47, 19, 108, -95, -63, -77, -110, -67, -78, 45, 45, 12, -85, -5, -96, -101, -32, -61, 60, 61, -53, -118, 25, -108, -71,\n -7, -110, 62, -51, -38, 48, 94, -93, 51, -17, 8, -65, 75, 2, 51, 35, -45, 36, 32, -12, -69, 46, -116, 67, -20,\n 57, -88, -121, 73, -101, 68, 20, -64, -57, 57, -93, 1, -36, 67, -43, 106, 47, 63, -28, -68, 57, -30, 31, 53, 20,\n -103, -10, -64, -92, 78, -93, -62, 67, 84, 68, 57, 92, 40, 103, 122, -79, 13, 42, -94, -18, 114, -65, 62, -52, 67,\n 104, 75, 30, -109, 67, -61, -39, -128, 31, 114, 50, 60, 94, 65, -90, -5, 19, 69, 14, -117, -71, -111, 34, -77, 37,\n 116, -65, 37, 43, -64, -24, -117, -107, 112, -21, 13, 10, -39, -113, 14, -15, 68, -14, 90, -108, 71, -60, -59, 10, -86,\n 42, -68, 90, -58, -3, -47, -66, -68, 122, -102, 94, 83, -74, 98, 27, -58, -65, -101, 16, -74, 57, 70, -91, 57, -85,\n -66, -125, -108, 59, 98, 70, 27, 51, -106, -61, -40, 61, 14, -21, -59, -121, -62, 62, 92, 1, -61, 73, -92, -72, -2,\n 113, 18, 13, -110, -59, 89, -44, 69, -40, 113, -86, -42, -127, 70, 113, -20, 30, 3, -55, 57, 83, -76, -75, -82, -93,\n 58, -10, -2, 74, -58, 76, -71, -70, -1, 48, -73, 0, -100, 34, 64, 124, -94, 106, 19, 41, 91, -60, -107, 97, -53,\n 71, 61, 43, 54, -15, -22, -86, -96, 75, 64, 77, -62, 37, -68, 25, 72, -126, 44, 72, 59, -12, -98, -124, 124, 34,\n 40, -84, -74, 19, 107, -56, -104, -80, 8, -120, -84, -77, 17, -108, -69, 97, -62, 57, -24, -24, 69, -95, -29, 51, -117,\n 28, 67, 36, 100, -100, 107, -55, 68, -40, -128, -106, 86, -63, -81, 124, 43, -118, -109, 68, 73, -27, -13, -107, 22, 90,\n -91, -38, -15, -63, 14, 123, 29, -37, -101, 38, -99, 90, 38, -40, -29, -112, 82, -20, 16, 54, -45, -111, 44, -28, -92,\n -98, 100, -75, -60, 107, -92, 79, -127, 69, -42, -29, 21, 44, -117, -89, 39, 52, 74, 62, 84, -62, -85, -94, -88, 91,\n 52, 35, 70, 34, 65, 116, -14, -63, -88, -92, -88, -87, -108, -76, 7, 2, -54, -65, 120, -56, 72, 82, -88, -83, 28,\n 41, 34, -93, 61, -92, 60, 51, -43, 34, 49, 115, 100, 15, -56, 64, -98, 108, -124, -81, 52, -70, -97, 78, 92, -53,\n 70, 83, 58, -65, -93, 13, 0, -6, 58, 124, 100, -54, -89, -61, -56, 22, -87, 63, 38, 100, -57, 36, 52, 47, -105,\n 43, 56, -124, -4, 73, -128, -86, 27, 81, 123, -91, 103, 17, 38, -62, -116, -56, -88, -100, 24, -47, -60, 72, 20, 105,\n 70, 1, -63, 67, 68, -61, -58, -2, 36, -116, 43, -68, 84, -84, 109, -68, -52, -67, 20, 27, -62, 73, 75, 17, -111,\n 60, -84, -4, 76, 47, 76, -85, -61, -76, -113, -127, -109, -90, -15, -6, 61, -32, 83, -97, 30, -92, 58, -114, 99, 27,\n -111, 4, 70, -103, -116, -51, -81, 113, -87, 99, 116, -96, 43, -124, 19, 121, 73, 30, -36, 20, -80, -126, -103, 18, 110,\n -117, 19, -82, -112, -73, -33, 108, 31, -43, 76, 20, -20, 36, -50, -27, -111, 28, -16, -100, -52, -81, 124, 61, 109, 4,\n -114, -37, -100, 15, -41, -13, -52, -15, -87, -51, 41, -103, 78, 50, -13, 38, 47, 26, -55, -23, -79, -80, 50, 59, -61,\n -92, -72, -49, -43, -20, 70, -62, 43, -49, 101, -6, -56, -13, 36, 68, 96, 107, -78, -30, 88, 62, 7, -22, 62, -8,\n -100, 72, -6, 72, 17, 122, -84, -81, -59, 100, -52, 3, -111, 68, -115, 107, 61, -128, -124, 58, -55, -44, -82, -86, 84,\n -93, 24, 27, 80, -84, 43, -55, 122, -31, -114, 79, 75, 80, -22, -84, 67, -30, 26, -49, -25, 121, -48, 26, 26, 78,\n 15, -13, 41, -83, -108, 62, -76, 12, 67, -109, -93, -85, 111, 44, 70, -79, 50, -53, 25, 117, 74, 9, 18, -47, -8,\n 60, -106, -116, -101, 37, 20, 13, -48, 78, 43, 81, -108, 122, -55, 61, 44, -94, 11, 109, 59, 75, -4, 81, 101, 26,\n 80, 2, -11, -53, -74, -44, -47, -3, -46, 16, -29, -116, -2, -63, 14, 109, -63, 78, 123, 63, -6, 11, -46, 25, 108,\n 55, -106, -95, -58, 42, 53, -109, 38, -3, -100, -12, 76, -70, 79, 83, 82, 40, -75, 31, -54, -23, 41, -38, -52, 26,\n -56, -100, 75, 44, -91, -53, 27, 36, 79, 61, 36, 67, 90, -71, -47, -38, 58, 72, 3, -3, -119, 30, 27, -45, 51,\n 21, 74, -38, -111, -89, -108, -116, -58, -18, -68, -69, 84, -20, -49, -82, 76, -50, 56, 77, 59, 51, -107, -103, -31, -61,\n 15, -84, -84, 36, 8, 89, -44, 62, 93, -60, -103, 4, -56, 112, -12, -100, 114, -116, 40, -52, 49, -44, 67, 69, -44,\n 24, 109, 35, 73, -27, 20, -43, 11, 83, -85, -4, 75, 0, -103, -44, 83, 67, 63, 43, -38, 39, 24, 58, -50, -51,\n 116, 78, 78, 53, 60, 79, -75, -72, -55, 12, 85, 51, -38, 84, 59, -35, 77, 83, -27, 73, 84, 45, 76, -80, 68,\n 76, 57, -29, -45, 70, 33, 36, -33, -48, -97, 116, -103, 83, -57, -29, -77, -37, -85, -90, 47, 21, -98, -25, 104, 63,\n -50, -124, -86, 94, -115, -68, 55, -126, 28, -83, -100, 39, 97, -51, -105, -125, -20, 25, -90, -77, 46, 33, 91, 56, -73,\n -95, 67, -49, 83, 69, -52, -124, -95, 75, 108, 86, 78, 10, -53, 105, -51, -69, 106, 37, 48, -72, 121, -103, 108, 5,\n -100, 109, -51, -70, -112, 18, 67, 112, 45, -73, -14, -101, -46, -72, -102, -100, -117, -2, 58, -41, 92, 109, 18, -26, 92,\n 87, -107, 107, 87, -89, 115, 28, 105, 12, -59, 60, -70, -50, -71, 68, -72, 74, 44, 88, 39, 116, 88, -13, -116, 70,\n -62, -126, -61, 32, 68, 69, -127, -91, -42, 86, -76, 33, 122, 28, 75, -64, 11, -49, -70, -6, 83, -55, -14, 70, -101,\n 76, -82, -26, -93, 88, 49, -30, -66, -117, -123, -63, -116, 37, 37, -56, 36, -43, 124, 90, 41, -3, -28, 64, -115, -108,\n -56, 36, -78, 45, -109, -27, -114, 74, 75, 89, -93, -93, 82, 5, 116, -75, 107, 109, -70, -88, -13, 82, 90, 29, 90,\n 91, -115, 71, -117, -55, 48, -100, -35, 62, -99, 29, -40, -22, 19, -51, 56, 114, 51, -68, -71, -87, -101, 3, -83, 116,\n -5, -44, -66, -116, 75, 97, -31, 88, 27, 4, -66, -50, 88, 90, -104, -5, 43, 82, 60, 61, -76, 43, -41, -105, -107,\n -96, 11, 52, -47, 115, -13, 68, -78, 117, -94, -64, -68, 84, -83, 19, 65, 81, -27, 85, -81, -107, 90, 10, 125, -73,\n 101, 81, -75, -94, -83, -106, -123, 124, -64, 66, -12, 51, -75, 93, 83, 10, -102, 24, 15, 37, -100, 23, 13, 44, 59,\n -20, -52, -68, -99, -37, 107, 113, 85, -6, -78, -64, -78, -28, 40, 19, 74, -44, -76, 117, -47, 110, -94, 89, 114, 41,\n 84, 104, 90, -81, 50, 84, -36, -77, 27, 90, 119, -71, -100, -89, 58, 88, -76, -83, -43, -88, 122, -46, -2, -39, 115,\n 23, 88, -115, 56, -100, 99, 42, -50, -51, 60, 56, 69, -57, -34, 115, 52, -47, -19, -37, 75, -13, 43, -103, 75, -36,\n 124, -79, 92, 98, -13, 19, -83, 45, -48, -42, 29, -89, -69, -123, -35, 3, -108, -38, -58, 77, 82, -7, 66, 29, -36,\n 29, -42, -120, -75, -70, 76, -20, 93, -21, -124, -96, -33, 77, 88, 40, 42, -54, 35, -5, -109, -28, 5, -45, -30, 61,\n 51, 70, 100, -80, -21, 85, 94, -27, 124, 54, 83, -46, -89, 112, 76, -98, 91, -117, -34, 10, -44, -94, -39, -67, -107,\n 82, -119, 87, -84, -95, 94, 89, 101, -97, -92, 18, 82, -90, -24, 94, -17, -3, -34, 76, 17, 43, 60, 5, 88, -84,\n 99, 95, -13, 69, -109, -94, 28, -75, 80, 25, -37, 93, 101, 37, 40, 27, 84, -87, -30, -106, -104, 93, -37, -107, 92,\n -34, -91, 89, 95, -98, -93, -40, -22, -20, -33, 69, -52, -111, -47, 28, -35, 17, 19, 78, 5, 102, 91, -125, 77, 96,\n -122, -7, -71, 119, 124, 92, -56, 101, -32, 72, 3, 76, -71, -109, -46, -128, -107, 96, 76, 77, -42, -111, -46, -85, -114,\n 36, -32, -102, -93, -87, 2, -71, 59, -35, 117, -35, -120, 21, -32, -57, -117, 18, -118, -23, -52, -109, -125, -116, 25, -93,\n 95, 20, -74, -102, -47, -38, 26, -61, 36, 89, 25, -42, 37, -82, 4, -36, -107, -101, 97, 61, -46, -114, -53, 117, 94,\n -91, 43, -2, 41, -104, -67, 84, -61, -8, -31, -113, -95, 93, 96, -75, 29, 31, -10, -93, 115, 82, 51, 89, -67, -39,\n 109, 83, -30, -46, 68, -111, -65, 68, -63, -69, 89, -30, -103, 125, 78, 16, -91, 98, 121, -19, 84, 36, -75, 28, -2,\n -83, -55, 15, -36, -68, -51, -53, -30, 58, -51, 96, -55, 83, -49, -30, 35, 19, 49, 54, -64, 28, 54, 73, 53, -58,\n 94, -26, 107, 88, 87, -46, -32, -62, -77, 68, 124, 27, -59, -17, -83, -40, -30, 123, -61, 65, 1, -29, -46, 124, -29,\n 63, -66, 60, -42, 92, 34, 41, 118, 86, -2, -109, -75, 29, 76, 50, 47, -122, -50, -63, -11, -74, 27, 36, -76, -2,\n -94, 99, -50, 93, -42, 45, -126, 100, 109, -43, -75, 67, -82, 56, -124, 101, 84, 18, 108, 83, -44, -107, 26, 36, -114,\n 100, -65, 60, -46, -33, 17, 101, -128, -126, -40, 77, -93, 60, -24, 26, 98, -63, -60, -47, 67, 117, -71, 127, -107, -27,\n -27, -108, -45, 82, 78, -82, -90, 114, -93, -42, 51, -59, 18, -86, -28, 32, -119, 85, 30, -75, -27, -2, -75, 66, 108,\n -126, 102, -112, 124, 90, 102, -61, -60, 76, 86, 80, 107, 13, 85, 3, 94, 101, 97, 54, 90, 24, -67, 32, 106, -82,\n -26, 74, -77, 96, 21, -106, -57, -119, 52, 70, -28, 73, -61, -41, -4, -26, 58, -114, 99, 113, 38, -30, 122, -20, 102,\n 108, -34, -60, 116, -74, 62, 102, -2, -18, 34, 70, 125, -78, 47, 114, 103, 93, 113, 95, 74, -22, -41, -104, 100, -29,\n 115, 6, -48, 123, 94, -74, 20, 93, -116, -84, -19, 86, 127, -66, 20, -128, 30, -93, 113, 38, 103, -1, -28, 60, -28,\n -37, 89, 0, -52, 95, -42, -19, -94, -56, 65, -39, 16, 109, -24, 42, -42, 84, -120, -82, 89, 74, 4, 42, -32, 28,\n 89, 106, 77, -95, 22, 94, 62, -14, -39, 100, -113, -50, 24, -45, 107, 100, 55, 38, -28, 11, 29, 14, 102, -117, 104,\n -74, 101, -24, -67, -127, -65, -106, -58, 94, -113, 82, -72, -104, -106, -23, -119, 110, 99, 21, 69, 103, 113, -60, -55, 32,\n 73, -58, -99, -10, 95, 23, 101, -36, 125, -79, -23, 91, -98, -23, 2, 2, -44, -75, 92, 84, -116, 78, -22, 98, -52,\n -114, -59, 50, -25, 66, 113, -22, -89, 102, -72, 8, -117, -22, -88, -10, -26, 81, -74, -22, -117, -23, -46, 79, 5, -81,\n 13, -36, 41, 55, 44, 92, 69, -39, 39, -114, -18, -45, 124, -58, 13, -78, -10, 23, 82, -98, 58, 120, -31, 106, -83,\n -15, 33, 35, -126, 74, -121, -44, -111, -117, -75, 88, -112, -61, -21, -99, 46, -62, 122, 54, 46, -23, -99, -83, 76, -51,\n -49, -34, -20, 26, -63, 14, 92, -25, 104, 56, 116, -99, -21, -36, 101, 69, -7, -83, 44, -25, 91, -59, 64, -94, 37,\n -7, 104, 103, -103, -55, -57, -78, 74, 62, -79, -106, 108, -2, -105, 14, 106, -69, -98, -74, -53, 102, -84, 51, -86, -65,\n -20, 52, -23, 58, 105, -20, -20, 81, -25, -49, 114, -19, -122, -66, -53, -32, -78, -20, -61, -90, -20, -1, 90, -106, 57,\n 9, -19, 35, 52, -24, -73, 22, 109, -121, 38, 109, -83, -66, -82, -55, 67, 78, -84, -10, 78, 71, -82, 15, -39, 102,\n 83, -82, 27, 97, -22, 91, 110, 119, 62, 99, 98, -26, -109, -37, -58, 109, -104, 116, 27, 16, -98, 31, -24, -58, -103,\n -14, -19, -51, 26, 11, 76, -32, -42, 91, -98, -94, 101, -30, 118, -31, -111, 110, -68, 31, -78, -52, -92, 13, 102, -97,\n -36, 97, -40, -82, 60, -118, 11, -17, 127, 14, 107, -21, -114, -104, -76, 54, -18, 79, -106, 51, 41, 68, -29, -34, 118,\n 30, -110, 99, 60, -10, -106, 111, 35, -111, 86, -62, -2, -110, -19, -58, -62, 118, -60, -48, 31, 92, -34, -110, 57, -31,\n -2, 38, -24, -3, -51, 110, 1, 127, 20, -88, 68, 109, -114, -87, -18, -6, -50, -41, -90, 97, -32, -85, 29, -40, 6,\n -33, -76, -83, 13, -16, 9, 7, -25, -31, -10, -36, -12, -71, 111, -4, 22, -22, 118, 114, -16, -14, 58, -16, 110, 105,\n 25, 53, 11, 65, 23, -9, -25, -60, -2, -43, 19, -57, 44, -52, 69, -17, -110, -90, -38, 68, -42, 109, -90, 117, 92,\n -101, -14, -15, 17, -9, 22, -71, -76, -15, -59, 59, 95, 105, 26, 91, 37, 71, -2, 86, 59, 21, -14, 35, 68, -68,\n -43, -106, -16, 33, 15, 110, 127, -93, 110, 20, -9, -68, -77, -78, 97, -72, -35, -17, 68, 110, -17, -93, 49, -24, 41,\n -9, 94, 60, -77, -14, 43, 23, 100, 12, 70, -42, 28, 102, -19, 84, -67, -21, 48, -1, -105, -9, 61, -21, -31, 45,\n -13, 49, -92, 109, -2, -98, 31, 59, -26, 69, 54, 111, -13, 127, -122, -16, -58, 34, 115, 12, 103, 114, 43, -58, -63,\n 88, -68, 115, 60, -65, -21, 25, -113, -18, 78, 37, 36, 63, -1, 115, 26, -4, 91, 23, 82, -17, 96, -69, -26, -83,\n 62, 116, 97, 102, 106, 126, -69, 54, 17, 55, 87, 118, -108, -26, 71, -105, -14, 40, -3, -40, 60, -41, 115, 71, -79,\n 116, 57, -21, 50, 63, 13, -22, -15, -18, -12, -28, 30, 71, 76, 47, 111, 81, 7, 28, -38, 5, 96, -11, 61, -11,\n -23, 30, 79, -106, 6, -16, 76, 119, 52, -81, 122, -11, -6, 109, 81, -30, 60, 52, 74, 87, -68, 112, -114, -36, 46,\n -105, -15, 59, 12, -94, 96, 87, -29, 90, -28, -50, 55, 69, 110, 87, 79, -30, -1, -28, -103, 104, -37, 109, 6, -105,\n 67, -17, -2, 105, 94, -9, -56, 98, -87, -62, 35, 38, -67, 100, 26, -17, 102, -30, 87, 106, 47, -10, -48, -107, -93,\n -72, -50, 118, 45, -66, 98, 42, -110, -89, 11, -82, 106, 70, 55, -15, 66, 14, -44, 52, -116, 108, -120, -2, 11, 104,\n 116, 39, -15, -66, 5, 119, -54, -48, -11, 112, 110, -60, 85, 103, 94, -34, -18, -40, 82, 74, 118, -13, 117, -27, -75,\n 43, 104, 48, 95, -32, 126, -81, 112, 66, -89, 50, -126, -65, 106, 95, 122, -8, -33, -3, -32, -38, -122, -13, 58, 23,\n -8, 56, 126, 104, -58, 110, -8, 47, -98, -26, 123, -65, -52, 106, -124, -25, -128, -57, 90, -105, 12, 90, 109, -30, -8,\n 16, -90, 39, -119, 87, 92, 95, 15, 98, 120, 31, -32, -50, -43, 113, 120, -65, -11, -44, 53, 101, 72, -12, -8, -113,\n 111, 102, 8, 63, 65, -25, 6, -38, -127, -66, 100, -29, 49, 62, -25, 85, 101, -100, -49, 121, -78, -36, 121, -97, 61,\n 35, 112, -13, -54, 64, 87, -20, 60, 61, -10, -94, 50, 122, -66, 44, 113, 68, 43, -60, -107, 79, 119, 45, 105, -7,\n -55, -70, 122, -113, 105, 118, 74, -106, -6, -93, 111, 122, -98, 63, -61, 125, -117, 17, 80, 55, 123, -101, -105, -61, 86,\n -97, 48, -80, -49, 105, -79, 95, -31, 119, -11, 116, -30, 21, -7, -96, -9, -20, -106, 26, -7, -74, -105, -74, -73, 39,\n 48, 39, 39, 122, 103, -74, -25, 56, 92, 123, -74, -49, -5, 64, 68, 122, 64, -89, -9, -104, -73, -8, -124, -49, 63,\n -63, -33, 106, -62, 47, -4, -67, -9, 84, -82, -41, 68, -125, -97, 50, -69, -113, -6, -57, -73, -47, 55, -105, 124, -22,\n 52, -37, -2, 27, 34, 119, -17, 107, 124, -45, -50, -4, -101, -116, 124, -105, -60, -13, -77, -81, 71, -48, 15, 125, -52,\n 39, -3, -89, -82, -38, -98, 47, 123, -11, -93, 121, 45, 20, 125, 3, 119, -3, 89, -36, -4, -116, 7, -51, 1, 68,\n 90, -120, -76, -3, 11, -57, -3, -68, -58, -66, -54, 70, 124, 68, 22, -91, 126, 38, 76, -32, 95, 116, -31, -81, 45,\n -35, 71, 94, -71, -105, -3, 34, -59, -51, -27, 55, -11, -26, 23, -45, -92, -124, 116, -34, 23, -89, -23, -84, -2, -22,\n -67, 126, -25, 34, -2, -33, -101, 124, 8, -27, -2, -18, 31, 50, 73, 127, 118, -16, -65, 37, 67, 78, -17, 72, 55,\n -1, -13, -105, -79, 111, 75, -3, 35, 95, 127, -100, 18, 127, -125, 122, 127, 65, 19, -47, -128, -53, -31, -54, 7, -120,\n 0, 2, 7, 18, 44, 104, 112, -96, 0, 0, 10, 23, 50, 108, -24, -16, 33, -60, -120, 18, 39, 82, -84, 104, -15,\n 34, -58, -116, 26, 55, 114, -20, -24, -15, 35, -56, -123, 2, 4, -114, 60, 104, -14, 100, -128, -110, 7, 71, 38, 12,\n -23, -14, 37, -52, -104, 27, 85, -94, 60, -39, 82, 38, -50, -100, 58, 119, -30, -92, 89, -45, -96, -128, -101, 24, 125,\n 6, -3, 105, 20, 40, -49, -92, 74, -105, 50, 109, -22, 84, 105, 73, -97, 71, -127, -94, 12, -6, -12, 42, -42, -105,\n 82, -89, 10, -51, -22, -11, 43, -2, 88, -122, 91, 127, 90, -19, 72, -77, -24, -44, -93, 93, -61, -78, 109, -21, -10,\n -19, 85, -107, 99, -45, -90, -84, 10, -9, 46, -40, -71, 85, -41, -30, -19, -21, 87, -93, -34, -96, -126, 7, -125, -108,\n 11, 64, 47, 93, -110, 127, 23, 51, 110, -36, 88, 110, -30, -107, 104, 11, -14, 117, 108, 57, 36, 98, -54, -107, 47,\n 115, -10, 59, -103, -14, -50, -88, -103, 19, 111, -18, 108, -6, 52, 106, -114, 103, 35, 35, 61, 44, 88, 113, -22, -40,\n 67, 7, -45, -82, 93, 90, 54, 110, -84, -97, -53, -22, 20, 124, -72, 46, -21, -107, 95, 121, -25, 46, 110, -4, 35,\n -28, -32, -96, -59, -34, 62, -18, -4, 57, 116, -73, 69, -101, 107, 117, 61, 90, 109, 88, -33, -47, -73, 115, -1, -115,\n 80, -7, -14, -18, -30, -57, -109, 127, 74, 61, -26, -21, -49, -84, -49, -13, -116, 90, -2, 125, -22, -43, -32, 9, -78,\n -121, 111, -1, 62, -2, -20, 9, -81, -37, -51, -98, 50, 63, -128, -98, 81, 54, 31, 125, 1, 26, 120, 32, -126, -70,\n -127, 87, 95, 123, 12, 38, -8, 32, 122, -12, 17, 24, 30, -124, 21, 90, 120, -31, 80, 11, 74, -73, 31, -122, 29,\n -54, 68, -44, -124, 5, 122, 56, 34, -119, 24, -14, -41, 90, 91, -124, -107, -72, -30, 76, 3, -122, -8, 31, -117, 49,\n -54, 120, -33, -119, 20, -78, 53, -35, -116, 57, 70, 4, -2, 98, -120, 14, -22, -8, 35, -112, -114, -115, 53, -105, 118,\n -46, -111, 68, 91, -112, 51, -14, 56, -95, -113, 73, 58, -7, 100, -118, 72, -99, 85, 36, 92, 91, 53, 9, 37, -115,\n 18, 46, -88, 34, -106, 93, 122, -23, 25, 90, 55, -79, 116, 37, 83, 86, 126, 57, -94, 124, 116, 33, 121, 38, -101,\n 109, -34, 69, -100, 107, -116, -103, -23, -90, -123, 105, -90, 69, 38, -99, 121, -22, 25, -38, 98, 86, -30, -71, -25, 113,\n 75, -34, 9, 40, -95, -123, -42, -87, -103, -95, 7, 10, -54, 85, -94, -115, 58, -118, -33, 89, -113, 2, -72, 40, 118,\n -110, 90, 122, 41, 116, -122, 97, 106, 31, -91, -110, -123, -71, 41, -88, -95, 50, 39, -26, -97, -24, 53, -28, -98, -88,\n -28, 117, -118, 34, -107, -87, -70, -22, -88, 104, 44, 25, -39, 82, 122, -81, -114, 87, 91, -91, -74, -22, 42, -23, -100,\n -2, -91, 52, 38, -100, -69, 58, 71, 106, -91, -91, 10, 123, -84, -116, 82, 25, 91, 24, -118, -56, 102, -86, 16, 75,\n -40, 5, -21, 44, -75, 94, 42, 123, 35, 125, -53, 86, 91, 37, -83, -64, -111, -43, -22, -74, -31, 62, 25, -87, -81,\n -80, -119, 27, 104, -73, -4, 77, 123, 46, -69, 57, 106, 58, 28, -71, -19, 26, -105, 110, -82, -14, -38, -85, 35, -72,\n 113, 53, 123, 47, 110, -55, -43, -92, 45, -65, 1, -17, -87, -34, -111, 2, -9, -2, -5, 29, 89, 6, 43, -84, -85,\n -97, 11, -53, -26, -81, 77, 14, 75, 28, -22, -112, 19, -57, 22, 109, -62, 22, 107, 12, -85, 73, 0, 111, -36, 84,\n 84, -33, 126, 60, 50, -95, 21, -109, 124, 89, -56, 54, 121, 124, 50, -53, -121, 10, -41, -14, 95, 86, 65, 108, 35,\n -52, 53, -113, -37, -80, -51, 111, 30, -119, 112, -57, 57, -5, 124, -77, 104, 63, -65, -7, 26, -49, 61, 11, 125, -12,\n -113, -21, 34, -99, -105, -117, -3, 45, -3, 52, -44, -37, -38, -23, 116, -44, 85, 91, -3, 106, -104, 70, -83, 124, 53,\n -41, 93, 39, 61, -104, -42, 94, -117, 61, -74, -95, -109, -115, -74, 53, -39, 105, -85, -99, -96, -39, 25, -81, -3, 54,\n -36, 73, -18, -25, 109, -60, 113, -37, 125, 119, -78, -45, -3, -117, 55, -33, 125, -93, 73, 55, 85, 104, -5, 61, 56,\n -31, -90, 17, -35, -79, -32, -123, 43, -66, -72, -100, -121, 35, -60, 56, -28, -111, -33, 90, -76, -71, -110, 91, 126, 121,\n 110, -47, 18, 53, -45, -102, -104, 123, -2, -71, 110, 41, 87, 126, -111, -52, -7, -126, 126, 58, -22, -24, 77, 71, 52,\n -125, -76, 38, -98, 58, -20, -96, 59, -2, -85, -46, -79, -37, 126, 59, 84, -23, 117, -114, 59, -17, -67, -73, 71, -69,\n 92, -81, -5, 62, 124, -22, -91, 3, -1, 43, -15, -55, 43, 111, 86, -23, -34, -115, -71, 60, -12, -47, 59, 83, -124,\n -85, -73, -75, 75, 127, 61, -15, -70, 3, 110, 61, -10, -35, -13, -98, 30, 66, 92, 122, 63, -66, -14, -69, -109, 127,\n 126, -10, -74, -95, -65, 126, -7, -36, -77, -1, 62, -4, -15, -53, 63, 63, -3, -11, -37, 127, 63, -2, -7, -21, -65,\n 63, -1, -3, -81, 24, 16, 0, 0, 59\n };\n}", "public void runLighten() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 5.3f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public BufferedImage randomLookupTable(BufferedImage image) {\r\n //convert buffered image to array.\r\n int[][][] arr = convertToArray(image);\r\n //set random table values\r\n int[] random = new int[256];\r\n Random r = new Random();\r\n for (int i = 0; i < random.length; i++) {\r\n random[i] = r.nextInt(255); //random from 0-255\r\n }\r\n for (int i = 0; i < arr.length; i++) {\r\n for (int j = 0; j < arr[1].length; j++) {\r\n //loop through red, blue and green.\r\n for (int k = 1; k < 4; k++) {\r\n int color = arr[i][j][k]; //set values to lookup table values\r\n color = random[color];\r\n if (color > 255) {\r\n arr[i][j][k] = 255; //max colour value 255.\r\n } else if (color < 0) {\r\n arr[i][j][k] = 0; //min colour value 0.\r\n } else {\r\n arr[i][j][k] = color; //set new colour value.\r\n }\r\n }\r\n }\r\n }\r\n return convertToBimage(arr); //return array\r\n }", "public void createImage() {\n\t\tBufferedImage crab1ststep = null;\n\t\tBufferedImage crab2ndstep = null;\n\t\tBufferedImage crabhalf = null;\n\t\tBufferedImage crabfull = null;\n\t\tBufferedImage eye6 = null;\n\t\tBufferedImage eye5 = null;\n\t\tBufferedImage eye4 = null;\n\t\tBufferedImage eye3 = null;\n\t\tBufferedImage eye2 = null;\n\t\tBufferedImage eye1 = null;\n\t\tBufferedImage eyeClosed = null;\n\t\ttry {\n\t\t crabImage = ImageIO.read(new File(\"src/images/crab.png\"));\n\t\t crab1ststep = ImageIO.read(new File(\"src/images/crab1ststep.png\"));\n\t\t crab2ndstep = ImageIO.read(new File(\"src/images/crab2ndstep.png\"));\n\t\t crabhalf = ImageIO.read(new File(\"src/images/crabhalf.png\"));\n\t\t crabfull = ImageIO.read(new File(\"src/images/crabfull.png\"));\n\t\t crabWin = ImageIO.read(new File(\"src/images/crabwin.png\"));\n\t\t crabLose = ImageIO.read(new File(\"src/images/crablose.png\"));\n\t\t eye6 = ImageIO.read(new File(\"src/images/crab_eye6.png\"));\n\t\t eye5 = ImageIO.read(new File(\"src/images/crab_eye5.png\"));\n\t\t eye4 = ImageIO.read(new File(\"src/images/crab_eye4.png\"));\n\t\t eye3 = ImageIO.read(new File(\"src/images/crab_eye3.png\"));\n\t\t eye2 = ImageIO.read(new File(\"src/images/crab_eye2.png\"));\n\t\t eye1 = ImageIO.read(new File(\"src/images/crab_eye1.png\"));\n\t\t eyeClosed = ImageIO.read(new File(\"src/images/eyes_closed.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"bad\");\n\t\t}\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\t\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\t\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n\t}", "private void loadTextures() {\n textureIdMap.keySet().forEach((i) -> {\n //for (int i = 0; i < textureFileNames.length; i++) {\n try {\n URL textureURL;\n textureURL = getClass().getClassLoader().getResource(textureIdMap.get(i));\n if (textureURL != null) {\n BufferedImage img = ImageIO.read(textureURL);\n ImageUtil.flipImageVertically(img);\n Texture temp = AWTTextureIO.newTexture(GLProfile.getDefault(), img, true);\n temp.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);\n temp.setTexParameteri(gl, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);\n textures.put(i, temp);\n }\n } catch (IOException | GLException e) {\n e.printStackTrace();\n }\n });\n textures.get(0).enable(gl);\n }", "private void createBitMap() {\n bitMap = bitMap.copy(bitMap.getConfig(), true);\n Canvas canvas = new Canvas(bitMap);\n Paint paint = new Paint();\n paint.setAntiAlias(true);\n paint.setColor(Color.BLACK);\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth(4.5f);\n canvas.drawCircle(50, 50, 30, paint);\n winningBitMap = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas2 = new Canvas(winningBitMap);\n paint.setAntiAlias(true);\n paint.setColor(Color.GREEN);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas2.drawCircle(50, 50, 30, paint);\n bitMapWin = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas3 = new Canvas(bitMapWin);\n paint.setAntiAlias(true);\n paint.setColor(Color.MAGENTA);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas3.drawCircle(50, 50, 30, paint);\n bitMapCat = winningBitMap.copy(winningBitMap.getConfig(), true);\n Canvas canvas4 = new Canvas(bitMapCat);\n paint.setAntiAlias(true);\n paint.setColor(Color.DKGRAY);\n paint.setStyle(Paint.Style.FILL);\n paint.setStrokeWidth(4.5f);\n canvas4.drawCircle(50, 50, 30, paint);\n }", "public static Map<Integer, List<Integer>> getZoomLevelsDict(String slideRef, Object... varargs) {\n\t\t// setting the default values when arguments' values are omitted\n\t\tString sessionID = null;\n\t\tInteger minNumberOfTiles = 0;\n\t\tif (varargs.length > 0) {\n\t\t\tif (!(varargs[0] instanceof String) && varargs[0] != null) {\n\t\t\t\tif (PMA.logger != null) {\n\t\t\t\t\tPMA.logger.severe(\"getZoomLevelsDict() : Invalid argument\");\n\t\t\t\t}\n\t\t\t\tthrow new IllegalArgumentException(\"...\");\n\t\t\t}\n\t\t\tsessionID = (String) varargs[0];\n\t\t}\n\t\tif (varargs.length > 1) {\n\t\t\tif (!(varargs[1] instanceof Integer) && varargs[1] != null) {\n\t\t\t\tif (PMA.logger != null) {\n\t\t\t\t\tPMA.logger.severe(\"getZoomLevelsDict() : Invalid argument\");\n\t\t\t\t}\n\t\t\t\tthrow new IllegalArgumentException(\"...\");\n\t\t\t}\n\t\t\tminNumberOfTiles = (Integer) varargs[1];\n\t\t}\n\t\t// Obtain a map with the number of tiles per zoom level.\n\t\t// Information is returned as (x, y, n) lists per zoom level, with\n\t\t// x = number of horizontal tiles,\n\t\t// y = number of vertical tiles,\n\t\t// n = total number of tiles at specified zoom level (x * y)\n\t\t// Use min_number_of_tiles argument to specify that you're only interested in\n\t\t// zoom levels that include at least a given number of tiles\n\t\tList<Integer> zoomLevels = new ArrayList<Integer>();\n\t\tIntStream.range(0, getMaxZoomLevel(slideRef, sessionID) + 1).forEach(n -> {\n\t\t\tzoomLevels.add(n);\n\t\t});\n\t\tList<List<Integer>> dimensions = new ArrayList<>();\n\t\tfor (int z : zoomLevels) {\n\t\t\tif (getNumberOfTiles(slideRef, z, sessionID).get(2) > minNumberOfTiles) {\n\t\t\t\tdimensions.add(getNumberOfTiles(slideRef, z, sessionID));\n\t\t\t}\n\t\t}\n\t\tList<Integer> zoomLevelsSubList = (List<Integer>) zoomLevels.subList(zoomLevels.size() - dimensions.size(),\n\t\t\t\tzoomLevels.size());\n\t\tMap<Integer, List<Integer>> d = new HashMap<>();\n\t\tfor (int i = 0; i < zoomLevelsSubList.size() && i < dimensions.size(); i++) {\n\t\t\td.put(zoomLevelsSubList.get(i), dimensions.get(i));\n\t\t}\n\t\treturn d;\n\t}", "private int load(String path)\n {\n int pixels[] = null;\n int width = 0;\n int height = 0;\n\n try\n {\n BufferedImage image = ImageIO.read(new FileInputStream(\"res/\" + path));\n width = image.getWidth();\n height = image.getHeight();\n pixels = new int[width * height];\n image.getRGB(0, 0, width, height, pixels, 0, width);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n\n int[] data = new int[width * height];\n\n for (int i = 0; i < width * height; i++)\n {\n int a = (pixels[i] & 0xff000000) >> 24;\n int r = (pixels[i] & 0xff0000) >> 16;\n int g = (pixels[i] & 0xff00) >> 8;\n int b = (pixels[i] & 0xff);\n\n data[i] = a << 24 | b << 16 | g << 8 | r;\n }\n\n int result = glGenTextures();\n allTextures.add(result);\n\n glBindTexture(GL_TEXTURE_2D, result);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, BufferUtils.createIntBuffer(data));\n glActiveTexture(GL_TEXTURE0);\n glBindTexture(GL_TEXTURE_2D, 0);\n return result;\n }", "Level( int tiles_per_cam_width , int tiles_per_cam_height ) {\r\n\t\ttotal_scroll = 0;\r\n\t\tleft_map_scroll = 0;\r\n\t\tleft_map_width = 20;\r\n\t\tleft_map = 0;\r\n\t\tcollision = new int[2][];\r\n\t\t_load(0,0);\r\n\t\t_load(1,1);\r\n\t\tfor(int i=0; i<2; i++) {\r\n\t\t\tcamera[i]= new OrthographicCamera();\r\n\t\t\tcamera[i].setToOrtho(false, tiles_per_cam_width, \r\n\t\t\t\t\ttiles_per_cam_height ); }\r\n\t}", "public void buildMap(){\n map =mapFactory.createMap(level);\n RefLinks.SetMap(map);\n }", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "List<List<Pixel>> transform(Image img, String operation);", "public Level[] makeLevels() {\n final int nbrLevels = 4;\n Level[] levels = new Level[nbrLevels];\n\n for (int i = 0; i < maps.length; i++) {\n try {\n levels[i] = getMapParser().parseMap(maps[i]);\n } catch (IOException e) {\n throw new PacmanConfigurationException(\n \"Unable to create level, name = \" + getLevelMap(), e);\n }\n }\n\n return levels;\n }", "public native void constituteImage(int width, int height, String map,\n\t\t\tint[] pixels) throws MagickException;", "protected void reduceBitmapMode(BufferedImage img, int xoffs, int yoffs) {\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histograms = new Map[(img.getWidth() + 7) / 8];\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histogramSides = new Map[(img.getWidth() + 7) / 8];\n \t\t\n \t\t// be sure we select the 8 pixel groups sensibly\n \t\tif ((xoffs & 7) > 3)\n \t\t\txoffs = (xoffs + 7) & ~7;\n \t\telse\n \t\t\txoffs = xoffs & ~7;\n \t\t\n \t\tint width = img.getWidth();\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\t// first scan: get histogram for each range\n \t\t\t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = new HashMap<Integer, Integer>();\n \t\t\t\tMap<Integer, Integer> histogramSide = new HashMap<Integer, Integer>();\n \t\t\t\t\n \t\t\t\thistograms[x / 8] = histogram;\n \t\t\t\thistogramSides[x / 8] = histogramSide;\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\tint scmx;\n \t\t\t\tint scmn;\n \t\t\t\t\n \t\t\t\t// scan outside the 8 pixels to get a broader\n \t\t\t\t// idea of what colors are important\n \t\t\t\tscmn = Math.max(0, x - 4);\n \t\t\t\tscmx = Math.min(width, maxx + 4);\n \t\t\t\t\n \t\t\t\tint pixel = 0;\n \t\t\t\tfor (int xd = scmn; xd < scmx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tpixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tMap<Integer, Integer> hist = (xd >= x && xd < maxx) ? histogram : histogramSide;\n \t\t\t\t\t\n \t\t\t\t\tInteger cnt = hist.get(pixel);\n \t\t\t\t\tif (cnt == null)\n \t\t\t\t\t\tcnt = 1;\n \t\t\t\t\telse\n \t\t\t\t\t\tcnt++;\n \t\t\t\t\t\n \t\t\t\t\thist.put(pixel, cnt);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = histograms[x / 8];\n \t\t\t\tMap<Integer, Integer> histogramSide = histogramSides[x / 8];\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\t// get prominent colors, weighing colors that also\n \t\t\t\t// appear in surrounding pixels higher \n \t\t\t\tList<Pair<Integer, Integer>> sorted = new ArrayList<Pair<Integer,Integer>>();\n \t\t\t\tfor (Map.Entry<Integer, Integer> entry : histogram.entrySet()) {\n \t\t\t\t\tInteger c = entry.getKey();\n \t\t\t\t\tint cnt = entry.getValue() * 2;\n \t\t\t\t\tInteger scnt = histogramSide.get(c);\n \t\t\t\t\tif (scnt != null)\n \t\t\t\t\t\tcnt += scnt;\n \t\t\t\t\tsorted.add(new Pair<Integer, Integer>(c, cnt));\n \t\t\t\t}\n \t\t\t\tCollections.sort(sorted, new Comparator<Pair<Integer, Integer>>() {\n \t\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n \t\t\t\t\t\t\tPair<Integer, Integer> o2) {\n \t\t\t\t\t\treturn o2.second - o1.second;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t});\n \t\n \t\t\t\tint fpixel, bpixel;\n \t\t\t\tif (sorted.size() >= 2) {\n \t\t\t\t\tfpixel = sorted.get(0).first;\n \t\t\t\t\tbpixel = sorted.get(1).first;\n \t\t\t\t} else {\n \t\t\t\t\tfpixel = bpixel = sorted.get(0).first;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint newPixel = 0;\n \t\t\t\tfor (int xd = x; xd < maxx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tnewPixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tif (newPixel != fpixel && newPixel != bpixel) {\n \t\t\t\t\t\tif (fpixel < bpixel) {\n \t\t\t\t\t\t\tnewPixel = newPixel <= fpixel ? fpixel : bpixel;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tnewPixel = newPixel < bpixel ? fpixel : bpixel;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\timageData.setPixel(xd + xoffs, y + yoffs, newPixel);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "private boolean importDirectMappedImage(BufferedImage img) {\n \t\tif (format == Format.COLOR256_1x1 || isMono)\n \t\t\treturn false;\n \t\t\n \t\tint numColors = format == Format.COLOR4_1x1 ? 4\n \t\t\t\t: 16;\n \t\t\n \t\t// effective minimum distance for any mode\n \t\tint maxDist = 0xf*0xf * 3;\n \t\tint numPixels = img.getWidth() * img.getHeight();\n \t\t\n \t\tboolean matched = false;\n \t\tHistogram hist = new Histogram(img);\n \t\t\n \t\tList<byte[][]> palettes = new ArrayList<byte[][]>();\n \t\tpalettes.add(thePalette);\n \t\tif (isStandardPalette)\n \t\t\tpalettes.addAll(Arrays.asList(VdpCanvas.palettes()));\n \t\t\n \t\tfor (byte[][] palette : palettes) {\n \t\t\tint matchedC = hist.generate(new FixedPaletteMapColor(palette, firstColor, numColors), maxDist, ~0); \n \t\t\tif (matchedC == numPixels) {\n \t\t\t\tmatched = true;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\t\n \t\tif (matched) {\n \t\t\tfor (int c = 0; c < numColors; c++) {\n \t\t\t\treplaceColor(img, hist, c, rgb8ToPixel(thePalette[c]), Integer.MAX_VALUE);\n \t\t\t}\n \t\t\t\n \t\t\treturn true;\n \t\t}\n \t\t\n \t\treturn false;\n \t}", "public static double[][][] scale(BufferedImage image, int scaledWidth, int scaledHeight) {\n double [][][] m = new double[3][scaledHeight][scaledWidth];\n\n int width = image.getWidth();\n int height = image.getHeight();\n double xScale = width / (double) scaledWidth;\n double yScale = height / (double) scaledHeight;\n\n double yEnd = 0;\n for (int i = 0; i < scaledHeight; i++) {\n\n double yStart = yEnd;\n yEnd = (i + 1) * yScale;\n if (yEnd >= height) {\n yEnd = height - 0.000001;\n }\n double xEnd = 0;\n for (int j = 0; j < scaledWidth; j++) {\n\n double xStart = xEnd;\n xEnd = (j + 1) * xScale;\n if (xEnd >= width) {\n xEnd = width - 0.000001;\n }\n\n double sumL = 0;\n double sumCb = 0;\n double sumCr = 0;\n\n for (int y = (int)yStart; y <= yEnd; y++) {\n double yPortion = 1.0;\n if (y == (int)yStart) {\n yPortion -= yStart - y;\n }\n if (y == (int)yEnd) {\n yPortion -= y + 1 - yEnd;\n }\n\n for (int x = (int)xStart; x <= xEnd; x++) {\n double xPortion = 1.0;\n if (x == (int)xStart) {\n xPortion -= xStart - x;\n }\n if (x == (int)xEnd) {\n xPortion -= x + 1 - xEnd;\n }\n\n Color color = new Color(image.getRGB(x, y));\n int r = color.getRed();\n int g = color.getGreen();\n int b = color.getBlue();\n\n double l = 0.299 * r + 0.587 * g + 0.114 * b;\n double cb = 128 - 0.169 * r - 0.331 * g + 0.500 * b;\n double cr = 128 + 0.500 * r - 0.419 * g - 0.081 * b;\n\n double portionArea = xPortion * yPortion;\n sumL += l * portionArea;\n sumCb += cb * portionArea;\n sumCr += cr * portionArea;\n }\n }\n double invArea = 1.0 / ((xEnd - xStart) * (yEnd - yStart));\n m[0][i][j] = sumL * invArea - 128;\n m[1][i][j] = sumCb * invArea - 128;\n m[2][i][j] = sumCr * invArea - 128;\n }\n }\n\n return m;\n }", "public void createWorldMap() {\r\n\t\tdo {\r\n\t\t\t//\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Recursive map generation method over here@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r\n\t\t\t//Generation loop 1 *ADDS VEIN STARTS AND GRASS*\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif (Math.random()*10000>9999) { //randomly spawn a conore vein start\r\n\t\t\t\t\t\ttileMap[i][j] = new ConoreTile (conore, true);\r\n\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t}else if (Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new KannaiteTile(kanna, true);\r\n\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new FuelTile(fuel, true);\r\n\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999) {\r\n\t\t\t\t\t\ttileMap[i][j] = new ForestTile(forest, true);\r\n\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t}else if(Math.random()*10000>9999){\r\n\t\t\t\t\t\ttileMap[i][j] = new OilTile(oil,true);\r\n\t\t\t\t\t}else if(Math.random()*10000>9997) {\r\n\t\t\t\t\t\ttileMap[i][j] = new MountainTile(mountain, true);\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\ttileMap[i][j] = new GrassTile(dirt);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} // End for loop \r\n\t\t\t} // End for loop\r\n\t\t\t//End generation loop 1\r\n\r\n\t\t\t//Generation loop 2 *EXPANDS ON THE VEINS*\r\n\t\t\tdo {\r\n\t\t\t\tif (conoreCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ConoreTile (conore,true);\r\n\t\t\t\t\tconoreCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tconorePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (kannaiteCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new KannaiteTile (kanna,true);\r\n\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (fuelCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new FuelTile (fuel,true);\r\n\t\t\t\t\tfuelCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (forestCount<6) {\r\n\t\t\t\t\ttileMap[(int)Math.random()*200][(int)Math.random()*200] = new ForestTile (forest,true);\r\n\t\t\t\t\tforestCount++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tforestPass = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 2\r\n\r\n\t\t\t//Generation loop 3 *COUNT ORES*\r\n\t\t\tint loop3Count = 0;\r\n\t\t\tconorePass = false;\r\n\t\t\tkannaitePass = false;\r\n\t\t\tfuelPass = false;\r\n\t\t\tforestPass = false;\r\n\t\t\tdo {\r\n\t\t\t\tconoreCount = 0;\r\n\t\t\t\tkannaiteCount = 0;\r\n\t\t\t\tfuelCount = 0;\r\n\t\t\t\tforestCount = 0;\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (tileMap[i][j] instanceof ConoreTile) {\r\n\t\t\t\t\t\t\tconoreCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof KannaiteTile) {\r\n\t\t\t\t\t\t\tkannaiteCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof FuelTile) {\r\n\t\t\t\t\t\t\tfuelCount++;\r\n\t\t\t\t\t\t}else if(tileMap[i][j] instanceof ForestTile) {\r\n\t\t\t\t\t\t\tforestCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\t\tif (conoreCount < 220) {\r\n\t\t\t\t\t\t\tbuildConore(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tconorePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (kannaiteCount < 220) {\r\n\t\t\t\t\t\t\tbuildKannaite(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tkannaitePass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (fuelCount< 220) {\r\n\t\t\t\t\t\t\tbuildFuel(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tfuelPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (forestCount < 220) {\r\n\t\t\t\t\t\t\tbuildForest(i,j);\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tforestPass = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"Conore: \" + conoreCount + \" - \" + conorePass);\r\n\t\t\t\tSystem.out.println(\"Kannaite: \" + kannaiteCount + \" - \" + kannaitePass);\r\n\t\t\t\tSystem.out.println(\"Fuel: \" + fuelCount + \" - \" + fuelPass);\r\n\t\t\t\tSystem.out.println(\"Forest: \" + forestCount + \" - \" + forestPass);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tloop3Count++;\r\n\t\t\t\tif (loop3Count > 100) {\r\n\t\t\t\t\tSystem.out.println(\"map generation failed! restarting\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}while(!conorePass || !kannaitePass || !fuelPass || !forestPass);\r\n\t\t\t//END OF LOOP 3\r\n\r\n\t\t\t//LOOP 4: THE MOUNTAIN & OIL LOOP\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\t\t\t\t\tbuildMountain(i,j);\r\n\t\t\t\t\tbuildOil(i,j);\r\n\t\t\t\t}\r\n\t\t\t}//End of THE Mountain & OIL LOOP\r\n\r\n\t\t\t//ADD MINIMUM AMOUNT OF ORES\r\n\r\n\t\t\t//Generation Loop 5 *FINAL SETUP*\r\n\t\t\tfor (int i = 0; i < tileMap.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < tileMap[i].length; j++) {\r\n\r\n\t\t\t\t\tif(i == 1 || j == 1 || i == tileMap.length-2 || j == tileMap[i].length-2) {\r\n\t\t\t\t\t\ttileMap[i][j] = new DesertTile(desert);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i == 0 || j == 0 || i == tileMap.length-1 || j == tileMap[i].length-1) {\r\n\t\t\t\t\t\ttileMap[i][j] = new WaterTile(water);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}//End of for loop\r\n\t\t\t}//End of for loop\r\n\t\t\t//End of generation loop 5\r\n\t\t\t//mapToString();//TEST RUN\r\n\t\t} while(!conorePass || !kannaitePass || !fuelPass || !forestPass); // End createWorldMap method\r\n\t}", "public abstract Image gen();", "private void createDepthMap() {\n\t\tdouble depthX = 0.0;\n\t\tdouble depthY = 0.0;\n\t\tdouble[][] depthMap = new double[I1.getRowDimension()][I1.getColumnDimension()];\n\t\tfor (int i=0; i < I1.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < I1.getColumnDimension(); j++) {\n\t\t\t\tif (j == 0) {\n\t\t\t\t\tdepthX += this.Ny.getEntry(i, 0) / -this.Nz.getEntry(i, j) ;\n\t\t\t\t\tdepthY = 0.0;\n\t\t\t\t}\n\t\t\t\tdepthY += this.Nx.getEntry(i, j) / -this.Nz.getEntry(i, j);\n\t\t\t\tdepthMap[i][j] = depthX + depthY ;\n\t\t\t}\n\t\t}\t\n\t\tthis.D = MatrixUtils.createRealMatrix(depthMap);\n\t}", "@DirtiesDatabase\n\t@Test\n\tpublic void testGetImageMapProduct() {\n\t\tProduct product = createProduct();\n\t\t\n\t\tImageMap imageMap = service.getImageMap(product);\n\t\tSet<String> imageKeys = imageMap.getImageKeys();\n\t\tassertEquals(\"There should be 3 image keys\", 3, imageKeys.size());\n\t\tassertEquals(\"There should be 3 keys for English\", 3, imageMap.getImageKeys(Locale.ENGLISH).size());\n\t\tassertEquals(\"There should be 3 keys for English Canadian\", 3, imageMap.getImageKeys(new Locale(\"en\", \"CA\")).size());\n\t\tassertEquals(\"There should be 2 keys for French Canadian\", 2, imageMap.getImageKeys(Locale.CANADA_FRENCH).size());\n\t\tassertEquals(\"There should be 1 key for other languages\", 1, imageMap.getImageKeys(Locale.GERMAN).size());\n\t\t\n\t\tassertTrue(\"There should be images for English\", imageMap.hasImages(Locale.ENGLISH));\n\t\tassertTrue(\"There should be images for French Canadian\", imageMap.hasImages(Locale.CANADA_FRENCH));\n\t\tassertTrue(\"There should be images for even German, since we do have a default image!\", imageMap.hasImages(Locale.GERMAN));\n\t\t\n\t\tassertEquals(\"The image for the thumbnail should point to thumbnail.jpg\", \"thumbnail.jpg\", imageMap.getImagePath(\"thumbnail\", Locale.ENGLISH));\n\n\t\tassertEquals(\"There should be a default image\", \"defaultImage.jpg\", imageMap.getImagePath(\"defaultImage\", Locale.ENGLISH));\n\t\tassertEquals(\"The english image should be found\", \"mainImage.jpg\", imageMap.getImagePath(\"mainImage\", Locale.ENGLISH));\n\t\tassertEquals(\"The more specific image should be found\", \"mainImageCanada.jpg\", imageMap.getImagePath(\"mainImage\", new Locale(\"en\", \"CA\")));\n\t\tassertEquals(\"There should be fallback if an image doesn't exist for a specific locale/country\", \"mainImage.jpg\",\n\t\t\t\timageMap.getImagePath(\"mainImage\", new Locale(\"en\", \"AU\")));\n\t}", "private void loadImages() {\n\t\ttry {\n\t\t\timage = ImageIO.read(Pillar.class.getResource(\"/Items/Pillar.png\"));\n\t\t\tscaledImage = image;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read Pillar image file: \" + e.getMessage());\n\t\t}\n\t}", "public HashMap selectLevel() {\n\n // get database and initialize hashmap\n SQLiteDatabase db = getWritableDatabase();\n HashMap<Integer, ArrayList<Integer>> levelMap = new HashMap<>();\n\n // select levels per multiplication\n for (int i = 0; i < amountMultiplications; i++) {\n\n // get cursor\n Cursor cursor = db.rawQuery(\"SELECT level FROM exercises WHERE multiplicationTable = \"\n + (i + 1), null);\n\n // make list with all levels and add list to hashmap\n ArrayList<Integer> levels = new ArrayList<>();\n try {\n while (cursor.moveToNext()) {\n levels.add(cursor.getInt(0));\n }\n levelMap.put(i + 1, levels);\n } finally {\n cursor.close();\n }\n }\n\n return levelMap;\n }" ]
[ "0.58233744", "0.555582", "0.5543614", "0.546479", "0.52992535", "0.52537316", "0.52510226", "0.5205754", "0.5205447", "0.5200339", "0.5171981", "0.5073422", "0.506367", "0.50588167", "0.4992657", "0.49729383", "0.49683535", "0.49676946", "0.49675956", "0.4924006", "0.48742604", "0.48728055", "0.48625946", "0.48474193", "0.48452055", "0.48442253", "0.48317182", "0.48081714", "0.4774152", "0.47624525", "0.47580907", "0.4732648", "0.47251242", "0.4724902", "0.4723031", "0.4705419", "0.46911126", "0.46832812", "0.46681002", "0.4659583", "0.4639353", "0.46391648", "0.46329278", "0.4630058", "0.462958", "0.4623217", "0.4616454", "0.46087453", "0.4601723", "0.45876777", "0.4587474", "0.45838898", "0.45809314", "0.45783454", "0.45765018", "0.4567385", "0.45607284", "0.4547637", "0.4546258", "0.45260337", "0.45198643", "0.45176792", "0.4514994", "0.45110464", "0.45058584", "0.44887882", "0.44821358", "0.44789636", "0.4471796", "0.44694677", "0.44637504", "0.4463247", "0.4455421", "0.4450584", "0.44390127", "0.4436431", "0.44344413", "0.44215998", "0.44171354", "0.4410679", "0.44027615", "0.44001177", "0.43994474", "0.43971032", "0.43963677", "0.43935424", "0.43930715", "0.4392819", "0.4390288", "0.43860856", "0.43838802", "0.43712837", "0.43673795", "0.43623704", "0.43598616", "0.43585956", "0.4353586", "0.43522903", "0.43518072", "0.43485343" ]
0.74496454
0
Crop an image to area defined by a rectangle Mipmap data will be lost.
public @NotNull Image crop(int x, int y, int width, int height) { if (this.data != null) { validateRect(x, y, width, height); Color.Buffer output = Color.malloc(this.format, width * height); long srcPtr = this.data.address(); long dstPtr = output.address(); long bytesPerLine = Integer.toUnsignedLong(width) * this.format.sizeof; for (int j = 0; j < height; j++) { long src = srcPtr + Integer.toUnsignedLong((j + y) * this.width + x) * this.format.sizeof; long dst = dstPtr + Integer.toUnsignedLong(j * width) * this.format.sizeof; MemoryUtil.memCopy(src, dst, bytesPerLine); } this.data.free(); this.data = output; this.width = width; this.height = height; this.mipmaps = 1; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native MagickImage cropImage(Rectangle chopInfo)\n\t\t\tthrows MagickException;", "public static BufferedImage cropImage(BufferedImage img, Rectangle bounds)\n\t{\n\t\tBufferedImage dest = img.getSubimage(bounds.x, bounds.y, bounds.width, bounds.height);\n\t\treturn dest; \n\t}", "private void cropImage() {\n\t\t// Use existing crop activity.\n\t\tIntent intent = new Intent(\"com.android.camera.action.CROP\");\n\t\tintent.setDataAndType(mImageCaptureUri, IMAGE_UNSPECIFIED);\n\n\t\t// Specify image size\n\t\tintent.putExtra(\"outputX\", 100);\n\t\tintent.putExtra(\"outputY\", 100);\n\n\t\t// Specify aspect ratio, 1:1\n\t\tintent.putExtra(\"aspectX\", 1);\n\t\tintent.putExtra(\"aspectY\", 1);\n\t\tintent.putExtra(\"scale\", true);\n\t\tintent.putExtra(\"return-data\", true);\n\n\t\t// REQUEST_CODE_CROP_PHOTO is an integer tag you defined to\n\t\t// identify the activity in onActivityResult() when it returns\n\t\tstartActivityForResult(intent, REQUEST_CODE_CROP_PHOTO);\n\t}", "public static BufferedImage cropImage(BufferedImage image, int topX,\r\n\t\t\tint topY, int width, int height) {\r\n\t\t// create cropping rectangle\r\n\t\tBufferedImage dest = image.getSubimage(topX, topY, width, height);\r\n\t\t// return cropped image\r\n\t\treturn dest;\r\n\t}", "private Bitmap inMemoryCrop(RotateBitmap rotateBitmap, Bitmap croppedImage, Rect r,\n int width, int height, int outWidth, int outHeight) {\n System.gc();\n\n try {\n croppedImage = Bitmap.createBitmap( outWidth, outHeight, Bitmap.Config.RGB_565 );\n\n Canvas canvas = new Canvas( croppedImage );\n RectF dstRect = new RectF( 0, 0, width, height );\n\n Matrix m = new Matrix();\n m.setRectToRect( new RectF( r ), dstRect, Matrix.ScaleToFit.FILL );\n m.preConcat( rotateBitmap.getRotateMatrix() );\n canvas.drawBitmap( rotateBitmap.getBitmap(), m, null );\n } catch (OutOfMemoryError e) {\n Log.e( \"Error cropping picture: \" + e.getMessage(), e );\n System.gc();\n }\n\n // Release bitmap memory as soon as possible\n clearImageView();\n return croppedImage;\n }", "private void startCropImage() {\n }", "private void performCrop() {\n try {\r\n //call the standard crop action intent (the user device may not support it)\r\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\r\n //indicate image type and Uri\r\n cropIntent.setDataAndType(picUri, \"image/*\");\r\n //set crop properties\r\n cropIntent.putExtra(\"crop\", \"true\");\r\n //indicate aspect of desired crop\r\n// cropIntent.putExtra(\"aspectX\", 1);\r\n// cropIntent.putExtra(\"aspectY\", 1);\r\n //indicate output X and Y\r\n// cropIntent.putExtra(\"outputX\", 256);\r\n// cropIntent.putExtra(\"outputY\", 256);\r\n //retrieve data on return\r\n cropIntent.putExtra(\"return-data\", true);\r\n //start the activity - we handle returning li_history onActivityResult\r\n startActivityForResult(cropIntent, 2);\r\n }\r\n //respond to users whose devices do not support the crop action\r\n catch (ActivityNotFoundException anfe) {\r\n //display an error message\r\n String errorMessage = \"Whoops - your device doesn't support the crop action!\";\r\n Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n }", "private void performCrop(Uri img) {\n try {\r\n //call the standard crop action intent (the user device may not support it)\r\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\r\n //indicate image type and Uri\r\n cropIntent.setDataAndType(img, \"image/*\");\r\n //set crop properties\r\n cropIntent.putExtra(\"crop\", \"true\");\r\n //indicate aspect of desired crop\r\n // cropIntent.putExtra(\"aspectX\", 1);\r\n //cropIntent.putExtra(\"aspectY\", 1);\r\n //indicate output X and Y\r\n // cropIntent.putExtra(\"outputX\", 256);\r\n // cropIntent.putExtra(\"outputY\", 256);\r\n //retrieve data on return\r\n\r\n cropIntent.putExtra(\"return-data\", true);\r\n //start the activity - we handle returning in onActivityResult\r\n startActivityForResult(cropIntent, 2);\r\n }\r\n //respond to users whose devices do not support the crop action\r\n catch (ActivityNotFoundException anfe) {\r\n //display an error message\r\n String errorMessage = \"Whoops - your device doesn't support the crop action!\";\r\n Toast toast = Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT);\r\n toast.show();\r\n }\r\n }", "public void cropMoleculeRecognition(){\n mOpenCameraView.disableView();\n\n Mat transformMat = Imgproc.getPerspectiveTransform(mCaptureAreaAdjusted,new MatOfPoint2f(new Point(0,0),new Point(0,400),new Point(400,400), new Point(400,0)));\n Mat croppedImage = new Mat();\n Imgproc.warpPerspective(mGray, croppedImage, transformMat, new Size(400, 400));\n\n /* cleanup the AR marker */\n int cropout = 240;\n\n croppedImage.submat(0,cropout,0,cropout).setTo(new Scalar(0));\n Core.MinMaxLocResult mmr;\n\n for(int i = 0; i<cropout; i++){\n mmr = Core.minMaxLoc(croppedImage.row(i).colRange(cropout,400));\n Core.add(croppedImage.row(i).colRange(0,cropout),new Scalar(mmr.maxVal/2),croppedImage.row(i).colRange(0,cropout));\n\n mmr = Core.minMaxLoc(croppedImage.col(i).rowRange(cropout, 400));\n Core.add(croppedImage.col(i).rowRange(0, cropout),new Scalar(mmr.maxVal/2),croppedImage.col(i).rowRange(0, cropout));\n }\n\n /*for now, just save the cropedImage*/\n /* in the live version, will need to sort out the ar marker on the top left */\n Imgcodecs.imwrite(getFilesDir().toString().concat(\"/croppedImg.png\"),croppedImage);\n Intent intent = new Intent(this,viewCapture.class);\n intent.putExtra(\"flagCaptureImage\",true);\n startActivity(intent);\n }", "static public Fits do_crop(Fits inFits, int min_x, int min_y, int max_x, int max_y)\n throws FitsException, IOException {\n int x_center = (min_x + max_x) / 2;\n int y_center = (min_y + max_y) / 2;\n int x_size = Math.abs(max_x - min_x);\n int y_size = Math.abs(max_y - min_y);\n\n ImageHDU h = (ImageHDU) inFits.readHDU();\n Header old_header = h.getHeader();\n\n Fits out_fits =\n common_crop(h, old_header, x_center, y_center, x_size, y_size);\n return (out_fits);\n }", "protected void cropImage() {\n if (mOptions.noOutputImage) {\n setResult(null, null, 1);\n } else {\n Uri outputUri = getOutputUri();\n mCropImageView.saveCroppedImageAsync(\n outputUri,\n mOptions.outputCompressFormat,\n mOptions.outputCompressQuality,\n mOptions.outputRequestWidth,\n mOptions.outputRequestHeight,\n mOptions.outputRequestSizeOptions);\n }\n }", "@Method(selector = \"crop:imageData:width:height:x:y:completionBlock:\")\n\tpublic native void crop(String name, NSData imageData, int width, int height, int x, int y, @Block App42ResponseBlock completionBlock);", "public BufferedImage crop(int x, int y, int width, int height){\n return sheet.getSubimage(x, y, width, height);\n }", "public void getCroppedBitmap(final OnResultListener onResultListener) {\n setProgressBarVisibility(VISIBLE);\n AsyncTask.execute(new Runnable() {\n @Override\n public void run() {\n try {\n ContentResolver resolver = getContext().getContentResolver();\n InputStream inputStream = resolver.openInputStream(imageUri);\n Bitmap bitmap = BitmapFactory.decodeStream(inputStream);\n\n //rotate image\n Matrix matrix = new Matrix();\n matrix.postRotate(getOrientation() + getRotation());\n\n bitmap = Bitmap.createBitmap(bitmap, 0, 0,\n bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);\n byte[] bitmapData = outputStream.toByteArray();\n ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bitmapData);\n\n BitmapRegionDecoder decoder = BitmapRegionDecoder.\n newInstance(byteArrayInputStream, false);\n\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inSampleSize = 1;\n options.inJustDecodeBounds = false;\n\n Bitmap croppedBitmap = decoder.decodeRegion(cropRect, options);\n decoder.recycle();\n\n final Result result = new Result(imageUri, croppedBitmap);\n CropImageView.this.post(new Runnable() {\n @Override\n public void run() {\n onResultListener.onResult(result);\n setProgressBarVisibility(GONE);\n }\n });\n } catch (Exception | OutOfMemoryError e) {\n e.printStackTrace();\n CropImageView.this.post(new Runnable() {\n @Override\n public void run() {\n onResultListener.onResult(new Result(getImageUri(), null));\n setProgressBarVisibility(GONE);\n }\n });\n }\n }\n });\n }", "public BufferedImage crop(int row,int col,int width,int height){\n\t\treturn imageSheet.getSubimage((col*32)-32, (row*32)-32, width, height);\n\t}", "@Override\n\tpublic void crop(int x, int y) {\n\n\t\tif (x >= this.frame.length || y >= this.frame[0].length) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint[][] new_frame = new int[x+1][y+1];\n\n\t\tfor (int i = 0; i <=x; i++) {\n\t\t\tfor (int j = 0; j <=y; j++) {\n\n\t\t\t\tif(isInside(this.frame, i,j)) {\n\t\t\t\t\tnew_frame[i][j] = this.frame[i][j];\n\t\t\t\t}\n\n\n\t\t\t}\n\t\t}\n\t\tthis.frame = new_frame;\n\t}", "public BufferedImage crop(int row,int col){\n\t\treturn imageSheet.getSubimage((col*64)-64, (row*64)-64, 64, 64);\n\t}", "private void cropEffect(int x, int y, int width, int height) {\n // int que estigui dins la imatge\n EffectFactory factory = effectContext.getFactory();\n effect = factory.createEffect(EffectFactory.EFFECT_CROP);\n effect.setParameter(\"xorigin\", x);\n effect.setParameter(\"yorigin\", y);\n effect.setParameter(\"width\", width);\n effect.setParameter(\"height\", height);\n effect.apply(textures[0], photoWidth, photoHeight, textures[1]);\n }", "public static BufferedImage autoCrop(BufferedImage source, float threshold) {\n\n int rgb;\n int backlo;\n int backhi;\n int width = source.getWidth();\n int height = source.getHeight();\n int startx = width;\n int starty = height;\n int destx = 0;\n int desty = 0;\n\n rgb = source.getRGB(source.getWidth() - 1, source.getHeight() - 1);\n backlo = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n backlo = (int) (backlo - (backlo * threshold));\n if (backlo < 0) {\n backlo = 0;\n }\n backhi = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n backhi = (int) (backhi + (backhi * threshold));\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n rgb = source.getRGB(x, y);\n int sum = ((rgb >> 16) & 255) + ((rgb >> 8) & 255) + ((rgb) & 255) / 3;\n if (sum < backlo || sum > backhi) {\n if (y < starty) {\n starty = y;\n }\n if (x < startx) {\n startx = x;\n }\n if (y > desty) {\n desty = y;\n }\n if (x > destx) {\n destx = x;\n }\n }\n }\n }\n System.out.println(\"crop: [\"\n + startx + \", \" + starty + \", \"\n + destx + \", \" + desty + \"]\");\n\n BufferedImage result = new BufferedImage(\n destx - startx, desty - starty,\n source.getType());\n result.getGraphics().drawImage(\n Toolkit.getDefaultToolkit().createImage(\n new FilteredImageSource(source.getSource(),\n new CropImageFilter(startx, starty, destx, desty))),\n 0, 0, null);\n return result;\n }", "private Rect cropRegionForZoom(float ratio) {\n int xCenter = mSensorRect.width() / 2;\n int yCenter = mSensorRect.height() / 2;\n int xDelta = (int) (0.5f * mSensorRect.width() / ratio);\n int yDelta = (int) (0.5f * mSensorRect.height() / ratio);\n return new Rect(xCenter - xDelta, yCenter - yDelta, xCenter + xDelta, yCenter + yDelta);\n }", "@Override\n public void onCropWindowChanged() {\n Bitmap cropped = imageView.getCroppedImage();\n BitmapHelper.getInstance().setBitmap(cropped);\n bitmap=cropped;\n\n }", "private void handleCrop(int resultCode, Intent data) {\n if (resultCode == RESULT_OK) {\n Uri uri = Crop.getOutput(data);\n try {\n Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);\n mImageCaptureUri = uri;\n mImageView.setImageBitmap(bitmap);\n } catch (Exception e) {\n Log.d(TAG, e.getMessage());\n }\n\n } else if (resultCode == Crop.RESULT_ERROR) {\n Toast.makeText(this, Crop.getError(data).getMessage(), Toast.LENGTH_SHORT).show();\n }\n }", "public void setCropRect(Rect cropRect) {\n this.cropRect = cropRect;\n //invalidate();\n }", "public interface Listener {\n void onCropImage(Bitmap original, Bitmap croppedBitmap);\n }", "synchronized public boolean crop(List<Layer> range) {\n \t\tHashSet<Long> lids = new HashSet<Long>();\n \t\tfor (Layer l : range) {\n \t\t\tlids.add(l.getId());\n \t\t}\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (!lids.contains(p_layer[i])) {\n \t\t\t\tremovePoint(i);\n \t\t\t\ti--;\n \t\t\t}\n \t\t}\n \t\tcalculateBoundingBox(true);\n \t\treturn true;\n \t}", "public static Bitmap cropImageVer2(Bitmap img, Bitmap templateImage, int width, int height) {\n // Merge two images together.\n int x=5,y=5;\n Bitmap bm = Bitmap.createBitmap(img.getWidth(), img.getHeight(), Bitmap.Config.ARGB_8888);\n Canvas combineImg = new Canvas(bm);\n combineImg.drawBitmap(img, 0f, 0f, null);\n combineImg.drawBitmap(templateImage, 0f, 0f, null);\n \n // Create new blank ARGB bitmap.\n Bitmap finalBm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n \n // Get the coordinates for the middle of bm.\n int hMid = bm.getHeight() / 2;\n int wMid = bm.getWidth() / 2;\n int hfMid = finalBm.getHeight() / 2;\n int wfMid = finalBm.getWidth() / 2;\n\n int y2 = hfMid;\n int x2 = wfMid;\n\n for ( y = hMid; y >= 0; y--) {\n // Check Upper-left section of combineImg.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the left side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n \n // Check upper-right section of combineImage.\n x2 = wfMid;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the right side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n \n // Get out of loop once it hits top most part of the template.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } \n x2 = wfMid;\n y2--;\n }\n\n x2 = wfMid;\n y2 = hfMid;\n for (y = hMid; y <= bm.getHeight(); y++) {\n // Check bottom-left section of combineImage.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the left side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n\n // Check bottom-right section of combineImage.\n x2 = wfMid;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n \n int px = bm.getPixel(x, y);\n // Get out of loop once it hits the right side of the template.\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n \n // Get out of loop once it hits bottom most part of the template.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n break;\n } \n x2 = wfMid;\n y2++;\n }\n \n // Get rid of images that we finished with to save memory.\n img.recycle();\n templateImage.recycle();\n bm.recycle();\n return finalBm;\n }", "public static Bitmap cropImage(Bitmap img, Bitmap templateImage, int width, int height) {\n // Merge two images together.\n \t int x=5;\n\t\tint y=5;\n Bitmap bm = Bitmap.createBitmap(img.getWidth(), img.getHeight(), Bitmap.Config.ARGB_8888);\n Canvas combineImg = new Canvas(bm);\n combineImg.drawBitmap(img, 0f, 0f, null);\n combineImg.drawBitmap(templateImage, 0f, 0f, null);\n \n // Create new blank ARGB bitmap.\n Bitmap finalBm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n \n // Get the coordinates for the middle of combineImg.\n int hMid = bm.getHeight() / 2;\n int wMid = bm.getWidth() / 2;\n int hfMid = finalBm.getHeight() / 2;\n int wfMid = finalBm.getWidth() / 2;\n\n int y2 = hfMid;\n int x2 = wfMid;\n\n for ( y = hMid; y >= 0; y--) {\n boolean template = false;\n // Check Upper-left section of combineImg.\n for ( x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n // Check upper-right section of combineImage.\n x2 = wfMid;\n template = false;\n for ( x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n\n // Once we reach the top-most part on the template line, set pixel value transparent\n // from that point on.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n for (int y3 = y2; y3 >= 0; y3--) {\n for (int x3 = 0; x3 < finalBm.getWidth(); x3++) {\n finalBm.setPixel(x3, y3, Color.TRANSPARENT);\n }\n }\n break;\n }\n\n x2 = wfMid;\n y2--;\n }\n\n x2 = wfMid;\n y2 = hfMid;\n for (y = hMid; y <= bm.getHeight(); y++) {\n boolean template = false;\n // Check bottom-left section of combineImage.\n for (x = wMid; x >= 0; x--) {\n if (x2 < 0) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2--;\n }\n\n // Check bottom-right section of combineImage.\n x2 = wfMid;\n template = false;\n for (x = wMid; x < bm.getWidth(); x++) {\n if (x2 >= finalBm.getWidth()) {\n break;\n }\n\n int px = bm.getPixel(x, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n template = true;\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else if (template) {\n finalBm.setPixel(x2, y2, Color.TRANSPARENT);\n } else {\n finalBm.setPixel(x2, y2, px);\n }\n x2++;\n }\n\n // Once we reach the bottom-most part on the template line, set pixel value transparent\n // from that point on.\n int px = bm.getPixel(wMid, y);\n if (Color.red(px) == 234 && Color.green(px) == 157 && Color.blue(px) == 33) {\n for (int y3 = y2; y3 < finalBm.getHeight(); y3++) {\n for (int x3 = 0; x3 < finalBm.getWidth(); x3++) {\n finalBm.setPixel(x3, y3, Color.TRANSPARENT);\n }\n }\n break;\n }\n\n x2 = wfMid;\n y2++;\n }\n \n // Get rid of images that we finished with to save memory.\n img.recycle();\n templateImage.recycle();\n bm.recycle();\n return finalBm;\n }", "private void cropCurrRect() {\n\t\tRectangle cropRec = currRect.getBounds();\n\t\tBufferedImage img = currImage.getSubimage(cropRec.x, cropRec.y, cropRec.width, cropRec.height);\n\t\tAffineTransform rotAT = AffineTransform.getRotateInstance(-currRect.getTheta(), cropRec.width, cropRec.height);\n\n\t\tBufferedImageOp bio;\n\t\tbio = new AffineTransformOp(rotAT, AffineTransformOp.TYPE_BICUBIC);\n\t\tBufferedImage rotImg = bio.filter(img, null);\n\t\tColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);\n\t\tColorConvertOp op = new ColorConvertOp(cs, null);\n\t\trotImg = op.filter(rotImg, null);\n\t\t\n\t\tocrExtraction(rotImg);\n\t}", "@Method(selector = \"crop:imagePath:width:height:x:ycompletionBlock:\")\n\tpublic native void crop(String name, String imagePath, int width, int height, int x, int y, @Block App42ResponseBlock completionBlock);", "private void onSaveClicked() {\n if (mCropView == null) {\n return;\n }\n\n if (mSaving) return;\n mSaving = true;\n\n Bitmap croppedImage;\n\n // If the output is required to a specific size, create an new image\n // with the cropped image in the center and the extra space filled.\n if (outputX != 0 && outputY != 0 && !scale) {\n // Don't scale the image but instead fill it so it's the\n // required dimension\n croppedImage = Bitmap.createBitmap(outputX, outputY, Bitmap.Config.RGB_565);\n Canvas canvas = new Canvas(croppedImage);\n\n Rect srcRect = mCropView.getCropRect();\n Rect dstRect = new Rect(0, 0, outputX, outputY);\n\n int dx = (srcRect.width() - dstRect.width()) / 2;\n int dy = (srcRect.height() - dstRect.height()) / 2;\n\n // If the srcRect is too big, use the center part of it.\n srcRect.inset(Math.max(0, dx), Math.max(0, dy));\n\n // If the dstRect is too big, use the center part of it.\n dstRect.inset(Math.max(0, -dx), Math.max(0, -dy));\n\n // Draw the cropped bitmap in the center\n canvas.drawBitmap(mBitmap, srcRect, dstRect, null);\n\n // Release bitmap memory as soon as possible\n mImageView.clear();\n mBitmap.recycle();\n } else {\n Rect r = mCropView.getCropRect();\n\n int width = r.width();\n int height = r.height();\n\n // If we are circle cropping, we want alpha channel, which is the\n // third param here.\n croppedImage = Bitmap.createBitmap(width, height,\n circleCrop ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);\n\n Canvas canvas = new Canvas(croppedImage);\n\n if (circleCrop) {\n final int color = 0xffff0000;\n final Paint paint = new Paint();\n final Rect rect = new Rect(0, 0, croppedImage.getWidth(), croppedImage.getHeight());\n final RectF rectF = new RectF(rect);\n\n paint.setAntiAlias(true);\n paint.setDither(true);\n paint.setFilterBitmap(true);\n canvas.drawARGB(0, 0, 0, 0);\n paint.setColor(color);\n canvas.drawOval(rectF, paint);\n\n paint.setColor(Color.BLUE);\n paint.setStyle(Paint.Style.STROKE);\n paint.setStrokeWidth((float) 4);\n paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));\n canvas.drawBitmap(mBitmap, r, rect, paint);\n }\n else {\n Rect dstRect = new Rect(0, 0, width, height);\n canvas.drawBitmap(mBitmap, r, dstRect, null);\n }\n\n // Release bitmap memory as soon as possible\n mImageView.clear();\n mBitmap.recycle();\n\n // If the required dimension is specified, scale the image.\n if (outputX != 0 && outputY != 0 && scale) {\n croppedImage = BitmapUtils.transform(new Matrix(), croppedImage,\n outputX, outputY, scaleUp, BitmapUtils.RECYCLE_INPUT);\n }\n }\n\n mImageView.setImageBitmapResetBase(croppedImage, true);\n mImageView.center(true, true);\n mImageView.getHighlightViews().clear();\n\n // save it to the specified URI.\n final Bitmap b = croppedImage;\n new AsyncTask<Void, Integer, IImage>() {\n ProgressDialog pd;\n\n @Override\n protected void onPreExecute() {\n pd = ProgressDialog.show(CropPhotoActivity.this, null,\n getResources().getString(R.string.saving_image));\n }\n\n @Override\n protected IImage doInBackground(Void[] params) {\n return saveOutput(b);\n }\n\n @Override\n protected void onPostExecute(IImage image) {\n pd.dismiss();\n mImageView.clear();\n b.recycle();\n\n if (image != null) {\n ArrayList<IImage> images = new ArrayList<>();\n images.add(image);\n\n Intent data = new Intent();\n data.putParcelableArrayListExtra(\"data\", images);\n setResult(Activity.RESULT_OK, data);\n finish();\n }\n }\n }.execute();\n }", "public void cropImage() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // 마쉬멜로우 이상 버전일 때\n grantUriPermission(\"com.android.camera\", mImageCaptureUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n Intent intent = new Intent(\"com.android.camera.action.CROP\");\n intent.setDataAndType(mImageCaptureUri, \"image/*\");\n\n List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n grantUriPermission(list.get(0).activityInfo.packageName, mImageCaptureUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n int size = list.size();\n if (size == 0) {\n Toast.makeText(ManualRegistActivity.this, \"취소 되었습니다.\", Toast.LENGTH_SHORT).show();\n return;\n } else {\n Toast.makeText(ManualRegistActivity.this, \"용량이 큰 사진의 경우 시간이 오래 걸릴 수 있습니다.\", Toast.LENGTH_SHORT).show();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n intent.putExtra(\"crop\", \"true\");\n intent.putExtra(\"aspectX\", 1);\n intent.putExtra(\"aspectY\", 1);\n intent.putExtra(\"scale\", true);\n croppedFile = null;\n try {\n croppedFile = createImageFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n File folder = new File(Environment.getExternalStorageDirectory() + \"/BioCube/\");\n File tempFile = new File(folder.toString(), croppedFile.getName());\n\n mCurrentPhotoPath = tempFile.getAbsolutePath();\n mImageCaptureUri = FileProvider.getUriForFile(ManualRegistActivity.this,\n \"com.example.seongjun.biocube.provider\", tempFile);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n\n intent.putExtra(\"return-data\", false);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageCaptureUri);\n intent.putExtra(\"outputFormat\", Bitmap.CompressFormat.JPEG.toString());\n\n Intent i = new Intent(intent);\n ResolveInfo res = list.get(0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n i.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n\n grantUriPermission(res.activityInfo.packageName, mImageCaptureUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n i.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));\n startActivityForResult(i, CROP_FROM_CAMERA);\n }\n }", "public native MagickImage chopImage(Rectangle chopInfo)\n\t\t\tthrows MagickException;", "public boolean isRectangularCrop() {\r\n return isRectangularCrop;\r\n }", "public void setRectangleClip(int x, int y, float width, float height);", "public BufferedImage cropImageSquare( byte[] image ) throws IOException {\n InputStream in = new ByteArrayInputStream( image );\n BufferedImage originalImage = ImageIO.read( in );\n\n // Get image dimensions\n int height = originalImage.getHeight();\n int width = originalImage.getWidth();\n\n // The image is already a square\n if ( height == width ) {\n return originalImage;\n }\n\n // Compute the size of the square\n int squareSize = ( height > width ? width : height );\n\n // Coordinates of the image's middle\n int xc = width / 2;\n int yc = height / 2;\n\n // Crop\n BufferedImage croppedImage = originalImage.getSubimage(\n xc - ( squareSize / 2 ), // x coordinate of the upper-left\n // corner\n yc - ( squareSize / 2 ), // y coordinate of the upper-left\n // corner\n squareSize, // widht\n squareSize // height\n );\n return croppedImage;\n }", "private Rect convertRectToCamera2(Rect crop_rect, Rect rect) {\n double left_f = (rect.left + 1000) / 2000.0;\n double top_f = (rect.top + 1000) / 2000.0;\n double right_f = (rect.right + 1000) / 2000.0;\n double bottom_f = (rect.bottom + 1000) / 2000.0;\n int left = (int) (crop_rect.left + left_f * (crop_rect.width() - 1));\n int right = (int) (crop_rect.left + right_f * (crop_rect.width() - 1));\n int top = (int) (crop_rect.top + top_f * (crop_rect.height() - 1));\n int bottom = (int) (crop_rect.top + bottom_f * (crop_rect.height() - 1));\n left = Math.max(left, crop_rect.left);\n right = Math.max(right, crop_rect.left);\n top = Math.max(top, crop_rect.top);\n bottom = Math.max(bottom, crop_rect.top);\n left = Math.min(left, crop_rect.right);\n right = Math.min(right, crop_rect.right);\n top = Math.min(top, crop_rect.bottom);\n bottom = Math.min(bottom, crop_rect.bottom);\n\n return new Rect(left, top, right, bottom);\n }", "static public Fits do_crop(Fits inFits, int extension,\n int min_x, int min_y, int max_x, int max_y)\n throws FitsException, IOException {\n int x_center = (min_x + max_x) / 2;\n int y_center = (min_y + max_y) / 2;\n int x_size = Math.abs(max_x - min_x);\n int y_size = Math.abs(max_y - min_y);\n\n ImageHDU h = (ImageHDU) inFits.getHDU(extension);\n Header old_header = h.getHeader();\n\n Fits out_fits =\n common_crop(h, old_header, x_center, y_center, x_size, y_size);\n return (out_fits);\n }", "private void onSaveClicked() {\n if (mCrop == null || mIsSaving) {\n return;\n }\n mIsSaving = true;\n Bitmap croppedImage = null;\n Rect r = mCrop.getCropRect();\n int width = r.width();\n int height = r.height();\n\n int outWidth = width, outHeight = height;\n if (mMaxX > 0 && mMaxY > 0 && (width > mMaxX || height > mMaxY)) {\n float ratio = (float) width / (float) height;\n if ((float) mMaxX / (float) mMaxY > ratio) {\n outHeight = mMaxY;\n outWidth = (int) ((float) mMaxY * ratio + .5f);\n } else {\n outWidth = mMaxX;\n outHeight = (int) ((float) mMaxX / ratio + .5f);\n }\n }\n if (IN_MEMORY_CROP && mRotateBitmap != null) {\n croppedImage = inMemoryCrop( mRotateBitmap, croppedImage, r,\n width * sampleSize,\n height * sampleSize,\n outWidth * sampleSize,\n outHeight * sampleSize );\n if (croppedImage != null) {\n mImageView.setImageBitmapResetBase( croppedImage, true );\n mImageView.center( true, true );\n mImageView.mHighlightViews.clear();\n }\n } else {\n try {\n croppedImage = decodeRegionCrop( croppedImage, r );\n } catch (IllegalArgumentException e) {\n setResultException( e );\n finish();\n return;\n }\n\n if (croppedImage != null) {\n mImageView.setImageRotateBitmapResetBase( new RotateBitmap( croppedImage, mExifRotation ), true );\n mImageView.center( true, true );\n mImageView.mHighlightViews.clear();\n }\n }\n if(croppedImage.getWidth() > mMaxX || croppedImage.getHeight() > mMaxY) {\n croppedImage = getResizedBitmap(croppedImage, mMaxX, mMaxY);\n }\n\n saveImage(croppedImage);\n }", "private Rect checkRectBounds(Rect cropRect, boolean resize) {\n Rect image = getImageRect();\n Rect newCropRect = cropRect;\n //check if inside image\n int width = newCropRect.width();\n int height = newCropRect.height();\n\n if (!image.contains(newCropRect)) {\n if (aspectRatio >= 0.0) {\n if (resize) {\n // new cropRect to big => try and fix size\n // check corners\n if (touchedCorner == TOP_LEFT) {\n if (image.left > newCropRect.left) {\n int delta = (int) ((image.left - newCropRect.left) / aspectRatio);\n newCropRect = new Rect(image.left, newCropRect.top + delta,\n newCropRect.right, newCropRect.bottom);\n }\n if (image.top > newCropRect.top) {\n int delta = (int) ((image.top - newCropRect.top) * aspectRatio);\n newCropRect = new Rect(newCropRect.left + delta, image.top,\n newCropRect.right, newCropRect.bottom);\n }\n } else if (touchedCorner == TOP_RIGHT) {\n if (image.right < newCropRect.right) {\n int delta = (int) ((newCropRect.right - image.right) / aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top + delta,\n image.right, newCropRect.bottom);\n }\n if (image.top > newCropRect.top) {\n int delta = (int) ((image.top - newCropRect.top) * aspectRatio);\n newCropRect = new Rect(newCropRect.left, image.top,\n newCropRect.right - delta, newCropRect.bottom);\n }\n } else if (touchedCorner == BOTTOM_RIGHT) {\n if (image.right < newCropRect.right) {\n int delta = (int) ((newCropRect.right - image.right) / aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n image.right, newCropRect.bottom - delta);\n }\n if (image.bottom < newCropRect.bottom) {\n int delta = (int) ((newCropRect.bottom - image.bottom) * aspectRatio);\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.right - delta, image.bottom);\n }\n } else if (touchedCorner == BOTTOM_LEFT) {\n if (image.left > newCropRect.left) {\n int delta = (int) ((image.left - newCropRect.left) / aspectRatio);\n newCropRect = new Rect(image.left, newCropRect.top,\n newCropRect.right, newCropRect.bottom - delta);\n }\n if (image.bottom < newCropRect.bottom) {\n int delta = (int) ((newCropRect.bottom - image.bottom) * aspectRatio);\n newCropRect = new Rect(newCropRect.left + delta, newCropRect.top,\n newCropRect.right, image.bottom);\n }\n }\n } else {\n // check edges\n // left edges\n if (image.left > newCropRect.left) {\n newCropRect = new Rect(image.left, newCropRect.top,\n image.left + width, newCropRect.bottom);\n }\n // top edge\n if (image.top > newCropRect.top) {\n newCropRect = new Rect(newCropRect.left, image.top,\n newCropRect.right, image.top + height);\n }\n // right edge\n if (image.right < newCropRect.right) {\n newCropRect = new Rect(image.right - width, newCropRect.top,\n image.right, newCropRect.bottom);\n }\n // bottom edge\n if (image.bottom < newCropRect.bottom) {\n newCropRect = new Rect(newCropRect.left, image.bottom - height,\n newCropRect.right, image.bottom);\n }\n }\n } else {\n // cropRect not inside => try to fix it\n if (image.left > newCropRect.left) {\n newCropRect = new Rect(image.left, newCropRect.top,\n resize ? newCropRect.right : image.left + width,\n newCropRect.bottom);\n }\n\n if (image.top > newCropRect.top) {\n newCropRect = new Rect(newCropRect.left, image.top, newCropRect.right,\n resize ? newCropRect.bottom : image.top + height);\n }\n\n if (image.right < newCropRect.right) {\n newCropRect = new Rect(resize ? newCropRect.left : image.right - width,\n newCropRect.top, image.right, newCropRect.bottom);\n }\n\n if (image.bottom < newCropRect.bottom) {\n newCropRect = new Rect(newCropRect.left,\n resize ? newCropRect.top : image.bottom - height,\n newCropRect.right, image.bottom);\n }\n }\n }\n\n Rect minRect = getMinCropRect();\n //check min size\n width = newCropRect.width();\n if (width < minRect.width()) {\n if (touchedCorner == TOP_LEFT) {\n newCropRect = new Rect(newCropRect.right - minRect.width(),\n newCropRect.top, newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == TOP_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.left + minRect.width(),\n newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.left + minRect.width(),\n newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_LEFT) {\n newCropRect = new Rect(newCropRect.right - minRect.width(),\n newCropRect.top, newCropRect.right, newCropRect.bottom);\n }\n }\n\n height = newCropRect.height();\n if (height < minRect.height()) {\n if (touchedCorner == TOP_LEFT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.bottom - minRect.height(),\n newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == TOP_RIGHT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.bottom - minRect.height(),\n newCropRect.right, newCropRect.bottom);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n newCropRect = new Rect(newCropRect.left, newCropRect.top,\n newCropRect.right,\n newCropRect.top + minRect.height());\n } else if (touchedCorner == BOTTOM_LEFT) {\n newCropRect = new Rect(newCropRect.left,\n newCropRect.top, newCropRect.right,\n newCropRect.top + minRect.height());\n }\n }\n\n return newCropRect;\n }", "public Rectangle2D getCropRect(ImageComponent ic) {\n switch (state) {\n case INITIAL:\n lastCropRect = null;\n break;\n case USER_DRAG:\n lastCropRect = userDrag.createPositiveRect();\n break;\n case TRANSFORM:\n lastCropRect = transformSupport.getImageSpaceRect(ic);\n break;\n }\n\n return lastCropRect;\n }", "public abstract void clipRect(int x, int y, int width, int height);", "public static BufferedImage cropImage(int x1, int y1, int x2, int y2, BufferedImage src){\n\t\tBufferedImage dest = null;\n\t\t\n\t\tif(x1>x2){\n\t\t\tint tmp = x1;\n\t\t\tx1 = x2;\n\t\t\tx2 = tmp;\n\t\t}\n\t\t\n\t\tif(y1>y2){\n\t\t\tint tmp = y1;\n\t\t\ty1 = y2;\n\t\t\ty2 = tmp;\n\t\t}\n\t\t\n\t\tx1 = Math.max(x1, 0);\n\t\tx2 = Math.min(x2, src.getWidth()-1);\n\t\t\t\t\n\t\ty1 = Math.max(y1, 0);\n\t\ty2 = Math.min(y2, src.getHeight()-1);\n\t\t\n\t\tdest = src.getSubimage(x1, y1, Math.abs(x2 - x1), Math.abs(y2 - y1));\n\n\t\treturn dest;\n\t}", "private Rect getNewRect(float x, float y) {\n PointF currentTouchPos = viewToSourceCoord(x, y);\n\n boolean freeAspectRatio = aspectRatio < 0.0;\n\n if (freeAspectRatio) {\n if (touchedCorner == TOP_LEFT) {\n return checkRectBounds(new Rect((int) currentTouchPos.x, (int) currentTouchPos.y,\n cropRect.right, cropRect.bottom), true);\n } else if (touchedCorner == TOP_RIGHT) {\n return checkRectBounds(new Rect(cropRect.left, (int) currentTouchPos.y,\n (int) currentTouchPos.x, cropRect.bottom), true);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n return checkRectBounds(new Rect(cropRect.left, cropRect.top,\n (int) currentTouchPos.x, (int) currentTouchPos.y), true);\n } else if (touchedCorner == BOTTOM_LEFT) {\n return checkRectBounds(new Rect((int) currentTouchPos.x, cropRect.top,\n cropRect.right, (int) currentTouchPos.y), true);\n }\n } else {\n // fixed aspectRatio\n if (touchedCorner == TOP_LEFT) {\n int delta = (int) Math.max(currentTouchPos.x - cropRect.left,\n currentTouchPos.y - cropRect.top);\n return checkRectBounds(new Rect((int) Math.round(cropRect.left\n + delta * aspectRatio), cropRect.top + delta,\n cropRect.right, cropRect.bottom), true);\n } else if (touchedCorner == TOP_RIGHT) {\n int delta = (int) Math.max(cropRect.right - currentTouchPos.x,\n currentTouchPos.y - cropRect.top);\n return checkRectBounds(new Rect(cropRect.left, cropRect.top + delta,\n (int) Math.round(cropRect.right - delta * aspectRatio),\n cropRect.bottom), true);\n } else if (touchedCorner == BOTTOM_RIGHT) {\n int delta = (int) Math.max(cropRect.right - currentTouchPos.x,\n cropRect.bottom - currentTouchPos.y);\n return checkRectBounds(new Rect(cropRect.left, cropRect.top,\n (int) Math.round(cropRect.right - delta * aspectRatio),\n cropRect.bottom - delta), true);\n } else if (touchedCorner == BOTTOM_LEFT) {\n int delta = (int) Math.max(currentTouchPos.x - cropRect.left,\n cropRect.bottom - currentTouchPos.y);\n return checkRectBounds(new Rect((int) Math.round(cropRect.left\n + delta * aspectRatio), cropRect.top,\n cropRect.right, cropRect.bottom - delta), true);\n }\n }\n\n return null;\n }", "public void cropImage() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n this.grantUriPermission(\"com.android.camera\", photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n Intent intent = new Intent(\"com.android.camera.action.CROP\");\n intent.setDataAndType(photoUri, \"image/*\");\n\n List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n grantUriPermission(list.get(0).activityInfo.packageName, photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n int size = list.size();\n if (size == 0) {\n Toast.makeText(this, \"취소 되었습니다.\", Toast.LENGTH_SHORT).show();\n return;\n } else {\n// Toast.makeText(this, \"용량이 큰 사진의 경우 시간이 오래 걸릴 수 있습니다.\", Toast.LENGTH_SHORT).show();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n intent.putExtra(\"crop\", \"true\");\n// intent.putExtra(\"aspectX\", 3);\n// intent.putExtra(\"aspectY\", 4);\n intent.putExtra(\"scale\", true);\n File croppedFileName = null;\n try {\n croppedFileName = createImageFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n File folder = new File(Environment.getExternalStorageDirectory() + \"/Body_Img/\");\n File tempFile = new File(folder.toString(), croppedFileName.getName());\n\n photoUri = FileProvider.getUriForFile(Body_Img.this,\n \"com.example.a1013c.body_sns.provider\", tempFile);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n }\n\n intent.putExtra(\"return-data\", false);\n intent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);\n intent.putExtra(\"outputFormat\", Bitmap.CompressFormat.JPEG.toString());\n\n Intent i = new Intent(intent);\n ResolveInfo res = list.get(0);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n i.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n i.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n\n grantUriPermission(res.activityInfo.packageName, photoUri,\n Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);\n }\n i.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name));\n startActivityForResult(i, CROP_FROM_CAMERA);\n }\n }", "private void beginCrop(Uri source) {\n Uri destination = Uri.fromFile(new File(getCacheDir(), \"cropped\"));\n Crop.of(source, destination).asSquare().start(this);\n }", "@Override public Bitmap transform(Bitmap source) {\n int width = source.getWidth(); //Width of source\n int height = source.getHeight(); //Height of source\n\n Bitmap result = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n\n Drawable mask = getMaskDrawable(mContext, mMaskId); //Init mask from resources\n\n //Using mask\n Canvas canvas = new Canvas(result);\n mask.setBounds(0, 0, width, height);\n mask.draw(canvas);\n canvas.drawBitmap(source, 0, 0, mMaskingPaint);\n\n source.recycle();\n\n //Return bitmap of cropped image\n return result;\n }", "public ConstRect cropBy(final ConstRect another)\r\n {\r\n // final ConstRect ret = new ConstRect(this);\r\n int xx = x, yy = y, w = width, h = height;\r\n if(x < another.x)\r\n {\r\n xx = another.x;\r\n w = width - (xx - x);// another.x + another.width - xx - 1;\r\n }\r\n else if(x + width > another.x + another.width)\r\n {\r\n w = another.x + another.width - x - 1;\r\n }\r\n if(y < another.y)\r\n {\r\n yy = another.y;\r\n h = height - (yy - y);\r\n }\r\n else if(y + height > another.y + another.height)\r\n {\r\n h = another.y + another.height - y - 1;\r\n }\r\n return new ConstRect(xx, yy, w, h);\r\n }", "private int[][] cropCell(int startY, int startX, int cellSize, int[][] warpedArray)\n {\n int cropBorder = 6;\n int totalCrop = cropBorder * 2;\n\n int[][] result = new int[cellSize - totalCrop][cellSize - totalCrop];\n\n // To keep track of co-ordinates of entire grid, and co-ordinates of the cropped cell.\n int croppedY = 0;\n int croppedX = 0;\n\n for (int y = startY + cropBorder; y < startY + cellSize - cropBorder; y++) {\n for (int x = startX + cropBorder; x < startX + cellSize - cropBorder; x++) {\n result[croppedY][croppedX] = warpedArray[y][x];\n croppedX++;\n }\n croppedX = 0;\n croppedY++;\n }\n\n return result;\n }", "private Rect getMinCropRect() {\n return new Rect(0, 0,\n aspectRatio < 0.0 ? minCropRectSize : (int) (minCropRectSize * aspectRatio),\n minCropRectSize);\n }", "private Rect getMovedRect(MotionEvent motionEvent) {\n if (cropRect == null) {\n return null;\n }\n\n PointF currentTouchPos = viewToSourceCoord(motionEvent.getX(),\n motionEvent.getY());\n\n int historySize = motionEvent.getHistorySize();\n if (historySize > 0) {\n PointF oldTouchPos = viewToSourceCoord(motionEvent.getHistoricalX(0),\n motionEvent.getHistoricalY(0));\n int deltaX = (int) (oldTouchPos.x - currentTouchPos.x);\n int deltaY = (int) (oldTouchPos.y - currentTouchPos.y);\n\n return checkRectBounds(new Rect(\n cropRect.left + deltaX,\n cropRect.top + deltaY,\n cropRect.right + deltaX,\n cropRect.bottom + deltaY), false);\n } else {\n return cropRect;\n }\n }", "private static void copyArea(BufferedImage image, int x, int y, int width, int height, int dx, int dy) {\n/* 158 */ Graphics2D g = (Graphics2D)image.getGraphics();\n/* */ \n/* 160 */ g.drawImage(image.getSubimage(x, y, width, height), x + dx, y + dy, null);\n/* */ }", "public static void performCrop(Activity activity, Uri picUri) {\n try {\n // call the standard crop action intent (the user device may not\n // support it)\n Intent cropIntent = new Intent(\"com.android.camera.action.CROP\");\n // indicate image type and Uri\n cropIntent.setDataAndType(picUri, \"image/*\");\n // set crop properties\n cropIntent.putExtra(\"crop\", \"true\");\n // indicate aspect of desired crop\n cropIntent.putExtra(\"aspectX\", 2);\n cropIntent.putExtra(\"aspectY\", 1);\n // indicate output X and Y\n cropIntent.putExtra(\"outputX\", 256);\n cropIntent.putExtra(\"outputY\", 256);\n // retrieve data on return\n cropIntent.putExtra(\"return-data\", true);\n // start the activity - we handle returning in onActivityResult\n activity.startActivityForResult(cropIntent, CROP_IMAGE);\n }\n // respond to users whose devices do not support the crop action\n catch (ActivityNotFoundException anfe) {\n Toast toast = Toast\n .makeText(activity, \"This device doesn't support the crop action!\", Toast.LENGTH_SHORT);\n toast.show();\n }\n\n }", "static public Fits do_crop(Fits fits, WorldPt wpt, double radius)\n throws FitsException, IOException, ProjectionException {\n ImageHDU h = (ImageHDU) fits.readHDU();\n Header old_header = h.getHeader();\n ImageHeader temp_hdr = new ImageHeader(old_header);\n CoordinateSys in_coordinate_sys = CoordinateSys.makeCoordinateSys(\n temp_hdr.getJsys(), temp_hdr.file_equinox);\n Projection in_proj = temp_hdr.createProjection(in_coordinate_sys);\n ProjectionPt ipt = in_proj.getImageCoords(wpt.getLon(), wpt.getLat());\n double x = ipt.getFsamp();\n double y = ipt.getFline();\n double x_size = 2 * radius / Math.abs(temp_hdr.cdelt1);\n if (SUTDebug.isDebug()) {\n System.out.println(\"x = \" + x + \" y = \" + y + \" x_size = \" + x_size);\n\n }\n Fits out_fits = common_crop(h, old_header,\n (int) x, (int) y, (int) x_size, (int) x_size);\n return (out_fits);\n }", "private BufferedImage getClipImage(final Rectangle effectBounds) {\n if (_clipImage == null\n || _clipImage.getWidth() < effectBounds.width\n || _clipImage.getHeight() < effectBounds.height) {\n /* */\n int w = effectBounds.width;\n int h = effectBounds.height;\n if (_clipImage != null) {\n w = Math.max(_clipImage.getWidth(), w);\n h = Math.max(_clipImage.getHeight(), h);\n }\n _clipImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);\n }\n return _clipImage;\n }", "@Override\n protected void onImageLaidOut() {\n super.onImageLaidOut();\n final Drawable drawable = getDrawable();\n if (drawable == null) {\n return;\n }\n\n float drawableWidth = drawable.getIntrinsicWidth();\n float drawableHeight = drawable.getIntrinsicHeight();\n\n if (mTargetAspectRatio == SOURCE_IMAGE_ASPECT_RATIO) {\n mTargetAspectRatio = drawableWidth / drawableHeight;\n }\n\n int height = (int) (mThisWidth / mTargetAspectRatio);\n if (height > mThisHeight) {\n int width = (int) (mThisHeight * mTargetAspectRatio);\n int halfDiff = (mThisWidth - width) / 2;\n mCropRect.set(halfDiff, 0, width + halfDiff, mThisHeight);\n } else {\n int halfDiff = (mThisHeight - height) / 2;\n mCropRect.set(0, halfDiff, mThisWidth, height + halfDiff);\n }\n\n calculateImageScaleBounds(drawableWidth, drawableHeight);\n setupInitialImagePosition(drawableWidth, drawableHeight);\n\n if (mCropBoundsChangeListener != null) {\n mCropBoundsChangeListener.onCropAspectRatioChanged(mTargetAspectRatio);\n }\n if (mTransformImageListener != null) {\n// mTransformImageListener.onScale(getCurrentScale());\n// mTransformImageListener.onRotate(getCurrentAngle());\n mTransformImageListener.onBrightness(getCurrentBrightness());\n// mTransformImageListener.onContrast(getCurrentContrast());\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t \t\n\t \tclass ToSaveCropped{\n\t \t\t\n\t \t\tfloat x=finalx;\n\t \t\tfloat y=finaly;\n\n\t\t\t\t\tprivate byte[] data = MainActivity.getbitmapData();\n\t\t\t Bitmap mImage = BitmapFactory.decodeByteArray(data, 0, data.length);\n\t\t\t \n\t\t\t Drawable myMask = getResources().getDrawable(R.drawable.mask);\n\t\t\t Bitmap mMask = ((BitmapDrawable) myMask).getBitmap();\n\t\t\t Bitmap mmImage = dv.bitmapRotate(mImage);\n\t\t\t \n\t\t\t Bitmap mmmImage = dv.getResizedBitmap(mmImage,height,width);\n\t\t\t \n\t\t\t Bitmap mmMask = dv.getResizedBitmap(mMask,wMask,wMask);\n\t\t\t\t\t\n\t\t\t\t\tpublic void onDraw(){\n\t\t\t\t\t\tCanvas canvas; \t\t\t\n\t \t\t\tint w = mmMask.getWidth(), h = mmMask.getHeight();\n\t \t\t\tBitmap.Config conf = Bitmap.Config.ARGB_8888; // see other conf types\n\t \t\t\tcroppedBitmap = Bitmap.createBitmap(w, h, conf); // this creates a MUTABLE bitmap\n\t \t\t\tcanvas = new Canvas(croppedBitmap);\n\t \t\t\t\n\t \t\t\tPaint maskPaint = new Paint();\n\t \t\t\tmaskPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));\n\n\t Paint imagePaint = new Paint();\n\t imagePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OVER));\n\t \t\t\t//Log.i(\"\"+x,\"\"+y);\n\t \t//canvas.drawBitmap(mMask,x,y,maskPaint);\n\t \tcanvas.drawBitmap(mmmImage,-x,-y,imagePaint);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t \t}\t \t\n\t \tToSaveCropped tsc = new ToSaveCropped();\n\t \ttsc.onDraw();\n\t \tByteArrayOutputStream stream = new ByteArrayOutputStream();\n\t \tcroppedBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);\n\t \tbitData = stream.toByteArray();\n\t\t\t\t\n\t\t\t\tSaveFile sv = new SaveFile();\n\t\t\t\tsv.save();\n\t\t\t\t\n\t\t\t\tMediaStore.Images.Media.insertImage(getContentResolver(), croppedBitmap, \"\", \"\");\n\t\t\t\t\n\t\t\t}", "@VisibleForTesting\n Rect calculateSnapshotCrop() {\n final Rect rect = new Rect();\n final HardwareBuffer snapshot = mSnapshot.getHardwareBuffer();\n rect.set(0, 0, snapshot.getWidth(), snapshot.getHeight());\n final Rect insets = mSnapshot.getContentInsets();\n\n final float scaleX = (float) snapshot.getWidth() / mSnapshot.getTaskSize().x;\n final float scaleY = (float) snapshot.getHeight() / mSnapshot.getTaskSize().y;\n\n // Let's remove all system decorations except the status bar, but only if the task is at the\n // very top of the screen.\n final boolean isTop = mTaskBounds.top == 0 && mFrame.top == 0;\n rect.inset((int) (insets.left * scaleX),\n isTop ? 0 : (int) (insets.top * scaleY),\n (int) (insets.right * scaleX),\n (int) (insets.bottom * scaleY));\n return rect;\n }", "private void beginCrop(Uri source) {\n // pass URI as intent to the CROP Activity;\n if (mPhotoFile != null) {\n Uri destination = FileProvider.getUriForFile(this,\n BuildConfig.APPLICATION_ID,\n mPhotoFile);\n Log.d(TAG, \"URI: \" + destination.toString());\n Crop.of(source, destination).asSquare().start(this);\n }\n }", "protected abstract void clipRect(final float x, final float y,\n final float width, final float height);", "@Generated\n @Selector(\"setCropRectangle:atTime:\")\n public native void setCropRectangleAtTime(@ByValue CGRect cropRectangle, @ByValue CMTime time);", "public void clipRect(int sx, int sy, int i, int j) {\n\t\t\n\t}", "public static Bitmap getCroppedBitmap(Bitmap bitmap) {\n Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),\n bitmap.getHeight(), Config.ARGB_8888);\n\n final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());\n\n Canvas canvas = new Canvas(output);\n\n final Paint paint = new Paint();\n paint.setAntiAlias(true);\n\n int halfWidth = bitmap.getWidth() / 2;\n int halfHeight = bitmap.getHeight() / 2;\n\n canvas.drawCircle(halfWidth, halfHeight,\n Math.max(halfWidth, halfHeight), paint);\n paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));\n canvas.drawBitmap(bitmap, rect, rect, paint);\n return output;\n }", "public static ImageData removeBorder(ImageData imageData) {\r\n\t\t\r\n\t\tfinal int imageWidth = imageData.getImageProcessor().getWidth()-2*Hyperparameter.MASK_SIZE;\r\n\t\tfinal int imageHeight = imageData.getImageProcessor().getHeight()-2*Hyperparameter.MASK_SIZE;\r\n\t\t\r\n\t\tImageData image = imageData.duplicate();\r\n\t\timage.getImageProcessor().setRoi(Hyperparameter.MASK_SIZE, Hyperparameter.MASK_SIZE, imageWidth, imageHeight);\r\n\t\timageData = new ImageData(image.getImageProcessor().crop(), image.getLabel());\r\n\t\t\r\n\t\treturn imageData;\t\t\r\n\t}", "public void handle(ActionEvent e) {\n Bounds selectionBounds = rubberBandSelection.getBounds();\n\n // show bounds info\n System.out.println( \"Selected area: \" + selectionBounds);\n\n // crop the image\n crop( selectionBounds);\n\n }", "public void clipRect(int x, int y, int width, int height)\r\n\t{\r\n\t\t// System.err.println(\"clipRect\");\r\n\t}", "private javaxt.io.Image _transform_simple(javaxt.io.Image src_img, \n double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n double[] src_quad = new double[]{0, 0, src_img.getWidth(), src_img.getHeight()};\n SRS.transf to_src_px =SRS.make_lin_transf(src_bbox, src_quad);\n\n //minx, miny = to_src_px((dst_bbox[0], dst_bbox[3]));\n double[] min = to_src_px.transf(dst_bbox[0], dst_bbox[3]);\n double minx = min[0];\n double miny = min[1];\n\n //maxx, maxy = to_src_px((dst_bbox[2], dst_bbox[1]));\n double[] max = to_src_px.transf(dst_bbox[2], dst_bbox[1]);\n double maxx = max[0];\n double maxy = max[1];\n\n double src_res = (src_bbox[0]-src_bbox[2])/src_img.getWidth();\n double dst_res = (dst_bbox[0]-dst_bbox[2])/dst_size[0];\n\n double tenth_px_res = Math.abs(dst_res/(dst_size[0]*10));\n javaxt.io.Image img = new javaxt.io.Image(src_img.getBufferedImage());\n if (Math.abs(src_res-dst_res) < tenth_px_res){\n img.crop(cint(minx), cint(miny), dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(minx)+dst_size[0], cint(miny)+dst_size[1]);\n return img; //src_img;\n }\n else{\n img.crop(cint(minx), cint(miny), cint(maxx)-cint(minx), cint(maxy)-cint(miny));\n img.resize(dst_size[0], dst_size[1]);\n //src_img.crop(cint(minx), cint(miny), cint(maxx), cint(maxy));\n //src_img.resize(dst_size[0], dst_size[1]);\n return img; //src_img;\n }\n //ImageSource(result, size=dst_size, transparent=src_img.transparent)\n }", "public JDialogCropBoundaryParam() { }", "public BufferedImage trim(BufferedImage img) {\n\t\t// point zero is upper left corner\n\t\tint xMin = getXmin(img); // the left border of the symbol\n\t\tint xMax = getXmax(img); // the right border of the symbol\n\t\tint yMin = getYmin(img); // the upper border of the symbol\n\t\tint yMax = getYmax(img); // the lower border of the symbol\n\n\t\tBufferedImage newImg = new BufferedImage(xMax - xMin + 10, yMax - yMin + 10, BufferedImage.TYPE_INT_RGB);\n\t\tGraphics g = newImg.createGraphics();\n\t\tg.drawImage(img, -xMin + 5, -yMin + 5, null);\n\t\timg = newImg;\n\t\treturn img;\n\t}", "public void transform(View view) {\n DrawRect.getCoord(1);\n\n // block to get coord os ROI\n ArrayList<Integer> full_x_ROIcoord = new ArrayList<>();\n ArrayList<Integer> full_y_ROIcoord = new ArrayList<>();\n\n if (xRed < 0 || xRed > 750 || yRed < 0 || yRed > 1000 ||\n xOrg < 0 || xOrg > 750 || yOrg < 0 || yOrg > 1000 ||\n xYell < 0 || xYell > 750 || yYell < 0 || yYell > 1000 ||\n xGreen < 0 || xGreen > 750 || yGreen < 0 || yGreen > 1000) {\n return;\n } else {\n // clear situation with x<= xYell\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n full_x_ROIcoord.add(x);\n full_y_ROIcoord.add(y);\n }\n }\n }\n // end block\n\n // block get contour via CannyFilter\n Mat sMat = oImage.submat(yRed, yGreen, xRed, xOrg);\n Imgproc.Canny(sMat, sMat, 25, 100 * 2);\n ArrayList<Double> subMatValue = new ArrayList<>();\n\n for (int x = 0; x < sMat.cols(); x++) {\n for (int y = 0; y < sMat.rows(); y++) {\n double[] ft2 = sMat.get(y, x);\n subMatValue.add(ft2[0]);\n }\n }\n int count = 0;\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n oImage.put(y, x, subMatValue.get(count));\n count++;\n }\n }\n // end block\n\n displayImage(oImage);\n }", "@Test\n\t\tpublic void testExtractBounds() {\n\t\t\tPixel [][] parray = new Pixel[5][5];\n\t\t\tfor(int x = 0; x<5;x++) {\n\t\t\t\tfor(int y = 0; y<5; y++) {\n\t\t\t\t\tparray[x][y] = new ColorPixel(0, 1, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tPicture picture = new MutablePixelArrayPicture(parray, \"Caption\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tPicture pextract = picture.extract(6, 2, 2, 2);\n\t\t\t\tfail(\"X value is not in picture\");\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPicture pextract = picture.extract(2, 6, 2, 2);\n\t\t\t\tfail(\"Y value is not in picture\");\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPicture pextract = picture.extract(2, 2, -1, 3);\n\t\t\t\tfail(\"Width cannot be negative\");\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tPicture pextract = picture.extract(2, 2, 2, -1);\n\t\t\t\tfail(\"Height cannot be negative\");\n\t\t\t} catch(IllegalArgumentException e) {\n\t\t\t}\n\t\t}", "@Override\n\t protected int getCropItem()\n\t {\n\t\t return cropID;\n\t }", "@Source(\"gr/grnet/pithos/resources/editcut.png\")\n ImageResource cut();", "public static Image cropToContent(final Image img, final Color contentColor) {\n\t\tfinal OptionalInt potentialStartY = getFirstSliceWithColor(img, contentColor, 0, Direction.POSITIVE_Y);\n\t\tif (!potentialStartY.isPresent()) {\n\t\t\treturn img;\n\t\t}\n\t\tfinal int startY = potentialStartY.getAsInt();\n\t\tfinal int startX = getFirstSliceWithColor(img, contentColor, 0, Direction.POSITIVE_X).getAsInt();\n\n\t\tfinal int endY = getFirstSliceWithColor(img, contentColor, (int) img.getHeight() - 1, Direction.NEGATIVE_Y).getAsInt();\n\t\tfinal int endX = getFirstSliceWithColor(img, contentColor, (int) img.getWidth() - 1, Direction.NEGATIVE_X).getAsInt();\n\n\t\treturn crop(img, startX, startY, endX - startX, endY - startY);\n\t}", "public void drawCropRect(Graphics g, int endX, int endY)\n\t{\n\t\tint leftX, upperY;\n\t\tif(startX < endX)\n\t\t\tleftX = startX;\n\t\telse\n\t\t\tleftX = endX;\n\t\tif(startY < endY)\n\t\t\tupperY = startY;\n\t\telse\n\t\t\tupperY = endY;\n\n\t\tg.setColor(Color.GREEN);\n\t\tg.drawRect(leftX, upperY, Math.abs(endX - startX), Math.abs(endY - startY));\n\t}", "public void savePicture() {\n\t\tLog.d(TAG, \"savePicture\");\n\t\t\n\t\tFile cropFile = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getPath() + \"/Lente/crop.jpg\");\n\t\tmCropView.setDrawingCacheEnabled(true);\n\t\tBitmap bm = Bitmap.createBitmap(mCropView.getDrawingCache());\n\t\tmCropView.setDrawingCacheEnabled(false);\n\t\t\n\t\ttry {\n\t\t FileOutputStream outputStream = new FileOutputStream(cropFile);\n\t\t Log.d(TAG, \"Compressing and saving...\");\n\t\t bm.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);\n\t\t outputStream.flush();\n\t\t outputStream.close();\n\t\t \n\t\t MediaScannerConnection.scanFile(getBaseContext(),\n\t new String[] { cropFile.toString() }, null,\n\t new MediaScannerConnection.OnScanCompletedListener() {\n\t public void onScanCompleted(String path, Uri uri) {\n\t Log.i(\"ExternalStorage\", \"Scanned \" + path + \":\");\n\t Log.i(\"ExternalStorage\", \"-> uri=\" + uri);\n\t //passUri(uri); //Pass the URI once obtained and move onto OCRopus\n\t }\n\t\t\t});\n\t }\n\t\t\n\t\tcatch (IOException e) {\n\t\t\tToast.makeText(ImageTextSelect.this, \"Failed to save selected image area.\", 2000).show();\n\t\t\tLog.e(TAG, \"IO Exception\");\n\t\t}\n\t}", "private List<Bitmap> cutImage(Bitmap picture) {\n List<Bitmap> newPieces = new ArrayList<Bitmap>();\n int w = picture.getWidth();\n int h = picture.getHeight();\n int boxWidth = w / Board.NUM_COLS;\n int boxHeight = h / Board.NUM_ROWS;\n for (int i = 0; i < Board.NUM_ROWS; i++) {\n for (int j = 0; j < Board.NUM_ROWS; j++) {\n Bitmap pictureFragment = Bitmap.createBitmap(picture, j * boxWidth, i * boxHeight, boxWidth, boxHeight);\n newPieces.add(pictureFragment);\n }\n }\n return newPieces;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK)\n {\n //------------Received image from camera in device serial number------------------------\n if (requestCode == CAMERA_DEVICE_SERIAL_NUMBER)\n {\n Uri picUri = pictureUri;\n startCropImageActivity(picUri, CROP_CAMERA_SERIAL_NUMBER);\n Toast.makeText(UserAreaActivity.this, \"Serial Number Image Saved!\", Toast.LENGTH_SHORT).show();\n }\n\n //---------------Cropped image from camera in device serial number----------------------\n if (requestCode == CROP_CAMERA_SERIAL_NUMBER)\n {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n Croppedimage(result, ivDeviceSerialNumber, etDeviceSerialNumber);\n }\n\n //------------Received image from gallery in device serial number-----------------------\n if (requestCode == GALLERY_DEVICE_SERIAL_NUMBER)\n {\n startCropImageActivity(data.getData(), CROP_GALLERY_SERIAL_NUMBER);\n Toast.makeText(UserAreaActivity.this, \"Image from gallery\", Toast.LENGTH_SHORT).show();\n }\n\n //--------------Cropped image from gallery in device serial number----------------------\n if(requestCode == CROP_GALLERY_SERIAL_NUMBER)\n {\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n Croppedimage(result, ivDeviceSerialNumber, etDeviceSerialNumber);\n }\n\n }\n\n }", "public void onPagesCropped() {\n/* 560 */ if (!this.mPdfViewCtrl.isUndoRedoEnabled()) {\n/* */ return;\n/* */ }\n/* */ \n/* */ try {\n/* 565 */ JSONObject jsonObj = new JSONObject();\n/* 566 */ if (this.mContext != null) {\n/* 567 */ String strCropPages = this.mContext.getResources().getString(R.string.pref_viewmode_user_crop);\n/* 568 */ jsonObj.put(\"Action\", strCropPages);\n/* */ } \n/* 570 */ jsonObj.put(\"Action event\", \"crop_pages\");\n/* */ \n/* 572 */ if (Utils.isNullOrEmpty(jsonObj.toString())) {\n/* 573 */ AnalyticsHandlerAdapter.getInstance().sendException(new Exception(\"takeUndoSnapshot with an empty string\"));\n/* */ }\n/* */ \n/* 576 */ takeUndoSnapshot(jsonObj.toString());\n/* 577 */ if (sDebug)\n/* 578 */ Log.d(TAG, \"snapshot: \" + jsonObj.toString()); \n/* 579 */ } catch (Exception e) {\n/* 580 */ AnalyticsHandlerAdapter.getInstance().sendException(e);\n/* */ } \n/* */ }", "boolean removeObject(RectangleLatLng rectangle, String id);", "public static BufferedImage[] cutMapaImage(String name, int X, int Y) {\n BufferedImage[] sprites = null;\n try {\n BufferedImage imagen = ImageIO.read(new File(CanvasMap.class.getClassLoader().getResource(name).getFile()));\n final int filas = imagen.getHeight() / X;\n final int columnas = imagen.getWidth() / Y;\n sprites = new BufferedImage[filas * columnas];\n\n for (int i = 0; i < filas; i++) {\n for (int j = 0; j < columnas; j++) {\n sprites[(i * columnas) + j] = imagen.getSubimage(j * X, i * Y, X, Y);\n Image img = sprites[(i * columnas) + j].getScaledInstance(tamX, tamY, BufferedImage.SCALE_DEFAULT);\n sprites[(i * columnas) + j] = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n Graphics2D g = (Graphics2D) sprites[(i * columnas) + j].getGraphics();\n g.drawImage(img, 0, 0, null);\n }\n }\n } catch (IOException ex) {\n Logger.getLogger(CanvasMap.class.getName()).log(Level.SEVERE, null, ex);\n }\n return sprites;\n }", "public void setRoundedRectangleClip(int x, int y, int width, int height, int radius);", "public void i() {\n float f2;\n float f3 = 0.0f;\n RectF b2 = b(getDisplayMatrix());\n q.a(this.e, \"checkMatrixBounds cur rect: \" + b2.toString() + \" width: \" + b2.width() + \" height: \" + b2.height());\n if (b2 != null && getDrawable() != null) {\n float height = b2.height();\n float width = b2.width();\n int i2 = this.j;\n if (height <= ((float) i2)) {\n q.a(this.e, \"+1111111111111+: height<=cropperHeight\");\n switch (n.a[this.L.ordinal()]) {\n case 1:\n f2 = -b2.top;\n break;\n case 2:\n f2 = (((float) i2) - height) - b2.top;\n break;\n default:\n f2 = (((((float) i2) - height) / 2.0f) - b2.top) + ((float) getTopBottomGap());\n break;\n }\n } else if (b2.top > ((float) getTopBottomGap())) {\n f2 = (-b2.top) + ((float) getTopBottomGap());\n q.a(this.e, \"+2222222222222+: \" + b2.top + \" \" + getTopBottomGap());\n } else if (b2.bottom < ((float) (getTopBottomGap() + i2))) {\n f2 = ((float) (getTopBottomGap() + i2)) - b2.bottom;\n q.a(this.e, \"+333333333333333+: \" + i2 + \" \" + getTopBottomGap() + \" \" + b2.bottom);\n } else {\n f2 = 0.0f;\n }\n int i3 = this.i;\n if (width <= ((float) i3)) {\n switch (n.a[this.L.ordinal()]) {\n case 1:\n f3 = -b2.left;\n break;\n case 2:\n f3 = (((float) i3) - width) - b2.left;\n break;\n default:\n f3 = (((((float) i3) - width) / 2.0f) - b2.left) + ((float) getLeftRightGap());\n break;\n }\n } else if (b2.left > ((float) getLeftRightGap())) {\n f3 = (-b2.left) + ((float) getLeftRightGap());\n } else if (b2.right < ((float) (getLeftRightGap() + i3))) {\n f3 = ((float) (getLeftRightGap() + i3)) - b2.right;\n }\n q.a(this.e, \"correct: \" + f3 + Token.SEPARATOR + f2);\n this.x.postTranslate(f3, f2);\n }\n }", "private int getTouchedCorner(MotionEvent motionEvent) {\n PointF currentTouchPos = new PointF(motionEvent.getX(), motionEvent.getY());\n if (cropRect == null) {\n return NO_CORNER;\n }\n PointF topLeft = sourceToViewCoord(cropRect.left, cropRect.top);\n PointF bottomRight = sourceToViewCoord(cropRect.right, cropRect.bottom);\n Rect cropRect = new Rect((int) topLeft.x, (int) topLeft.y,\n (int) bottomRight.x, (int) bottomRight.y);\n\n if (currentTouchPos.x > cropRect.left - touchDelta\n && currentTouchPos.x < cropRect.left + touchDelta\n && currentTouchPos.y > cropRect.top - touchDelta\n && currentTouchPos.y < cropRect.top + touchDelta) {\n return TOP_LEFT;\n }\n\n if (currentTouchPos.x > cropRect.right - touchDelta\n && currentTouchPos.x < cropRect.right + touchDelta\n && currentTouchPos.y > cropRect.top - touchDelta\n && currentTouchPos.y < cropRect.top + touchDelta) {\n return TOP_RIGHT;\n }\n\n if (currentTouchPos.x > cropRect.right - touchDelta\n && currentTouchPos.x < cropRect.right + touchDelta\n && currentTouchPos.y > cropRect.bottom - touchDelta\n && currentTouchPos.y < cropRect.bottom + touchDelta) {\n return BOTTOM_RIGHT;\n }\n\n if (currentTouchPos.x > cropRect.left - touchDelta\n && currentTouchPos.x < cropRect.left + touchDelta\n && currentTouchPos.y > cropRect.bottom - touchDelta\n && currentTouchPos.y < cropRect.bottom + touchDelta) {\n return BOTTOM_LEFT;\n }\n\n return NO_CORNER;\n }", "@Override\n public void dataLoaded(Bitmap bitmap) {\n ivCrop.setImageToCrop(bitmap);\n Bitmap bm = null;\n if (ivCrop.canRightCrop()) bm = ivCrop.crop();\n if (bm != null) ivShow.setImageBitmap(bm);\n }", "@NonNull\n private Size applyCropRegionCoordinates(@NonNull Size referenceSize,\n @NonNull PointF referencePoint) {\n Rect cropRect = builder.get(CaptureRequest.SCALER_CROP_REGION);\n // For now we don't care about x and y position. Rect should not be null, but let's be safe.\n int cropRectWidth = cropRect == null ? referenceSize.getWidth() : cropRect.width();\n int cropRectHeight = cropRect == null ? referenceSize.getHeight() : cropRect.height();\n // The stream is always centered inside the crop region, and one of the dimensions\n // should always match. We just increase the other one.\n referencePoint.x += (cropRectWidth - referenceSize.getWidth()) / 2F;\n referencePoint.y += (cropRectHeight - referenceSize.getHeight()) / 2F;\n return new Size(cropRectWidth, cropRectHeight);\n }", "public int getCropType() {\n\n return cropType;\n }", "public native MagickImage trimImage() throws MagickException;", "@Override\n public void setIndividualWallpaper(final WallpaperInfo wallpaper, Asset asset,\n @Nullable Rect cropRect, float scale, @Destination final int destination,\n final SetWallpaperCallback callback) {\n if (cropRect == null && asset instanceof StreamableAsset) {\n ((StreamableAsset) asset).fetchInputStream(new StreamReceiver() {\n @Override\n public void onInputStreamOpened(@Nullable InputStream inputStream) {\n if (inputStream == null) {\n callback.onError(null /* throwable */);\n return;\n }\n setIndividualWallpaper(wallpaper, inputStream, destination, callback);\n }\n });\n return;\n }\n\n // If no crop rect is specified but the wallpaper asset is not streamable, then fall back to\n // using the device's display size.\n if (cropRect == null) {\n Display display = ((WindowManager) mAppContext.getSystemService(Context.WINDOW_SERVICE))\n .getDefaultDisplay();\n Point screenSize = ScreenSizeCalculator.getInstance().getScreenSize(display);\n asset.decodeBitmap(screenSize.x, screenSize.y, new BitmapReceiver() {\n @Override\n public void onBitmapDecoded(@Nullable Bitmap bitmap) {\n if (bitmap == null) {\n callback.onError(null /* throwable */);\n return;\n }\n setIndividualWallpaper(wallpaper, bitmap, destination, callback);\n }\n });\n return;\n }\n\n BitmapCropper bitmapCropper = InjectorProvider.getInjector().getBitmapCropper();\n bitmapCropper.cropAndScaleBitmap(asset, scale, cropRect, new Callback() {\n @Override\n public void onBitmapCropped(Bitmap croppedBitmap) {\n setIndividualWallpaper(wallpaper, croppedBitmap, destination, callback);\n }\n\n @Override\n public void onError(@Nullable Throwable e) {\n callback.onError(e);\n }\n });\n }", "public void setCropType(int cropType) {\n\n this.cropType = cropType;\n }", "@Override\n public void clip() {\n graphicsEnvironmentImpl.clip(canvas);\n }", "public void clipRect(Rect mClipBounds) {\n\t\t\n\t}", "private void manageCrops() {\r\n// System.out.println(\"\\nThis is manage the crops option\");\r\n CropView.runCropsView();\r\n }", "private Rect getMaxCenteredCropRect() {\n if (!isImageLoaded()) {\n return null;\n }\n if (aspectRatio < 0.0) {\n return getImageRect();\n } else {\n Rect imageRect = getImageRect();\n int imageHeight = imageRect.bottom - imageRect.top,\n imageWidth = imageRect.right - imageRect.left;\n if (imageHeight * aspectRatio <= imageWidth) {\n int padding = (int) ((imageWidth - (imageHeight * aspectRatio)) / 2);\n return new Rect(padding,\n 0,\n (int) ((imageHeight * aspectRatio) + padding),\n imageHeight);\n } else {\n int padding = (int) ((imageHeight - (imageWidth / aspectRatio)) / 2);\n return new Rect(0,\n padding,\n imageWidth,\n (int) ((imageWidth / aspectRatio) + padding));\n }\n }\n }", "interface Clipping {\n /**\n * Sets the clip's bounding rectangle into the provided argument and\n * returns it for convenince.\n * \n * @param rect\n * the rect\n * @return the given rect\n * @since 3.1\n */\n Rectangle getBoundingBox(Rectangle rect);\n\n Clipping getCopy();\n\n void intersect(int left, int top, int right, int bottom);\n\n void scale(float horizontal, float vertical);\n\n void setOn(GC gc, int translateX, int translateY);\n\n void translate(float dx, float dy);\n }", "BufferedImage getSubimage(BufferedImage image, Rectangle rect) {\n Gui.iconPosX = rect.x;\n Gui.iconPosY = rect.y;\n\n Gui.imageWidth = image.getWidth();\n Gui.imageHeight = image.getHeight();\n\n Gui.iconHeight = rect.height;\n Gui.iconWidth = rect.width;\n\n int height = Gui.iconHeight + Gui.iconMargin * 2;\n int width = Gui.iconWidth + Gui.iconMargin * 2;\n\n while (width + Gui.iconPosX > image.getWidth() + 1) {\n width -= 1;\n }\n\n while (height + Gui.iconPosY > image.getHeight() + 1) {\n height -= 1;\n }\n\n BufferedImage subImage = image.getSubimage(Math.max(0, Math.min(Gui.imageWidth - 1, Gui.iconPosX - Gui.iconMargin)),\n Math.max(0, Math.min(Gui.imageHeight - 1, Gui.iconPosY - Gui.iconMargin)),\n width,\n height\n );\n\n return subImage;\n }", "public static BufferedImage trimEdges(GameImage gameImage, BufferedImage image) {\n int xTrim = gameImage.getFullWidth() - gameImage.getIngameWidth();\n int yTrim = gameImage.getFullHeight() - gameImage.getIngameHeight();\n\n BufferedImage trimImage = new BufferedImage(gameImage.getIngameWidth(), gameImage.getIngameHeight(), image.getType());\n Graphics2D graphics = trimImage.createGraphics();\n graphics.drawImage(image, -xTrim / 2, -yTrim / 2, gameImage.getFullWidth(), gameImage.getFullHeight(), null);\n graphics.dispose();\n\n return trimImage;\n }", "@Test\n\tpublic void testCopy() {\n\t\tImagePlus.resetClipboard();\n\n\t\t// cut == true, roi null\n\t\tproc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\tip = new ImagePlus(\"Copier\",proc);\n\t\tImagePlus.resetClipboard();\n\t\tassertNull(ip.getRoi());\n\t\tassertNull(ImagePlus.getClipboard());\n\t\tip.copy(true);\n\t\tassertNull(ImagePlus.getClipboard()); // cut requires a selection\n\t\tassertNull(proc.getSnapshotPixels());\n\n\t\t// cut == true, roi not an area\n\t\t//proc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\t//ip = new ImagePlus(\"Copier\",proc);\n\t\t//ImagePlus.resetClipboard();\n\t\t//assertNull(ip.getRoi());\n\t\t//ip.setRoi(new Line(1,1,2,2));\n\t\t//assertNotNull(ip.getRoi());\n\t\t//assertNull(ImagePlus.getClipboard());\n\t\t//ip.copy(true);\n\t\t//assertNull(ImagePlus.getClipboard());\n\t\t//assertNull(proc.getSnapshotPixels());\n\n\t\t// cut == true, roi an area\n\t\tproc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\tip = new ImagePlus(\"Copier\",proc);\n\t\tImagePlus.resetClipboard();\n\t\tassertNull(ip.getRoi());\n\t\tip.setRoi(new Rectangle(1,1,2,2));\n\t\tassertNotNull(ip.getRoi());\n\t\tassertNull(ImagePlus.getClipboard());\n\t\tip.copy(true);\n\t\tassertNotNull(ImagePlus.getClipboard());\n\t\tassertNotNull(proc.getSnapshotPixels());\n\n\t\t// cut == false, roi null\n\t\tproc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\tip = new ImagePlus(\"Copier\",proc);\n\t\tImagePlus.resetClipboard();\n\t\tassertNull(ip.getRoi());\n\t\tassertNull(ImagePlus.getClipboard());\n\t\tip.copy(false);\n\t\tassertNotNull(ImagePlus.getClipboard());\n\t\tassertNull(proc.getSnapshotPixels());\n\n\t\t// cut == false, roi not an area\n\t\t//proc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\t//ip = new ImagePlus(\"Copier\",proc);\n\t\t//ImagePlus.resetClipboard();\n\t\t//assertNull(ip.getRoi());\n\t\t//ip.setRoi(new Line(1,1,2,2));\n\t\t//assertNotNull(ip.getRoi());\n\t\t//assertNull(ImagePlus.getClipboard());\n\t\t//ip.copy(false);\n\t\t//assertNull(ImagePlus.getClipboard());\n\t\t//assertNull(proc.getSnapshotPixels());\n\n\t\t// cut == false, roi an area\n\t\tproc = new ColorProcessor(2,3,new int[] {1,2,3,4,5,6});\n\t\tip = new ImagePlus(\"Copier\",proc);\n\t\tImagePlus.resetClipboard();\n\t\tassertNull(ip.getRoi());\n\t\tip.setRoi(new Rectangle(1,1,2,2));\n\t\tassertNotNull(ip.getRoi());\n\t\tassertNull(ImagePlus.getClipboard());\n\t\tip.copy(false);\n\t\tassertNotNull(ImagePlus.getClipboard());\n\t\tassertNull(proc.getSnapshotPixels());\n\n\t\t// reset state to keep from messing up other tests\n\t\tImagePlus.resetClipboard();\n\t}", "public Rectangle getBounds() {\n\t\tif (img == null)\n\t\t\treturn new Rectangle();\n\t\treturn new Rectangle(new Dimension(img.getWidth(), img.getHeight()));\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tif (resultCode != RESULT_OK) {\n\t\t\tLog.d(\"CS65\", \"Camera error: result not ok.\");\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (requestCode) {\n\t\tcase REQUEST_CODE_CHOOSE_FROM_GALLERY:\n\t\t\t// Allow user to choose image from internal gallery.\n\t\t\tLog.d(\"CS65\", \"entered choose from gallery request\");\n\t\t\tmImageCaptureUri = data.getData();\n\t\t\tcropImage();\n\t\t\tbreak;\n\n\t\tcase REQUEST_CODE_TAKE_FROM_CAMERA:\n\t\t\t// Allow user to take a photo from the camera.\n\t\t\t// Send image taken from camera for cropping\n\t\t\tcropImage();\n\t\t\tbreak;\n\n\t\tcase REQUEST_CODE_CROP_PHOTO:\n\t\t\t// Update image view after image crop.\n\t\t\tBundle extras = data.getExtras();\n\t\t\t// Set the picture image in UI\n\t\t\tif (extras != null) {\n\t\t\t\t// Convert bitmap to a byte array and load.\n\t\t\t\tBitmap photo = (Bitmap) extras.getParcelable(\"data\");\n\t\t\t\tbitToByte(photo);\n\t\t\t\tloadImage();\n\t\t\t}\n\n\t\t\t// Delete temporary image taken by camera after crop.\n\t\t\tif (isTakenFromCamera) {\n\t\t\t\tFile f = new File(mImageCaptureUri.getPath());\n\t\t\t\tif (f.exists())\n\t\t\t\t\tf.delete();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "private javaxt.io.Image _transform(javaxt.io.Image src_img, double[] src_bbox, int[] dst_size, double[] dst_bbox){\n\n //Use GeoTools to reproject src_img to the output projection.\n try{\n\n //Compute geodetic w/h in degrees (used to specify the Envelope2D)\n double x1 = x(src_bbox[0]);\n double x2 = x(src_bbox[2]);\n double w = 0;\n if (x1>x2) w = x1-x2;\n else w = x2-x1;\n //System.out.println(x1 + \" to \" + x2 + \" = \" + (w));\n\n double y1 = y(src_bbox[1]);\n double y2 = y(src_bbox[3]);\n double h = 0;\n if (y1>y2) h = y1-y2;\n else h = y2-y1;\n //System.out.println(y1 + \" to \" + y2 + \" = \" + (h));\n\n\n System.out.println(src_bbox[0] + \", \" + src_bbox[1] + \", \" + src_bbox[2] + \", \" + src_bbox[3]);\n System.out.println(dst_bbox[0] + \", \" + dst_bbox[1] + \", \" + dst_bbox[2] + \", \" + dst_bbox[3]);\n \n Envelope2D envelope =\n new Envelope2D(this.src_srs.crs, src_bbox[0], src_bbox[1], w, h);\n\n GridCoverage2D gc2d =\n new GridCoverageFactory().create(\"BMImage\", src_img.getBufferedImage(), envelope);\n\n GridCoverage2D gc2dProj =\n (GridCoverage2D)Operations.DEFAULT.resample(gc2d, this.dst_srs.crs);\n\n //TODO: Crop Output?\n /* \n final AbstractProcessor processor = new DefaultProcessor(null);\n final ParameterValueGroup param = processor.getOperation(\"CoverageCrop\").getParameters();\n \n final GeneralEnvelope crop = new GeneralEnvelope( ... ); //<--Define new extents\n param.parameter(\"Source\").setValue( gc2dProj );\n param.parameter(\"Envelope\").setValue( crop );\n\n gc2dProj = (GridCoverage2D) processor.doOperation(param); \n */\n\n src_img = new javaxt.io.Image(gc2dProj.getRenderedImage());\n src_img.resize(dst_size[0], dst_size[1], false);\n\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n\n /*\n //Start port of original python code...\n src_bbox = this.src_srs.align_bbox(src_bbox);\n dst_bbox = this.dst_srs.align_bbox(dst_bbox);\n int[] src_size = new int[]{src_img.getWidth(), src_img.getHeight()}; //src_img.size\n double[] src_quad = new double[]{0, 0, src_size[0], src_size[1]};\n double[] dst_quad = new double[]{0, 0, dst_size[0], dst_size[1]};\n \n SRS.transf to_src_px = SRS.make_lin_transf(src_bbox, src_quad);\n SRS.transf to_dst_w = SRS.make_lin_transf(dst_quad, dst_bbox);\n\n //This segment still needs to be ported to java\n meshes = []; \n def dst_quad_to_src(quad):\n src_quad = []\n for dst_px in [(quad[0], quad[1]), (quad[0], quad[3]),\n (quad[2], quad[3]), (quad[2], quad[1])]:\n dst_w = to_dst_w(dst_px)\n src_w = self.dst_srs.transform_to(self.src_srs, dst_w)\n src_px = to_src_px(src_w)\n src_quad.extend(src_px)\n return quad, src_quad\n */\n\n /*\n int mesh_div = this.mesh_div;\n while (mesh_div > 1 && ((dst_size[0] / mesh_div) < 10 || (dst_size[1] / mesh_div) < 10))\n mesh_div -= 1;\n for (int[] quad : griddify(dst_quad, mesh_div))\n meshes.append(dst_quad_to_src(quad));\n result = src_img.as_image().transform(dst_size, Image.MESH, meshes,\n image_filter[self.resampling])\n */\n return src_img;\n }" ]
[ "0.7130381", "0.67658496", "0.67375314", "0.6407373", "0.63544434", "0.63427454", "0.63246214", "0.62885416", "0.62187743", "0.6216118", "0.6199108", "0.61617845", "0.6151268", "0.6150247", "0.61327267", "0.6087626", "0.603978", "0.60225886", "0.6017626", "0.5970345", "0.5961268", "0.5948808", "0.59304345", "0.59157187", "0.5899819", "0.5864415", "0.5851462", "0.5843832", "0.5843034", "0.58420026", "0.5821282", "0.5769954", "0.5730183", "0.5726981", "0.5696449", "0.5683235", "0.56827587", "0.56742144", "0.5656452", "0.56439906", "0.56146765", "0.56144726", "0.5576856", "0.5566123", "0.5483087", "0.54530513", "0.54268384", "0.53823006", "0.5336367", "0.53181237", "0.5229115", "0.5220759", "0.51808286", "0.515695", "0.51548594", "0.5153934", "0.51288956", "0.512812", "0.5104095", "0.5093884", "0.5075973", "0.5072009", "0.50651085", "0.50639415", "0.50635505", "0.5029838", "0.502111", "0.5018803", "0.49875626", "0.49779445", "0.4970262", "0.49697778", "0.4954825", "0.4952008", "0.49467796", "0.49348536", "0.49173158", "0.48948586", "0.48903582", "0.4888105", "0.48860928", "0.48800144", "0.4877607", "0.48706833", "0.48615524", "0.48312524", "0.48267758", "0.48263618", "0.4790928", "0.47885093", "0.47848374", "0.47792363", "0.47789353", "0.47777972", "0.4776753", "0.4773234", "0.47557923", "0.47475106", "0.47426325", "0.47423393" ]
0.64363366
3
Convert image to POT (poweroftwo)
public @NotNull Image toPOT(@NotNull Colorc fill) { // Calculate next power-of-two values // NOTE: Just add the required amount of pixels at the right and bottom sides of image... int potWidth = (int) Math.pow(2, Math.ceil(Math.log(this.width) / Math.log(2))); int potHeight = (int) Math.pow(2, Math.ceil(Math.log(this.height) / Math.log(2))); // Check if POT texture generation is required (if texture is not already POT) return resizeCanvas(0, 0, potWidth, potHeight, fill); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean translateImageToText();", "private String ConvertImagenTexto(Bitmap imagenpro) {\n ByteArrayOutputStream espacio = new ByteArrayOutputStream();\n imagenpro.compress(Bitmap.CompressFormat.JPEG,100,espacio);\n byte[] imagen = espacio.toByteArray();\n String imagenAstring = Base64.encodeToString(imagen,Base64.DEFAULT);\n return imagenAstring;\n }", "NativeLong wkhtmltoimage_get_output(PointerByReference converter, PointerByReference charPtrPtr1);", "int wkhtmltoimage_convert(PointerByReference converter);", "int wkhtmltoimage_current_phase(PointerByReference converter);", "public boolean generateImageFromText();", "PointerByReference wkhtmltoimage_create_converter(PointerByReference settings, String data);", "public static BufferedImage makePPM(byte[] aux) {\n int w = 0, h = 0;\n boolean fin = true;\n\n char[] iaux = new char[aux.length];\n for (int j = 0; j < aux.length; j++) {\n iaux[j] = (char) (aux[j] & 0xFF);\n }\n\n for (int i = 3; iaux[i] != '\\n'; ++i) {\n if (iaux[i] == ' ') fin = false;\n else {\n if (fin) {\n int a = Character.getNumericValue(iaux[i]);\n w *= 10;\n w += a;\n } else {\n int a = Character.getNumericValue(iaux[i]);\n h *= 10;\n h += a;\n }\n }\n }\n\n BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n int r, g, b, k = 0, pixel;\n for (int y = 0; y < h; y++) {\n for (int x = 0; (x < w) && ((k + 3) < aux.length); x++) {\n r = aux[k++] & 0xFF;\n g = aux[k++] & 0xFF;\n b = aux[k++] & 0xFF;\n pixel = 0xFF000000 + (r << 16) + (g << 8) + b;\n image.setRGB(x, y, pixel);\n }\n }\n\n return image;\n }", "PointerByReference wkhtmltoimage_create_converter(PointerByReference settings, Pointer data);", "String wkhtmltoimage_phase_description(PointerByReference converter, int phase);", "public Image getTrebleClef();", "Pointer wkhtmltoimage_progress_string(PointerByReference converter);", "@Test\n\tpublic void testImageFromWindowsPhotoEditor2() throws IOException, ImageProcessingException, MetadataException {\n\t\tURL url = new URL(\"https://dbis-thure.uibk.ac.at/f/Get?id=BTCMSAGPZYLKPPLZWWQLSMKY\");\n\t\tRotatedBufferedImage bi = (RotatedBufferedImage) TrpImageIO.read(url);\n\t\tlogger.info(\"TrpImageIO result = \" + bi.getImageTransformation().toString());\n\t\t\n\t\tImageTransformation t = TrpImgMdParser.readImageDimension(url);\n\t\tlogger.info(\"TrpImgMdParser result = \" + t.toString());\n\t}", "public void ocultarMensaje(String msje, String fo, String nueFo){\n String mensaje, binario;\n Color color;\n int r,g,b;\n try{\n mensaje = lecturaArchivo(msje);\n binario = preparaMensaje(mensaje);\n BufferedImage image = sacaFoto(fo);\n int k = 0;\n for(int i = 0; i < image.getHeight(); i++)\n for(int j = 0; j < image.getWidth(); j++){\n color = new Color(image.getRGB(j, i));\n if(k <= binario.length()){\n String red = toBinary((byte) color.getRed());\n String green = toBinary((byte) color.getGreen());\n String blue = toBinary((byte) color.getBlue());\n red = reemplazarLSB(red, binario);\n green = reemplazarLSB(green, binario);\n blue = reemplazarLSB(blue, binario);\n r = Integer.parseInt(red ,2);\n g = Integer.parseInt(green ,2);\n b = Integer.parseInt(blue ,2);\n }else{\n r = color.getRed();\n g = color.getGreen();\n b = color.getBlue();\n }\n image.setRGB(j, i, new Color(r,g,b).getRGB());\n k+=3;\n }\n File output = new File(nueFo);\n ImageIO.write(image, \"png\", output);\n }catch(IOException ioe){\n System.out.println(\"Hubo un error en la escritura de la imagen\");\n System.exit(1);\n }\n }", "public native double testyolo(String imgfile);", "static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}", "@Test\n\tpublic void testImageFromWindowsPhotoEditor() throws IOException, ImageProcessingException, MetadataException {\n\t\tURL url = new URL(\"https://files-test.transkribus.eu/Get?id=JMWVACVZDPHVPOVGFWQVBHXP\");\n\t\tRotatedBufferedImage bi = (RotatedBufferedImage) TrpImageIO.read(url);\n\t\tlogger.info(\"TrpImageIO result = \" + bi.getImageTransformation().toString());\n\t\t\n\t\tImageTransformation t = TrpImgMdParser.readImageDimension(url);\n\t\tlogger.info(\"TrpImgMdParser result = \" + t.toString());\n\t}", "static public void wyslijObraz(Image image) throws IOException\n {\n if(Klient.czyRysuje == true)\n {\n String obrazek = \"<<OBRAZ>>\";\n obrazek += DatatypeConverter.printBase64Binary(obrazNaBity(image));//Konwersja obrazka do Base64Binary \n out.println(obrazek);\n }\n }", "private String tesseract(Bitmap bitmap) {\n return \"NOT IMPLEMENTED\";\n }", "public BufferedImage add_text(BufferedImage image, String text) {\n // convert all items to byte arrays: image, message, message length\n byte img[] = get_byte_data(image);\n byte msg[] = text.getBytes();\n byte len[] = bit_conversion(msg.length);\n try {\n encode_text(img, len, 0); // 0 first positiong\n encode_text(img, msg, 32); // 4 bytes of space for length:\n // 4bytes*8bit = 32 bits\n }\n catch (Exception e) {\n JOptionPane.showMessageDialog(\n null,\n \"Target File cannot hold message!\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n }\n return image;\n }", "Bitmap mo1406a(Bitmap bitmap, float f);", "private void saveImageAsText() {\n\t\tFile textFile = fileChooser.getOutputFile(this, \"Select Text File Name\", \"textImage.txt\"); \n\t\tif (textFile == null)\n\t\t\treturn;\n\t\ttry {\n\t\t\tPrintWriter write = new PrintWriter(textFile);\n\t\t\twrite.println(\"New textImage\");\n\t\t\twrite.println(canvas.getBackground().getRed());\n\t\t\twrite.println(canvas.getBackground().getGreen());\n\t\t\twrite.println(canvas.getBackground().getBlue());\n\t\t\tif (theString != null)\n\t\t\t\tfor (DrawTextItem s: theString) { \n\t\t\t\t\twrite.println(\"theString:\"); \n\t\t\t\t\twrite.println(s.getString()); \n\t\t\t\t\twrite.println(s.getX());\n\t\t\t\t\twrite.println(s.getY());\n\t\t\t\t\twrite.println(s.getFont().getName());\n\t\t\t\t\twrite.println(s.getFont().getStyle());\n\t\t\t\t\twrite.println(s.getFont().getSize());\n\t\t\t\t\twrite.println(s.getTextColor().getRed()); \n\t\t\t\t\twrite.println(s.getTextColor().getGreen());\n\t\t\t\t\twrite.println(s.getTextColor().getBlue());\n\t\t\t\t\twrite.println(s.getTextTransparency());\n\t\t\t\t\tif (s.getBackground() == null) {\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t\twrite.println(-1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twrite.println(s.getBackground().getRed()); \n\t\t\t\t\t\twrite.println(s.getBackground().getGreen());\n\t\t\t\t\t\twrite.println(s.getBackground().getBlue());\n\t\t\t\t\t}\n\t\t\t\t\twrite.println(s.getBackgroundTransparency());\n\t\t\t\t\twrite.println(s.getBorder())\n\t\t\t\t\twrite.println(s.getMagnification());\n\t\t\t\t\twrite.println(s.getRotationAngle());\n\t\t\t\t}\n\t\t\twrite.close();\n\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(this, \n\t\t\t\t\t\"Sorry, an error occurred while trying to save this image progress.\\n\" + \"Error message: \" + e);\n\t\t}\n\t}", "Picture binaryComponentImage() throws Exception;", "public BufferedImage saltnpepper(BufferedImage timg) {\n\n int[][][] ImageArray1 = convertToArray(timg);\n\n return convertToBimage(ImageArray1);\n }", "private Image bitmap2JPEG(Bitmap bit) {\n\n Image baseImage = new Image();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bit.compress(Bitmap.CompressFormat.JPEG, 90, stream);\n byte[] imageBytes = stream.toByteArray();\n baseImage.encodeContent(imageBytes);\n\n return baseImage;\n }", "private byte[] PPMfile() {\n StringBuilder Finald = new StringBuilder();\n Finald.append(\"P6\");\n Finald.append(\"\\n\");\n Finald.append(width);\n Finald.append(\" \");\n Finald.append(height);\n Finald.append(\"\\n\");\n Finald.append(255);\n Finald.append(\"\\n\");\n for (int x = 0; x < height; ++x) {\n for (int y = 0; y < width; ++y) {\n char auxe = (char) FinalR[x][y];\n Finald.append(auxe);\n auxe = (char) FinalG[x][y];\n Finald.append(auxe);\n auxe = (char) FinalB[x][y];\n Finald.append(auxe);\n }\n }\n String Finaldes = Finald.toString();\n return Finaldes.getBytes();\n }", "public void testMULTI2Conversion() throws java.io.FileNotFoundException, java.io.IOException {\n OPMToDot toDot=new OPMToDot(\"src/main/resources/defaultConfigMulti.xml\"); // with multisteps\n \n toDot.convert(graph1,\"target/multi2.dot\", \"target/multi2.pdf\");\n }", "public static Texture getWat(){\n //set a linear filter to clean image\n h2o.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);\n //return image\n return h2o;\n }", "@Test\r\n public void testComplex(){\r\n List<Tone> palette = StandardPalettes.PWG_STANDARD;\r\n\r\n BufferedImage image = ImageFileUtils.loadImageResource(\"/sampleImages/complex/rooves.jpg\");\r\n\r\n PaletteReplacer replacer = new PaletteReplacer();\r\n\r\n BufferedImage result = replacer.replace(image, palette);\r\n\r\n BufferedImage target = ImageFileUtils.loadImageResource(\"/resultImages/paletteReplacer/pwgRooves.png\");\r\n\r\n assertPixelsMatch(target, result);\r\n }", "private Bitmap translateImgToBitmap(String filepath){\n File imgFile = new File(filepath);\n\n if (imgFile.exists()) {\n Bitmap bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\n\n float imgScale = (float) bitmap.getHeight() / 1620;\n bitmap = Bitmap.createScaledBitmap(bitmap,\n Math.round(bitmap.getWidth() / imgScale),\n Math.round(bitmap.getHeight() / imgScale), true);\n\n return bitmap;\n\n } else {\n Toast.makeText(getApplicationContext(), \"Die Datei wurde nicht gefunden.\", Toast.LENGTH_SHORT).show();\n return null;\n }\n }", "public void convert() throws Exception {\r\n\t\tString svg_URI_input = Paths.get(\"library.svg\").toUri().toURL().toString();\r\n\t\tTranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);\r\n\t\tthis.setNewImage(generate(20));// Define the name of the file\r\n\t\ttry (OutputStream png_ostream = new FileOutputStream(newImage)) {\r\n\t\t\tTranscoderOutput output_png_image = new TranscoderOutput(png_ostream);\r\n\r\n\t\t\tPNGTranscoder my_converter = new PNGTranscoder();\r\n\t\t\tmy_converter.transcode(input_svg_image, output_png_image);\r\n\r\n\t\t\tpng_ostream.flush();\r\n\t\t\tpng_ostream.close();\r\n\t\t}\r\n\r\n\t}", "int wkhtmltoimage_init(int use_graphics);", "String getImage();", "void texImage2D(int target, int level, int resourceId, int border);", "com.google.protobuf.ByteString getPicture();", "public Output convertImage(final BufferedImage source) {\n\t\t// dimension of each tile\n\t\tDimension tileSize = this.characterCache.getCharacterImageSize();\n\n\t\t// round the width and height so we avoid partial characters\n\t\tint outputImageWidth = (source.getWidth() / tileSize.width)\n\t\t\t\t* tileSize.width;\n\t\tint outputImageHeight = (source.getHeight() / tileSize.height)\n\t\t\t\t* tileSize.height;\n\n\t\t// extract pixels from source image\n\t\tint[] imagePixels = source.getRGB(0, 0, outputImageWidth,\n\t\t\t\toutputImageHeight, null, 0, outputImageWidth);\n\n\t\t// process the pixels to a grayscale matrix\n\t\tGrayscaleMatrix sourceMatrix = new GrayscaleMatrix(imagePixels,\n\t\t\t\toutputImageWidth, outputImageHeight);\n\n\t\t// divide matrix into tiles for easy processing\n\t\tTiledGrayscaleMatrix tiledMatrix = new TiledGrayscaleMatrix(\n\t\t\t\tsourceMatrix, tileSize.width, tileSize.height);\n\n\t\tthis.output = initializeOutput(outputImageWidth, outputImageHeight);\n\n\t\t// compare each tile to every character to determine best fit\n\t\tfor (int i = 0; i < tiledMatrix.getTileCount(); i++) {\n\n\t\t\tGrayscaleMatrix tile = tiledMatrix.getTile(i);\n\n\t\t\tfloat minError = Float.MAX_VALUE;\n\t\t\tEntry<Character, GrayscaleMatrix> bestFit = null;\n\n\t\t\tfor (Entry<Character, GrayscaleMatrix> charImage : characterCache) {\n\t\t\t\tGrayscaleMatrix charPixels = charImage.getValue();\n\n\t\t\t\tfloat error = this.characterFitStrategy.calculateError(\n\t\t\t\t\t\tcharPixels, tile);\n\n\t\t\t\tif (error < minError) {\n\t\t\t\t\tminError = error;\n\t\t\t\t\tbestFit = charImage;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint tileX = ArrayUtils.convert1DtoX(i, tiledMatrix.getTilesX());\n\t\t\tint tileY = ArrayUtils.convert1DtoY(i, tiledMatrix.getTilesX());\n\n\t\t\t// copy character to output\n\t\t\taddCharacterToOutput(bestFit, imagePixels, tileX, tileY,\n\t\t\t\t\toutputImageWidth);\n\t\t}\n\n\t\tfinalizeOutput(imagePixels, outputImageWidth, outputImageHeight);\n\n\t\treturn this.output;\n\n\t}", "@Source(\"gr/grnet/pithos/resources/translate.png\")\n ImageResource selectAll();", "@Override\n\tpublic void pintar() {\n\t\n\t\tapp.image(water, this.px, this.py);\n\t\t\n\t}", "public native void textureImage(MagickImage image) throws MagickException;", "public byte[] convertImage(Image image) {\n BufferedImage bytesImage = SwingFXUtils.fromFXImage(image, null);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n byte[] bytesArray = null;\n try {\n ImageIO.write(bytesImage, \"png\", baos);\n //coloca los bytes de la imagen en un arreglo de bytes\n bytesArray = baos.toByteArray();\n baos.close();\n return bytesArray;\n } catch (IOException ex) {\n Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "private static byte[] mergeImageAndText(BufferedImage im, String name, String event, Point pointName, Point pointEvent) throws IOException {\n\t\tGraphics2D g2 = im.createGraphics(); //graohics obj banaya to draw\n\t\tSystem.out.println(name);\n\t\tg2.setFont(new Font(\"TimesRoman\", Font.BOLD,28));\n\t\tg2.setColor(Color.BLACK);\n\t\tg2.drawString(name, pointName.x, pointName.y);//write text\n\t\tg2.drawString(event, pointEvent.x, pointEvent.y);//write text\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\tImageIO.write(im, \"jpg\", baos);\n\t\treturn baos.toByteArray();\n\t}", "int wkhtmltoimage_phase_count(PointerByReference converter);", "java.lang.String getImage();", "public static ImagePNG encodage(ImagePNG imagePNG, ArrayList<Integer> messageBinaire) {\r\n if (messageBinaire.size() >= imagePNG.getWidth() * imagePNG.getHeight()) {\r\n JOptionPane.showMessageDialog(null, \"Le message est trop long\");\r\n return imagePNG.copy();\r\n }\r\n ImagePNG copy = imagePNG.copy();\r\n int cle = 1;\r\n int compteur = 0;\r\n for (int i = 0; i < messageBinaire.size(); i++) {\r\n int message = messageBinaire.get(i);\r\n int valeurEntierePixelModifiee = ((copy.getImage()[compteur / imagePNG.getHeight()][compteur % imagePNG.getHeight()].getValeurEntierePixel() >> 1) << 1);\r\n copy.getImage()[compteur / imagePNG.getHeight()][compteur % imagePNG.getHeight()]\r\n .setValeurEntierePixel(valeurEntierePixelModifiee | message);\r\n compteur++;\r\n }\r\n return copy;\r\n }", "List<List<Pixel>> transform(Image img, String operation);", "public Image getNatural();", "int wkhtmltoimage_extended_qt();", "public Image creerImage() {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n\t\ttry {\r\n\t\t\t// Transfert de l image dans le buffer de bytes\r\n\t\t\tImageIO.write(monImage.getImage(), \"png\", baos);\r\n\t\t\t\r\n\t\t\t// Creation d une instance d Image iText\r\n\t\t\tImage image = Image.getInstance(baos.toByteArray());\r\n\t\t\treturn image;\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (BadElementException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public static String convertImageInStdout(String mscgen_path, String codePath){\n\t\t\n\t\tProcessBuilder pb = new ProcessBuilder(); \n\t\tif (mscgen_path == \"MSCGEN PATH EMPTY\") {\n\t\t\treturn \"0\"+\",ERROR:\" +\"MSCGen compiler path not set.\";\n\t\t}\n\t\t\n\t\telse if (mscgen_path == \"MSCGEN EXE NOT FOUND\") {\n\t\t\t \n\t\t\treturn \"0\"+\",ERROR:\" +\"MSCGen compiler not found.\";\n\t\t}\n String OS = System.getProperty(\"os.name\");\n if(OS.startsWith(\"Windows\")){\n codePath = codePath.replace(\"\\\\\",\"\\\\\\\\\");\n /* \n * Ref: PLUG-5262\n * In case of windows environment if we have space in-between the compiler path \n * then we need to set parent directory as the directory of ProcessBuilder. \n */\n File f = new File(mscgen_path);\n pb.directory(f.getParentFile());\n pb.command(\"cmd.exe\", \"/c\",f.getName(),\"-T\",\"png\",\"-i\",codePath);\n }else{\n pb.command(mscgen_path,\"-T\",\"png\",\"-i\",codePath); \n }\n Process p = null;\n\t\ttry {\n\t\t\tp = pb.start();\n\t\t\tp.waitFor();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\tString error=checkError(p);\n\t\tif(error!=\"\"){\n\t\t\treturn getErrorLine(error)+\",ERROR:\"+error;\n\t\t}\n\t\tBufferedImage image=null;\t\n\t\ttry {\n File f = new File(codePath+\".png\");\n\t\t\timage=ImageIO.read(f);\n \n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO exception in read\");\n\t\t} \n String imageString = null;\n ByteArrayOutputStream imageInBytes = new ByteArrayOutputStream();\n\t try {\n\t\t\tImageIO.write(image, \"png\", imageInBytes);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO exception in write\");\n\t\t}\n\t byte[] imageBytes = imageInBytes.toByteArray();\n\t imageString = DatatypeConverter.printBase64Binary(imageBytes);\n\t try {\n\t\t\timageInBytes.close();\n\t\t\tp.getInputStream().close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO exception in close\");\n }\n\t\treturn imageString;\n\t}", "public String scanText(BufferedImage image) throws IOException {\n File tmpImgFile = File.createTempFile(\"tmpImg\", \".jpg\");\n ImageIO.write(image, \"jpg\", tmpImgFile);\n String rawData = TesseractWrapper.runTesseract(tmpImgFile.getAbsolutePath());\n tmpImgFile.delete();\n return rawData;\n }", "private String MiniTwoConversion() {\n int reading = ((raw[23] & 0xC0) >> 6) + ((raw[24] & 0xFF) << 2);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = m2Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "@Override\n public byte[] getBytes(EscPosImage image) {\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n //\n bytes.write(ESC);\n bytes.write('a');\n bytes.write(justification.value);\n //\n int paramSize = image.getRasterSizeInBytes() + 10;\n int pL = paramSize & 0xFF;\n int pH = (paramSize & 0xFF00) >> 8 ;\n\n bytes.write(GS);\n bytes.write('(');\n bytes.write('L');\n bytes.write(pL); // pl\n bytes.write(pH); // ph\n bytes.write(48); // m\n bytes.write(112); //fn\n bytes.write(48); // a\n bytes.write(graphicsImageBxBy.bx); // bx\n bytes.write(graphicsImageBxBy.by); // by\n bytes.write(49); // c\n\n // bits in horizontal direction for the bit image\n int horizontalBits = image.getWidthOfImageInBits();\n int xL = horizontalBits & 0xFF;\n int xH = (horizontalBits & 0xFF00) >> 8 ;\n // \n // bits in vertical direction for the bit image\n int verticalBits = image.getHeightOfImageInBits();\n // getting first and second bytes separatted\n int yL = verticalBits & 0xFF;\n int yH = (verticalBits & 0xFF00) >> 8 ;\n \n bytes.write(xL);\n bytes.write(xH);\n bytes.write(yL);\n bytes.write(yH);\n // write bytes\n byte [] rasterBytes = image.getRasterBytes().toByteArray();\n bytes.write(rasterBytes,0,rasterBytes.length);\n \n // function 050\n bytes.write(GS);\n bytes.write('(');\n bytes.write('L');\n bytes.write(2); // pl\n bytes.write(0); // ph\n bytes.write(48); //m\n bytes.write(50); //fn\n \n \n \n\n //\n return bytes.toByteArray();\n \n }", "public void geraWord() throws IOException, SQLException {\n String matricula2 = JOptionPane.showInputDialog(\"Matricula: \");\n String escola = JOptionPane.showInputDialog(\"Escola: \");\n String titulo2 = JOptionPane.showInputDialog(\"Titulo: \");\n String prof = JOptionPane.showInputDialog(\"Professor: \");\n String turma = JOptionPane.showInputDialog(\"Turma: \");\n String nomeAluno = JOptionPane.showInputDialog(\"Nome: \");\n String data = JOptionPane.showInputDialog(\"Data: \");\n String valor = JOptionPane.showInputDialog(\"Valor: \");\n XWPFDocument document = new XWPFDocument();\n CTSectPr sectPr = document.getDocument().getBody().addNewSectPr();\n CTPageMar pageMar = sectPr.addNewPgMar();\n pageMar.setLeft(BigInteger.valueOf(500));\n pageMar.setTop(BigInteger.valueOf(100));\n pageMar.setRight(BigInteger.valueOf(500));\n pageMar.setBottom(BigInteger.valueOf(100));\n File f = new File(\"ALICE_COSTA 201511130024.jpg\");\n BufferedImage i = ImageIO.read(f);\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n ImageIO.write(i, \"jpg\", os);\n InputStream is = new ByteArrayInputStream(os.toByteArray());\n\n File f2 = new File(\"brasao.gif\");\n BufferedImage i2 = ImageIO.read(f2);\n ByteArrayOutputStream os2 = new ByteArrayOutputStream();\n ImageIO.write(i2, \"gif\", os2);\n InputStream is2 = new ByteArrayInputStream(os2.toByteArray());\n\n File f3 = new File(\"logo.gif\");\n BufferedImage i3 = ImageIO.read(f3);\n ByteArrayOutputStream os3 = new ByteArrayOutputStream();\n ImageIO.write(i3, \"gif\", os3);\n InputStream is3 = new ByteArrayInputStream(os3.toByteArray());\n\n try {\n\n XWPFParagraph paragrafo = document.createParagraph();\n paragrafo.setAlignment(ParagraphAlignment.DISTRIBUTE);\n paragrafo.setSpacingAfter(200);\n // XWPFHeaderFooterPolicy policy = document.getHeaderFooterPolicy();\n XWPFRun p = paragrafo.createRun();\n p.setText(\" \");\n p.addPicture(is, Document.PICTURE_TYPE_JPEG, \"ALICE_COSTA 201511130024.jpg\", Units.toEMU(60), Units.toEMU(60));\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.setText(\" \");\n\n p.addPicture(is2, Document.PICTURE_TYPE_GIF, \"brasao.gif\", Units.toEMU(60), Units.toEMU(60));\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.addTab();\n p.addPicture(is3, Document.PICTURE_TYPE_GIF, \"logo.gif\", Units.toEMU(60), Units.toEMU(60));\n\n } catch (InvalidFormatException e1) {\n System.out.println(e1.getMessage());\n }\n\n XWPFParagraph matricula = document.createParagraph();\n matricula.setFirstLineIndent(100);\n matricula.setIndentFromRight(9500);\n matricula.setAlignment(ParagraphAlignment.CENTER);\n\n XWPFRun matriculaR = matricula.createRun();\n matriculaR.setFontFamily(\"Arial\");\n matriculaR.setText(matricula2);\n matriculaR.setFontSize(12);\n matriculaR.setColor(\"000000\");\n\n XWPFParagraph titulo = document.createParagraph();\n titulo.setAlignment(ParagraphAlignment.CENTER);\n XWPFRun tituloR = titulo.createRun();\n tituloR.setFontSize(12);\n tituloR.setFontFamily(\"Arial\");\n tituloR.setColor(\"000000\");\n titulo.setSpacingAfterLines(100);\n\n tituloR.setText(escola);\n tituloR.addBreak();\n tituloR.setText(titulo2);\n tituloR.addBreak();\n\n XWPFParagraph paragraphThree = document.createParagraph();\n paragraphThree.setAlignment(ParagraphAlignment.NUM_TAB);\n XWPFRun paragraphThreeRunOne = paragraphThree.createRun();\n paragraphThreeRunOne.setFontSize(12);\n paragraphThreeRunOne.setFontFamily(\"Arial\");\n paragraphThreeRunOne.setColor(\"000000\");\n paragraphThreeRunOne.setText(\"Professor (A): \");\n paragraphThreeRunOne.setText(prof);\n int aux = prof.length() / 6;\n int aux2 = nomeAluno.length() / 6;\n int primeiroTab = 10;\n int segundoTab = 11;\n if (prof.length() % 6 == prof.length()) {\n aux = 1;\n if (prof.length() <= 5) {\n aux--;\n }\n }\n if (nomeAluno.length() % 6 == nomeAluno.length()) {\n aux2 = 1;\n if (nomeAluno.length() <= 5) {\n //aux2+=2;\n }\n }\n aux = primeiroTab - aux;\n aux2 = segundoTab - aux2;\n for (int j = 0; j <= aux; j++) {\n System.out.println(j);\n paragraphThreeRunOne.addTab();\n }\n paragraphThreeRunOne.setText(\"Turma: \");\n paragraphThreeRunOne.setText(turma);\n\n XWPFParagraph paragrafo2 = document.createParagraph();\n paragrafo2.setAlignment(ParagraphAlignment.LEFT);\n\n XWPFRun paragrafo2R = paragrafo2.createRun();\n paragrafo2R.setFontFamily(\"Arial\");\n paragrafo2R.setFontSize(12);\n paragrafo2R.setText(\"Aluno (a): \");\n paragrafo2R.setText(nomeAluno);\n for (int j = 0; j <= aux2; j++) {\n System.out.println(j);\n paragrafo2R.addTab();\n }\n paragrafo2R.setText(\"Data: \");\n paragrafo2R.setText(data);\n XWPFParagraph paragrafo3 = document.createParagraph();\n paragrafo2.setAlignment(ParagraphAlignment.LEFT);\n XWPFRun paragrafo3R = paragrafo3.createRun();\n paragrafo3R.setFontFamily(\"Arial\");\n paragrafo3R.setFontSize(12);\n for (int j = 0; j < 13; j++) {//System.out.println(j);\n paragrafo3R.addTab();\n }\n paragrafo3R.setText(\"Valor: \");\n paragrafo3R.setText(valor);\n\n FileOutputStream outStream = null;\n try {\n outStream = new FileOutputStream(\"teste.docx\");\n } catch (FileNotFoundException e) {\n System.out.println(e.getMessage());\n }\n try {\n document.write(outStream);\n outStream.close();\n } catch (FileNotFoundException e) {\n System.out.println(e.getMessage());\n } catch (IOException e) {\n System.out.println(e.getMessage());\n }\n }", "public void gen_encrypted_image(double mat[][])\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tgetpixel_1(mat);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgetpixel_2(mat);\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tImageIO.write(img, \"jpg\", new File(folder+\"Encrypted_\"+name));\n\t\t\tRuntime.getRuntime().exec(folder+\"Encrypted_\"+name);\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t}\t\t\n }", "public static Bitmap convertSingleBitmap (PicObject picOb){\n Bitmap bitmap = decodeBase64(picOb.getImage());\n captionListNews.add(picOb.getCaption());\n return bitmap;\n }", "public static void main(String[] args) throws IOException {\n BmpFile c = new ImageReader().read();\n \n BmpFileTransformer t = new BmpFileTransformer();\n c = t.transform(c);\n \n new ImageInHtmlWriter().create(c);\n BmpFileWriter w = new BmpFileWriter();\n w.write(c);\n }", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImageByTransform();", "public CopyOfPlayer(){ //Loads and scales the images\n for (int i = 0; i < robotImages.length; i++){\n for (int j = 0; j < black.length; j++){\n robotImages[i][j].scale(300, 300);\n }\n }\n costume = PrefLoader.getCostume(); //Sets costume according to file\n setImage(robotImages[costume][2]);\n }", "private static final byte[] pkg_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, -1,\n\t\t\t\t-6, -51, 0, 0, 0, -91, 42, 42, -128, -128, -128, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97, 100,\n\t\t\t\t101, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33, -7, 4,\n\t\t\t\t1, 10, 0, 0, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 3, 64, 8, -86,\n\t\t\t\t-79, -48, 110, -123, 32, 32, -99, 110, -118, 93, 41, -57, -34,\n\t\t\t\t54, 13, 83, 88, 61, -35, -96, 6, -21, 37, -87, 48, 27, 75, -23,\n\t\t\t\t-38, -98, -26, 88, 114, 120, -18, 75, -102, 96, 7, -62, 16, 85,\n\t\t\t\t-116, 39, -38, -121, -105, 44, 46, 121, 68, -122, 39, -124,\n\t\t\t\t-119, 72, 47, 81, -85, 84, -101, 0, 0, 59 };\n\t\treturn data;\n\t}", "public void instalarTipoLetra()\r\n\t{\r\n\t\ttry\r\n { \r\n FileInputStream fIn = new FileInputStream(\"./images/dandelion in the spring.ttf\");\r\n FileOutputStream fOut = new FileOutputStream(\"C:/windows/fonts/dandelion in the spring.ttf\");\r\n \r\n FileChannel fIChan = fIn.getChannel();\r\n FileChannel fOChan = fOut.getChannel();\r\n \r\n long fSize = fIChan.size();\r\n \r\n MappedByteBuffer mBuf = \r\n fIChan.map(FileChannel.MapMode.READ_ONLY, 0, fSize); \r\n fOChan.write(mBuf);//con esto copiamos el archivo\r\n \r\n //nunca olvidemos cerrar los archivos\r\n fIChan.close();\r\n fIn.close();\r\n fOChan.close();\r\n fOut.close();\r\n JOptionPane.showMessageDialog(this,\"El tipo de letra ha sido instalada en el sistema operativo.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n JOptionPane.showMessageDialog(this,\"Cierre el Sistema Experto - SESP y vuelva a iniciar el ejecutable.\",\"Instalar Tipo Letra\", JOptionPane.INFORMATION_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/informacion.PNG\"));\r\n }\r\n catch(Exception ef)\r\n {\r\n \tJOptionPane.showMessageDialog(this,\"Error al instalar el tipo de letra dandelion in the spring en el sistema operativo\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \tJOptionPane.showMessageDialog(this,\"Intente instalar manualmente el archivo (dandelion in the spring.ttf) que esta en la carpeta images o intente\"+\"\\n\"+\" copiar manualmente el archivo (dandelion in the spring.ttf) en el directorio C:/windows/fonts\",\"Error\", JOptionPane.ERROR_MESSAGE,new ImageIcon(\"./images/IconosInterfaz/error.PNG\"));\r\n \t}\r\n\t}", "private void sendTextBitmap(LiveViewAdapter mLiveViewAdapter,\n int mPluginId, String txt) {\n Bitmap bitmap = null;\n try {\n bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.RGB_565);\n } catch (IllegalArgumentException e) {\n return;\n }\n\n Canvas canvas = new Canvas(bitmap);\n\n // Set the text properties in the canvas\n TextPaint textPaint = new TextPaint();\n textPaint.setTextSize(18);\n textPaint.setColor(Color.WHITE);\n\n // Create the text layout and draw it to the canvas\n Layout textLayout = new StaticLayout(txt, textPaint, 128,\n Layout.Alignment.ALIGN_CENTER, 1, 1, false);\n textLayout.draw(canvas);\n\n\n try {\n mLiveViewAdapter.sendImageAsBitmap(mPluginId,\n PluginUtils.centerX(bitmap), PluginUtils.centerY(bitmap),\n bitmap);\n } catch (Exception e) {\n Log.d(PluginConstants.LOG_TAG, \"Failed to send bitmap\", e);\n }\n\n }", "WorldImage getImage();", "public void pintaFecha(){\n \tImage image;\r\n \ttry {\r\n\t \r\n \t\tString imageUrl = PropiedadesJLet.getInstance().getProperty(\"path.img.logoinvoice\") + \"FondoLeppardPico1.png\";\r\n\t\r\n\t\t\timage = Image.getInstance(imageUrl);\r\n\t\t image.setAbsolutePosition(inmargde-10, 725);\r\n\t\t image.scaleAbsolute(50,20);\r\n\t\t image.setAlignment(Image.LEFT | Image.TEXTWRAP);//Code 2\r\n\t\t\tdocumento.add(image);\r\n \r\n\t\t\tFRAparen.absTextBoldColor(writer,\"Fecha \",inmargde,730,10,new BaseColor(255,255,255));\r\n\t\t\tFRAparen.absText(writer,FRAparen.fechaNormal(fhfactur),inmargde + 45,730,10);\r\n\t\t\t\r\n\t\t\timage = Image.getInstance(imageUrl);\r\n\t\t image.setAbsolutePosition(inmargde-10, 700);\r\n\t\t image.scaleAbsolute(100,20);\r\n\t\t image.setAlignment(Image.LEFT | Image.TEXTWRAP);//Code 2\r\n\t\t\tdocumento.add(image);\r\n\t\t\t\r\n\t\t\tif (cabecNFC.equals(\"COND\") || cabecNFC.equals(\"R\")){\r\n\t\t\t\tFRAparen.absTextBoldColor(writer,cabecNFC +\" \"+ numerNFC +\" \",inmargde,705,10,new BaseColor(255,255,255));\r\n\t\t\t} else {\r\n\t\t\t\tFRAparen.absTextBoldColor(writer,\"NFC \"+ cabecNFC +\" \"+ numerNFC +\" \",inmargde,705,10,new BaseColor(255,255,255));\r\n\t\t\t}\r\n\t\t\t\r\n \t} catch (Exception e) {\r\n \t\tSystem.err.println(this.getClass().getName() +\" ERROR pintaFecha() - \"+ e.getMessage());\r\n \t}\r\n \t\r\n }", "public byte[] convertN21ToJpeg(byte[] bytesN21, int w, int h) {\n boolean isAlgorithmsOn = Keys.isAlgorithmsOn(this.mActivity.getSettingsManager());\n if (isDepthEnabled() || !isAlgorithmsOn) {\n Log.d(TAG, \"depth on return jpeg\");\n return bytesN21;\n }\n byte[] rez = new byte[0];\n YuvImage yuvImage = new YuvImage(bytesN21, 17, w, h, null);\n Rect rect = new Rect(0, 0, w, h);\n ByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n boolean compressToJpeg = yuvImage.compressToJpeg(rect, true, outputStream);\n return outputStream.toByteArray();\n }", "@Override\r\n\tpublic String getPicture(boolean whiteSquare, boolean whitePiece) {\n\t\tif (whiteSquare){\r\n\t\t\t//if white piece\r\n\t\t\tif (whitePiece) {\r\n\t\t\t\treturn \"wrookWsq.jpeg\";\r\n\t\t\t}else{//black piece\r\n\t\t\t\treturn \"brookWsq.jpeg\";\r\n\t\t\t}\r\n\t\t}else{// square is black\r\n\t\t\t//if white piece\r\n\t\t\tif (whitePiece) {\r\n\t\t\t\treturn \"wrookBsq.jpeg\";\r\n\t\t\t}else{//black piece\r\n\t\t\t\treturn \"brookBsq.jpeg\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "void mo12205a(Bitmap bitmap);", "private static final byte[] xfplot_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -60, 16, 0, -65,\n\t\t\t\t3, 28, -1, 0, 21, -1, 0, 68, 0, 0, 0, -1, 0, 114, -1, 0, -70,\n\t\t\t\t-18, 0, -1, -1, 0, -27, -52, 0, -1, -78, 0, -1, -121, 0, -1,\n\t\t\t\t59, 0, -1, 93, 0, -1, 0, -112, -1, 0, 102, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t\t\t\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t\t\t\t0, 0, 0, 0, 0, 0, 33, -7, 4, 1, 0, 0, 16, 0, 44, 0, 0, 0, 0,\n\t\t\t\t16, 0, 16, 0, 0, 5, 103, 32, 36, -114, 16, 0, -112, 40, 25,\n\t\t\t\t-84, 65, -102, 10, -80, -112, 14, 36, 97, -33, 40, 61, 22,\n\t\t\t\t-123, -51, -25, 35, -61, -31, -64, 27, 26, 72, 58, 8, -62, 32,\n\t\t\t\t60, 48, 17, 72, 81, 2, 65, 125, 82, 19, 35, 93, 98, 75, -67,\n\t\t\t\t110, -77, 16, -123, 88, -79, -35, -114, 21, -94, -63, -126,\n\t\t\t\t-63, 62, -117, -39, -116, 5, -92, -31, 120, -40, -31, 112, -5,\n\t\t\t\t-61, -47, -128, 12, 6, 122, 11, -126, 11, 122, 127, 72, -128,\n\t\t\t\t15, -126, 118, -122, 46, 127, 14, 14, -116, 46, 35, 13, 125,\n\t\t\t\t41, 33, 0, 59 };\n\t\treturn data;\n\t}", "IMG createIMG();", "private ByteArrayOutputStream convertPEI2Rtf() throws PDFException {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n Document document = new Document();\n\n try {\n //Set the document properties\n setProperties(document);\n //Set the print writer\n RtfWriter2 writer = RtfWriter2.getInstance(document, baos);\n\n writer.setAutogenerateTOCEntries(true);\n\n setHeaderFooter(headerLeft, headerRight, writer);\n\n document.open();//Open the document\n Image img = installationPhoto != null ? PlanExportUtil.getImage(installationPhoto) : null;\n for (int i = 0; i < 5; i++) {\n document.add(new Paragraph(Chunk.NEWLINE));\n }\n createCoverTable(document, img);\n document.newPage();\n\n // Create a Paragraph and add the table of contents to it\n Paragraph par = new Paragraph(new Chunk(Chunk.NEWLINE));\n par.add(new RtfTableOfContents(getMessage(\"pei.export.table.of.contents.update\")));\n par.setFont(getFontNormal());\n document.add(par);\n\n buildDocument(null, document, folderToExport, resources.getLocale(), false);//Let's build it\n document.close();//Close it\n writer.close();\n } catch (DocumentException e) {\n throw new PDFException(\"Error while creating RTF \" + e.getMessage(), e);\n } catch (IOException e) {\n throw new PDFException(\"Error while creating RTF \" + e.getMessage(), e);\n }\n return baos;\n }", "public Image getFlat();", "public byte[] decode_text(byte[] image) {\n int length = 0;\n int offset = 32;\n // loop through 32 bytes of data to determine text length\n for (int i = 0; i < 32; ++i) // i=24 will also work, as only the 4th\n // byte contains real data\n {\n length = (length << 1) | (image[i] & 1);\n }\n\n byte[] result = new byte[length];\n\n // loop through each byte of text\n for (int b = 0; b < result.length; ++b) {\n // loop through each bit within a byte of text\n for (int i = 0; i < 8; ++i, ++offset) {\n // assign bit: [(new byte value) << 1] OR [(text byte) AND 1]\n result[b] = (byte) ((result[b] << 1) | (image[offset] & 1));\n }\n }\n return result;\n }", "SurfaceTexture mo17006a();", "public void ocrExtraction(BufferedImage image) {\n\t\tFile outputfile = new File(\"temp.png\");\n\t\toutputfile.deleteOnExit();\n\t\tString ocrText = \"\", currLine = \"\";\n\t\ttry {\n\t\t\tImageIO.write(image, \"png\", outputfile);\n\n\t\t\t// System call to Tesseract OCR\n\t\t\tRuntime r = Runtime.getRuntime();\n\t\t\tProcess p = r.exec(\"tesseract temp.png ocrText -psm 6\");\n//\t\t\tProcess p = r.exec(\"tesseract temp.png ocrText\");\n\t\t\tp.waitFor();\n\n\t\t\t// Read text file generated by tesseract\n\t\t\tFile f = new File(\"ocrText.txt\");\n\t\t\tf.deleteOnExit();\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\t\t\n\t\t\twhile ((currLine = br.readLine()) != null) {\n\t\t\t\tocrText += (currLine + \" \");\n\t\t\t}\n\t\t\tif(ocrText.trim().isEmpty()) {\n\t\t\t\tocrText = \"OCR_FAIL\";\n\t\t\t}\n\t\t\tbr.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttextField.setText(ocrText.trim());\n\t\ttextField.requestFocus();\n\t\ttextField.selectAll();\n\t}", "public Bitmap EncodeBitmap(Bitmap bitmap, String message){\n\n ArrayList<Boolean> srcBin = ToBinArray(message.getBytes());\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(bitmap.getByteCount());\n bitmap.copyPixelsToBuffer(byteBuffer);\n byte[] byteArray = byteBuffer.array();\n\n ArrayList<Byte> bytes = new ArrayList<>();\n\n for (int i = 0; i < 54; i++) {\n bytes.add(byteArray[i]);\n }\n\n for (int i = 54; i < byteArray.length; i++) {\n byte b = byteArray[i];\n\n b &= 0xFE;\n\n if (i-54<srcBin.size()){\n if(srcBin.get(i-54)){\n b |= 1 << 0;\n }\n }\n\n bytes.add(b);\n\n }\n\n\n\n byte[] encodedByteArray = toByteArray(bytes);\n\n // Convert to Bitmap\n Bitmap.Config configBmp = Bitmap.Config.valueOf(bitmap.getConfig().name());\n Bitmap bitmap_tmp = Bitmap.createBitmap(bitmap.getWidth(),bitmap.getHeight(), configBmp);\n ByteBuffer buffer = ByteBuffer.wrap(encodedByteArray);\n bitmap_tmp.copyPixelsFromBuffer(buffer);\n\n return bitmap_tmp;\n }", "protected double toPounds(double weightOunces){\n\t\treturn 0.0625 * weightOunces;\n\t}", "public Image getTieOver();", "private String MiniOneConversion() {\n int reading = ((raw[22] & 0xF0) >> 4) + ((raw[23] & 0x3F) << 4);\n\n Map<String, BigDecimal> variables = new HashMap<String, BigDecimal>();\n variables.put(\"x\", new BigDecimal(reading));\n BigDecimal result = m1Conv.eval(variables);\n return result.setScale(3, RoundingMode.UP) + \"\";\n }", "void exports(String text,String name){\n BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);\n Graphics2D g2d = img.createGraphics();\n Font font = new Font(\"Arial\", Font.PLAIN, 48);\n g2d.setFont(font);\n FontMetrics fm = g2d.getFontMetrics();\n int width = fm.stringWidth(text);\n int height = fm.getHeight();\n g2d.dispose();\n\n img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n g2d = img.createGraphics();\n g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);\n g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);\n g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);\n g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);\n g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);\n g2d.setFont(font);\n fm = g2d.getFontMetrics();\n g2d.setColor(Color.BLACK);\n g2d.drawString(text, 0, fm.getAscent());\n g2d.dispose();\n try {\n ImageIO.write(img, \"png\", new File(name+\".png\"));\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n }", "public void ToImage(){\n\t\tint row=SL.length;\n\t\tint col=SL[0].length;\n\t\tint cr=0;\n\t\tint cb=0;\n\t\t// System.out.println(row+\" \"+col);\n\t\tint[] intArray = new int[3*row*col];\n\t\tint w=row;\n\t int h=col;\n\t BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);\n\t\tint pixel = 0;\n\t\tfor(int x=0;x<row;x++){\n\t\t\tfor(int y=0;y<col;y++){\n\t\t\t\tint rByte = (int)(SL[x][y]);\n\t\t int gByte = (int)(SL[x][y]);\n\t\t int bByte = (int)(SL[x][y]);\n\t\t \n\t\t // int rByte = (int)(SL[x][y]+1.402*(cr-128));\n\t\t // int gByte = (int)(SL[x][y]-0.3414*(cb-128)-0.71414*(cr-128));\n\t\t // int bByte = (int)(SL[x][y]+1.772*(cb-128));\n\t\t int rgb = (rByte *65536) + (gByte * 256) + bByte;\n\t\t image.setRGB(x,y,rgb);\n\t \t}\n\t\t}\n\t try {\n\t ImageIO.write(image, \"bmp\", new File(\"\"+picture_num+\".png\"));\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t }\n\t}", "private void generarPNG(String nombre, String entrada) {\n try {\n String ruta = this.pathGuardado + \"/\" + nombre + \".dot\";\n File file = new File(ruta);\n // Si el archivo no existe es creado\n if (!file.exists()) {\n file.createNewFile();\n }\n FileWriter fw = new FileWriter(file);\n BufferedWriter bw = new BufferedWriter(fw);\n bw.write(entrada);\n bw.close();\n// //Generar Imagen creada por .dot\n ControlTerminal controlTer = new ControlTerminal(ruta, this.pathGuardado + \"/\" + nombre + \".png\");\n controlTer.generarImagen();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void pintarMesa() {\n try {\n mesa = ImageIO.read(new File(\"src/imagenes/Mesa.jpg\")).getScaledInstance(1600, 1300, Image.SCALE_SMOOTH);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private String soundConversion() {\n int reading = (record[18] & 255) + ((record[21] & 0x0C) << 6);\n return (reading * 100) / 1024 + \"\";\n }", "private void enhanceImage(){\n }", "public TE doInBackground(byte[]... data) {\n return PhotoModule.this.convertN21ToBitmap(data[0]);\n }", "public static void copyChatImageExtStg(String imageName) {\n File fromFile = new File(PathUtil.getInternalChatImageTempUri().getPath());\n if(fromFile.exists()) {\n File toFile = PathUtil.createExternalChatImageFile(imageName);\n copy(fromFile, toFile);\n //LogUtil.e(\"StorageUtil\", \"copyChatImageExtStg\");\n }\n }", "public SbMatrix\ngetObjectToImage( SoNode node) \n//\n////////////////////////////////////////////////////////////////////////\n{\n getMatrix(node);\n return matrixAction.getTextureMatrix();\n}", "public void imagepackets(String quality) {\t\t// error or free\r\n\tint k;\r\n\tModem modem = setmodem(10000, 2000); // creates and initializes modem\r\n\r\n\tFileOutputStream fout = makefile(\"image\", \".jpeg\");\t// opening file to store input data\r\n\r\n\tString img; \r\n\t \r\n\tif (quality == \"error\")\r\n\t\timg = imgerror;\r\n\telse img = imgfree;\r\n\t \r\n\tmodem.open(\"ithaki\");\r\n\t\r\n\tfor ( ; ; ) { //// it's for emptying the initial message\r\n\t\ttry {\r\n\t\tk=modem.read();\r\n\t\tif (k==-1){ break;}\r\n\t \r\n\t\t\tSystem.out.print((char)k);\r\n\t \r\n\t\t} catch (Exception x) {\r\n\t\t\tbreak;\r\n\t \r\n\t\t}\r\n\t \r\n\t}\r\n\t\r\n\tfor (int i = 0; i<1; i++){\t\r\n\t\t\r\n\t\tmodem.write(img.getBytes()); \r\n\r\n\t\tfor ( ; ; ) { //// it's for reading the characters\r\n\t\t\r\n\t\t\ttry {\r\n\t\t \r\n\t\t\t\tk=modem.read();\r\n\t\t\t\tif (k==-1){fout.write(\"\\r\\n\".getBytes()); break;}\r\n\t \r\n\t\t\t\tSystem.out.print((char)k);\r\n\t \r\n\t\t\t\tfout.write(k);\r\n\t \r\n\t\t\t} catch (Exception x) {\r\n\t\t\t\tbreak;\r\n\t \r\n\t\t\t}\r\n\t \r\n\t\t}\r\n\t \r\n\t }\r\n\tmodem.close();\r\n }", "Imagem getImagem();", "void seTubeUpImage(String image);", "public void write(String filename) throws IOException {\n \t\n\t\tFileOutputStream os = null;\n\t\ttry {\n\t\t \tos = new FileOutputStream(new File(\"./OutputImage.txt\"));\n\t\t\tString header = (\"P6\\n\" + width + \"\\n\" + height + \"\\n255\\n\")//.getBytes() missing for converting the string into bytes;\n\t\t\t// For P6 there is no \\n after each spec. Use: new (\"P6 \"+width+\" \"+h+\" 255\\n\").getBytes())\n\t\t\tos.write(header);\n\t\t\tos.write(data);\n\t\t} catch (IOException e) {\n\t\t \t e.printStackTrace();\n\t\t}finally{\n\t\t try {\n\t\t\tos.close();\n\t\t } catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t \t}\n \t}\n \n\n}", "private String asciiImage(final boolean target) {\n \t\tfinal String newLine = System.getProperty(\"line.separator\");\n \t\tfinal StringBuilder sb = new StringBuilder();\n \t\tfinal int step = maxContrib / 4;\n \t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\t\tif (contrib[y][x] == null) {\n \t\t\t\t\tsb.append(\" \");\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tfinal int value =\n \t\t\t\t\ttarget ? contrib[y][x].target : contrib[y][x].current;\n \t\t\t\tfinal int index = (value - 1) / step;\n \t\t\t\tsb.append(CAL_ASCII.charAt(index));\n \t\t\t}\n \t\t\tsb.append(newLine);\n \t\t}\n \t\treturn sb.toString();\n \t}", "public static Texture getTut(){\n //set a linear filter to clean image\n tuts.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);\n //return image\n return tuts;\n }", "private void speak() {\n String s = textArea.getText();\n String s5=\"images\\\\\";\n String s4=\".jpeg\";\n String obj=s5+s+s4;\n ImageIcon ic1=new ImageIcon(obj);\n Image image1=ic1.getImage().getScaledInstance(image.getWidth(),image.getHeight(),Image.SCALE_AREA_AVERAGING);\n ImageIcon icon1=new ImageIcon(image1);\n image.setIcon(icon1);\n int i = textArea.getCaretPosition();\n int k = s.length();\n for (int j = i; j <= k - 1; j++) {\n char c = s.charAt(j);\n String s3 = Character.toString(c);\n s2 = s2 + s3;\n }\n VoiceManager voiceManager = VoiceManager.getInstance();\n helloVoice = voiceManager.getVoice(\"kevin16\");\n helloVoice.allocate();\n helloVoice.speak(s2);\n helloVoice.deallocate();\n playB.setText(\"PLAY\");\n }", "public ImageConverter() {\n\t}", "@Override\n\tpublic AbstractTroisFrommage createTroisFrommage() {\n\t\treturn new TroisFrommageSN();\n\t}", "private static final byte[] pkgload_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 0, 0,\n\t\t\t\t0, -91, 42, 42, -128, -128, -128, 94, 94, 94, -1, -1, -1, -1,\n\t\t\t\t-1, 0, -64, -64, -64, 94, 24, 24, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, 33, -2, 14, 77, 97, 100, 101, 32, 119, 105, 116, 104, 32,\n\t\t\t\t71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0, 8, 0, 44, 0, 0, 0, 0,\n\t\t\t\t16, 0, 16, 0, 0, 4, 88, 16, 73, 32, 103, -67, 8, -128, 64, 51,\n\t\t\t\t-17, -43, 22, -116, -38, 72, 98, -101, 38, 12, 37, 120, 1, 66,\n\t\t\t\t60, -60, 84, 44, -124, -33, -38, 18, -4, 45, -110, 63, 78, -63,\n\t\t\t\t64, -16, -91, 14, -100, -49, 112, 120, -53, 108, -112, 74, -61,\n\t\t\t\t-14, 102, -85, 90, -103, 8, 1, 111, -53, 45, 2, 10, 84, -62,\n\t\t\t\t82, 74, 30, -62, -102, -38, -79, 90, 0, -109, 104, -53, -16,\n\t\t\t\t66, -37, 77, -120, -109, -39, 21, -85, -98, 29, 1, 0, 59 };\n\t\treturn data;\n\t}", "private void getBinaryImage() {\n //apply gaussianfilter\n Imgproc.GaussianBlur(currentGray, currentGray, new Size(gauss,gauss), 0);\n\n // subtract backgroundGray from current image and store in currentGray\n Core.subtract(currentGray, backgroundGray, currentGray);\n\n //get Binary image using Otsu\n Imgproc.threshold(currentGray, binary, 0, 255, Imgproc.THRESH_BINARY + Imgproc.THRESH_OTSU);\n }", "public static String type2pic(int type) {\r\n\t\tswitch(type) {\r\n\t\t\tcase CW_TRADITIONAL:\treturn CW_PIC_TRADITIONAL;\r\n\t\t\tcase CW_MULTI:\t\t\treturn CW_PIC_MULTI;\r\n\t\t\tcase CW_VIRTUAL:\t\treturn CW_PIC_VIRTUAL;\r\n\t\t\tcase CW_LETTERBOX:\t\treturn CW_PIC_LETTERBOX;\r\n\t\t\tcase CW_EVENT:\t\t\treturn CW_PIC_EVENT;\r\n\t\t\tcase CW_QUIZ:\t\t\treturn CW_PIC_QUIZ;\r\n\t\t\tcase CW_UNKNOWN:\t\treturn CW_PIC_UNKNOWN;\r\n\t\t\tcase CW_MOVING:\t\t\treturn CW_PIC_MOVING;\r\n\t\t\tcase CW_DRIVE_IN:\t\treturn CW_PIC_DRIVE_IN;\r\n\t\t\tcase CW_WEBCAM:\t\t\treturn CW_PIC_WEBCAM;\r\n\t\t\tcase CW_LOCATIONLESS:\treturn CW_PIC_LOCATIONLESS;\r\n\t\t\tcase CW_CITO:\t\t\treturn CW_PIC_CITO;\r\n\t\t\tcase CW_EARTH:\t\t\treturn CW_PIC_EARTH;\r\n\t\t\tcase CW_MEGA_EVENT:\t\treturn CW_PIC_MEGA_EVENT;\r\n\t\t\tcase CW_WHERIGO:\t return CW_PIC_WHERIGO;\r\n\t\t\tcase CW_PARKING:\t\treturn CW_PIC_PARKING;\r\n\t\t\tcase CW_STAGE_OF_MULTI:\treturn CW_PIC_STAGE_OF_MULTI;\r\n\t\t\tcase CW_QUESTION:\t\treturn CW_PIC_QUESTION;\r\n\t\t\tcase CW_FINAL:\t\t\treturn CW_PIC_FINAL;\r\n\t\t\tcase CW_TRAILHEAD:\t\treturn CW_PIC_TRAILHEAD;\r\n\t\t\tcase CW_REFERENCE:\t\treturn CW_PIC_REFERENCE;\r\n\t\t\tdefault:\t\treturn \"no_picture.png\";\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n try {\n File image = new File(\"petite_image.png\");\n ImageSerializer serializer = new ImageSerializerBase64Impl();\n\n // Sérialization\n String encodedImage = (String) serializer.serialize(image);\n System.out.println(splitDisplay(encodedImage,76));\n\n // Désérialisation\n byte[] deserializedImage = (byte[]) serializer.deserialize(encodedImage);\n\n // Vérifications\n // 1/ Automatique\n assert (Arrays.equals(deserializedImage, Files.readAllBytes(image.toPath())));\n System.out.println(\"Cette sérialisation est bien réversible :)\");\n // 2/ Manuelle\n File extractedImage = new File(\"petite_image_extraite.png\");\n new FileOutputStream(extractedImage).write(deserializedImage);\n System.out.println(\"Je peux vérifier moi-même en ouvrant mon navigateur de fichiers et en ouvrant l'image extraite dans le répertoire de ce Test\");\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public JavaImageConverter (SProperties props) {\n Runtime rt = Runtime.getRuntime ();\n long max = rt.maxMemory ();\n\tmaxImageSize = max / 4;\n\tString sq = props.getProperty (\"quality\", STD_QUALITY);\n\tquality = Float.parseFloat (sq);\n }" ]
[ "0.55649096", "0.5350051", "0.53304666", "0.5277065", "0.5186151", "0.5163378", "0.5135969", "0.503843", "0.5002752", "0.4987604", "0.4963655", "0.49606407", "0.49143142", "0.48910815", "0.4885245", "0.48560703", "0.48479494", "0.4841581", "0.48309702", "0.48112237", "0.48057255", "0.48014286", "0.47935554", "0.47784278", "0.47570238", "0.47528285", "0.474344", "0.4731371", "0.4724125", "0.47212014", "0.47210443", "0.47040263", "0.4700663", "0.4698673", "0.467989", "0.4678578", "0.46763742", "0.46575102", "0.46508554", "0.4647585", "0.46448165", "0.46412966", "0.4618816", "0.46129146", "0.46120802", "0.4611799", "0.46078128", "0.45911044", "0.45875335", "0.4578326", "0.45761904", "0.45610586", "0.45550507", "0.45513844", "0.45448425", "0.45428526", "0.45326626", "0.4529344", "0.45248407", "0.45111448", "0.4506983", "0.450649", "0.45062923", "0.4505764", "0.45006844", "0.44918558", "0.44904876", "0.44854614", "0.44724673", "0.4466176", "0.4464374", "0.44583973", "0.444842", "0.44437566", "0.44405296", "0.4436658", "0.44247866", "0.4423682", "0.44233888", "0.44133672", "0.4406629", "0.44041732", "0.43944848", "0.4391181", "0.43827835", "0.43814516", "0.43800175", "0.43785542", "0.43782037", "0.4377226", "0.43722808", "0.4370532", "0.43678388", "0.4366572", "0.43661666", "0.43539825", "0.43491665", "0.4343165", "0.4337654", "0.4337277" ]
0.55965036
0
Quantize the image by decreasing the bits per pixels to the values specified.
public @NotNull Image quantize(int rBpp, int gBpp, int bBpp, int aBpp) { if (this.data != null) { Color.Buffer pixels = Objects.requireNonNull(getColorData()); this.data.free(); // free old image data this.format = ColorFormat.RGBA; this.data = Color.malloc(this.format, this.width * this.height); this.mipmaps = 1; Color color; int r, g, b, a; int rs = (1 << rBpp) - 1; int gs = (1 << gBpp) - 1; int bs = (1 << bBpp) - 1; int as = (1 << aBpp) - 1; for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width; x++) { color = pixels.get(y * this.width + x); // This "CAN" be simplified, but we need the precision to be lost. r = rs > 0 ? ((((color.r() + (127 / rs)) * rs) / 255) * 255) / rs : 0; g = gs > 0 ? ((((color.g() + (127 / gs)) * gs) / 255) * 255) / gs : 0; b = bs > 0 ? ((((color.b() + (127 / bs)) * bs) / 255) * 255) / bs : 0; a = as > 0 ? ((((color.a() + (127 / as)) * as) / 255) * 255) / as : 255; this.data.put(y * this.width + x, r, g, b, a); } } pixels.free(); } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public @UInt32 int getQuantizationBits();", "public static int offsetBits_quality() {\n return 48;\n }", "protected void reduceBitmapMode(BufferedImage img, int xoffs, int yoffs) {\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histograms = new Map[(img.getWidth() + 7) / 8];\n \t\t@SuppressWarnings(\"unchecked\")\n \t\tMap<Integer, Integer>[] histogramSides = new Map[(img.getWidth() + 7) / 8];\n \t\t\n \t\t// be sure we select the 8 pixel groups sensibly\n \t\tif ((xoffs & 7) > 3)\n \t\t\txoffs = (xoffs + 7) & ~7;\n \t\telse\n \t\t\txoffs = xoffs & ~7;\n \t\t\n \t\tint width = img.getWidth();\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\t// first scan: get histogram for each range\n \t\t\t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = new HashMap<Integer, Integer>();\n \t\t\t\tMap<Integer, Integer> histogramSide = new HashMap<Integer, Integer>();\n \t\t\t\t\n \t\t\t\thistograms[x / 8] = histogram;\n \t\t\t\thistogramSides[x / 8] = histogramSide;\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\tint scmx;\n \t\t\t\tint scmn;\n \t\t\t\t\n \t\t\t\t// scan outside the 8 pixels to get a broader\n \t\t\t\t// idea of what colors are important\n \t\t\t\tscmn = Math.max(0, x - 4);\n \t\t\t\tscmx = Math.min(width, maxx + 4);\n \t\t\t\t\n \t\t\t\tint pixel = 0;\n \t\t\t\tfor (int xd = scmn; xd < scmx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tpixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tMap<Integer, Integer> hist = (xd >= x && xd < maxx) ? histogram : histogramSide;\n \t\t\t\t\t\n \t\t\t\t\tInteger cnt = hist.get(pixel);\n \t\t\t\t\tif (cnt == null)\n \t\t\t\t\t\tcnt = 1;\n \t\t\t\t\telse\n \t\t\t\t\t\tcnt++;\n \t\t\t\t\t\n \t\t\t\t\thist.put(pixel, cnt);\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\n \t\t\tfor (int x = 0; x < width; x += 8) {\n \t\t\t\tMap<Integer, Integer> histogram = histograms[x / 8];\n \t\t\t\tMap<Integer, Integer> histogramSide = histogramSides[x / 8];\n \t\t\t\t\n \t\t\t\tint maxx = x + 8 < width ? x + 8 : width;\n \t\t\t\t\n \t\t\t\t// get prominent colors, weighing colors that also\n \t\t\t\t// appear in surrounding pixels higher \n \t\t\t\tList<Pair<Integer, Integer>> sorted = new ArrayList<Pair<Integer,Integer>>();\n \t\t\t\tfor (Map.Entry<Integer, Integer> entry : histogram.entrySet()) {\n \t\t\t\t\tInteger c = entry.getKey();\n \t\t\t\t\tint cnt = entry.getValue() * 2;\n \t\t\t\t\tInteger scnt = histogramSide.get(c);\n \t\t\t\t\tif (scnt != null)\n \t\t\t\t\t\tcnt += scnt;\n \t\t\t\t\tsorted.add(new Pair<Integer, Integer>(c, cnt));\n \t\t\t\t}\n \t\t\t\tCollections.sort(sorted, new Comparator<Pair<Integer, Integer>>() {\n \t\n \t\t\t\t\t@Override\n \t\t\t\t\tpublic int compare(Pair<Integer, Integer> o1,\n \t\t\t\t\t\t\tPair<Integer, Integer> o2) {\n \t\t\t\t\t\treturn o2.second - o1.second;\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t});\n \t\n \t\t\t\tint fpixel, bpixel;\n \t\t\t\tif (sorted.size() >= 2) {\n \t\t\t\t\tfpixel = sorted.get(0).first;\n \t\t\t\t\tbpixel = sorted.get(1).first;\n \t\t\t\t} else {\n \t\t\t\t\tfpixel = bpixel = sorted.get(0).first;\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tint newPixel = 0;\n \t\t\t\tfor (int xd = x; xd < maxx; xd++) {\n \t\t\t\t\tif (xd < width)\n \t\t\t\t\t\tnewPixel = img.getRGB(xd, y);\n \t\t\t\t\t\n \t\t\t\t\tif (newPixel != fpixel && newPixel != bpixel) {\n \t\t\t\t\t\tif (fpixel < bpixel) {\n \t\t\t\t\t\t\tnewPixel = newPixel <= fpixel ? fpixel : bpixel;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tnewPixel = newPixel < bpixel ? fpixel : bpixel;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\timageData.setPixel(xd + xoffs, y + yoffs, newPixel);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public static int sizeBits_quality() {\n return 16;\n }", "private Bitmap processBitmap(Bitmap bitmap) {\n Bitmap pic = bitmap.copy(Bitmap.Config.ARGB_8888, true);\n\n // Get dimensions to base the following work off of.\n int picHeight = pic.getHeight();\n int picWidth = pic.getWidth();\n\n // In this block we're go to change every pixel to the closest 3-bit value. Then we're\n // going to \"dither\", or randomize, the adjacent, further pixels as to make the image\n // look more cleaner... for a 3-bit looking image that is... Ha!\n int x, y, oldPixel, newPixel;\n int quantError, rightPixel, bottomRightPixel, bottomPixel, bottomLeftPixel;\n for(y=0; y<picHeight; y++) {\n for(x=0; x<picWidth; x++) {\n oldPixel = pic.getPixel(x, y);\n newPixel = colorPicker(oldPixel);\n pic.setPixel(x, y, newPixel);\n\n quantError = computeQuantizationError(oldPixel, newPixel);\n\n if(x+1 < picWidth) { // Right pixel\n rightPixel = pic.getPixel(x+1, y);\n pic.setPixel(x+1, y, ditherPixel(rightPixel, quantError, 7.0/16.0));\n\n if (y+1 < picHeight) { // Right bottom pixel\n bottomRightPixel = pic.getPixel(x+1, y+1);\n pic.setPixel(x + 1, y+1, ditherPixel(bottomRightPixel, quantError, 1.0/16.0));\n }\n }\n if(y+1 < picHeight) { // Bottom pixel\n bottomPixel = pic.getPixel(x, y+1);\n pic.setPixel(x, y+1, ditherPixel(bottomPixel, quantError, 5.0/16.0));\n\n if (x-1 >= 0) { // Left bottom pixel\n bottomLeftPixel = pic.getPixel(x-1, y+1);\n pic.setPixel(x-1, y+1, ditherPixel(bottomLeftPixel, quantError, 3.0/16.0));\n }\n }\n }\n }\n\n return pic;\n }", "public void set_quality(int value) {\n setUIntBEElement(offsetBits_quality(), 16, value);\n }", "private Picture saturate(Picture p, double saturateFactor) {\n\t\tPicture output = copy(p);\n\t\tdouble f = saturateFactor / 100.0;\n\n\t\tfor (int i = 0; i < p.getWidth(); i++) {\n\t\t\tfor (int j = 0; j < p.getHeight(); j++) {\n\t\t\t\tCoordinate c = new Coordinate(i, j);\n\t\t\t\tdouble b = p.getPixel(c).getIntensity();\n\t\t\t\tif (f < 0) {\n\t\t\t\t\tdouble oldRed = p.getPixel(c).getRed();\n\t\t\t\t\tdouble oldGreen = p.getPixel(c).getGreen();\n\t\t\t\t\tdouble oldBlue = p.getPixel(c).getBlue();\n\t\t\t\t\tdouble newRed = oldRed * (1.0 + (f)) - (b * f);\n\t\t\t\t\tdouble newGreen = oldGreen * (1.0 + (f)) - (b * f);\n\t\t\t\t\tdouble newBlue = oldBlue * (1.0 + (f)) - (b * f);\n\t\t\t\t\tdouble[] outs = limits(newRed, newGreen, newBlue);\n\t\t\t\t\toutput.setPixel(c, new ColorPixel(outs[0], outs[1], outs[2]));\n\t\t\t\t} else if (f > 0) {\n\t\t\t\t\tdouble oldRed = p.getPixel(c).getRed();\n\t\t\t\t\tdouble oldGreen = p.getPixel(c).getGreen();\n\t\t\t\t\tdouble oldBlue = p.getPixel(c).getBlue();\n\t\t\t\t\tdouble a = oldRed;\n\t\t\t\t\tif (oldGreen > oldRed && oldGreen > oldBlue) {\n\t\t\t\t\t\ta = oldGreen;\n\t\t\t\t\t} else if (oldBlue > oldRed && oldBlue > oldGreen) {\n\t\t\t\t\t\ta = oldBlue;\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdouble newRed = oldRed * ((a + ((1.0 - a) * (f))) / a);\n\t\t\t\t\t\tdouble newGreen = oldGreen * ((a + ((1.0 - a) * (f))) / a);\n\t\t\t\t\t\tdouble newBlue = oldBlue * ((a + ((1.0 - a) * (f))) / a);\n\t\t\t\t\t\tdouble[] outs = limits(newRed, newGreen, newBlue);\n\t\t\t\t\t\toutput.setPixel(c, new ColorPixel(outs[0], outs[1], outs[2]));\n\t\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\t\toutput.setPixel(c, new ColorPixel(0, 0, 0));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.setPixel(c, p.getPixel(c));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}", "public void maximizeIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tintensity[row][col] = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t }\r\n\t}\r\n }", "public void setQuantizationBits(\r\n\t\t\t@UInt32 int bitsCount)\r\n\t\tthrows IllegalArgumentException;", "List<List<Pixel>> filter(Image img, int multiplier, String operation);", "public native boolean quantizeImage(QuantizeInfo quantizeInfo)\n\t\t\tthrows MagickException;", "private void equalize(BufferedImage img) {\n \t\tfloat minSat = Float.MAX_VALUE, maxSat = Float.MIN_VALUE;\n \t\tfloat minVal = Float.MAX_VALUE, maxVal = Float.MIN_VALUE;\n \t\t\n \t\tint[] prgb = { 0, 0, 0 };\n \t\tfloat[] hsv = { 0, 0, 0 };\n \t\t\n \t\tint[] valCount = new int[16];\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\tminSat = Math.min(hsv[1], minSat);\n \t\t\t\tmaxSat = Math.max(hsv[1], maxSat);\n \t\t\t\tminVal = Math.min(hsv[2], minVal);\n \t\t\t\tmaxVal = Math.max(hsv[2], maxVal);\n \t\t\t\tvalCount[(int) (hsv[2] / 16)]++;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint maxPt = -1;\n \t\tfor (int i = 1; i < 15; i++) {\n \t\t\tif (maxPt == -1 || valCount[i] >= valCount[maxPt]) {\n \t\t\t\tmaxPt = i;\n \t\t\t}\n \t\t}\n \t\t\n \t\tint valueMidpoint = maxPt * 16;\n \t\t\n \t\tSystem.out.println(\"Equalize: sat = \"+minSat+\" to \" +maxSat+\"; val = \" + minVal + \" to \" + maxVal+\"; value midpoint = \" + valueMidpoint);\n \t\tfloat satScale = 1.0f - minSat;\n \t\tfloat valScale = 255 - minVal;\n \t\tfloat satDiff = maxSat - minSat;\n \t\tfloat valDiff = maxVal - minVal;\n \t\t\n \t\tfor (int y = 0; y < img.getHeight(); y++) {\n \t\t\tfor (int x = 0; x < img.getWidth(); x++) {\n \t\t\t\tint pixel = img.getRGB(x, y);\n \t\t\t\tpixelToRGB(pixel, prgb);\n \t\t\t\trgbToHsv(prgb[0], prgb[1], prgb[2], hsv);\n \t\t\t\t\n \t\t\t\tif (satDiff < 0.5)\n \t\t\t\t\thsv[1] = ((hsv[1] - minSat) / satDiff) * satScale + minSat;\n \t\t\t\tif (valDiff < 128)\n \t\t\t\t\thsv[2] = ((hsv[2] - minVal) / valDiff) * valScale + minVal;\n \n \t\t\t\thsvToRgb(hsv[0], hsv[1], hsv[2], prgb);\n \t\t\t\t\n \t\t\t\timg.setRGB(x, y, rgb8ToPixel(prgb) | (pixel & 0xff000000));\n \t\t\t}\n \t\t}\n \t}", "public static int offset_quality() {\n return (48 / 8);\n }", "void setBitsPerPixel(int bitsPerPixel);", "public void setMaxBitDepth(int maxValue) {\n/* 460 */ this.maxSample = maxValue;\n/* */ \n/* 462 */ this.maxSampleSize = 0;\n/* 463 */ while (maxValue > 0) {\n/* 464 */ maxValue >>>= 1;\n/* 465 */ this.maxSampleSize++;\n/* */ } \n/* */ }", "int getImageQualityPref();", "private void compact(int[] values, int maxValue) {\n int blockIndex = 0;\n int bitIndex = 0;\n\n for (int value : values) {\n if (value < 0 || value > maxValue) {\n throw new IllegalArgumentException(\"Bad element: \" + value);\n }\n vector[blockIndex] |= value << bitIndex;\n int b = Math.min(bitNum, BLOCK_SIZE - bitIndex);\n bitIndex += b;\n\n if (bitIndex == BLOCK_SIZE) {\n blockIndex++;\n bitIndex = 0;\n\n if (b < bitNum) {\n vector[blockIndex] |= value >>> b;\n bitIndex = bitNum - b;\n }\n }\n }\n }", "Compress(double[][][] Image){\n \n /** Step 1 */\n R1 = new Reduce(Image);\n A1 = R1.Nearest(2);\n // A1 = R1.Bilinear(2);\n \n /** Step 2 */ \n R2 = new Reduce(A1);\n A2 = R2.Nearest(2);\n //A2 = R2.Bilinear(2);\n \n /** Step 3 */\n R3 = new Reduce(A2);\n A3 = R3.Nearest(2);\n //A3 = R3.Bilinear(2);\n \n /** Step 4 */\n R4 = new Reduce(A3);\n A4 = R4.Nearest(2);\n //A4 = R4.Bilinear(2);\n\n }", "public static double megaBitsToBits(double num) { return (num*Math.exp(6)); }", "int getMaxRawImages();", "private int bigv_bitcount(int [] ix, EChannel gi) {\n\t\tint bits = 0;\n\n\t\tif ( gi.window_switching_flag != 0 && gi.block_type == 2 ) {\n\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t */\n\t\t\tint sfb = 0, window, line, start, end;\n\n\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\tint tableindex;\n\n\t\t\t\tif ( (tableindex = gi.table_select[0]) != 0 )\n\t\t\t\t\tbits += count_bit( ix, 0, gi.address1, tableindex );\n\t\t\t\tsfb = 2;\n\t\t\t}\n\n\t\t\tfor ( ; sfb < 13; sfb++ ) {\n\t\t\t\tint tableindex = 100;\n\n\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\tif ( start < 12 )\n\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\telse\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\tbits += count_bit_short(ix, start, end, tableindex);/*\n for ( line = start; line < end; line += 2 ) {\n for ( window = 0; window < 3; window++ ){\n x = (ix[line * 3 + window ]);\n y = (ix[(line + 1) * 3 + window]);\n\n // x = (i192_3[ line ][ window ]);\n // y = (i192_3[ line + 1 ][ window]);\n\n bits += HuffmanCode( tableindex, x, y );\n }\n }*/\n\t\t\t}\n\t\t} else {\n\n\t\t\tint table;\n\n\t\t\tif( (table = gi.table_select[0] )>=0) // region0\n\t\t\tbits += count_bit(ix, 0, gi.address1, table );\n\t\t\tif( (table = gi.table_select[1])>=0) // region1\n\t\t\t\tbits += count_bit(ix, gi.address1, gi.address2, table );\n\t\t\tif( (table = gi.table_select[2])>=0) // region2\n\t\t\t\tbits += count_bit(ix, gi.address2, gi.address3, table );\n\t\t}\n\n\t\treturn bits;\n\t}", "private static void setG8(BufferedImage image, int x, int y, int value) {\n assert (value >= 0 && value <= 255);\n image.setRGB(x, y, value | (value << 8) | (value << 16));\n }", "public static double megaBytesToBits(double num) { return (num*8*Math.exp(6)); }", "public void pixaveGreyscale(int x1, int y1, int x2, int y2) {\n //float sumr,sumg,sumb;\n float sumg;\n int pix;\n //int r,g,b;\n float g;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n //sumr=sumg=sumb=0.0;\n sumg = 0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n \n // old method use depth image\n //pix= kinecter.depthImg.pixels[i];\n //g = pix & 0xFF; // grey\n //sumg += g;\n \n //b=pix & 0xFF; // blue\n // pix = pix >> 8;\n //g=pix & 0xFF; // green\n //pix = pix >> 8;\n //r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n //sumr += b;//r;//g;//r;\n //sumg += b;//r;//g;\n //sumb += b;//r;//g;//b;\n \n // WORK WITH RAW DEPTH INSTEAD\n sumg += kinecter.rawDepth[i];\n\n \n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n //ar = sumr/n; \n //ag = sumg/n; \n //ab = sumb/n;\n\n ar = sumg/n; \n ag = ar; \n ab = ar;\n }", "long getCollideBits();", "public void adjustIntensity()\r\n {\r\n\tint rows = getHeight();\r\n\tint cols = getWidth();\r\n\tdouble dbL = (double)(L-1);\r\n\tshort maxI;\r\n\tfor (int row = 0; row < rows; row++)\r\n\t{\r\n\t for (int col = 0; col < cols; col++)\r\n\t {\r\n\t\tmaxI = (short)Math.min(L-1, \r\n\t\t Math.round((L-1) * maxIntensity(hue[row][col]/dbL,\r\n\t\t saturation[row][col]/dbL)));\r\n\t\tintensity[row][col] =\r\n\t\t (short)Math.min(intensity[row][col], maxI);\r\n\t }\r\n\t}\r\n }", "void setQuantizerScale(int value)\n {\n quantizerScale = value;\n }", "private int caculateInSampleSize(BitmapFactory.Options options, int width, int height) {\r\n int outWidth = options.outWidth;\r\n int outHeight = options.outHeight;\r\n int inSampleSize=1;\r\n if (outWidth>width||outHeight>height){\r\n int widthRadio= Math.round(outWidth*1.0f/width);\r\n int heightRadio= Math.round(outHeight*1.0f/height);\r\n inSampleSize= Math.max(widthRadio,heightRadio);\r\n }\r\n\r\n return inSampleSize;\r\n }", "private static int setBits(int n) {\r\n int highestBitValue = 1;\r\n int c = 0;\r\n\r\n while (highestBitValue < n) {\r\n highestBitValue = highestBitValue * 2;\r\n }\r\n\r\n \r\n int currentBitValue = highestBitValue;\r\n while (currentBitValue > 0) {\r\n if (currentBitValue <= n) {\r\n\r\n n -= currentBitValue;\r\n c++;\r\n }\r\n currentBitValue = currentBitValue / 2;\r\n }\r\n\r\n return c;\r\n }", "private int computeQuantizationError(int oldPixel, int newPixel) {\n int oldRed, oldGreen, oldBlue, oldAlpha,\n newRed, newGreen, newBlue, newAlpha;\n\n oldRed = Color.red(oldPixel);\n oldGreen = Color.green(oldPixel);\n oldBlue = Color.blue(oldPixel);\n oldAlpha = Color.alpha(oldPixel);\n\n newRed = Color.red(newPixel);\n newGreen = Color.green(newPixel);\n newBlue = Color.blue(newPixel);\n newAlpha = Color.alpha(newPixel);\n\n return Color.argb(newAlpha, oldRed - newRed, oldGreen - newGreen, oldBlue - newBlue);\n }", "private void quantizeWithClamp(int[] out, Vector3f clampedPoint) {\n\n\t\t/*\n\t\t * btVector3 clampedPoint(point); XXX\n\t\tclampedPoint.setMax(m_localAabbMin);\n\t\tclampedPoint.setMin(m_localAabbMax);\n\n\t\t * clampedPoint.clampMax(m_localAabbMax,);\n\t\tclampedPoint.clampMax(m_localAabbMax);\n\t\tclampedPoint.clampMax(m_localAabbMax);\n\n\t\tclampedPoint.clampMin(m_localAabbMin);\n\t\tclampedPoint.clampMin(m_localAabbMin); ///CLAMPS\n\t\tclampedPoint.clampMin(m_localAabbMin);*/\n\n\t\tout[0] = getQuantized(clampedPoint.x);\n\t\tout[1] = getQuantized(clampedPoint.y);\n\t\tout[2] = getQuantized(clampedPoint.z);\n\t}", "public org.apache.spark.sql.catalyst.util.QuantileSummaries compress () { throw new RuntimeException(); }", "public PixImage toPixImage() {\n // Replace the following line with your solution.\n\t PixImage image=new PixImage(getWidth(),getHeight());\n\t \n\t DList<int[]> runs_new=new DList<int[]>();\n\t\t\t for(RunIterator i=this.iterator();i.hasNext();) {\n\t\t\t int[] run = i.next();\n\t\t\t for (int t= 0; t < run[0]; t++) {\n\t\t\t \t runs_new.addLast(run);\n\t\t\t System.out.print(\"(\" + run[1]+\" \"+ run[2]+\" \"+run[3]+\")\");\n\t\t } \n\t }\t\n int position=1;\n for(int j=0;j<height;j++) {\n\t for(int i=0;i<width;i++) {\n\t\t\n\t\t DListNode<int[]> run_new=runs_new.nth(position);\n\t\t position++;\n\t\t \n\t\t image.setPixel(i, j, (short) run_new.item[1], (short) run_new.item[2], (short) run_new.item[3]);\n\t }\n }\n\t\t \n\t\t \n\t return image;\n }", "private int Huffmancodebits( int [] ix, EChannel gi ) {\n\t\tint region1Start;\n\t\tint region2Start;\n\t\tint count1End;\n\t\tint bits, stuffingBits;\n\t\tint bvbits, c1bits, tablezeros, r0, r1, r2;//, rt, pr;\n\t\tint bitsWritten = 0;\n\t\tint idx = 0;\n\t\ttablezeros = 0;\n\t\tr0 = r1 = r2 = 0;\n\n\t\tint bigv = gi.big_values * 2;\n\t\tint count1 = gi.count1 * 4;\n\n\n\t\t/* 1: Write the bigvalues */\n\n\t\tif ( bigv!= 0 ) {\n\t\t\tif ( (gi.mixed_block_flag) == 0 && gi.window_switching_flag != 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t// if ( (gi.mixed_block_flag) == 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t\t */\n\n\t\t\t\tint sfb, window, line, start, end;\n\n\t\t\t\t//int [] scalefac = scalefac_band_short; //da modificare nel caso si convertano mp3 con fs diversi\n\n\t\t\t\tregion1Start = 12;\n\t\t\t\tregion2Start = 576;\n\n\t\t\t\tfor ( sfb = 0; sfb < 13; sfb++ ) {\n\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\t\tif ( start < region1Start )\n\t\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\t\telse\n\t\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tif ( gi.mixed_block_flag!= 0 && gi.block_type == 2 ) { /* Mixed blocks long, short */\n\t\t\t\t\tint sfb, window, line, start, end;\n\t\t\t\t\tint tableindex;\n\t\t\t\t\t//scalefac_band_long;\n\n\t\t\t\t\t/* Write the long block region */\n\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\tif ( tableindex != 0 )\n\t\t\t\t\t\tfor (int i = 0; i < 36; i += 2 ) {\n\t\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\t\t\t\t\t/* Write the short block region */\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( sfb = 3; sfb < 13; sfb++ ) {\n\t\t\t\t\t\tstart = scalefac_band_long[ sfb ];\n\t\t\t\t\t\tend = scalefac_band_long[ sfb+1 ];\n\n\t\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\t\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { /* Long blocks */\n\t\t\t\t\tint scalefac_index = 100;\n\n\t\t\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\t\t\tregion1Start = 36;\n\t\t\t\t\t\tregion2Start = 576;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscalefac_index = gi.region0_count + 1;\n\t\t\t\t\t\tregion1Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t\tscalefac_index += gi.region1_count + 1;\n\t\t\t\t\t\tregion2Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < bigv; i += 2 ) {\n\t\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\t\tif ( i < region1Start ) {\n\t\t\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif ( i < region2Start ) {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[2];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* get huffman code */\n\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\tif ( tableindex!= 0 ) {\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttablezeros += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t\tbvbits = bitsWritten;\n\n\t\t/* 2: Write count1 area */\n\t\tint tableindex = gi.count1table_select + 32;\n\n\t\tcount1End = bigv + count1;\n\t\tfor (int i = bigv; i < count1End; i += 4 ) {\n\t\t\tv = ix[i];\n\t\t\tw = ix[i+1];\n\t\t\tx = ix[i+2];\n\t\t\ty = ix[i+3];\n\t\t\tbitsWritten += huffman_coder_count1(tableindex);\n\t\t}\n\n\t\t// c1bits = bitsWritten - bvbits;\n\t\t// if ( (stuffingBits = gi.part2_3_length - gi.part2_length - bitsWritten) != 0 ) {\n\t\t// int stuffingWords = stuffingBits / 32;\n\t\t// int remainingBits = stuffingBits % 32;\n\t\t//\n\t\t// /*\n\t\t// Due to the nature of the Huffman code\n\t\t// tables, we will pad with ones\n\t\t// */\n\t\t// while ( stuffingWords-- != 0){\n\t\t// mn.add_entry( -1, 32 );\n\t\t// }\n\t\t// if ( remainingBits!=0 )\n\t\t// mn.add_entry( -1, remainingBits );\n\t\t// bitsWritten += stuffingBits;\n\t\t//\n\t\t// }\n\t\treturn bitsWritten;\n\t}", "public int scale(int original);", "private double normalizeImageValue(double value){\n return value/(31);\n }", "public static int clearBitsUpToMS(int n, int i) {\n return n & (1<<i)-1;\n }", "public void fuzzify() {\n ImageArray newCopy = currentIm.copy();\n \n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n for(int rr = 1; rr < rows-1; rr++){\n \n for(int cc = 1; cc < cols-1; cc++){\n fuzPixel(rr,cc,newCopy);\n \n }\n \n }\n \n currentIm = newCopy.copy();\n \n \n }", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "public static int size_quality() {\n return (16 / 8);\n }", "private static void compressSave(Bitmap image, File outFile, int maxSize) throws IOException {\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n // scale\n int options = 80;\n // Store the bitmap into output stream(no compress)\n image.compress(Bitmap.CompressFormat.JPEG, options, os);\n // Compress by loop\n while (os.toByteArray().length / 1024 > maxSize) {\n // Clean up os\n os.reset();\n // interval 10\n options -= 10;\n image.compress(Bitmap.CompressFormat.JPEG, options, os);//\"质量压缩: \" + os.toByteArray().length / 1024 + \"KB\"\n }\n\n // Generate compressed image file\n FileOutputStream fos = new FileOutputStream(outFile);\n fos.write(os.toByteArray());\n fos.flush();\n fos.close();\n }", "public static Bitmap decodeBitmapSize(Bitmap bm, int IMAGE_BIGGER_SIDE_SIZE) {\n Bitmap b = null;\r\n\r\n\r\n //convert Bitmap to byte[]\r\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\r\n bm.compress(Bitmap.CompressFormat.JPEG, 100, stream);\r\n byte[] byteArray = stream.toByteArray();\r\n\r\n //We need to know image width and height, \r\n //for it we create BitmapFactory.Options object and do BitmapFactory.decodeByteArray\r\n //inJustDecodeBounds = true - means that we do not need load Bitmap to memory\r\n //but we need just know width and height of it\r\n BitmapFactory.Options opt = new BitmapFactory.Options();\r\n opt.inJustDecodeBounds = true;\r\n BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length, opt);\r\n int CurrentWidth = opt.outWidth;\r\n int CurrentHeight = opt.outHeight;\r\n\r\n\r\n //there is function that can quick scale images\r\n //but we need to give in scale parameter, and scale - it is power of 2\r\n //for example 0,1,2,4,8,16...\r\n //what scale we need? for example our image 1000x1000 and we want it will be 100x100\r\n //we need scale image as match as possible but should leave it more then required size\r\n //in our case scale=8, we receive image 1000/8 = 125 so 125x125, \r\n //scale = 16 is incorrect in our case, because we receive 1000/16 = 63 so 63x63 image \r\n //and it is less then 100X100\r\n //this block of code calculate scale(we can do it another way, but this way it more clear to read)\r\n int scale = 1;\r\n int PowerOf2 = 0;\r\n int ResW = CurrentWidth;\r\n int ResH = CurrentHeight;\r\n if (ResW > IMAGE_BIGGER_SIDE_SIZE || ResH > IMAGE_BIGGER_SIDE_SIZE) {\r\n while (1 == 1) {\r\n PowerOf2++;\r\n scale = (int) Math.pow(2, PowerOf2);\r\n ResW = (int) ((double) opt.outWidth / (double) scale);\r\n ResH = (int) ((double) opt.outHeight / (double) scale);\r\n if (Math.max(ResW, ResH) < IMAGE_BIGGER_SIDE_SIZE) {\r\n PowerOf2--;\r\n scale = (int) Math.pow(2, PowerOf2);\r\n ResW = (int) ((double) opt.outWidth / (double) scale);\r\n ResH = (int) ((double) opt.outHeight / (double) scale);\r\n break;\r\n }\r\n\r\n }\r\n }\r\n\r\n\r\n //Decode our image using scale that we calculated\r\n BitmapFactory.Options opt2 = new BitmapFactory.Options();\r\n opt2.inSampleSize = scale;\r\n //opt2.inScaled = false;\r\n b = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length, opt2);\r\n\r\n\r\n //calculating new width and height\r\n int w = b.getWidth();\r\n int h = b.getHeight();\r\n if (w >= h) {\r\n w = IMAGE_BIGGER_SIDE_SIZE;\r\n h = (int) ((double) b.getHeight() * ((double) w / b.getWidth()));\r\n } else {\r\n h = IMAGE_BIGGER_SIDE_SIZE;\r\n w = (int) ((double) b.getWidth() * ((double) h / b.getHeight()));\r\n }\r\n\r\n\r\n //if we lucky and image already has correct sizes after quick scaling - return result\r\n if (opt2.outHeight == h && opt2.outWidth == w) {\r\n return b;\r\n }\r\n\r\n\r\n //we scaled our image as match as possible using quick method\r\n //and now we need to scale image to exactly size\r\n b = Bitmap.createScaledBitmap(b, w, h, true);\r\n\r\n\r\n return b;\r\n }", "public void pixave(int x1, int y1, int x2, int y2) {\n float sumr,sumg,sumb;\n int pix;\n int r,g,b;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n sumr=sumg=sumb=0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n pix= kinecter.depthImg.pixels[i];\n b=pix & 0xFF; // blue\n pix = pix >> 8;\n g=pix & 0xFF; // green\n pix = pix >> 8;\n r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n sumr += b;//r;//g;//r;\n sumg += b;//r;//g;\n sumb += b;//r;//g;//b;\n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n ar = sumr/n; \n ag=sumg/n; \n ab=sumb/n;\n }", "private static byte[] m17790a(Bitmap bitmap) {\n int i;\n int i2;\n int i3;\n int width = bitmap.getWidth();\n int height = bitmap.getHeight();\n OutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n for (i = 0; i < 32; i++) {\n byteArrayOutputStream.write(0);\n }\n int[] iArr = new int[(width - 2)];\n bitmap.getPixels(iArr, 0, width, 1, 0, width - 2, 1);\n Object obj = iArr[0] == -16777216 ? 1 : null;\n Object obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n int length = iArr.length;\n width = 0;\n int i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n int i5 = i4;\n int i6 = i5 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i3 = i - 1;\n } else {\n i3 = i;\n }\n iArr = new int[(height - 2)];\n bitmap.getPixels(iArr, 0, 1, 0, 1, 1, height - 2);\n obj = iArr[0] == -16777216 ? 1 : null;\n obj2 = iArr[iArr.length + -1] == -16777216 ? 1 : null;\n length = iArr.length;\n width = 0;\n i4 = 0;\n for (i2 = 0; i2 < length; i2++) {\n if (width != iArr[i2]) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, i2);\n width = iArr[i2];\n }\n }\n if (obj2 != null) {\n i4++;\n C5225r.m17788a(byteArrayOutputStream, length);\n }\n i6 = i4 + 1;\n if (obj != null) {\n i = i6 - 1;\n } else {\n i = i6;\n }\n if (obj2 != null) {\n i--;\n }\n for (i6 = 0; i6 < i3 * i; i6++) {\n C5225r.m17788a(byteArrayOutputStream, 1);\n }\n byte[] toByteArray = byteArrayOutputStream.toByteArray();\n toByteArray[0] = (byte) 1;\n toByteArray[1] = (byte) i5;\n toByteArray[2] = (byte) i4;\n toByteArray[3] = (byte) (i * i3);\n C5225r.m17787a(bitmap, toByteArray);\n return toByteArray;\n }", "public void k() {\n float f2 = BitmapDescriptorFactory.HUE_RED;\n for (float f3 : this.i) {\n if (f3 > BitmapDescriptorFactory.HUE_RED) {\n f2 += f3;\n }\n }\n if (f2 != BitmapDescriptorFactory.HUE_RED) {\n int length = this.i.length;\n for (int i2 = 0; i2 < length; i2++) {\n float[] fArr = this.i;\n if (fArr[i2] > BitmapDescriptorFactory.HUE_RED) {\n fArr[i2] = fArr[i2] / f2;\n }\n }\n }\n }", "@Override\npublic Image operate (Image source)\n{\n final Image thresholdImage = NIVision\n .imaqCreateImage(ImageType.IMAGE_U8, 0);\n\n // @TODO: Store NIVision.Range instead of integers so we don't make a\n // new one every time.\n NIVision.imaqColorThreshold(thresholdImage, source, 255,\n NIVision.ColorMode.HSL, this.hueRange, this.satRange,\n this.lumRange);\n source.free();\n return thresholdImage;\n}", "private void CreateCompression() {\n double[][] Ydct = new double[8][8];\n double[][] Cbdct = new double[8][8];\n double[][] Crdct = new double[8][8];\n\n /*\n Tenemos que coger una matriz de 8x8 que sera nuestro pixel a comprimir. Si la matriz se sale de los parametros\n altura y anchura, haremos padding con 0, para que sea negro.\n */\n\n\n for (int i = 0; i < height; i += 8) {\n for (int j = 0; j < width; j += 8) {\n for (int x = 0; x < 8; ++x) {\n for (int y = 0; y < 8; ++y) {\n if (i + x >= height || j + y >= width) {\n Ydct[x][y] = 0;\n Cbdct[x][y] = 0;\n Crdct[x][y] = 0;\n } else {\n Ydct[x][y] = (double) imagenYCbCr[x + i][y + j][0] - 128;\n Cbdct[x][y] = (double) imagenYCbCr[x + i][y + j][1] - 128;\n Crdct[x][y] = (double) imagenYCbCr[x + i][y + j][2] - 128;\n }\n }\n }\n\n\n /*\n Haremos el DCT2 de cada componente de color para el pixel\n */\n\n\n Ydct = dct2(Ydct);\n Cbdct = dct2(Cbdct);\n Crdct = dct2(Crdct);\n\n /*\n Quantizamos los DCT de cada componente del color\n */\n\n for (int v = 0; v < 8; ++v) {\n for (int h = 0; h < 8; ++h) {\n Ydct[v][h] = Math.round(Ydct[v][h] / QtablesLuminance[quality][v][h]);\n Cbdct[v][h] = Math.round(Cbdct[v][h] / QtablesChrominance[quality][v][h]);\n Crdct[v][h] = Math.round(Crdct[v][h] / QtablesChrominance[quality][v][h]);\n\n }\n }\n\n\n /*\n Hacemos el encoding con Huffman HAY QUE RECORRER EN ZIGZAG CADA MATRIZ\n */\n\n int u = 1;\n int k = 1;\n int contador = 0;\n for (int element = 0; element < 64; ++element, ++contador) {\n Yencoding.add((int) Ydct[u - 1][k - 1]);\n Cbencoding.add((int) Cbdct[u - 1][k - 1]);\n Crencoding.add((int) Crdct[u - 1][k - 1]);\n if ((k + u) % 2 != 0) {\n if (k < 8)\n k++;\n else\n u += 2;\n if (u > 1)\n u--;\n } else {\n if (u < 8)\n u++;\n else\n k += 2;\n if (k > 1)\n k--;\n }\n }\n }\n }\n }", "public void filterImage() {\n\n if (opIndex == lastOp) {\n return;\n }\n\n lastOp = opIndex;\n switch (opIndex) {\n case 0:\n biFiltered = bi; /* original */\n return;\n case 1:\n biFiltered = ImageNegative(bi); /* Image Negative */\n return;\n\n case 2:\n biFiltered = RescaleImage(bi);\n return;\n\n case 3:\n biFiltered = ShiftImage(bi);\n return;\n\n case 4:\n biFiltered = RescaleShiftImage(bi);\n return;\n\n case 5:\n biFiltered = Add(bi, bi1);\n return;\n\n case 6:\n biFiltered = Subtract(bi, bi1);\n return;\n\n case 7:\n biFiltered = Multiply(bi, bi1);\n return;\n\n case 8:\n biFiltered = Divide(bi, bi1);\n return;\n\n case 9:\n biFiltered = NOT(bi);\n return;\n\n case 10:\n biFiltered = AND(bi, bi1);\n return;\n\n case 11:\n biFiltered = OR(bi, bi1);\n return;\n\n case 12:\n biFiltered = XOR(bi, bi1);\n return;\n\n case 13:\n biFiltered = ROI(bi);\n return;\n\n case 14:\n biFiltered = Negative_Linear(bi);\n return;\n\n case 15:\n biFiltered= Logarithmic_function(bi);\n return;\n\n case 16:\n biFiltered = Power_Law(bi);\n return;\n\n case 17:\n biFiltered = LUT(bi);\n return;\n\n case 18:\n biFiltered = Bit_planeSlicing(bi);\n return;\n\n case 19:\n biFiltered = Histogram(bi1,bi2);\n return;\n\n case 20:\n biFiltered = HistogramEqualisation(bi,bi3);\n return;\n\n case 21:\n biFiltered = Averaging(bi1);\n return;\n\n case 22:\n biFiltered = WeightedAveraging(bi1);\n return;\n\n case 23:\n biFiltered = fourNeighbourLaplacian(bi1);\n return;\n\n case 24:\n biFiltered= eightNeighbourLaplacian(bi1);\n return;\n\n case 25:\n biFiltered = fourNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 26:\n biFiltered = eightNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 27:\n biFiltered = Roberts(bi1);\n return;\n\n case 28:\n biFiltered = SobelX(bi1);\n return;\n\n case 29:\n biFiltered = SobelY(bi1);\n return;\n\n case 30:\n biFiltered = Gaussian(bi1);\n return;\n\n case 31:\n biFiltered = LoG (bi1);\n return;\n\n case 32:\n biFiltered = saltnpepper(bi4);\n return;\n\n case 33:\n biFiltered = minFiltering(bi4);\n return;\n\n case 34:\n biFiltered = maxFiltering(bi4);\n return;\n\n case 35:\n biFiltered = maidpointFiltering(bi4);\n return;\n\n case 36:\n biFiltered = medianFiltering(bi4);\n return;\n\n case 37:\n biFiltered = simpleThresholding(bi5);\n return;\n\n case 38:\n biFiltered = automatedThresholding(bi6);\n return;\n\n case 39:\n biFiltered = adaptiveThresholding(bi7);\n return;\n }\n }", "private static int calculateInSampleSize(\n BitmapFactory.Options options, int reqWidth, int reqHeight) {\n final int height = options.outHeight;\n final int width = options.outWidth;\n int inSampleSize = 1;\n\n if (height > reqHeight || width > reqWidth) {\n\n final int halfHeight = height / 2;\n final int halfWidth = width / 2;\n\n // Calculate the largest inSampleSize value that is a power of 2 and keeps both\n // height and width larger than the requested height and width.\n while ((halfHeight / inSampleSize) > reqHeight\n && (halfWidth / inSampleSize) > reqWidth) {\n inSampleSize *= 2;\n }\n }\n\n return inSampleSize;\n}", "public PlanarImage equalize() {\n int sum = 0;\n byte[] cumulative = new byte[256];\n int array[] = getHistogram(source);\n\n float scale = 255.0F / (float) (source.getWidth() *\n source.getHeight()); \n\n for ( int i = 0; i < 256; i++ ) {\n sum += array[i];\n cumulative[i] = (byte)((sum * scale) + .5F);\n }\n\n LookupTableJAI lookup = new LookupTableJAI(cumulative);\n\n ParameterBlock pb = new ParameterBlock();\n pb.addSource(source);\n pb.add(lookup);\n\n return JAI.create(\"lookup\", pb, null);\n }", "@Override\n public void onClick(View arg0) {\n double xmin = -1.5;\n double xmax = 1.5;\n double ymin = -1.5;\n double ymax = 1.5;\n\n int xpix = 250;\n int ypix = 250;\n\n // Create a random number generator and a value for parameter 'c'\n Random rand = new Random();\n double creal = .8*rand.nextDouble()-.4;\n double cimag = .8*rand.nextDouble()-.4;\n //double creal = -.8;\n //double cimag = .156;\n\n // Initiate colors, cutoff, various extras and begin our loop\n int[] colors = new int[xpix*ypix];\n int pix1, pix2, pix3;\n double cutoff = 1000000;\n int maxiters = 63;\n int pixel_count = 0;\n double x0, y0, zreal, zimag, ztmp, curnorm;\n for (int a = 1; a<=xpix; a++){\n for (int b = 1; b<=ypix; b++){\n x0 = ((xmax-xmin)/xpix)*a - xmax;\n y0 = ((ymax-ymin)/ypix)*b - ymax;\n zreal = x0;\n zimag = y0;\n curnorm = Math.sqrt(((zreal*zreal)+(zimag*zimag)));\n\n int curcount = 0;\n while( (curcount < maxiters) && (curnorm < cutoff) ){\n ztmp = zreal;\n zreal = zreal*zreal - zimag*zimag + creal;\n zimag = 2*ztmp*zimag + cimag;\n\n curnorm = Math.sqrt(((zreal*zreal)+(zimag*zimag)));\n curcount++;\n }\n pix1 = colorMap1.getColor(curcount,0);\n pix2 = colorMap1.getColor(curcount,1);\n pix3 = colorMap1.getColor(curcount,2);\n colors[pixel_count] = Color.rgb(pix1, pix2, pix3);\n pixel_count++;\n }\n }\n bitmap = Bitmap.createBitmap(colors, xpix, ypix, Bitmap.Config.ARGB_8888);\n image.setImageBitmap(bitmap);\n\n String str1 = new DecimalFormat(\"#.####\").format(creal);\n String str2 = new DecimalFormat(\"#.####\").format(cimag);\n\n TextView tv= (TextView) findViewById(R.id.currentParam);\n tv.setText(\"Current 'c' value: c = \" + str1 + \" + \" + str2 + \"*i\");\n }", "public Unsigned128BitType( final BigInteger value )\n\t{\n\t\tthis( ( NativeImg< ?, ? extends LongAccess > ) null );\n\t\tdataAccess = new LongArray( 2 );\n\t\tset( value );\n\t}", "private void method_255(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10) {\n var3 = var9;\n if(field_759 || var9 < 0) {\n do {\n this.pixels[var4++] = var2[(var5 >> 17) + (var6 >> 17) * var10];\n var5 += var7;\n var6 += var8;\n ++var3;\n } while(var3 < 0);\n\n }\n }", "public static double kiloBytesToBits(double num) { return (num*8000); }", "private int count1_bitcount(int [] ix, EChannel cod_info) {\n\t\tint p, i, k;\n\t\tint signbits;\n\t\tint sum0 = 0, sum1 = 0;\n\t\tint count1End = bigvalues_region + count1_region;\n\n\t\tfor(i = bigvalues_region, k=0; k < count1End; i+=4, k++) {\n\t\t\tv = Math.abs(ix[i]);\n\t\t\tw = Math.abs(ix[i+1]);\n\t\t\tx = Math.abs(ix[i+2]);\n\t\t\ty = Math.abs(ix[i+3]);\n\n\t\t\tp = signbits = 0;\n\t\t\tif(v!=0) { signbits++; p |= 1; }\n\t\t\tif(w!=0) { signbits++; p |= 2; }\n\t\t\tif(x!=0) { signbits++; p |= 4; }\n\t\t\tif(y!=0) { signbits++; p |= 8; }\n\n\t\t\tsum0 += signbits;\n\t\t\tsum1 += signbits;\n\n\t\t\tsum0 += hlen[32][p];\n\t\t\tsum1 += hlen[33][p];\n\t\t}\n\n\t\tif(sum0 < sum1) {\n\t\t\tcod_info.count1table_select = 0;\n\t\t\treturn sum0;\n\t\t} else {\n\t\t\tcod_info.count1table_select = 1;\n\t\t\treturn sum1;\n\t\t}\n\t}", "void setBits(int... values);", "public int howManyBits(int value) {\n\t\t// TODO: Implement this method.\n\t\treturn 0;\n\t}", "Bitmap mo1406a(Bitmap bitmap, float f);", "public native void setCompression(int value) throws MagickException;", "int regionSplitBits4DownSampledTable();", "@Test\n public void testGrayExpandNoData() {\n BufferedImage im8bit = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_GRAY);\n WritableRaster raster8bit = im8bit.getRaster();\n int[] fill = new int[50 * 100];\n Arrays.fill(fill, 10);\n raster8bit.setSamples(0, 0, 50, 100, 0, fill);\n Arrays.fill(fill, 50);\n raster8bit.setSamples(50, 0, 50, 100, 0, fill);\n\n // and now a ushort one, top half 1000, bottom half 30000\n BufferedImage im16bit = new BufferedImage(100, 100, BufferedImage.TYPE_USHORT_GRAY);\n WritableRaster raster16bit = im16bit.getRaster();\n Arrays.fill(fill, 1000);\n raster16bit.setSamples(0, 0, 100, 50, 0, fill);\n Arrays.fill(fill, 30000);\n raster16bit.setSamples(0, 50, 100, 50, 0, fill);\n\n // mosaic setting the nodata\n Range noData10 = RangeFactory.create((byte) 10, (byte) 10);\n Range noData1000 = RangeFactory.create(1000, 1000);\n RenderedOp mosaic = MosaicDescriptor.create(new RenderedImage[] { im8bit, im16bit },\n javax.media.jai.operator.MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null,\n new double[] { 0 }, new Range[] { noData10, noData1000 }, null);\n\n // RenderedImageBrowser.showChain(mosaic);\n\n assertGray(mosaic, DataBuffer.TYPE_USHORT);\n\n // check top left quadrant, should 0, the output nodata\n int[] pixel = new int[1];\n mosaic.getData().getPixel(10, 10, pixel);\n assertArrayEquals(new int[] { 0 }, pixel);\n // check top right quadrant, should be 50 expanded to ushort\n mosaic.getData().getPixel(75, 10, pixel);\n assertArrayEquals(new int[] { 12850 }, pixel);\n // check bottom left quadrant, should be 30000\n mosaic.getData().getPixel(25, 75, pixel);\n assertArrayEquals(new int[] { 30000 }, pixel);\n // check bottom right quadrant, should be 50 expanded to ushort\n mosaic.getData().getPixel(75, 75, pixel);\n assertArrayEquals(new int[] { 12850 }, pixel);\n }", "public abstract float scaleIntensityData(float rawData);", "public Bitmap scaleDenomination(Bitmap in) {\n return Bitmap.createScaledBitmap(in, 825, 300, true);\n }", "private void increaseQualityByOne(Item item) {\n item.quality = item.quality + 1;\n }", "private void changePixelValues(ImageProcessor ip) {\n\t\t\tint[] pixels = (int[])ip.getPixels();\r\n\t\t\t\r\n\t\t\tfor (int y=0; y<height; y++) {\r\n\t\t\t\tfor (int x=0; x<width; x++) {\r\n\t\t\t\t\tint pos = y*width + x;\r\n\t\t\t\t\tint argb = origPixels[pos]; // Lesen der Originalwerte \r\n\t\t\t\t\t\r\n\t\t\t\t\tint r = (argb >> 16) & 0xff;\r\n\t\t\t\t\tint g = (argb >> 8) & 0xff;\r\n\t\t\t\t\tint b = argb & 0xff;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// anstelle dieser drei Zeilen später hier die Farbtransformation durchführen,\r\n\t\t\t\t\t// die Y Cb Cr -Werte verändern und dann wieder zurücktransformieren\r\n\t\t\t\t\t\r\n\t\t\t\t\tYUV c = new YUV(r, g, b);\r\n\t\t\t\t\t\r\n\t\t\t\t\tc.changeBrightness(brightness).changeContrast(contrast).changeSaturation(saturation).changeHue(hue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint[] rgbNew = c.toRGB();\r\n\r\n\t\t\t\t\t// Hier muessen die neuen RGB-Werte wieder auf den Bereich von 0 bis 255 begrenzt werden\r\n\t\t\t\t\t\r\n\t\t\t\t\tpixels[pos] = (0xFF<<24) | (rgbNew[0]<<16) | (rgbNew[1]<<8) | rgbNew[2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public Image getSemiquaverUp();", "private float[] _book_unquantize( int n, int[] sparsemap ) {\n int j,k,count=0;\n float[] r = null;\n if(mapType==1 || mapType==2){\n int quantvals;\n float mindel=_float32_unpack(q_min);\n float delta=_float32_unpack(q_delta);\n r= new float[ n * dim ];\n\n /* maptype 1 and 2 both use a quantized value vector, but\n different sizes */\n switch(mapType){\n case 1: {\n /* most of the time, entries%dimensions == 0, but we need to be\n well defined. We define that the possible vales at each\n scalar is values == entries/dim. If entries%dim != 0, we'll\n have 'too few' values (values*dim<entries), which means that\n we'll have 'left over' entries; left over entries use zeroed\n values (and are wasted). So don't generate codebooks like\n that */\n quantvals = (int)Math.floor( Math.pow( (double)entries, ((double)1)/((double)dim) ) );\n\n for(j=0;j<entries;j++) {\n\t if((sparsemap != null && (lengthList[j] != 0)) || sparsemap == null ){\n float last=0.f;\n int indexdiv=1;\n for(k=0;k<dim;k++){\n int index= (j/indexdiv)%quantvals;\n float val=quantlist[index];\n//System.out.println( \"a\" + (int)(val * 1000) + \" \" + index );\n val=fabs(val)*delta+mindel+last;\n//System.out.println( \"d\" + (int)(delta * 1000) + \" \" + (int)(mindel * 1000) );\n if(q_sequencep != 0)last=val;\t \n//System.out.println( (int)(val * 1000) );\n if(sparsemap != null) {\n r[sparsemap[count]*dim+k]=val;\n// System.out.println( \"sparsemap \" + sparsemap[count] );\n } else {\n r[count*dim+k]=val;\n }\n indexdiv*=quantvals;\n }\n count++;\n }\n }\n break;\n }\n case 2: {\n for(j=0;j<entries;j++){\n if((sparsemap != null && lengthList[j] != 0) || sparsemap == null ){\n\t float last=0.f;\n\t \n\t for(k=0;k<dim;k++) {\n float val=quantlist[j*dim+k];\n//System.out.println( \"a\" + (int)(val * 1000) + \" \" + (j*dim+k));\n\n val=fabs(val)*delta+mindel+last;\n//System.out.println( \"d\" + (int)(delta * 1000) + \" \" + (int)(mindel * 1000) );\n if(q_sequencep != 0)last=val;\n//System.out.println( (int)(val * 1000) );\n if(sparsemap != null)\n r[sparsemap[count]*dim+k]=val;\n else\n r[count*dim+k]=val;\n }\n count++;\n }\n }\n break;\n }\n }\n }\n return(r);\n }", "private void updateImageScale() {\r\n\t\t//Check which dimension is larger and store it in this variable.\r\n\t\tint numHexLargestDimension = this.numHexRow;\r\n\t\tif (this.totalHexWidth > this.totalHexHeight) {\r\n\t\t\tnumHexLargestDimension = this.numHexCol;\r\n\t\t}\r\n\t\t\r\n\t\tif (numHexLargestDimension < 35) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 16.5) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 7){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 70) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 22.2) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() \r\n\t\t\t\t\t* (this.numHexCol / 2) > 14.5){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 105) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 32.6) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 21){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 44.4) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 28){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public native MagickImage implodeImage(double amount)\n\t\t\tthrows MagickException;", "@Override\n public void eCGSignalQuality(int value, int timestamp) {\n }", "public Pic maximize() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n //Finds the max value between the three values of\n //red, green, and blue\n int max = Math.max(current.getRed(), Math.max(\n current.getGreen(), current.getBlue()));\n //Sets color value to 0 if value is not max value\n if (current.getRed() != max) {\n current.setRed(0);\n }\n if (current.getGreen() != max) {\n current.setGreen(0);\n }\n if (current.getBlue() != max) {\n current.setBlue(0);\n }\n }\n }\n return output;\n }", "private int optimizeForNColorsAndRebuildPalette(BufferedImage img, IMapColor mapColor) {\n \t\t\n \t\tint maxDist = 0;\n \t\tmaxDist = mapColor.getMinimalPaletteDistance();\n \n \t\tHistogram hist = new Histogram(img);\n \t\tint interestingColors = 0;\n \t\tint mappedColors = 0;\n \t\t\n \t\tint mostInterestingColors = 0;\n \t\t\n \t\t//int total = img.getWidth() * img.getHeight();\n \t\t\n \t\t//for (int mask = 4; mask < 7; mask++) {\n \t\t\tmappedColors = hist.generate(mapColor, maxDist, 0);\n \t\t\tinterestingColors = hist.size();\n \t\t\tif (interestingColors > mostInterestingColors)\n \t\t\t\tmostInterestingColors = interestingColors;\n \t\t\tSystem.out.println(\"For mask \" + Integer.toHexString(0) \n \t\t\t\t\t+\"; # interesting = \" + interestingColors\n \t\t\t\t\t+\"; # mapped = \" + mappedColors);\n \t\t\t//if (interestingColors <= 256)\n \t\t\t//\tbreak;\n \t\t\t//if (mappedColors > total / 2)\n \t\t\t//\tbreak;\n \t\t//} \n \t\t\n \t\tint usedColors = Math.min(mapColor.getNumColors(), interestingColors);\n \t\t\n \t\tSystem.out.println(\"interestingColors=\"+interestingColors\n \t\t\t\t+\"; usedColors=\"+usedColors\n \t\t\t\t+\"; mappedColors=\" + mappedColors);\n \t\t\n \t\tint replaceDist = mapColor.getMaximalReplaceDistance(mostInterestingColors);\n \n \t\tint[] paletteSelections = new int[usedColors];\n \t\t\n \t\tif (mapColor.getNumColors() >= 16) {\n \t\t\tselectExponential(interestingColors, usedColors, paletteSelections);\n \t\t} else {\n \t\t\tselectNovelColors(mapColor, hist, interestingColors, usedColors, paletteSelections);\n \t\t}\n \t\t\n \t\tfor (int c = 0; c < usedColors; c++) {\n \t\t\tint idx = hist.getColorIndex(paletteSelections[c]);\n \t\t\tint r = (idx>>6) & 0x7;\n \t\t\tint g = (idx>>3) & 0x7;\n \t\t\tint b = (idx>>0) & 0x7;\n \t\t\tcanvas.setGRB333(c, g, r, b);\n \t\t\t\n \t\t\treplaceColor(img, hist, idx, rgb8ToPixel(thePalette[c]), replaceDist);\n \t\t}\n \t\t\n \t\t\n \t\treturn maxDist;\n \t}", "void reduceStarsBy(final int amount);", "void invertAllBits();", "public static int convertToPix(float density, int sizeInDips) {\n float size = sizeInDips * density;\n return (int) size;\n }", "public void setAverageBits(int bits) {\n }", "public Bitmap ratio(Bitmap image, float pixelW, float pixelH) {\n ByteArrayOutputStream os = new ByteArrayOutputStream();\n image.compress(Bitmap.CompressFormat.JPEG, 100, os);\n if (os.toByteArray().length / 1024 >\n 1024) {//判断如果图片大于1M,进行压缩避免在生成图片(BitmapFactory.decodeStream)时溢出\n os.reset();//重置baos即清空baos\n image.compress(Bitmap.CompressFormat.JPEG, 50, os);//这里压缩50%,把压缩后的数据存放到baos中\n }\n ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());\n BitmapFactory.Options newOpts = new BitmapFactory.Options();\n //开始读入图片,此时把options.inJustDecodeBounds 设回true了\n newOpts.inJustDecodeBounds = true;\n newOpts.inPreferredConfig = Config.RGB_565;\n Bitmap bitmap = BitmapFactory.decodeStream(is, null, newOpts);\n newOpts.inJustDecodeBounds = false;\n int w = newOpts.outWidth;\n int h = newOpts.outHeight;\n //缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可\n int be = 1;//be=1表示不缩放\n if (w > h && w > pixelW) {//如果宽度大的话根据宽度固定大小缩放\n be = (int) (newOpts.outWidth / pixelW);\n } else if (w < h && h > pixelH) {//如果高度高的话根据宽度固定大小缩放\n be = (int) (newOpts.outHeight / pixelH);\n }\n if (be <= 0) { be = 1; }\n newOpts.inSampleSize = be;//设置缩放比例\n //重新读入图片,注意此时已经把options.inJustDecodeBounds 设回false了\n is = new ByteArrayInputStream(os.toByteArray());\n bitmap = BitmapFactory.decodeStream(is, null, newOpts);\n //压缩好比例大小后再进行质量压缩\n // return compress(bitmap, maxSize); // 这里再进行质量压缩的意义不大,反而耗资源,删除\n return bitmap;\n }", "public void makeGrayscale() {\n PixelReader pr = img.getPixelReader();\n WritableImage gray = new WritableImage((int) w, (int) h);\n PixelWriter pw = gray.getPixelWriter();\n int count = 0;\n for (int i = 0; i < (int) h; i++) {\n for (int j = 0; j < (int) w; j++) {\n count += 1;\n Color color = pr.getColor(j, i);\n //Reading each pixel and converting to Grayscale\n pw.setColor(j, i, new Color((color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n (color.getRed() * 0.3 + color.getGreen() * 0.59 + color.getBlue() * 0.11),\n 1.0));\n holderImg = gray;\n }\n }\n }", "public Builder addAllBloomFilterSizeInBytes(\n java.lang.Iterable<? extends java.lang.Integer> values) {\n ensureBloomFilterSizeInBytesIsMutable();\n com.google.protobuf.AbstractMessageLite.Builder.addAll(\n values, bloomFilterSizeInBytes_);\n onChanged();\n return this;\n }", "private void updateChildesValues(int value){\n\n for (int i = 0; i < mDataSize; i++) {\n\n if(((value >> i) & 1) == 1){\n mChildTags.get(i).setValue(true);}\n else {mChildTags.get(i).setValue(false);}\n }\n }", "int getBitsPerPixel();", "public static int calculateInSampleSize(BitmapFactory.Options options, int maxSize) {\n int height = options.outHeight;\n int inSampleSize = 1;\n while (((double) (options.outWidth * height)) * (1.0d / Math.pow((double) inSampleSize, 2.0d)) > ((double) maxSize)) {\n inSampleSize++;\n }\n return inSampleSize;\n }", "private void fuzPixel(int rPix, int cPix, ImageArray iCopy){\n \n /*int rgb= currentIm.getPixel(rPix,cPix);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);*/\n \n int rgb = 0;\n double red = 0.0;\n double blue = 0.0;\n double green = 0.0;\n int alpha = 0;\n \n for(int rr = rPix-1; rr < rPix+2; rr++){\n \n for(int cc = cPix-1; cc <cPix+2; cc++){\n rgb = currentIm.getPixel(rr,cc);\n red = red + DM.getRed(rgb);\n blue = blue + DM.getBlue(rgb);\n green = green + DM.getGreen(rgb);\n alpha= alpha + DM.getAlpha(rgb);\n \n }\n \n }\n \n red = red/9;\n blue = blue/9;\n green = green/9;\n \n iCopy.setPixel(rPix, cPix,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }", "private int ditherPixel(int futurePixel, int quantError, double factor) {\n int futureRed, futureGreen, futureBlue, futureAlpha,\n quantRed, quantGreen, quantBlue, quantAlpha;\n\n quantRed = (int)(Color.red(quantError) * factor);\n quantGreen = (int)(Color.green(quantError) * factor);\n quantBlue = (int)(Color.blue(quantError) * factor);\n quantAlpha = (int)(Color.alpha(quantError));\n\n futureRed = Color.red(futurePixel);\n futureGreen = Color.green(futurePixel);\n futureBlue = Color.blue(futurePixel);\n futureAlpha = Color.alpha(futurePixel);\n\n// return Color.argb(futureAlpha, futureRed + quantRed, futureGreen + quantGreen, futureBlue + quantBlue);\n return Color.argb(futureAlpha, futureRed, futureGreen, futureBlue);\n }", "public DecreaseColorDepth(Bitmap bitmapIn, int bitOffset) {\r\n\t\tthis.bitmapIn = bitmapIn;\r\n\t\tthis.bitOffset = bitOffset;\r\n\t}", "private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }", "public byte getPixel8bitGrayScale(int x, int y)\n {\n getPixelRgb(x, y, rgb);\n\n int sum = VSDK.signedByte2unsignedInteger(rgb.r) + VSDK.signedByte2unsignedInteger(rgb.g) + VSDK.signedByte2unsignedInteger(rgb.b);\n return VSDK.unsigned8BitInteger2signedByte(sum / 3);\n }", "private Bitmap getCompressedBitmap(Bitmap bitmap) {\n if (bitmap.getWidth() > MAX_WIDTH || bitmap.getHeight() > MAX_HEIGHT) {\n float scale = Math.min(((float) MAX_WIDTH / bitmap.getWidth()),\n ((float) MAX_HEIGHT / bitmap.getHeight()));\n Matrix matrix = new Matrix();\n matrix.postScale(scale, scale);\n Bitmap resizedImage = Bitmap.createBitmap(bitmap, 0, 0,\n bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n bitmap.recycle();\n return resizedImage;\n }\n return bitmap;\n }", "private void traverseBayeredPatternHalfSizeRGB(){\n int originalPositionX = 0;\n int originalPositionY = 1;\n\n for (int newX = 0; originalPositionX < originalImageHeight -1; newX++){\n for (int newY = 0; originalPositionY < originalImageWidth -1; newY++){\n Point newPosition = new Point(newX,newY);\n int newAbsoultPosition = getAbsolutPixelPosition(newPosition, originalImageHeight / 2, originalImageWidth / 2);\n halfSizePixRGB[newAbsoultPosition] = getAverageRGB(new Point(originalPositionX,originalPositionY));\n originalPositionY += 2;\n }\n originalPositionY = 0;\n originalPositionX += 2;\n }\n }", "public static double kiloBitsToBits(double num) { return (num*1000); }", "public void gettingImageInput(){\n Bitmap bm = getYourInputImage();\n int z;\n if(res==2) { z=50; }\n else { z=224; }\n Bitmap bitmap = Bitmap.createScaledBitmap(bm, z, z, true);\n input = ByteBuffer.allocateDirect(z * z * 3 * 4).order(ByteOrder.nativeOrder());\n for (int y = 0; y < z; y++) {\n for (int x = 0; x < z; x++) {\n int px = bitmap.getPixel(x, y);\n\n // Get channel values from the pixel value.\n int r = Color.red(px);\n int g = Color.green(px);\n int b = Color.blue(px);\n\n // Normalize channel values to [-1.0, 1.0]. This requirement depends\n // on the model. For example, some models might require values to be\n // normalized to the range [0.0, 1.0] instead.\n float rf = (r) / 255.0f;\n float gf = (g) / 255.0f;\n float bf = (b) / 255.0f;\n\n input.putFloat(rf);\n input.putFloat(gf);\n input.putFloat(bf);\n }\n }\n }", "public void compressImage(String path, String module) {\n pathtoUpload = path;\n String imagePath = getRealPathFromURI(path);\n Bitmap scaledBitmap = null;\n BitmapFactory.Options options = new BitmapFactory.Options();\n// by setting this field as true, the actual bitmap pixels are not loaded in the memory. Just the bounds are loaded. If\n// you try the use the bitmap here, you will get null.\n options.inJustDecodeBounds = true;\n Bitmap bmp = BitmapFactory.decodeFile(imagePath, options);\n int actualHeight = options.outHeight;\n int actualWidth = options.outWidth;\n// max Height and width values of the compressed image is taken as 816x612\n if (actualWidth > 0 && actualHeight > 0) {\n float maxHeight = 816.0f;\n float maxWidth = 612.0f;\n float imgRatio = 0;\n float maxRatio = 0;\n if (actualHeight != 0) {\n imgRatio = actualWidth / actualHeight;\n }\n if (maxHeight != 0) {\n maxRatio = maxWidth / maxHeight;\n }\n // width and height values are set maintaining the aspect ratio of the image\n if (actualHeight > maxHeight || actualWidth > maxWidth) {\n if (imgRatio < maxRatio) {\n imgRatio = maxHeight / actualHeight;\n actualWidth = (int) (imgRatio * actualWidth);\n actualHeight = (int) maxHeight;\n } else if (imgRatio > maxRatio) {\n imgRatio = maxWidth / actualWidth;\n actualHeight = (int) (imgRatio * actualHeight);\n actualWidth = (int) maxWidth;\n } else {\n actualHeight = (int) maxHeight;\n actualWidth = (int) maxWidth;\n }\n }\n options.inSampleSize = calculateInSampleSize(options, actualWidth, actualHeight);\n options.inJustDecodeBounds = false;\n options.inPurgeable = true;\n options.inInputShareable = true;\n options.inTempStorage = new byte[16 * 1024];\n try {\n bmp = BitmapFactory.decodeFile(imagePath, options);\n } catch (OutOfMemoryError exception) {\n exception.printStackTrace();\n }\n try {\n scaledBitmap = Bitmap.createBitmap(actualWidth, actualHeight, Bitmap.Config.ARGB_8888);\n } catch (OutOfMemoryError exception) {\n exception.printStackTrace();\n }\n float ratioX = actualWidth / (float) options.outWidth;\n float ratioY = actualHeight / (float) options.outHeight;\n float middleX = actualWidth / 2.0f;\n float middleY = actualHeight / 2.0f;\n\n Matrix scaleMatrix = new Matrix();\n scaleMatrix.setScale(ratioX, ratioY, middleX, middleY);\n\n Canvas canvas = new Canvas(scaledBitmap);\n canvas.setMatrix(scaleMatrix);\n canvas.drawBitmap(bmp, middleX - bmp.getWidth() / 2, middleY - bmp.getHeight() / 2, new Paint(Paint.FILTER_BITMAP_FLAG));\n ExifInterface exif;\n try {\n exif = new ExifInterface(imagePath);\n\n int orientation = exif.getAttributeInt(\n ExifInterface.TAG_ORIENTATION, 0);\n Log.d(\"EXIF\", \"Exif: \" + orientation);\n Matrix matrix = new Matrix();\n if (orientation == 6) {\n matrix.postRotate(90);\n Log.d(\"EXIF\", \"Exif: \" + orientation);\n } else if (orientation == 3) {\n matrix.postRotate(180);\n Log.d(\"EXIF\", \"Exif: \" + orientation);\n } else if (orientation == 8) {\n matrix.postRotate(270);\n Log.d(\"EXIF\", \"Exif: \" + orientation);\n }\n scaledBitmap = Bitmap.createBitmap(scaledBitmap, 0, 0,\n scaledBitmap.getWidth(), scaledBitmap.getHeight(), matrix,\n true);\n } catch (IOException e) {\n e.printStackTrace();\n }\n FileOutputStream out = null;\n //String filename = getFilename();\n File outFile = new File(imagePath);\n if (outFile != null && outFile.exists()) {\n outFile.delete();\n }\n try {\n out = new FileOutputStream(outFile);\n scaledBitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);\n out.flush();\n out.close();\n\n if (module.equals(ApplicationConstant.MODULE_CAPTURE)) {\n captureImage.setImageURI(Uri.parse(pathtoUpload));\n }\n if (module.equals(ApplicationConstant.MODULE_GALLERY)) {\n captureImage.setImageBitmap(BitmapFactory.decodeFile(pathtoUpload));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "public Image getSemiquaverDown();", "public Image getQuaverUp();", "public static Bitmap reduceBitmapSize(Bitmap bitmap){\r\n double ratioSquare;\r\n int bitmapHeight, bitmapWidth;\r\n //Acquire Data\r\n bitmapHeight = bitmap.getHeight();\r\n bitmapWidth = bitmap.getWidth();\r\n ratioSquare = (bitmapHeight * bitmapWidth)/MAX_SIZE;\r\n //If the reduction is lower or equals to the original\r\n if(ratioSquare<=1) return bitmap;\r\n double ratio = Math.sqrt(ratioSquare);\r\n\r\n int requiredHeight = (int) Math.round(bitmapHeight/ratio);\r\n int requiredWidth = (int) Math.round(bitmapWidth / ratio);\r\n return Bitmap.createScaledBitmap(bitmap,requiredWidth,requiredHeight,true);\r\n }", "public int xPixScale( double x ) { return (int)(width / xRange * x); }", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n MyCheckBox myCheckBox = (MyCheckBox) buttonView;\n NLog.e(TAG, \"onCheckedChanged:%s\", localPosition);\n if (imgSum >= imageNum && isChecked) {\n buttonView.setChecked(false);\n Toast.makeText(mContext, \"最多设置\" + imageNum + \"张图片\", Toast.LENGTH_SHORT).show();\n return;\n }\n mImageInfos.get(localPosition).select = isChecked;\n imgSum += isChecked ? 1 : -1;\n NLog.e(TAG, \"imgSum:%d\", imgSum);\n\n }", "private static long mapType1QuantValues(long entries, long dimension) {\n return (long) Math.floor(Math.pow(entries, 1.d / dimension));\n }", "public static int sizeBits_cost() {\n return 16;\n }", "public static byte[] unsignedCopyAndIncrement(final byte[] input) {\n byte[] copy = copy(input);\n if (copy == null) {\n throw new IllegalArgumentException(\"cannot increment null array\");\n }\n for (int i = copy.length - 1; i >= 0; --i) {\n if (copy[i] == -1) {// -1 is all 1-bits, which is the unsigned maximum\n copy[i] = 0;\n } else {\n ++copy[i];\n return copy;\n }\n }\n // we maxed out the array\n byte[] out = new byte[copy.length + 1];\n out[0] = 1;\n System.arraycopy(copy, 0, out, 1, copy.length);\n return out;\n }" ]
[ "0.5573085", "0.53353304", "0.5242637", "0.51383597", "0.5041641", "0.50192505", "0.4957123", "0.49354258", "0.4909599", "0.48757094", "0.48533675", "0.48307005", "0.4812074", "0.48104256", "0.4805515", "0.4801556", "0.4765041", "0.47362292", "0.47290415", "0.47019294", "0.46794897", "0.464021", "0.4636953", "0.46313724", "0.46188718", "0.46102342", "0.46053684", "0.4599386", "0.4596307", "0.4594535", "0.4593787", "0.4584027", "0.45804888", "0.4576144", "0.45645386", "0.45621362", "0.45602947", "0.45537895", "0.45485514", "0.45392436", "0.4538502", "0.4529405", "0.45266002", "0.45168433", "0.45167384", "0.4508149", "0.4491625", "0.44805565", "0.4480288", "0.44682816", "0.44471467", "0.44467324", "0.44356757", "0.44316098", "0.44310927", "0.4427853", "0.44250217", "0.44224477", "0.4408683", "0.43988517", "0.43878913", "0.43871957", "0.43870324", "0.43854403", "0.43834537", "0.43804365", "0.43788096", "0.43697953", "0.43675837", "0.43666026", "0.43650964", "0.43584603", "0.4357793", "0.43573004", "0.4354289", "0.43540004", "0.4345936", "0.4344197", "0.4338098", "0.43355355", "0.4328566", "0.43239546", "0.4321675", "0.43185997", "0.43159923", "0.43127897", "0.43088773", "0.4306813", "0.42973456", "0.42843074", "0.42781976", "0.42660922", "0.426385", "0.42634863", "0.4262577", "0.42516243", "0.4251248", "0.42492682", "0.42441517", "0.42388445" ]
0.49027967
9
Dither image data (FloydSteinberg dithering) Mipmap data will be lost.
public @NotNull Image dither(int rBpp, int gBpp, int bBpp, int aBpp) { if (this.data != null) { Color.Buffer pixels = Objects.requireNonNull(getColorData()); this.data.free(); // free old image data this.format = ColorFormat.RGBA; this.data = Color.malloc(this.format, this.width * this.height); this.mipmaps = 1; Color color; int r, g, b, a; int rErr, gErr, bErr, aErr; int rNew, gNew, bNew, aNew; int rs = (1 << rBpp) - 1; int gs = (1 << gBpp) - 1; int bs = (1 << bBpp) - 1; int as = (1 << aBpp) - 1; for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width; x++) { color = pixels.get(y * this.width + x); r = color.r(); g = color.g(); b = color.b(); a = color.a(); // NOTE: New pixel obtained by bits truncate, it would be better to round values (check ImageFormat()) rNew = rs > 0 ? ((((r + (127 / rs)) * rs) / 255) * 255) / rs : 0; gNew = gs > 0 ? ((((g + (127 / gs)) * gs) / 255) * 255) / gs : 0; bNew = bs > 0 ? ((((b + (127 / bs)) * bs) / 255) * 255) / bs : 0; aNew = as > 0 ? ((((a + (127 / as)) * as) / 255) * 255) / as : 255; // NOTE: Error must be computed between new and old pixel but using same number of bits! // We want to know how much color precision we have lost... rErr = r - rNew; gErr = g - gNew; bErr = b - bNew; aErr = a - aNew; this.data.put(y * this.width + x, rNew, gNew, bNew, aNew); // NOTE: Some cases are out of the array and should be ignored if (x < this.width - 1) { color = pixels.get(y * this.width + x + 1); color.set(color.r() + (int) (rErr * 7F / 16F), color.g() + (int) (gErr * 7F / 16F), color.b() + (int) (bErr * 7F / 16F), color.a() + (int) (aErr * 7F / 16F)); } if (x > 0 && y < this.height - 1) { color = pixels.get((y + 1) * this.width + x - 1); color.set(color.r() + (int) (rErr * 3F / 16F), color.g() + (int) (gErr * 3F / 16F), color.b() + (int) (bErr * 3F / 16F), color.a() + (int) (aErr * 3F / 16F)); } if (y < this.height - 1) { color = pixels.get((y + 1) * this.width + x); color.set(color.r() + (int) (rErr * 5F / 16F), color.g() + (int) (gErr * 5F / 16F), color.b() + (int) (bErr * 5F / 16F), color.a() + (int) (aErr * 5F / 16F)); } if (x < this.width - 1 && y < this.height - 1) { color = pixels.get((y + 1) * this.width + x + 1); color.set(color.r() + (int) (rErr * 1F / 16F), color.g() + (int) (gErr * 1F / 16F), color.b() + (int) (bErr * 1F / 16F), color.a() + (int) (aErr * 1F / 16F)); } } } } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void dither();", "void dither();", "int[][][] ditheringImage(int[][][] imageArray, int height, int width);", "@Override\n public void setDither(boolean dither) {\n patternDrawable.setDither(dither);\n super.setDither(dither);\n }", "public @NotNull Image flipH()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n if (this.format != ColorFormat.RGBA)\n {\n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n // OPTION 1: Move pixels with memCopy()\n long src = Integer.toUnsignedLong(y * this.width + this.width - 1 - x) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, bytesPerLine);\n \n // OPTION 2: Just copy data pixel by pixel\n // output.put(y * this.width + x, this.data.getBytes(y * this.width + (this.width - 1 - x)));\n }\n }\n \n this.data.free();\n \n this.data = output;\n }\n else\n {\n // OPTION 3: Faster implementation (specific for 32bit pixels)\n // NOTE: It does not require additional allocations\n IntBuffer ptr = this.data.toBuffer().asIntBuffer();\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width / 2; x++)\n {\n int backup = ptr.get(y * this.width + x);\n ptr.put(y * this.width + x, ptr.get(y * this.width + this.width - 1 - x));\n ptr.put(y * this.width + this.width - 1 - x, backup);\n }\n }\n }\n this.mipmaps = 1;\n }\n \n return this;\n }", "private void reanderImage(ImageData data) {\n \n }", "private Bitmap processBitmap(Bitmap bitmap) {\n Bitmap pic = bitmap.copy(Bitmap.Config.ARGB_8888, true);\n\n // Get dimensions to base the following work off of.\n int picHeight = pic.getHeight();\n int picWidth = pic.getWidth();\n\n // In this block we're go to change every pixel to the closest 3-bit value. Then we're\n // going to \"dither\", or randomize, the adjacent, further pixels as to make the image\n // look more cleaner... for a 3-bit looking image that is... Ha!\n int x, y, oldPixel, newPixel;\n int quantError, rightPixel, bottomRightPixel, bottomPixel, bottomLeftPixel;\n for(y=0; y<picHeight; y++) {\n for(x=0; x<picWidth; x++) {\n oldPixel = pic.getPixel(x, y);\n newPixel = colorPicker(oldPixel);\n pic.setPixel(x, y, newPixel);\n\n quantError = computeQuantizationError(oldPixel, newPixel);\n\n if(x+1 < picWidth) { // Right pixel\n rightPixel = pic.getPixel(x+1, y);\n pic.setPixel(x+1, y, ditherPixel(rightPixel, quantError, 7.0/16.0));\n\n if (y+1 < picHeight) { // Right bottom pixel\n bottomRightPixel = pic.getPixel(x+1, y+1);\n pic.setPixel(x + 1, y+1, ditherPixel(bottomRightPixel, quantError, 1.0/16.0));\n }\n }\n if(y+1 < picHeight) { // Bottom pixel\n bottomPixel = pic.getPixel(x, y+1);\n pic.setPixel(x, y+1, ditherPixel(bottomPixel, quantError, 5.0/16.0));\n\n if (x-1 >= 0) { // Left bottom pixel\n bottomLeftPixel = pic.getPixel(x-1, y+1);\n pic.setPixel(x-1, y+1, ditherPixel(bottomLeftPixel, quantError, 3.0/16.0));\n }\n }\n }\n }\n\n return pic;\n }", "public void runDarken() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 0.5f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void bufferImageGrey()\n {\n int col = 0;\n int[][] heightmap = parent.normaliseMap(parent.getPreviewMap(), 255);\n \n bufferedImage = createImage(heightmap.length, heightmap[0].length);\n Graphics bg = bufferedImage.getGraphics();\n for(int i = 0; i < heightmap.length; i ++) {\n for(int j = 0; j < heightmap[i].length - 1; j++) {\n col = heightmap[i][j];\n if(col > 255)\n col = 255;\n bg.setColor(new Color(col, col, col));\n bg.drawLine(i, j, i, j);\n }\n }\n }", "void resetDCPredictor()\n {\n dctDCYPast = 128*8;\n dctDCCrPast = 128*8;\n dctDCCbPast = 128*8;\n }", "public static void decodeAllImages(Args args){\n \t//Now those arrays will contain 'decoded' images\n \timageNames.clear();\n imagesToZip.clear();\n imageDict.clear();\n ArrayList<CodedData> recoveredData = null;\n\n //Read the coded images\n try {\n System.out.println(\"Reading zip file...\");\n readZip(args.codedInput, false);\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n BufferedImage tempFrame=null, tempFrameI=null;\n WritableRaster tempBitmap=null;\n WritableRaster tempDecoded=null;\n CodedData tempData=null;\n int gop = dataList.get(0).gop;\n //System.out.println(gop);\n BufferedImage tempBufferedImage = null;\n int z = 0;\n //recoveredData[0] contains the info of the image 0, and so on\n int recoveredDataCounter = 0;\n //For every image,\n for(int i= 0; i < imageNames.size(); i++){\n \t//z is a counter of the gop so we can decide if its a frameI or P\n if(z >= (gop)){\n z=0;\n }\n if(z == 0){//Frame I\n \t//Store it\n tempFrameI = imageDict.get(imageNames.get(i));\n imageDict.put(imageNames.get(i), tempFrameI);\n }else{\n //Frame P, decode it\n tempFrame = imageDict.get(imageNames.get(i)); \n tempBitmap = (WritableRaster) tempFrame.getData();\n tempDecoded = tempBitmap.createWritableChild(tempFrame.getMinX(), tempFrame.getMinY(), tempFrame.getWidth(), tempFrame.getHeight(), 0,0, null);\n \t//Get his info\n tempData = dataList.get(recoveredDataCounter);\n recoveredDataCounter++;\n int[] tempColor;\n //Iterate through the tile and replace its pixels\n for(int k = 0; k < tempData.bestTilesX.size(); k++){\n for (int baseX = 0; baseX < tempData.tileWidth ; baseX++) {\n for (int baseY = 0; baseY < tempData.tileHeight; baseY++) {\n tempColor = getPixelColor(tempFrameI, tempData.bestOriginX.get(k)+baseX, tempData.bestOriginY.get(k)+baseY);\n tempDecoded.setPixel(tempData.bestTilesX.get(k)+baseX, tempData.bestTilesY.get(k)+baseY, tempColor);\n }\n }\n }\n //Store the new decoded image\n tempBufferedImage = new BufferedImage(tempFrame.getColorModel(),tempDecoded,tempFrame.isAlphaPremultiplied(),null);\n imageDict.put(imageNames.get(i), tempBufferedImage);\n tempFrameI = tempBufferedImage;\n }\n z++;\n }\n }", "public static int[][][] rescaleShift(int[][][] ImageArray1) {\n\n int width = ImageArray1.length;\n int height = ImageArray1[0].length;\n\n int[][][] ImageArray2 = ImageArray1;\n\n float s = randFloat(0, 2);\n int t = (int) (Math.random());\n //float s = 2;\n //int t = 20;\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n\n ImageArray1[x][y][1] = (int) (t + ImageArray1[x][y][1]); //r\n ImageArray1[x][y][2] = (int) (t + ImageArray1[x][y][2]); //g\n ImageArray1[x][y][3] = (int) (t + ImageArray1[x][y][3]); //b\n }\n }\n int rmin = (int) (s * (ImageArray1[0][0][1] + t));\n int rmax = rmin;\n int gmin = (int) (s * (ImageArray1[0][0][2] + t));\n int gmax = gmin;\n int bmin = (int) (s * (ImageArray1[0][0][3] + t));\n int bmax = bmin;\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray2[x][y][1] = (int) (s * ImageArray1[x][y][1]); //r\n ImageArray2[x][y][2] = (int) (s * ImageArray1[x][y][2]); //g\n ImageArray2[x][y][3] = (int) (s * ImageArray1[x][y][3]); //b\n\n if (rmin > ImageArray2[x][y][1]) {\n rmin = ImageArray2[x][y][1];\n }\n if (gmin > ImageArray2[x][y][2]) {\n gmin = ImageArray2[x][y][2];\n }\n if (bmin > ImageArray2[x][y][3]) {\n bmin = ImageArray2[x][y][3];\n }\n if (rmax < ImageArray2[x][y][1]) {\n rmax = ImageArray2[x][y][1];\n }\n if (gmax < ImageArray2[x][y][2]) {\n gmax = ImageArray2[x][y][2];\n }\n if (bmax < ImageArray2[x][y][3]) {\n bmax = ImageArray2[x][y][3];\n }\n }\n }\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n ImageArray2[x][y][1] = 255 * (ImageArray2[x][y][1] - rmin) / (rmax - rmin);\n ImageArray2[x][y][2] = 255 * (ImageArray2[x][y][2] - gmin) / (gmax - gmin);\n ImageArray2[x][y][3] = 255 * (ImageArray2[x][y][3] - bmin) / (bmax - bmin);\n }\n }\n return (ImageArray2);\n }", "public void resetProcessed() {\r\n for (int x = 0; x < image.getWidth(); x++) {\r\n for (int y = 0; y < image.getHeight(); y++) {\r\n maskDone[x][y] = false;\r\n }\r\n }\r\n }", "public void fuzzify() {\n ImageArray newCopy = currentIm.copy();\n \n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n for(int rr = 1; rr < rows-1; rr++){\n \n for(int cc = 1; cc < cols-1; cc++){\n fuzPixel(rr,cc,newCopy);\n \n }\n \n }\n \n currentIm = newCopy.copy();\n \n \n }", "void deriveImage()\n\t{\n\n\t\t//img = new BufferedImage(dimx, dimy, BufferedImage.TYPE_INT_ARGB);\n\t\timg = null;\n\t\ttry{\n\t\t\timg = ImageIO.read(new File(\"src/input/World.png\"));\n\n\t\t}catch (IOException e){\n\t\t\tSystem.out.println(\"world image file error\");\n\t\t}\n\t\t//System.out.println(img.getHeight());\n\t\t//System.out.println(img.getWidth());\n//\t\tfloat maxh = -10000.0f, minh = 10000.0f;\n//\n//\t\t// determine range of tempVals s\n//\t\tfor(int x=0; x < dimx; x++)\n//\t\t\tfor(int y=0; y < dimy; y++) {\n//\t\t\t\tfloat h = tempVals [x][y];\n//\t\t\t\tif(h > maxh)\n//\t\t\t\t\tmaxh = h;\n//\t\t\t\tif(h < minh)\n//\t\t\t\t\tminh = h;\n//\t\t\t}\n\t\t\n\t\tfor(int x=0; x < dimx; x++)\n\t\t\tfor(int y=0; y < dimy; y++) {\n\t\t\t\t \t\n\t\t\t\t// find normalized tempVals value in range\n\t\t\t\t//float val = (tempVals [x][y] - minh) / (maxh - minh);\n\t\t\t\tfloat val = tempVals[x][y];\n\n\t\t\t\t//System.out.println(val);\n\n\t\t\t\tColor c = new Color(img.getRGB(x,y));\n\n\t\t\t\tif((c.getRed() > 50 && c.getGreen() > 100 && c.getBlue() < 200)) {\n\n\t\t\t\t\tif (val != 0.0f) {\n\t\t\t\t\t\tColor col = new Color(val, 0, 0);\n\t\t\t\t\t\timg.setRGB(x, y, col.getRGB());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t\n\t}", "public void run(ImageProcessor ip) {\n ImagePlus impDark = WindowManager.getImage(DarkiD);\n ImageStack DarkStack = impDark.getStack();\n int width = DarkStack.getProcessor(1).getWidth();\n int height = DarkStack.getProcessor(1).getHeight();\n int dim = width * height;\n \n // Let's assign & declare all the local variables. \n //The pix-by-pix sum of the stack\n double[] sum;\n sum = new double[dim];\n \n //The pix-by-pix average of the stack\n double[] average;\n average = new double[dim];\n \n //The DARK signal pixel array\n double[] DARKpixels;\n DARKpixels = new double[dim];\n \n /* Scan the stack to weed out pics w/ pixel > saturation, then sum \n pix-by-pix through the stack. */\n int k = 0;\n for(int i=1; i<=DarkStack.getSize(); i++){\n double imgMax = DarkStack.getProcessor(i).getStatistics().max;\n if (imgMax < saturation){\n short[] pixels = (short[]) (DarkStack.getPixels(i));\n for (int j=0; j<dim; j++){\n sum[j] += (double)(pixels[j] & 0xffff);\n }\n } else \n k++;\n } \n \n // Average pix-by-pix\n for(int i=0; i<dim; i++){\n average[i] = (double) (sum[i]/(DarkStack.getSize() - k ));\n }\n \n /* Subtract off READ signal and normalize per exposure time. If \n a pixel has a value less than 0, then set it to zero.\n */\n ImagePlus impREAD = WindowManager.getImage(READiD);\n ImageProcessor READ_ip = impREAD.getProcessor();\n float[] READpixels = (float[]) ( READ_ip.getPixels() ); \n for(int i =0; i<dim; i++){\n DARKpixels[i] = (double)( (average[i] - READpixels[i])\n /(DarkTime - READTime) );\n if (DARKpixels[i]< 0)\n DARKpixels[i]=0; \n }\n \n // Make DARK image from pixels then show it. \n ImageProcessor DARK_ip = new FloatProcessor(width, \n height,DARKpixels); \n ImagePlus impDARK = new ImagePlus(\"DARK\",DARK_ip);\n impDARK.show();\n impDARK.draw();\n IJ.run(impDARK, \"Enhance Contrast\", \"saturated=0.35\");\n \n //Print out specs of the DARK image.\n ResultsTable rt = new ResultsTable();\n rt.incrementCounter();\n rt.addValue(\"Mean\",DARK_ip.getStatistics().mean);\n rt.addValue(\"Max\",DARK_ip.getStatistics().max);\n rt.addValue(\"Min\",DARK_ip.getStatistics().min);\n rt.addValue(\"Std.Dev.\",DARK_ip.getStatistics().stdDev);\n rt.showRowNumbers(false);\n rt.show(\"Results\");\n \n\t}", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "public @NotNull Image flipV()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int i = this.height - 1, offsetSize = 0; i >= 0; i--)\n {\n long src = srcPtr + Integer.toUnsignedLong(i * this.width) * this.format.sizeof;\n \n MemoryUtil.memCopy(src, dstPtr + offsetSize, bytesPerLine);\n offsetSize += bytesPerLine;\n }\n \n this.data.free();\n this.data = output;\n this.mipmaps = 1;\n }\n return this;\n }", "@Override\n\tpublic void desenhar() {\n\t\tSystem.out.println(\"desenhar imagem png\");\n\t\t\n\t}", "private void calculateMaps() {\n\tsrcrows = new int[destHeight + 1];\n\tfor (int y = 0; y <= destHeight; y++) {\n\t srcrows[y] = (2 * y * srcHeight + srcHeight) / (2 * destHeight);\n\t}\n\tsrccols = new int[destWidth + 1];\n\tfor (int x = 0; x <= destWidth; x++) {\n\t srccols[x] = (2 * x * srcWidth + srcWidth) / (2 * destWidth);\n\t}\n\n float xscale = ( ( float ) srcWidth - 1 ) / ( ( float ) destWidth );\n float yscale = ( ( float ) srcHeight - 1 ) / ( ( float ) destHeight ) ;\n\n srcxlarr = new int[destWidth+1];\n srcxuarr = new int[destWidth+1];\n srcxarr = new int[destWidth+1];\n\n for (int x = 0 ; x <= destWidth;x++) {\n float tmp = x * xscale ;\n srcxlarr[x] = (int) Math.floor( tmp ) ;\n srcxuarr[x] = (int) Math.ceil( tmp ) ;\n srcxarr[x] = (int) ( ( tmp - srcxlarr[x] ) * 255f );\n }\n\n srcylarr = new int[destHeight+1];\n srcyuarr = new int[destHeight+1];\n srcyarr = new int[destHeight+1];\n\n for (int y = 0 ; y <= destHeight;y++) {\n float tmp = y * yscale ;\n srcylarr[y] = (int) Math.floor( tmp ) ;\n srcyuarr[y] = (int) Math.ceil( tmp ) ;\n srcyarr[y] = (int) ( ( tmp - srcylarr[y] ) * 255f );\n }\n\n /*\n System.out.println( \"srcrows\" );\n for (int i=0;i<srcrows.length;i++) {\n System.out.print( srcrows[i] + \" \" );\n }\n\n System.out.println( \"\\nsrccols\" );\n for (int i=0;i<srccols.length;i++) {\n System.out.print( srccols[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxlarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcxlarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcxuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcxuarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcylarr\" );\n for (int i=0;i<srcxlarr.length;i++) {\n System.out.print( srcylarr[i] + \" \" );\n }\n\n System.out.println( \"\\nsrcyuarr\" );\n for (int i=0;i<srcxuarr.length;i++) {\n System.out.print( srcyuarr[i] + \" \" );\n }\n */\n }", "public void filter(PixelImage pi) {\n\t\tPixel[][] data = pi.getData();\r\n\r\n\t\t\r\n\t\t// use loop to edit every pixel\r\n\t\tfor (int rowTemp = 1; rowTemp < data.length-1; rowTemp+=1) {\r\n\t\t\tfor (int colTemp = 1; colTemp < data[0].length-1; colTemp+=1) {\r\n\t\t\t\t\r\n\t\t\t\t// get every pixel in 3x3\r\n\t\t\t\tPixel tempMid =data[rowTemp][colTemp];\t\t\t\t\r\n\t\t\t\tPixel temp2 = data[rowTemp-1][colTemp];\r\n\t\t\t\tPixel temp1 = data[rowTemp-1][colTemp-1];\r\n\t\t\t\tPixel temp3 = data[rowTemp-1][colTemp+1];\r\n\t\t\t\tPixel temp4 = data[rowTemp][colTemp-1];\r\n\t\t\t\tPixel temp6 = data[rowTemp][colTemp+1];\r\n\t\t\t\tPixel temp7 = data[rowTemp+1][colTemp-1];\r\n\t\t\t\tPixel temp8 = data[rowTemp+1][colTemp];\r\n\t\t\t\tPixel temp9 = data[rowTemp+1][colTemp+1];\r\n\t\t\r\n\t\t\t\t// put red color in redList\r\n\t\t\t\tint[] redList = {temp1.red,temp2.red,temp3.red,\r\n\t\t\t\t\t\ttemp4.red,temp7.red,temp6.red,temp8.red,temp9.red,tempMid.red};\r\n\t\t\t\t\r\n\t\t\t\t// arrange list in the order that int is from small to big\r\n\t\t\t\tArrays.sort(redList);\r\n\t\t\t\t\r\n\t\t\t\t// take the middle int\t\t\t\r\n\t\t\t\ttempMid.red= redList[4];\r\n\t\t\t\t\r\n\t\t\t\t// put blue color in redList\t\t\r\n\t\t\t\tint[] blueList = {temp1.blue,temp2.blue,temp3.blue,\r\n\t\t\t\t\t\ttemp4.blue,\ttemp7.blue,temp6.blue,temp8.blue,temp9.blue,tempMid.blue};\r\n\t\t\t\tArrays.sort(blueList);\r\n\t\t\t\t// get the middle int\r\n\t\t\t\ttempMid.blue= blueList[4];\r\n\t\t\t\r\n\t\t\t\t// put green color in redList\r\n\t\t\t\tint[] greenList = {temp1.green,temp2.green,temp3.green\r\n\t\t\t\t\t\t,temp4.green,temp7.green,temp6.green,temp8.green,temp9.green,tempMid.green};\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tArrays.sort(greenList);\r\n\t\t\t\t\r\n\t\t\t\ttempMid.green= greenList[4];\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\tdata[rowTemp][colTemp]=tempMid;\r\n\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\r\n\r\n\t\tpi.setData(data);\r\n\t}", "public final Image getDiffuse() {\n int scaleFactor;\n if (width * height >= RESOLUTION_HIGH) {\n scaleFactor = 2;\n } else {\n scaleFactor = 1;\n }\n\n int widthScaled = (int) Math.ceil((double) width / scaleFactor);\n int heightScaled = (int) Math.ceil((double) height / scaleFactor);\n WritableImage img = new WritableImage(widthScaled, heightScaled);\n PixelWriter writer = img.getPixelWriter();\n diffuseLoop:\n for (int j = 0; j < heightScaled; j++) {\n for (int i = 0; i < widthScaled; i++) {\n if (Thread.interrupted()) {\n break diffuseLoop;\n }\n writer.setColor(i, j, colors.getColor(\n noiseBuffer[j * scaleFactor][i * scaleFactor]));\n }\n }\n return img;\n }", "public static void invert(ImageProcessor output) {\r\n\t\tfor (int x = 0; x < output.getWidth(); x++) {\r\n\t\t\tfor (int y = 0; y < output.getHeight(); y++) {\r\n\t\t\t\tboolean a = output.get(x, y) > 127;\r\n\t\t\t\toutput.set(x, y, (!a) ? WHITE : BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public native MagickImage despeckleImage() throws MagickException;", "public static void flushImageCache() {\n // Only clear this as normally it will be at least an order of magnitude greater than the\n // other maps used for caching images.\n rotatedImages.clear();\n }", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public void runLighten() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 5.3f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void onLowMemory() {\r\n \t\tlog.info(\"On low memory : cleaning tiles - size = \" + cacheOfImages.size());\r\n \t\tArrayList<String> list = new ArrayList<String>(cacheOfImages.keySet());\r\n \t\t// remove first images (as we think they are older)\r\n \t\tfor (int i = 0; i < list.size()/2; i ++) {\r\n \t\t\tBitmap bmp = cacheOfImages.remove(list.get(i));\r\n \t\t\tif(bmp != null){\r\n \t\t\t\tbmp.recycle();\r\n \t\t\t}\r\n \t\t}\r\n \t\tSystem.gc();\r\n \t}", "public ShortProcessor distanceMap(ImageProcessor mask) {\n\n\t\t// size of image\n\t\twidth = mask.getWidth();\n\t\theight = mask.getHeight();\n\t\t\n\t\t// update mask\n\t\tthis.maskProc = mask;\n\n\t\t// create new empty image, and fill it with black\n\t\tbuffer = new ShortProcessor(width, height);\n\t\tbuffer.setValue(0);\n\t\tbuffer.fill();\n\t\t\n\t\t// initialize empty image with either 0 (background) or Inf (foreground)\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tint val = mask.get(i, j) & 0x00ff;\n\t\t\t\tbuffer.set(i, j, val == 0 ? 0 : backgroundValue);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Two iterations are enough to compute distance map to boundary\n\t\tforwardIteration();\n\t\tbackwardIteration();\n\n\t\t// Normalize values by the first weight\n\t\tif (this.normalizeMap) {\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\t\tif (maskProc.getPixel(i, j) != 0) {\n\t\t\t\t\t\tbuffer.set(i, j, buffer.get(i, j) / weights[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Compute max value within the mask\n\t\tshort maxVal = 0;\n\t\tfor (int i = 0; i < width; i++)\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\tif (maskProc.getPixel(i, j) != 0)\n\t\t\t\t\tmaxVal = (short) Math.max(maxVal, buffer.get(i, j));\n\t\t\t}\n\n\t\t// calibrate min and max values of result imaeg processor\n\t\tbuffer.setMinAndMax(0, maxVal);\n\n\t\t// Forces the display to non-inverted LUT\n\t\tif (buffer.isInvertedLut())\n\t\t\tbuffer.invertLut();\n\t\t\n\t\treturn buffer;\n\t}", "private boolean importDirectMappedImage(BufferedImage img) {\n \t\tif (format == Format.COLOR256_1x1 || isMono)\n \t\t\treturn false;\n \t\t\n \t\tint numColors = format == Format.COLOR4_1x1 ? 4\n \t\t\t\t: 16;\n \t\t\n \t\t// effective minimum distance for any mode\n \t\tint maxDist = 0xf*0xf * 3;\n \t\tint numPixels = img.getWidth() * img.getHeight();\n \t\t\n \t\tboolean matched = false;\n \t\tHistogram hist = new Histogram(img);\n \t\t\n \t\tList<byte[][]> palettes = new ArrayList<byte[][]>();\n \t\tpalettes.add(thePalette);\n \t\tif (isStandardPalette)\n \t\t\tpalettes.addAll(Arrays.asList(VdpCanvas.palettes()));\n \t\t\n \t\tfor (byte[][] palette : palettes) {\n \t\t\tint matchedC = hist.generate(new FixedPaletteMapColor(palette, firstColor, numColors), maxDist, ~0); \n \t\t\tif (matchedC == numPixels) {\n \t\t\t\tmatched = true;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t\t\n \t\tif (matched) {\n \t\t\tfor (int c = 0; c < numColors; c++) {\n \t\t\t\treplaceColor(img, hist, c, rgb8ToPixel(thePalette[c]), Integer.MAX_VALUE);\n \t\t\t}\n \t\t\t\n \t\t\treturn true;\n \t\t}\n \t\t\n \t\treturn false;\n \t}", "public void filterImage() {\n\n if (opIndex == lastOp) {\n return;\n }\n\n lastOp = opIndex;\n switch (opIndex) {\n case 0:\n biFiltered = bi; /* original */\n return;\n case 1:\n biFiltered = ImageNegative(bi); /* Image Negative */\n return;\n\n case 2:\n biFiltered = RescaleImage(bi);\n return;\n\n case 3:\n biFiltered = ShiftImage(bi);\n return;\n\n case 4:\n biFiltered = RescaleShiftImage(bi);\n return;\n\n case 5:\n biFiltered = Add(bi, bi1);\n return;\n\n case 6:\n biFiltered = Subtract(bi, bi1);\n return;\n\n case 7:\n biFiltered = Multiply(bi, bi1);\n return;\n\n case 8:\n biFiltered = Divide(bi, bi1);\n return;\n\n case 9:\n biFiltered = NOT(bi);\n return;\n\n case 10:\n biFiltered = AND(bi, bi1);\n return;\n\n case 11:\n biFiltered = OR(bi, bi1);\n return;\n\n case 12:\n biFiltered = XOR(bi, bi1);\n return;\n\n case 13:\n biFiltered = ROI(bi);\n return;\n\n case 14:\n biFiltered = Negative_Linear(bi);\n return;\n\n case 15:\n biFiltered= Logarithmic_function(bi);\n return;\n\n case 16:\n biFiltered = Power_Law(bi);\n return;\n\n case 17:\n biFiltered = LUT(bi);\n return;\n\n case 18:\n biFiltered = Bit_planeSlicing(bi);\n return;\n\n case 19:\n biFiltered = Histogram(bi1,bi2);\n return;\n\n case 20:\n biFiltered = HistogramEqualisation(bi,bi3);\n return;\n\n case 21:\n biFiltered = Averaging(bi1);\n return;\n\n case 22:\n biFiltered = WeightedAveraging(bi1);\n return;\n\n case 23:\n biFiltered = fourNeighbourLaplacian(bi1);\n return;\n\n case 24:\n biFiltered= eightNeighbourLaplacian(bi1);\n return;\n\n case 25:\n biFiltered = fourNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 26:\n biFiltered = eightNeighbourLaplacianEnhancement(bi1);\n return;\n\n case 27:\n biFiltered = Roberts(bi1);\n return;\n\n case 28:\n biFiltered = SobelX(bi1);\n return;\n\n case 29:\n biFiltered = SobelY(bi1);\n return;\n\n case 30:\n biFiltered = Gaussian(bi1);\n return;\n\n case 31:\n biFiltered = LoG (bi1);\n return;\n\n case 32:\n biFiltered = saltnpepper(bi4);\n return;\n\n case 33:\n biFiltered = minFiltering(bi4);\n return;\n\n case 34:\n biFiltered = maxFiltering(bi4);\n return;\n\n case 35:\n biFiltered = maidpointFiltering(bi4);\n return;\n\n case 36:\n biFiltered = medianFiltering(bi4);\n return;\n\n case 37:\n biFiltered = simpleThresholding(bi5);\n return;\n\n case 38:\n biFiltered = automatedThresholding(bi6);\n return;\n\n case 39:\n biFiltered = adaptiveThresholding(bi7);\n return;\n }\n }", "public Bitmap getBitmap() {\n\t\tBitmap bitmap;\n\t\tint intpixels[] = new int[getNrows()*getNcols()];\n\n// Log.i(\"min value\", Float.toString(getMinElevation()));\n// Log.i(\"max value\", Float.toString(getMaxElevation()));\n// Log.i(\"range value\", Float.toString(getMaxElevation()-getMinElevation()));\n\t\tfor(int k = 0; k<getNrows(); k++) {\n\t\t\tfor(int m=0; m<getNcols(); m++) {\n\t\t \t//normalize each float to a value from 0-255\n\n double range = 255/(getMaxElevation()-getMinElevation());\n\t\t \tintpixels[k+(m*getNrows())] = (int)(range*(getElevationData()[k][m]-getMinElevation()));\n\n //Log.i(\"pixel value\", Integer.toString(intpixels[m+(k*getNcols())]));\n\t\t \t//intpixels[k] = (int)( ((pixels[k]-min)/(max-min))*(double)255.0);\n\t\t \t//convert to greyscale ARGB value\n\t\t \t//intpixels[m+(k*getNcols())] = 0xFF000000 + intpixels[m+(k*getNcols())] + intpixels[m+(k*getNcols())]<<8 + intpixels[m+(k*getNcols())]<<16;\n\t\t\t}\t\n\t }\n\n for(int l=0;l<getNcols()*getNrows(); l++) {\n //intpixels[l] = 0xFF000000 + intpixels[l] + intpixels[l]<<8 + intpixels[l]<<16;\n intpixels[l] = Color.argb(255, intpixels[l], intpixels[l], intpixels[l]);\n }\n\t\tbitmap = Bitmap.createBitmap(intpixels, 0, getNrows(), getNrows(), getNcols(), Bitmap.Config.ARGB_8888);\n\n Matrix matrix = new Matrix();\n matrix.postRotate(90);\n bitmap = Bitmap.createBitmap(bitmap, 0, 0,\n bitmap.getWidth(), bitmap.getHeight(),\n matrix, true);\n try {\n FileOutputStream out = new FileOutputStream(\"/sdcard/field.png\");\n bitmap.compress(Bitmap.CompressFormat.PNG, 90, out);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n\n return bitmap;\n\t}", "private void filter(BufferedImageOp op)\n { \n if (image == null) return;\n BufferedImage filteredImage \n = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());\n op.filter(image, filteredImage);\n image = filteredImage;\n repaint();\n }", "private static final byte[] xfuzzysave_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, 96,\n\t\t\t\t96, 96, -128, -128, -128, -112, -112, -112, -64, -64, -64,\n\t\t\t\t-112, -112, -112, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -2,\n\t\t\t\t14, 77, 97, 100, 101, 32, 119, 105, 116, 104, 32, 71, 73, 77,\n\t\t\t\t80, 0, 33, -7, 4, 1, 10, 0, 5, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0,\n\t\t\t\t0, 3, 64, 8, -86, -43, 11, 45, -82, -24, 32, -83, -74, -80, 43,\n\t\t\t\t-39, -26, -35, 7, 98, -39, -24, -119, -41, 23, 8, 67, -37, 10,\n\t\t\t\t-127, 86, -82, 66, 109, 7, 79, -76, -70, 111, -52, -47, -74,\n\t\t\t\t-102, -17, 18, 40, 26, -115, -96, 34, 97, -71, 44, 38, 3, 77,\n\t\t\t\t-88, -13, 7, 37, 40, -89, -60, 42, -77, -104, 0, 0, 59 };\n\t\treturn data;\n\t}", "protected void setImageData(BufferedImage img) {\n \t\tif (format == null || format == Format.TEXT || format == Format.COLOR16_8x8)\n \t\t\treturn;\n \t\n \t\tequalize(img);\n \t\t\n \t\t//denoise(img);\n \t\t\n \t\tupdatePaletteMapping();\n \t\n \t\tflatten(img);\n \t\t\n \t\tif (!importDirectMappedImage(img)) {\n \t\t\tconvertImageToColorMap(img);\n \t\t}\n \t\n \t\treplaceImageData(img);\n \t}", "@Override\r\n\tpublic int[][][] processImg(int[][][] threeDPix) {\n\t\tint imgRows = threeDPix.length;\r\n\t\tint imgCols = threeDPix[0].length;\r\n\t\tint [][][] data = new int[imgRows][imgCols][4];\r\n\t\t\r\n\t\tfor (int i=0; i<imgRows; i++){\r\n\t\t\tfor (int j=0; j<imgCols; j++){\r\n\t\t\t\tdata[i][j][0] = 255;\r\n\t\t\t\tif (type == WHITE_THROUGH){\r\n\t\t\t\t\tif (threeDPix[i][j][1] == 255){\r\n\t\t\t\t\t\tdata[i][j][1] = origin[i][j][1];\r\n\t\t\t\t\t\tdata[i][j][2] = origin[i][j][2];\r\n\t\t\t\t\t\tdata[i][j][3] = origin[i][j][3];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdata[i][j][1] = 0;\r\n\t\t\t\t\t\tdata[i][j][2] = 0;\r\n\t\t\t\t\t\tdata[i][j][3] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tif (threeDPix[i][j][1] == 0){\r\n\t\t\t\t\t\tdata[i][j][1] = origin[i][j][1];\r\n\t\t\t\t\t\tdata[i][j][2] = origin[i][j][2];\r\n\t\t\t\t\t\tdata[i][j][3] = origin[i][j][3];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tdata[i][j][1] = 0;\r\n\t\t\t\t\t\tdata[i][j][2] = 0;\r\n\t\t\t\t\t\tdata[i][j][3] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "private Bitmap decodeMapBitmap() {\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inJustDecodeBounds = false;\n options.inScaled = false;\n options.outWidth = 2048;\n options.outHeight = 2048;\n\n return BitmapFactory.decodeResource(getResources(), R.drawable.map, options);\n }", "private void fuzPixel(int rPix, int cPix, ImageArray iCopy){\n \n /*int rgb= currentIm.getPixel(rPix,cPix);\n double red= DM.getRed(rgb);\n double blue= DM.getBlue(rgb);\n double green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);*/\n \n int rgb = 0;\n double red = 0.0;\n double blue = 0.0;\n double green = 0.0;\n int alpha = 0;\n \n for(int rr = rPix-1; rr < rPix+2; rr++){\n \n for(int cc = cPix-1; cc <cPix+2; cc++){\n rgb = currentIm.getPixel(rr,cc);\n red = red + DM.getRed(rgb);\n blue = blue + DM.getBlue(rgb);\n green = green + DM.getGreen(rgb);\n alpha= alpha + DM.getAlpha(rgb);\n \n }\n \n }\n \n red = red/9;\n blue = blue/9;\n green = green/9;\n \n iCopy.setPixel(rPix, cPix,\n (alpha << 24) | ((int)red << 16) | ((int)green << 8) | \n (int)blue);\n }", "public static Bitmap convertToMutable(Bitmap imgIn) {\n try {\n //this is the file going to use temporally to save the bytes.\n // This file will not be a imageView, it will store the raw imageView data.\n File file = new File(Environment.getExternalStorageDirectory() + File.separator + \"temp.tmp\");\n\n //Open an RandomAccessFile\n //Make sure you have added uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"\n //into AndroidManifest.xml file\n RandomAccessFile randomAccessFile = new RandomAccessFile(file, \"rw\");\n\n // get the width and height of the source bitmap.\n int width = imgIn.getWidth();\n int height = imgIn.getHeight();\n Bitmap.Config type = imgIn.getConfig();\n\n //Copy the byte to the file\n //Assume source bitmap loaded using options.inPreferredConfig = Config.ARGB_8888;\n FileChannel channel = randomAccessFile.getChannel();\n MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0, imgIn.getRowBytes()*height);\n imgIn.copyPixelsToBuffer(map);\n //recycle the source bitmap, this will be no longer used.\n imgIn.recycle();\n System.gc();// try to force the bytes from the imgIn to be released\n\n //Create a new bitmap to load the bitmap again. Probably the memory will be available.\n imgIn = Bitmap.createBitmap(width, height, type);\n map.position(0);\n //load it back from temporary\n imgIn.copyPixelsFromBuffer(map);\n //close the temporary file and channel , then delete that also\n channel.close();\n randomAccessFile.close();\n\n // delete the temp file\n file.delete();\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return imgIn;\n }", "private static void reduceNoise(Mat image) {\n\n\t\t// create structuring element that will be used to \"dilate\" and \"erode\"\n\t\t// image. the element chosen here is a 3px by 3px rectangle\n\t\tMat erodeElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(1, 1));\n\n\t\t// dilate with larger element so make sure object is nicely visible\n\t\tMat dilateElement = Imgproc.getStructuringElement(Imgproc.MORPH_RECT,\n\t\t\t\tnew Size(12, 12));\n\n\t\t// Erode will shrink the grouping of pixels\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\t\tImgproc.erode(image, image, erodeElement);\n\n\t\t// // Dilate will expand the grouping of pixels\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\tImgproc.dilate(image, image, dilateElement);\n\t\t// Imgproc.dilate(image, image, dilateElement);\n\n\t}", "private static final byte[] xfdm_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -62, 0, 0, 104,\n\t\t\t\t104, 104, -1, -1, -1, 123, 123, 123, -127, -127, -127, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, -2, 14, 77, 97,\n\t\t\t\t100, 101, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0, 33,\n\t\t\t\t-7, 4, 1, 10, 0, 1, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 3, 57,\n\t\t\t\t24, -70, -36, 43, -62, 41, 0, 24, -116, -115, 86, 11, -103,\n\t\t\t\t-106, -41, 68, 73, -54, -11, -111, -27, -87, 12, -125, -93, 97,\n\t\t\t\t107, 27, -56, 111, 23, -49, -20, 25, -30, 108, -66, -107, 16,\n\t\t\t\t22, -81, -41, 16, 16, 123, 72, 6, 113, 40, 92, 44, -103, -79,\n\t\t\t\t38, 106, -102, 0, 0, 59 };\n\t\treturn data;\n\t}", "public void recycleBitmapData(){\n\t\tif(bmpData != null){\n\t\t\tbmpData.recycle();\n\t\t\tbmpData = null;\n\t\t}\n\t}", "private void resample(){\n\n\t\tint iRow;\n\t\t\n\t\t//saving copies\n\t\tif(rgdX0==null){\n\t\t\trgdX0=rgdX;\n\t\t\trgdY0=rgdY;\n\t\t}\n\t\t\n\t\t//initializing resamples\n\t\trgdX = new double[rgdX0.length][rgdX0[0].length];\n\t\trgdY = new double[rgdY0.length];\n\t\t\n\t\t//resampling\n\t\tfor(int i=0;i<rgdX.length;i++){\n\t\t\tiRow = rnd1.nextInt(rgdX.length);\n\t\t\tfor(int j=0;j<rgdX[0].length;j++){\n\t\t\t\trgdX[i][j]=rgdX0[iRow][j];\n\t\t\t}\n\t\t\trgdY[i]=rgdY0[iRow];\n\t\t}\n\t\tloadData(rgdX,rgdY);\n\t\tthis.mapCoefficients=null;\n\t}", "public TailoredImage uncompress() {\n\t\t\tsetPrimaryImg(snappyUnCompress(getPrimaryImg()));\n\t\t\tsetBlockImg(snappyUnCompress(getBlockImg()));\n\t\t\treturn this;\n\t\t}", "private static int[] initFloydSteinberg24To8(ColorCube colorCube) {\n // Allocate memory for the dither table.\n int[] ditherTable = new int[NBANDS * TOTALGRAYS];\n\n float[] thresh = new float[NGRAYS];\n\n //\n // Get the colorcube parameters\n //\n int[] multipliers = colorCube.getMultipliers();\n int[] dimsLessOne = colorCube.getDimsLessOne();\n int offset = colorCube.getAdjustedOffset();\n\n //\n // Construct tables for each band\n //\n for (int band = 0; band < NBANDS; band++) {\n int pTab = band * TOTALGRAYS;\n\n //\n // Calculate the binwidth for this band, i.e. the gray level step\n // from one quantization level to the next. Do this in scaled\n // integer to maintain precision.\n //\n float binWidth = 255.0F / dimsLessOne[band];\n\n //\n // Pre-calculate the thresholds, so we don't have to do\n // it in the inner loops. The threshold is always the\n // midpoint of each bin, since, in error diffusion, the dithering\n // is done by the error distribution process, not by varying\n // the dither threshold as in ordered dither.\n //\n for (int i = 0; i < dimsLessOne[band]; i++) {\n thresh[i] = (i + 0.5F) * binWidth;\n }\n thresh[dimsLessOne[band]] = 256.0F;\n\n //\n // Populate the range below gray level zero with the same entry\n // as that for zero. The error distribution can cause undershoots\n // of as much as 255.\n //\n int tableInc = 1 << ERR_SHIFT;\n int tableValue = (-UNDERSHOOT) << ERR_SHIFT;\n for (int gray = -UNDERSHOOT; gray < 0; gray++) {\n ditherTable[pTab++] = tableValue;\n tableValue += tableInc;\n }\n\n //\n // Populate the main range of 0...255.\n //\n int indexContrib = 0;\n float frepValue = 0.0F;\n int repValue;\n int binNum = 0;\n float threshold = thresh[0];\n int gray = 0;\n while (gray < 256) {\n //\n // Populate all the table values up to the next threshold.\n // Since the only thing which changes is the error,\n // and it changes by one scaled gray level, we can\n // just add the increment at each iteration.\n //\n int tableBase = indexContrib;\n repValue = (int) (frepValue + 0.5F);\n while ((float) gray < threshold) {\n ditherTable[pTab++] = ((gray - repValue) << ERR_SHIFT) + tableBase;\n gray++;\n }\n\n //\n // Once the gray level crosses a threshold,\n // move to the next bin threshold. Also update\n // the color contribution index step and the\n // representative value, needed to compute the error.\n //\n threshold = thresh[++binNum];\n indexContrib += multipliers[band];\n frepValue += binWidth;\n }\n\n //\n // Populate the range above gray level 255 with the same entry\n // as that for 255. As in the under-range case, the error\n // distribution can cause overshoots as high as 255 over max.\n //\n indexContrib -= multipliers[band];\n repValue = 255;\n tableValue = ((256 - repValue) << ERR_SHIFT) | indexContrib;\n\n for (gray = 256; gray < (256 + OVERSHOOT); gray++) {\n ditherTable[pTab++] = tableValue;\n tableValue += tableInc;\n }\n\n } // End band loop\n\n //\n // Add in the colormap offset value to the index contribution\n // for the first band. This eliminates the need to add it in\n // when we do the error diffusion.\n //\n int pTab = 0;\n for (int count = TOTALGRAYS; count != 0; count--) {\n ditherTable[pTab] += offset;\n pTab++;\n }\n\n return ditherTable;\n }", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "@Override\n\tpublic void run(ImageProcessor ip) {\n\t\twidth = ip.getWidth();\n\t\theight = ip.getHeight();\n\n\t\tbyte[] pixels = (byte[]) ip.getPixels();\n\t\tij.gui.Roi[] rois = new ij.gui.Roi[0];\n\t\tbyte[] output = trimSperm(pixels, width, height, rois);\n\n\t\tByteProcessor bp = new ByteProcessor(width, height, output);\n\t\tip.copyBits(bp, 0, 0, Blitter.COPY);\n\t\timage.show();\n\t\timage.updateAndDraw();\n\t}", "public void negative(BufferedImage img, int startX, int startY, int endX, int endY) throws IOException{\r\n int pixels[] = new int[3];\r\n double ww[]=new double[3];\r\n WritableRaster raster = img.getRaster();\r\n \r\n for(int i=startX;i<endX;i++) {\r\n for(int j=startY;j<endY;j++){\r\n \r\n \r\n raster.getPixel(i, j, pixels);\r\n \r\n ww[0] = 255-pixels[0];\r\n ww[1] = 255-pixels[1];\r\n ww[2] = 255-pixels[2];\r\n \r\n raster.setPixel(i, j, ww);\r\n \r\n }\r\n \r\n }\r\n\r\n \r\n\r\n }", "private void enhanceImage(){\n }", "public void setInputMap(RendererMapColor kMap) {\r\n\r\n super.setInputMap(kMap);\r\n\r\n // Reset the intensity image which corresponds to the RGB channels\r\n // so that it can be recomputed.\r\n m_acImageI = null;\r\n }", "public void blackScreen() {\n boolean var5 = field_759;\n int var1 = this.field_723 * this.field_724;\n int var2;\n if(this.interlace) {\n var2 = 0;\n int var3 = -this.field_724;\n if(var5 || var3 < 0) {\n do {\n int var4 = -this.field_723;\n if(var5) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n while(var4 < 0) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n var2 += this.field_723;\n var3 += 2;\n } while(var3 < 0);\n\n }\n } else {\n var2 = 0;\n if(var5 || var2 < var1) {\n do {\n this.pixels[var2] = 0;\n ++var2;\n } while(var2 < var1);\n\n }\n }\n }", "public @NotNull Image genMipmaps()\n {\n if (this.data != null)\n {\n // TODO - LWJGL-ify\n int mipCount = 1; // Required mipmap levels count (including base level)\n int mipWidth = this.width; // Base image width\n int mipHeight = this.height; // Base image height\n \n int mipSize = mipWidth * mipHeight * this.format.sizeof; // Image data size (in bytes)\n \n // Count mipmap levels required\n while (mipWidth != 1 || mipHeight != 1)\n {\n if (mipWidth != 1) mipWidth >>= 1;\n if (mipHeight != 1) mipHeight >>= 1;\n \n // Security check for NPOT textures\n if (mipWidth < 1) mipWidth = 1;\n if (mipHeight < 1) mipHeight = 1;\n \n Image.LOGGER.fine(\"Next mipmap level: %s x %s - current size %s\", mipWidth, mipHeight, mipSize);\n \n mipCount++;\n mipSize += mipWidth * mipHeight * this.format.sizeof; // Add mipmap size (in bytes)\n }\n \n if (this.mipmaps < mipCount)\n {\n Color.Buffer temp = Color.realloc(this.data, mipSize);\n \n if (temp.address() != 0)\n {\n this.data = temp; // Assign new pointer (new size) to store mipmaps data\n }\n else\n {\n Image.LOGGER.warning(\"IMAGE: Mipmaps required memory could not be allocated\");\n }\n \n // Pointer to allocated memory point where store next mipmap level data\n long nextMip = this.data.address() + (long) this.width * this.height * this.format.sizeof;\n \n mipWidth = this.width >> 1;\n mipHeight = this.height >> 1;\n mipSize = mipWidth * mipHeight * this.format.sizeof;\n Image imCopy = copy();\n \n for (int i = 1; i < mipCount; i++)\n {\n Image.LOGGER.fine(\"IMAGE: Generating mipmap level: %s (%s x %s) - size: %s - offset: 0x%x\", i, mipWidth, mipHeight, mipSize, nextMip);\n \n imCopy.resize(mipWidth, mipHeight); // Uses internally Mitchell cubic downscale filter\n \n if (imCopy.data != null) MemoryUtil.memCopy(imCopy.data.address(), nextMip, mipSize);\n nextMip += mipSize;\n this.mipmaps++;\n \n // Security check for NPOT textures\n if ((mipWidth >>= 1) < 1) mipWidth = 1;\n if ((mipHeight >>= 1) < 1) mipHeight = 1;\n \n mipSize = mipWidth * mipHeight * this.format.sizeof;\n }\n \n imCopy.delete();\n }\n else\n {\n Image.LOGGER.warning(\"Mipmaps already available\");\n }\n }\n return this;\n }", "public String[] stitch() {\n String[] result = new String[image.length * image[0][0].getImageSize()];\n Arrays.fill(result, \"\");\n for (int i = 0; i < image.length; i++) {\n for (int j = 0; j < image[i].length; j++) {\n for (int k = 0; k < image[i][j].getImageSize(); k++) {\n result[i * image[i][j].getImageSize() + k] += image[i][j].getImageSlice(k);\n }\n }\n }\n return result;\n }", "public static final int[] convert2grey_fast(DataBuffer bim) {\n if (bim.getDataType() == DataBuffer.TYPE_BYTE) {\n DataBufferByte dbi = (DataBufferByte) bim;\n byte[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i] & 0x000000FF; //just take green component\n z++; //cheaper than i/3\n\n }\n return copy;\n } else {\n DataBufferInt dbi = (DataBufferInt) bim;\n int[] data = dbi.getData();\n int[] copy = new int[data.length / 3];\n int z=0;\n final int l=data.length;\n for (int i = 1; i < l; i += 3) {\n copy[z] = data[i]; //just take green component\n z++; //cheaper than i/3\n }\n return copy;\n }\n }", "private static final byte[] xfplot_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -60, 17, 0, 0, 0,\n\t\t\t\t0, 74, 74, 74, 92, 92, 92, 98, 98, 98, 105, 105, 105, 108, 108,\n\t\t\t\t108, 116, 116, 116, 119, 119, 119, 123, 123, 123, -126, -126,\n\t\t\t\t-126, -123, -123, -123, -112, -112, -112, -109, -109, -109,\n\t\t\t\t-103, -103, -103, -95, -95, -95, -92, -92, -92, -1, -1, -1, -1,\n\t\t\t\t-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t\t\t\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t\t\t\t0, 0, 0, 33, -7, 4, 1, 0, 0, 17, 0, 44, 0, 0, 0, 0, 16, 0, 16,\n\t\t\t\t0, 0, 5, 85, 96, 36, -114, 81, 16, -112, 40, 105, -102, 105,\n\t\t\t\t-70, -98, 40, 64, 10, 116, 29, -109, 4, 65, -25, -73, 88, -4,\n\t\t\t\t-71, 95, -127, 36, 19, 17, -124, 66, 2, 81, 36, -56, 29, 11,\n\t\t\t\t78, -63, -88, 88, 115, -22, 104, -45, 72, 109, -53, 21, 1, 94,\n\t\t\t\t92, -63, 43, -126, 32, 64, -50, 47, -45, 25, 66, 64, 68, 0,\n\t\t\t\t-128, -11, 107, 13, 39, -58, 33, 106, 72, -67, 5, -49, -19, 91,\n\t\t\t\t35, 8, 110, 41, 33, 0, 59 };\n\t\treturn data;\n\t}", "public void pixaveGreyscale(int x1, int y1, int x2, int y2) {\n //float sumr,sumg,sumb;\n float sumg;\n int pix;\n //int r,g,b;\n float g;\n int n;\n\n if(x1<0) x1=0;\n if(x2>=kWidth) x2=kWidth-1;\n if(y1<0) y1=0;\n if(y2>=kHeight) y2=kHeight-1;\n\n //sumr=sumg=sumb=0.0;\n sumg = 0.0f;\n for(int y=y1; y<=y2; y++) {\n for(int i=kWidth*y+x1; i<=kWidth*y+x2; i++) {\n \n // old method use depth image\n //pix= kinecter.depthImg.pixels[i];\n //g = pix & 0xFF; // grey\n //sumg += g;\n \n //b=pix & 0xFF; // blue\n // pix = pix >> 8;\n //g=pix & 0xFF; // green\n //pix = pix >> 8;\n //r=pix & 0xFF; // red\n //if( random(0, 150000) > 149000 && r > 0) println(\"r \" + r + \" b \" + b + \" g \" + g);\n // averaging the values\n //sumr += b;//r;//g;//r;\n //sumg += b;//r;//g;\n //sumb += b;//r;//g;//b;\n \n // WORK WITH RAW DEPTH INSTEAD\n sumg += kinecter.rawDepth[i];\n\n \n }\n }\n n = (x2-x1+1)*(y2-y1+1); // number of pixels\n // the results are stored in static variables\n //ar = sumr/n; \n //ag = sumg/n; \n //ab = sumb/n;\n\n ar = sumg/n; \n ag = ar; \n ab = ar;\n }", "private void decodeImageData() throws IOException {\n\t\t\tfinal int nullCode = -1;\n\t\t\tfinal int npix = getMetadata().getIw() * getMetadata().getIh();\n\n\t\t\tbyte[] pixels = getMetadata().getPixels();\n\n\t\t\tif (pixels == null || pixels.length < npix) pixels = new byte[npix];\n\n\t\t\tshort[] prefix = getMetadata().getPrefix();\n\t\t\tbyte[] suffix = getMetadata().getSuffix();\n\t\t\tbyte[] pixelStack = getMetadata().getPixelStack();\n\n\t\t\tif (prefix == null) prefix = new short[MAX_STACK_SIZE];\n\t\t\tif (suffix == null) suffix = new byte[MAX_STACK_SIZE];\n\t\t\tif (pixelStack == null) pixelStack = new byte[MAX_STACK_SIZE + 1];\n\n\t\t\tgetMetadata().setPrefix(prefix);\n\t\t\tgetMetadata().setSuffix(suffix);\n\t\t\tgetMetadata().setPixelStack(pixelStack);\n\n\t\t\t// initialize GIF data stream decoder\n\n\t\t\tfinal int read = getSource().read();\n\t\t\tfinal int dataSize = read & 0xff;\n\n\t\t\tfinal int clear = 1 << dataSize;\n\t\t\tfinal int eoi = clear + 1;\n\t\t\tint available = clear + 2;\n\t\t\tint oldCode = nullCode;\n\t\t\tint codeSize = dataSize + 1;\n\t\t\tint codeMask = (1 << codeSize) - 1;\n\t\t\tint code = 0, inCode = 0;\n\t\t\tfor (code = 0; code < clear; code++) {\n\t\t\t\tprefix[code] = 0;\n\t\t\t\tsuffix[code] = (byte) code;\n\t\t\t}\n\n\t\t\t// decode GIF pixel stream\n\n\t\t\tint datum = 0, first = 0, top = 0, pi = 0, bi = 0, bits = 0, count = 0;\n\t\t\tint i = 0;\n\n\t\t\tfor (i = 0; i < npix;) {\n\t\t\t\tif (top == 0) {\n\t\t\t\t\tif (bits < codeSize) {\n\t\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\t\tcount = readBlock();\n\t\t\t\t\t\t\tif (count <= 0) break;\n\t\t\t\t\t\t\tbi = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdatum += (getMetadata().getdBlock()[bi] & 0xff) << bits;\n\t\t\t\t\t\tbits += 8;\n\t\t\t\t\t\tbi++;\n\t\t\t\t\t\tcount--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// get the next code\n\t\t\t\t\tcode = datum & codeMask;\n\t\t\t\t\tdatum >>= codeSize;\n\t\t\t\t\tbits -= codeSize;\n\n\t\t\t\t\t// interpret the code\n\n\t\t\t\t\tif ((code > available) || (code == eoi)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (code == clear) {\n\t\t\t\t\t\t// reset the decoder\n\t\t\t\t\t\tcodeSize = dataSize + 1;\n\t\t\t\t\t\tcodeMask = (1 << codeSize) - 1;\n\t\t\t\t\t\tavailable = clear + 2;\n\t\t\t\t\t\toldCode = nullCode;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (oldCode == nullCode) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tfirst = code;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tinCode = code;\n\t\t\t\t\tif (code == available) {\n\t\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\t\tcode = oldCode;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile (code > clear) {\n\t\t\t\t\t\tpixelStack[top++] = suffix[code];\n\t\t\t\t\t\tcode = prefix[code];\n\t\t\t\t\t}\n\t\t\t\t\tfirst = suffix[code] & 0xff;\n\n\t\t\t\t\tif (available >= MAX_STACK_SIZE) break;\n\t\t\t\t\tpixelStack[top++] = (byte) first;\n\t\t\t\t\tprefix[available] = (short) oldCode;\n\t\t\t\t\tsuffix[available] = (byte) first;\n\t\t\t\t\tavailable++;\n\n\t\t\t\t\tif (((available & codeMask) == 0) && (available < MAX_STACK_SIZE)) {\n\t\t\t\t\t\tcodeSize++;\n\t\t\t\t\t\tcodeMask += available;\n\t\t\t\t\t}\n\t\t\t\t\toldCode = inCode;\n\t\t\t\t}\n\t\t\t\ttop--;\n\t\t\t\tpixels[pi++] = pixelStack[top];\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tfor (i = pi; i < npix; i++)\n\t\t\t\tpixels[i] = 0;\n\t\t\tgetMetadata().setPixels(pixels);\n\t\t\tsetPixels();\n\t\t}", "public void fade2black() {\n int var3 = this.field_723 * this.field_724;\n int var2 = 0;\n if(field_759 || var2 < var3) {\n do {\n int var1 = this.pixels[var2] & 16777215;\n this.pixels[var2] = (var1 >>> 1 & 8355711) + (var1 >>> 2 & 4144959) + (var1 >>> 3 & 2039583) + (var1 >>> 4 & 986895);\n ++var2;\n } while(var2 < var3);\n\n }\n }", "public BufferedImage NOT(BufferedImage timg) {\n int width = timg.getWidth();\n int height = timg.getHeight();\n\n int[][][] ImageArray1 = convertToArray(timg);\n int[][][] ImageArray2 = convertToArray(timg);\n\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n\n int r = ImageArray1[x][y][1]; //r\n int g = ImageArray1[x][y][2]; //g\n int b = ImageArray1[x][y][3]; //b\n\n ImageArray2[x][y][1] = (~r) & 0xFF; //r\n ImageArray2[x][y][2] = (~g) & 0xFF; //g\n ImageArray2[x][y][3] = (~b) & 0xFF; //b\n\n }\n }\n return convertToBimage(ImageArray2);\n\n }", "interface WorldmapBuffer2 {\n final static byte[] image2 = {\n -125, 47, -3, 77, 51, 29, -45, -103, -120, 119, 76, -122, -82, -22, -106, 61, 113, 4, -59, 124, -116, 59, 115, -26, -44,\n 56, -115, 34, 106, -124, 98, 83, -115, 70, 9, -67, -116, 99, 92, -127, 89, -23, -68, -11, -41, 72, -15, -68, -48, 4,\n 29, 85, -30, 4, -79, -56, -20, 126, 69, 119, -119, -115, -116, 60, -37, -53, -107, 68, 90, -45, 79, -99, 108, 109, 45,\n 84, -65, -93, -44, -79, -23, -40, 23, -40, -48, 98, -92, -50, 125, -104, -52, -58, 50, -97, -119, 13, -78, -81, 82, -86,\n 15, -71, -92, 77, -115, -48, 48, 77, -88, 6, 61, 104, -117, -51, 103, -90, 5, -71, -52, 42, 76, -68, 113, 79, -7,\n 43, -42, -84, 38, -56, -100, 93, -44, 34, 71, -113, 100, -116, 64, 42, 88, -40, 94, 93, -83, -118, -115, 99, -32, -27,\n 72, -26, 43, -104, 35, 7, 37, 101, 12, -66, 107, -104, -128, -106, -116, 54, -93, -83, -119, -50, 23, -47, -117, 39, 89,\n 6, -9, 41, 47, 10, -37, -124, -2, 115, -40, -55, -67, -37, -118, -118, 92, 108, 24, -41, 35, -43, -61, 45, 44, 118,\n 87, 92, 70, -14, 108, -37, -22, -106, -41, -127, 124, -92, -70, -99, -42, 22, -38, 106, 43, -8, -84, -97, -99, -39, -48,\n -6, -62, 78, -10, -98, -38, 109, -98, -23, -87, -45, 112, -67, 73, 42, 21, 99, -25, 109, -40, -21, 10, 120, -88, -110,\n -99, 105, -37, -97, 68, -70, -112, 15, 54, -99, 111, 77, 37, 108, 52, -33, 113, 93, 59, -33, 56, -78, 124, -85, 42,\n 107, -3, -54, -94, 29, -37, 97, -53, -54, -24, 8, -113, -18, 45, 108, 61, 122, -124, 19, 102, 118, -65, -14, -31, 32,\n 30, -30, -8, 35, -40, 102, -106, -109, -33, -115, -58, -27, 38, -37, 43, 88, 106, -11, -104, -51, -16, 11, -39, 116, 24,\n -123, -48, -6, 107, 73, -39, -31, -107, 109, -98, 85, -36, 39, 115, 61, -37, -33, 53, -61, -49, 103, -119, -73, 84, -35,\n -64, -6, 97, -72, -85, -98, -94, 58, -33, 127, 77, -34, 96, 90, -127, 58, -22, -118, -61, -83, 58, 96, 59, 95, 27,\n 11, -29, -123, 76, 79, -108, 11, -48, -35, -100, -40, 82, 4, 97, 57, -18, -36, -63, -94, -28, -105, -87, -76, -57, -84,\n 122, -13, -40, -60, -37, -6, -28, -105, -42, -34, -105, 76, 61, 59, -2, -27, -103, -125, -76, 111, 39, -39, 118, -88, -119,\n 56, 43, 116, 50, 22, -87, 44, 43, -91, 63, -21, -51, -2, -14, -26, -38, -76, 36, -26, -52, -122, -26, 100, -61, -75,\n -108, 7, 24, -24, 92, -37, -28, -116, -51, 52, 126, -33, -103, -102, 114, -27, 77, -24, -124, 87, 68, -13, -119, -28, 99,\n -71, -33, 25, 88, -49, 120, 41, -24, -125, -82, -62, 102, -25, -49, -119, 25, -82, 111, 38, 63, -52, 76, 26, 81, 71,\n 118, -115, 39, 125, -58, -94, -26, 29, -109, -25, -4, -92, -80, 43, -42, -83, -108, -66, -86, -65, 43, -25, 19, 70, -23,\n -80, -68, -54, -72, -3, -43, 32, -117, -93, 102, -93, 27, -29, -77, 56, -70, -38, -34, 27, -67, -94, 52, -75, -119, -73,\n -5, -45, 58, 120, -48, 107, 125, -112, 109, -84, -25, 40, 78, -21, -8, 69, -27, -117, -36, 108, 57, 93, -114, 52, 120,\n -32, 100, 68, -48, -51, 65, -35, -42, 78, 82, 58, -88, 96, -121, 126, -39, 104, 34, -123, -6, 9, 66, -35, 40, 107,\n 66, -120, -65, 127, -125, -19, -75, 6, 122, -30, -21, -74, 42, 126, -121, 2, 3, -19, 22, 20, 53, 85, 89, 61, -21,\n -25, -95, 94, 18, -18, -35, 70, -101, 33, 10, -80, 18, 35, 94, 99, -98, -18, 40, -66, 87, 54, -18, -23, -36, 107,\n -24, 8, 47, -28, -113, -61, -87, -20, -98, -19, -71, 45, -35, -128, -82, -80, -23, -121, -38, 99, -117, -70, 7, 104, -20,\n 52, 122, -18, 76, -115, -40, 36, -6, -16, 88, -59, -72, 127, -58, -111, 59, 126, -2, 82, -17, -68, -49, -18, -63, -118,\n 111, -109, -33, 120, -118, -50, -52, 52, -29, -121, -2, -62, 126, 26, -124, -46, -18, -112, -115, 92, -65, 117, 125, -16, -74,\n 74, 90, -9, 27, -61, 0, 111, 110, 2, -72, -125, -102, 30, 22, 42, -33, 115, 23, -6, -24, 124, -102, -57, -16, 78,\n -62, 76, -119, 91, -48, -87, -65, -71, 126, -118, -123, -89, -18, -31, -92, -13, -95, -68, -35, -63, -100, 55, 88, -68, -47,\n -69, 55, -12, 99, 33, -16, -34, -22, -63, 66, 78, -11, -93, 78, 66, 17, 12, -75, -115, 6, -109, 34, 9, 114, -108,\n -72, -103, 8, -76, 112, 58, 126, -16, -74, -34, 102, 29, -56, -64, 88, 103, 123, -91, 100, 55, 61, -55, -50, 59, -33,\n -22, 90, 55, -90, -106, -3, -20, -79, -35, 53, -112, -2, -47, 49, -114, -23, 30, 95, -16, 25, 70, -17, 75, 53, -9,\n -38, 73, 109, 53, 38, -10, 106, -102, 55, -17, -31, 76, -26, -6, -128, -110, -1, -44, 25, 7, -56, 86, -56, -9, -6,\n 9, -10, -57, -66, -20, 5, 125, -8, 106, -83, -8, -1, -89, -13, -114, 31, -97, -88, -120, 75, -21, 42, -22, -19, -111,\n 101, -117, 107, -30, -71, 121, -11, -99, 23, 88, -68, -8, -88, -85, 25, -128, 72, 47, -95, -122, -125, -87, 50, -82, 50,\n -14, -34, -92, 112, 102, -29, -87, -113, -106, -64, -18, 108, 26, 107, 32, 69, -37, 120, 10, -113, 118, -20, -2, 38, -46,\n 93, -116, -63, 23, 126, -19, 25, -55, -113, -95, -99, 121, -55, 106, -122, 29, 72, -32, 117, 103, -106, 86, -52, 104, -37,\n 15, -14, -122, -27, -33, 77, 79, 96, 4, 27, 34, -87, -6, 69, -69, -69, -93, 113, 3, -49, 69, -75, 56, 101, 106,\n 78, 57, 62, -15, -16, 92, -8, -63, -114, -48, -59, -82, 95, 52, 116, 108, 104, 11, -69, 78, 6, 16, 1, 4, 14,\n 36, 88, -48, -32, 65, -124, 9, 21, 46, 100, 56, 80, 0, 0, 1, 7, 35, 10, -96, 8, 49, 98, -61, -126, 15,\n 1, 108, -28, -40, -47, -29, 71, -112, 33, 69, -114, 36, 89, -46, -28, 73, -108, 41, 47, 98, 76, -88, 113, 100, -59,\n -115, 43, 9, -62, -20, 72, 49, -128, 77, -121, 11, 93, -106, -92, 72, 83, -92, -52, -101, 61, 29, -6, -12, -120, 51,\n -88, -48, -116, 10, -127, 74, 100, 57, 115, 105, 83, -88, 45, -97, 10, -20, 57, 53, 42, 84, -93, 59, 85, 62, 20,\n -86, 53, -27, 87, -80, 97, -59, -114, 37, 91, -42, 108, 88, -85, 87, -43, -82, 101, -120, 52, -93, 70, -93, 87, -67,\n -98, -91, 91, -41, -82, -39, -86, 108, -25, 22, -35, 25, 119, -24, -57, -117, 50, -105, 86, 37, 10, 56, 110, -31, -102,\n 84, -111, 30, -2, -23, 23, -95, 85, -57, 65, 115, 98, -115, -52, 118, 109, 86, -73, -106, -43, 10, 30, -37, -109, 35,\n -30, -69, -2, -95, 69, -113, 38, 93, 58, 100, 90, -51, -87, 85, 27, -52, -85, 23, -76, 105, -40, -79, -47, 14, 69,\n -51, 122, 47, 95, -61, -84, 1, 83, 117, 74, -8, -90, 83, -117, 46, 43, 7, -83, 73, 24, -13, -17, -103, -89, 99,\n 54, -100, -24, -72, -7, 98, -29, -61, 21, -41, 94, -51, 50, 115, 117, -21, -103, 111, -13, -12, 44, -37, -5, 119, -16,\n -31, 65, 82, -57, 94, -34, -68, -50, -18, -30, -43, -81, 79, 60, 25, -29, -21, -94, 55, 79, -21, 110, -1, -5, -16,\n 68, -38, -48, -87, -73, 126, 59, 84, -30, 120, -72, -104, -29, -115, 53, -34, -116, -21, -17, 49, -14, -50, 83, -80, 41,\n -56, -2, -21, 108, 34, -10, 34, -108, 112, 66, -80, 18, 92, -16, -62, -43, -46, -93, 112, 67, -39, 4, -77, 78, 37,\n -86, 78, 3, -118, -90, -107, 112, 10, 44, -90, -86, -118, -77, -112, -71, 18, 31, -37, 77, -70, -57, -108, -102, 46, 58,\n 4, 49, -76, -47, -75, -89, 42, -37, -114, 39, -30, 56, -12, -15, 71, 9, 87, -68, 113, 72, -84, -128, 52, 114, 52,\n 15, -33, -5, -22, -60, -58, 104, 91, 14, 57, -59, -28, -5, -52, 64, 5, 3, 67, 48, -66, -53, 90, -126, 18, 61,\n 24, -119, -12, 50, -71, 39, -35, 123, -85, -84, 18, -113, 52, -13, 76, -46, -124, -4, 114, 77, 7, -47, 116, -77, -77,\n -103, 62, 4, 81, -54, -105, 66, -2, -124, 9, 63, -121, 32, -30, 107, -56, -25, -24, -29, 75, -51, 40, 9, -108, -18,\n 58, 54, 11, 5, 46, -52, -93, 108, -61, 11, -52, 55, 27, 117, 116, 73, 67, 35, 109, -53, -90, 29, 31, -75, 52,\n -52, 4, 43, 125, -47, 36, 38, -21, -53, 19, 75, 27, -97, -93, -76, 83, 80, 47, 27, 49, 63, 26, 37, 85, -107,\n -50, 39, 73, 100, -108, -52, 87, 47, -107, 117, 86, 64, 87, 93, -112, 43, -8, 102, -75, -76, 69, 37, -105, -52, -75,\n -43, -15, 14, 45, -11, -42, 1, 41, 101, 117, 79, -53, -4, 66, -83, 86, 91, 85, 35, -86, -71, 97, 53, -27, 49,\n 68, 93, -85, -107, -107, -39, 102, -85, -85, 8, 66, 107, -83, 53, -111, 65, -76, 78, -30, 118, -73, -93, -126, -67, 49,\n 48, -63, -74, -61, -42, 63, 49, 109, 91, 55, -37, -88, -26, 42, 108, -80, -77, -54, -20, -10, -34, 55, -33, -123, 87,\n -77, -82, -16, -11, 118, 75, -99, 68, 51, -18, 37, 19, -5, -22, -46, -39, -106, -22, -20, 109, -77, 1, -37, 117, 120,\n -33, 42, 81, 26, 76, -38, -97, 62, -11, -9, -30, 35, -7, -125, -40, 75, 13, 49, -34, 21, -32, -124, -21, -30, -17,\n -41, -32, -114, -123, -24, 92, -91, 42, 30, 89, -56, -26, -100, -118, 113, -29, 80, -59, 45, -40, 100, 72, -87, -11, -8,\n 102, 31, -11, -123, -103, 50, -118, 113, -34, -48, 74, -26, -2, 66, 51, -111, 83, 81, -55, 13, 85, 42, 17, -91, 34,\n 15, -49, -55, -46, -43, 121, -25, -128, -125, 123, -115, -79, 37, 17, -19, -39, 103, -84, -45, -124, -102, -29, -85, -77, -114,\n -80, -27, -74, -46, 36, -103, -44, -8, 8, -115, 55, 58, -115, 37, -14, -86, 54, -77, 103, 76, 21, 74, -96, -73, -66,\n 80, -39, -67, 56, -37, 74, 89, -81, -13, 86, -17, 105, -71, 83, -42, -37, -51, 59, -89, -22, -72, 49, -76, 83, 28,\n 79, 102, -102, -91, 62, 85, 109, -76, -109, 114, 92, 41, -31, 14, -114, 44, -45, -103, -5, 38, 114, -22, -116, 36, 6,\n 57, -15, -65, 59, 23, -38, 114, 12, -69, -10, -4, 107, 116, 65, 43, -4, 101, -50, 125, 37, -102, -72, -126, -17, -44,\n -119, 41, 22, 87, 84, -106, 103, 116, 65, -97, 123, -57, 17, 53, 119, 113, 116, -34, -111, -76, -3, -68, -63, 123, -49,\n -8, -74, -74, -75, -76, -7, 59, -83, -26, 125, 29, 118, -32, -29, -52, -82, 70, -105, 127, -41, 107, -38, -52, -87, -9,\n 83, 120, -20, -21, -107, 30, -8, -20, -49, 36, 12, 89, -84, 98, 37, 51, 120, -18, -124, 91, -98, -7, -14, -66, 101,\n 16, 61, -55, 54, -33, 62, 108, -21, -113, 87, 88, -47, -18, -21, 39, -117, 111, -23, 73, -74, 95, -68, 17, -45, 94,\n 95, -4, 7, 125, -81, 124, -84, 74, 75, 1, -101, -41, -66, -1, 65, -18, 113, -2, -17, -21, 21, 73, 114, 7, 32,\n -33, 108, -55, 112, -5, -93, -96, -18, 24, -104, -84, 10, 2, 73, 112, 122, 1, 96, 120, -58, -123, 40, 2, 25, 47,\n 125, 28, -20, -115, -1, -16, -73, 49, 105, -107, 14, 64, 74, -109, -110, -24, 50, 88, -65, -30, 93, 48, 106, 47, -4,\n -103, 8, -49, 102, -79, 32, -127, -49, 54, 54, -44, 22, 9, -99, -57, 67, 25, -50, -112, 96, 117, 43, -99, 91, -32,\n 66, 67, 36, 110, 37, -120, -17, 113, 97, 18, 5, 38, -93, 120, 9, 43, 103, 13, 99, 23, 16, 17, 38, 23, -25,\n 64, 113, -119, 65, -69, -33, 4, -115, -24, 68, 48, 90, 112, -117, 109, 10, -29, 122, 96, 4, -88, -2, -3, -120, 105,\n -127, 58, 31, 118, -48, -120, 58, -12, -115, -47, 111, 104, 73, 79, 119, -56, 87, 70, 60, 126, 70, -114, -41, -53, 35,\n 120, -10, -109, -91, -73, 52, -15, 46, -38, -79, -48, -63, -62, 119, -74, 28, 105, 113, -113, 33, -85, -48, -119, -122, -90,\n -89, 62, 70, -46, 92, 123, -44, -97, 36, 69, -74, 52, 64, -70, 103, -126, 14, 20, 100, -46, 2, 37, 59, 55, -54,\n 69, -127, 112, 92, 36, 25, 37, 118, 50, -55, 84, -46, -110, 97, 124, -37, -5, 58, -71, -54, -102, 89, 39, -109, -101,\n -53, -107, 10, -75, -89, 49, -106, -123, -14, -112, -118, -100, 78, 41, -123, 40, 46, 84, 114, 5, -106, -61, -2, 4, 85,\n -23, -74, -9, 74, 98, -118, 107, 82, -2, -5, 95, 1, 43, 22, -56, -15, 49, -82, -112, -70, 124, 30, 47, -87, -24,\n -53, 64, -118, -114, 108, -55, 36, -90, 49, -39, -120, -86, 19, -14, -117, -101, -90, 97, 91, 15, -35, 39, 63, 79, 101,\n 115, -120, 125, -111, -32, 125, 100, -103, -95, -3, 116, 105, -125, -40, 68, -112, 42, -127, 53, 78, 110, 50, -55, 105, -124,\n 10, -25, 101, -16, 89, -102, 114, 102, -24, -100, 127, 25, 86, 8, 55, -103, 21, 20, -127, -19, -102, -67, 108, -29, 21,\n -95, 39, 32, 82, -46, -77, -125, -100, -76, -25, 63, -111, -88, -49, 4, -50, -115, -117, 22, -3, 28, -5, -32, -55, 68,\n -72, 24, -48, 93, -3, 3, 90, -110, 30, 26, 71, 126, 89, -77, 45, -11, -108, 40, -3, 56, -6, -46, 105, 5, 40,\n -93, -38, 58, -35, -18, 96, 42, -78, 81, -102, -109, 65, 1, -35, -52, 96, 60, -54, 56, -121, -94, -76, -95, -46, -108,\n 104, 69, 111, -118, -49, 113, -127, -110, 123, -122, -71, 14, 50, -113, 42, 56, 67, 70, -47, 60, -52, -102, -35, 74, -43,\n 6, 66, 44, 102, 83, -87, -25, 99, -90, 12, 7, 118, 84, -80, 98, -55, 124, 9, -116, 33, 56, 35, 88, 41, -124,\n -122, -11, 126, 59, 36, -42, 84, 119, -7, -55, -91, -111, 52, -99, 88, -20, 42, 68, -83, 122, 32, -41, 64, -52, -87,\n 106, -59, -2, 99, 29, 17, -7, -80, -22, -119, 40, -123, 56, -28, 43, -30, -94, -89, 81, -73, -18, 114, 84, -120, -52,\n 11, 59, 125, -8, 88, -107, 2, -106, 69, 3, 53, -44, 94, 11, 91, 70, 87, 37, 11, 114, 56, 69, -25, 101, -97,\n -7, -61, -48, 29, 112, -89, 11, -107, -86, 98, -26, 90, 90, -122, 49, -47, -118, 92, 2, -19, -86, 44, -21, 89, 86,\n -114, 21, -78, -90, -75, -117, -35, 96, -21, -55, 5, -74, 53, -79, -76, -101, -22, 105, -33, -6, -37, -55, 10, -107, -95,\n 8, 92, -104, -83, 94, 123, 91, 26, 62, 18, -107, -77, -20, -47, 32, 39, 10, -37, 8, -110, 86, -76, 35, -116, -105,\n 69, 122, -21, -37, -103, 114, -87, 86, -109, 107, -36, 112, 89, 42, -87, -29, 34, 55, -125, -117, -63, -18, 123, -98, -69,\n -42, -13, -14, -107, -92, 101, 21, -24, 116, -63, -75, 92, 109, -23, 16, -75, 67, 53, 85, -125, 22, 39, -62, 126, 54,\n 80, -68, 96, -91, 84, 121, -19, 26, 94, -85, -19, 87, -113, 44, 68, -20, 110, -85, 11, -33, 12, -27, 102, 70, -26,\n -67, 43, 77, 103, 87, -94, -74, 25, 49, 82, 0, 22, -16, 11, 63, -120, 45, -27, 58, -105, -80, -73, 21, 41, 101,\n 83, -22, -34, -9, 34, 56, 53, 68, 116, 108, 100, 67, 88, -91, -82, -12, 73, 42, 39, 94, 19, -123, 43, 108, 97,\n 2, -14, -53, -88, -54, 76, 93, -2, 97, 33, 76, 37, -23, 6, -107, -102, 114, 25, 112, 124, -43, 37, 98, 22, -45,\n 119, -86, 107, -116, 104, -114, 67, -9, -30, -53, -6, 68, 95, 20, -34, 38, 116, 91, -85, -74, 42, 69, -39, -97, 64,\n -106, 113, 99, 18, 90, -28, -43, 38, 118, 89, -62, 61, 23, -110, 109, 76, -89, 119, -71, 56, 56, 21, 54, -87, -112,\n 71, 12, -30, 16, -29, -49, 116, -57, -117, -18, -115, 35, -52, 39, -17, 2, 54, -65, -65, -12, -14, 83, 109, -74, 46,\n 49, 35, -7, -66, -11, -116, 42, 112, 117, 124, 96, 42, -69, 6, -126, -60, -5, -22, 105, -25, -20, 48, -19, 112, 57,\n 102, 9, -83, 51, 76, -19, 21, -24, -115, 54, 90, -61, 79, 94, 96, -97, -33, -71, 99, 30, -9, -40, 89, 107, 67,\n -50, -116, -105, 27, -35, 2, -117, 105, -98, 45, 30, 112, -98, 37, -35, 59, 82, 89, 122, -61, -89, 94, 84, 110, -125,\n -20, 97, 81, 98, 58, -45, 88, 77, 22, -114, 33, 44, 22, 34, -93, -84, -75, -119, 84, 117, -83, 19, 99, 106, 86,\n -13, -82, -65, -2, -75, 105, -80, 91, 125, -40, 34, -97, 16, -44, -20, 125, 53, -96, 105, -51, 92, 68, -29, -102, 77,\n -89, -118, 91, 127, 14, 77, -48, 82, 27, -5, -91, -54, 115, -10, 32, 55, -23, -39, 61, -81, -74, -41, 39, 61, 10,\n -124, -77, -37, 109, -66, -31, -46, -108, -70, 27, 119, -84, -2, -93, -73, -27, -97, -10, -44, 92, -64, -42, -10, -24, -28,\n -43, -19, 122, -47, -51, -55, -82, 86, 116, -104, 121, 105, 72, -86, 126, 16, -46, 56, 18, 92, 0, 57, -106, 31, 88,\n 67, -75, 118, -17, -124, -113, -64, -21, 109, -25, 16, -25, -69, -36, 99, -6, 50, -65, -5, -67, 93, 120, -29, 53, -53,\n 13, 46, 49, -102, 59, -53, 41, -74, 74, 57, 64, -110, 115, -77, -94, -109, -13, 43, 79, 63, 92, -110, -78, -69, 100,\n -32, 8, -87, -42, 68, -38, 117, -29, 51, -49, -15, -96, 10, 119, 115, -25, 104, -38, -29, 77, -28, 76, 63, 83, -68,\n -100, 66, -30, 9, -86, 124, -82, -102, -54, -43, 91, 36, -94, 21, -70, 124, -24, -30, 47, -86, 24, 28, -17, 6, -101,\n -8, -101, -108, -34, -116, -50, 13, -68, -22, 57, 109, 107, -87, -49, -54, -22, 64, -47, 102, -12, 122, -77, 28, -28, -127,\n 85, 98, 115, 45, 10, -22, 75, 71, -99, -36, 102, -82, -94, 100, -99, 61, 103, 122, -31, 69, -74, -15, -3, 108, -38,\n -35, 103, 48, -80, -121, 125, -42, 117, -1, 56, -115, -51, -114, -44, -39, 74, 29, -42, -51, 14, -7, -32, 35, -99, -33,\n -72, 79, -102, -18, 124, -49, 41, -78, 77, 70, -17, -68, 3, 6, -77, 123, -97, 15, -39, 99, 41, -64, 127, 110, -105,\n 50, 80, 118, -9, 50, -37, 77, -58, -49, -1, -37, 119, 110, 28, -5, 40, 71, -2, 45, -81, -56, -17, 45, -27, 127,\n 83, -109, -70, -42, 45, -79, -114, 21, 14, -106, -102, 71, -19, -25, -73, -102, -32, -126, 18, -36, -14, -100, -59, 125, -4,\n 52, 14, -78, 71, -85, 8, -14, -87, 63, -39, -22, -11, 102, 105, -41, -13, -111, 46, -58, -62, 118, 31, 105, -49, -40,\n 15, -37, 125, -60, 70, -21, 105, -15, 0, -84, 51, 85, 54, 40, -73, -63, -49, 54, -15, -3, -24, -4, -96, 79, 50,\n -67, -72, 110, -22, -16, -15, -11, -4, -50, -89, -10, -36, 24, -92, 62, 72, 115, 45, -59, -114, -78, 63, -106, -108, -10,\n -23, -29, 29, -82, 58, -17, -13, 55, -24, 56, -98, -114, -73, -65, 117, -48, 111, -125, 49, -11, 75, 63, 2, 84, -69,\n -23, -53, -67, 21, -77, -72, 60, -61, 48, -98, 107, 54, 115, 75, -91, -61, -127, 21, -29, -53, 63, 48, 10, -67, 68,\n -103, 64, -63, 34, -94, -66, -126, -74, -11, -21, 64, -102, -85, 58, 4, 36, -68, 28, -119, 13, -86, -126, -107, 87, 3,\n -101, -1, -117, 63, -13, -93, 64, 97, 107, -67, 20, 124, 56, -86, -30, 64, 63, 99, -69, -22, 107, 63, 44, 3, 24,\n 12, -12, 61, 57, 65, -81, -100, -104, 24, -125, -86, -79, 10, 25, 63, 22, -20, -90, 92, -94, 45, -67, 11, -68, -89,\n -109, 65, -63, 43, 45, 78, 91, 48, -73, -77, -113, 28, 44, -67, -99, -46, 30, 118, -7, 35, 35, 92, -2, 62, 33,\n 28, 66, 34, -52, -88, 21, -76, 36, 111, -14, 64, 26, 52, 64, 49, -52, 36, 78, 115, 39, -54, -118, 66, 49, -46,\n 47, 19, 108, -95, -63, -77, -110, -67, -78, 45, 45, 12, -85, -5, -96, -101, -32, -61, 60, 61, -53, -118, 25, -108, -71,\n -7, -110, 62, -51, -38, 48, 94, -93, 51, -17, 8, -65, 75, 2, 51, 35, -45, 36, 32, -12, -69, 46, -116, 67, -20,\n 57, -88, -121, 73, -101, 68, 20, -64, -57, 57, -93, 1, -36, 67, -43, 106, 47, 63, -28, -68, 57, -30, 31, 53, 20,\n -103, -10, -64, -92, 78, -93, -62, 67, 84, 68, 57, 92, 40, 103, 122, -79, 13, 42, -94, -18, 114, -65, 62, -52, 67,\n 104, 75, 30, -109, 67, -61, -39, -128, 31, 114, 50, 60, 94, 65, -90, -5, 19, 69, 14, -117, -71, -111, 34, -77, 37,\n 116, -65, 37, 43, -64, -24, -117, -107, 112, -21, 13, 10, -39, -113, 14, -15, 68, -14, 90, -108, 71, -60, -59, 10, -86,\n 42, -68, 90, -58, -3, -47, -66, -68, 122, -102, 94, 83, -74, 98, 27, -58, -65, -101, 16, -74, 57, 70, -91, 57, -85,\n -66, -125, -108, 59, 98, 70, 27, 51, -106, -61, -40, 61, 14, -21, -59, -121, -62, 62, 92, 1, -61, 73, -92, -72, -2,\n 113, 18, 13, -110, -59, 89, -44, 69, -40, 113, -86, -42, -127, 70, 113, -20, 30, 3, -55, 57, 83, -76, -75, -82, -93,\n 58, -10, -2, 74, -58, 76, -71, -70, -1, 48, -73, 0, -100, 34, 64, 124, -94, 106, 19, 41, 91, -60, -107, 97, -53,\n 71, 61, 43, 54, -15, -22, -86, -96, 75, 64, 77, -62, 37, -68, 25, 72, -126, 44, 72, 59, -12, -98, -124, 124, 34,\n 40, -84, -74, 19, 107, -56, -104, -80, 8, -120, -84, -77, 17, -108, -69, 97, -62, 57, -24, -24, 69, -95, -29, 51, -117,\n 28, 67, 36, 100, -100, 107, -55, 68, -40, -128, -106, 86, -63, -81, 124, 43, -118, -109, 68, 73, -27, -13, -107, 22, 90,\n -91, -38, -15, -63, 14, 123, 29, -37, -101, 38, -99, 90, 38, -40, -29, -112, 82, -20, 16, 54, -45, -111, 44, -28, -92,\n -98, 100, -75, -60, 107, -92, 79, -127, 69, -42, -29, 21, 44, -117, -89, 39, 52, 74, 62, 84, -62, -85, -94, -88, 91,\n 52, 35, 70, 34, 65, 116, -14, -63, -88, -92, -88, -87, -108, -76, 7, 2, -54, -65, 120, -56, 72, 82, -88, -83, 28,\n 41, 34, -93, 61, -92, 60, 51, -43, 34, 49, 115, 100, 15, -56, 64, -98, 108, -124, -81, 52, -70, -97, 78, 92, -53,\n 70, 83, 58, -65, -93, 13, 0, -6, 58, 124, 100, -54, -89, -61, -56, 22, -87, 63, 38, 100, -57, 36, 52, 47, -105,\n 43, 56, -124, -4, 73, -128, -86, 27, 81, 123, -91, 103, 17, 38, -62, -116, -56, -88, -100, 24, -47, -60, 72, 20, 105,\n 70, 1, -63, 67, 68, -61, -58, -2, 36, -116, 43, -68, 84, -84, 109, -68, -52, -67, 20, 27, -62, 73, 75, 17, -111,\n 60, -84, -4, 76, 47, 76, -85, -61, -76, -113, -127, -109, -90, -15, -6, 61, -32, 83, -97, 30, -92, 58, -114, 99, 27,\n -111, 4, 70, -103, -116, -51, -81, 113, -87, 99, 116, -96, 43, -124, 19, 121, 73, 30, -36, 20, -80, -126, -103, 18, 110,\n -117, 19, -82, -112, -73, -33, 108, 31, -43, 76, 20, -20, 36, -50, -27, -111, 28, -16, -100, -52, -81, 124, 61, 109, 4,\n -114, -37, -100, 15, -41, -13, -52, -15, -87, -51, 41, -103, 78, 50, -13, 38, 47, 26, -55, -23, -79, -80, 50, 59, -61,\n -92, -72, -49, -43, -20, 70, -62, 43, -49, 101, -6, -56, -13, 36, 68, 96, 107, -78, -30, 88, 62, 7, -22, 62, -8,\n -100, 72, -6, 72, 17, 122, -84, -81, -59, 100, -52, 3, -111, 68, -115, 107, 61, -128, -124, 58, -55, -44, -82, -86, 84,\n -93, 24, 27, 80, -84, 43, -55, 122, -31, -114, 79, 75, 80, -22, -84, 67, -30, 26, -49, -25, 121, -48, 26, 26, 78,\n 15, -13, 41, -83, -108, 62, -76, 12, 67, -109, -93, -85, 111, 44, 70, -79, 50, -53, 25, 117, 74, 9, 18, -47, -8,\n 60, -106, -116, -101, 37, 20, 13, -48, 78, 43, 81, -108, 122, -55, 61, 44, -94, 11, 109, 59, 75, -4, 81, 101, 26,\n 80, 2, -11, -53, -74, -44, -47, -3, -46, 16, -29, -116, -2, -63, 14, 109, -63, 78, 123, 63, -6, 11, -46, 25, 108,\n 55, -106, -95, -58, 42, 53, -109, 38, -3, -100, -12, 76, -70, 79, 83, 82, 40, -75, 31, -54, -23, 41, -38, -52, 26,\n -56, -100, 75, 44, -91, -53, 27, 36, 79, 61, 36, 67, 90, -71, -47, -38, 58, 72, 3, -3, -119, 30, 27, -45, 51,\n 21, 74, -38, -111, -89, -108, -116, -58, -18, -68, -69, 84, -20, -49, -82, 76, -50, 56, 77, 59, 51, -107, -103, -31, -61,\n 15, -84, -84, 36, 8, 89, -44, 62, 93, -60, -103, 4, -56, 112, -12, -100, 114, -116, 40, -52, 49, -44, 67, 69, -44,\n 24, 109, 35, 73, -27, 20, -43, 11, 83, -85, -4, 75, 0, -103, -44, 83, 67, 63, 43, -38, 39, 24, 58, -50, -51,\n 116, 78, 78, 53, 60, 79, -75, -72, -55, 12, 85, 51, -38, 84, 59, -35, 77, 83, -27, 73, 84, 45, 76, -80, 68,\n 76, 57, -29, -45, 70, 33, 36, -33, -48, -97, 116, -103, 83, -57, -29, -77, -37, -85, -90, 47, 21, -98, -25, 104, 63,\n -50, -124, -86, 94, -115, -68, 55, -126, 28, -83, -100, 39, 97, -51, -105, -125, -20, 25, -90, -77, 46, 33, 91, 56, -73,\n -95, 67, -49, 83, 69, -52, -124, -95, 75, 108, 86, 78, 10, -53, 105, -51, -69, 106, 37, 48, -72, 121, -103, 108, 5,\n -100, 109, -51, -70, -112, 18, 67, 112, 45, -73, -14, -101, -46, -72, -102, -100, -117, -2, 58, -41, 92, 109, 18, -26, 92,\n 87, -107, 107, 87, -89, 115, 28, 105, 12, -59, 60, -70, -50, -71, 68, -72, 74, 44, 88, 39, 116, 88, -13, -116, 70,\n -62, -126, -61, 32, 68, 69, -127, -91, -42, 86, -76, 33, 122, 28, 75, -64, 11, -49, -70, -6, 83, -55, -14, 70, -101,\n 76, -82, -26, -93, 88, 49, -30, -66, -117, -123, -63, -116, 37, 37, -56, 36, -43, 124, 90, 41, -3, -28, 64, -115, -108,\n -56, 36, -78, 45, -109, -27, -114, 74, 75, 89, -93, -93, 82, 5, 116, -75, 107, 109, -70, -88, -13, 82, 90, 29, 90,\n 91, -115, 71, -117, -55, 48, -100, -35, 62, -99, 29, -40, -22, 19, -51, 56, 114, 51, -68, -71, -87, -101, 3, -83, 116,\n -5, -44, -66, -116, 75, 97, -31, 88, 27, 4, -66, -50, 88, 90, -104, -5, 43, 82, 60, 61, -76, 43, -41, -105, -107,\n -96, 11, 52, -47, 115, -13, 68, -78, 117, -94, -64, -68, 84, -83, 19, 65, 81, -27, 85, -81, -107, 90, 10, 125, -73,\n 101, 81, -75, -94, -83, -106, -123, 124, -64, 66, -12, 51, -75, 93, 83, 10, -102, 24, 15, 37, -100, 23, 13, 44, 59,\n -20, -52, -68, -99, -37, 107, 113, 85, -6, -78, -64, -78, -28, 40, 19, 74, -44, -76, 117, -47, 110, -94, 89, 114, 41,\n 84, 104, 90, -81, 50, 84, -36, -77, 27, 90, 119, -71, -100, -89, 58, 88, -76, -83, -43, -88, 122, -46, -2, -39, 115,\n 23, 88, -115, 56, -100, 99, 42, -50, -51, 60, 56, 69, -57, -34, 115, 52, -47, -19, -37, 75, -13, 43, -103, 75, -36,\n 124, -79, 92, 98, -13, 19, -83, 45, -48, -42, 29, -89, -69, -123, -35, 3, -108, -38, -58, 77, 82, -7, 66, 29, -36,\n 29, -42, -120, -75, -70, 76, -20, 93, -21, -124, -96, -33, 77, 88, 40, 42, -54, 35, -5, -109, -28, 5, -45, -30, 61,\n 51, 70, 100, -80, -21, 85, 94, -27, 124, 54, 83, -46, -89, 112, 76, -98, 91, -117, -34, 10, -44, -94, -39, -67, -107,\n 82, -119, 87, -84, -95, 94, 89, 101, -97, -92, 18, 82, -90, -24, 94, -17, -3, -34, 76, 17, 43, 60, 5, 88, -84,\n 99, 95, -13, 69, -109, -94, 28, -75, 80, 25, -37, 93, 101, 37, 40, 27, 84, -87, -30, -106, -104, 93, -37, -107, 92,\n -34, -91, 89, 95, -98, -93, -40, -22, -20, -33, 69, -52, -111, -47, 28, -35, 17, 19, 78, 5, 102, 91, -125, 77, 96,\n -122, -7, -71, 119, 124, 92, -56, 101, -32, 72, 3, 76, -71, -109, -46, -128, -107, 96, 76, 77, -42, -111, -46, -85, -114,\n 36, -32, -102, -93, -87, 2, -71, 59, -35, 117, -35, -120, 21, -32, -57, -117, 18, -118, -23, -52, -109, -125, -116, 25, -93,\n 95, 20, -74, -102, -47, -38, 26, -61, 36, 89, 25, -42, 37, -82, 4, -36, -107, -101, 97, 61, -46, -114, -53, 117, 94,\n -91, 43, -2, 41, -104, -67, 84, -61, -8, -31, -113, -95, 93, 96, -75, 29, 31, -10, -93, 115, 82, 51, 89, -67, -39,\n 109, 83, -30, -46, 68, -111, -65, 68, -63, -69, 89, -30, -103, 125, 78, 16, -91, 98, 121, -19, 84, 36, -75, 28, -2,\n -83, -55, 15, -36, -68, -51, -53, -30, 58, -51, 96, -55, 83, -49, -30, 35, 19, 49, 54, -64, 28, 54, 73, 53, -58,\n 94, -26, 107, 88, 87, -46, -32, -62, -77, 68, 124, 27, -59, -17, -83, -40, -30, 123, -61, 65, 1, -29, -46, 124, -29,\n 63, -66, 60, -42, 92, 34, 41, 118, 86, -2, -109, -75, 29, 76, 50, 47, -122, -50, -63, -11, -74, 27, 36, -76, -2,\n -94, 99, -50, 93, -42, 45, -126, 100, 109, -43, -75, 67, -82, 56, -124, 101, 84, 18, 108, 83, -44, -107, 26, 36, -114,\n 100, -65, 60, -46, -33, 17, 101, -128, -126, -40, 77, -93, 60, -24, 26, 98, -63, -60, -47, 67, 117, -71, 127, -107, -27,\n -27, -108, -45, 82, 78, -82, -90, 114, -93, -42, 51, -59, 18, -86, -28, 32, -119, 85, 30, -75, -27, -2, -75, 66, 108,\n -126, 102, -112, 124, 90, 102, -61, -60, 76, 86, 80, 107, 13, 85, 3, 94, 101, 97, 54, 90, 24, -67, 32, 106, -82,\n -26, 74, -77, 96, 21, -106, -57, -119, 52, 70, -28, 73, -61, -41, -4, -26, 58, -114, 99, 113, 38, -30, 122, -20, 102,\n 108, -34, -60, 116, -74, 62, 102, -2, -18, 34, 70, 125, -78, 47, 114, 103, 93, 113, 95, 74, -22, -41, -104, 100, -29,\n 115, 6, -48, 123, 94, -74, 20, 93, -116, -84, -19, 86, 127, -66, 20, -128, 30, -93, 113, 38, 103, -1, -28, 60, -28,\n -37, 89, 0, -52, 95, -42, -19, -94, -56, 65, -39, 16, 109, -24, 42, -42, 84, -120, -82, 89, 74, 4, 42, -32, 28,\n 89, 106, 77, -95, 22, 94, 62, -14, -39, 100, -113, -50, 24, -45, 107, 100, 55, 38, -28, 11, 29, 14, 102, -117, 104,\n -74, 101, -24, -67, -127, -65, -106, -58, 94, -113, 82, -72, -104, -106, -23, -119, 110, 99, 21, 69, 103, 113, -60, -55, 32,\n 73, -58, -99, -10, 95, 23, 101, -36, 125, -79, -23, 91, -98, -23, 2, 2, -44, -75, 92, 84, -116, 78, -22, 98, -52,\n -114, -59, 50, -25, 66, 113, -22, -89, 102, -72, 8, -117, -22, -88, -10, -26, 81, -74, -22, -117, -23, -46, 79, 5, -81,\n 13, -36, 41, 55, 44, 92, 69, -39, 39, -114, -18, -45, 124, -58, 13, -78, -10, 23, 82, -98, 58, 120, -31, 106, -83,\n -15, 33, 35, -126, 74, -121, -44, -111, -117, -75, 88, -112, -61, -21, -99, 46, -62, 122, 54, 46, -23, -99, -83, 76, -51,\n -49, -34, -20, 26, -63, 14, 92, -25, 104, 56, 116, -99, -21, -36, 101, 69, -7, -83, 44, -25, 91, -59, 64, -94, 37,\n -7, 104, 103, -103, -55, -57, -78, 74, 62, -79, -106, 108, -2, -105, 14, 106, -69, -98, -74, -53, 102, -84, 51, -86, -65,\n -20, 52, -23, 58, 105, -20, -20, 81, -25, -49, 114, -19, -122, -66, -53, -32, -78, -20, -61, -90, -20, -1, 90, -106, 57,\n 9, -19, 35, 52, -24, -73, 22, 109, -121, 38, 109, -83, -66, -82, -55, 67, 78, -84, -10, 78, 71, -82, 15, -39, 102,\n 83, -82, 27, 97, -22, 91, 110, 119, 62, 99, 98, -26, -109, -37, -58, 109, -104, 116, 27, 16, -98, 31, -24, -58, -103,\n -14, -19, -51, 26, 11, 76, -32, -42, 91, -98, -94, 101, -30, 118, -31, -111, 110, -68, 31, -78, -52, -92, 13, 102, -97,\n -36, 97, -40, -82, 60, -118, 11, -17, 127, 14, 107, -21, -114, -104, -76, 54, -18, 79, -106, 51, 41, 68, -29, -34, 118,\n 30, -110, 99, 60, -10, -106, 111, 35, -111, 86, -62, -2, -110, -19, -58, -62, 118, -60, -48, 31, 92, -34, -110, 57, -31,\n -2, 38, -24, -3, -51, 110, 1, 127, 20, -88, 68, 109, -114, -87, -18, -6, -50, -41, -90, 97, -32, -85, 29, -40, 6,\n -33, -76, -83, 13, -16, 9, 7, -25, -31, -10, -36, -12, -71, 111, -4, 22, -22, 118, 114, -16, -14, 58, -16, 110, 105,\n 25, 53, 11, 65, 23, -9, -25, -60, -2, -43, 19, -57, 44, -52, 69, -17, -110, -90, -38, 68, -42, 109, -90, 117, 92,\n -101, -14, -15, 17, -9, 22, -71, -76, -15, -59, 59, 95, 105, 26, 91, 37, 71, -2, 86, 59, 21, -14, 35, 68, -68,\n -43, -106, -16, 33, 15, 110, 127, -93, 110, 20, -9, -68, -77, -78, 97, -72, -35, -17, 68, 110, -17, -93, 49, -24, 41,\n -9, 94, 60, -77, -14, 43, 23, 100, 12, 70, -42, 28, 102, -19, 84, -67, -21, 48, -1, -105, -9, 61, -21, -31, 45,\n -13, 49, -92, 109, -2, -98, 31, 59, -26, 69, 54, 111, -13, 127, -122, -16, -58, 34, 115, 12, 103, 114, 43, -58, -63,\n 88, -68, 115, 60, -65, -21, 25, -113, -18, 78, 37, 36, 63, -1, 115, 26, -4, 91, 23, 82, -17, 96, -69, -26, -83,\n 62, 116, 97, 102, 106, 126, -69, 54, 17, 55, 87, 118, -108, -26, 71, -105, -14, 40, -3, -40, 60, -41, 115, 71, -79,\n 116, 57, -21, 50, 63, 13, -22, -15, -18, -12, -28, 30, 71, 76, 47, 111, 81, 7, 28, -38, 5, 96, -11, 61, -11,\n -23, 30, 79, -106, 6, -16, 76, 119, 52, -81, 122, -11, -6, 109, 81, -30, 60, 52, 74, 87, -68, 112, -114, -36, 46,\n -105, -15, 59, 12, -94, 96, 87, -29, 90, -28, -50, 55, 69, 110, 87, 79, -30, -1, -28, -103, 104, -37, 109, 6, -105,\n 67, -17, -2, 105, 94, -9, -56, 98, -87, -62, 35, 38, -67, 100, 26, -17, 102, -30, 87, 106, 47, -10, -48, -107, -93,\n -72, -50, 118, 45, -66, 98, 42, -110, -89, 11, -82, 106, 70, 55, -15, 66, 14, -44, 52, -116, 108, -120, -2, 11, 104,\n 116, 39, -15, -66, 5, 119, -54, -48, -11, 112, 110, -60, 85, 103, 94, -34, -18, -40, 82, 74, 118, -13, 117, -27, -75,\n 43, 104, 48, 95, -32, 126, -81, 112, 66, -89, 50, -126, -65, 106, 95, 122, -8, -33, -3, -32, -38, -122, -13, 58, 23,\n -8, 56, 126, 104, -58, 110, -8, 47, -98, -26, 123, -65, -52, 106, -124, -25, -128, -57, 90, -105, 12, 90, 109, -30, -8,\n 16, -90, 39, -119, 87, 92, 95, 15, 98, 120, 31, -32, -50, -43, 113, 120, -65, -11, -44, 53, 101, 72, -12, -8, -113,\n 111, 102, 8, 63, 65, -25, 6, -38, -127, -66, 100, -29, 49, 62, -25, 85, 101, -100, -49, 121, -78, -36, 121, -97, 61,\n 35, 112, -13, -54, 64, 87, -20, 60, 61, -10, -94, 50, 122, -66, 44, 113, 68, 43, -60, -107, 79, 119, 45, 105, -7,\n -55, -70, 122, -113, 105, 118, 74, -106, -6, -93, 111, 122, -98, 63, -61, 125, -117, 17, 80, 55, 123, -101, -105, -61, 86,\n -97, 48, -80, -49, 105, -79, 95, -31, 119, -11, 116, -30, 21, -7, -96, -9, -20, -106, 26, -7, -74, -105, -74, -73, 39,\n 48, 39, 39, 122, 103, -74, -25, 56, 92, 123, -74, -49, -5, 64, 68, 122, 64, -89, -9, -104, -73, -8, -124, -49, 63,\n -63, -33, 106, -62, 47, -4, -67, -9, 84, -82, -41, 68, -125, -97, 50, -69, -113, -6, -57, -73, -47, 55, -105, 124, -22,\n 52, -37, -2, 27, 34, 119, -17, 107, 124, -45, -50, -4, -101, -116, 124, -105, -60, -13, -77, -81, 71, -48, 15, 125, -52,\n 39, -3, -89, -82, -38, -98, 47, 123, -11, -93, 121, 45, 20, 125, 3, 119, -3, 89, -36, -4, -116, 7, -51, 1, 68,\n 90, -120, -76, -3, 11, -57, -3, -68, -58, -66, -54, 70, 124, 68, 22, -91, 126, 38, 76, -32, 95, 116, -31, -81, 45,\n -35, 71, 94, -71, -105, -3, 34, -59, -51, -27, 55, -11, -26, 23, -45, -92, -124, 116, -34, 23, -89, -23, -84, -2, -22,\n -67, 126, -25, 34, -2, -33, -101, 124, 8, -27, -2, -18, 31, 50, 73, 127, 118, -16, -65, 37, 67, 78, -17, 72, 55,\n -1, -13, -105, -79, 111, 75, -3, 35, 95, 127, -100, 18, 127, -125, 122, 127, 65, 19, -47, -128, -53, -31, -54, 7, -120,\n 0, 2, 7, 18, 44, 104, 112, -96, 0, 0, 10, 23, 50, 108, -24, -16, 33, -60, -120, 18, 39, 82, -84, 104, -15,\n 34, -58, -116, 26, 55, 114, -20, -24, -15, 35, -56, -123, 2, 4, -114, 60, 104, -14, 100, -128, -110, 7, 71, 38, 12,\n -23, -14, 37, -52, -104, 27, 85, -94, 60, -39, 82, 38, -50, -100, 58, 119, -30, -92, 89, -45, -96, -128, -101, 24, 125,\n 6, -3, 105, 20, 40, -49, -92, 74, -105, 50, 109, -22, 84, 105, 73, -97, 71, -127, -94, 12, -6, -12, 42, -42, -105,\n 82, -89, 10, -51, -22, -11, 43, -2, 88, -122, 91, 127, 90, -19, 72, -77, -24, -44, -93, 93, -61, -78, 109, -21, -10,\n -19, 85, -107, 99, -45, -90, -84, 10, -9, 46, -40, -71, 85, -41, -30, -19, -21, 87, -93, -34, -96, -126, 7, -125, -108,\n 11, 64, 47, 93, -110, 127, 23, 51, 110, -36, 88, 110, -30, -107, 104, 11, -14, 117, 108, 57, 36, 98, -54, -107, 47,\n 115, -10, 59, -103, -14, -50, -88, -103, 19, 111, -18, 108, -6, 52, 106, -114, 103, 35, 35, 61, 44, 88, 113, -22, -40,\n 67, 7, -45, -82, 93, 90, 54, 110, -84, -97, -53, -22, 20, 124, -72, 46, -21, -107, 95, 121, -25, 46, 110, -4, 35,\n -28, -32, -96, -59, -34, 62, -18, -4, 57, 116, -73, 69, -101, 107, 117, 61, 90, 109, 88, -33, -47, -73, 115, -1, -115,\n 80, -7, -14, -18, -30, -57, -109, 127, 74, 61, -26, -21, -49, -84, -49, -13, -116, 90, -2, 125, -22, -43, -32, 9, -78,\n -121, 111, -1, 62, -2, -20, 9, -81, -37, -51, -98, 50, 63, -128, -98, 81, 54, 31, 125, 1, 26, 120, 32, -126, -70,\n -127, 87, 95, 123, 12, 38, -8, 32, 122, -12, 17, 24, 30, -124, 21, 90, 120, -31, 80, 11, 74, -73, 31, -122, 29,\n -54, 68, -44, -124, 5, 122, 56, 34, -119, 24, -14, -41, 90, 91, -124, -107, -72, -30, 76, 3, -122, -8, 31, -117, 49,\n -54, 120, -33, -119, 20, -78, 53, -35, -116, 57, 70, 4, -2, 98, -120, 14, -22, -8, 35, -112, -114, -115, 53, -105, 118,\n -46, -111, 68, 91, -112, 51, -14, 56, -95, -113, 73, 58, -7, 100, -118, 72, -99, 85, 36, 92, 91, 53, 9, 37, -115,\n 18, 46, -88, 34, -106, 93, 122, -23, 25, 90, 55, -79, 116, 37, 83, 86, 126, 57, -94, 124, 116, 33, 121, 38, -101,\n 109, -34, 69, -100, 107, -116, -103, -23, -90, -123, 105, -90, 69, 38, -99, 121, -22, 25, -38, 98, 86, -30, -71, -25, 113,\n 75, -34, 9, 40, -95, -123, -42, -87, -103, -95, 7, 10, -54, 85, -94, -115, 58, -118, -33, 89, -113, 2, -72, 40, 118,\n -110, 90, 122, 41, 116, -122, 97, 106, 31, -91, -110, -123, -71, 41, -88, -95, 50, 39, -26, -97, -24, 53, -28, -98, -88,\n -28, 117, -118, 34, -107, -87, -70, -22, -88, 104, 44, 25, -39, 82, 122, -81, -114, 87, 91, -91, -74, -22, 42, -23, -100,\n -2, -91, 52, 38, -100, -69, 58, 71, 106, -91, -91, 10, 123, -84, -116, 82, 25, 91, 24, -118, -56, 102, -86, 16, 75,\n -40, 5, -21, 44, -75, 94, 42, 123, 35, 125, -53, 86, 91, 37, -83, -64, -111, -43, -22, -74, -31, 62, 25, -87, -81,\n -80, -119, 27, 104, -73, -4, 77, 123, 46, -69, 57, 106, 58, 28, -71, -19, 26, -105, 110, -82, -14, -38, -85, 35, -72,\n 113, 53, 123, 47, 110, -55, -43, -92, 45, -65, 1, -17, -87, -34, -111, 2, -9, -2, -5, 29, 89, 6, 43, -84, -85,\n -97, 11, -53, -26, -81, 77, 14, 75, 28, -22, -112, 19, -57, 22, 109, -62, 22, 107, 12, -85, 73, 0, 111, -36, 84,\n 84, -33, 126, 60, 50, -95, 21, -109, 124, 89, -56, 54, 121, 124, 50, -53, -121, 10, -41, -14, 95, 86, 65, 108, 35,\n -52, 53, -113, -37, -80, -51, 111, 30, -119, 112, -57, 57, -5, 124, -77, 104, 63, -65, -7, 26, -49, 61, 11, 125, -12,\n -113, -21, 34, -99, -105, -117, -3, 45, -3, 52, -44, -37, -38, -23, 116, -44, 85, 91, -3, 106, -104, 70, -83, 124, 53,\n -41, 93, 39, 61, -104, -42, 94, -117, 61, -74, -95, -109, -115, -74, 53, -39, 105, -85, -99, -96, -39, 25, -81, -3, 54,\n -36, 73, -18, -25, 109, -60, 113, -37, 125, 119, -78, -45, -3, -117, 55, -33, 125, -93, 73, 55, 85, 104, -5, 61, 56,\n -31, -90, 17, -35, -79, -32, -123, 43, -66, -72, -100, -121, 35, -60, 56, -28, -111, -33, 90, -76, -71, -110, 91, 126, 121,\n 110, -47, 18, 53, -45, -102, -104, 123, -2, -71, 110, 41, 87, 126, -111, -52, -7, -126, 126, 58, -22, -24, 77, 71, 52,\n -125, -76, 38, -98, 58, -20, -96, 59, -2, -85, -46, -79, -37, 126, 59, 84, -23, 117, -114, 59, -17, -67, -73, 71, -69,\n 92, -81, -5, 62, 124, -22, -91, 3, -1, 43, -15, -55, 43, 111, 86, -23, -34, -115, -71, 60, -12, -47, 59, 83, -124,\n -85, -73, -75, 75, 127, 61, -15, -70, 3, 110, 61, -10, -35, -13, -98, 30, 66, 92, 122, 63, -66, -14, -69, -109, 127,\n 126, -10, -74, -95, -65, 126, -7, -36, -77, -1, 62, -4, -15, -53, 63, 63, -3, -11, -37, 127, 63, -2, -7, -21, -65,\n 63, -1, -3, -81, 24, 16, 0, 0, 59\n };\n}", "public void ResetState() {\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n pictures[i][j] = temp_pictures[i][j];\n pictures2[i][j] = pictures[i][j];\n\n\n }\n }\n }", "public void image_toGrey(int my_id) {\n int y1;\n //int offset = size;\n int myInitRow = (int)(((float)my_id/(float)nThreads)*((float)height/2.0f));\n int nextThreadRow = (int)(((float)(my_id+1)/(float)nThreads)*((float)height/2.0f));\n int myEnd, myOff;\n myOff = 2*width*myInitRow;\n myEnd = 2*width*nextThreadRow;\n for(int i=myOff; i < myEnd;i++) {\n y1 = data[i]&0xff;\n image[i] = 0xff000000 | (y1<<16) | (y1<<8) | y1;\n }\n }", "private static void mapScaler(android.hardware.camera2.impl.CameraMetadataNative r1, android.hardware.camera2.legacy.ParameterUtils.ZoomData r2, android.hardware.Camera.Parameters r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void\");\n }", "static WGraphP4<Pixel> imageToGraph(BufferedImage image,\r\n Distance<Pixel> pd) {\r\n WGraphP4<Pixel> g = new WGraphP4<Pixel>();\r\n ArrayList<Pixel> pix = new ArrayList<Pixel>();\r\n int height = image.getHeight();\r\n int width = image.getWidth();\r\n for (int row = 0; row < height; row++) {\r\n for (int col = 0; col < width; col++) {\r\n Pixel v2 = new Pixel(col, row, image.getRGB(col, row));\r\n pix.add(v2);\r\n GVertex<Pixel> g2 = new GVertex<Pixel>(v2, g.nextID());\r\n g.addVertex(g2);\r\n if (col > 0) {\r\n Pixel v1 = pix.get(pix.size() - 2);\r\n double d = pd.distance(v1, v2);\r\n GVertex<Pixel> g1 = new GVertex<Pixel>(v1, g.id() - 2);\r\n g.addEdge(g1, g2, d);\r\n // System.out.println(g1.data().row() + \" \" +\r\n // g1.data().col());\r\n // System.out.println(g2.data().row() + \" \" +\r\n // g2.data().col());\r\n }\r\n if (row > 0) {\r\n Pixel v1 = pix.get(pix.size() - width - 1);\r\n double d = pd.distance(v1, v2);\r\n GVertex<Pixel> g1 = new GVertex<Pixel>(v1,\r\n g.id() - width - 1);\r\n g.addEdge(g1, g2, d);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * for (WEdge<Pixel> i : g.allEdges()) { Pixel d = i.source().data();\r\n * Pixel e = i.end().data(); // System.out.println(d.col() + \" \" +\r\n * d.row()); System.out.println(d.row() + \" \" + d.col());\r\n * System.out.println(e.row() + \" \" + e.col()); }\r\n */\r\n\r\n return g;\r\n }", "void unsetValueSampledData();", "@Override\n\tpublic void pintar() {\n\t\n\t\tapp.image(water, this.px, this.py);\n\t\t\n\t}", "public ZiplineLightData() {\n\t\tsamplePoints = new int[SAMPLE_POINTS];\n\t\tArrays.fill(samplePoints, -1);\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate void cloneImage() {\n//\t\tColorModel cm = offimg.getColorModel();\n//\t\t boolean isAlphaPremultiplied = cm.isAlphaPremultiplied();\n//\t\t WritableRaster raster = offimg.copyData(null);\n//\t\t offimg2 = new BufferedImage(cm, raster, isAlphaPremultiplied, null);\n//\t\t BufferedImage currentImage = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR);\n\n\t//Fastest method to clone the image (DOES NOT WORK for MACOS)\n//\t\t int[] frame = ((DataBufferInt)offimg.getRaster().getDataBuffer()).getData();\n//\t\t int[] imgData = ((DataBufferInt)offimg2.getRaster().getDataBuffer()).getData();\n//\t\t System.arraycopy(frame,0,imgData,0,frame.length);\n\t}", "public static void main(String[]args){\n Scanner reader = new Scanner(System.in);\n System.out.print(\"Enter an image file name: \");\n String fileName = reader.nextLine();\n APImage theOriginal = new APImage(fileName);\n theOriginal.draw();\n\n // Create a copy of the image to blur\n APImage newImage = theOriginal.clone();\n\n // Visit all pixels except for those on the perimeter\n for (int y = 1; y < theOriginal.getHeight() - 1; y++)\n for (int x = 1; x < theOriginal.getWidth() - 1; x++){\n\n // Obtain info from the old pixel and its neighbors\n Pixel old = theOriginal.getPixel(x, y);\n Pixel left = theOriginal.getPixel(x - 1, y);\n Pixel right = theOriginal.getPixel(x + 1, y);\n Pixel top = theOriginal.getPixel(x, y - 1);\n Pixel bottom = theOriginal.getPixel(x, y + 1);\n int redAve = (old.getRed() + left.getRed() + right.getRed() + \n top.getRed() + bottom.getRed()) / 5;\n int greenAve = (old.getGreen() + left.getGreen() + right.getGreen() + \n top.getGreen() + bottom.getGreen()) / 5;\n int blueAve = (old.getBlue() + left.getBlue() + right.getBlue() + \n top.getBlue() + bottom.getBlue()) / 5;\n\n // Reset new pixel to that info\n Pixel newPixel = newImage.getPixel(x, y);\n newPixel.setRed(redAve);\n newPixel.setGreen(greenAve);\n newPixel.setBlue(blueAve);\n }\n System.out.print(\"Press return to continue:\");\n reader.nextLine();\n newImage.draw();\n }", "private final void resetIsosurfaceBoundary() {\n \tif (debug) System.out.print(\"fast marching evolution: iso-surface reinit\\n\");\n\n \tfloat[] nbdist = new float[6];\n \tboolean[] nbflag = new boolean[6];\n \tboolean boundary;\n \tfloat[] tmp = new float[nx*ny*nz];\n \tboolean[] processed = new boolean[nx*ny*nz];\n \t\n\t\tfor (int xyz = 0; xyz<nx*ny*nz; xyz++) if (mask[xyz]) {\n\t\t\t\n\t\t\tboundary = false;\n\t\t\tfor (int l=0; l<6; l++) {\n\t\t\t\tnbdist[l] = UNKNOWN;\n\t\t\t\tnbflag[l] = false;\n\t\t\t\t\n\t\t\t\tint xyznb = xyz + xoff[l] + yoff[l] + zoff[l];\n\t\t\t\tif (segmentation[xyznb]!=segmentation[xyz] && mask[xyznb]) {\n\t\t\t\t\t// compute new distance based on processed neighbors for the same object\n\t\t\t\t\tnbdist[l] = Numerics.abs(mgdmfunctions[0][xyznb]);\n\t\t\t\t\tnbflag[l] = true;\n\t\t\t\t\tboundary = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (boundary) {\n\t\t\t\ttmp[xyz] = isoSurfaceDistance(mgdmfunctions[0][xyz], nbdist, nbflag);\n\t\t\t\tprocessed[xyz] = true;\n\t\t\t}\n\t\t}\n\t\t// once all the new values are computed, copy into original GDM function (sign is not important here)\n\t\tfor (int xyz = 0; xyz<nx*ny*nz; xyz++) {\n\t\t\tif (processed[xyz]) mgdmfunctions[0][xyz] = tmp[xyz];\n\t\t\telse mgdmfunctions[0][xyz] = UNKNOWN;\n\t\t}\n\t\t\t\n return;\n }", "private void doBlur(int times){\n \n int pixel, x,y;\n long s,r,g,b;\n //times the image will be blurred with the kernel\n for (int t = 0; t < times; t++) {\n //march pixels\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n //reset colors\n r = g = b = s = 0;\n //march pixels inside kernel\n for (int k = 0; k < kernelSize; k++) {\n for (int l = 0; l < kernelSize; l++) {\n //get rgb color from pixel\n x = j + l - kernelCenter; \n y = i + k - kernelCenter;\n try{\n if( x>=0 && x<512 && y>=0 && y<512 ){\n pixel = imageKerneled.getRGB(x,y);\n //multiply the rgb by the number in kernel\n r += ((pixel >> 16) & 0xff) * kernel[k][l];\n g += ((pixel >> 8) & 0xff) * kernel[k][l];\n b += ((pixel) & 0xff) * kernel[k][l];\n s += kernel[k][l];\n }\n }catch(ArrayIndexOutOfBoundsException e){\n System.out.println(\"Error en \"+x+\",\"+y);\n }\n }\n }\n //averages\n r = Math.round(r/s);\n if(r>255) {System.out.println(r+\" entro r > 255 en \"+j+\",\"+i); r=255; }\n else if(r<0) {System.out.println(r+\" entro r < 255 en \"+j+\",\"+i); r=0; }\n g = Math.round(g/s);\n if(g>255) {System.out.println(g+\" entro g > 255 en \"+j+\",\"+i); g=255; }\n else if(g<0) {System.out.println(g+\" entro g < 255 en \"+j+\",\"+i); g=0; }\n b = Math.round(b/s);\n if(b>255) {System.out.println(b+\" entro b > 255 en \"+j+\",\"+i); b=255; }\n else if(b<0) {System.out.println(b+\" entro b < 255 en \"+j+\",\"+i); b=0; }\n //set the new rgb\n imageKerneled2.setRGB(j,i,new Color((int)r,(int)g,(int)b).getRGB());\n }\n }\n copyKerneled2ToKerneled();\n System.out.println(\"Finished blur: \"+(t+1));\n }\n }", "static void processPicture(byte[][] img) {\n\t\tcontrastImage(img);\n\t\t//generateDebugImage(img);\n\t\t\n\t\t\n\t\tPoint[] ergs = raster(img);\n\t\tprintPoints(ergs);\n\t\tergs = Cluster.cluster(ergs);\n\t\tprintPoints(ergs);\n\t\tBlume[] blumen = Radiuserkennung.erkennen(img, ergs);\n\t\t\n\t\t//Blumen veröffentlichen!\n\t\tDaten.setNewBlumen(blumen);\n\t\t\n\t\tprintBlumen(blumen);\n\t}", "private static void filterNoise(BufferedImage image) {\n\t\tfor (int x=0; x<image.getWidth(); x++) {\r\n\t\t\tfor (int y=0; y<image.getHeight(); y++) {\r\n\t\t\t\t\r\n\t\t\t\tint pixelVal = image.getRGB(x, y);\r\n\r\n\t\t\t\t// check how many pixels in a 2 x 2 rectangle with this point \r\n\t\t\t\t// in the center have the same color as this point; if not \r\n\t\t\t\t// many, flip this pixel's color\r\n\t\t\t\tint startX = Math.max(x-2, 0);\r\n\t\t\t\tint startY = Math.max(y-2, 0);\r\n\t\t\t\tint endX = Math.min(x+2, image.getWidth()-1);\r\n\t\t\t\tint endY = Math.min(y+2, image.getHeight()-1);\r\n\r\n\t\t\t\tint matchCount = 0;\r\n\t\t\t\tint totalCount = 0;\r\n\t\t\t\tfor (int i=startX; i<=endX; i++) {\r\n\t\t\t\t\tfor (int j=startY; j<=endY; j++) {\r\n\t\t\t\t\t\tif (image.getRGB(i,j) == pixelVal) {\r\n\t\t\t\t\t\t\tmatchCount++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttotalCount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ((matchCount / (double) totalCount) < .2) {\r\n\t\t\t\t\tif (pixelVal == Color.YELLOW.getRGB()) {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.BLACK.getRGB());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\timage.setRGB(x, y, Color.YELLOW.getRGB());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (debug) {\r\n\t\t\ttry {\r\n\t\t\t\tImageIO.write(image, \"gif\", new File(\"noiseFiltered.gif\"));\r\n\t\t\t} catch (Exception e) {e.printStackTrace();}\r\n\t\t}\r\n\t}", "public static BufferedImage ghost( final BufferedImage input )\n {\n return ALPHA.filter( input, null );\n }", "public void adjustMap(MapData mapd){\n int[][] map = mapd.getMap();\n int mx=mapd.getX();\n int my=mapd.getY();\n for(int y=0;y<my;y++){\n for(int x=0;x<mx;x++){\n boolean l = false;\n boolean r = false;\n boolean t = false;\n boolean b = false;\n boolean tl = false;\n boolean tr = false;\n boolean bl = false;\n boolean br = false;\n \n\n if(map[x][y]>0 && map[x][y]<26) {\n int mustSet = 0;\n //LEFT\n if (x > 0 && map[x - 1][y] > 0 && map[x-1][y]<26) {\n l = true;\n }\n //RIGHT\n if (x < mx - 1 && map[x + 1][y] > 0 && map[x+1][y]<26) {\n r = true;\n }\n //TOP\n if (y > 0 && map[x][y - 1] > 0 && map[x][y-1]<26) {\n t = true;\n }\n //Bottom\n if (y < my - 1 && map[x][y + 1] > 0 && map[x][y+1]<26) {\n b = true;\n }\n //TOP LEFT\n if (x > 0 && y > 0 && map[x - 1][y - 1] > 0 && map[x-1][y-1]<26) {\n tl = true;\n }\n //TOP RIGHT\n if (x < mx - 1 && y > 0 && map[x + 1][y - 1] > 0 && map[x+1][y-1]<26) {\n tr = true;\n }\n //Bottom LEFT\n if (x > 0 && y < my - 1 && map[x - 1][y + 1] > 0 && map[x-1][y+1]<26) {\n bl = true;\n }\n //Bottom RIGHT\n if (x < mx - 1 && y < my - 1 && map[x + 1][y + 1] > 0 && map[x+1][y+1]<26) {\n br = true;\n }\n\n //Decide Image to View\n if (!r && !l && !t && !b) {\n mustSet = 23;\n }\n if (r && !l && !t && !b) {\n mustSet = 22;\n }\n if (!r && l && !t && !b) {\n mustSet = 25;\n }\n if (!r && !l && t && !b) {\n mustSet = 21;\n }\n if (!r && !l && !t && b) {\n mustSet = 19;\n }\n if (r && l && !t && !b) {\n mustSet = 24;\n }\n if (!r && !l && t && b) {\n mustSet = 20;\n }\n if (r && !l && t && !b && !tr) {\n mustSet = 11;\n }\n if (r && !l && t && !b && tr) {\n mustSet = 2;\n }\n if (!r && l && t && !b && !tl) {\n mustSet = 12;\n }\n if (!r && l && t && !b && tl) {\n mustSet = 3;\n }\n if (r && !l && !t && b && br) {\n mustSet = 1;\n }\n if (r && !l && !t && b && !br) {\n mustSet = 10;\n }\n if (!r && l && !t && b && bl) {\n mustSet = 4;\n }\n if (r && !l && t && b && !tr) {\n mustSet = 15;\n }\n if (r && !l && t && b && tr) {\n mustSet = 6;\n }\n if (!r && l && t && b && !tl) {\n mustSet = 17;\n }\n if (!r && l && t && b && tl) {\n mustSet = 8;\n }\n if (r && l && !t && b && !br) {\n mustSet = 14;\n }\n if (r && l && !t && b && br) {\n mustSet = 5;\n }\n if (r && l && t && !b && !tr) {\n mustSet = 16;\n }\n if (r && l && t && !b && tr) {\n mustSet = 7;\n }\n if (!r && l && !t && b && !bl) {\n mustSet = 13;\n }\n if (r && l && t && b && br && tl) {\n mustSet = 9;\n }\n if (r && l && t && b && !br && !tl) {\n mustSet = 18;\n }\n\n //System.out.println(\"MAP SEGMENT : \" + mustSet);\n map[x][y] = mustSet;\n }\n mapd.setMap(map);\n }\n }\n System.out.println(\"Map Adjust OK !\");\n }", "private Bitmap m6552d() {\n if (this.f5072i == null) {\n this.f5072i = m6555f();\n }\n return this.f5072i;\n }", "public void paint(Graphics g) {\n filterImage();\n\n g.drawImage(biFiltered, 0, 0, null);\n\n g.drawImage(biFiltered1, 512, 0, null);\n\n //g.drawImage(biFiltered2, 512, 512, null);\n\n }", "public void InitMap() {\n for (int i=0; i<m_mapSize; i++) {\n SetColour(i, null);\n }\n }", "private static final byte[] xfj_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -29, 0, 0, 76,\n\t\t\t\t76, 76, 11, 11, 11, 7, 7, 7, -47, -47, -47, -1, -1, -1, -7, -7,\n\t\t\t\t-7, -128, -128, -128, 113, 113, 113, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n\t\t\t\t-1, -1, 33, -2, 14, 77, 97, 100, 101, 32, 119, 105, 116, 104,\n\t\t\t\t32, 71, 73, 77, 80, 0, 33, -7, 4, 1, 10, 0, 8, 0, 44, 0, 0, 0,\n\t\t\t\t0, 16, 0, 16, 0, 0, 4, 93, 16, 73, 9, -24, -84, 51, 99, 84,\n\t\t\t\t119, -106, 1, 16, -124, -31, 7, 6, 2, -112, 10, -23, 24, 76,\n\t\t\t\t-63, 48, -90, -86, -8, 34, 119, 64, 12, -78, 27, -53, 56, 24,\n\t\t\t\t97, -57, -29, 13, 95, 55, 28, -95, 48, 100, 46, -111, -97, 0,\n\t\t\t\t115, 122, 76, 26, -82, -40, -31, 18, -104, -63, 94, -117, 50,\n\t\t\t\t-62, -31, 32, 41, 20, -68, -66, -27, -110, -116, -16, 26, -76,\n\t\t\t\t-50, -79, -28, -118, 56, 27, -118, 99, 118, -37, -48, -11, 125,\n\t\t\t\t-24, 38, -127, 17, 0, 59 };\n\t\treturn data;\n\t}", "boolean isBlurred(String imageLocation) {\n\t\t\tBitmapFactory.Options opt = new BitmapFactory.Options();\n\t\t\topt.inDither = true;\n\t\t\topt.inPreferredConfig = Bitmap.Config.ARGB_8888;\n\t\t\tFile f = new File(imageLocation);\n\t\t\tFile f1 = new File(Environment.getExternalStorageDirectory(),\n\t\t\t\t\t\"Flash/raw/raw01.jpg/\");\n\n\t\t\tBitmap image = BitmapFactory.decodeFile(f.getAbsolutePath());\n\t\t\tBitmap image1 = BitmapFactory.decodeFile(f.getAbsolutePath());\n\t\t\tint l = CvType.CV_8UC1; // 8-bit grey scale image\n\t\t\tMat matImage = new Mat();\n\t\t\tUtils.bitmapToMat(image, matImage);\n\t\t\tMat matImageGrey = new Mat();\n\t\t\tImgproc.cvtColor(matImage, matImageGrey, Imgproc.COLOR_BGR2GRAY);\n\n\t\t\tBitmap destImage;\n\t\t\tdestImage = Bitmap.createBitmap(image);\n\t\t\tMat dst2 = new Mat();\n\t\t\tUtils.bitmapToMat(destImage, dst2);\n\t\t\tMat laplacianImage = new Mat();\n\t\t\tdst2.convertTo(laplacianImage, l);\n\t\t\tImgproc.Laplacian(matImageGrey, laplacianImage, CvType.CV_8U);\n\t\t\tMat laplacianImage8bit = new Mat();\n\t\t\tlaplacianImage.convertTo(laplacianImage8bit, l);\n\n\t\t\tBitmap bmp = Bitmap.createBitmap(laplacianImage8bit.cols(),\n\t\t\t\t\tlaplacianImage8bit.rows(), Bitmap.Config.ARGB_8888);\n\n\t\t\tUtils.matToBitmap(laplacianImage8bit, bmp);\n\t\t\tint[] pixels = new int[bmp.getHeight() * bmp.getWidth()];\n\t\t\tbmp.getPixels(pixels, 0, bmp.getWidth(), 0, 0, bmp.getWidth(),\n\t\t\t\t\tbmp.getHeight());\n\n\t\t\tint maxLap = -16777216;\n\n\t\t\tfor (int i = 0; i < pixels.length; i++) {\n\t\t\t\tif (pixels[i] > maxLap)\n\t\t\t\t\tmaxLap = pixels[i];\n\t\t\t}\n\n\t\t\tint soglia = -8500000;// -6118750; -93492394; //\n\t\t\t// blurred: -12500671\n\t\t\t// nonblurred: -8487298\n\t\t\t// medium blurred: -8947849\n\t\t\tif (maxLap < soglia || maxLap == soglia) {\n\t\t\t\tString result = \"Blurred\";\n\t\t\t\tSystem.out.println(\"img is: \" + maxLap + \" blurred\");\n\t\t\t\tLog.d(\"DEBUG\", \"\" + maxLap);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tString result = \"Not blurred\";\n\t\t\t\tLog.d(\"DEBUG\", \"\" + maxLap);\n\t\t\t\tSystem.out.println(\"img is: \" + maxLap + \" not blurred\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "private static final byte[] xfsp_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -95, 0, 0, 76,\n\t\t\t\t76, 76, -1, -1, -1, 124, 124, 124, -1, -1, -1, 33, -2, 14, 77,\n\t\t\t\t97, 100, 101, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 0,\n\t\t\t\t33, -7, 4, 1, 10, 0, 3, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 2,\n\t\t\t\t52, -36, -128, -87, 104, 6, 2, -93, 4, -19, -56, 43, 104, 123,\n\t\t\t\t34, 4, -84, 57, -112, 7, 86, 28, 121, -123, 86, -9, -91, -26,\n\t\t\t\t-40, 78, 47, 91, 110, 112, 45, -46, -82, -51, 122, -88, 122,\n\t\t\t\t-14, -3, 102, 24, 8, -80, 24, 1, 46, -106, -122, 2, 0, 59 };\n\t\treturn data;\n\t}", "private void m87324c() {\n this.f61230w = -1;\n this.f61216i = false;\n this.f61217j = false;\n this.f61229v = 0.0f;\n this.f61228u = 0.0f;\n this.f61227t = 0.0f;\n this.f61223p.clear();\n }", "private android.graphics.Bitmap getMaskBitmap() {\n /*\n r20 = this;\n r0 = r20;\n r1 = r0.f5066b;\n if (r1 == 0) goto L_0x0009;\n L_0x0006:\n r1 = r0.f5066b;\n return r1;\n L_0x0009:\n r1 = r0.f5069f;\n r2 = r20.getWidth();\n r1 = r1.m6537a(r2);\n r2 = r0.f5069f;\n r3 = r20.getHeight();\n r2 = r2.m6539b(r3);\n r3 = m6543a(r1, r2);\n r0.f5066b = r3;\n r4 = new android.graphics.Canvas;\n r3 = r0.f5066b;\n r4.<init>(r3);\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5049a;\n r5 = r0.f5069f;\n r5 = r5.f5059i;\n r5 = r5.ordinal();\n r3 = r3[r5];\n r5 = 4611686018427387904; // 0x4000000000000000 float:0.0 double:2.0;\n r7 = 2;\n if (r3 == r7) goto L_0x0074;\n L_0x003b:\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5050b;\n r8 = r0.f5069f;\n r8 = r8.f5051a;\n r8 = r8.ordinal();\n r3 = r3[r8];\n r8 = 0;\n switch(r3) {\n case 2: goto L_0x0055;\n case 3: goto L_0x0051;\n case 4: goto L_0x004f;\n default: goto L_0x004b;\n };\n L_0x004b:\n r9 = r1;\n r3 = 0;\n L_0x004d:\n r10 = 0;\n goto L_0x0058;\n L_0x004f:\n r3 = r2;\n goto L_0x0053;\n L_0x0051:\n r8 = r1;\n r3 = 0;\n L_0x0053:\n r9 = 0;\n goto L_0x004d;\n L_0x0055:\n r10 = r2;\n r3 = 0;\n r9 = 0;\n L_0x0058:\n r19 = new android.graphics.LinearGradient;\n r12 = (float) r8;\n r13 = (float) r3;\n r14 = (float) r9;\n r15 = (float) r10;\n r3 = r0.f5069f;\n r16 = r3.m6538a();\n r3 = r0.f5069f;\n r17 = r3.m6540b();\n r18 = android.graphics.Shader.TileMode.REPEAT;\n r11 = r19;\n r11.<init>(r12, r13, r14, r15, r16, r17, r18);\n r3 = r19;\n goto L_0x009c;\n L_0x0074:\n r3 = r1 / 2;\n r8 = r2 / 2;\n r16 = new android.graphics.RadialGradient;\n r10 = (float) r3;\n r11 = (float) r8;\n r3 = java.lang.Math.max(r1, r2);\n r8 = (double) r3;\n r12 = java.lang.Math.sqrt(r5);\n r8 = r8 / r12;\n r12 = (float) r8;\n r3 = r0.f5069f;\n r13 = r3.m6538a();\n r3 = r0.f5069f;\n r14 = r3.m6540b();\n r15 = android.graphics.Shader.TileMode.REPEAT;\n r9 = r16;\n r9.<init>(r10, r11, r12, r13, r14, r15);\n r3 = r16;\n L_0x009c:\n r8 = r0.f5069f;\n r8 = r8.f5052b;\n r9 = r1 / 2;\n r9 = (float) r9;\n r10 = r2 / 2;\n r10 = (float) r10;\n r4.rotate(r8, r9, r10);\n r9 = new android.graphics.Paint;\n r9.<init>();\n r9.setShader(r3);\n r5 = java.lang.Math.sqrt(r5);\n r3 = java.lang.Math.max(r1, r2);\n r10 = (double) r3;\n r5 = r5 * r10;\n r3 = (int) r5;\n r3 = r3 / r7;\n r5 = -r3;\n r6 = (float) r5;\n r1 = r1 + r3;\n r7 = (float) r1;\n r2 = r2 + r3;\n r8 = (float) r2;\n r5 = r6;\n r4.drawRect(r5, r6, r7, r8, r9);\n r1 = r0.f5066b;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.shimmer.ShimmerFrameLayout.getMaskBitmap():android.graphics.Bitmap\");\n }", "private void changePixelValues(ImageProcessor ip) {\n\t\t\tint[] pixels = (int[])ip.getPixels();\r\n\t\t\t\r\n\t\t\tfor (int y=0; y<height; y++) {\r\n\t\t\t\tfor (int x=0; x<width; x++) {\r\n\t\t\t\t\tint pos = y*width + x;\r\n\t\t\t\t\tint argb = origPixels[pos]; // Lesen der Originalwerte \r\n\t\t\t\t\t\r\n\t\t\t\t\tint r = (argb >> 16) & 0xff;\r\n\t\t\t\t\tint g = (argb >> 8) & 0xff;\r\n\t\t\t\t\tint b = argb & 0xff;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// anstelle dieser drei Zeilen später hier die Farbtransformation durchführen,\r\n\t\t\t\t\t// die Y Cb Cr -Werte verändern und dann wieder zurücktransformieren\r\n\t\t\t\t\t\r\n\t\t\t\t\tYUV c = new YUV(r, g, b);\r\n\t\t\t\t\t\r\n\t\t\t\t\tc.changeBrightness(brightness).changeContrast(contrast).changeSaturation(saturation).changeHue(hue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint[] rgbNew = c.toRGB();\r\n\r\n\t\t\t\t\t// Hier muessen die neuen RGB-Werte wieder auf den Bereich von 0 bis 255 begrenzt werden\r\n\t\t\t\t\t\r\n\t\t\t\t\tpixels[pos] = (0xFF<<24) | (rgbNew[0]<<16) | (rgbNew[1]<<8) | rgbNew[2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public static void spreadDust() {\n newMap = new int[R][C];\n\n for (int i = 0; i < R; i++) {\n for (int j = 0; j < C; j++) {\n if (map[i][j] > 0) {\n int cnt = 0;\n for (int d = 0; d < 4; d++) {\n int ny = i + dy[d];\n int nx = j + dx[d];\n\n if (ny < 0 || ny > R - 1 || nx < 0 || nx > C - 1 || map[ny][nx] == -1)\n continue;\n\n newMap[ny][nx] += map[i][j] / 5;\n cnt++;\n }\n newMap[i][j] += map[i][j] - (map[i][j] / 5) * cnt;\n } else if (map[i][j] == -1) {// 공기청정기 위치.\n newMap[i][j] = -1;\n// airCleaner.add(new Point4(j, i));\n }\n }\n }\n\n for (int i = 0; i < R; i++) {\n map[i] = Arrays.copyOf(newMap[i], C);\n }\n\n cleanAir(airCleaner.get(0), airCleaner.get(1));\n\n }", "private int ditherPixel(int futurePixel, int quantError, double factor) {\n int futureRed, futureGreen, futureBlue, futureAlpha,\n quantRed, quantGreen, quantBlue, quantAlpha;\n\n quantRed = (int)(Color.red(quantError) * factor);\n quantGreen = (int)(Color.green(quantError) * factor);\n quantBlue = (int)(Color.blue(quantError) * factor);\n quantAlpha = (int)(Color.alpha(quantError));\n\n futureRed = Color.red(futurePixel);\n futureGreen = Color.green(futurePixel);\n futureBlue = Color.blue(futurePixel);\n futureAlpha = Color.alpha(futurePixel);\n\n// return Color.argb(futureAlpha, futureRed + quantRed, futureGreen + quantGreen, futureBlue + quantBlue);\n return Color.argb(futureAlpha, futureRed, futureGreen, futureBlue);\n }", "private void CreateDecompression() {\n int iteradorY = 0;\n int iteradorarray = 0;\n int fila = 0;\n int columna = 0;\n while (iteradorY < width / 8 * height / 8) {\n int u = 1;\n int k = 1;\n double[][] Y = new double[8][8];\n double[][] CB = new double[8][8];\n double[][] CR = new double[8][8];\n for (int element = 0; element < 64; ++element) {\n Y[u - 1][k - 1] = (double) Ydes.get(iteradorarray);\n CB[u - 1][k - 1] = (double) CBdes.get(iteradorarray);\n CR[u - 1][k - 1] = (double) CRdes.get(iteradorarray);\n if ((k + u) % 2 != 0) {\n if (k < 8)\n k++;\n else\n u += 2;\n if (u > 1)\n u--;\n } else {\n if (u < 8)\n u++;\n else\n k += 2;\n if (k > 1)\n k--;\n }\n iteradorarray++;\n }\n ++iteradorY;\n //DESQUANTIZAMOS\n for (int m = 0; m < 8; ++m) {\n for (int n = 0; n < 8; ++n) {\n Y[m][n] = Y[m][n] * QtablesLuminance[quality][m][n];\n CB[m][n] = CB[m][n] * QtablesChrominance[quality][m][n];\n CR[m][n] = CR[m][n] * QtablesChrominance[quality][m][n];\n }\n }\n //INVERSA DE LA DCT2\n double[][] Ydct = dct3(Y);\n double[][] CBdct = dct3(CB);\n double[][] CRdct = dct3(CR);\n\n //SUMAR 128\n for (int m = 0; m < 8; ++m) {\n for (int n = 0; n < 8; ++n) {\n Ydct[m][n] = Ydct[m][n] + 128;\n CBdct[m][n] = CBdct[m][n] + 128;\n CRdct[m][n] = CRdct[m][n] + 128;\n int[] YCbCr = {(int) Ydct[m][n], (int) CBdct[m][n], (int) CRdct[m][n]};\n int[] RGB = YCbCrtoRGB(YCbCr);\n if (fila + m < height & columna + n < width) {\n FinalR[fila + m][columna + n] = RGB[0];\n FinalG[fila + m][columna + n] = RGB[1];\n FinalB[fila + m][columna + n] = RGB[2];\n }\n }\n }\n if (columna + 8 < width) columna = columna + 8;\n else {\n fila = fila + 8;\n columna = 0;\n }\n }\n }", "public void clear() {\n\t\tfor(int i=0;i<getWidth();i++) {\n\t\t\tfor(int j=0;j<getHeight();j++) {\n\t\t\t\tbImage.setRGB(i, j, 0xffffffff);\n\t\t\t}\n\t\t}\n\t}", "private static double[][] downsample(double[][] data) {\n double[][] plane = new double[data.length / 2][data[0].length / 2];\n for (int i = 0; i < data.length; i += 2) {\n for (int j = 0; j < data[i].length; j += 2) {\n plane[i / 2][j / 2] = (data[i][j] + data[i + 1][j] + data[i][j + 1] + data[i + 1][j + 1]) / 4;\n }\n }\n return plane;\n }", "public static float[][] enhance_deconvolve(float[][] img)\n {\n return null;\n }", "void resetDragImage();", "public static void codeAllImages(Args args) throws FileNotFoundException, IOException{\n BufferedImage tempI=null, tempP=null;\n BufferedImage[] codeOut = null;\n FileOutputStream fos = new FileOutputStream(args.output);\n ZipOutputStream zipOS = new ZipOutputStream(fos);\n int j = 0;\n //Iterate through all the images dividing them into frameP or frameI\n for(int i= 0; i < imageNames.size(); i++){ \n //j is a counter of the gop\n if(j >= (args.gop)){\n j=0;\n }\n if(j==0){\n // Frame I\n tempI = imageDict.get(imageNames.get(i));\n imgToZip(tempI, i, zipOS, \"image_coded_\");\n }else{\n //Frame P\n codeOut = createCodedImg(tempI, imageDict.get(imageNames.get(i)), args.thresh, args.tileSize, args.seekRange, args.comparator);\n imgToZip(codeOut[0], i, zipOS, \"image_coded_\");\n tempI = codeOut[1];\n //showImage(tempP);\n }\n j++;\n }\n //Get the gop, its always the first position of the coded data\n dataList.get(0).gop = args.gop;\n //Store into a .gz file all the info of every tile of every image, info that is stored into our dataList\n try {\n FileOutputStream out = new FileOutputStream(\"codedData.gz\");\n GZIPOutputStream gos = new GZIPOutputStream(out);\n ObjectOutputStream oos = new ObjectOutputStream(gos);\n oos.writeObject(dataList);\n oos.flush();\n gos.flush();\n out.flush();\n \n oos.close();\n gos.close();\n out.close();\n } catch (Exception e) {\n System.out.println(\"Problem serializing: \" + e);\n }\n \n FileInputStream fis = new FileInputStream(\"codedData.gz\");\n ZipEntry e = new ZipEntry(\"codedData.gz\");\n zipOS.putNextEntry(e);\n\n byte[] bytes = new byte[1024];\n int length;\n while ((length = fis.read(bytes)) >= 0) {\n zipOS.write(bytes, 0, length);\n }\n zipOS.closeEntry();\n fis.close();\n zipOS.finish(); //Good practice!\n zipOS.close();\n }", "public void flip(){\n Matrix mirrorMatrix = new Matrix();\n mirrorMatrix.preScale(-1, 1);\n Bitmap turnMap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mirrorMatrix, false);\n turnMap.setDensity(DisplayMetrics.DENSITY_DEFAULT);\n bitmap = new BitmapDrawable(turnMap).getBitmap();\n }", "public void reset(){\r\n \tif (resetdelay<=0){//if he didn't just die\r\n \t\tsetLoc(400,575);\r\n \t\timg = imgs[4];\r\n \t}\r\n }", "void imageData(int width, int height, int[] rgba);", "private static final byte[] xfcpp_d_image() {\n\t\tbyte data[] = { 71, 73, 70, 56, 57, 97, 16, 0, 16, 0, -95, 0, 0, 96,\n\t\t\t\t96, 96, -128, -128, -128, -1, -1, -1, -1, -1, -1, 33, -2, 14,\n\t\t\t\t77, 97, 100, 101, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80,\n\t\t\t\t0, 33, -7, 4, 1, 10, 0, 2, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0,\n\t\t\t\t2, 53, -108, -113, -119, -64, 96, -2, 78, -101, 2, 86, -55,\n\t\t\t\t-80, -101, 116, 89, -40, 40, -33, -109, 41, 98, 105, 94, 21,\n\t\t\t\t42, -75, 85, 0, -57, -21, 26, 2, 49, -52, 90, 111, -84, -85,\n\t\t\t\t-58, 29, 72, -3, -126, 2, -104, -48, 120, 32, -102, -112, -62,\n\t\t\t\t67, 1, 0, 59 };\n\t\treturn data;\n\t}", "public abstract float scaleIntensityData(float rawData);", "public void setup() {\r\n smooth();\r\n // TODO: Try other images.\r\n img = loadImage(\"frog.jpg\");\r\n\r\n // Create and initialize the 2D array from individual pixels\r\n // in the image. Note that img.pixels is a 2D array - it contains\r\n // all the rows of the images strung in a long line, one row after an\r\n // other.\r\n pixelArray = new int[img.width][img.height];\r\n for (int i = 0; i < img.width; i++) {\r\n for (int j = 0; j < img.height; j++) {\r\n pixelArray[i][j] = img.pixels[j * img.width + i];\r\n }\r\n }\r\n }", "public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) {\n/* 81 */ if (p_76308_9_ == 1) {\n/* */ \n/* 83 */ boolean var64 = false;\n/* 84 */ boolean var65 = false;\n/* 85 */ boolean var21 = false;\n/* 86 */ boolean var68 = false;\n/* 87 */ double var70 = 0.0D;\n/* 88 */ double var73 = 0.0D;\n/* 89 */ int var75 = 0;\n/* 90 */ double var77 = 1.0D / p_76308_17_;\n/* */ \n/* 92 */ for (int var30 = 0; var30 < p_76308_8_; var30++) {\n/* */ \n/* 94 */ double var31 = p_76308_2_ + var30 * p_76308_11_ + this.xCoord;\n/* 95 */ int var78 = (int)var31;\n/* */ \n/* 97 */ if (var31 < var78)\n/* */ {\n/* 99 */ var78--;\n/* */ }\n/* */ \n/* 102 */ int var34 = var78 & 0xFF;\n/* 103 */ var31 -= var78;\n/* 104 */ double var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 106 */ for (int var37 = 0; var37 < p_76308_10_; var37++)\n/* */ {\n/* 108 */ double var38 = p_76308_6_ + var37 * p_76308_15_ + this.zCoord;\n/* 109 */ int var40 = (int)var38;\n/* */ \n/* 111 */ if (var38 < var40)\n/* */ {\n/* 113 */ var40--;\n/* */ }\n/* */ \n/* 116 */ int var41 = var40 & 0xFF;\n/* 117 */ var38 -= var40;\n/* 118 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* 119 */ int var19 = this.permutations[var34] + 0;\n/* 120 */ int var66 = this.permutations[var19] + var41;\n/* 121 */ int var67 = this.permutations[var34 + 1] + 0;\n/* 122 */ int var22 = this.permutations[var67] + var41;\n/* 123 */ var70 = lerp(var35, func_76309_a(this.permutations[var66], var31, var38), grad(this.permutations[var22], var31 - 1.0D, 0.0D, var38));\n/* 124 */ var73 = lerp(var35, grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D));\n/* 125 */ double var79 = lerp(var42, var70, var73);\n/* 126 */ int var10001 = var75++;\n/* 127 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var79 * var77;\n/* */ }\n/* */ \n/* */ } \n/* */ } else {\n/* */ \n/* 133 */ int var19 = 0;\n/* 134 */ double var20 = 1.0D / p_76308_17_;\n/* 135 */ int var22 = -1;\n/* 136 */ boolean var23 = false;\n/* 137 */ boolean var24 = false;\n/* 138 */ boolean var25 = false;\n/* 139 */ boolean var26 = false;\n/* 140 */ boolean var27 = false;\n/* 141 */ boolean var28 = false;\n/* 142 */ double var29 = 0.0D;\n/* 143 */ double var31 = 0.0D;\n/* 144 */ double var33 = 0.0D;\n/* 145 */ double var35 = 0.0D;\n/* */ \n/* 147 */ for (int var37 = 0; var37 < p_76308_8_; var37++) {\n/* */ \n/* 149 */ double var38 = p_76308_2_ + var37 * p_76308_11_ + this.xCoord;\n/* 150 */ int var40 = (int)var38;\n/* */ \n/* 152 */ if (var38 < var40)\n/* */ {\n/* 154 */ var40--;\n/* */ }\n/* */ \n/* 157 */ int var41 = var40 & 0xFF;\n/* 158 */ var38 -= var40;\n/* 159 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 161 */ for (int var44 = 0; var44 < p_76308_10_; var44++) {\n/* */ \n/* 163 */ double var45 = p_76308_6_ + var44 * p_76308_15_ + this.zCoord;\n/* 164 */ int var47 = (int)var45;\n/* */ \n/* 166 */ if (var45 < var47)\n/* */ {\n/* 168 */ var47--;\n/* */ }\n/* */ \n/* 171 */ int var48 = var47 & 0xFF;\n/* 172 */ var45 -= var47;\n/* 173 */ double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 175 */ for (int var51 = 0; var51 < p_76308_9_; var51++) {\n/* */ \n/* 177 */ double var52 = p_76308_4_ + var51 * p_76308_13_ + this.yCoord;\n/* 178 */ int var54 = (int)var52;\n/* */ \n/* 180 */ if (var52 < var54)\n/* */ {\n/* 182 */ var54--;\n/* */ }\n/* */ \n/* 185 */ int var55 = var54 & 0xFF;\n/* 186 */ var52 -= var54;\n/* 187 */ double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 189 */ if (var51 == 0 || var55 != var22) {\n/* */ \n/* 191 */ var22 = var55;\n/* 192 */ int var69 = this.permutations[var41] + var55;\n/* 193 */ int var71 = this.permutations[var69] + var48;\n/* 194 */ int var72 = this.permutations[var69 + 1] + var48;\n/* 195 */ int var74 = this.permutations[var41 + 1] + var55;\n/* 196 */ int var75 = this.permutations[var74] + var48;\n/* 197 */ int var76 = this.permutations[var74 + 1] + var48;\n/* 198 */ var29 = lerp(var42, grad(this.permutations[var71], var38, var52, var45), grad(this.permutations[var75], var38 - 1.0D, var52, var45));\n/* 199 */ var31 = lerp(var42, grad(this.permutations[var72], var38, var52 - 1.0D, var45), grad(this.permutations[var76], var38 - 1.0D, var52 - 1.0D, var45));\n/* 200 */ var33 = lerp(var42, grad(this.permutations[var71 + 1], var38, var52, var45 - 1.0D), grad(this.permutations[var75 + 1], var38 - 1.0D, var52, var45 - 1.0D));\n/* 201 */ var35 = lerp(var42, grad(this.permutations[var72 + 1], var38, var52 - 1.0D, var45 - 1.0D), grad(this.permutations[var76 + 1], var38 - 1.0D, var52 - 1.0D, var45 - 1.0D));\n/* */ } \n/* */ \n/* 204 */ double var58 = lerp(var56, var29, var31);\n/* 205 */ double var60 = lerp(var56, var33, var35);\n/* 206 */ double var62 = lerp(var49, var58, var60);\n/* 207 */ int var10001 = var19++;\n/* 208 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var62 * var20;\n/* */ } \n/* */ } \n/* */ } \n/* */ } \n/* */ }", "public Pic noRed() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(0);\n }\n }\n return output;\n }" ]
[ "0.64630455", "0.64630455", "0.64196175", "0.6126515", "0.55990404", "0.5588918", "0.5463629", "0.53691036", "0.5319125", "0.5303451", "0.52866834", "0.52536416", "0.5236294", "0.52249384", "0.5161377", "0.51298475", "0.51185644", "0.50660765", "0.5044299", "0.4995609", "0.4982901", "0.4963655", "0.49556977", "0.49337244", "0.4933134", "0.4925076", "0.49141237", "0.49030173", "0.4887738", "0.48863754", "0.4877697", "0.48682046", "0.48584753", "0.4852823", "0.48489046", "0.48456272", "0.48330867", "0.48299435", "0.48295787", "0.4819408", "0.4817262", "0.47893748", "0.4788864", "0.47759262", "0.47675687", "0.4766211", "0.47612047", "0.4747794", "0.47354615", "0.47354123", "0.47325367", "0.47247663", "0.47234657", "0.4722865", "0.47078913", "0.47076112", "0.4701702", "0.46991768", "0.46817458", "0.46809334", "0.46789965", "0.46789408", "0.4662845", "0.46604586", "0.46604285", "0.46572077", "0.46396402", "0.46378553", "0.46305063", "0.46297178", "0.46274504", "0.4624767", "0.46157038", "0.46121708", "0.46101487", "0.46090868", "0.4605856", "0.45980626", "0.4596547", "0.45956117", "0.4595362", "0.45946124", "0.45889807", "0.458611", "0.45812052", "0.4580762", "0.45659482", "0.4560822", "0.45456585", "0.45429966", "0.4533696", "0.45333958", "0.453307", "0.45321208", "0.45308873", "0.4526209", "0.4521647", "0.4520902", "0.45207182", "0.45182782" ]
0.55387455
6
Flips this image vertically. Mipmap data will be lost.
public @NotNull Image flipV() { if (this.data != null) { if (this.mipmaps > 1) Image.LOGGER.warning("Image manipulation only applied to base mipmap level"); Color.Buffer output = Color.malloc(this.format, this.width * this.height); long srcPtr = this.data.address(); long dstPtr = output.address(); long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof; for (int i = this.height - 1, offsetSize = 0; i >= 0; i--) { long src = srcPtr + Integer.toUnsignedLong(i * this.width) * this.format.sizeof; MemoryUtil.memCopy(src, dstPtr + offsetSize, bytesPerLine); offsetSize += bytesPerLine; } this.data.free(); this.data = output; this.mipmaps = 1; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flipVertical() {\n\t\t\tthis.data = flipGridVertical(data);\n\t\t\tcomputeHashes();\n\t\t}", "public void flipV() {\r\n int tmp, sym;\r\n for (int col = 0; col < pixels.length; ++col) {\r\n for (int row = 0; row < pixels[col].length / 2; ++row) {\r\n // find the column index of the vertically symmetric pixel\r\n sym = pixels[col].length - 1 - row;\r\n // swap the pixel value between the two\r\n tmp = pixels[col][row];\r\n pixels[col][row] = pixels[col][sym];\r\n pixels[col][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public void flip(){\n Matrix mirrorMatrix = new Matrix();\n mirrorMatrix.preScale(-1, 1);\n Bitmap turnMap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mirrorMatrix, false);\n turnMap.setDensity(DisplayMetrics.DENSITY_DEFAULT);\n bitmap = new BitmapDrawable(turnMap).getBitmap();\n }", "public void setFlipped() {\n\t\thasFlipped = true;\n\t}", "public void onMirrorVertical() {\n mirror(TransformDesign.MIRROR_VERTICAL, 0.0f);\n }", "public void flipH() {\r\n int tmp, sym;\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length / 2; ++col) {\r\n // find the column index of the horizontally symmetric pixel\r\n sym = pixels[row].length - 1 - col;\r\n // swap the pixel value between the two\r\n tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][sym];\r\n pixels[row][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public void reverseFrame() {\r\n if (reversedImage) {\r\n reversedImage = false;\r\n } else {\r\n reversedImage = true;\r\n }\r\n }", "public void verticalFlip(Image im, int x, int y, int pixels, GraphicsContext gc2) {\n //permite que la imagen se pueda editar\n imageView = new ImageView(im);\n SnapshotParameters snap = new SnapshotParameters();\n //selecciona el bloque que se va a voltear\n snap.setViewport(new Rectangle2D(x, y, pixels, pixels));\n im = imageView.snapshot(snap, null);\n //voltea la imagen\n gc2.drawImage(im, 0, 0, pixels, pixels, x + pixels, y, -pixels, pixels);\n }", "public static BufferedImage flipVertically(BufferedImage image) {\n BufferedImage trimImage = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());\n Graphics2D graphics = trimImage.createGraphics();\n graphics.drawImage(image, 0, image.getHeight(), image.getWidth(), -image.getHeight(), null);\n graphics.dispose();\n\n return trimImage;\n }", "public PImage flipVH(PImage img)\n {\n PImage flipped = createImage(img.width,img.height,RGB);\n flipped.loadPixels();\n for(int i = 0; i < img.width; i++)\n {\n for(int j = 0; j < img.height; j++)\n {\n int loc = i + j * flipped.width;\n int locFlipped = (img.width-i-1) + (img.height-j-1) * flipped.width;\n if(img.pixels[loc] == color(0,0,0))\n {\n flipped.pixels[locFlipped] = color(0,0,0);\n }\n else\n {\n flipped.pixels[locFlipped] = color(255,255,255);\n }\n }\n }\n flipped.updatePixels();\n return flipped;\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\timgfinalImage.setImageBitmap(flipImage(RateItScreen.bmp, \"Vertical\"));\r\n\t\t\t}", "public static void flipVertical (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n // Temp image, to store pixels as we reverse everything\n BufferedImage newBi = new BufferedImage (xSize, ySize, 3); \n\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n int rgb = bi.getRGB(i,j);\n newBi.setRGB(i,ySize-j-1, rgb); //flip the pixels\n }\n }\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n bi.setRGB(i,j,newBi.getRGB(i,j)); // set each pixel of the original image \n }\n }\n redoList.add(deepCopy(bi)); // add the new image to the redo list\n }", "public @NotNull Image flipH()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n if (this.format != ColorFormat.RGBA)\n {\n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n // OPTION 1: Move pixels with memCopy()\n long src = Integer.toUnsignedLong(y * this.width + this.width - 1 - x) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, bytesPerLine);\n \n // OPTION 2: Just copy data pixel by pixel\n // output.put(y * this.width + x, this.data.getBytes(y * this.width + (this.width - 1 - x)));\n }\n }\n \n this.data.free();\n \n this.data = output;\n }\n else\n {\n // OPTION 3: Faster implementation (specific for 32bit pixels)\n // NOTE: It does not require additional allocations\n IntBuffer ptr = this.data.toBuffer().asIntBuffer();\n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width / 2; x++)\n {\n int backup = ptr.get(y * this.width + x);\n ptr.put(y * this.width + x, ptr.get(y * this.width + this.width - 1 - x));\n ptr.put(y * this.width + this.width - 1 - x, backup);\n }\n }\n }\n this.mipmaps = 1;\n }\n \n return this;\n }", "public static int[][][] flipVertically(int[][][] source) {\n\n\t\tint[][][] verticalTemp = source;\n\t\tint[][][] vertical = new int[source.length][source[0].length][3]; \n\t\tint rows = (vertical.length) - 1; \n\n\t\t// Using one loop to swift the content\n\t\tfor (int i = 0; i < (rows + 1); i++) { \n\t\t\tvertical[i] = verticalTemp[rows - i];\n\t\t}\n\t\treturn vertical;\n\t}", "public void flip() {\r\n \tif (flip != 0) {\r\n \t\tflipValue = -1;\r\n \t\tflipReposition = frameWidth;\r\n \t} else {\r\n \t\tflipValue = 1;\r\n \t\tflipReposition = 0;\r\n \t}\r\n }", "static Bitmap flip(Bitmap bitmap, boolean horizontal, boolean vertical) {\n Matrix matrix = new Matrix();\n matrix.preScale(horizontal ? -1 : 1, vertical ? -1 : 1);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "public native MagickImage flipImage() throws MagickException;", "private boolean isFlipped(){\n switch(this.orientation){\n case \"0\": case\"1\": case\"2\": case\"3\": return false;\n case \"4\": case\"5\": case\"6\": case\"7\": return true;\n default: return false;\n }\n }", "public void flip() {\n\t\t\tif (showing.getImage() == faceUp) {\n\t\t\t\tshowing.setImage(FACE_DOWN);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tshowing.setImage(faceUp);\n\t\t\t}\n\t\t}", "public void flip() {\n float tx = x1;\n float ty = y1;\n x1 = x2;\n y1 = y2;\n x2 = tx;\n y2 = ty;\n nx = -nx;\n ny = -ny;\n }", "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "public void flipBoard() {\r\n\t\tfor (int i = 0; i < this.SIZE/2; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tswap(j, this.SIZE - 1 - i, j, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void flip() {\n _flipped = !_flipped;\n }", "public void flip(){\n this.faceDown = !this.faceDown;\n }", "public void vreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= cols-1;\n //invariant: columns 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap column h with column k\n // invariant: pixels 0..c-1 of columns h and k have been swapped\n for (int c= 0; c != rows; c= c+1) {\n currentIm.swapPixels(c, h, c, k);\n }\n \n h= h+1; k= k-1;\n }\n \n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\timgfinalImage.setImageBitmap(flipImage(RateItScreen.bmp, \"Horizontal\"));\r\n\t\t\t}", "public StateChangeMdiIcon flipV() {\n defaultIcon.flipV();\n statesMap.values().forEach(MdiIcon::flipV);\n return this;\n }", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "@Override\n public void Invert() {\n\t \n }", "private Bitmap flipImage(byte[] input, FileOutputStream fos){\n\n\t\t\t\tMatrix rotate_matrix = new Matrix();\n\t\t\t\trotate_matrix.preScale(-1.0f, 1.0f);\n\t\t\t\tBitmapFactory bmf = new BitmapFactory();\n\t\t\t\tBitmap raw_bitmap = bmf.decodeByteArray(input, 0, input.length);\n\t\t\t\tBitmap result = Bitmap.createBitmap(raw_bitmap, 0, 0, raw_bitmap.getWidth(), raw_bitmap.getHeight(), rotate_matrix, true);\n\t\t\t\treturn result;\n\t\t\t\t/*\n\t\t\t\tresult.compress(Bitmap.CompressFormat.JPEG, 90, fos);\n\t\t\t\ttry {\n\t\t\t\t\tfos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}", "public static BufferedImage mirrorVertically (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n BufferedImage newBi = new BufferedImage (xSize,ySize*2, 1); // double the height of the image\n for (int x = 0; x < xSize; x++)\n {\n for (int top = ySize-1, bottom = ySize;bottom < ySize*2; top--,bottom++)\n {\n int rgb = bi.getRGB(x,top); \n newBi.setRGB(x,top,rgb);\n newBi.setRGB(x,bottom,rgb);\n }\n }\n redoList.add(deepCopy(newBi)); // add the image to the redo list\n return newBi; // return the new mirrored image\n\n }", "public static void testMirrorVertical()\n {\n Picture caterpillar = new Picture(\"caterpillar.jpg\");\n caterpillar.explore();\n caterpillar.mirrorVertical();\n caterpillar.explore();\n }", "public void moveBack() {\r\n\t\tsetY(getY() - 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 100, 60);\r\n\r\n\t}", "static public int[][] flipAndInvertImage(int[][] A) {\n for(int i =0;i<A.length;i++){\n processARow(A[i]);\n }\n return A;\n }", "public void horizontalFlip(Image im, int x, int y, int pixels, GraphicsContext gc2) {\n //permite que la imagen se pueda editar\n imageView = new ImageView(im);\n SnapshotParameters snap = new SnapshotParameters();\n //selecciona el bloque que se va a voltear\n snap.setViewport(new Rectangle2D(x, y, pixels, pixels));\n im = imageView.snapshot(snap, null);\n //voltea la imagen\n gc2.drawImage(im, 0, 0, pixels, pixels, x, y + pixels, pixels, -pixels);\n }", "private void flipArrow() {\n arrow.setRotation(0);\n arrow.setScaleX(-1);\n arrow.setRotation(50);\n }", "private void flip()\r\n\t{\r\n\t\tif(heading == Direction.WEST)\r\n\t\t{\r\n\t\t\tsetDirection(Direction.EAST);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsetDirection(Direction.WEST);\r\n\t\t}\r\n\t}", "@NotNull\n private Coordinate flipV() {\n angle = -angle;\n Coordinate nextCenterPointCoordinate = new Coordinate(this.centerPointCoordinate.getXCoordinate(),\n this.centerPointCoordinate.getYCoordinate() + (Constants.BULLET_SPEED * Math.sin(Math.toRadians(90 - angle))));\n return nextCenterPointCoordinate;\n }", "public void flip() {\r\n\t\tObject[] bak = path.toArray(new Direction[path.size()]);\r\n\t\tpath.clear();\r\n\t\tfor (int i = bak.length-1; i >= 0; i--) {\r\n\t\t\tpath.push((Direction) bak[i]);\r\n\t\t}\r\n\t}", "@Override\n public void onClick(View v) {\n\n\n float x = ivImage.getScaleX();\n float y = ivImage.getScaleY();\n\n ivImage.setScaleX((float) (x - 1));\n ivImage.setScaleY((float) (y - 1));\n }", "protected AbstractMatrix3D vColumnFlip() {\n\tif (columns>0) {\n\t\tcolumnZero += (columns-1)*columnStride;\n\t\tcolumnStride = -columnStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }", "public void setFlip() {\n\t\tflip = true;\n\t}", "public void mirror() {\n this.mirrored = !this.mirrored;\n }", "public void reverseDirectionY()\n\t{\n\t\t\n\t\tvy = -vy;\n\t}", "public void flip(int bitIndex);", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "public void invertImage()\r\n {\r\n BufferedImage toInvert;\r\n if (isChanged || isBlured )\r\n {\r\n toInvert = cropedEdited;\r\n }\r\n else\r\n {\r\n toInvert = cropedPart;\r\n }\r\n for (int x = 0; x < toInvert.getWidth(); x++) {\r\n for (int y = 0; y < toInvert.getHeight(); y++) {\r\n int rgba = toInvert.getRGB(x, y);\r\n Color col = new Color(rgba, true);\r\n col = new Color(255 - col.getRed(),\r\n 255 - col.getGreen(),\r\n 255 - col.getBlue());\r\n toInvert.setRGB(x, y, col.getRGB());\r\n }\r\n }\r\n repaint();\r\n }", "public void setInvertedImage(double position, double height) {\n // set the X coordinate of the image center\n // X imageCenter = X of lensCenter + the distance between the lens and the image\n imageCenterX = lensCenterX + position;\n\n // remove the image from the pane if it's already existed\n removeFromPane(image);\n \n // create new image rectangle\n // x coordinate = Xcenter - half of the rectangle's width (since the width of the object is equal to the image)\n // y coordinate = Y coordinate of the ground line\n image = new Rectangle(objectWidth, height);\n image.setLayoutX(imageCenterX - objectWidth / 2);\n image.setLayoutY(groundLineY);\n\n // Check the comboBox to set the corresponding inverted image\n if (pickPicture.getValue().equals(\"Candle\")) {\n image.setFill(AssetManager.getInvertedCandleImage());\n } else if (pickPicture.getValue().equals(\"Can\")) {\n image.setFill(AssetManager.getInvertedCanImage());\n }\n else\n image.setFill(AssetManager.getInvertedPencilImage());\n \n // add the image rectangle to the pane\n addToPane(image);\n }", "public void ensureInverted() {\r\n\t\tif (textureHeight > 0) {\r\n\t\t\ttextureY = textureY + textureHeight;\r\n\t\t\ttextureHeight = -textureHeight;\r\n\t\t}\r\n\t}", "public void flipHorizontal() {\n\t\t\tfor(int row = 0; row < TILE_DIM; row++) {\n\t\t\t\tString tmp = \"\";\n\t\t\t\tfor(int col = TILE_DIM-1; col >= 0; col--) {\n\t\t\t\t\ttmp += this.data[row].charAt(col);\n\t\t\t\t}\n\t\t\t\tthis.data[row] = tmp;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "public void flipOverY(){\n int len = tileChars.length;\r\n \r\n // swap columns\r\n for (int i = 0; i < len; i++)\r\n {\r\n for (int j = 0; j < len / 2; j++)\r\n {\r\n char temp = tileChars[i][j];\r\n tileChars[i][j] = tileChars[i][len - j - 1];\r\n tileChars[i][len - j - 1] = temp;\r\n }\r\n }\r\n \r\n boolean temp = this.matchFound[1];\r\n this.matchFound[1] = this.matchFound[3];\r\n this.matchFound[3] = temp;\r\n \r\n this.recalculateEdges(); //fix edges\r\n }", "public void setInverted(boolean inv) {\n/* 69 */ int dat = getData() & 0x7;\n/* 70 */ if (inv) {\n/* 71 */ dat |= 0x8;\n/* */ }\n/* 73 */ setData((byte)dat);\n/* */ }", "public static void invert(ImageProcessor output) {\r\n\t\tfor (int x = 0; x < output.getWidth(); x++) {\r\n\t\t\tfor (int y = 0; y < output.getHeight(); y++) {\r\n\t\t\t\tboolean a = output.get(x, y) > 127;\r\n\t\t\t\toutput.set(x, y, (!a) ? WHITE : BLACK);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "public void removeVerticalSeam(int[] seam) {\n for (int rows = 0; rows < height; rows++) {\n for (int columns = seam[rows]; columns < width - 1; columns++) {\n this.pic.set(columns, rows, this.pic.get(columns + 1, rows));\n }\n }\n width--;\n }", "public void flipHidden()\n {\n for(int i=0;i<7;i++)\n {\n if(tableauVisible[i].isEmpty() && !tableauHidden[i].isEmpty())\n tableauVisible[i].forcePush(tableauHidden[i].pop());\n } \n }", "public void moverVerticalSuave( int posicion )\n {\n brazo.moverVerticalSuave( posicion );\n }", "void FlipBook()\r\n\t\t{\r\n\t\t\t Collections.reverse(this);\r\n\t\t}", "public void reverseY()\r\n {\r\n\t if(moveY < 0)\r\n\t\t moveY = moveY * (-1);\r\n\t else if(moveY > 0)\r\n\t\t moveY = moveY * (-1);\r\n }", "public StateChangeMdiIcon flipH() {\n defaultIcon.flipH();\n statesMap.values().forEach(MdiIcon::flipH);\n return this;\n }", "void display() {\n pushMatrix();\n pushStyle();\n \n translate(_x, _y);\n rotate(_rotVector.heading() - _front);\n if (_flipped) scale(-1, 1);\n imageMode(CENTER);\n image(_img, 0, 0, _w, _h);\n \n popStyle();\n popMatrix();\n }", "private void colidiuPaddle(Bola bola, Sprite paddle) {\n\t\tPoint posicaoB = bola.getPosition();\n\t\tPoint posicaoP = paddle.getPosition();\n\t\tif (posicaoB.y + 5 == posicaoP.y && posicaoP.x + 27 >= posicaoB.x && posicaoP.x <= posicaoB.x + 5) {\n\t\t\tbola.invertVertical();\n\t\t}\n\t}", "public RMTransform getTransformInverse() { return getTransform().invert(); }", "public void flipCard() {\n this.faceUp = !faceUp;\n }", "void disableFlipMode();", "public void flip()throws IOException{\n String input = j.showInputDialog(\"Choose a file to use:\");\n Scanner ab = new Scanner(new File(input+\".ppm\"));\n input = j.showInputDialog(\"Choose a name for the new file:\");\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(input+\".ppm\")));\n input = j.showInputDialog(\"Flip: (1)Horizontal (2)Vertical (3)Both\");\n out.println(ab.next());\n int height=Integer.parseInt(ab.next());\n int width=Integer.parseInt(ab.next());\n out.println(height);out.println(width);\n out.println(ab.next());\n int asd[][][]=new int[width][height][3];\n for(int x=0;x<width;x++){\n for(int y=0;y<height;y++){\n for(int rgb=0;rgb<3;rgb++){\n String ass=ab.next();\n asd[x][y][rgb]= Integer.parseInt(ass);\n }\n }\n }\n if(Integer.parseInt(input)==1){\n for(int x=0;x<width;x++){\n for(int y=height-1;y>=0;y--){\n for(int rgb=0;rgb<3;rgb++){\n out.print(\" \"+asd[x][y][rgb]+\" \");\n }\n }\n }\n }\n else if(Integer.parseInt(input)==2){\n for(int x=width-1;x>=0;x--){\n for(int y=0;y<height;y++){\n for(int rgb=0;rgb<3;rgb++){\n out.print(\" \"+asd[x][y][rgb]+\" \");\n }\n }\n }\n }else{\n for(int x=width-1;x>=0;x--){\n for(int y=height-1;y>=0;y--){\n for(int rgb=0;rgb<3;rgb++){\n out.print(\" \"+asd[x][y][rgb]);\n }\n }\n }\n }\n out.close(); \n ab.close();\n System.exit(0);\n }", "private void resetIconYAxis(View view) {\n if (view.getRotationY() != 0) {\n view.setRotationY(0);\n }\n }", "private void resetIconYAxis(View view) {\n if (view.getRotationY() != 0) {\n view.setRotationY(0);\n }\n }", "public void setFlippedV(final boolean selected) {\r\n\t\tif (current != null) {\r\n\t\t\tcurrent.setFlippedV(selected);\r\n\t\t\telementView.repaint();\r\n\t\t\tnotifyModificationListeners();\r\n\t\t}\r\n\t}", "public static void flipHorizontal (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n // Temp image, to store pixels as we reverse everything\n BufferedImage newBi = new BufferedImage (xSize, ySize, 3); \n\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n int rgb = bi.getRGB(i,j);\n newBi.setRGB(xSize-i-1,j,rgb); //flip the pixels\n }\n }\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n bi.setRGB(i,j,newBi.getRGB(i,j)); // set each pixel of the original image \n }\n }\n redoList.add(deepCopy(bi)); // add the new image to the redo list\n }", "private static String[] flipGridVertical(String[] grid) {\n\t\tString[] tmp = new String[grid.length];\n\t\tfor(int row = 0; row < grid.length; row++) {\n\t\t\ttmp[grid.length - (row+1)] = grid[row];\n\t\t}\n\t\treturn tmp;\n\t}", "public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;", "public void act() \n {\n move(-2);\n if(isAtEdge())\n {\n turn(180);\n getImage().mirrorVertically();\n }\n }", "public Piece flip(){\n if(this == BLACK){\n return WHITE;\n }\n else{\n return BLACK;\n }\n }", "@objid (\"7f09cb6a-1dec-11e2-8cad-001ec947c8cc\")\n public void setVertical(boolean value) {\n if (this.vertical != value) {\n this.vertical = value;\n firePropertyChange(IGmObject.PROPERTY_LAYOUTDATA, null, getLayoutData());\n }\n }", "public void restore() {\n currentIm= originalIm.copy();\n }", "private void changePixelValues(ImageProcessor ip) {\n\t\t\tint[] pixels = (int[])ip.getPixels();\r\n\t\t\t\r\n\t\t\tfor (int y=0; y<height; y++) {\r\n\t\t\t\tfor (int x=0; x<width; x++) {\r\n\t\t\t\t\tint pos = y*width + x;\r\n\t\t\t\t\tint argb = origPixels[pos]; // Lesen der Originalwerte \r\n\t\t\t\t\t\r\n\t\t\t\t\tint r = (argb >> 16) & 0xff;\r\n\t\t\t\t\tint g = (argb >> 8) & 0xff;\r\n\t\t\t\t\tint b = argb & 0xff;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// anstelle dieser drei Zeilen später hier die Farbtransformation durchführen,\r\n\t\t\t\t\t// die Y Cb Cr -Werte verändern und dann wieder zurücktransformieren\r\n\t\t\t\t\t\r\n\t\t\t\t\tYUV c = new YUV(r, g, b);\r\n\t\t\t\t\t\r\n\t\t\t\t\tc.changeBrightness(brightness).changeContrast(contrast).changeSaturation(saturation).changeHue(hue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tint[] rgbNew = c.toRGB();\r\n\r\n\t\t\t\t\t// Hier muessen die neuen RGB-Werte wieder auf den Bereich von 0 bis 255 begrenzt werden\r\n\t\t\t\t\t\r\n\t\t\t\t\tpixels[pos] = (0xFF<<24) | (rgbNew[0]<<16) | (rgbNew[1]<<8) | rgbNew[2];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }", "public void removeVerticalSeam(int[] seam) {\n if (seam == null) {\n throw new NullPointerException();\n }\n\n if (seam.length != height()) {\n throw new IllegalArgumentException();\n }\n\n Picture original = this.picture;\n Picture seamed = new Picture(original.width() - 1, original.height());\n\n for (int h = 0; h < seamed.height(); h++) {\n for (int w = 0; w < seam[h]; w++) {\n seamed.set(w, h, original.get(w, h));\n }\n for (int w = seam[h]; w < seamed.width(); w++) {\n seamed.set(w, h, original.get(w + 1, h));\n }\n }\n this.picture = seamed;\n }", "protected AbstractMatrix3D vRowFlip() {\n\tif (rows>0) {\n\t\trowZero += (rows-1)*rowStride;\n\t\trowStride = -rowStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "void enableFlipMode();", "public void onMirrorHorizontal() {\n mirror(TransformDesign.MIRROR_HORIZONTAL, 0.0f);\n }", "public void swim() {\r\n\t\tif(super.getPosition()[0] == Ocean.getInstance().getWidth()-71){\r\n\t\t\tinvX = true;\r\n\t\t} else if(super.getPosition()[0] == 0){\r\n\t\t\tinvX = false;\r\n\t\t}\r\n\t\tif(super.getPosition()[1] == Ocean.getInstance().getDepth()-71){\r\n\t\t\tinvY = true;\r\n\t\t} else if(super.getPosition()[1] == 0){\r\n\t\t\tinvY = false;\r\n\t\t}\r\n\t\tif(invX){\r\n\t\t\tsuper.getPosition()[0]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[0]+=1;\r\n\t\t}\r\n\t\tif(invY){\r\n\t\t\tsuper.getPosition()[1]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[1]+=1;\r\n\t\t}\r\n\t}", "public synchronized Block flip() {\r\n\t\t// TODO ILLEGAL STATUS: THROW AN EXCEPTION HERE\r\n\t\tif(status == Status.Fliped || status == Status.Cleared)\r\n\t\t\treturn null;\r\n\t\telse\r\n\t\t\tstatus = Status.Fliped;\r\n\t\t// when it is clicked when it should be flipped back after a short interval, the flag should be \r\n\t\t// reset to avoid being covered at which the card should be shown\r\n\t\tdelayedCover = false;\r\n\t\tgraphics.updateBlock();\r\n\t\treturn this;\r\n\t}", "public void invertOrientation() {\n\t\tPoint3D temp = getPoint(2);\n\t\tsetPoint(2, getPoint(1));\n\t\tsetPoint(1, temp);\n\n\t\tTriangleElt3D temp2 = getNeighbour(2);\n\t\tsetNeighbour(2, getNeighbour(1));\n\t\tsetNeighbour(1, temp2);\n\t\tif (this.getNetComponent() != null)\n\t\t\tthis.getNetComponent().setOriented(false);\n\t}", "public void adjustDown() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y + 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y + 4;\n grassTiles[x][y].y = grassTiles[x][y].y + 4;\n }\n }", "public void rotateY90() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint x_ = vertexX[v];\n\t\t\tvertexX[v] = vertexZ[v];\n\t\t\tvertexZ[v] = -x_;\n\t\t}\n\t}", "public void transpose() {\n // Follow this plan: \n // (1) Create a new ImageArray ia, using currentIM's row-major order array\n // and rows and columns, but swap the roles of its numbers\n // of rows and columns.\n // (2) Store the transpose of the currentIm array in ia, using currentIm's\n // 2-parameter getPixel function and ia's 3-parameter setPixel\n // function.\n // (3) assign ia to currentIm.\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n ImageArray ia= new ImageArray(currentIm.getRmoArray(), cols, rows);\n \n //Copy each element ImageArray[r,c] to ia[c,r]\n // invariant: rows 0..r-1 have been copied to ia[.., 0..r-1]\n for (int r= 0; r != rows; r= r+1)\n // invariant: elements [r..0..c-1] have been copied to ia[0..c-1, r]\n for (int c= 0; c != cols; c= c+1) {\n ia.setPixel(c, r, currentIm.getPixel(r,c));\n }\n \n currentIm= ia;\n }", "public static void flipHorizontalAxis(int[][] matrix){\n\n int beginIndex = 0;\n int endIndex = (matrix.length - 1);\n int[] begin = matrix[beginIndex];\n int[] end = matrix[endIndex];\n int[] temp;\n\n\n while(endIndex > beginIndex){\n //swap the arrays with a temp variable\n temp = Arrays.copyOf(begin, begin.length);\n begin = Arrays.copyOf(end, end.length);\n end = Arrays.copyOf(temp, temp.length);\n\n //update the new arrays in the matrix\n matrix[beginIndex] = begin;\n matrix[endIndex] = end;\n\n //update the new indexes\n beginIndex++;\n endIndex--;\n\n //move begin and end to the next set to be swapped\n begin = matrix[beginIndex];\n end = matrix[endIndex];\n }\n\n }", "public void removeVerticalSeam(int[] a) \n {\n if (width() <= 1 || !isValidSeam(a, height(), width()))\n throw new java.lang.IllegalArgumentException();\n Picture pic = new Picture(width()-1, height());\n \n for (int h = 0; h < height(); h++)\n { \n for (int w = 0; w < a[h]; w++)\n pic.set(w, h, this.picture.get(w, h)); \n \n for (int w = a[h]+1; w < width(); w++) \n pic.set(w-1, h, this.picture.get(w, h)); \n \n }\n this.picture = pic;\n }", "public void runDarken() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 0.5f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onVerticalSwipe() {\n System.out.println(\"ImageView has been VERTICALLY swiped\");\n }", "public void setReverse(boolean reverse) {\n\t\tif (isReverse != reverse) {\n\t\t\tisReverse = reverse;\n\t\t\tpauseMusic();\n\t\t\tint position;\n\t\t\tif (isReverse) {\n\t\t\t\tif (!isWah && !isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(musicSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(reverseSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isWah && isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(wahDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revWahDistortSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isWah) {\n\t\t\t\t\tposition = alGetSourcei(wahSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revWahSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(distortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(revDistortSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!isWah && !isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(reverseSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(musicSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isWah && isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(revWahDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(wahDistortSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isWah) {\n\t\t\t\t\tposition = alGetSourcei(revWahSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(wahSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t\telse if (isDistorted) {\n\t\t\t\t\tposition = alGetSourcei(revDistortSourceIndex, AL_BYTE_OFFSET);\n\t\t\t\t\talSourcei(distortSourceIndex, AL_BYTE_OFFSET, musicSize - position);\n\t\t\t\t}\n\t\t\t}\n\t\t\tplayMusic();\n\t\t}\n\t}", "public boolean getScaleVertical() {\r\n return ScaleVertical;\r\n }", "public void rotateBack() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[i][j] = tmp_grid[i][j];\n\t\t}", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n dialog.setPadding(new Insets(0,0,0,7));\n }", "public void removeVerticalSeam(int[] seam) {\r\n\r\n validateVertSeam(seam);\r\n Picture newPic = new Picture(--width, height);\r\n for (int col = 0; col < width; col++) {\r\n for (int row = 0; row < height; row++) {\r\n if (col < seam[row]) {\r\n newPic.set(col, row, pic.get(col, row));\r\n energy[col][row] = energy[col][row];\r\n }\r\n else {\r\n newPic.set(col, row, pic.get(col + 1, row));\r\n energy[col][row] = energy[col + 1][row];\r\n }\r\n }\r\n }\r\n\r\n pic = newPic;\r\n\r\n for (int row = 0; row < height; row++) {\r\n if (seam[row] > 0) energy[seam[row] - 1][row] = calcEnergy(seam[row] - 1, row);\r\n if (seam[row] < width - 1) energy[seam[row]][row] = calcEnergy(seam[row], row);\r\n }\r\n\r\n }" ]
[ "0.7230693", "0.72085613", "0.7048189", "0.67737776", "0.6584952", "0.6505118", "0.64456934", "0.64367086", "0.64167273", "0.6397538", "0.6344496", "0.6274758", "0.62010217", "0.61883426", "0.6119559", "0.6113863", "0.6054396", "0.6052101", "0.6048686", "0.6041786", "0.60269356", "0.6016868", "0.59965324", "0.58588386", "0.583499", "0.5791826", "0.5751346", "0.57320887", "0.5716522", "0.56557846", "0.5628313", "0.55921257", "0.5559706", "0.55257", "0.5516841", "0.5499021", "0.54866606", "0.54629296", "0.5449747", "0.5416041", "0.5415859", "0.54061675", "0.5401198", "0.5379741", "0.5364341", "0.5332945", "0.53268796", "0.53083044", "0.5240589", "0.52057034", "0.52003276", "0.5200067", "0.5199359", "0.5180401", "0.51566243", "0.51566243", "0.51566243", "0.51552606", "0.5154803", "0.5147097", "0.5142418", "0.5133943", "0.50982577", "0.5065447", "0.50621504", "0.5060037", "0.50582784", "0.50530577", "0.5051854", "0.50213015", "0.50213015", "0.50211996", "0.5012377", "0.49844348", "0.49671245", "0.4965563", "0.49521115", "0.4950317", "0.49366903", "0.49352396", "0.49326795", "0.4929987", "0.49167368", "0.49131283", "0.49109936", "0.49099755", "0.49013805", "0.4896997", "0.488498", "0.48820698", "0.48563647", "0.48508507", "0.48497766", "0.48473582", "0.48410568", "0.48404357", "0.48377025", "0.48326597", "0.4831014", "0.48185262" ]
0.7045616
3
Flips this image horizontally. Mipmap data will be lost.
public @NotNull Image flipH() { if (this.data != null) { if (this.mipmaps > 1) Image.LOGGER.warning("Image manipulation only applied to base mipmap level"); if (this.format != ColorFormat.RGBA) { Color.Buffer output = Color.malloc(this.format, this.width * this.height); long srcPtr = this.data.address(); long dstPtr = output.address(); long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof; for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width; x++) { // OPTION 1: Move pixels with memCopy() long src = Integer.toUnsignedLong(y * this.width + this.width - 1 - x) * this.format.sizeof; long dst = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof; MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, bytesPerLine); // OPTION 2: Just copy data pixel by pixel // output.put(y * this.width + x, this.data.getBytes(y * this.width + (this.width - 1 - x))); } } this.data.free(); this.data = output; } else { // OPTION 3: Faster implementation (specific for 32bit pixels) // NOTE: It does not require additional allocations IntBuffer ptr = this.data.toBuffer().asIntBuffer(); for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width / 2; x++) { int backup = ptr.get(y * this.width + x); ptr.put(y * this.width + x, ptr.get(y * this.width + this.width - 1 - x)); ptr.put(y * this.width + this.width - 1 - x, backup); } } } this.mipmaps = 1; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flip(){\n Matrix mirrorMatrix = new Matrix();\n mirrorMatrix.preScale(-1, 1);\n Bitmap turnMap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mirrorMatrix, false);\n turnMap.setDensity(DisplayMetrics.DENSITY_DEFAULT);\n bitmap = new BitmapDrawable(turnMap).getBitmap();\n }", "public void onMirrorHorizontal() {\n mirror(TransformDesign.MIRROR_HORIZONTAL, 0.0f);\n }", "public void flipHorizontal() {\n\t\t\tfor(int row = 0; row < TILE_DIM; row++) {\n\t\t\t\tString tmp = \"\";\n\t\t\t\tfor(int col = TILE_DIM-1; col >= 0; col--) {\n\t\t\t\t\ttmp += this.data[row].charAt(col);\n\t\t\t\t}\n\t\t\t\tthis.data[row] = tmp;\n\t\t\t}\n\t\t\tcomputeHashes();\n\t\t}", "public void setFlipped() {\n\t\thasFlipped = true;\n\t}", "public @NotNull Image flipV()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n long bytesPerLine = Integer.toUnsignedLong(this.width) * this.format.sizeof;\n for (int i = this.height - 1, offsetSize = 0; i >= 0; i--)\n {\n long src = srcPtr + Integer.toUnsignedLong(i * this.width) * this.format.sizeof;\n \n MemoryUtil.memCopy(src, dstPtr + offsetSize, bytesPerLine);\n offsetSize += bytesPerLine;\n }\n \n this.data.free();\n this.data = output;\n this.mipmaps = 1;\n }\n return this;\n }", "public void flip() {\r\n \tif (flip != 0) {\r\n \t\tflipValue = -1;\r\n \t\tflipReposition = frameWidth;\r\n \t} else {\r\n \t\tflipValue = 1;\r\n \t\tflipReposition = 0;\r\n \t}\r\n }", "public void flipH() {\r\n int tmp, sym;\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[row].length / 2; ++col) {\r\n // find the column index of the horizontally symmetric pixel\r\n sym = pixels[row].length - 1 - col;\r\n // swap the pixel value between the two\r\n tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][sym];\r\n pixels[row][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public void flipV() {\r\n int tmp, sym;\r\n for (int col = 0; col < pixels.length; ++col) {\r\n for (int row = 0; row < pixels[col].length / 2; ++row) {\r\n // find the column index of the vertically symmetric pixel\r\n sym = pixels[col].length - 1 - row;\r\n // swap the pixel value between the two\r\n tmp = pixels[col][row];\r\n pixels[col][row] = pixels[col][sym];\r\n pixels[col][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public void horizontalFlip(Image im, int x, int y, int pixels, GraphicsContext gc2) {\n //permite que la imagen se pueda editar\n imageView = new ImageView(im);\n SnapshotParameters snap = new SnapshotParameters();\n //selecciona el bloque que se va a voltear\n snap.setViewport(new Rectangle2D(x, y, pixels, pixels));\n im = imageView.snapshot(snap, null);\n //voltea la imagen\n gc2.drawImage(im, 0, 0, pixels, pixels, x, y + pixels, pixels, -pixels);\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\timgfinalImage.setImageBitmap(flipImage(RateItScreen.bmp, \"Horizontal\"));\r\n\t\t\t}", "public native MagickImage flipImage() throws MagickException;", "public void flip() {\n float tx = x1;\n float ty = y1;\n x1 = x2;\n y1 = y2;\n x2 = tx;\n y2 = ty;\n nx = -nx;\n ny = -ny;\n }", "static Bitmap flip(Bitmap bitmap, boolean horizontal, boolean vertical) {\n Matrix matrix = new Matrix();\n matrix.preScale(horizontal ? -1 : 1, vertical ? -1 : 1);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "private boolean isFlipped(){\n switch(this.orientation){\n case \"0\": case\"1\": case\"2\": case\"3\": return false;\n case \"4\": case\"5\": case\"6\": case\"7\": return true;\n default: return false;\n }\n }", "public static void flipHorizontal (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n // Temp image, to store pixels as we reverse everything\n BufferedImage newBi = new BufferedImage (xSize, ySize, 3); \n\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n int rgb = bi.getRGB(i,j);\n newBi.setRGB(xSize-i-1,j,rgb); //flip the pixels\n }\n }\n for (int i = 0; i < xSize; i++)\n {\n for (int j = 0; j< ySize; j++)\n {\n bi.setRGB(i,j,newBi.getRGB(i,j)); // set each pixel of the original image \n }\n }\n redoList.add(deepCopy(bi)); // add the new image to the redo list\n }", "public void mirror() {\n this.mirrored = !this.mirrored;\n }", "void flip() {\n _flipped = !_flipped;\n }", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "static public int[][] flipAndInvertImage(int[][] A) {\n for(int i =0;i<A.length;i++){\n processARow(A[i]);\n }\n return A;\n }", "public static void testMirrorHorizontal()\n {\n Picture caterpillar = new Picture(\"caterpillar.jpg\");\n caterpillar.explore();\n caterpillar.mirrorHorizontal();\n caterpillar.explore();\n }", "public static int[][][] flipHorizontally(int[][][] source) {\n\n\t\t// Getting the source in a temp Matrix\n\t\tint[][][] horizontalTemp = source; \n\t\t// Creating the new matrix\n\t\tint[][][] horizontal = new int[source.length][source[0].length][3];\n\t\tint columns = (horizontal[0].length); \n\t\tint rows = (horizontal.length);\n\n\t\tfor (int j = 0; j < rows; j++) { // Creating two loop to flip\n\t\t\tfor (int i = 0; i < columns; i++) { // To flip horizontally\n\t\t\t\thorizontal[j][i] = horizontalTemp[j][(columns - i) - 1];\n\t\t\t}\n\t\t}\n\n\t\treturn horizontal;\n\t}", "public void reverseFrame() {\r\n if (reversedImage) {\r\n reversedImage = false;\r\n } else {\r\n reversedImage = true;\r\n }\r\n }", "@Override\n\tpublic void move_x() {\n\t\tif(mX < 0){\n\t \tdirection *= -1 ;\n\t \t setScale(-1, 1);\n\t }else if (mX > activity.getCameraWidth()-64){\n\t \tdirection *= -1 ;\n\t \tsetScale(1, 1);\n\t } \n\t\tmove_x(direction);\n\t}", "public MutableImage rotateLeft() {\n return rotate(-90);\n }", "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "public void swim() {\r\n\t\tif(super.getPosition()[0] == Ocean.getInstance().getWidth()-71){\r\n\t\t\tinvX = true;\r\n\t\t} else if(super.getPosition()[0] == 0){\r\n\t\t\tinvX = false;\r\n\t\t}\r\n\t\tif(super.getPosition()[1] == Ocean.getInstance().getDepth()-71){\r\n\t\t\tinvY = true;\r\n\t\t} else if(super.getPosition()[1] == 0){\r\n\t\t\tinvY = false;\r\n\t\t}\r\n\t\tif(invX){\r\n\t\t\tsuper.getPosition()[0]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[0]+=1;\r\n\t\t}\r\n\t\tif(invY){\r\n\t\t\tsuper.getPosition()[1]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[1]+=1;\r\n\t\t}\r\n\t}", "public void flip() {\n\t\t\tif (showing.getImage() == faceUp) {\n\t\t\t\tshowing.setImage(FACE_DOWN);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tshowing.setImage(faceUp);\n\t\t\t}\n\t\t}", "void display() {\n pushMatrix();\n pushStyle();\n \n translate(_x, _y);\n rotate(_rotVector.heading() - _front);\n if (_flipped) scale(-1, 1);\n imageMode(CENTER);\n image(_img, 0, 0, _w, _h);\n \n popStyle();\n popMatrix();\n }", "public void flipBoard() {\r\n\t\tfor (int i = 0; i < this.SIZE/2; i++) {\r\n\t\t\tfor (int j = 0; j < this.SIZE; j++) {\r\n\t\t\t\tswap(j, this.SIZE - 1 - i, j, i);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void flipHorizontalAxis(int[][] matrix){\n\n int beginIndex = 0;\n int endIndex = (matrix.length - 1);\n int[] begin = matrix[beginIndex];\n int[] end = matrix[endIndex];\n int[] temp;\n\n\n while(endIndex > beginIndex){\n //swap the arrays with a temp variable\n temp = Arrays.copyOf(begin, begin.length);\n begin = Arrays.copyOf(end, end.length);\n end = Arrays.copyOf(temp, temp.length);\n\n //update the new arrays in the matrix\n matrix[beginIndex] = begin;\n matrix[endIndex] = end;\n\n //update the new indexes\n beginIndex++;\n endIndex--;\n\n //move begin and end to the next set to be swapped\n begin = matrix[beginIndex];\n end = matrix[endIndex];\n }\n\n }", "public PImage flipVH(PImage img)\n {\n PImage flipped = createImage(img.width,img.height,RGB);\n flipped.loadPixels();\n for(int i = 0; i < img.width; i++)\n {\n for(int j = 0; j < img.height; j++)\n {\n int loc = i + j * flipped.width;\n int locFlipped = (img.width-i-1) + (img.height-j-1) * flipped.width;\n if(img.pixels[loc] == color(0,0,0))\n {\n flipped.pixels[locFlipped] = color(0,0,0);\n }\n else\n {\n flipped.pixels[locFlipped] = color(255,255,255);\n }\n }\n }\n flipped.updatePixels();\n return flipped;\n }", "public void adjustLeft() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].x = tiles[x][y].x - 4;\n backGroundTiles[x][y].x = backGroundTiles[x][y].x - 4;\n grassTiles[x][y].x = grassTiles[x][y].x - 4;\n }\n }", "public void flip(){\n this.faceDown = !this.faceDown;\n }", "public void setFlip() {\n\t\tflip = true;\n\t}", "public static BufferedImage mirrorHorizontally (BufferedImage bi)\n {\n imageList.add(deepCopy(bi)); // add the image to the undo list\n int xSize = bi.getWidth();\n int ySize = bi.getHeight();\n\n BufferedImage newBi = new BufferedImage (xSize*2,ySize, 1); // double the width \n for (int y = 0; y < ySize; y++)\n {\n for (int left = 0, right = xSize*2-1;left < xSize; left++,right-- )\n {\n int rgb = bi.getRGB(left,y); \n newBi.setRGB(left,y,rgb);\n newBi.setRGB(right,y,rgb);\n }\n }\n\n redoList.add(deepCopy(newBi)); // add the image to the redo list\n return newBi; // return the new mirrored image\n\n }", "void enableFlipMode();", "@Override\n public void Invert() {\n\t \n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\timgfinalImage.setImageBitmap(flipImage(RateItScreen.bmp, \"Vertical\"));\r\n\t\t\t}", "public void startFlipping() {\n if (!mKeepFlipping) {\n mKeepFlipping = true;\n showOnly(mWhichChild);\n Message msg = mHandler.obtainMessage(FLIP_MSG);\n mHandler.sendMessageDelayed(msg, mFlipInterval);\n }\n }", "private void flipArrow() {\n arrow.setRotation(0);\n arrow.setScaleX(-1);\n arrow.setRotation(50);\n }", "private void flip()\r\n\t{\r\n\t\tif(heading == Direction.WEST)\r\n\t\t{\r\n\t\t\tsetDirection(Direction.EAST);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsetDirection(Direction.WEST);\r\n\t\t}\r\n\t}", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "public void updateFrontPhotoflipMode() {\n if (isCameraFrontFacing()) {\n this.mCameraSettings.setMirrorSelfieOn(Keys.isMirrorSelfieOn(this.mAppController.getSettingsManager()));\n }\n }", "public void flipOverX(){\n int len = tileChars.length;\r\n \r\n // swap rows\r\n for (int i = 0; i < len / 2; i++)\r\n {\r\n for (int j = 0; j < len; j++)\r\n {\r\n // swap `tileChars[i][j]` with `tileChars[len-i-1][j]`\r\n char temp = tileChars[i][j];\r\n tileChars[i][j] = tileChars[len-i-1][j];\r\n tileChars[len-i-1][j] = temp;\r\n }\r\n }\r\n \r\n boolean temp = this.matchFound[0];\r\n this.matchFound[0] = this.matchFound[2];\r\n this.matchFound[2] = temp;\r\n \r\n this.recalculateEdges(); //fix edges\r\n }", "private Bitmap flipImage(byte[] input, FileOutputStream fos){\n\n\t\t\t\tMatrix rotate_matrix = new Matrix();\n\t\t\t\trotate_matrix.preScale(-1.0f, 1.0f);\n\t\t\t\tBitmapFactory bmf = new BitmapFactory();\n\t\t\t\tBitmap raw_bitmap = bmf.decodeByteArray(input, 0, input.length);\n\t\t\t\tBitmap result = Bitmap.createBitmap(raw_bitmap, 0, 0, raw_bitmap.getWidth(), raw_bitmap.getHeight(), rotate_matrix, true);\n\t\t\t\treturn result;\n\t\t\t\t/*\n\t\t\t\tresult.compress(Bitmap.CompressFormat.JPEG, 90, fos);\n\t\t\t\ttry {\n\t\t\t\t\tfos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}", "public void flip(int bitIndex);", "protected AbstractMatrix3D vRowFlip() {\n\tif (rows>0) {\n\t\trowZero += (rows-1)*rowStride;\n\t\trowStride = -rowStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "private void flip() {\n ObservableList<Node> tmp = FXCollections.observableArrayList(this.getChildren());\n Collections.reverse(tmp);\n getChildren().setAll(tmp);\n setAlignment(Pos.TOP_LEFT);\n }", "@Override\n public void onClick(View v) {\n\n\n float x = ivImage.getScaleX();\n float y = ivImage.getScaleY();\n\n ivImage.setScaleX((float) (x - 1));\n ivImage.setScaleY((float) (y - 1));\n }", "private void setMToIdentity()\n\t\t{\n\t\t\tfor(rowNumber = 0; rowNumber < 4; rowNumber++)\n\t\t\t\tfor(int column = 0; column < 4; column++)\n\t\t\t\t{\n\t\t\t\t\tif(rowNumber == column)\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 0;\n\t\t\t\t}\n\t\t\ttransform = new Transform3D(mElements);\n\t\t\trowNumber = 0;\n\t\t}", "public void reverseX()\r\n {\r\n\t if(moveX < 0)\r\n\t\t moveX = moveX * (-1);\r\n\t else if(moveX > 0)\r\n\t\t moveX = moveX * (-1);\r\n }", "public void update()\n {\n if(x + image.getWidth(null) < 0)\n {\n x = 0;\n }\n else\n {\n x--;\n }\n }", "private GObject hFlipGObject(GObject o, double x) {\n\t\to.setLocation(2 * x - o.getWidth() - o.getX(), o.getY());\n\t\treturn o;\n\t}", "void setLandscape(boolean ls);", "public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\timgfinalImage.setImageBitmap(rotateImage(RateItScreen.bmp, \"Left\"));\r\n\r\n\t\t\t}", "public void moveLeft() {\n this.accelerateXL();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(141);\n this.setLoopCells(true);\n }", "public void flipVertical() {\n\t\t\tthis.data = flipGridVertical(data);\n\t\t\tcomputeHashes();\n\t\t}", "public void reverseDirectionX()\n\t{\n\t\t\n\t\tvx = -vx;\n\t\t\n\t}", "public void flip() {\r\n\t\tObject[] bak = path.toArray(new Direction[path.size()]);\r\n\t\tpath.clear();\r\n\t\tfor (int i = bak.length-1; i >= 0; i--) {\r\n\t\t\tpath.push((Direction) bak[i]);\r\n\t\t}\r\n\t}", "public void Wrap () \n {\n pos.x = (pos.x + width) % width;\n pos.y = (pos.y + height) % height;\n }", "public void rotateClockWise() {\r\n\r\n transpose();\r\n\r\n // swap columns\r\n for (int col = 0; col < pixels[0].length / 2; col++) {\r\n for (int row = 0; row < pixels.length; row++) {\r\n int tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][pixels[0].length - 1 - col];\r\n pixels[row][pixels[0].length - 1 - col] = tmp;\r\n }\r\n }\r\n\r\n this.pix2img();\r\n }", "public void transpose() {\n // Follow this plan: \n // (1) Create a new ImageArray ia, using currentIM's row-major order array\n // and rows and columns, but swap the roles of its numbers\n // of rows and columns.\n // (2) Store the transpose of the currentIm array in ia, using currentIm's\n // 2-parameter getPixel function and ia's 3-parameter setPixel\n // function.\n // (3) assign ia to currentIm.\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n ImageArray ia= new ImageArray(currentIm.getRmoArray(), cols, rows);\n \n //Copy each element ImageArray[r,c] to ia[c,r]\n // invariant: rows 0..r-1 have been copied to ia[.., 0..r-1]\n for (int r= 0; r != rows; r= r+1)\n // invariant: elements [r..0..c-1] have been copied to ia[0..c-1, r]\n for (int c= 0; c != cols; c= c+1) {\n ia.setPixel(c, r, currentIm.getPixel(r,c));\n }\n \n currentIm= ia;\n }", "@Override\n\tpublic void rotate90() {\n\n\t\tint[][] rotate = new int[this.frame[0].length][this.frame.length];\n\n\t\tfor (int x = 0; x < rotate[0].length; x++) {\n\t\t\tfor (int y = 0; y < rotate.length; y++) {\n\t\t\t\trotate[y][x] = this.frame[this.frame.length - x - 1][y];\n\t\t\t}\n\t\t} \n\n\t\tthis.frame = rotate;\n\n\t}", "@Override\n\tpublic void run(ImageProcessor ip) {\n\t\twidth = ip.getWidth();\n\t\theight = ip.getHeight();\n\n\t\tbyte[] pixels = (byte[]) ip.getPixels();\n\t\tij.gui.Roi[] rois = new ij.gui.Roi[0];\n\t\tbyte[] output = trimSperm(pixels, width, height, rois);\n\n\t\tByteProcessor bp = new ByteProcessor(width, height, output);\n\t\tip.copyBits(bp, 0, 0, Blitter.COPY);\n\t\timage.show();\n\t\timage.updateAndDraw();\n\t}", "public void removeHorizontalSeam(int[] seam) {\n Picture original = picture;\n Picture transpose = new Picture(original.height(), original.width());\n\n for (int w = 0; w < transpose.width(); w++) {\n for (int h = 0; h < transpose.height(); h++) {\n transpose.set(w, h, original.get(h, w));\n }\n }\n\n this.picture = transpose;\n transpose = null;\n original = null;\n\n // call removeVerticalSeam\n removeVerticalSeam(seam);\n\n // Transpose back.\n original = picture;\n transpose = new Picture(original.height(), original.width());\n\n for (int w = 0; w < transpose.width(); w++) {\n for (int h = 0; h < transpose.height(); h++) {\n transpose.set(w, h, original.get(h, w));\n }\n }\n\n this.picture = transpose;\n transpose = null;\n original = null;\n }", "@Override\n public void onClick(View v) {\n\n float x = ivImage.getScaleX();\n float y = ivImage.getScaleY();\n\n ivImage.setScaleX((float) (x + 1));\n ivImage.setScaleY((float) (y + 1));\n }", "void disableFlipMode();", "public boolean getScaleHorizontal() {\r\n return ScaleHorizontal;\r\n }", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "public Pic invert() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n current.setRed(255 - current.getRed());\n current.setGreen(255 - current.getGreen());\n current.setBlue(255 - current.getBlue());\n }\n }\n return output;\n }", "public void setIdentity() {\n System.arraycopy(IDENTITY, 0, matrix, 0, 16);\n }", "public StateChangeMdiIcon flipV() {\n defaultIcon.flipV();\n statesMap.values().forEach(MdiIcon::flipV);\n return this;\n }", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "public void runLighten() {\n BufferedImage transformedImage = new BufferedImage(this.image.getWidth(), this.image.getHeight(), this.image.getType());\n\n try {\n for(int i = 0; i < this.image.getWidth(); i++) {\n for(int j = 0; j < this.image.getHeight(); j++) {\n transformedImage.setRGB(i, j, image.getRGB(i,j));\n }\n }\n float scaleFactor = 5.3f;\n RescaleOp op = new RescaleOp(scaleFactor, 0, null);\n transformedImage = op.filter(transformedImage, null);\n\n File outputImageFileLocation = new File(this.exportLocation);\n ImageIO.write(transformedImage, Files.getFileExtension(this.imageLocation), outputImageFileLocation);\n System.out.println(\"Success\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected AbstractMatrix3D vColumnFlip() {\n\tif (columns>0) {\n\t\tcolumnZero += (columns-1)*columnStride;\n\t\tcolumnStride = -columnStride;\n\t\tthis.isNoView = false;\n\t}\n\treturn this;\n}", "public void restore() {\n currentIm= originalIm.copy();\n }", "public static BufferedImage flipVertically(BufferedImage image) {\n BufferedImage trimImage = new BufferedImage(image.getWidth(), image.getHeight(), image.getType());\n Graphics2D graphics = trimImage.createGraphics();\n graphics.drawImage(image, 0, image.getHeight(), image.getWidth(), -image.getHeight(), null);\n graphics.dispose();\n\n return trimImage;\n }", "protected void center(boolean horizontal, boolean vertical) \r\n {\r\n Matrix m = getDisplayMatrix();\r\n\r\n RectF rect = new RectF(0, 0,mRoBitmap.getBitmap().getWidth(),\r\n \t\t\t\t\t\tmRoBitmap.getBitmap().getHeight());\r\n m.mapRect(rect);\r\n\r\n float height = rect.height();\r\n float width = rect.width();\r\n\r\n float deltaX = 0, deltaY = 0;\r\n\r\n if (vertical) {\r\n if (height < mViewHeight) {\r\n deltaY = (mViewHeight - height) / 2 - rect.top;\r\n } else if (rect.top > 0) {\r\n deltaY = -rect.top;\r\n } else if (rect.bottom < mViewHeight) {\r\n deltaY = mViewHeight - rect.bottom;\r\n }\r\n }\r\n if (horizontal) {\r\n if (width < mViewWidth) {\r\n deltaX = (mViewWidth - width) / 2 - rect.left;\r\n } else if (rect.left > 0) {\r\n deltaX = -rect.left;\r\n } else if (rect.right < mViewWidth) {\r\n deltaX = mViewWidth - rect.right;\r\n }\r\n }\r\n postTranslate(deltaX, deltaY);\r\n getDisplayMatrix();\r\n }", "public void setInverted(boolean inv) {\n/* 69 */ int dat = getData() & 0x7;\n/* 70 */ if (inv) {\n/* 71 */ dat |= 0x8;\n/* */ }\n/* 73 */ setData((byte)dat);\n/* */ }", "@Override\n\t\t\tprotected void paintComponent(Graphics g) {\n\t\t\t\tsuper.paintComponent(g);\n\t\t\t\tGraphics2D g2d = (Graphics2D) g;\n\t\t\t\tg2d.translate(this.getWidth() / 2, this.getHeight() / 2);\n\t\t\t\tg2d.translate(-image.getWidth(null) / 2, -image.getHeight(null) / 2);\n\t\t\t\tg2d.drawImage(image, 0, 0, null);\n\t\t\t}", "public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }", "public boolean slideLeft() {\n\t\tif (currentCol > 0) {\n\t\t\tboard[currentRow][currentCol] = board[currentRow][currentCol - 1];\n\t\t\tcurrentCol--;\n\t\t\tboard[currentRow][currentCol] = '0';\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public void oddRowShift(int shift)\n{\n if(m != null && m.getOutputImageManager().getMosaic()!= null)\n {\n m.getOutputImageManager().setOddRowShift((float)(shift*0.01f));\n m.getOutputImageManager().setToRerender();\n }\n}", "public void imageSwap() {\n GreenfootImage image = (movement.dx < 1) ? leftImage : rightImage;\n setImage(image);\n }", "public void flipCard() {\n this.faceUp = !faceUp;\n }", "protected abstract void clip();", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "public void vreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= cols-1;\n //invariant: columns 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap column h with column k\n // invariant: pixels 0..c-1 of columns h and k have been swapped\n for (int c= 0; c != rows; c= c+1) {\n currentIm.swapPixels(c, h, c, k);\n }\n \n h= h+1; k= k-1;\n }\n \n }", "boolean getLandscape();", "public void flip() {\n flipRecur(root);\n }", "public void restore() {\n setOrientation(0);\n setCropRect(getMaxCenteredCropRect(), false);\n autoZoom(true);\n }", "public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }", "private int[][] shiftLeft(int[][] matrix, int row) {\r\n\t\tfor (int i = 0; i < row; i++) {\r\n\t\t\tint tmp = matrix[row][0];\r\n\t\t\tmatrix[row][0] = matrix[row][1];\r\n\t\t\tmatrix[row][1] = matrix[row][2];\r\n\t\t\tmatrix[row][2] = matrix[row][3];\r\n\t\t\tmatrix[row][3] = tmp;\r\n\t\t}\r\n\t\treturn matrix;\r\n\t}", "private void updateSprite(){\n //facing front\n getImage().clear();\n getImage().drawImage(SHEET,-(frame%SHEET_W)*SPRITE_W,0);\n if(!goLeft) getImage().mirrorHorizontally();\n if (iframes>0&&iframes%10<5) setImage(SpriteHelper.makeWhite( getImage()));\n else frame = frame + 1 % (SHEET_H* SHEET_W);\n }", "private void setPixels() {\n\t\t\tfinal byte[] dest = new byte[(int) (getMetadata().get(0).getAxisLength(\n\t\t\t\tAxes.X) * getMetadata().get(0).getAxisLength(Axes.Y))];\n\t\t\tlong lastImage = -1;\n\n\t\t\t// fill in starting image contents based on last image's dispose\n\t\t\t// code\n\t\t\tif (getMetadata().getLastDispose() > 0) {\n\t\t\t\tif (getMetadata().getLastDispose() == 3) { // use image before last\n\t\t\t\t\tfinal long n = getMetadata().get(0).getPlaneCount() - 2;\n\t\t\t\t\tif (n > 0) lastImage = n - 1;\n\t\t\t\t}\n\n\t\t\t\tif (lastImage != -1) {\n\t\t\t\t\tfinal byte[] prev = getMetadata().getImages().get((int) lastImage);\n\t\t\t\t\tSystem.arraycopy(prev, 0, dest, 0, (int) (getMetadata().get(0)\n\t\t\t\t\t\t.getAxisLength(Axes.X) * getMetadata().get(0).getAxisLength(\n\t\t\t\t\t\t\tAxes.Y)));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// copy each source line to the appropriate place in the destination\n\n\t\t\tint pass = 1;\n\t\t\tint inc = 8;\n\t\t\tint iline = 0;\n\t\t\tfor (int i = 0; i < getMetadata().getIh(); i++) {\n\t\t\t\tint line = i;\n\t\t\t\tif (getMetadata().isInterlace()) {\n\t\t\t\t\tif (iline >= getMetadata().getIh()) {\n\t\t\t\t\t\tpass++;\n\t\t\t\t\t\tswitch (pass) {\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tiline = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tiline = 2;\n\t\t\t\t\t\t\t\tinc = 4;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tiline = 1;\n\t\t\t\t\t\t\t\tinc = 2;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tline = iline;\n\t\t\t\t\tiline += inc;\n\t\t\t\t}\n\t\t\t\tline += getMetadata().getIy();\n\t\t\t\tif (line < getMetadata().get(0).getAxisLength(Axes.Y)) {\n\t\t\t\t\tfinal int k = line * (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint dx = k + getMetadata().getIx(); // start of line in dest\n\t\t\t\t\tint dlim = dx + getMetadata().getIw(); // end of dest line\n\t\t\t\t\tif ((k + getMetadata().get(0).getAxisLength(Axes.X)) < dlim) dlim =\n\t\t\t\t\t\tk + (int) getMetadata().get(0).getAxisLength(Axes.X);\n\t\t\t\t\tint sx = i * getMetadata().getIw(); // start of line in\n\t\t\t\t\t// source\n\t\t\t\t\twhile (dx < dlim) {\n\t\t\t\t\t\t// map color and insert in destination\n\t\t\t\t\t\tfinal int index = getMetadata().getPixels()[sx++] & 0xff;\n\t\t\t\t\t\tdest[dx++] = (byte) index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMetadata().getColorTables().add(getMetadata().getAct());\n\t\t\tgetMetadata().getImages().add(dest);\n\t\t}", "public void setBitmapLeft(Bitmap b){\n\t\timgLeft = b;\n\t\tleft.setBitmap(b);\n\t\tinvalidate();\n\t}", "private void toMirrorImage(Node root){\n if(root==null){\n return;\n }\n Node temp = root.getLeft();\n root.setLeft(root.getRight());\n root.setRight(temp);\n\n toMirrorImage(root.getLeft());\n toMirrorImage(root.getRight());\n }" ]
[ "0.67610556", "0.64542675", "0.6453264", "0.639316", "0.6072418", "0.60189945", "0.59343934", "0.5881711", "0.585844", "0.58137286", "0.5738235", "0.57060176", "0.5693743", "0.5651657", "0.5630142", "0.55748504", "0.5529685", "0.5498218", "0.5474971", "0.545889", "0.5432554", "0.54273146", "0.54208714", "0.5403084", "0.54029095", "0.53479445", "0.53372043", "0.5305701", "0.52944946", "0.5285345", "0.52390206", "0.5229161", "0.52194613", "0.5210956", "0.520956", "0.51394016", "0.5134986", "0.51269794", "0.5110288", "0.5094426", "0.5085258", "0.5034321", "0.50328743", "0.49583334", "0.49565545", "0.49480164", "0.49400574", "0.4937099", "0.4937099", "0.4937099", "0.4925927", "0.4922736", "0.49159765", "0.49139798", "0.49074233", "0.4884756", "0.48679987", "0.48572424", "0.4844812", "0.484132", "0.48394498", "0.48314568", "0.4828503", "0.47933772", "0.47913367", "0.47784013", "0.47681242", "0.47585666", "0.47521126", "0.47506148", "0.47436652", "0.47369257", "0.4723716", "0.4715478", "0.47036538", "0.4700732", "0.46960655", "0.46720582", "0.4667239", "0.46610108", "0.46581754", "0.4657171", "0.46478063", "0.4630806", "0.4630674", "0.4628058", "0.46217373", "0.46213216", "0.4621299", "0.4618777", "0.46171793", "0.46093282", "0.4608197", "0.46067226", "0.46056136", "0.46019414", "0.46018943", "0.46015435", "0.45961922", "0.45949745" ]
0.5546565
16
Rotates this image 90 degrees clockwise. Mipmap data will be lost.
public @NotNull Image rotateCW() { if (this.data != null) { if (this.mipmaps > 1) Image.LOGGER.warning("Image manipulation only applied to base mipmap level"); Color.Buffer output = Color.malloc(this.format, this.width * this.height); long srcPtr = this.data.address(); long dstPtr = output.address(); for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width; x++) { long src = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof; long dst = Integer.toUnsignedLong(x * this.height + this.height - y - 1) * this.format.sizeof; MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof); } } this.data.free(); this.data = output; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}", "void rotate();", "public void rotateClockWise() {\r\n\r\n transpose();\r\n\r\n // swap columns\r\n for (int col = 0; col < pixels[0].length / 2; col++) {\r\n for (int row = 0; row < pixels.length; row++) {\r\n int tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][pixels[0].length - 1 - col];\r\n pixels[row][pixels[0].length - 1 - col] = tmp;\r\n }\r\n }\r\n\r\n this.pix2img();\r\n }", "@Override\n\tpublic void rotate90() {\n\n\t\tint[][] rotate = new int[this.frame[0].length][this.frame.length];\n\n\t\tfor (int x = 0; x < rotate[0].length; x++) {\n\t\t\tfor (int y = 0; y < rotate.length; y++) {\n\t\t\t\trotate[y][x] = this.frame[this.frame.length - x - 1][y];\n\t\t\t}\n\t\t} \n\n\t\tthis.frame = rotate;\n\n\t}", "public @NotNull Image rotateCCW()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n long src = Integer.toUnsignedLong(y * this.width + this.width - x - 1) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(x * this.height + y) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof);\n }\n }\n \n this.data.free();\n this.data = output;\n }\n return this;\n }", "public void rotate()\r\n\t{\r\n\t\tdouble degree = Math.PI/2;\r\n\t\tdouble sin = Math.sin(degree);\r\n\r\n\t\tAffineTransform tx = new AffineTransform();\r\n\t\ttx.rotate(degree, this.bufferedImage.getWidth() / (double)2, this.bufferedImage.getHeight() / (double)2);\r\n\t\tAffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);\r\n\r\n\t\tRectangle rect = op.getBounds2D(this.bufferedImage).getBounds();\r\n\t\ttx.translate(sin * rect.getX(), -sin * rect.getY());\r\n\t\top = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);\r\n\t\tthis.bufferedImage = op.filter(this.bufferedImage, op.createCompatibleDestImage(this.bufferedImage, null) );\r\n\r\n\r\n\t\tthis.setBounds( getX(), getY(), this.bufferedImage.getWidth(), this.bufferedImage.getHeight() );\r\n\t\tthis.width = this.bufferedImage.getWidth();\r\n\t\tthis.height = this.bufferedImage.getHeight();\r\n\t\t\r\n\t}", "public void zRotate() {\n\t\t\n\t}", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "@Override\n \t\t\t\tpublic void doRotateZ() {\n \n \t\t\t\t}", "public MutableImage rotateLeft() {\n return rotate(-90);\n }", "@Override\n\tpublic void rotate() {\n\t}", "LocalMaterialData rotate();", "public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }", "public native MagickImage rotateImage(double degrees)\n\t\t\tthrows MagickException;", "public Matrix rotate90Degree() {\n\t\tMatrix rotatedMatrix = new Matrix(this.getHeight(), this.getWidth());\n\t\tfor(int i = 0; i < this.getWidth(); i++) {\n\t\t\tfor(int j = 0; j < this.getHeight(); j++) {\n\t\t\t\trotatedMatrix.setElement(j, (this.getWidth() -1) - i, data[i][j]);\n\t\t\t}\n\t\t}\n\t\tthis.show();\n\t\trotatedMatrix.show();\n\t\treturn rotatedMatrix;\n\t}", "public static void rotateAcw(RasterImage inputImage, RasterImage outputImage)\n\t{\n\t\tassert inputImage != null && outputImage != null && outputImage.getSize() == inputImage.getSize();\n\t\t\n\t\t\n\t\tif (inputImage == outputImage)\n\t\t{\n\t\t\tinputImage = new RasterImage(inputImage);\n\t\t}\n\t\t\n\t\toutputImage.resize(inputImage.getHeight(), inputImage.getWidth());\n\t\t\n\t\tint newY;\n\t\t\n\t\tfor (int i = 0; i < inputImage.getHeight(); i++)\n\t\t{\n\t\t\tfor (int j = 0; j < inputImage.getWidth(); j++)\n\t\t\t{\n\t\t\t\tnewY = inputImage.getWidth() - j - 1;\n\t\t\t\toutputImage.setRgb(i, newY, inputImage.getRgb(j, i));\n\t\t\t}\n\t\t}\n\t}", "public abstract void rotate();", "public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }", "public static BufferedImage rotate90ToLeft(BufferedImage inputImage) {\n // The most of code is same as before\n int width = inputImage.getWidth();\n int height = inputImage.getHeight();\n BufferedImage returnImage = new BufferedImage(height, width,\n inputImage.getType());\n // We have to change the width and height because when you rotate the image\n // by 90 degree, the\n // width is height and height is width <img\n // src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/smile.png'\n // class='bbc_emoticon' alt=':)' />\n\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n returnImage.setRGB(y, width - x - 1, inputImage.getRGB(x, y));\n }\n }\n return returnImage;\n\n }", "public static Bitmap rotateBitmap(Bitmap newImage) throws IOException {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n newImage.compress(Bitmap.CompressFormat.JPEG, 100, stream);\n InputStream inputStream = new ByteArrayInputStream(stream.toByteArray());\n try {\n ExifInterface exif = new ExifInterface(inputStream);\n int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) {\n Matrix matrix = new Matrix();\n matrix.postRotate(90);\n Bitmap rotatedBitmap = Bitmap.createBitmap(newImage, 0, 0, newImage.getWidth(), newImage.getHeight(), matrix, true);\n return rotatedBitmap;\n } else {\n return newImage;\n }\n } catch (Exception e) {\n Log.e(\"Error getting image: \", e.toString());\n }\n return newImage;\n }", "public MutableImage rotate(double degrees) {\n return apply(t -> {\n var w = image.getWidth();\n var h = image.getHeight();\n var rads = Math.toRadians(degrees);\n var sin = Math.abs(Math.sin(rads));\n var cos = Math.abs(Math.cos(rads));\n var newWidth = (int) Math.floor(w * cos + h * sin);\n var newHeight = (int) Math.floor(h * cos + w * sin);\n t.translate((newWidth - w) / 2d, (newHeight - h) / 2d);\n var x = w / 2;\n var y = h / 2;\n t.rotate(rads, x, y);\n });\n }", "public MutableImage rotateRight() {\n return rotate(90);\n }", "public void rotateImage(View view) {\n\n View img = findViewById(ID_PlacementMode_BrickPreview_ImageView);\n\n float rotation;\n\n if (view.getId() == R.id.ID_PlacementMode_RotateLeft_Button) {\n rotation = img.getRotation() - (float) 90.0;\n }\n else { // rotate right\n rotation = img.getRotation() + (float) 90.0;\n }\n\n // set rotation in positive range in order to use map_angle_to_blockrotation correctly (Bugfix #414)\n if (rotation < 0) {\n rotation = rotation + 360f;\n }\n\n // set rotation of visualized brick preview\n img.setRotation(rotation);\n\n BlockRotation block_rotation = map_angle_to_blockrotation.get(((int)rotation)%360);\n\n // set rotation in block object\n objBrickPreview.setRotation(block_rotation);\n\n }", "public void rotateCCW(){\n rotState = (rotState + 3) % 4;\n for (int i = 0; i < tiles.length; ++i){\n tiles[i] = new Point(tiles[i].y , -tiles[i].x);\n }\n }", "private void rotate(int direction){\n\t\t//Gdx.app.debug(TAG, \"rotating, this.x: \" + this.x + \", this.y: \" + this.y);\n\t\tif (direction == 1 || direction == -1){\n\t\t\tthis.orientation = (this.orientation + (direction*-1) + 4) % 4;\n\t\t\t//this.orientation = (this.orientation + direction) % 4;\n\t\t} else{\n\t\t\tthrow new RuntimeException(\"Tile invalid direction\");\n\t\t}\n\t}", "@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}", "private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }", "public ImageIcon rotateImage(ImageIcon aicon){\n\t\tswitch(angle){\n\t\tcase 90: case -90: return rotateImage(aicon, angle);\n\t\tcase 180: return rotateImage(rotateImage(aicon, 90), 90);\n\t\tdefault: return aicon;\n\t\t}\n\t}", "public void xRotate() {\n\t\t\n\t}", "private Bitmap rotateBitmap(Bitmap bitmap){\n Matrix matrix = new Matrix();\n matrix.postRotate(90);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "public StateChangeMdiIcon rotate90() {\n defaultIcon.rotate90();\n statesMap.values().forEach(MdiIcon::rotate90);\n return this;\n }", "private Bitmap rotateImage(final String path) {\n\n Bitmap b = decodeFileFromPath(path);\n\n try {\n ExifInterface ei = new ExifInterface(path);\n int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n default:\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n //b.copyPixelsFromBuffer(ByteBuffer.)\n break;\n }\n } catch (Throwable e) {\n e.printStackTrace();\n }\n return b;\n }", "public Matrix rotate90DegreeInPlace() {\n\t\tfor(int layer = 0; layer < this.getWidth() / 2; ++layer) {\n\t\t\tint first = layer;\n\t\t\tint last = this.getWidth() - 1 - layer;\n\t\t\t\n\t\t\tfor(int i = first; i < last; ++i) {\n\t\t\t\tint offset = i - first;\n\t\t\t\t\n\t\t\t\t//save top\n\t\t\t\tdouble top = this.getElement(first, i);\n\t\t\t\t\n\t\t\t\t// left -> top\n\t\t\t\tthis.setElement(first, i, this.getElement(last - offset, first));\n\t\t\t\t// bottom -> left\n\t\t\t\tthis.setElement(last - offset, first, this.getElement(last, last - offset));\n\t\t\t\t// right -> bottom\n\t\t\t\tthis.setElement(last, last - offset, this.getElement(i, last));\n\t\t\t\t// top -> right\n\t\t\t\tthis.setElement(i, last, top);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}", "public static void rotateCw(RasterImage inputImage, RasterImage outputImage)\n\t{\n\t\tassert outputImage.getSize() == inputImage.getSize();\n\t\t\n\t\t\n\t\tif (inputImage == outputImage)\n\t\t{\n\t\t\tinputImage = new RasterImage(inputImage);\n\t\t}\n\t\t\n\t\toutputImage.resize(inputImage.getHeight(), inputImage.getWidth());\n\t\t\n\t\tint newX;\n\t\t\n\t\tfor (int i = 0; i < inputImage.getHeight(); i++)\n\t\t{\n\t\t\tnewX = inputImage.getHeight() - i - 1;\n\t\t\t\n\t\t\tfor (int j = 0; j < inputImage.getWidth(); j++)\n\t\t\t{\n\t\t\t\toutputImage.setRgb(newX, j, inputImage.getRgb(j, i));\n\t\t\t}\n\t\t}\n\t}", "void rotate () {\n final int rows = currentPiece.height;\n final int columns = currentPiece.width;\n int[][] rotated = new int[columns][rows];\n\n for (int i = 0; i < rows; i++)\n for (int j = 0; j < columns; j++)\n rotated[j][i] = currentPiece.blocks[i][columns - 1 - j];\n\n Piece rotatedPiece = new Piece(currentPiece.color, rotated);\n int kicks[][] = {\n {0, 0},\n {0, 1},\n {0, -1},\n //{0, -2},\n //{0, 2},\n {1, 0},\n //{-1, 0},\n {1, 1},\n //{-1, 1},\n {1, -1},\n //{-1, -1},\n };\n for (int kick[] : kicks) {\n if (canMove(currentRow + kick[0], currentColumn + kick[1], rotatedPiece)) {\n //System.out.println(\"Kicking \" + kick[0] + \", \" + kick[1]);\n currentPiece = rotatedPiece;\n currentRow += kick[0];\n currentColumn += kick[1];\n updateView();\n break;\n }\n }\n }", "@Override\r\n\tpublic void rotar() {\n\r\n\t}", "public static BufferedImage rotate90ToRight(BufferedImage inputImage) {\n int width = inputImage.getWidth();\n int height = inputImage.getHeight();\n BufferedImage returnImage = new BufferedImage(height, width,\n inputImage.getType());\n\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n returnImage.setRGB(height - y - 1, x, inputImage.getRGB(x, y));\n }\n }\n return returnImage;\n }", "void rotate() {\n startAnimation(allSubCubes(), Axis.Y, Direction.CLOCKWISE);\n rotateCubeSwap();\n }", "public void rotate() \n {\n \tint[] rotatedState = new int[state.length];\n \tfor (int i = 0; i < state.length; ++i)\n \t\trotatedState[(i+7)%14] = state[i];\n \tstate = rotatedState;\n }", "public double getRotation();", "public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}", "public void rotate() {\n\t\tclearPiece();\n\t\trotateFirstBlock();\n\t\trotateSecondBlock();\n\t\trotateFourthBlock();\n\t\tsetPiece();\n\t\trepaint();\n\t}", "public Matrix getCurrentRotation() throws ManipulatorException;", "public void rotate(boolean clockwise) \n\t{\n\t\tcircular_shift(connections, clockwise);\n\t\torientation = next(orientation, clockwise);\n\t}", "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "public Rotation(){\n\t\timageData = new int[][] {{1,2,3,4}, {5,6,7,8},{9, 10, 11, 12},{13, 14, 15 ,16}};\n\t\tn = 4;\n\t}", "public void Rotation(int i) {\n mRender.Rotation(i);\n }", "public void draw()\n {\n imageView.setRotate(teta);\n imageView.relocate(super.getX(),super.getY());\n }", "void rotatePolygon() {\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].rotate();\n\t}", "protected void rotateImage(int degrees) {\n mCropImageView.rotateImage(degrees);\n }", "public boolean hasRotate() { return hasRotate; }", "public Direction rotate90() {\n return values()[r90index];\n }", "private Bitmap rotateBitmapOrientation(String photoFilePath) {\n BitmapFactory.Options bounds = new BitmapFactory.Options();\n bounds.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(photoFilePath, bounds);\n BitmapFactory.Options opts = new BitmapFactory.Options();\n Bitmap bm = BitmapFactory.decodeFile(photoFilePath, opts);\n // Read EXIF Data\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(photoFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n int rotationAngle = 0;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n // Rotate Bitmap\n Matrix matrix = new Matrix();\n matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, bounds.outWidth, bounds.outHeight, matrix, true);\n // Return result\n return rotatedBitmap;\n }", "private static Bitmap fixImageRotation (Bitmap bitmap, String rawImageFilePath) throws IOException\r\n {\r\n /* Evaluate if we need to rotate the bitmap and replace the old bitmap. */\r\n float angle = getRawImageRotation(rawImageFilePath);\r\n if ( bitmap != null\r\n && angle != 0)\r\n {\r\n Matrix matrix = new Matrix();\r\n matrix.postRotate(angle);\r\n\r\n Bitmap oldBitmap = bitmap;\r\n\r\n bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\r\n bitmap.getHeight(), matrix, true);\r\n\r\n oldBitmap.recycle();\r\n }\r\n return bitmap;\r\n }", "private void rotateSeaperch(ImageView imageView, float x, float y, float z){\n\t\timageView.setRotationX(x);\n\t\timageView.setRotation(y);\n\t\timageView.setRotationY(z);\n\t}", "public static BufferedImage rotateCw( BufferedImage img ) {\n int width = img.getWidth();\n int height = img.getHeight();\n BufferedImage newImage = new BufferedImage( height, width, img.getType());\n\n for( int i=0 ; i < width ; i++ )\n for( int j=0 ; j < height ; j++ )\n newImage.setRGB( height-1-j, i, img.getRGB(i,j) );\n \n return newImage;\n }", "public AbstractJmodelAction getRotate() {\r\n \r\n \t\treturn actionRotate;\r\n \t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "int[][] rotate(int[][] image) {\n if(image.length != image[0].length) {\n throw new IllegalArgumentException();\n }\n // can assume the image is square matrix.\n int dimension = image.length;\n for(int i=0;i< dimension; i++) {\n for(int j=i;j<dimension;j++) {\n int temp = image[j][i];\n image[j][i] = image[i][j];\n image[i][j] = temp;\n }\n }\n return image;\n }", "DMatrix3C getRotation();", "Mat rotateMatCW(Mat src ) {\n Mat rotationMatrix = Imgproc.getRotationMatrix2D(new Point(src.cols()/2,src.rows()/2),270,1);\n\n //Rotating the given image\n Imgproc.warpAffine(src, result,rotationMatrix, new Size(src.cols(), src.rows()));\n return result;\n }", "public abstract void rotateLeft();", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "private void rotateView(Canvas paramCanvas) {\n float degree = mDistance / 3f;\n paramCanvas.rotate(-degree, this.getWidth() / 2, this.getHeight() / 2);\n paramCanvas.drawBitmap(mBmp, this.getWidth() / 2 - mBmp.getWidth() / 2, this.getHeight()\n / 2 - mBmp.getHeight() / 2, mTxtPaint);\n }", "@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\tint hieght=this.getHeight();\n\t\tint width=this.getWidth();\n\t\tcanvas.rotate(direction, width/2,hieght/2);\n\t\t\n\t\tsuper.onDraw(canvas);\n\t\t\n\t\t\n\t}", "private Bitmap rotateImage(Bitmap source, float angle) {\n Matrix matrix = new Matrix();\n matrix.postRotate(angle);\n return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(),\n matrix, true);\n }", "public void rotate(float angle);", "public void calculateAngleAndRotate(){\n\t\tdouble cumarea = 0;\n\t\tdouble sina = 0;\n\t\tdouble cosa = 0;\n\t\tdouble area, angle;\n\t\tfor (int n = 0; n < rt.size();n++) {\n\t\t\tarea = rt.getValueAsDouble(rt.getColumnIndex(\"Area\"),n);\n\t\t\tangle = 2*rt.getValueAsDouble(rt.getColumnIndex(\"Angle\"),n);\n\t\t\tsina = sina + area*Math.sin(angle*Math.PI/180);\n\t\t\tcosa = cosa + area*Math.cos(angle*Math.PI/180);\n\t\t\tcumarea = cumarea+area;\n\t\t}\n\t\taverageangle = Math.abs(0.5*(180/Math.PI)*Math.atan2(sina/cumarea,cosa/cumarea)); // this is the area weighted average angle\n\t\t// rotate the data \n\t\tIJ.run(ActiveImage,\"Select All\",\"\");\n\t\tActiveImageConverter.convertToGray32();\n\t\tIJ.run(ActiveImage,\"Macro...\", \"code=[v= x*sin(PI/180*\"+averageangle+\")+y*cos(PI/180*\"+averageangle+\")]\");\n\t\treturn;\n\t}", "private void computeRotate() {\n time = Math.min(\n duration,\n time + MaterialWeatherView.WeatherAnimationImplementor.REFRESH_INTERVAL);\n rotationNow = (rotationEnd - rotationStart) * (1 - Math.pow(1 - 1.0 * time / duration, 2 * FACTOR))\n + rotationStart;\n if (time == duration) {\n // finish.\n rotating = false;\n }\n }", "public void setRotate() {\r\n\t\tint npoints = xpoints.length;\r\n\t\tdouble[] tempxpoints = new double[xpoints.length];\r\n\t\tdouble[] tempypoints = new double[xpoints.length];\r\n\t\tdouble radians = Math.toRadians(angle%360);\r\n\t\tdouble y = pivotY;\r\n\t\tdouble x = pivotX;\r\n\t\tfor(int i = 0; i<xpoints.length; i++) {\r\n\t\t\ttempxpoints[i] = (Math.cos(radians)*(xpoints[i]-x)-Math.sin(radians)*(ypoints[i]-y)+x);\r\n\t\t\ttempypoints[i] = (Math.sin(radians)*(xpoints[i]-x)+Math.cos(radians)*(ypoints[i]-y)+y);\r\n\t\t}\r\n\t\txpoints = tempxpoints;\r\n\t\typoints = tempypoints;\r\n\t\tangle = 0;\r\n\t}", "public static void rotate(int[][] matrix) {\n int numLayers = matrix.length / 2;\n\n for (int i = 0; i < numLayers; i++) {\n int beginningPixel = i;\n int lastPixel = matrix.length - i - 1;\n // don't swap the last pixel because it was already swapped as the first pixel of another row\n for (int j = beginningPixel; j < lastPixel; j++) {\n int top = matrix[i][j];\n // left -> top\n matrix[i][j] = matrix[matrix.length - j - 1][i];\n\n // bottom -> left\n matrix[matrix.length - j - 1][i] = matrix[matrix.length - i - 1][matrix.length - j - 1];\n\n // right -> bottom\n matrix[matrix.length - i - 1][matrix.length - j - 1] = matrix[j][matrix.length - i - 1];\n\n // top -> right\n matrix[j][matrix.length - i - 1] = top;\n }\n }\n }", "public Piece rotate() {\n\t\tif (!isRotatable) {\n\t\t\treturn this;\n\t\t}\n\t\tint m = shape.length;\n\t\tint n = shape[0].length;\n\t\tint[][] newPiece = new int[n][m];\n\t\tfor (int r = 0; r < m; r++) {\n\t for (int c = 0; c < n; c++) {\n\t newPiece[c][m-1-r] = shape[r][c];\n\t }\n\t\t}\n\t\treturn new Piece(value, name, newPiece, isFlippable, isRotatable);\n\t}", "void applyRotationMatrix() {\n for (int i = 0; i < coors.length; i++) {\n for (int j = 0; j < coors[i].length; j++) {\n newCoors[i][j] = coors[i][0] * R[j][0] + coors[i][1] * R[j][1] + coors[i][2] * R[j][2];\n }\n // add perspective\n float scale = map(Math.abs(newCoors[i][2]), 0, (float) (halfSize * Math.sqrt(3)), 1, 1.5f);\n if (newCoors[i][2] < 0) {\n scale = 2f - scale;\n }\n for (int j = 0; j < 2; j++) {\n newCoors[i][j] *= scale;\n }\n }\n // to R2\n // just dont use Z\n setPathAndAlpha();\n }", "public void rotate(Point P, int rotation) {\n\n\n }", "public StateChangeMdiIcon rotate45() {\n defaultIcon.rotate45();\n statesMap.values().forEach(MdiIcon::rotate45);\n return this;\n }", "private Bitmap flipImage(byte[] input, FileOutputStream fos){\n\n\t\t\t\tMatrix rotate_matrix = new Matrix();\n\t\t\t\trotate_matrix.preScale(-1.0f, 1.0f);\n\t\t\t\tBitmapFactory bmf = new BitmapFactory();\n\t\t\t\tBitmap raw_bitmap = bmf.decodeByteArray(input, 0, input.length);\n\t\t\t\tBitmap result = Bitmap.createBitmap(raw_bitmap, 0, 0, raw_bitmap.getWidth(), raw_bitmap.getHeight(), rotate_matrix, true);\n\t\t\t\treturn result;\n\t\t\t\t/*\n\t\t\t\tresult.compress(Bitmap.CompressFormat.JPEG, 90, fos);\n\t\t\t\ttry {\n\t\t\t\t\tfos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "private static void rotate(int[][] matrix) {\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = i; j < matrix[0].length; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[j][i];//转置,第i行变成第i列\r\n\t\t\t\tmatrix[j][i] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = 0; j < matrix.length / 2; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[i][matrix.length - 1 - j];\r\n\t\t\t\tmatrix[i][matrix.length - 1 - j] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "static Bitmap rotate(Bitmap bitmap, float degrees) {\n Matrix matrix = new Matrix();\n matrix.postRotate(degrees);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "public StateChangeMdiIcon rotate315() {\n defaultIcon.rotate315();\n statesMap.values().forEach(MdiIcon::rotate315);\n return this;\n }", "private Bitmap fixOrientation(Bitmap bitmap) {\n if (bitmap == null) {\n return null;\n }\n\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(currentPhotoPath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);\n\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n break;\n default:\n break;\n }\n bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n return bitmap;\n }", "public float getRotation()\n {\n return rotation;\n }", "public Bitmap rotateBitmapOrientation(String file) {\n\t BitmapFactory.Options bounds = new BitmapFactory.Options();\n\t bounds.inJustDecodeBounds = true;\n\t BitmapFactory.decodeFile(file, bounds);\n\t BitmapFactory.Options opts = new BitmapFactory.Options();\n\t Bitmap bm = BitmapFactory.decodeFile(file, opts);\n\t CameraPreview cp = (CameraPreview) findViewById(R.id.camera_preview);\n\t bm = Bitmap.createScaledBitmap(bm, cp.getWidth(), cp.getHeight(), true);\n\t // Read EXIF Data\n\t ExifInterface exif;\n\t\ttry {\n\t\t\texif = new ExifInterface(file);\n\t\t String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n\t\t int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n\t\t int rotationAngle = 0;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n\t\t // Rotate Bitmap\n\t\t Matrix matrix = new Matrix();\n\t\t matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n\t\t Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, cp.getWidth(), cp.getHeight(), matrix, true);\n\t\t // Return result\n\t\t return rotatedBitmap;\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "void rotateRotator(int offset) {\n final Map<String, String> rotatorEncodeNew = new HashMap<>();\n String newEncode;\n int j;\n for (int i = 65; i <= 90; i++) {\n j = i + offset > 90 ? (i + offset) - 26 : i + offset;\n j = j < 65 ? j + 26 : j;\n rotatorEncodeNew.put(Character.toString((char) i), this.rotatorEncode.get(Character.toString((char) j)));\n }\n this.rotatorEncode.clear();\n this.rotatorEncode.putAll(rotatorEncodeNew);\n this.rotatorDecode.putAll(this.rotatorEncode\n .entrySet()\n .stream()\n .collect((Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey))));\n }", "void rotatePiece() {\n boolean temp = this.left;\n boolean temp2 = this.up;\n boolean temp3 = this.right;\n boolean temp4 = this.down;\n this.left = temp4;\n this.up = temp;\n this.right = temp2;\n this.down = temp3;\n }", "private static Bitmap rotateImage(Bitmap source, float angle) {\n Matrix matrix = new Matrix();\n matrix.postRotate(angle);\n return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(),\n matrix, true);\n }", "void rotateInv() {\n startAnimation(allSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n rotateCubeSwap();\n rotateCubeSwap();\n rotateCubeSwap();\n }", "static void rotate(int[][] matrix) {\n int n = matrix.length;\n for (int i = 0; i < (n + 1) / 2; i++) {\n for (int j = 0; j < n / 2; j++) {\n int temp = matrix[n - 1 - j][i];\n matrix[n - 1 - j][i] = matrix[n - 1 - i][n - j - 1];\n matrix[n - 1 - i][n - j - 1] = matrix[j][n - 1 - i];\n matrix[j][n - 1 - i] = matrix[i][j];\n matrix[i][j] = temp;\n }\n }\n }", "void setImageProperty() {\n\t\t imgView.setImageResource(R.drawable.weathericon);\n\t\tMatrix matrix = new Matrix();\n\t\trotate += 30;\n\t\tif (rotate == 360) {\n\t\t\trotate = 0;\n\t\t}\n\t\tfloat centerX = imgView.getWidth() / 2;\n\t\tfloat centerY = imgView.getHeight() / 2;\n\t\tmatrix.setRotate(rotate, centerX, centerY);\n\t\t//matrix.setTranslate(10, 20);\n\t\timgView.setImageMatrix(matrix); \n\t\t//ScaleType type = ScaleType.\n\t\t\n\t\t//imgView.setScaleType(scaleType);\n\t \n\t}", "public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }", "public void flip(){\n Matrix mirrorMatrix = new Matrix();\n mirrorMatrix.preScale(-1, 1);\n Bitmap turnMap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mirrorMatrix, false);\n turnMap.setDensity(DisplayMetrics.DENSITY_DEFAULT);\n bitmap = new BitmapDrawable(turnMap).getBitmap();\n }", "private void rotate(final MouseEvent event) {\r\n\r\n\t\t// reset transform3D\r\n\t\tthis.rotation.rotY(0);\r\n\r\n\t\t// rotate around y-axis\r\n\t\tif (super.x_last - event.getPoint().x > 0) {\r\n\t\t\t// rotate leftwards\r\n\t\t\tthis.rotation.rotY(this.angle);\r\n\t\t} else {\r\n\t\t\t// rotate rightwards\r\n\t\t\tthis.rotation.rotY(-this.angle);\r\n\t\t}\r\n\r\n\t\t// apply rotation\r\n\t\tsuper.transformGroup.getTransform(this.transform);\r\n\t\tthis.transform.mul(this.rotation);\r\n\t\tsuper.transformGroup.setTransform(this.transform);\r\n\t}", "static PT RotateCCW90(PT p) {\r\n\t\treturn new PT(-p.y, p.x);\r\n\t}", "public void rotateY90() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint x_ = vertexX[v];\n\t\t\tvertexX[v] = vertexZ[v];\n\t\t\tvertexZ[v] = -x_;\n\t\t}\n\t}", "public ImageRotator(int receivedAngle){angle = receivedAngle;}", "private KeyValue rotatingText() {\r\n\t\tdouble val = b_MyPane.getText().getRotate() + 40;\r\n\t\tb_MyPane.getText().setRotate(val);\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void rotateRight(int degrees) {\n\t\t\n\t}", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "public StateChangeMdiIcon rotate270() {\n defaultIcon.rotate270();\n statesMap.values().forEach(MdiIcon::rotate270);\n return this;\n }" ]
[ "0.67872846", "0.6719662", "0.66683483", "0.6658961", "0.6654887", "0.6650214", "0.6627556", "0.6552559", "0.65494585", "0.65053517", "0.6472391", "0.64637077", "0.6449866", "0.6413659", "0.6407631", "0.6402604", "0.6384034", "0.63559854", "0.63510776", "0.62930876", "0.6257538", "0.6254815", "0.62451255", "0.6117564", "0.6112434", "0.610368", "0.60979605", "0.60930896", "0.6064955", "0.60548794", "0.6040567", "0.60357493", "0.60339975", "0.6030585", "0.6017127", "0.6003235", "0.6001657", "0.5979934", "0.596718", "0.5958247", "0.5935003", "0.59049493", "0.58896863", "0.5854658", "0.58016926", "0.5792793", "0.57922167", "0.5769466", "0.57584804", "0.57536757", "0.57494575", "0.5740694", "0.57282686", "0.5721442", "0.56972843", "0.56615895", "0.5660171", "0.5652634", "0.56472605", "0.56462955", "0.56415945", "0.5627246", "0.56119335", "0.56079006", "0.56055367", "0.55816555", "0.55783904", "0.55679834", "0.5555243", "0.5547932", "0.5529194", "0.5512723", "0.5504494", "0.5502378", "0.54991835", "0.5497591", "0.5493656", "0.548482", "0.5458621", "0.5456486", "0.54531384", "0.5452243", "0.5446576", "0.544513", "0.54448277", "0.54389477", "0.54308933", "0.5421605", "0.54134434", "0.5412715", "0.54115015", "0.5405073", "0.5400039", "0.5395917", "0.5394526", "0.53925854", "0.53876793", "0.5387467", "0.5385962", "0.5379535" ]
0.667917
2
Rotates this image 90 degrees counterclockwise. Mipmap data will be lost.
public @NotNull Image rotateCCW() { if (this.data != null) { if (this.mipmaps > 1) Image.LOGGER.warning("Image manipulation only applied to base mipmap level"); Color.Buffer output = Color.malloc(this.format, this.width * this.height); long srcPtr = this.data.address(); long dstPtr = output.address(); for (int y = 0; y < this.height; y++) { for (int x = 0; x < this.width; x++) { long src = Integer.toUnsignedLong(y * this.width + this.width - x - 1) * this.format.sizeof; long dst = Integer.toUnsignedLong(x * this.height + y) * this.format.sizeof; MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof); } } this.data.free(); this.data = output; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public @NotNull Image rotateCW()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n long src = Integer.toUnsignedLong(y * this.width + x) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(x * this.height + this.height - y - 1) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof);\n }\n }\n \n this.data.free();\n this.data = output;\n }\n return this;\n }", "public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}", "@Override\n \t\t\t\tpublic void doRotateZ() {\n \n \t\t\t\t}", "public void rotateClockWise() {\r\n\r\n transpose();\r\n\r\n // swap columns\r\n for (int col = 0; col < pixels[0].length / 2; col++) {\r\n for (int row = 0; row < pixels.length; row++) {\r\n int tmp = pixels[row][col];\r\n pixels[row][col] = pixels[row][pixels[0].length - 1 - col];\r\n pixels[row][pixels[0].length - 1 - col] = tmp;\r\n }\r\n }\r\n\r\n this.pix2img();\r\n }", "public void zRotate() {\n\t\t\n\t}", "public void rotate()\r\n\t{\r\n\t\tdouble degree = Math.PI/2;\r\n\t\tdouble sin = Math.sin(degree);\r\n\r\n\t\tAffineTransform tx = new AffineTransform();\r\n\t\ttx.rotate(degree, this.bufferedImage.getWidth() / (double)2, this.bufferedImage.getHeight() / (double)2);\r\n\t\tAffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);\r\n\r\n\t\tRectangle rect = op.getBounds2D(this.bufferedImage).getBounds();\r\n\t\ttx.translate(sin * rect.getX(), -sin * rect.getY());\r\n\t\top = new AffineTransformOp(tx,AffineTransformOp.TYPE_BILINEAR);\r\n\t\tthis.bufferedImage = op.filter(this.bufferedImage, op.createCompatibleDestImage(this.bufferedImage, null) );\r\n\r\n\r\n\t\tthis.setBounds( getX(), getY(), this.bufferedImage.getWidth(), this.bufferedImage.getHeight() );\r\n\t\tthis.width = this.bufferedImage.getWidth();\r\n\t\tthis.height = this.bufferedImage.getHeight();\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}", "@Override\n\tpublic void rotate90() {\n\n\t\tint[][] rotate = new int[this.frame[0].length][this.frame.length];\n\n\t\tfor (int x = 0; x < rotate[0].length; x++) {\n\t\t\tfor (int y = 0; y < rotate.length; y++) {\n\t\t\t\trotate[y][x] = this.frame[this.frame.length - x - 1][y];\n\t\t\t}\n\t\t} \n\n\t\tthis.frame = rotate;\n\n\t}", "public Matrix rotate90Degree() {\n\t\tMatrix rotatedMatrix = new Matrix(this.getHeight(), this.getWidth());\n\t\tfor(int i = 0; i < this.getWidth(); i++) {\n\t\t\tfor(int j = 0; j < this.getHeight(); j++) {\n\t\t\t\trotatedMatrix.setElement(j, (this.getWidth() -1) - i, data[i][j]);\n\t\t\t}\n\t\t}\n\t\tthis.show();\n\t\trotatedMatrix.show();\n\t\treturn rotatedMatrix;\n\t}", "public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }", "void rotate();", "public MutableImage rotateLeft() {\n return rotate(-90);\n }", "public static void rotateAcw(RasterImage inputImage, RasterImage outputImage)\n\t{\n\t\tassert inputImage != null && outputImage != null && outputImage.getSize() == inputImage.getSize();\n\t\t\n\t\t\n\t\tif (inputImage == outputImage)\n\t\t{\n\t\t\tinputImage = new RasterImage(inputImage);\n\t\t}\n\t\t\n\t\toutputImage.resize(inputImage.getHeight(), inputImage.getWidth());\n\t\t\n\t\tint newY;\n\t\t\n\t\tfor (int i = 0; i < inputImage.getHeight(); i++)\n\t\t{\n\t\t\tfor (int j = 0; j < inputImage.getWidth(); j++)\n\t\t\t{\n\t\t\t\tnewY = inputImage.getWidth() - j - 1;\n\t\t\t\toutputImage.setRgb(i, newY, inputImage.getRgb(j, i));\n\t\t\t}\n\t\t}\n\t}", "public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }", "LocalMaterialData rotate();", "public MutableImage rotateRight() {\n return rotate(90);\n }", "public native MagickImage rotateImage(double degrees)\n\t\t\tthrows MagickException;", "@Override\n\tpublic void rotate() {\n\t}", "public static BufferedImage rotate90ToLeft(BufferedImage inputImage) {\n // The most of code is same as before\n int width = inputImage.getWidth();\n int height = inputImage.getHeight();\n BufferedImage returnImage = new BufferedImage(height, width,\n inputImage.getType());\n // We have to change the width and height because when you rotate the image\n // by 90 degree, the\n // width is height and height is width <img\n // src='http://forum.codecall.net/public/style_emoticons/<#EMO_DIR#>/smile.png'\n // class='bbc_emoticon' alt=':)' />\n\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n returnImage.setRGB(y, width - x - 1, inputImage.getRGB(x, y));\n }\n }\n return returnImage;\n\n }", "public MutableImage rotate(double degrees) {\n return apply(t -> {\n var w = image.getWidth();\n var h = image.getHeight();\n var rads = Math.toRadians(degrees);\n var sin = Math.abs(Math.sin(rads));\n var cos = Math.abs(Math.cos(rads));\n var newWidth = (int) Math.floor(w * cos + h * sin);\n var newHeight = (int) Math.floor(h * cos + w * sin);\n t.translate((newWidth - w) / 2d, (newHeight - h) / 2d);\n var x = w / 2;\n var y = h / 2;\n t.rotate(rads, x, y);\n });\n }", "public void rotateShip(){\n if (this.orientation == false){\n this.orientation = true;\n }else\n orientation = false;\n \n return;\n }", "public static Bitmap rotateBitmap(Bitmap newImage) throws IOException {\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n newImage.compress(Bitmap.CompressFormat.JPEG, 100, stream);\n InputStream inputStream = new ByteArrayInputStream(stream.toByteArray());\n try {\n ExifInterface exif = new ExifInterface(inputStream);\n int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) {\n Matrix matrix = new Matrix();\n matrix.postRotate(90);\n Bitmap rotatedBitmap = Bitmap.createBitmap(newImage, 0, 0, newImage.getWidth(), newImage.getHeight(), matrix, true);\n return rotatedBitmap;\n } else {\n return newImage;\n }\n } catch (Exception e) {\n Log.e(\"Error getting image: \", e.toString());\n }\n return newImage;\n }", "public abstract void rotate();", "public void rotateCCW(){\n rotState = (rotState + 3) % 4;\n for (int i = 0; i < tiles.length; ++i){\n tiles[i] = new Point(tiles[i].y , -tiles[i].x);\n }\n }", "public static void rotateCw(RasterImage inputImage, RasterImage outputImage)\n\t{\n\t\tassert outputImage.getSize() == inputImage.getSize();\n\t\t\n\t\t\n\t\tif (inputImage == outputImage)\n\t\t{\n\t\t\tinputImage = new RasterImage(inputImage);\n\t\t}\n\t\t\n\t\toutputImage.resize(inputImage.getHeight(), inputImage.getWidth());\n\t\t\n\t\tint newX;\n\t\t\n\t\tfor (int i = 0; i < inputImage.getHeight(); i++)\n\t\t{\n\t\t\tnewX = inputImage.getHeight() - i - 1;\n\t\t\t\n\t\t\tfor (int j = 0; j < inputImage.getWidth(); j++)\n\t\t\t{\n\t\t\t\toutputImage.setRgb(newX, j, inputImage.getRgb(j, i));\n\t\t\t}\n\t\t}\n\t}", "private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }", "public void rotateImage(View view) {\n\n View img = findViewById(ID_PlacementMode_BrickPreview_ImageView);\n\n float rotation;\n\n if (view.getId() == R.id.ID_PlacementMode_RotateLeft_Button) {\n rotation = img.getRotation() - (float) 90.0;\n }\n else { // rotate right\n rotation = img.getRotation() + (float) 90.0;\n }\n\n // set rotation in positive range in order to use map_angle_to_blockrotation correctly (Bugfix #414)\n if (rotation < 0) {\n rotation = rotation + 360f;\n }\n\n // set rotation of visualized brick preview\n img.setRotation(rotation);\n\n BlockRotation block_rotation = map_angle_to_blockrotation.get(((int)rotation)%360);\n\n // set rotation in block object\n objBrickPreview.setRotation(block_rotation);\n\n }", "public static BufferedImage rotate90ToRight(BufferedImage inputImage) {\n int width = inputImage.getWidth();\n int height = inputImage.getHeight();\n BufferedImage returnImage = new BufferedImage(height, width,\n inputImage.getType());\n\n for (int x = 0; x < width; x++) {\n for (int y = 0; y < height; y++) {\n returnImage.setRGB(height - y - 1, x, inputImage.getRGB(x, y));\n }\n }\n return returnImage;\n }", "void rotate() {\n startAnimation(allSubCubes(), Axis.Y, Direction.CLOCKWISE);\n rotateCubeSwap();\n }", "public Matrix rotate90DegreeInPlace() {\n\t\tfor(int layer = 0; layer < this.getWidth() / 2; ++layer) {\n\t\t\tint first = layer;\n\t\t\tint last = this.getWidth() - 1 - layer;\n\t\t\t\n\t\t\tfor(int i = first; i < last; ++i) {\n\t\t\t\tint offset = i - first;\n\t\t\t\t\n\t\t\t\t//save top\n\t\t\t\tdouble top = this.getElement(first, i);\n\t\t\t\t\n\t\t\t\t// left -> top\n\t\t\t\tthis.setElement(first, i, this.getElement(last - offset, first));\n\t\t\t\t// bottom -> left\n\t\t\t\tthis.setElement(last - offset, first, this.getElement(last, last - offset));\n\t\t\t\t// right -> bottom\n\t\t\t\tthis.setElement(last, last - offset, this.getElement(i, last));\n\t\t\t\t// top -> right\n\t\t\t\tthis.setElement(i, last, top);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}", "private Bitmap rotateBitmap(Bitmap bitmap){\n Matrix matrix = new Matrix();\n matrix.postRotate(90);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "public ImageIcon rotateImage(ImageIcon aicon){\n\t\tswitch(angle){\n\t\tcase 90: case -90: return rotateImage(aicon, angle);\n\t\tcase 180: return rotateImage(rotateImage(aicon, 90), 90);\n\t\tdefault: return aicon;\n\t\t}\n\t}", "private void rotate(int direction){\n\t\t//Gdx.app.debug(TAG, \"rotating, this.x: \" + this.x + \", this.y: \" + this.y);\n\t\tif (direction == 1 || direction == -1){\n\t\t\tthis.orientation = (this.orientation + (direction*-1) + 4) % 4;\n\t\t\t//this.orientation = (this.orientation + direction) % 4;\n\t\t} else{\n\t\t\tthrow new RuntimeException(\"Tile invalid direction\");\n\t\t}\n\t}", "public StateChangeMdiIcon rotate90() {\n defaultIcon.rotate90();\n statesMap.values().forEach(MdiIcon::rotate90);\n return this;\n }", "@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}", "void rotate () {\n final int rows = currentPiece.height;\n final int columns = currentPiece.width;\n int[][] rotated = new int[columns][rows];\n\n for (int i = 0; i < rows; i++)\n for (int j = 0; j < columns; j++)\n rotated[j][i] = currentPiece.blocks[i][columns - 1 - j];\n\n Piece rotatedPiece = new Piece(currentPiece.color, rotated);\n int kicks[][] = {\n {0, 0},\n {0, 1},\n {0, -1},\n //{0, -2},\n //{0, 2},\n {1, 0},\n //{-1, 0},\n {1, 1},\n //{-1, 1},\n {1, -1},\n //{-1, -1},\n };\n for (int kick[] : kicks) {\n if (canMove(currentRow + kick[0], currentColumn + kick[1], rotatedPiece)) {\n //System.out.println(\"Kicking \" + kick[0] + \", \" + kick[1]);\n currentPiece = rotatedPiece;\n currentRow += kick[0];\n currentColumn += kick[1];\n updateView();\n break;\n }\n }\n }", "public void xRotate() {\n\t\t\n\t}", "@Override\r\n\tpublic void rotar() {\n\r\n\t}", "public double getRotation();", "private Bitmap rotateImage(final String path) {\n\n Bitmap b = decodeFileFromPath(path);\n\n try {\n ExifInterface ei = new ExifInterface(path);\n int orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n break;\n default:\n b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);\n //b.copyPixelsFromBuffer(ByteBuffer.)\n break;\n }\n } catch (Throwable e) {\n e.printStackTrace();\n }\n return b;\n }", "public Matrix getCurrentRotation() throws ManipulatorException;", "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "public void draw()\n {\n imageView.setRotate(teta);\n imageView.relocate(super.getX(),super.getY());\n }", "public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}", "public Direction rotate90() {\n return values()[r90index];\n }", "protected void rotateImage(int degrees) {\n mCropImageView.rotateImage(degrees);\n }", "public void Rotation(int i) {\n mRender.Rotation(i);\n }", "public void rotate() {\n\t\tclearPiece();\n\t\trotateFirstBlock();\n\t\trotateSecondBlock();\n\t\trotateFourthBlock();\n\t\tsetPiece();\n\t\trepaint();\n\t}", "public boolean hasRotate() { return hasRotate; }", "Mat rotateMatCW(Mat src ) {\n Mat rotationMatrix = Imgproc.getRotationMatrix2D(new Point(src.cols()/2,src.rows()/2),270,1);\n\n //Rotating the given image\n Imgproc.warpAffine(src, result,rotationMatrix, new Size(src.cols(), src.rows()));\n return result;\n }", "private Bitmap rotateBitmapOrientation(String photoFilePath) {\n BitmapFactory.Options bounds = new BitmapFactory.Options();\n bounds.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(photoFilePath, bounds);\n BitmapFactory.Options opts = new BitmapFactory.Options();\n Bitmap bm = BitmapFactory.decodeFile(photoFilePath, opts);\n // Read EXIF Data\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(photoFilePath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n int rotationAngle = 0;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n // Rotate Bitmap\n Matrix matrix = new Matrix();\n matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, bounds.outWidth, bounds.outHeight, matrix, true);\n // Return result\n return rotatedBitmap;\n }", "public Rotation(){\n\t\timageData = new int[][] {{1,2,3,4}, {5,6,7,8},{9, 10, 11, 12},{13, 14, 15 ,16}};\n\t\tn = 4;\n\t}", "public static BufferedImage rotateCw( BufferedImage img ) {\n int width = img.getWidth();\n int height = img.getHeight();\n BufferedImage newImage = new BufferedImage( height, width, img.getType());\n\n for( int i=0 ; i < width ; i++ )\n for( int j=0 ; j < height ; j++ )\n newImage.setRGB( height-1-j, i, img.getRGB(i,j) );\n \n return newImage;\n }", "DMatrix3C getRotation();", "public AbstractJmodelAction getRotate() {\r\n \r\n \t\treturn actionRotate;\r\n \t}", "public void rotate() \n {\n \tint[] rotatedState = new int[state.length];\n \tfor (int i = 0; i < state.length; ++i)\n \t\trotatedState[(i+7)%14] = state[i];\n \tstate = rotatedState;\n }", "public void calculateAngleAndRotate(){\n\t\tdouble cumarea = 0;\n\t\tdouble sina = 0;\n\t\tdouble cosa = 0;\n\t\tdouble area, angle;\n\t\tfor (int n = 0; n < rt.size();n++) {\n\t\t\tarea = rt.getValueAsDouble(rt.getColumnIndex(\"Area\"),n);\n\t\t\tangle = 2*rt.getValueAsDouble(rt.getColumnIndex(\"Angle\"),n);\n\t\t\tsina = sina + area*Math.sin(angle*Math.PI/180);\n\t\t\tcosa = cosa + area*Math.cos(angle*Math.PI/180);\n\t\t\tcumarea = cumarea+area;\n\t\t}\n\t\taverageangle = Math.abs(0.5*(180/Math.PI)*Math.atan2(sina/cumarea,cosa/cumarea)); // this is the area weighted average angle\n\t\t// rotate the data \n\t\tIJ.run(ActiveImage,\"Select All\",\"\");\n\t\tActiveImageConverter.convertToGray32();\n\t\tIJ.run(ActiveImage,\"Macro...\", \"code=[v= x*sin(PI/180*\"+averageangle+\")+y*cos(PI/180*\"+averageangle+\")]\");\n\t\treturn;\n\t}", "private static Bitmap fixImageRotation (Bitmap bitmap, String rawImageFilePath) throws IOException\r\n {\r\n /* Evaluate if we need to rotate the bitmap and replace the old bitmap. */\r\n float angle = getRawImageRotation(rawImageFilePath);\r\n if ( bitmap != null\r\n && angle != 0)\r\n {\r\n Matrix matrix = new Matrix();\r\n matrix.postRotate(angle);\r\n\r\n Bitmap oldBitmap = bitmap;\r\n\r\n bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),\r\n bitmap.getHeight(), matrix, true);\r\n\r\n oldBitmap.recycle();\r\n }\r\n return bitmap;\r\n }", "private void rotateView(Canvas paramCanvas) {\n float degree = mDistance / 3f;\n paramCanvas.rotate(-degree, this.getWidth() / 2, this.getHeight() / 2);\n paramCanvas.drawBitmap(mBmp, this.getWidth() / 2 - mBmp.getWidth() / 2, this.getHeight()\n / 2 - mBmp.getHeight() / 2, mTxtPaint);\n }", "void rotatePolygon() {\n\t\tfor (int i = 0; i < amount; i++)\n\t\t\tpoint[i].rotate();\n\t}", "@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\tint hieght=this.getHeight();\n\t\tint width=this.getWidth();\n\t\tcanvas.rotate(direction, width/2,hieght/2);\n\t\t\n\t\tsuper.onDraw(canvas);\n\t\t\n\t\t\n\t}", "public void rotate(boolean clockwise) \n\t{\n\t\tcircular_shift(connections, clockwise);\n\t\torientation = next(orientation, clockwise);\n\t}", "int[][] rotate(int[][] image) {\n if(image.length != image[0].length) {\n throw new IllegalArgumentException();\n }\n // can assume the image is square matrix.\n int dimension = image.length;\n for(int i=0;i< dimension; i++) {\n for(int j=i;j<dimension;j++) {\n int temp = image[j][i];\n image[j][i] = image[i][j];\n image[i][j] = temp;\n }\n }\n return image;\n }", "public void rotateY90() {\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tint x_ = vertexX[v];\n\t\t\tvertexX[v] = vertexZ[v];\n\t\t\tvertexZ[v] = -x_;\n\t\t}\n\t}", "@Override\r\n\tpublic void rotateRight() {\n\t\tsetDirection((this.getDirection() + 1) % 4);\r\n\t}", "void applyRotationMatrix() {\n for (int i = 0; i < coors.length; i++) {\n for (int j = 0; j < coors[i].length; j++) {\n newCoors[i][j] = coors[i][0] * R[j][0] + coors[i][1] * R[j][1] + coors[i][2] * R[j][2];\n }\n // add perspective\n float scale = map(Math.abs(newCoors[i][2]), 0, (float) (halfSize * Math.sqrt(3)), 1, 1.5f);\n if (newCoors[i][2] < 0) {\n scale = 2f - scale;\n }\n for (int j = 0; j < 2; j++) {\n newCoors[i][j] *= scale;\n }\n }\n // to R2\n // just dont use Z\n setPathAndAlpha();\n }", "void rotateInv() {\n startAnimation(allSubCubes(), Axis.Y, Direction.ANTICLOCKWISE);\n rotateCubeSwap();\n rotateCubeSwap();\n rotateCubeSwap();\n }", "private void rotate(final MouseEvent event) {\r\n\r\n\t\t// reset transform3D\r\n\t\tthis.rotation.rotY(0);\r\n\r\n\t\t// rotate around y-axis\r\n\t\tif (super.x_last - event.getPoint().x > 0) {\r\n\t\t\t// rotate leftwards\r\n\t\t\tthis.rotation.rotY(this.angle);\r\n\t\t} else {\r\n\t\t\t// rotate rightwards\r\n\t\t\tthis.rotation.rotY(-this.angle);\r\n\t\t}\r\n\r\n\t\t// apply rotation\r\n\t\tsuper.transformGroup.getTransform(this.transform);\r\n\t\tthis.transform.mul(this.rotation);\r\n\t\tsuper.transformGroup.setTransform(this.transform);\r\n\t}", "private void computeRotate() {\n time = Math.min(\n duration,\n time + MaterialWeatherView.WeatherAnimationImplementor.REFRESH_INTERVAL);\n rotationNow = (rotationEnd - rotationStart) * (1 - Math.pow(1 - 1.0 * time / duration, 2 * FACTOR))\n + rotationStart;\n if (time == duration) {\n // finish.\n rotating = false;\n }\n }", "private void rotateSeaperch(ImageView imageView, float x, float y, float z){\n\t\timageView.setRotationX(x);\n\t\timageView.setRotation(y);\n\t\timageView.setRotationY(z);\n\t}", "private Bitmap rotateImage(Bitmap source, float angle) {\n Matrix matrix = new Matrix();\n matrix.postRotate(angle);\n return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(),\n matrix, true);\n }", "public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }", "public static void rotate(int[][] matrix) {\n int numLayers = matrix.length / 2;\n\n for (int i = 0; i < numLayers; i++) {\n int beginningPixel = i;\n int lastPixel = matrix.length - i - 1;\n // don't swap the last pixel because it was already swapped as the first pixel of another row\n for (int j = beginningPixel; j < lastPixel; j++) {\n int top = matrix[i][j];\n // left -> top\n matrix[i][j] = matrix[matrix.length - j - 1][i];\n\n // bottom -> left\n matrix[matrix.length - j - 1][i] = matrix[matrix.length - i - 1][matrix.length - j - 1];\n\n // right -> bottom\n matrix[matrix.length - i - 1][matrix.length - j - 1] = matrix[j][matrix.length - i - 1];\n\n // top -> right\n matrix[j][matrix.length - i - 1] = top;\n }\n }\n }", "public StateChangeMdiIcon rotate315() {\n defaultIcon.rotate315();\n statesMap.values().forEach(MdiIcon::rotate315);\n return this;\n }", "private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }", "static PT RotateCCW90(PT p) {\r\n\t\treturn new PT(-p.y, p.x);\r\n\t}", "@Override\r\n\tpublic void rotateLeft() {\n\t\tsetDirection((this.getDirection() + 3) % 4);\r\n\t}", "public Bitmap rotateBitmapOrientation(String file) {\n\t BitmapFactory.Options bounds = new BitmapFactory.Options();\n\t bounds.inJustDecodeBounds = true;\n\t BitmapFactory.decodeFile(file, bounds);\n\t BitmapFactory.Options opts = new BitmapFactory.Options();\n\t Bitmap bm = BitmapFactory.decodeFile(file, opts);\n\t CameraPreview cp = (CameraPreview) findViewById(R.id.camera_preview);\n\t bm = Bitmap.createScaledBitmap(bm, cp.getWidth(), cp.getHeight(), true);\n\t // Read EXIF Data\n\t ExifInterface exif;\n\t\ttry {\n\t\t\texif = new ExifInterface(file);\n\t\t String orientString = exif.getAttribute(ExifInterface.TAG_ORIENTATION);\n\t\t int orientation = orientString != null ? Integer.parseInt(orientString) : ExifInterface.ORIENTATION_NORMAL;\n\t\t int rotationAngle = 0;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_90) rotationAngle = 90;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_180) rotationAngle = 180;\n\t\t if (orientation == ExifInterface.ORIENTATION_ROTATE_270) rotationAngle = 270;\n\t\t // Rotate Bitmap\n\t\t Matrix matrix = new Matrix();\n\t\t matrix.setRotate(rotationAngle, (float) bm.getWidth() / 2, (float) bm.getHeight() / 2);\n\t\t Bitmap rotatedBitmap = Bitmap.createBitmap(bm, 0, 0, cp.getWidth(), cp.getHeight(), matrix, true);\n\t\t // Return result\n\t\t return rotatedBitmap;\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public float getRotation()\n {\n return rotation;\n }", "public abstract void rotateLeft();", "private Bitmap flipImage(byte[] input, FileOutputStream fos){\n\n\t\t\t\tMatrix rotate_matrix = new Matrix();\n\t\t\t\trotate_matrix.preScale(-1.0f, 1.0f);\n\t\t\t\tBitmapFactory bmf = new BitmapFactory();\n\t\t\t\tBitmap raw_bitmap = bmf.decodeByteArray(input, 0, input.length);\n\t\t\t\tBitmap result = Bitmap.createBitmap(raw_bitmap, 0, 0, raw_bitmap.getWidth(), raw_bitmap.getHeight(), rotate_matrix, true);\n\t\t\t\treturn result;\n\t\t\t\t/*\n\t\t\t\tresult.compress(Bitmap.CompressFormat.JPEG, 90, fos);\n\t\t\t\ttry {\n\t\t\t\t\tfos.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}", "public Piece rotate() {\n\t\tif (!isRotatable) {\n\t\t\treturn this;\n\t\t}\n\t\tint m = shape.length;\n\t\tint n = shape[0].length;\n\t\tint[][] newPiece = new int[n][m];\n\t\tfor (int r = 0; r < m; r++) {\n\t for (int c = 0; c < n; c++) {\n\t newPiece[c][m-1-r] = shape[r][c];\n\t }\n\t\t}\n\t\treturn new Piece(value, name, newPiece, isFlippable, isRotatable);\n\t}", "public StateChangeMdiIcon rotate270() {\n defaultIcon.rotate270();\n statesMap.values().forEach(MdiIcon::rotate270);\n return this;\n }", "static Bitmap rotate(Bitmap bitmap, float degrees) {\n Matrix matrix = new Matrix();\n matrix.postRotate(degrees);\n return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n }", "public void rotate(float angle);", "void rotateRotator(int offset) {\n final Map<String, String> rotatorEncodeNew = new HashMap<>();\n String newEncode;\n int j;\n for (int i = 65; i <= 90; i++) {\n j = i + offset > 90 ? (i + offset) - 26 : i + offset;\n j = j < 65 ? j + 26 : j;\n rotatorEncodeNew.put(Character.toString((char) i), this.rotatorEncode.get(Character.toString((char) j)));\n }\n this.rotatorEncode.clear();\n this.rotatorEncode.putAll(rotatorEncodeNew);\n this.rotatorDecode.putAll(this.rotatorEncode\n .entrySet()\n .stream()\n .collect((Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey))));\n }", "void setImageProperty() {\n\t\t imgView.setImageResource(R.drawable.weathericon);\n\t\tMatrix matrix = new Matrix();\n\t\trotate += 30;\n\t\tif (rotate == 360) {\n\t\t\trotate = 0;\n\t\t}\n\t\tfloat centerX = imgView.getWidth() / 2;\n\t\tfloat centerY = imgView.getHeight() / 2;\n\t\tmatrix.setRotate(rotate, centerX, centerY);\n\t\t//matrix.setTranslate(10, 20);\n\t\timgView.setImageMatrix(matrix); \n\t\t//ScaleType type = ScaleType.\n\t\t\n\t\t//imgView.setScaleType(scaleType);\n\t \n\t}", "public void setRotate() {\r\n\t\tint npoints = xpoints.length;\r\n\t\tdouble[] tempxpoints = new double[xpoints.length];\r\n\t\tdouble[] tempypoints = new double[xpoints.length];\r\n\t\tdouble radians = Math.toRadians(angle%360);\r\n\t\tdouble y = pivotY;\r\n\t\tdouble x = pivotX;\r\n\t\tfor(int i = 0; i<xpoints.length; i++) {\r\n\t\t\ttempxpoints[i] = (Math.cos(radians)*(xpoints[i]-x)-Math.sin(radians)*(ypoints[i]-y)+x);\r\n\t\t\ttempypoints[i] = (Math.sin(radians)*(xpoints[i]-x)+Math.cos(radians)*(ypoints[i]-y)+y);\r\n\t\t}\r\n\t\txpoints = tempxpoints;\r\n\t\typoints = tempypoints;\r\n\t\tangle = 0;\r\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\timgfinalImage.setImageBitmap(rotateImage(RateItScreen.bmp, \"Left\"));\r\n\r\n\t\t\t}", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\t\n\t\n\t\tint px = getMeasuredWidth();\n\t\tint py =this.getMeasuredHeight();\n\t\tcanvas.rotate(current_degrees, px/2, py/2);\n\t\tsuper.onDraw(canvas);\n\t}", "public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}", "void rotatePiece() {\n boolean temp = this.left;\n boolean temp2 = this.up;\n boolean temp3 = this.right;\n boolean temp4 = this.down;\n this.left = temp4;\n this.up = temp;\n this.right = temp2;\n this.down = temp3;\n }", "private KeyValue rotatingText() {\r\n\t\tdouble val = b_MyPane.getText().getRotate() + 40;\r\n\t\tb_MyPane.getText().setRotate(val);\r\n\t\treturn null;\r\n\t}", "public StateChangeMdiIcon rotate180() {\n defaultIcon.rotate180();\n statesMap.values().forEach(MdiIcon::rotate180);\n return this;\n }", "private Bitmap fixOrientation(Bitmap bitmap) {\n if (bitmap == null) {\n return null;\n }\n\n ExifInterface exif = null;\n try {\n exif = new ExifInterface(currentPhotoPath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);\n\n Matrix matrix = new Matrix();\n switch (orientation) {\n case ExifInterface.ORIENTATION_ROTATE_90:\n matrix.postRotate(90);\n break;\n case ExifInterface.ORIENTATION_ROTATE_180:\n matrix.postRotate(180);\n break;\n case ExifInterface.ORIENTATION_ROTATE_270:\n matrix.postRotate(270);\n break;\n default:\n break;\n }\n bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);\n return bitmap;\n }", "private static void rotate(int[][] matrix) {\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = i; j < matrix[0].length; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[j][i];//转置,第i行变成第i列\r\n\t\t\t\tmatrix[j][i] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = 0; j < matrix.length / 2; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[i][matrix.length - 1 - j];\r\n\t\t\t\tmatrix[i][matrix.length - 1 - j] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public StateChangeMdiIcon rotate45() {\n defaultIcon.rotate45();\n statesMap.values().forEach(MdiIcon::rotate45);\n return this;\n }", "public float getRotation() {\n return this.rotation;\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\timgfinalImage.setImageBitmap(rotateImage(RateItScreen.bmp, \"Right\"));\r\n\t\t\t}" ]
[ "0.68205875", "0.6582094", "0.65624326", "0.65607566", "0.6545998", "0.65011865", "0.6500177", "0.6475113", "0.64222676", "0.64119554", "0.6402128", "0.63884026", "0.637564", "0.6359911", "0.63278556", "0.6278411", "0.62656885", "0.6251913", "0.6248097", "0.6236647", "0.61857456", "0.61525226", "0.61180717", "0.610192", "0.6078559", "0.6052513", "0.60136336", "0.6010928", "0.5993336", "0.59877807", "0.5977029", "0.5970341", "0.59687454", "0.59319943", "0.59166175", "0.59097856", "0.5883309", "0.58690435", "0.5849117", "0.58260083", "0.5793644", "0.57880366", "0.57701963", "0.576289", "0.5716377", "0.56975204", "0.5675036", "0.5671464", "0.56576353", "0.56545675", "0.56498677", "0.5648869", "0.56448114", "0.56436384", "0.56435806", "0.5634258", "0.56303436", "0.56277955", "0.56250626", "0.56135976", "0.56018287", "0.5600342", "0.5537355", "0.5523952", "0.5507696", "0.5506625", "0.5465599", "0.5461472", "0.5457389", "0.5454476", "0.5444128", "0.5426391", "0.542216", "0.54119945", "0.5409108", "0.5406515", "0.53892547", "0.53878844", "0.5380551", "0.5373249", "0.5372474", "0.53673327", "0.5360501", "0.53595155", "0.53399074", "0.53391653", "0.53352195", "0.5330473", "0.533031", "0.5329654", "0.5328803", "0.5328023", "0.5321587", "0.5321275", "0.532071", "0.5310109", "0.53062296", "0.5305791", "0.53052753", "0.53045624" ]
0.68228906
0
Drawing Functions TODO Create Rectangle/Shape2d Versions
public void clear(Colorc color) { if (this.data != null) this.data.forEach(c -> c.set(color)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Shapes draw ( );", "public void draw(){\n\t\t int startRX = 100;\r\n\t\t int startRY = 100;\r\n\t\t int widthR = 300;\r\n\t\t int hightR = 300;\r\n\t\t \r\n\t\t \r\n\t\t // start points on Rectangle, from the startRX and startRY\r\n\t\t int x1 = 0;\r\n\t\t int y1 = 100;\r\n\t\t int x2 = 200;\r\n\t\t int y2 = hightR;\r\n\t\t \r\n //direction L - false or R - true\r\n\t\t \r\n\t\t boolean direction = true;\r\n\t\t \t\r\n\t\t\r\n\t\t //size of shape\r\n\t\t int dotD = 15;\r\n\t\t //distance between shapes\r\n\t int distance = 30;\r\n\t\t \r\n\t rect(startRX, startRY, widthR, hightR);\r\n\t \r\n\t drawStripesInRectangle ( startRX, startRY, widthR, hightR,\r\n\t \t\t x1, y1, x2, y2, dotD, distance, direction) ;\r\n\t\t \r\n\t\t super.draw();\r\n\t\t}", "public void drawShape(Shape shape);", "interface DrawingShape {\n\t\tboolean contains(Graphics2D g2, double x, double y);\n\t\tvoid draw(Graphics2D g2);\n\t\tRectangle2D getBounds(Graphics2D g2);\n\t}", "void createRectangles();", "interface DrawingShape {\n\t\tboolean contains(Graphics2D g2, double x, double y);\n\n\t\tvoid draw(Graphics2D g2);\n\n\t\tRectangle2D getBounds(Graphics2D g2);\n\t}", "public void strokeRectangle(RectangleShape rectangle);", "void draw(IViewShapes shape);", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"Here is the method to draw a Rectangle\");\n\t}", "public void interface1(){\n noStroke();\n fill(10,100);//light gray\n rect(0,60,600,590);\n fill(220);//gray\n noStroke();\n beginShape();\n vertex(365,40);\n vertex(600,40);\n vertex(600,80);\n vertex(365,80);\n vertex(345,60);\n endShape(CLOSE);\n fill(19,70,100,100);//dark blue\n rect(0,110,600,215);\n rect(0,380,600,215);\n}", "abstract void draw(Graphics g, int xoff, int yoff,\n int x, int y, int width, int height);", "public void draw(Graphics2D g, Dimension area);", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"You are drawing a RECTANGLE\");\n\t}", "public void strokeRectangle(int x, int y, int width, int height);", "protected abstract void draw();", "public void drawRect(int x, int y, int width, int height);", "public abstract void draw(Graphics2D graphics);", "public abstract void draw( Graphics2D gtx );", "public void drawRect(int x, int y, int width, int height, int color);", "void draw (Graphics2D g);", "public void fillRectangle(RectangleShape rectangle);", "void drawShape(Shape s) {\n }", "abstract void draw();", "abstract void draw();", "void drawAt(DrawSurface d, Rectangle rect);", "abstract public void draw(Graphics2D g);", "public void draw();", "public void draw();", "public void draw();", "public abstract void draw( );", "private void drawRectangle(GraphicsContext gc, double x, double y) {\r\n GraphicsContext gc2 = myCanvas.getGraphicsContext2D();\r\n gc2.setFill(randomColor());\r\n gc2.fillRect(x - 20, y - 20, 40, 40);\r\n }", "public void draw()\n {\n Rectangle hatbox = new Rectangle(x, y, 20, 20);\n hatbox.fill();\n Rectangle brim = new Rectangle(x-10, y+20, 40, 0);\n brim.draw();\n Ellipse circle = new Ellipse (x, y+20, 20, 20);\n circle.draw();\n Ellipse circle2 = new Ellipse (x-10, y+40, 40, 40);\n circle2.draw();\n Ellipse circle3 = new Ellipse (x-20, y+80, 60, 60);\n circle3.draw();\n \n }", "public abstract void draw();", "public abstract void draw();", "public abstract void draw();", "void render(Rectangle borders);", "@Override\n\tpublic void draw(Graphics2D g, int x, int y,int width,int height) {\n\n\t}", "public static void drawRectangle(int x, int y,int width, int height){\n for (int i = 0; i < y; i++) {\n System.out.println();\n }\n for (int i = 1; i < width; i++) {\n System.out.print(\"*\");\n }\n System.out.println(\"*\");\n for (int i = 0; i < height; i++) {\n System.out.print(\"*\");\n for (int j = 2; j < width; j++) {\n System.out.print(\" \");\n }\n System.out.println(\"*\");\n }\n for (int i = 0; i < width; i++) {\n System.out.print(\"*\");\n }\n\n }", "public static void mainDraw(Graphics graphics){\n\n int centerX = WIDTH / 3 ;\n int centerY = HEIGHT / 3;\n int rectA2 = 20 / 2;\n\n graphics.setColor(Color.GREEN);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH /5 ;\n centerY = HEIGHT / 2;\n rectA2 = 40 / 2;\n\n graphics.setColor(Color.YELLOW);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH / 2 ;\n centerY = HEIGHT / 6;\n rectA2 = 70 / 2;\n\n graphics.setColor(Color.BLUE);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n centerX = WIDTH / 2 ;\n centerY = HEIGHT / 2;\n rectA2 = 100 / 2;\n\n graphics.setColor(Color.RED);\n graphics.drawRect(centerX - rectA2, centerY - rectA2, rectA2 * 2, rectA2 * 2);\n\n }", "public interface DrawingObject {\n\t// interface: blueprints but doesn't tell you how to do it\n\n\t/**\n\t * Draw the object.\n\t * \n\t * @param g\n\t */\n\tpublic void draw(Graphics g);\n\n\t/**\n\t * Called to start drawing a new object.\n\t * \n\t * @param p\n\t */\n\tpublic void start(Point p);\n\n\t/**\n\t * Called repeatedly while dragging a new object out to size (typically\n\t * called from within a mouseDragged() ).\n\t * \n\t * @param p\n\t */\n\tpublic void drag(Point p);\n\n\t/**\n\t * Called to move an object. Often called repeatedly inside a\n\t * mouseDragged().\n\t * \n\t * @param p\n\t */\n\tpublic void move(Point p);\n\n\t/**\n\t * Does the math to determine the number/position of points of star\n\t */\n\tpublic void doMath();\n\n\t/**\n\t * Set the bounding rectangle.\n\t * \n\t * @param b\n\t */\n\tpublic void setBounds(Rectangle b);\n\n\t/**\n\t * Determines if the point clicked is contained by the object.\n\t * \n\t * @param p\n\t * @return\n\t */\n\tpublic boolean contains(Point p);\n\n\t/**\n\t * Called to set the color of a shape\n\t */\n\tpublic void setColor(Color c);\n\n\t/**\n\t * Called to get the color of a shape\n\t * \n\t * @return\n\t */\n\tpublic Color getColor();\n}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\tSystem.out.println(\"Draw all shapes\");\r\n\t\t\r\n\t}", "@Override\n public void draw(GraphicsContext gc) {\n gc.setFill(getFillColor());\n gc.setStroke(getStrokeColor());\n gc.setLineWidth(getStrokeWidth());\n gc.fillRect(getX1(), getY1(), getX2() - getX1(), getX2() - getX1());\n gc.strokeRect(getX1(), getY1(), getX2() - getX1(), getX2() - getX1());\n }", "void draw();", "public void Draw(Graphics2D g2d, Point mousePosition)\n {\n \n }", "public void drawArea(Graphics2D g, int width, int height, double minX,\n double minY, double maxX, double maxY) {\n upperX = maxX;\n lowerX = minX;\n\n upperY = maxY;\n lowerY = minY;\n //debug, drawLine bounds\n// g.drawLine(XOffSet, YOffSet, width, YOffSet);\n// g.drawLine(XOffSet, height, width, height); //X\n//\n// g.drawLine(XOffSet, YOffSet, XOffSet, height);\n// g.drawLine(width, YOffSet, width, height); //Y\n\n double Xscale = GetXScale(width);\n double Yscale = GetYScale(height);\n int centerX = getCenterX(width);\n int centerY = getCenterY(height);\n\n //drawGrid(g, width, height, minX, minY, maxX, maxY);\n\n //create a polygon for every area between two zeros\n g.setColor(LineColor);\n //ArrayList<Polygon> p = new ArrayList<>();\n Polygon p = new Polygon();\n //p.add(new Polygon());\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,\n Opacity));\n //p.get(0).addPoint(XOffSet, getCenterY(height));\n p.addPoint(XOffSet, getCenterY(height));\n for (int i = 0; i <= PointArray.length - 2; i += 2) {\n double x = ((PointArray[i] * Xscale) + centerX);\n double y = ((centerY) - (PointArray[i + 1]) * Yscale);\n if (x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {\n continue;\n }\n if (y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY) {\n y = height - YOffSet;\n }\n //p.get(p.size() - 1).addPoint((int) x, (int) y);\n p.addPoint((int) x, (int) y);\n }\n //p.get(p.size() - 1).addPoint(width, getCenterY(height));\n p.addPoint(width, getCenterY(height));\n //for (int i = 0; i <= p.size() - 1; i++) {\n g.fill(p);//.get(i));\n //}\n g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1));\n drawLine(g, width, height, minX, minY, maxX, maxY);\n }", "public void drawRect(float x, float y, float width, float height) {\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x1, y1, 0F, 0F,\n x2, y1, 1F, 0F,\n x2, y2, 1F, 1F,\n x1, y2, 0F, 1F\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }", "public void draw() {\n \n }", "@Override\n public void draw(GraphicsContext gc, int sides){}", "public abstract void drawFill();", "void draw(GraphicsContext context);", "public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}", "@Override\n public void draw(Graphics graphics){\n graphics.fillRect(referencePoint.getX() + width / 3, referencePoint.getY() + height / 3, width / 3, height / 3);\n }", "void drawInterior(DrawContext dc, Object shape);", "void draw() {\n\t\tSystem.out.println(\"Drawing the Rectange...\");\n\t\t}", "private void drawSquare(Graphics g, int x, int y, \n Tetrominoe shape) {\n Color colors[] = {\n new Color(0, 0, 0), new Color(204, 102, 102),\n new Color(102, 204, 102), new Color(102, 102, 204),\n new Color(204, 204, 102), new Color(204, 102, 204),\n new Color(102, 204, 204), new Color(218, 170, 0)\n };\n//left and top sides are brighter, bottom and right sides to look 3d\n Color color = colors[shape.ordinal()];\n\n g.setColor(color);\n g.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2);\n\n g.setColor(color.brighter());\n g.drawLine(x, y + squareHeight() - 1, x, y);\n g.drawLine(x, y, x + squareWidth() - 1, y);\n\n g.setColor(color.darker());\n g.drawLine(x + 1, y + squareHeight() - 1,\n x + squareWidth() - 1, y + squareHeight() - 1);\n g.drawLine(x + squareWidth() - 1, y + squareHeight() - 1,\n x + squareWidth() - 1, y + 1);\n\n }", "private void render() {\n if (drawingArea != null) {\n //get graphics of the image where coordinate and function will be drawn\n Graphics g = drawingArea.getGraphics();\n\n //draw the x-axis and y-axis\n g.drawLine(0, originY, width, originY);\n g.drawLine(originX, 0, originX, height);\n\n //print numbers on the x-axis and y-axis, based on the scale\n for (int i = 0; i < lengthX; i++) {\n g.drawString(Integer.toString(i), (int) (originX + (i * scaleX)), originY);\n g.drawString(Integer.toString(-1 * i), (int) (originX + (-i * scaleX)), originY);\n }\n for (int i = 0; i < lengthY; i++) {\n g.drawString(Integer.toString(-1 * i), originX, (int) (originY + (i * scaleY)));\n g.drawString(Integer.toString(i), originX, (int) (originY + (-i * scaleY)));\n }\n\n // draw the lines\n for (int i = 0; i < points1.size() - 1; i++) {\n g.setColor(Color.BLACK);\n g.drawLine((int) (originX + points1.get(i).x * scaleX), (int) (originY - points1.get(i).y * scaleY),\n (int) (originX + points1.get(i + 1).x * scaleX), (int) (originY - points1.get(i + 1).y * scaleY));\n g.setColor(Color.RED);\n g.drawLine((int) (originX + points2.get(i).x * scaleX), (int) (originY - points2.get(i).y * scaleY),\n (int) (originX + points2.get(i + 1).x * scaleX), (int) (originY - points2.get(i + 1).y * scaleY));\n }\n }\n }", "public static void drawRectangle(double width, double height) {\n gl.glPushMatrix();\n gl.glScaled(width, height, 1);\n gl.glBegin(GL.GL_TRIANGLE_FAN);\n gl.glVertex3d(-0.5, -0.5, 0);\n gl.glVertex3d(0.5, -0.5, 0);\n gl.glVertex3d(0.5, 0.5, 0);\n gl.glVertex3d(-0.5, 0.5, 0);\n gl.glEnd();\n gl.glPopMatrix();\n }", "public void draw() {\n }", "@Override\n\tpublic void draw(Graphics2D g2d) {\n\t\t\n\t}", "public abstract void draw(Object o);", "public static void drawPicture1(Graphics2D g2) {\r\n\r\n\tRodent r1 = new Rodent(100,250,50);\r\n\tg2.setColor(Color.CYAN); g2.draw(r1);\r\n\t\r\n\t// Make a black rodent that's half the size, \r\n\t// and moved over 150 pixels in x direction\r\n\r\n\tShape r2 = ShapeTransforms.scaledCopyOfLL(r1,0.5,0.5);\r\n\tr2 = ShapeTransforms.translatedCopyOf(r2,150,0);\r\n\tg2.setColor(Color.BLACK); g2.draw(r2);\r\n\t\r\n\t// Here's a rodent that's 4x as big (2x the original)\r\n\t// and moved over 150 more pixels to right.\r\n\tr2 = ShapeTransforms.scaledCopyOfLL(r2,4,4);\r\n\tr2 = ShapeTransforms.translatedCopyOf(r2,150,0);\r\n\t\r\n\t// We'll draw this with a thicker stroke\r\n\tStroke thick = new BasicStroke (4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); \r\n\t\r\n\t// for hex colors, see (e.g.) http://en.wikipedia.org/wiki/List_of_colors\r\n\t// #002FA7 is \"International Klein Blue\" according to Wikipedia\r\n\t// In HTML we use #, but in Java (and C/C++) its 0x\r\n\t\r\n\tStroke orig=g2.getStroke();\r\n\tg2.setStroke(thick);\r\n\tg2.setColor(new Color(0x002FA7)); \r\n\tg2.draw(r2); \r\n\t\r\n\t// Draw two Rabbits\r\n\t\r\n\tRabbit ra1 = new Rabbit(50,350,40);\r\n\tRabbit ra2 = new Rabbit(200,350,200);\r\n\t\r\n\tg2.draw(ra1);\r\n\tg2.setColor(new Color(0x8F00FF)); g2.draw(ra2);\r\n\t\r\n\t// @@@ FINALLY, SIGN AND LABEL YOUR DRAWING\r\n\t\r\n\tg2.setStroke(orig);\r\n\tg2.setColor(Color.BLACK); \r\n\tg2.drawString(\"A few rabbits by Josephine Vo\", 20,20);\r\n }", "public void draw(Graphics2D g2)\n {\n Rectangle r1 = new Rectangle( xTopLeft, yTopLeft, screenWidth, screenHeight);\n \n Rectangle l1 = new Rectangle( xTopLeft + (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l2 = new Rectangle( xTopLeft + 3 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l3 = new Rectangle( xTopLeft + 5 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l4 = new Rectangle( xTopLeft + 7 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l5 = new Rectangle( xTopLeft + 9 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l6 = new Rectangle( xTopLeft + 11 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l7 = new Rectangle( xTopLeft + 13 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l8 = new Rectangle( xTopLeft + 15 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n Rectangle l9 = new Rectangle( xTopLeft + 17 * (screenWidth/19), yTopLeft + (screenHeight/2), (screenWidth/19), (screenHeight/10));\n \n g2.setColor(Color.BLACK);\n \n g2.draw(r1);\n g2.fill(r1);\n \n g2.setColor(Color.YELLOW);\n \n g2.draw(l1);\n g2.fill(l1);\n g2.draw(l2);\n g2.fill(l2);\n g2.draw(l3);\n g2.fill(l3);\n g2.draw(l3);\n g2.fill(l3);\n g2.draw(l4);\n g2.fill(l4);\n g2.draw(l5);\n g2.fill(l5);\n g2.draw(l6);\n g2.fill(l6);\n g2.draw(l7);\n g2.fill(l7);\n g2.draw(l8);\n g2.fill(l8);\n g2.draw(l9);\n g2.fill(l9);\n }", "public abstract Color draw(Graphics2D g2d, String bin, int x, int y);", "public void drawAll(){\n for (Triangle triangle : triangles) {\n triangle.draw();\n }\n for (Circle circle : circles) {\n circle.draw();\n }\n for(Rectangle rectangle : rectangles){\n rectangle.draw();\n }\n }", "public void draw() {\n\n }", "@Test\r\n public void testDrawingDoubler() {\r\n System.out.println(\"testDrawingDoubler\");\r\n ad = new AreaDoubler();\r\n d.accept(ad);\r\n \r\n Drawing dd = (Drawing)ad.getFigureDoubled();\r\n Circle dd_c = (Circle) dd.getComponents().get(0);\r\n Rectangle dd_r = (Rectangle) dd.getComponents().get(1);\r\n \r\n \r\n Circle c_doubled = (Circle)d.getComponents().get(0);\r\n double c_radius_doubled = c_doubled.getRadius()* Math.sqrt(2.0);\r\n \r\n assertEquals(c_radius_doubled, dd_c.getRadius(), 0.02);\r\n \r\n Rectangle r_doubled = (Rectangle)d.getComponents().get(1);\r\n double r_height_doubled = r_doubled.getHeight()* Math.sqrt(2.0);\r\n double r_width_doubled= r_doubled.getWidth()*Math.sqrt(2.0);\r\n \r\n assertEquals(r_height_doubled, dd_r.getHeight(), 0.02);\r\n assertEquals(r_width_doubled, dd_r.getWidth(), 0.02);\r\n \r\n }", "void render(Graphics2D brush);", "public abstract void drawBody(Graphics2D g);", "public void draw() {\n \n // TODO\n }", "@Override\n\tvoid draw(Graphics g) {\n\t\tg.setColor(needsHighlight() ? selectColor : Color.GRAY);\n\t\tsetBbox(x, y, x2, y2);\n\t\tif (x < x2 && y < y2)\n\t\t\tg.fillRect(x, y, x2 - x, y2 - y);\n\t\telse if (x > x2 && y < y2)\n\t\t\tg.fillRect(x2, y, x - x2, y2 - y);\n\t\telse if (x < x2 && y > y2)\n\t\t\tg.fillRect(x, y2, x2 - x, y - y2);\n\t\telse\n\t\t\tg.fillRect(x2, y2, x - x2, y - y2);\n\t}", "private void\trender(GLAutoDrawable drawable)\n\t{\n\t\tGL2\t\tgl = drawable.getGL().getGL2();\n\n\t\tgl.glClear(GL.GL_COLOR_BUFFER_BIT);\t// Clear the buffer\n\t\tgl.glEnable(GL.GL_BLEND);\n\t\tgl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);\n\t\tsetScreenProjection(gl);\n\n\t\t\n\t\t//changes what to render and what animation is going to happen based off what shape is selected\n\t\tif(shape1)\n\t\t{\n\t\t\tsetColor(gl, red, green, blue);\n\t\t\t//gives us the points for the shape\n\t\t\trectangle = fillRect(gl, (int)(getWidth() / 2) - (int)(rectWidth / 2), \n\t\t\t\t\t(int)(getHeight() / 2) - (int)(rectHeight / 2), rectWidth , rectHeight);\n\t\t\t//need to add the first point so we can loop around for collision detection\n\t\t\trectangle.add(rectangle.get(0));\n\t\t\tcreateBall(gl);\n\t\t\tmovePoint(rectangle);\n\n\t\t}\n\t\telse if(shape2)\n\t\t{\t\n\t\t\tsetColor(gl, red, green, blue);\n\t\t\t//gives us the points for the shape\n\t\t\thexagon = drawGon(gl, 6, getWidth() / 2, getHeight() / 2, (int)(rectHeight / 2));\n\t\t\tcreateBall(gl);\n\t\t\tmovePoint(hexagon);\n\n\t\t}\n\t\telse if(shape3)\n\t\t{\n\t\t\tsetColor(gl, red, green, blue);\n\t\t\t//gives us the points for the shape\n\t\t\tcircle = drawGon(gl, 32, getWidth() / 2, getHeight() / 2, (int)(rectHeight / 2));\n\t\t\tcreateBall(gl);\n\t\t\tmovePoint(circle);\n\t\t}\n\t\telse if(shape4)\n\t\t{\t\n\t\t\tsetColor(gl, red, green, blue);\n\t\t\t//gives us the points for the shape\n\t\t\tweirdPoly = fillPoly(gl,(int)(getWidth() / 2) , (int)(getHeight() / 2), pointArray);\n\t\t\t//need to add the first point so we can loop around for collision detection\n\t\t\tweirdPoly.add(weirdPoly.get(0));\n\t\t\tcreateBall(gl);\n\t\t\tmovePoint(weirdPoly);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Do Nothing??\n\t\t}\n\n\t}", "public interface DrawShape {\n void draw();\n}", "private void drawShape(Graphics g, IShape shape) {\r\n Color color = shape.getColor();\r\n if (shape.getPosition() != null) {\r\n int x = shape.getPosition().getX();\r\n int y = shape.getPosition().getY();\r\n int width = shape.getWidth();\r\n int height = shape.getHeight();\r\n\r\n\r\n switch (shape.getShapeType()) {\r\n case \"Ellipse\":\r\n g.setColor(color);\r\n g.fillOval(x, y, width, height);\r\n g.drawOval(x, y, width, height);\r\n break;\r\n case \"Rectangle\":\r\n g.setColor(color);\r\n g.fillRect(x, y, width, height);\r\n g.drawRect(x, y, width, height);\r\n break;\r\n case \"Plus\":\r\n g.setColor(color);\r\n int width1 = width ;\r\n int height2 = height;\r\n int height1 = height / 2;\r\n int width2 = width / 2;\r\n int x1 = x;\r\n int y1 = y + height / 4;\r\n int x2 = x + width / 4;\r\n int y2 = y;\r\n g.fillRect(x1, y1, width1, height1);\r\n g.fillRect(x2, y2, width2, height2);\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n }", "public abstract void paint(Graphics2D g2d);", "protected abstract void paintCoordinates(Graphics2D g);", "public void drawRectangle(int x, int y, int width, int height, Color color) {\n implementation.devDrawRectangle(x, y, width, height, color);\n }", "protected void drawRectangle(Graphics2D g2, final Color c, final double x, final double y, final double width, final double height) {\r\n\r\n g2.setColor(c);\r\n\r\n g2.fillRect(floor(x), floor(y), floor(width), floor(height));\r\n }", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "public abstract void draw(Graphics g);", "@Override\n\tpublic void draw() {\n\t\tSystem.out.println(\"Rectangle.draw()\");\n\t}", "private void drawBox(Graphics2D g2d, int y, int wid, int hei) {\n g2d.setColor(Dark_Gray);\n Triangle triangle1 = new Triangle(new Point(wid / 3, y), new Point(2 * wid / 3, y), new Point(wid / 3, y + hei / 10));\n triangle1.fill(g2d);\n g2d.setColor(Light_Gray);\n Triangle triangle2 = new Triangle(new Point(2 * wid / 3, y + hei / 10), new Point(2 * wid / 3, y), new Point(wid / 3, y + hei / 10));\n triangle2.fill(g2d);\n Triangle triangle3 = new Triangle(new Point(wid / 3, y + hei / 10), new Point(wid / 3 + 8, y + hei / 10), new Point(wid / 3 + 8, y + hei / 10 - 8));\n triangle3.fill(g2d);\n g2d.setColor(Dark_Gray);\n Triangle triangle4 = new Triangle(new Point(2 * wid / 3, y), new Point(2 * wid / 3 - 8, y), new Point(2 * wid / 3 - 8, y + 8));\n triangle4.fill(g2d);\n g2d.setColor(Color.BLACK);\n g2d.fillRect(wid / 3 + 4, y + 4, wid / 3 - 8, hei / 10 - 8);\n }", "public abstract void drawSimplified(Object o);", "abstract public void draw(Graphics g);", "public abstract void draw(java.awt.Graphics canvas);", "public void draw(){\n }", "public interface CompositeShapeInt\n{\n /**\n Add a shape to this composite shape.\n @param aShape the shape to add\n */\n void add(Shape aShape);\n\n /**\n Returns an integer Rectangle that completely encloses the Shape.\n Note that there is no guarantee that the returned Rectangle is the\n smallest bounding box that encloses the Shape, only that the Shape\n lies entirely within the indicated Rectangle.\n */\n Rectangle getBounds();\n\n /**\n Draws this CompositeShape at the relative position to the top left corner of the bounding box.\n @param g2 the graphics context\n */\n void draw (Graphics2D g);\n\n}", "@Override\r\n public final void draw(final Rectangle r, final BufferedImage paper) {\n String red;\r\n String green;\r\n String blue;\r\n if (Integer.toHexString(r.getBorderColor().getRed()).length() == 1) {\r\n red = \"0\" + Integer.toHexString(r.getBorderColor().getRed());\r\n } else {\r\n red = Integer.toHexString(r.getBorderColor().getRed());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getGreen()).length() == 1) {\r\n green = \"0\" + Integer.toHexString(r.getBorderColor().getGreen());\r\n } else {\r\n green = Integer.toHexString(r.getBorderColor().getGreen());\r\n }\r\n if (Integer.toHexString(r.getBorderColor().getBlue()).length() == 1) {\r\n blue = \"0\" + Integer.toHexString(r.getBorderColor().getBlue());\r\n } else {\r\n blue = Integer.toHexString(r.getBorderColor().getBlue());\r\n }\r\n String color = \"#\" + red + green + blue;\r\n\r\n draw(new Line((String.valueOf(r.getxSus())), String.valueOf(r.getySus()),\r\n String.valueOf(r.getxSus() + r.getLungime() - 1), String.valueOf(r.getySus()),\r\n color, String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus()), String.valueOf(r.getxSus() + r.getLungime() - 1),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus() + r.getLungime() - 1)),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), color,\r\n String.valueOf(r.getBorderColor().getAlpha()), paper), paper);\r\n\r\n draw(new Line((String.valueOf(r.getxSus())),\r\n String.valueOf(r.getySus() + r.getInaltime() - 1), String.valueOf(r.getxSus()),\r\n String.valueOf(r.getySus()), color, String.valueOf(r.getBorderColor().getAlpha()),\r\n paper), paper);\r\n\r\n for (int i = r.getxSus() + 1; i < r.getxSus() + r.getLungime() - 1; i++) {\r\n for (int j = r.getySus() + 1; j < r.getySus() + r.getInaltime() - 1; j++) {\r\n if (checkBorder(i, j, paper)) {\r\n paper.setRGB(i, j, r.getFillColor().getRGB());\r\n }\r\n }\r\n }\r\n }", "@Override\n\tpublic void draw(Graphics2D g) {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\tdecoratedShape.draw();\n\t}", "@Override\n public void draw(ModernComponent c, Graphics2D g2, IntRect rect, Props props) {\n\n g2.setColor(FILL);\n\n fill(c, g2, rect, props);\n\n g2.setColor(BORDER);\n outline(c, g2, rect, props);\n }", "public static void writeRectangle(Model model, int x1, int y1, int x2, int y2, char colour) {\n int xLength = model.getWidth();\n int yLength = model.getHeight();\n\n if (x1 > xLength || x2 > xLength || y1 > yLength || y2 > yLength) {\n System.out.println(String.format(\"Couldn't create rectangle inside current simpleCanvas width: %d, height: %d\", xLength, yLength));\n return;\n }\n\n writeLine(model, x1, y1, x1, y2, colour);\n writeLine(model, x1, y2, x2, y2, colour);\n writeLine(model, x2, y2, x2, y1, colour);\n writeLine(model, x2, y1, x1, y1, colour);\n }", "public void drawRect(int x, int y, int width, int height, int color){\n hline(x, x + width - 1, y, color);\n hline(x, x + width - 1, y + height - 1, color);\n vline(y, y + height - 1, x, color);\n vline(y, y + height - 1, x + width - 1, color);\n }", "public abstract void drawPiece(int x, int y, Graphics g);", "protected void drawImpl()\n {\n if (mode == 2) {\n // Invader\n background(0);\n noStroke();\n int triangleXDensity = 32;\n int triangleYDensity = 18;\n for (int i = 0; i < triangleXDensity + 100; i++) {\n for (int j = 0; j < triangleYDensity + 100; j++) {\n float value = scaledBandLevels[(i % scaledBandLevels.length)];\n float shapeSize = map(value, 0, 255, 0, 150);\n int currentX = (width/triangleXDensity) * i;\n int currentY = (int)(((height/triangleYDensity) * j));\n\n if (subMode == 1) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 3));\n }\n else if (subMode == 3) {\n currentY = (int)(((height/triangleYDensity) * j) - (frameCount % height * 6));\n }\n\n if (subMode == 4) {\n shapeSize = map(value, 0, 255, 0, 500);\n }\n\n if ((i + j) % (int)random(1,5) == 0) {\n fill(0, 255, 255);\n }\n else {\n fill(234,100,255);\n }\n pushMatrix();\n if (subMode == 2) {\n translate(width/2, height/2);\n rotate(radians(frameCount % value * 2));\n translate(-width/2, -height/2);\n }\n triangle(currentX, currentY - shapeSize/2, currentX - shapeSize/2, currentY + shapeSize/2, currentX + shapeSize/2, currentY + shapeSize/2);\n popMatrix();\n }\n }\n\n }\n else if (mode == 5) {\n // Mirror Ball\n background(0);\n translate(width/2, height/2, 500);\n noStroke();\n if (subMode == 0) {\n rotateY(frameCount * PI/800);\n }\n else if (subMode == 1 || subMode == 2) {\n rotateY(frameCount * PI/800);\n rotateX(frameCount * PI/100);\n }\n else if (subMode == 3) {\n rotateY(frameCount * PI/400);\n }\n\n for (int i = 0; i < 100; i++) {\n for (int j = 0; j < 100; j++) {\n rotateY((2*PI/200) * j);\n pushMatrix();\n rotateX((2*PI/200) * i);\n translate(0,200);\n if (j > 50 && j < 150) {\n rotateX(PI/2);\n }\n else {\n rotateX(-PI/2);\n }\n if (subMode == 2 || subMode == 3) {\n fill(i * 2, 0, j, scaledBandLevels[i % scaledBandLevels.length] * 2);\n }\n else {\n fill(255, scaledBandLevels[i % scaledBandLevels.length]);\n }\n rect(0,200,20,20);\n popMatrix();\n }\n }\n }\n else if (mode == 8) {\n // End To Begin\n background(0);\n\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i] && modSizes[i] < 60) {\n modSizes[i]+=2;\n }\n else if (modSizes[i] > 5) {\n modSizes[i]--;\n }\n }\n \n theta += .2;\n\n if (subMode >=3) {\n theta += .6;\n }\n\n float tempAngle = theta;\n for (int i = 0; i < yvalues.length; i++) {\n yvalues[i] = sin(tempAngle)*amplitude;\n tempAngle+=dx;\n }\n\n noStroke();\n if (subMode >= 4) {\n translate(0, height/2);\n }\n int currentFrameCount = frameCount;\n for (int x = 0; x < yvalues.length; x++) {\n if (subMode >= 4) {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length] * 3);\n rotateX(currentFrameCount * (PI/200));\n }\n else {\n fill(0,random(128,255),255, scaledBandLevels[x % scaledBandLevels.length]);\n }\n ellipse(x*xspacing - period/2, height/2+yvalues[x], modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n if (subMode >= 1) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/4, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n if (subMode >= 2) {\n ellipse(x*xspacing, height/2+yvalues[x] - height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n ellipse(x*xspacing, height/2+yvalues[x] + height/8, modSizes[x % modSizes.length], modSizes[x % modSizes.length]);\n }\n }\n }\n else if (mode == 1) {\n // Life Support\n background(0);\n noStroke();\n if (trigger) { \n if (subMode == 0) {\n fill(255, 0, 0, triggerHold - (triggerCount * 4));\n }\n else if (subMode == 1) {\n fill(255, triggerHold - (triggerCount * 4));\n }\n rect(0,0,width,height);\n if (triggerCount > triggerHold) {\n trigger = false;\n triggerCount = 1;\n }\n else {\n triggerCount++;\n }\n }\n }\n else if (mode == 6) {\n // Stacking Cards\n background(255);\n if (subMode >= 1) {\n translate(width/2, 0);\n rotateY(frameCount * PI/200);\n }\n imageMode(CENTER);\n\n if (subMode <= 1) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=40;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n else if (subMode == 2) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 4; j++) {\n rotateY(j * (PI/4));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 3) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), (height/2), modSizes[i], modSizes[i]);\n }\n }\n }\n else if (subMode == 4) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n if (modSizes[i] < scaledBandLevels[i]) {\n modSizes[i]+=20;\n }\n else if (modSizes[i] > 40) {\n modSizes[i]--;\n }\n }\n for (int j = 0; j < 8; j++) {\n rotateY(j * (PI/8));\n for (int k = 0; k < height; k+= 300) {\n for (int i = 0; i < scaledBandLevels.length; i++) {\n image(mod, ((width/scaledBandLevels.length) * i) + ((width/scaledBandLevels.length)/2), k, modSizes[i], modSizes[i]);\n }\n }\n }\n }\n } \n else if (mode == 4) {\n background(0);\n noStroke();\n for (int i = 0; i < letterStrings.length; i++) { \n if (subMode == 0) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), (height/2) + 75);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, (height/2) + 75);\n }\n }\n else if (subMode == 1) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100; j < height + 100; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 2) {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 2);\n for (int j = -100 - (frameCount % 400); j < height + 600; j+=200) {\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n else if (subMode == 3) {\n for (int j = -100; j < height + 100; j+=200) {\n if (random(0,1) < .5) {\n fill(0,250,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n else {\n fill(234,100,255, scaledBandLevels[i % scaledBandLevels.length] * 4);\n }\n if (i < letterStrings.length/2) {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) - scaledBandLevels[i % scaledBandLevels.length] - (400 - (i * 100)), j);\n }\n else {\n text(letterStrings[i], (width/2) - (textWidth(letterStrings[i])/2) + scaledBandLevels[i % scaledBandLevels.length] + (i * 100) - 400, j);\n }\n }\n }\n }\n }\n else if (mode == 9) {\n background(0);\n noStroke();\n fill(234,100,255);\n String bandName = \"ELAPHANT\";\n text(bandName, (width/2) - (textWidth(bandName)/2), (height/2) + 75);\n }\n else {\n background(0);\n }\n }", "public void draw() {\n\tbackground(bg_count); // set background to something\n\tbg_count = bg_count + bg_dir;\n\tif (bg_count >= 255) {\n\t bg_dir = -1;\n\t} else if (bg_count <= 0) {\n\t bg_count = 0;\n\t bg_dir = 1;\n\t}\n\tellipse_x = ellipse_x + ellipse_x_dir;\n\tellipse_y = ellipse_y - ellipse_y_dir;\n\n\tif (ellipse_x > width) {\n\t ellipse_x_dir = -1;\n\t ellipse_x = width - 1;\n\t} else if (ellipse_x < 0) {\n\t ellipse_x_dir = 1;\n\t ellipse_x = 0;\n\t}\n\tif (ellipse_y > height) {\n\t ellipse_y_dir = -1;\n\t ellipse_y = height - 1;\n\t} else if (ellipse_y < 0) {\n\t ellipse_y_dir = 1;\n\t ellipse_y = 0;\n\t}\n\n\tfill(0, 64, 0);\n\t// x y w h\n\trect(400, 300, 200, 100);\n\n\tfill(212, 111, 249);\n\t\n\tstrokeWeight(4.0f);\n\n\t// x y r1 r2 // can set to mouseX, mouseY\n\tellipse(ellipse_x, ellipse_y, 30, 30);\n\n\t// some draw methods associated with PApplet:\n\t// background(int)\n\t// stroke(int, int, int)\n\t// fill(int)\n\t// ellipse(x, y, radius_1, radius_2)\n\t// noFill()\n\n\t// text(str, x, y)\n }", "protected void renderFilledRect(Graphics g, int x1, int y1, int x2, int y2)\n {\n\tg.fillRect(x1,y1,x2,y2);\n\tig.fillRect(x1,y1,x2,y2);\n }", "public void draw(Graphics graphics);" ]
[ "0.743644", "0.738167", "0.7160798", "0.71203256", "0.7046356", "0.7045262", "0.7020533", "0.7011047", "0.69875115", "0.6975945", "0.6975752", "0.69028676", "0.69005984", "0.68456507", "0.68224597", "0.6812861", "0.68084794", "0.6787097", "0.6786883", "0.67771995", "0.6773619", "0.67636436", "0.670099", "0.670099", "0.66885626", "0.6687138", "0.6684595", "0.6684595", "0.6684595", "0.6670912", "0.659459", "0.65579545", "0.6557395", "0.6557395", "0.6557395", "0.6529695", "0.65263677", "0.6521929", "0.6482158", "0.6468272", "0.64620006", "0.64620006", "0.64620006", "0.6459939", "0.6447539", "0.64362925", "0.6425647", "0.64232695", "0.6413038", "0.64044017", "0.63974977", "0.63937", "0.6382941", "0.63722634", "0.6361971", "0.635322", "0.63356686", "0.6331635", "0.6320304", "0.6309498", "0.6307758", "0.63073236", "0.63059074", "0.6303231", "0.6302329", "0.62989956", "0.62988544", "0.62893224", "0.62863415", "0.6285618", "0.6280761", "0.6258697", "0.6258518", "0.6249662", "0.6248292", "0.6244643", "0.6237299", "0.6232776", "0.6222637", "0.6220895", "0.6220895", "0.6220895", "0.6220895", "0.62102103", "0.620918", "0.6205248", "0.62041426", "0.6200471", "0.61955106", "0.61909133", "0.61876786", "0.6177569", "0.61769164", "0.61719364", "0.6170785", "0.6170227", "0.6170219", "0.61586314", "0.61553955", "0.6154652", "0.6150643" ]
0.0
-1
A validator that delegates to a collection of other validators to validate an object.
public interface IAggregateValidator extends IValidator { /** * Gets a map of names to instances of the validators used by this validator. * FIXME: this operation is Eclipse-specific. Move it to an interface * in com.choicemaker.cm.validation.eclipse * @return a non-null, but possibly empty map of name to delegate validators. */ public Map getValidatorMap(); /** * Gets the plugin names of the validators used by this validator. * FIXME: this operation is Eclipse-specific. Move it to an interface * in com.choicemaker.cm.validation.eclipse * @return a non-null, but possibly empty array of validator names. */ public String[] getValidatorNames(); /** * Gets the validators used by this validator. * @return a non-null, but possibly empty array of delegate validators. */ public IValidator[] getValidators(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public <T> List<ObjectError> validate(T dto, Validator validator) {\n DataBinder binder = getDataBinder(dto, validator);\n binder.validate();\n return getValidationErrors(binder.getBindingResult());\n }", "public void validate(Object value) throws FailedValidationException\n {\n List<FailedValidationException> failedValidationExceptions=new LinkedList<FailedValidationException>();\n boolean failedValidation=false;\n Map valueGroup=(Map)value;\n Iterator i=validatorMap.keySet().iterator();\n while (i.hasNext())\n {\n \t Object key=i.next(); \n IValidator validator=(IValidator) validatorMap.get(key);\n Object validatedObject=valueGroup.get(key);\n try\n {\n validator.validate(validatedObject);\n }\n catch (FailedValidationException e)\n {\n failedValidationExceptions.add(e);\n failedValidation=true;\n }\n }\n if (failedValidation)\n {\n \t if (getReason()==null)\n \t {\n\t throw new SeveralFailedValidationsException(failedValidationExceptions, value);\n \t }\n\t else\n\t {\n\t throw new SeveralFailedValidationsException(failedValidationExceptions, value, getReason());\n\t }\n }\n }", "@Override\n\tpublic void validate(Object arg0, Errors arg1) {\n\n\t}", "public IValidationResult isValid(T object);", "@Override\r\n\tpublic boolean validate(Object object) {\n\t\treturn this.validate(object);\r\n\t}", "void validate(T object);", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "public IValidator[] getValidators();", "public void validate(Object object, ClassDescriptorResolver resolver)\n throws ValidationException\n {\n if (object == null) {\n throw new ValidationException(\"Cannot validate a null object.\");\n }\n if (!getJavaClass().isAssignableFrom(object.getClass())) {\n String err = \"The given object is not an instance of the class\"+\n \" described by this ClassDecriptor.\";\n throw new ValidationException(err);\n }\n\n switch (_compositor) {\n\n case CHOICE:\n\n boolean found = false;\n XMLFieldDescriptor fieldDesc = null;\n //-- handle elements, affected by choice\n for (int i = 0; i < elementDescriptors.size(); i++) {\n XMLFieldDescriptor desc =\n (XMLFieldDescriptor) elementDescriptors.get(i);\n FieldHandler handler = desc.getHandler();\n\n if (handler.getValue(object) != null) {\n //Special case if we have a Vector, an ArrayList\n //or an Array --> need to check if it is not empty\n if (desc.isMultivalued()) {\n Object temp = handler.getValue(object);\n //-- optimize this?\n if (java.lang.reflect.Array.getLength(temp) == 0) {\n temp = null;\n continue;\n }\n temp = null;\n }\n\n if (found) {\n String err = null;\n if (desc.isContainer()) {\n err = \"The group '\" + desc.getFieldName();\n err += \"' cannot exist at the same time that \";\n if (fieldDesc.isContainer())\n err += \"the group '\" + fieldDesc.getFieldName();\n else err += \"the element '\" + fieldDesc.getXMLName();\n err +=\"' also exists.\";\n }\n else {\n err = \"The element '\" + desc.getXMLName();\n err += \"' cannot exist at the same time that \";\n err += \"element '\" + fieldDesc.getXMLName() + \"' also exists.\";\n }\n throw new ValidationException(err);\n }\n found = true;\n fieldDesc = desc;\n\n FieldValidator fieldValidator = desc.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n }//for\n\n //if there is nothing, we check if at least one field is required\n //and print the grammar that the choice must match.\n if (!found) {\n StringBuffer buffer = new StringBuffer(40);\n boolean error = false;\n for (int i = 0; i < elementDescriptors.size(); i++) {\n XMLFieldDescriptor desc = (XMLFieldDescriptor) elementDescriptors.get(i);\n FieldValidator fieldValidator = desc.getValidator();\n if (fieldValidator.getMinOccurs() > 0) {\n error = true;\n buffer.append('(');\n buffer.append(desc.getXMLName());\n buffer.append(\") \");\n }\n }\n if (error) {\n String err = \"In the choice contained in <\"+ this.getXMLName()\n +\">, at least one of these elements must appear:\\n\"\n + buffer.toString();\n throw new ValidationException(err);\n }\n\n }\n //-- handle attributes, not affected by choice\n for (int i = 0; i < attributeDescriptors.size(); i++) {\n XMLFieldDescriptor desc =\n (XMLFieldDescriptor) attributeDescriptors.get(i);\n FieldValidator fieldValidator = desc.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n //-- handle content, not affected by choice\n if (contentDescriptor != null) {\n FieldValidator fieldValidator = contentDescriptor.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n break;\n //-- Currently SEQUENCE is handled the same as all\n case SEQUENCE:\n //-- ALL\n default:\n //-- handle elements\n for (int i = 0; i < elementDescriptors.size(); i++) {\n XMLFieldDescriptor desc =\n (XMLFieldDescriptor) elementDescriptors.get(i);\n FieldValidator fieldValidator = desc.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n //-- handle attributes\n for (int i = 0; i < attributeDescriptors.size(); i++) {\n XMLFieldDescriptor desc =\n (XMLFieldDescriptor) attributeDescriptors.get(i);\n FieldValidator fieldValidator = desc.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n //-- handle content\n if (contentDescriptor != null) {\n FieldValidator fieldValidator = contentDescriptor.getValidator();\n if (fieldValidator != null)\n fieldValidator.validate(object, resolver);\n }\n break;\n }\n\n }", "public void validate() throws ValidationException {\r\n/* 522 */ Validator validator = new Validator();\r\n/* 523 */ validator.validate(this);\r\n/* */ }", "public interface Rule<T> {\n\n /**\n * Validate the supplied target object.\n *\n * @param regData the object that is to be validated (can be null)\n * @param errors contextual state about the validation process\n */\n void validate(T regData, Errors errors);\n}", "public interface validator {\n //what are the minimum requirements\n //what we need for our methods\n\n //write down the methods/processes that are in common\n //define the methods\n\n public boolean isValid();\n public String errorMessage();\n\n\n}", "public abstract void validate(List<String> validationMessages);", "public void validate(Object object)\n throws ValidationException\n {\n validate(object, (ClassDescriptorResolver)null);\n }", "Form setValidators(List<FormValidator> validators);", "List<FormValidator> getValidators();", "interface Validator<T> {\n /**\n * Checks whether the object is valid.\n *\n * @param t the object to check.\n * @return true if the object is valid else false.\n */\n boolean isValid(PooledObject<T> t);\n\n }", "public List<Validator> getValidators() {\n return Collections.unmodifiableList(validators);\n }", "@Override\n\tpublic void validate(Object target, Errors errors) {\n\t\t\n\t}", "public void validateObjectMetier() throws NSValidation.ValidationException {\n\n\t}", "public void validateObjectMetier() throws NSValidation.ValidationException {\n\n\t}", "public void validateObjectMetier() throws NSValidation.ValidationException {\n\n\t}", "private void setValidators() {\n getUtils().addNoNumbers(getOriginTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDestinationTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getCollectionPlaceTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDeliveryPlaceTxt(), getValidatorTxt());\n getUtils().eurosListener(getTravelValueTxt(), getValidatorTxt());\n getUtils().eurosListener(getMoneyforDriverTxt(), getValidatorTxt());\n getUtils().eurosListener(getCustomsTxt(), getValidatorTxt());\n getUtils().eurosListener(getOtherExpensesTxt(), getValidatorTxt());\n getUtils().eurosListener(getShippingExpensesTxt(), getValidatorTxt());\n //No listenerValidator for distance because, finally it is a string\n// getUtils().distanceListener(getDistanceTxt(), getValidatorTxt());\n getUtils().dateValidator(getDateTxt(), getValidatorTxt());\n getUtils().timeListener(getArriveHourTxt(), getValidatorTxt());\n getUtils().timeListener(getExitHourTxt(), getValidatorTxt());\n getUtils().timeListener(getProvidedHourTxt(), getValidatorTxt());\n\n }", "public void setValidator(Validator<V> validator);", "public interface FieldValidator {\n static boolean validateStringIfPresent(Object o, int len) {\n return o == null || o instanceof String && !((String) o).isEmpty() && ((String) o).length() < len;\n }\n\n static boolean validateString(Object o, int len) {\n return !(o == null || !(o instanceof String) || ((String) o).isEmpty() || (((String) o).length() > len));\n }\n\n static boolean validateInteger(Object o) {\n if (o == null) {\n return false;\n }\n try {\n Integer.valueOf(o.toString());\n } catch (NumberFormatException e) {\n return false;\n }\n return true;\n }\n\n static boolean validateDateWithFormat(Object o, DateTimeFormatter formatter, boolean allowedInPast) {\n if (o == null) {\n return false;\n }\n try {\n LocalDate date = LocalDate.parse(o.toString(), formatter);\n if (!allowedInPast) {\n return date.isAfter(LocalDate.now());\n }\n } catch (DateTimeParseException e) {\n return false;\n }\n return true;\n }\n\n static boolean validateJsonIfPresent(Object o) {\n return o == null || o instanceof JsonObject && !((JsonObject) o).isEmpty();\n }\n\n static boolean validateJson(Object o) {\n return !(o == null || !(o instanceof JsonObject) || ((JsonObject) o).isEmpty());\n }\n\n static boolean validateJsonArrayIfPresent(Object o) {\n return o == null || o instanceof JsonArray && !((JsonArray) o).isEmpty();\n }\n\n static boolean validateJsonArray(Object o) {\n return !(o == null || !(o instanceof JsonArray) || ((JsonArray) o).isEmpty());\n }\n\n static boolean validateDeepJsonArrayIfPresent(Object o, FieldValidator fv) {\n if (o == null) {\n return true;\n } else if (!(o instanceof JsonArray) || ((JsonArray) o).isEmpty()) {\n return false;\n } else {\n JsonArray array = (JsonArray) o;\n for (Object element : array) {\n if (!fv.validateField(element)) {\n return false;\n }\n }\n }\n return true;\n }\n\n static boolean validateDeepJsonArray(Object o, FieldValidator fv) {\n if (o == null || !(o instanceof JsonArray) || ((JsonArray) o).isEmpty()) {\n return false;\n }\n JsonArray array = (JsonArray) o;\n for (Object element : array) {\n if (!fv.validateField(element)) {\n return false;\n }\n }\n return true;\n }\n\n static boolean validateBoolean(Object o) {\n return o != null && o instanceof Boolean;\n }\n\n static boolean validateBooleanIfPresent(Object o) {\n return o == null || o instanceof Boolean;\n }\n\n static boolean validateUuid(Object o) {\n try {\n UUID uuid = UUID.fromString((String) o);\n return true;\n } catch (IllegalArgumentException e) {\n return false;\n }\n }\n\n static boolean validateUuidIfPresent(String o) {\n return o == null || validateUuid(o);\n }\n\n boolean validateField(Object value);\n\n Pattern EMAIL_PATTERN =\n Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n\n static boolean validateEmail(Object o) {\n Matcher matcher = EMAIL_PATTERN.matcher((String) o);\n return matcher.matches();\n }\n}", "public interface ValidationCheck extends Configurable {\n\n /**\n * Validates the concept.\n *\n * @param concept the concept\n * @return the validation result\n */\n public ValidationResult validate(Concept concept);\n\n /**\n * Validates the descriptor.\n *\n * @param descriptor the descriptor\n * @return the validation result\n */\n public ValidationResult validate(Descriptor descriptor);\n\n /**\n * Validates the code.\n *\n * @param code the code\n * @return the validation result\n */\n public ValidationResult validate(Code code);\n\n /**\n * Validates the atom.\n *\n * @param atom the atom\n * @return the validation result\n */\n public ValidationResult validate(Atom atom);\n\n /**\n * Validates the concept merge.\n *\n * @param concept1 the concept1\n * @param concept2 the concept2\n * @return the validation result\n */\n public ValidationResult validateMerge(Concept concept1,\n Concept concept2);\n\n}", "protected void validateForm() {\n for (Validator validator : validators) {\n validator.validate();\n }\n }", "public interface IValidator\n{\n /**\n * \n * @return the validator bean name\n */\n String getValidatorBeanName( );\n\n /**\n * \n * @return the validator display name\n */\n String getValidatorDisplayName( );\n\n /**\n * @param control\n * The control to build model\n * @return the HTML to display\n */\n String getDisplayHtml( Control control );\n\n /**\n * \n * @return the list of available entrytype for this validator\n */\n List<String> getListAvailableEntryType( );\n\n /**\n * @param questionResponse\n * The response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( FormQuestionResponse questionResponse, Control control );\n\n /**\n * @param questionResponse\n * The List response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( List<FormQuestionResponse> questionResponse, Control control );\n\n /**\n * Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE\n * \n * @return the javascript validation code for Conditional display control\n * \n */\n String getJavascriptValidation( );\n\n /**\n * @param control\n * The control\n * @return the control value needed for javascript\n */\n String getJavascriptControlValue( Control control );\n\n}", "@Override\n\tpublic void validate(Object target, Errors errors) {\n\t\t\n\t\t\n\t}", "@Override\n\tpublic void validate(Object obj, Errors errors) {\n\n\t\tUser user = (User) obj;\n\t\t\n\t\t // Check validate for values in form\n\t\tValidationUtils.rejectIfEmpty(errors, \"user_fullName\", \"user.user_fullName.emplty\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"user_mail\", \"user.user_mail.emplty\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"user_passWord\", \"user.user_passWord.emplty\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"role_id\", \"user.role_id.emplty\");\n\n\t\tPattern pattern = Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n\t\tif (!(pattern.matcher(user.getUser_mail()).matches())) {\n\t\t\terrors.rejectValue(\"user_mail\", \"user.user_mail.invalid\");\n\t\t}\n\n\t\tif (user.getUser_fullName().length() <= 3 || user.getUser_fullName().length() >= 50) {\n\t\t\terrors.rejectValue(\"user_fullName\", \"user.user_fullName.limit\");\n\t\t}\n\n\t\tif (user.getUser_passWord().length() <= 4 || user.getUser_passWord().length() >= 15) {\n\t\t\terrors.rejectValue(\"user_passWord\", \"user.user_passWord.limit\");\n\n\t\t}\n\n\t}", "@Override\n public int validate(Object object, Object value, Errors errors) {\n AMEEUnitType thisUnitType = (AMEEUnitType) object;\n if (thisUnitType != null) {\n if (!unitService.isUnitTypeUniqueByName(thisUnitType)) {\n errors.rejectValue(\"name\", \"duplicate\");\n }\n }\n return ValidationSpecification.CONTINUE;\n }", "@Override\n\tpublic void validate(Object obj, Errors errors) {\n\t\tReservationCommand command = (ReservationCommand)obj; \n\t\tReservation reservation = command.getReservation();\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"reservation.numOfPeople\", \"NUMOFPEOPLE_REQUIRED\", \"num of people is required.\");\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"reservation.visit_date\", \"VISIT_DATE_REQUIRED\", \"visit date is required.\");\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"reservation.visit_time\", \"VISIT_TIME_REQUIRED\", \"visit time is required.\");\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"reservation.name\", \"NAME_REQUIRED\", \"name is required.\");\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"reservation.phone\", \"PHONE_REQUIRED\", \"Phone number is required.\");\n\n\t\t\n\t}", "void apply(Validator validator, List<Exp> args);", "public Validator<V> getValidator();", "public interface InputValidator<E> {\n\t\tString DEFAULT_SUCCESS_MESSAGE = \"\";\n\t\tString FIELD_CANNOT_BE_EMPTY = \"Este campo n�o pode ficar vazio.\";\n\n\t\t/**\n\t\t * gets the validation result.\n\t\t *\n\t\t * @param input the <code>Object</code> to be validated.\n\t\t * @return the validation result.\n\t\t */\n\t\tString getErrorMessage(E input);\n\n\t\tdefault boolean isValid(E input) {\n\t\t\treturn getErrorMessage(input).equals(DEFAULT_SUCCESS_MESSAGE);\n\t\t}\n\t}", "public interface MultiFieldValidator {\r\n\r\n\t/**\r\n\t * Perform the validation on the collected values of the input components and returns whether the validation is\r\n\t * successful. Note: this validator does NOT throw {@link ValidatorException}! This job is up to the\r\n\t * {@link ValidateMultipleFields} implementation who will call this method.\r\n\t * @param context The faces context to work with.\r\n\t * @param components The input components whose values are to be validated.\r\n\t * @param values The values of the input components to be validated, in the same order as the components.\r\n\t * @return <code>true</code> if validation is successful, otherwise <code>false</code> (and thus show the message).\r\n\t */\r\n\tboolean validateValues(FacesContext context, List<UIInput> components, List<Object> values);\r\n\r\n}", "public interface Validateable {\n\n Validator validator = Validation.buildDefaultValidatorFactory().getValidator();\n\n default void validate(Validateable v) throws BeanValidationException {\n Set<ConstraintViolation<Validateable>> constraintViolations = validator.validate(v);\n if (constraintViolations.size() != 0) {\n StringBuilder sb = new StringBuilder();\n constraintViolations.forEach(cons -> sb.append(cons.getPropertyPath()).append(cons.getMessage()).append(','));\n throw new BeanValidationException(sb.toString());\n }\n }\n\n void validate();\n}", "boolean areErrorsLegal(List<ValidatorError> errors);", "public GroupValidator()\n {\n this(new HashMap<Object, IValidator>());\n }", "public interface IValidator {\n\n /**\n * Based on what is required to be validated,\n *\n * @param response The REST response returns JSONElement.\n * @return By default, return false. Implementations returns true, if this matches expectation.\n */\n default boolean checkJsonResp(JsonElement response) {\n return false;\n }\n\n /**\n * Based on what is required to be validated,\n *\n * @param object On querying the db returns an object of the required class.\n * @return By default, return false. Implementations returns true, if this matches expectation.\n */\n default boolean checkDbObj(Object object) {\n return false;\n }\n}", "public interface Validator<T> {\n\n // Валидирует переданое значение\n boolean isValid(int result);\n}", "@Override\n public void validate(Object o, Errors errors)\n {\n ParametersSelectedForTourPackages parametersSelectedForTourPackages = (ParametersSelectedForTourPackages) o;\n String minDay = parametersSelectedForTourPackages.getMinDay();\n String maxDay = parametersSelectedForTourPackages.getMaxDay();\n\n if (minDay != null && maxDay != null\n && !minDay.isEmpty() && !maxDay.isEmpty()\n && Integer.parseInt(minDay) > Integer.parseInt(maxDay))\n {\n errors.rejectValue(\"minDay\", \"illegal.range.days\");\n }\n\n String minPrice = parametersSelectedForTourPackages.getMinPrice();\n String maxPrice = parametersSelectedForTourPackages.getMaxPrice();\n\n if (minPrice != null && maxPrice != null\n && !minPrice.isEmpty() && !maxPrice.isEmpty()\n && Integer.parseInt(minPrice) > Integer.parseInt(maxPrice))\n {\n errors.rejectValue(\"minPrice\", \"illegal.range.prices\");\n }\n }", "public void validate(Object obj, Errors errors) {\n\t\tSystem.out.println(\" ------------------------ in validator ----------------,,,\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"username\", \"user.name.empty\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"password\", \"user.password.empty\");\n\t\t/*ValidationUtils.rejectIfEmpty(errors, \"exist\", \"user.exist.empty\");\n\t\tValidationUtils.rejectIfEmpty(errors, \"notexist\", \"user.notexist.empty\");\n\t\tLoginBean lb = (LoginBean) obj;\n\t\tif(!lb.isExist()){\n\t\t\terrors.rejectValue(\"exist\", \"user.exist.empty\");\n\t\t}*/\n\t}", "List<RecordItemValidatorIF> getItemValidators();", "public interface Validatable {\r\n void validate( ) throws ValidationException;\r\n}", "void addValidator(IValidator validator);", "public void validate(Object obj, Errors errors) {\n\t\t\n\t\tBooking booking = (Booking) obj;\n\t\t\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(errors, \"aptNo\", \"error.invalid.aptNo\", \"Apartment Number Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"street\", \"error.invalid.street\", \"Street Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"city\", \"error.invalid.city\", \"City Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"state\", \"error.invalid.state\", \"State Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"zipCode\", \"error.invalid.zipCode\", \"Zipcode Required\");\n \n\t}", "@Override\n\tpublic void validate() {\n\t\tFormFieldValidator.validateStudent(this, student);\n\t\tFormFieldValidator.validateCourseList(this, courseID);\n\t}", "public interface Validator\n{\n void assertEqual(Object expected, Object actual, String successMessage, String failureMessage) throws IOException;\n\n void assertNotEqual(Object expected, Object actual, String successMessage, String failureMessage) throws IOException;\n\n void assertNotEmpty(Collection collection, String successMessage, String failureMessage) throws IOException;\n\n void assertEmpty(Collection collection, String successMessage, String failureMessage) throws IOException;\n}", "protected void validate(T object)\n/* */ {\n/* 217 */ boolean dirty = false;\n/* 218 */ for (Painter p : this.painters) {\n/* 219 */ if ((p instanceof AbstractPainter)) {\n/* 220 */ AbstractPainter ap = (AbstractPainter)p;\n/* 221 */ ap.validate(object);\n/* 222 */ if (ap.isDirty()) {\n/* 223 */ dirty = true;\n/* 224 */ break;\n/* */ }\n/* */ }\n/* */ }\n/* 228 */ this.clearLocalCacheOnly = true;\n/* 229 */ setDirty(dirty);\n/* 230 */ this.clearLocalCacheOnly = false;\n/* */ }", "public boolean validate(Object o){\r\n\t\treturn false;\r\n\t}", "public void validate(Object target, Errors errors) {\n\t }", "public void validate() {\n\t\tClass<?> clazz = this.getModelObject().getClass();\n\t\tif (!ArenaUtils.isObservable(clazz)) {\n\t\t\tthrow new RuntimeException(\"La clase \" + clazz.getName() + \" no tiene alguna de estas annotations \" + ArenaUtils.getRequiredAnnotationForModels() + \" que son necesarias para ser modelo de una vista en Arena\");\n\t\t}\n\t\t// TODO: Validate children bindings?\n\t}", "public T caseValidation(Validation object) {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic void validate(Object object, Errors error) {\n\t\t\r\n\t\tStudent student = (Student)object;\r\n\t\t\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(error, \"name\", \"valid.name\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(error, \"address\", \"valid.address\");\r\n\t\r\n\t\tif(student.getName().length() < 5){\r\n\t\t\terror.rejectValue(\"name\", \"valid.name.min.required\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private Set<ValidationMessage> validateInternal(final JsonNode schemaJson, final JsonNode objectJson) {\n Preconditions.checkNotNull(schemaJson);\n Preconditions.checkNotNull(objectJson);\n\n final JsonSchema schema = getSchemaValidator(schemaJson);\n return schema.validate(objectJson);\n }", "public interface IValidator {\n\n\tvoid validate(Version version);\n\t\n\tboolean matchProblems(Problem validationErrorA, Problem validationErrorB);\n\t\n\tEObject getContextElement(Problem validationError);\n}", "@Override\n public BeanValidationResult validate() {\n return new BeanValidator().validateTop(getClass().getSimpleName(), this);\n }", "public interface Validator {\n\n void validate(Entity entity) throws CommonException;\n}", "public interface Validator {\r\n\r\n\t/**\r\n\t * Advice que valida la modificacion de un Activo fijo\r\n\t */\r\n\tvoid validateActivoUpdate(Activo activo);\r\n\r\n\t/**\r\n\t * Advice que valida la creacion de un Activo fijo\r\n\t */\r\n\tvoid validateActivoCreate(Activo activo);\r\n\t\r\n}", "@Override\n\tpublic void validate(CarRegistrationNumber object) {\n\t}", "@Override\n public void validate(Object o, Errors errors) {\n User user = (User) o;\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"firstname\", \"NotEmpty.registerForm.firstname\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"lastname\", \"NotEmpty.registerForm.lastname\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"login\", \"NotEmpty.registerForm.login\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"mail\", \"NotEmpty.registerForm.mail\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"mail_confirm\", \"NotEmpty.registerForm.mail_confirm\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"password\", \"NotEmpty.registerForm.password\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"password_confirm\", \"NotEmpty.registerForm.password_confirm\");\n \n if (!user.getPassword().equals(user.getPassword_confirm())) {\n errors.rejectValue(\"password_confirm\", \"Diff.registerForm.password_confirm\");\n }\n if (!user.getMail().equals(user.getMail_confirm())) {\n errors.rejectValue(\"mail_confirm\", \"Diff.registerForm.mail_confirm\");\n }\n }", "Form addValidator(FormValidator validator);", "public ValidatorStandardSubsetBroad() {\n super();\n addErrorKey(ERROR_KEY1);\n addValidatorErrorListener(new DefaultErrorListener(), ERROR_KEY1);\n addErrorKey(ERROR_KEY2);\n addValidatorErrorListener(new DefaultErrorListener(), ERROR_KEY2); \n }", "private static void validate(final Object object) {\n if (object instanceof Object[]) {\n final Object[] array = (Object[]) object;\n for (int idx = 1; idx < array.length; ++idx) {\n SameDimensionCheck.validate(array[0], array[idx]);\n }\n }\n }", "public interface OEValidator {\r\n\t\r\n\tboolean isValid(OrderExecution execution);\r\n\r\n}", "public boolean valid(Object obj) {\n return !validator.valid(obj);\n }", "public abstract FieldReport validate(int fieldSequence, Object fieldValue);", "public void validate(Object obj, Errors errors)\n {\n User user = (User) obj;\n //errors.rejectValue(\"userName\", \"error.userName.required\",\"User name or password incorrect!\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"userName\", \"error.invalid.name\", \"UserName Required\");\n ValidationUtils.rejectIfEmptyOrWhitespace(errors, \"passWord\", \"error.invalid.password\", \"Password Required\");\n \n UserDAO userDao = new UserDAO();\n try {\n User temp = userDao.get(user.getUserName(), user.getPassWord());\n if(temp == null){\n errors.rejectValue(\"userName\", \"error.userName.required\",\"User name or password incorrect!\");\n }\n } catch (AdException ex) {\n Logger.getLogger(MyAccountValidator.class.getName()).log(Level.SEVERE, null, ex);\n errors.rejectValue(\"userName\", \"error.userName.required\",\"User or password incorrect!\");\n }\n userDao.close();\n }", "private void updateViewModelValidatorSupports()\n {\n if (myValidator == null)\n {\n return;\n }\n Conditional cond = myOperator.get();\n if (cond == Conditional.IN_LIST || cond == Conditional.NOT_IN_LIST || cond == Conditional.LIKE_LIST\n || cond == Conditional.NOT_LIKE_LIST)\n {\n myCriterionValue.setValidatorSupport(new TextModelListValidatorSupport(myCriterionValue, myValidator));\n myCriterionMaxValue.setValidatorSupport(new TextModelListValidatorSupport(myCriterionMaxValue, myValidator));\n }\n else\n {\n myCriterionValue.setValidatorSupport(new ObservableValueValidatorSupport<>(myCriterionValue, myValidator));\n myCriterionMaxValue.setValidatorSupport(new ObservableValueValidatorSupport<>(myCriterionMaxValue, myValidator));\n }\n }", "public interface EntityValidator<T> {\n\n /**\n * <p>Validates the given entity.</p>\n * @param entity The entity instance to validate.\n * @return The validation constraints collection produced.\n */\n Set<ConstraintViolation<T>> validate(T entity);\n}", "void validate(T entity) throws ValidatorException;", "public interface ValidatorNumberator<T> extends Numberator<T>, Validator<T> {\n}", "public OfficialOwnerValidator(IValidatable validator) {\n super(validator);\n }", "public void addValidator(ValueBoxBase widget, AsyncValidator asyncValidator, ClientValidator... validators) {\r\n\t\tthis.validators.addAll(Arrays.asList(validators));\r\n\t\tValidatorController validatorController = new ValidatorController(asyncValidator, validators);\r\n\t\tvalidatorController.addValidationHandler(new TextBoxValidationHandler(widget));\r\n\t\twidget.addChangeHandler(validatorController);\r\n\t}", "@Override\n public boolean isValid(Iterable<? extends CharSequence> value, ConstraintValidatorContext context) {\n if (value == null) {\n return true;\n }\n\n for (CharSequence str : value) {\n if (!validate(str)) {\n return false;\n }\n }\n\n return true;\n }", "@Override\n public void validate(Object o, Errors errors){\n RegistrationForm user = (RegistrationForm) o;\n\n if (userRepo.findByUsername(user.getUsername()) != null) {\n errors.rejectValue(\"username\", \"Duplicate.RegiterForm.username\");\n }\n\n if (!user.getConfirmPassword().equals(user.getPassword())) {\n errors.rejectValue(\"confirmPassword\", \"Diff.RegiterForm.confirmPassword\");\n }\n }", "protected void validate() {\n Validator mandatoryValidator = validateMandatoryOptions();\n Validator exclusionsValidator = validateOptionExclusions();\n Validator inapplicableOptionValidator = validateInapplicableOptions();\n Validator optionalValidator = validateOptionalParameters();\n\n List<String> validationMessages = new LinkedList<>();\n\n validationMessages.addAll(mandatoryValidator.getValidationMessages());\n validationMessages.addAll(exclusionsValidator.getValidationMessages());\n validationMessages.addAll(optionalValidator.getValidationMessages());\n validationMessages.addAll(inapplicableOptionValidator.getValidationMessages());\n\n if (!validationMessages.isEmpty()) {\n String tablePathString =\n (tablePath != null) ? SourceUtils.pathToString(tablePath) : \"null\";\n throw new DeltaOptionValidationException(tablePathString, validationMessages);\n }\n }", "public String[] getValidators()\r\n {\r\n return m_validators;\r\n }", "public List<CandidateValidator> getValidators(List<CandidateValidatorType> validatorTypes) {\n\n\t\tList<CandidateValidator> toReutrn = new LinkedList<>();\n\n\t\tthis.validators.stream().filter(v -> handlesAny(v, validatorTypes)).forEach(toReutrn::add);\n\t\treturn toReutrn;\n\t}", "public interface ValidatingRule extends NormalisationRule\n{\n /**\n * Performs validation for the given stage by validating the input object using the criteria\n * defined for this rule.\n * \n * @param stage\n * A URI denoting the stage to use. This stage must be a valid stage for this type of\n * rule based on the result of validForStage(stage)\n * @param input\n * The input object to be validated by this rule.\n * @return True if the validation succeeded, or false otherwise.\n * @throws InvalidStageException\n * If the given stage was not valid.\n * @throws ValidationFailedException\n * If the validation failed.\n * @throws QueryAllException\n * If the validation process did not complete.\n */\n boolean normaliseByStage(URI stage, Object input) throws InvalidStageException, ValidationFailedException,\n QueryAllException;\n \n /**\n * Validates the given input object in the stage after query creation, but before query parsing.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterQueryCreation(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after query parsing, but before query\n * submission to the provider.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterQueryParsing(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the RDF results have been imported from\n * the results for a provider, but before they have been merged into a pool with results from\n * other providers.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsImport(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the combined RDF statements in the pool\n * have been serialised to the results document.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsToDocument(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after the RDF results have been merged into a\n * pool of RDF statements, but before they have been serialised to the results document.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageAfterResultsToPool(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage after results have been returned from a\n * provider, but before they have been parsed into RDF statements.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageBeforeResultsImport(Object input) throws ValidationFailedException;\n \n /**\n * Validates the given input object in the stage where query variables are being normalised\n * based on the context of the provider.\n * \n * @param input\n * The input object to be validated.\n * @return True if the input object was valid and false otherwise.\n * @throws ValidationFailedException\n * If the validation failed.\n */\n boolean stageQueryVariables(Object input) throws ValidationFailedException;\n}", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "@Override\n public void customValidation() {\n }", "public static void validate(Object obj) {\n try {\n getMonitorTags(obj);\n } catch (Exception e) {\n throw new IllegalArgumentException(\n \"invalid MonitorTags annotation on object \" + obj, e);\n }\n\n List<AnnotatedAttribute> attrs = getMonitoredAttributes(obj);\n if (attrs.isEmpty()) {\n throw new IllegalArgumentException(\n \"no Monitor annotations on object \" + obj);\n }\n String ctype = obj.getClass().getCanonicalName();\n for (AnnotatedAttribute attr : attrs) {\n Monitor m = attr.getAnnotation();\n Object value = null;\n try {\n value = attr.getValue();\n } catch (Exception e) {\n throw new IllegalArgumentException(\n \"failed to get value for \" + m + \" on \" + ctype, e);\n }\n\n if (m.type() != DataSourceType.INFORMATIONAL) {\n String vtype = (value == null)\n ? null\n : value.getClass().getCanonicalName();\n Number n = asNumber(value);\n if (n == null) {\n throw new IllegalArgumentException(\n \"expected java.lang.Number, but received \" + vtype +\n \" for \" + m + \" on \" + ctype);\n }\n }\n }\n }", "@Override\n\tpublic void selfValidate() {\n\t\t\n\t}", "public List<ModelValidator> getDetailedValidators() {\n return detailedValidators;\n }", "void validate() throws ValidationException;", "private void validateUserObject(User user) {\n }", "public void validate (Set classes) throws ValidationException;", "public Collection fullValidationCheck ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tIterator iterator = getFullValidationList().iterator();\n\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t((ValidationComponent)iterator.next()).validate();\n\t\t\t}\n\t\t\tcatch (ModelValidationException e)\n\t\t\t{\n\t\t\t\tlist.add(e);\n\t\t\t}\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public List<ValidationError> validate() {\n\n List<ValidationError> errors = new ArrayList<>();\n\n // isActive\n if (this.isActive != null && !this.isActive.equals(\"\") && this.getIsActiveAsBoolean() == null) {\n errors.add(new ValidationError(\"isActive\", \"isActive is not correctly formated, should be a true or false\"));\n }\n\n // actorTypeRefId\n if (this.actorTypeRefId != null && !this.actorTypeRefId.equals(\"\") && this.getActorType() == null) {\n errors.add(new ValidationError(\"actorTypeRefId\", String.format(\"ActorType %s does not exist\", this.actorTypeRefId)));\n }\n\n // login\n if (this.login != null && !this.login.equals(\"\")) {\n Actor testActor = ActorDao.getActorByUid(this.login);\n if (testActor != null) {\n Actor actor = ActorDao.getActorByRefId(this.refId);\n if (actor != null) { // edit\n if (!testActor.id.equals(actor.id)) {\n errors.add(new ValidationError(\"login\", \"The login \\\"\" + this.login + \"\\\" is already used by another actor\"));\n }\n } else { // create\n errors.add(new ValidationError(\"login\", \"The login \\\"\" + this.login + \"\\\" is already used by another actor\"));\n }\n }\n }\n\n return errors.isEmpty() ? null : errors;\n }", "@Override\n\tpublic void validate() {\n\t}", "public interface RecordValidator_2_IF extends HomeHealthRecordValidatorIF{\n \n /**\n * adds a Item validator to the list of validators\n * @param itemValidator \n */\n void add(RecordItemValidatorIF itemValidator);\n\n /**\n * returns a non-mutable list of the item validator\n * @return \n */\n List<RecordItemValidatorIF> getItemValidators();\n\n /**\n * removes an item validator from this validation\n * @param itemValidator \n */\n void remove(RecordItemValidatorIF itemValidator);\n \n}", "@Override\n\tpublic boolean isSatisfied(Object arg0, Object arg1, OValContext arg2,\n\t\t\tValidator arg3) throws OValException {\n\t\treturn false;\n\t}", "@Override\r\n public void validate() {\r\n }", "public void validate(Object obj, Errors err) {\n\t\tUserLogin userLogin=(UserLogin)obj;\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"fName\", \"fName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"lName\", \"lName.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mailId\", \"mailId.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"pass\", \"password.emptyOrSpace\");\r\n\t\tValidationUtils.rejectIfEmptyOrWhitespace(err, \"mob\", \"mob.emptyOrSpace\");\r\n\t\t\r\n\t\t//Business rule related Validation \r\n\t\tif(userLogin.getfName()!=null && userLogin.getfName().trim().length()>0) {\r\n\t\t\tif(userLogin.getfName().trim().length()>20)\r\n\t\t\t\terr.rejectValue(\"fName\", \"fName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getlName()!=null && userLogin.getlName().trim().length()>0) {\r\n\t\t\tif(userLogin.getlName().trim().length()>10)\r\n\t\t\t\terr.rejectValue(\"lName\", \"lName.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMob()!=null && userLogin.getMob().trim().length()>0) {\r\n\t\t\tif(userLogin.getMob().trim().length()!=10)\r\n\t\t\t\terr.rejectValue(\"mob\", \"mob.length.exceeds\");\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getMailId()!=null && userLogin.getMailId().trim().length()>0) {\r\n\t\t\tif(userLogin.getMailId().trim().length()>=20 ) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.length.exceeds\");\r\n\t\t\t}else if(!userLogin.getMailId().contains(\"@\")) {\r\n\t\t\t\terr.rejectValue(\"mailId\", \"mailId.format.first.rule\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(userLogin.getPass()!=null && userLogin.getPass().trim().length()>0) {\r\n\t\t\tif(userLogin.getPass().trim().length()>=10 ) {\r\n\t\t\t\terr.rejectValue(\"pass\", \"pass.length.exceeds\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t//DB validations\r\n\t\tif(!registerService.validateUser(userLogin)) {\r\n\t\t\terr.rejectValue(\"mailId\", \"mailId.alreadyRegistered\");\r\n\t\t}\r\n\t\t\r\n\t}", "public void validate() {}", "void calculateValidationRequirement() {\n this.elementRequiringJSR303Validation = Util.hasValidation(this.type);\n\n // Check for JSR 303 or @OnValidate annotations in default group\n if (Util.requiresDefaultValidation(this.type)) {\n this.requiresDefaultValidation = true;\n return;\n }\n\n // Check for any simple index uniqueness constraints\n if (!this.uniqueConstraintFields.isEmpty()) {\n this.requiresDefaultValidation = true;\n return;\n }\n\n // Check for any composite index uniqueness constraints\n if (!this.uniqueConstraintCompositeIndexes.isEmpty()) {\n this.requiresDefaultValidation = true;\n return;\n }\n }", "public List<ModelValidator> getBasicValidators() {\n return basicValidators;\n }" ]
[ "0.6372948", "0.6058083", "0.5916532", "0.590117", "0.58680964", "0.5829342", "0.58170044", "0.5769207", "0.5752377", "0.55970764", "0.5577065", "0.5555033", "0.5540765", "0.5520433", "0.5481543", "0.54782546", "0.5451584", "0.5402087", "0.53984994", "0.5381298", "0.5381298", "0.5381298", "0.53779376", "0.5369358", "0.53676015", "0.5364313", "0.5361996", "0.5344702", "0.53296363", "0.5329029", "0.5301745", "0.5288254", "0.5284862", "0.5274098", "0.52721936", "0.5243643", "0.52355224", "0.5176291", "0.51671237", "0.5159333", "0.5155364", "0.51517475", "0.51372296", "0.5135569", "0.5127462", "0.5122781", "0.51196027", "0.51163507", "0.5116297", "0.51024485", "0.50974905", "0.509375", "0.50880027", "0.5086205", "0.50712234", "0.5065063", "0.50641036", "0.5048137", "0.5046415", "0.50418496", "0.5040426", "0.5013494", "0.5004393", "0.49908012", "0.49715024", "0.49574807", "0.49231657", "0.49222904", "0.49200457", "0.4919139", "0.49164814", "0.49138767", "0.49079227", "0.49063358", "0.48989058", "0.48987484", "0.4894099", "0.48937738", "0.48834604", "0.48832107", "0.48711455", "0.48709106", "0.48709106", "0.48709106", "0.48642847", "0.4864007", "0.48585972", "0.4857297", "0.48495036", "0.48411414", "0.4832959", "0.4831347", "0.48296422", "0.4820708", "0.48152453", "0.48145485", "0.48097914", "0.48088422", "0.4807309", "0.47994766" ]
0.5439891
17
Gets a map of names to instances of the validators used by this validator. FIXME: this operation is Eclipsespecific. Move it to an interface in com.choicemaker.cm.validation.eclipse
public Map getValidatorMap();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getValidators()\r\n {\r\n return m_validators;\r\n }", "List<FormValidator> getValidators();", "public List<Validator> getValidators() {\n return Collections.unmodifiableList(validators);\n }", "public IValidator[] getValidators();", "public String[] getValidatorNames();", "@ApplicationScoped\n\t@Produces\n\tpublic Multimap<Class<?>, AbstractValidator<?>> create() {\n\t\tMultimap<Class<?>, AbstractValidator<?>> map = ArrayListMultimap.create();\n\t\tIterator<AbstractValidator<?>> iter = validators.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tAbstractValidator<?> validator = iter.next();\n\t\t\tClass<?> validatorBeanClass = Reflections.getGenericTypeArgument(validator.getClass(), 0);\n\t\t\tif (!validatorBeanClass.isAnnotationPresent(Ignore.class)) {\n\t\t\t\tmap.put(validatorBeanClass, validator);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public List<ModelValidator> getDetailedValidators() {\n return detailedValidators;\n }", "public List<CandidateValidator> getValidators(List<CandidateValidatorType> validatorTypes) {\n\n\t\tList<CandidateValidator> toReutrn = new LinkedList<>();\n\n\t\tthis.validators.stream().filter(v -> handlesAny(v, validatorTypes)).forEach(toReutrn::add);\n\t\treturn toReutrn;\n\t}", "public List<ModelValidator> getBasicValidators() {\n return basicValidators;\n }", "public interface IAggregateValidator extends IValidator {\n\n\t/**\n\t * Gets a map of names to instances of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty map of name to delegate validators.\n\t */\n\tpublic Map getValidatorMap();\n\n\t/**\n\t * Gets the plugin names of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty array of validator names.\n\t */\n\tpublic String[] getValidatorNames();\n\n\t/**\n\t * Gets the validators used by this validator.\n\t * @return a non-null, but possibly empty array of delegate validators.\n\t */\n\tpublic IValidator[] getValidators();\n\n}", "List<RecordItemValidatorIF> getItemValidators();", "public void initializeValidators(String[] validatorNames, ONDEXGraph graph) {\n if (validatorLogger == null) {\n validatorLogger = new ONDEXPluginLogger();\n }\n for (String validator : validatorNames) {\n String className = \"net.sourceforge.ondex.validator.\" + validator.toLowerCase() + \".Validator\";\n if (ValidatorRegistry.validators.keySet().contains(className)) {\n continue;\n }\n try {\n Class<?> validatorClass = Class.forName(className);\n Class<?>[] args = new Class<?>[] {};\n Constructor<?> constructor = validatorClass.getClassLoader().loadClass(className).getConstructor(args);\n AbstractONDEXValidator validatorInstance = (AbstractONDEXValidator) constructor.newInstance(new Object[] {});\n ValidatorRegistry.validators.put(validator.toLowerCase(), validatorInstance);\n File vout = new File(Config.ondexDir + File.separator + \"dbs\" + File.separator + graph.getName() + File.separator + \"validatorsout\" + File.separator + validatorInstance.getName());\n vout.mkdirs();\n vout.deleteOnExit();\n ValidatorArguments va = new ValidatorArguments();\n va.setInputDir(Config.ondexDir + File.separator + \"importdata\" + File.separator + validator.toLowerCase());\n System.out.println(\"Validator input dir ==> \" + va.getInputDir());\n va.setOutputDir(vout.getAbsolutePath());\n if (validatorInstance.requiresIndexedGraph()) {\n LuceneEnv lenv = getIndex(graph, validatorInstance.getName());\n }\n validatorInstance.addValidatorListener(validatorLogger);\n validatorInstance.setArguments(va);\n validatorInstance.start();\n } catch (ClassNotFoundException e) {\n fireEventOccurred(new InvalidArgumentEvent(validator.toLowerCase() + \" validator \" + className + \" does not exist\"));\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IllegalArgumentException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "private void setValidators() {\n getUtils().addNoNumbers(getOriginTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDestinationTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getCollectionPlaceTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDeliveryPlaceTxt(), getValidatorTxt());\n getUtils().eurosListener(getTravelValueTxt(), getValidatorTxt());\n getUtils().eurosListener(getMoneyforDriverTxt(), getValidatorTxt());\n getUtils().eurosListener(getCustomsTxt(), getValidatorTxt());\n getUtils().eurosListener(getOtherExpensesTxt(), getValidatorTxt());\n getUtils().eurosListener(getShippingExpensesTxt(), getValidatorTxt());\n //No listenerValidator for distance because, finally it is a string\n// getUtils().distanceListener(getDistanceTxt(), getValidatorTxt());\n getUtils().dateValidator(getDateTxt(), getValidatorTxt());\n getUtils().timeListener(getArriveHourTxt(), getValidatorTxt());\n getUtils().timeListener(getExitHourTxt(), getValidatorTxt());\n getUtils().timeListener(getProvidedHourTxt(), getValidatorTxt());\n\n }", "Form setValidators(List<FormValidator> validators);", "public String getValidatorClassName() {\n return configurationName + \"Validator\";\n }", "public IValidator get(String key)\n {\n \t return validatorMap.get(key);\n }", "public List<IEntranceValidation> validations(){\n\t\tList<IEntranceValidation> validations = new ArrayList<>();\n\t\tvalidations.add(new ValidationDayMonday(new DateToday()));\n\t\tvalidations.add(new ValidationDisplacement());\n\t\tvalidations.add(new ValidationTires());\n\t\treturn validations;\n\t}", "public Map<QName, Marshaller> getMarshallers() {\n return Collections.unmodifiableMap(marshallers);\n }", "public Collection getBasicValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tString className = getClassName();\n\n\t\tlist.add(createClassExistenceComponent(className));\n\t\tlist.add(createClassPersistenceComponent(className));\n\n\t\tlist.addAll(getDatabaseValidationList());\n\t\tlist.addAll(getFieldsValidationList());\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public interface IValidator\n{\n /**\n * \n * @return the validator bean name\n */\n String getValidatorBeanName( );\n\n /**\n * \n * @return the validator display name\n */\n String getValidatorDisplayName( );\n\n /**\n * @param control\n * The control to build model\n * @return the HTML to display\n */\n String getDisplayHtml( Control control );\n\n /**\n * \n * @return the list of available entrytype for this validator\n */\n List<String> getListAvailableEntryType( );\n\n /**\n * @param questionResponse\n * The response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( FormQuestionResponse questionResponse, Control control );\n\n /**\n * @param questionResponse\n * The List response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( List<FormQuestionResponse> questionResponse, Control control );\n\n /**\n * Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE\n * \n * @return the javascript validation code for Conditional display control\n * \n */\n String getJavascriptValidation( );\n\n /**\n * @param control\n * The control\n * @return the control value needed for javascript\n */\n String getJavascriptControlValue( Control control );\n\n}", "public Map getESBManagers()\n\t{\n\t\tMap mgrs = (Map)cache( \"esbManagers\" );\t\t\n\t\t\n\t\tif ( mgrs == null )\n\t\t{\n\t\t\tmgrs = new HashMap();\n\t\t\tCollection names \t= getESBManagerNames();\n\t\t\t\n\t\t\tIterator iter\t\t= names.iterator();\n\t\t\tString name\t\t\t= null;\n\t\t\t\t\n\t\t\twhile( iter.hasNext() )\n\t\t\t{\n\t\t\t\tname = (String)iter.next();\n\t\t\t\tmgrs.put( name, getESBManagerData( name ) );\n\t\t\t}\n\t\t\t\n\t\t\tcache( \"esbManagers\", mgrs );\n\t\t}\n\t\t\n\t\treturn( mgrs );\n\t\t\n\t}", "public Map<String, Mapper> getMappers() {\n return new HashMap<String, Mapper>(this.mappers);\n }", "public void testAddEventValidator2_Accuracy() {\n eventManager.addEventValidator(successEventValidator);\n eventManager.addEventValidator(modifiedEventValidator);\n eventManager.addEventValidator(deniedEventValidator);\n\n Map<Class, Set<ActionEventValidator>> map = (Map<Class, Set<ActionEventValidator>>)\n getPrivateField(EventManager.class, eventManager, \"eventValidators\");\n // Check all the validators have been added correctly\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, null, successEventValidator));\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, null, modifiedEventValidator));\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, null, deniedEventValidator));\n }", "Map<String, Decorator> getDecorators();", "public Validator getValidator() throws InstantiationException, \r\n\t\t\tIllegalAccessException, ClassNotFoundException {\r\n\t\treturn ValidatorFactory.getValidator(getClassName());\r\n\t}", "protected void validateForm() {\n for (Validator validator : validators) {\n validator.validate();\n }\n }", "public Validator<V> getValidator();", "public Map<String, NGPackageSpecification<WebObjectSpecification>> getWebComponentSpecifications()\n\t{\n\t\treturn reader.getWebComponentSpecifications();\n\t}", "public abstract Map<String,List<Component>> getNamedComponents();", "public DefaultValidationAnnotationHandlerRegistry() {\n\n // class annotation handlers\n registerClassHandler(new ExpressionClassValidationAnnotationHandler());\n registerClassHandler(new ExpressionsClassValidationAnnotationHandler());\n registerClassHandler(new ValidatorClassValidationAnnotationHandler());\n registerClassHandler(new ValidatorsClassValidationAnnotationHandler());\n registerClassHandler(new ValidatorReferenceClassValidationAnnotationHandler());\n\n // method annotation handlers\n registerMethodHandler(new ValidationMethodAnnotationHandler());\n\n // property annotation handlers\n registerPropertyHandler(new CascadeValidationAnnotationHandler());\n registerPropertyHandler(new EmailValidationAnnotationHandler());\n registerPropertyHandler(new DateInTheFutureValidationAnnotationHandler());\n registerPropertyHandler(new DateInThePastValidationAnnotationHandler());\n registerPropertyHandler(new LengthValidationAnnotationHandler());\n registerPropertyHandler(new NotBlankValidationAnnotationHandler());\n registerPropertyHandler(new NotEmptyValidationAnnotationHandler());\n registerPropertyHandler(new NotNullValidationAnnotationHandler());\n registerPropertyHandler(new RangeValidationAnnotationHandler());\n registerPropertyHandler(new RegExpValidationAnnotationHandler());\n registerPropertyHandler(new SizeValidationAnnotationHandler());\n registerPropertyHandler(new ExpressionPropertyValidationAnnotationHandler());\n registerPropertyHandler(new ExpressionsPropertyValidationAnnotationHandler());\n registerPropertyHandler(new ConditionReferenceValidationAnnotationHandler());\n\n if (LibraryUtils.JODA_TIME_IN_CLASSPATH) {\n registerPropertyHandler(new InstantInTheFutureValidationAnnotationHandler());\n registerPropertyHandler(new InstantInThePastValidationAnnotationHandler());\n }\n\n }", "public GroupValidator(Map<Object, IValidator> validatorMap)\n {\n this(validatorMap,null);\n }", "public Set<String> getFonts() {\n return generators.keySet();\n }", "public Validator getValidator() {\n return _validator;\n }", "protected final SearchControls getSearchControls() {\n final SearchControls constraints = new SearchControls();\n\n constraints.setSearchScope(this.scope);\n constraints.setReturningAttributes(new String[]{this.multiFactorAttributeName});\n constraints.setTimeLimit(this.timeout);\n constraints.setCountLimit(DEFAULT_MAX_NUMBER_OF_RESULTS);\n return constraints;\n }", "public void testAddEventValidator1_Accuracy() {\n eventManager.addEventValidator(successEventValidator, Action.class);\n eventManager.addEventValidator(modifiedEventValidator, Action.class);\n eventManager.addEventValidator(deniedEventValidator, UndoableAction.class);\n\n Map<Class, Set<ActionEventValidator>> map = (Map<Class, Set<ActionEventValidator>>)\n getPrivateField(EventManager.class, eventManager, \"eventValidators\");\n // Check all the validators have been added correctly\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, Action.class, successEventValidator));\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, Action.class, modifiedEventValidator));\n assertTrue(\"Test method for 'EventManager.addEventValidator(ActionEventValidator, Class)' failed.\",\n containsInMap(map, UndoableAction.class, deniedEventValidator));\n }", "private List<PropertyGenerator> getPropertyGenerators() {\n\t\tList<PropertyGenerator.GeneratorFactory> factories = new ArrayList<PropertyGenerator.GeneratorFactory>();\n\t\t// these bindings will not mangle their property names\n\t\tfactories.add(new MethodPropertyGenerator.Factory(AccessorPrefix.NONE));\n\t\tfactories.add(new MethodCallableGenerator.Factory());\n\t\t// these bindings will try to drop their prefix and use a shorter name\n\t\t// (e.g. getFoo -> foo)\n\t\tfactories.add(new MethodPropertyGenerator.Factory(AccessorPrefix.GET));\n\t\tfactories.add(new MethodPropertyGenerator.Factory(AccessorPrefix.HAS));\n\t\tfactories.add(new MethodPropertyGenerator.Factory(AccessorPrefix.IS));\n\t\t// the field binding will use its name or append Field if it was already\n\t\t// taken by get/has/is\n\t\tfactories.add(new FieldPropertyGenerator.Factory());\n\n\t\tSet<String> namesTaken = new HashSet<String>();\n\t\tnamesTaken.add(\"getName\");\n\t\tnamesTaken.add(\"getPath\");\n\t\tnamesTaken.add(\"getType\");\n\t\tnamesTaken.add(\"getParentBinding\");\n\t\tnamesTaken.add(\"getChildBindings\");\n\n\t\tList<Element> elements = this.getAccessibleElements();\n\t\tList<PropertyGenerator> generators = new ArrayList<PropertyGenerator>();\n\n\t\tfor (PropertyGenerator.GeneratorFactory f : factories) {\n\t\t\tfor (Iterator<Element> i = elements.iterator(); i.hasNext();) {\n\t\t\t\tElement enclosed = i.next();\n\t\t\t\ttry {\n\t\t\t\t\tPropertyGenerator pg = f.newGenerator(this.pathBindingClass, this.name, this.element, enclosed,\n\t\t\t\t\t\t\tnamesTaken);\n\t\t\t\t\tif (namesTaken.contains(pg.getPropertyName())) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnamesTaken.add(pg.getPropertyName());\n\t\t\t\t\t}\n\t\t\t\t\ti.remove(); // element is handled, skip any further\n\t\t\t\t\t\t\t\t// generators\n\t\t\t\t\tgenerators.add(pg);\n\t\t\t\t\tthis.sourceElements.add(enclosed);\n\t\t\t\t} catch (WrongGeneratorException e) {\n\t\t\t\t\t// try next\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn generators;\n\t}", "@Override\r\n\tpublic Validation<Escala> getValidation() {\n\t\treturn new EscalaValidation();\r\n\t\t\r\n\t}", "public Collection getFullValidationList ()\n\t{\n\t\tArrayList list = new ArrayList(getBasicValidationList());\n\t\tString className = getClassName();\n\t\tPersistenceClassElement persistenceClass = \n\t\t\tgetPersistenceClass(className);\n\n\t\tif (persistenceClass != null)\n\t\t{\n\t\t\tPersistenceFieldElement[] fields = persistenceClass.getFields();\n\t\t\tint i, count = ((fields != null) ? fields.length : 0);\n\n\t\t\tlist.add(createSerializableClassComponent(className));\n\t\t\tlist.add(createKeyClassComponent(persistenceClass.getKeyClass()));\n\t\t\tlist.add(createClassMappingComponent(persistenceClass));\n\t\t\tlist.add(createKeyColumnMappingComponent(persistenceClass));\n\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tPersistenceFieldElement field = fields[i];\n\n\t\t\t\tlist.add(createFieldCardinalityComponent(field));\n\t\t\t\tlist.add(createFieldMappingComponent(field));\n\t\t\t\tlist.add(createFieldBlobMappingComponent(field));\n\t\t\t\tlist.addAll(getRelatedClassValidationList(field));\n\t\t\t}\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public GroupValidator()\n {\n this(new HashMap<Object, IValidator>());\n }", "public void setValidatorName(String name) {\r\n\t\t_validatorName = name;\r\n\t}", "Collection<PropertyValidationAnnotationHandler> getPropertyHandlers();", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public RegisteredConstraintLinkValidator() {\r\n\t\tsetDomainID(RegisteredConstraintLinkValidator.class.getName());\r\n\t}", "private Collection getDatabaseValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tString className = getClassName();\n\t\tMappingClassElement mappingClass = getMappingClass(className);\n\n\t\tif (mappingClass != null)\n\t\t{\n\t\t\tArrayList tables = mappingClass.getTables();\n\t\t\tint i, count = ((tables != null) ? tables.size() : 0);\n\t\t\tMappingTableElement primaryTable = null;\n\t\t\tIterator iterator = null;\n\n\t\t\tlist.add(createSchemaExistenceComponent(className));\n\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tMappingTableElement nextTable = \n\t\t\t\t\t(MappingTableElement)tables.get(i);\n\n\t\t\t\tlist.add(createTableExistenceComponent(nextTable.getTable()));\n\n\t\t\t\tif (i == 0)\n\t\t\t\t{\n\t\t\t\t\tprimaryTable = nextTable;\n\t\t\t\t\tlist.add(createPrimaryTableComponent(primaryTable));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMappingReferenceKeyElement referenceKey = \n\t\t\t\t\t\tfindReferenceKey(primaryTable, nextTable);\n\n\t\t\t\t\tif (referenceKey != null)\n\t\t\t\t\t{\n\t\t\t\t\t\titerator = referenceKey.getColumnPairNames().iterator();\n\t\t\t\t\t\twhile (iterator.hasNext())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist.add(createColumnExistenceComponent(\n\t\t\t\t\t\t\t\t(String)iterator.next()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlist.add(createVersionConsistencyComponent(mappingClass));\n\n\t\t\titerator = mappingClass.getFields().iterator();\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tMappingFieldElement nextField = \n\t\t\t\t\t(MappingFieldElement)iterator.next();\n\t\t\t\tArrayList allColumns = new ArrayList();\n\t\t\t\tIterator columnIterator = null;\n\n\t\t\t\tif (isRelationship(nextField))\n\t\t\t\t{\n\t\t\t\t\tallColumns.addAll(((MappingRelationshipElement)nextField).\n\t\t\t\t\t\tgetAssociatedColumns());\n\t\t\t\t}\n\n\t\t\t\tallColumns.addAll(nextField.getColumns());\n\n\t\t\t\tcolumnIterator = allColumns.iterator();\n\t\t\t\twhile (columnIterator.hasNext())\n\t\t\t\t{\n\t\t\t\t\tlist.add(createColumnExistenceComponent(\n\t\t\t\t\t\t(String)columnIterator.next(), nextField));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}", "public com.google.common.util.concurrent.ListenableFuture<cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsResponse> delegatorValidators(\n cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getDelegatorValidatorsMethod(), getCallOptions()), request);\n }", "public Validator getCustomerValidator() {\n return customerValidator;\n }", "public String getValidatorProperty() {\n return _validatorProperty;\n }", "@Transient\r\n\tpublic Map<String, Object> getLookups() {\r\n\t\tMap<String,Object> map = new HashMap<String,Object>();\r\n map.put(ICommercialAlias.TARGET_REGISTRY_ID, getId());\r\n map.put(ICommercialAlias.TARGET_REGISTRY_DOCUMENT, getRegistry().getDocument());\r\n map.put(ICommercialAlias.TARGET_REGISTRY_NAME, getRegistry().getName());\r\n map.put(ICommercialAlias.TARGET_REGISTRY_SURNAME, getRegistry().getSurname());\r\n map.put(ICommercialAlias.TARGET_REGISTRY_ALIAS, getRegistry().getAlias());\r\n return map;\r\n\t}", "public Iterator<RendererBean> renderers()\r\n {\r\n return _renderers.values().iterator();\r\n }", "public HtmlValidatorText getValidator() {\r\n\t\treturn _validator;\r\n\t}", "public void mapValidatorsFrom(BrokerAlgoSpec inCannonicalAlgoSpec)\n {\n if(algoSpec == null) {\n return;\n }\n if(!algoSpec.equals(inCannonicalAlgoSpec)) {\n throw new CoreException(new I18NBoundMessage2P(Messages.ALGO_SPEC_MISMATCH,\n algoSpec.getName(),\n inCannonicalAlgoSpec.getName()));\n }\n algoSpec.setValidator(inCannonicalAlgoSpec.getValidator());\n if(algoTags != null && inCannonicalAlgoSpec.getAlgoTagSpecs() != null) {\n Map<Integer,Validator<BrokerAlgoTag>> validators = new HashMap<Integer,Validator<BrokerAlgoTag>>();\n for(BrokerAlgoTagSpec algoTagSpec : inCannonicalAlgoSpec.getAlgoTagSpecs()) {\n if(algoTagSpec.getValidator() != null) {\n validators.put(algoTagSpec.getTag(),\n algoTagSpec.getValidator());\n }\n }\n for(BrokerAlgoTag algoTag : algoTags) {\n algoTag.getTagSpec().setValidator(validators.get(algoTag.getTagSpec().getTag()));\n }\n }\n }", "private void setupValidations() {\n for (Map.Entry<EditText, Validator> e : mValidators.entrySet()) {\n // On every keystroke, validate input and make text colour black or red\n e.getKey().addTextChangedListener(new MyTextWatcher() {\n @Override\n public void afterTextChanged(Editable s) {\n if (e.getValue().test(e.getKey().getText().toString()))\n e.getKey().setTextColor(mInputTextColorNormal);\n else\n e.getKey().setTextColor(mInputTextColorInvalid);\n }\n });\n // When the field loses focus, set an error icon if the input is invalid\n e.getKey().setOnFocusChangeListener((v, hasFocus) -> {\n if (hasFocus) return;\n if (!e.getValue().test(e.getKey().getText().toString()))\n e.getKey().setError(e.getValue().getWarnMsg(), e.getValue().getWarnIcon());\n });\n }\n }", "public GroupValidator(Map<Object, IValidator> validatorMap, String reason)\n {\n super(reason);\n this.validatorMap=validatorMap;\n }", "protected Iterable<ConfigSearcher.Domain> getSearcherDomains ()\n {\n return ImmutableList.<ConfigSearcher.Domain>of(new ConfigSearcher.ConfigDomain(this));\n }", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "public Set<YValidationAspekt> validateComponent() {\r\n\t\tthis.foundErrors = EnumSet.noneOf(YValidationAspekt.class);\r\n\t\tthis.foundWarnings = EnumSet.noneOf(YValidationAspekt.class);\r\n\r\n\t\tassertModelSpecification();\r\n\t\tassertModelImplementation();\r\n\r\n\t\tassertIdAndVarName();\r\n\t\tassertProperties();\r\n\r\n\t\treturn this.foundErrors;\r\n\t}", "public abstract List<String> getValidDescriptors();", "public TypeValidator getValidator() {\n if (validator != null)\n return validator;\n return this;\n }", "InputMap getInputMap() {\n InputMap map = new InputMapUIResource();\n\n InputMap shared =\n (InputMap)DefaultLookup.get(editor, this,\n getPropertyPrefix() + \".focusInputMap\");\n if (shared != null) {\n map.setParent(shared);\n }\n return map;\n }", "Map<String, Field> extensionFieldsMap() {\n Map<String, Field> extensionsForType = new LinkedHashMap<>();\n for (Field field : extensionFields) {\n extensionsForType.put(field.qualifiedName(), field);\n }\n return extensionsForType;\n }", "@Override\n protected Validator getValidator() {\n return super.getValidator();\n }", "public String[] getInitiators() { return this.initiators; }", "public static Collection<TreeRendererDescriptor> registeredRenderers() {\n return Collections.unmodifiableCollection(REGISTRY.values());\n }", "@Test\n public void subsetValidatorsHasMatchingEnabledListEntry() {\n DroolsRulesServiceFactoryFromFile reader = buildDefaultReader();\n\n EngineConfigDTO engine = new EngineConfigDTO();\n List<String> enabledFactsValidators = new ArrayList<>();\n enabledFactsValidators.add(DEFAULT_IFACTS_PREPROCESSOR1.getName());\n engine.setEnabledPreProcessors(enabledFactsValidators);\n List<IFactsPreProcessor> validators = reader.configurePreProcessors(engine, new ArrayList<String>());\n\n assertEquals(1, validators.size());\n IFactsPreProcessor validator = validators.get(0);\n assertEquals(validator.getName(), DEFAULT_IFACTS_PREPROCESSOR1.getName());\n }", "private synchronized static Map getListeners() {\n\t\tif (registeredListeners == null) {\n\t\t\tregisteredListeners = Collections.synchronizedMap(new HashMap());\n\t\t}\n\t\treturn registeredListeners;\n\t}", "public Map<ClassName, List<ClassName>> dependenciesMap() { return m_dependenceisMap; }", "public DescriptorExtensionList<Builder, Descriptor<Builder>> getBuilderDescriptors() {\n return Builder.all();\n }", "@Override\n public int hashCode() {\n return Objects.hash(validator, poolOfExistingAcceptedDrivers);\n }", "private Collection getFieldsValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tModel model = getModel();\n\t\tString className = getClassName();\n\t\tPersistenceClassElement persistenceClass = \n\t\t\tgetPersistenceClass(className);\n\n\t\tif (persistenceClass != null)\n\t\t{\n\t\t\tPersistenceFieldElement[] fields = persistenceClass.getFields();\n\t\t\tint i, count = ((fields != null) ? fields.length : 0);\n\t\t\tIterator iterator = \n\t\t\t\tgetMappingClass(className).getFields().iterator();\n\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tPersistenceFieldElement field = fields[i];\n\n\t\t\t\tlist.add(createFieldExistenceComponent(field));\n\n\t\t\t\t// even though this is really the validation step, we \n\t\t\t\t// only want to add the others if the field exists\n\t\t\t\tif (model.hasField(className, field.getName()))\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldPersistenceComponent(field));\n\t\t\t\t\tlist.add(createFieldPersistenceTypeComponent(field));\n\t\t\t\t\tlist.add(createFieldConsistencyComponent(field));\n\n\t\t\t\t\tif (isLegalRelationship(field))\n\t\t\t\t\t{\n\t\t\t\t\t\tRelationshipElement rel = (RelationshipElement)field;\n\n\t\t\t\t\t\t/* user modifiable collection class not yet supported\n\t\t\t\t\t\tlist.add(createCollectionClassComponent(rel));*/\n\t\t\t\t\t\tlist.add(createElementClassComponent(rel));\n\t\t\t\t\t\tlist.add(createRelatedClassMatchesComponent(rel));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tMappingFieldElement field = \n\t\t\t\t\t(MappingFieldElement)iterator.next();\n\t\t\t\tString fieldName = field.getName();\n\n\t\t\t\t// only check this if it is not in the jdo model\n\t\t\t\tif (persistenceClass.getField(fieldName) == null)\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldExistenceComponent(field));\n\n\t\t\t\t\t// even though this is really the validation step, we \n\t\t\t\t\t// only want to add the others if the field exists\n\t\t\t\t\tif (model.hasField(className, fieldName))\n\t\t\t\t\t\tlist.add(createFieldConsistencyComponent(field));\n\t\t\t\t}\n\n\t\t\t\tif (!isRelationship(field))\n\t\t\t\t\tlist.add(createColumnOverlapComponent(field));\n\n\t\t\t\t// preliminary fix for CR6239630\n\t\t\t\tif (Boolean.getBoolean(\"AllowManagedFieldsInDefaultFetchGroup\")) // NOI18N\n\t\t \t\t{\n // Do nothing - AllowManagedFieldsInDefaultFetchGroup: \n // disabled single model validation test; \n // may use checked read/write access to managed fields\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldDefaultFetchGroupComponent(field));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}", "public Collection fullValidationCheck ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tIterator iterator = getFullValidationList().iterator();\n\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t((ValidationComponent)iterator.next()).validate();\n\t\t\t}\n\t\t\tcatch (ModelValidationException e)\n\t\t\t{\n\t\t\t\tlist.add(e);\n\t\t\t}\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public List<String> validate() {\n\t\t\n\t\tList<String> validationMessages = new ArrayList<String>();\n\t\tvalidate(validationMessages);\n\t\treturn validationMessages;\n\t}", "protected Iterable<DynamicValidationComponent> createValidatorComponents(Image it, File currentFile,\n\t\t\tDynamicValidationContext context) {\n\t\tfinal Collection<DynamicValidationComponent> components = new ArrayList<>();\n\t\tif (isLocalImageReferenceValidation()) {\n\t\t\tfinal int lineno = computeLineNo(it);\n\t\t\tfinal URL url = FileSystem.convertStringToURL(it.getUrl().toString(), true);\n\t\t\tif (URISchemeType.FILE.isURL(url)) {\n\t\t\t\tfinal DynamicValidationComponent component = createLocalImageValidatorComponent(\n\t\t\t\t\t\tit, url, lineno, currentFile, context);\n\t\t\t\tif (component != null) {\n\t\t\t\t\tcomponents.add(component);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn components;\n\t}", "public Collection getESBManagerNames()\n {\n \treturn( getFrameworkXMLParser().getAttributesForEachOccurance( \"esbManager\", \"name\" ) );\n }", "public SoftAssert validator() {\n return pageValidator;\n }", "public Map<String, Factory> getFactoryMap(){\n\t\treturn factoryMap;\n\t}", "Collection<MatchmakingManager> getManagers();", "public cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsResponse delegatorValidators(cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsRequest request) {\n return blockingUnaryCall(\n getChannel(), getDelegatorValidatorsMethod(), getCallOptions(), request);\n }", "public static FASTAWriterFactory[] getRegisteredWriters(){\r\n return (FASTAWriterFactory[])writers.values().toArray(new FASTAWriterFactory[0]);\r\n }", "public Map<String,String> getMetadataElementMap() {\n\t\tMap<String,String> uiList = new LinkedHashMap<String,String>();\n\t\tfor (MetadataElement element: MetadataElement.values()){\n\t\t\tuiList.put(element.toString(), element.getDisplayName());\n\t\t}\n \n\t\treturn uiList;\n\t}", "Iterable<String> getRegisteredNames();", "public Map<InjectionSite, Injectable> getInjectionSites() {\n return injectionSites;\n }", "public static ValidatorFactory buildDefaultValidatorFactory() {\n return byDefaultProvider().configure().buildValidatorFactory();\n }", "public Map<ModelObject, InjectionSite> getInjectionSiteMappings() {\n return injectionSiteMapping;\n }", "public String[] getRuleSetNames()\n/* */ {\n/* 945 */ return (String[])this.publicRuleSetNames.clone();\n/* */ }", "public Iterator<String> validate() {\r\n\t\tValidityReport vr = ONT_MODEL.validate();\r\n\t\t\r\n\t\tCollection<String> reports = new ArrayList<String>();\r\n\t\t\r\n\t\tfor(Iterator riter = vr.getReports(); riter.hasNext();)\r\n\t\t{\r\n\t\t\tValidityReport.Report r = (ValidityReport.Report)riter.next();\r\n\t\t\tString msg =\"\";\r\n\t\t\tif(r.isError())\r\n\t\t\t\tmsg += \"[ERROR]\";\r\n\t\t\telse\r\n\t\t\t\tmsg += \"[WARNING]\";\r\n\t\t\tmsg+=\"[\"+r.getType()+\"]\";\r\n\t\t\tmsg+=r.getDescription();\r\n\t\t\treports.add(msg);\r\n\t\t}\r\n\t\t\r\n\t\treturn reports.iterator();\r\n\t}", "private Map<String, Mutator> createMutatorMap() {\n Map<String, Mutator> mutators = new HashMap<String, Mutator>();\n\n Method[] methods = type.getMethods();\n for (int i = 0; i < methods.length; i++) {\n Method method = methods[i];\n\n // implement some rules to decide if this method is a mutator or not\n\n // not interested in methods declared by Object\n if (method.getDeclaringClass() == Object.class) continue;\n\n // method name should start with 'get'\n String fieldName = mutatorMethodNameToFieldName(method.getName());\n if (fieldName == null) continue;\n\n // method should have a single parameter\n Class<?>[] parameterTypes = method.getParameterTypes();\n if (parameterTypes.length != 1) continue;\n Class<?> parameterType = parameterTypes[0];\n\n // method have void return type\n Class<?> returnType = method.getReturnType();\n if (returnType != Void.TYPE) continue;\n\n // everything checks out, add mutator to list\n mutators.put(fieldName, new MethodMutatorImpl(method, fieldName, parameterType));\n }\n\n return mutators;\n }", "@JsonValue\n public Map<String, Object> getRegularExpressions()\n {\n if (regularExpressions == null)\n {\n setRegularExpressions(new HashMap());\n }\n return regularExpressions;\n }", "public Map<Class, Erector> getErectors() {\n return erectors;\n }", "public Collection<IRequestHandler<?>> getRegisteredValues() {\n return registry.values();\n }", "public Map<AnnotatedWithParams, BeanPropertyDefinition[]> _findCreatorsFromProperties(DeserializationContext ctxt, BeanDescription beanDesc) throws JsonMappingException {\n Map<AnnotatedWithParams, BeanPropertyDefinition[]> result = Collections.emptyMap();\n for (BeanPropertyDefinition propDef : beanDesc.findProperties()) {\n Iterator<AnnotatedParameter> it = propDef.getConstructorParameters();\n while (true) {\n if (it.hasNext()) {\n AnnotatedParameter param = (AnnotatedParameter) it.next();\n AnnotatedWithParams owner = param.getOwner();\n BeanPropertyDefinition[] defs = (BeanPropertyDefinition[]) result.get(owner);\n int index = param.getIndex();\n if (defs == null) {\n if (result.isEmpty()) {\n result = new LinkedHashMap<>();\n }\n defs = new BeanPropertyDefinition[owner.getParameterCount()];\n result.put(owner, defs);\n } else if (defs[index] != null) {\n throw new IllegalStateException(\"Conflict: parameter #\" + index + \" of \" + owner + \" bound to more than one property; \" + defs[index] + \" vs \" + propDef);\n }\n defs[index] = propDef;\n }\n }\n }\n return result;\n }", "public ArrayList<Exception> getValidateExceptions();", "protected Comparator getNameComparator()\n {\n if(nameComparator == null)\n {\n nameComparator = new SMComponentNameComparator();\n }\n\n return nameComparator;\n }", "public Map<String, Boolean> getIsTypeOptionValidMap() {\n if (typeOptionValidMap == null) {\n typeOptionValidMap = new HashMap<String, Boolean>() {\n @Override\n public Boolean get(Object key) {\n return !(key == null || \"\".equals(key.toString().trim()) || countKeyOccurence(typeOptions, (String) key) > 1);\n }\n };\n }\n return typeOptionValidMap;\n }", "public IContextInformationValidator getContextInformationValidator() {\n\t\treturn fValidator;\n\t}", "public Map<Integer, EngineSpecifications> getMapOfEngineDisplacementCC() {\n\t\tengineDisplacementCCMap = new HashMap<>();\n\n\t\tfor (int i = 0; i < engineDisplacementCC.size(); i++) {\n\t\t\tengineDisplacementCCMap.put(engineDisplacementCC.get(i), engineTypeForEngineDisplacementCC.get(i));\n\t\t}\n\n\t\treturn engineDisplacementCCMap;\n\t}", "public Map<ConstraintType, ClusterConstraints> getConstraintMap() {\n return _constraintMap;\n }", "public List<SchemaDescriptor> getSchemaDescriptor() {\n List<SchemaDescriptor> results = new ArrayList<SchemaDescriptor>();\n try {\n results.add(new TextRegexpSchemaDescriptor(fs, p, typeIdentifier, regexps, schemas));\n } catch (Exception iex) {\n }\n return results;\n }", "@Override\n public Collection<ValidatorMessage> validateForm() throws ValidatorException {\n ReportObjectValidator validator = ValidatorFactory.getInstance().getReportValidator();\n return validator.validate(ptmTable.getAll());\n }" ]
[ "0.70024717", "0.6952873", "0.6902611", "0.6894871", "0.67893183", "0.66997457", "0.6385738", "0.6083203", "0.58523595", "0.5812104", "0.56491566", "0.54684323", "0.54375625", "0.5314673", "0.5292902", "0.5282293", "0.5264063", "0.5252955", "0.51907736", "0.5146373", "0.5110921", "0.5109646", "0.50552213", "0.5032299", "0.5027571", "0.5013675", "0.50126773", "0.49936378", "0.49765277", "0.49746236", "0.4961444", "0.49593312", "0.49387297", "0.49363163", "0.49168387", "0.49167305", "0.49112752", "0.49104562", "0.48935062", "0.48766664", "0.48578694", "0.48404348", "0.48404348", "0.48404348", "0.480802", "0.4801757", "0.47875723", "0.4777228", "0.4773349", "0.4772449", "0.4771461", "0.47416764", "0.4734394", "0.47277027", "0.47275138", "0.47270098", "0.47191092", "0.4696265", "0.46895057", "0.4689062", "0.46858284", "0.4671713", "0.46596372", "0.46584633", "0.4656177", "0.4648689", "0.46447754", "0.46354783", "0.46295238", "0.46232587", "0.45806068", "0.4577467", "0.45563397", "0.45438257", "0.45408916", "0.4537915", "0.45334548", "0.45291963", "0.4522087", "0.45147598", "0.45114672", "0.4510966", "0.45022193", "0.4500339", "0.4477995", "0.44697076", "0.44696066", "0.44682232", "0.44531575", "0.44517323", "0.44491267", "0.44484618", "0.44390452", "0.44389525", "0.44283485", "0.44274217", "0.44254893", "0.4420299", "0.44177553", "0.44043493" ]
0.71959466
0
Gets the plugin names of the validators used by this validator. FIXME: this operation is Eclipsespecific. Move it to an interface in com.choicemaker.cm.validation.eclipse
public String[] getValidatorNames();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<String> getPluginNames() {\n\t\tList<String> pluginNames = new ArrayList<String>();\n\t\tfor (Plugin plugin : pluginManager.getPlugins(Plugin.class)) {\n\t\t\tif (StringUtils.isEmpty(plugin.getName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpluginNames.add(plugin.getName().trim());\n\t\t}\n\t\treturn pluginNames;\n\t}", "public String[] getValidators()\r\n {\r\n return m_validators;\r\n }", "List<FormValidator> getValidators();", "public List<String> getAllPluginNames() {\n\t\treturn allPluginNames;\n\t}", "public List<Validator> getValidators() {\n return Collections.unmodifiableList(validators);\n }", "public IValidator[] getValidators();", "public List<ModelValidator> getDetailedValidators() {\n return detailedValidators;\n }", "public interface IAggregateValidator extends IValidator {\n\n\t/**\n\t * Gets a map of names to instances of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty map of name to delegate validators.\n\t */\n\tpublic Map getValidatorMap();\n\n\t/**\n\t * Gets the plugin names of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty array of validator names.\n\t */\n\tpublic String[] getValidatorNames();\n\n\t/**\n\t * Gets the validators used by this validator.\n\t * @return a non-null, but possibly empty array of delegate validators.\n\t */\n\tpublic IValidator[] getValidators();\n\n}", "public Set<String> getPluginDependencyNames() { return pluginDependencyNames; }", "public Collection<Plugin> getPlugins()\n {\n final List<Plugin> plugins;\n synchronized ( this )\n {\n plugins = Arrays.asList(pluginsLoaded.values().toArray(new Plugin[0]));\n }\n return Collections.unmodifiableCollection( plugins );\n }", "public List<ModelValidator> getBasicValidators() {\n return basicValidators;\n }", "List<QuestionPlugin> getQuestionPlugins();", "private String[] detectPlugins() {\n \t\t\tchangeStampIsValid = false;\n \t\t\tpluginsChangeStampIsValid = false;\n \t\t\tparent.changeStampIsValid = false;\n \t\t\tparent.pluginsChangeStampIsValid = false;\n \n \t\t\tplugins = new ArrayList();\n \n \t\t\tif (!supportsDetection(resolvedURL))\n \t\t\t\treturn new String[0];\n \n \t\t\t// locate plugin entries on site\n \t\t\tFile root = new File(resolvedURL.getFile().replace('/', File.separatorChar) + PLUGINS);\n \t\t\tString[] list = root.list();\n \t\t\tString path;\n \t\t\tFile plugin;\n \t\t\tfor (int i = 0; list != null && i < list.length; i++) {\n \t\t\t\tpath = list[i] + File.separator + PLUGIN_XML;\n \t\t\t\tplugin = new File(root, path);\n \t\t\t\tif (!plugin.exists()) {\n \t\t\t\t\tpath = list[i] + File.separator + FRAGMENT_XML;\n \t\t\t\t\tplugin = new File(root, path);\n \t\t\t\t\tif (!plugin.exists())\n \t\t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tplugins.add(PLUGINS + \"/\" + path.replace(File.separatorChar, '/')); //$NON-NLS-1$\n \t\t\t}\n \t\t\tif (DEBUG) {\n \t\t\t\tdebug(resolvedURL.toString() + \" located \" + plugins.size() + \" plugin(s)\"); //$NON-NLS-1$ //$NON-NLS-2$\n \t\t\t}\n \n \t\t\treturn (String[]) plugins.toArray(new String[0]);\n \t\t}", "Set<DependencyDescriptor> getPluginDependencyDescriptors() {\n return pluginDependencyDescriptors;\n }", "private List<Object> pluginPropertyDefinitions() {\n List<Object> extensions = new ArrayList<>();\n extensions.add(getProperty(Constants.ENABLED, \"Plugin enabled\",\n \"Are Teams notifications enabled in general?\",\n \"false\", PropertyType.BOOLEAN));\n extensions.add(getProperty(Constants.BYPASS_HTTPS_VALIDATION, \"Bypass HTTPS Validation\",\n \"Bypass SSL/TLS certificate validation on HTTPS requests (useful for proxies)\",\n \"false\", PropertyType.BOOLEAN));\n extensions.add(getProperty(Constants.PROXY_IP, \"Proxy Server\",\n \"Domain or IP address of proxy server to use\",\n \"\", PropertyType.STRING));\n extensions.add(getProperty(Constants.PROXY_PORT, \"Proxy Port\",\n \"Port for the proxy server\",\n \"8080\", PropertyType.INTEGER));\n extensions.add(getProperty(Constants.PROXY_USER, \"Proxy User\",\n \"User name for proxy authentication\",\n \"\", PropertyType.STRING));\n extensions.add(getProperty(Constants.PROXY_PASS, \"Proxy Password\",\n \"Password for proxy authentication\",\n \"\", PropertyType.PASSWORD));\n return extensions;\n }", "public String getValidatorClassName() {\n return configurationName + \"Validator\";\n }", "public final static List<KaranteeniPlugin> getPluginInstances() {\r\n\t\treturn new ArrayList<KaranteeniPlugin>(kPluginInstances.values());\r\n\t}", "java.util.List<com.google.wireless.android.sdk.stats.BuildAttributionPluginIdentifier>\n getIncompatiblePluginsList();", "public static List<String> getPluginsByType(PluginType t){\r\n\t\tMap<String, Class<IKomorebiPlugin>> plugins = instance.pluginRegister.get(t);\r\n\t\tif(plugins == null){\r\n\t\t\treturn new ArrayList<String>();\r\n\t\t}\r\n\t\treturn new ArrayList<String>(plugins.keySet());\r\n\t}", "public static Set<String> getPluginNamesOfType(String interfaceName) { \n if (PLUGINS.get(interfaceName) != null) {\n return PLUGINS.get(interfaceName).keySet();\n }\n \n return null;\n }", "public JSONObject getPlugins() {\r\n\t\tJSONObject plugins = (JSONObject) super.get(PLUGINS_FIELD_NAME);\r\n\t\tif (plugins == null) {\r\n\t\t\tplugins = new JSONObject();\r\n\t\t\tsuper.put(PLUGINS_FIELD_NAME, plugins);\r\n\t\t}\r\n\t\treturn plugins;\r\n\t}", "public List<CandidateValidator> getValidators(List<CandidateValidatorType> validatorTypes) {\n\n\t\tList<CandidateValidator> toReutrn = new LinkedList<>();\n\n\t\tthis.validators.stream().filter(v -> handlesAny(v, validatorTypes)).forEach(toReutrn::add);\n\t\treturn toReutrn;\n\t}", "public static List<String[]> getPluginDomains() {\r\n final List<String[]> ret = new ArrayList<String[]>();\r\n // each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain\r\n ret.add(new String[] { \"brfiles.com\" });\r\n return ret;\r\n }", "public String getPluginName(){\n\t\treturn pluginName;\n\t}", "public PluginLocation[] getBuiltinPluginLocations()\r\n {\r\n java.lang.String conf = \"/net/sf/xpontus/plugins/plugins.txt\";\r\n\r\n InputStream is = null;\r\n LineIterator it = null;\r\n\r\n List<PluginLocation> locations = new ArrayList<PluginLocation>();\r\n\r\n try\r\n {\r\n is = getClass().getResourceAsStream(conf);\r\n it = IOUtils.lineIterator(is, \"UTF-8\");\r\n\r\n while (it.hasNext())\r\n {\r\n String line = it.nextLine();\r\n\r\n PluginLocation loc = getPluginLocation(line);\r\n locations.add(loc);\r\n }\r\n }\r\n catch (IOException ex)\r\n {\r\n LOG.error(ex.getMessage(), ex);\r\n }\r\n finally\r\n {\r\n if (is != null)\r\n {\r\n IOUtils.closeQuietly(is);\r\n }\r\n\r\n if (it != null)\r\n {\r\n LineIterator.closeQuietly(it);\r\n }\r\n }\r\n\r\n return (PluginLocation[]) locations.toArray(new PluginLocation[0]);\r\n }", "@VisibleForTesting\n List<TimelineEntityGroupPlugin> getPlugins() {\n return cacheIdPlugins;\n }", "public Map getValidatorMap();", "private Vector<String> getSwingClassNames() {\n List<ClassLoader> classLoadersList = new LinkedList<>();\n classLoadersList.add(ClasspathHelper.contextClassLoader());\n classLoadersList.add(ClasspathHelper.staticClassLoader());\n\n Reflections reflections = new Reflections(new ConfigurationBuilder()\n .setScanners(new SubTypesScanner(false), new ResourcesScanner())\n .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0])))\n .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(\"javax.swing\"))));\n\n Set<Class<? extends JComponent>> classes = reflections.getSubTypesOf(JComponent.class);\n\n Vector<String> classNames = new Vector<>();\n for (Class<?> cls : classes) {\n if (cls.getSimpleName().length() > 0 && cls.getSimpleName().charAt(0) == 'J') {\n classNames.add(cls.getSimpleName() + \" (\" + cls.getName() + \")\");\n }\n }\n\n return classNames;\n }", "private List<IUserLoginPlugin> getLoginPlugins()\n/* */ {\n/* 341 */ if (this.plugins == null)\n/* 342 */ this.plugins = PluginManager.newIns().getExtInstances(\"loginplugin\", IUserLoginPlugin.class);\n/* 343 */ return this.plugins;\n/* */ }", "public XCN[] getAdministeringProvider() {\r\n \tXCN[] retVal = this.getTypedField(10, new XCN[0]);\r\n \treturn retVal;\r\n }", "public List<String> validate() {\n\t\t\n\t\tList<String> validationMessages = new ArrayList<String>();\n\t\tvalidate(validationMessages);\n\t\treturn validationMessages;\n\t}", "java.util.List<? extends com.google.wireless.android.sdk.stats.BuildAttributionPluginIdentifierOrBuilder>\n getIncompatiblePluginsOrBuilderList();", "public static String[] getAcceptedExtensions()\n\t{\n\t\tArrayList<String> acceptedExtensions = new ArrayList<String>();\n\n\t\tfor (ImageWriter imageWriter : imageWriters)\n\t\t{\n\t\t\tString[] imageFormats = imageWriter.getAcceptedImageFormats();\n\n\t\t\tif (imageFormats != null)\n\t\t\t{\n\t\t\t\tfor (String format : imageFormats)\n\t\t\t\t{\n\t\t\t\t\tacceptedExtensions.add(format);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tString[] toReturn = null;\n\t\treturn (String[])acceptedExtensions.toArray( toReturn );\n\t}", "public static List<LanguageInterpreterDescriptor> getRegisteredInterpreters() {\r\n\t\treturn new ArrayList<LanguageInterpreterDescriptor>(INTERPRETERS);\r\n\t}", "int getIncompatiblePluginsCount();", "public String searchExportedPlugins()\n\t{\n\t\tFile parent = null;\n\t\tif (System.getProperty(\"eclipse.home.location\") != null)\n\t\t\tparent = new File(URI.create(System.getProperty(\"eclipse.home.location\").replaceAll(\" \", \"%20\")));\n\t\telse parent = new File(System.getProperty(\"user.dir\"));\n\n\t\tList<String> pluginLocations = exportModel.getPluginLocations();\n\t\tfor (String libName : NG_LIBS)\n\t\t{\n\t\t\tint i = 0;\n\t\t\tboolean found = false;\n\t\t\twhile (!found && i < pluginLocations.size())\n\t\t\t{\n\t\t\t\tFile pluginLocation = new File(pluginLocations.get(i));\n\t\t\t\tif (!pluginLocation.isAbsolute())\n\t\t\t\t{\n\t\t\t\t\tpluginLocation = new File(parent, pluginLocations.get(i));\n\t\t\t\t}\n\t\t\t\tFileFilter filter = new WildcardFileFilter(libName);\n\t\t\t\tFile[] libs = pluginLocation.listFiles(filter);\n\t\t\t\tif (libs != null && libs.length > 0)\n\t\t\t\t{\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (!found) return libName;\n\t\t}\n\t\treturn null;\n\t}", "java.util.List<? extends com.google.wireless.android.sdk.stats.CriticalPathAnalyzerData.PluginBuildDataOrBuilder>\n getPluginsCriticalPathOrBuilderList();", "public Set < String > getListeningPluginChannels ( ) {\n\t\treturn extract ( handle -> handle.getListeningPluginChannels ( ) );\n\t}", "public Collection<String> getPhaseProviders() {\n List<String> phaseProviders = new ArrayList<String>();\n for (IMixinPlatformAgent agent : this.agents) {\n String phaseProvider = agent.getPhaseProvider();\n if (phaseProvider != null) {\n phaseProviders.add(phaseProvider);\n }\n }\n return phaseProviders;\n }", "public Map<String, String> getPluginIdentifierToNameMap() {\n\t\treturn pluginIdentifierToNameMap;\n\t}", "@Override\n public String getPluginName() {\n return null;\n }", "@Override\n public String getPluginName() {\n return null;\n }", "java.util.List<com.google.wireless.android.sdk.stats.CriticalPathAnalyzerData.PluginBuildData>\n getPluginsCriticalPathList();", "public List<String> getRulesName(){\r\n\t\tList<String> names = new ArrayList<String>();\r\n\r\n\t\tfor(Column c: columns)\r\n\t\t\tnames.add(c.getRuleName());\r\n\r\n\t\treturn names;\r\n\t}", "@NotNull\n List<NlComponentEditor> getEditors();", "public String[] getNames() {\n\t\tString[] names = new String[functions.size()];\n\t\tint index = 0;\n\t\tfor (Enumeration en = functions.keys(); en.hasMoreElements(); index++) {\n\t\t\tnames[index] = (String) en.nextElement();\n\t\t}\n\t\treturn names;\n\t}", "@Override\n public Set<String> getFacetNames() {\n if (_subBrowsers.length == 0) {\n return null;\n }\n return _subBrowsers[0].getFacetNames();\n }", "public List getPluginInfoList(String pluginType) {\n\t\treturn (List) pluginTypeInfoMap.get(pluginType);\n\t}", "@Serialize//(getName = \"property\")\r\n public List<String> getPluginPoints()\r\n\t{\r\n\t\treturn _pluginPoints; \r\n\t}", "public interface IValidator\n{\n /**\n * \n * @return the validator bean name\n */\n String getValidatorBeanName( );\n\n /**\n * \n * @return the validator display name\n */\n String getValidatorDisplayName( );\n\n /**\n * @param control\n * The control to build model\n * @return the HTML to display\n */\n String getDisplayHtml( Control control );\n\n /**\n * \n * @return the list of available entrytype for this validator\n */\n List<String> getListAvailableEntryType( );\n\n /**\n * @param questionResponse\n * The response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( FormQuestionResponse questionResponse, Control control );\n\n /**\n * @param questionResponse\n * The List response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( List<FormQuestionResponse> questionResponse, Control control );\n\n /**\n * Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE\n * \n * @return the javascript validation code for Conditional display control\n * \n */\n String getJavascriptValidation( );\n\n /**\n * @param control\n * The control\n * @return the control value needed for javascript\n */\n String getJavascriptControlValue( Control control );\n\n}", "protected FileNameExtensionFilter[] getExtensions()\n {\n List<FileNameExtensionFilter> filters = new ArrayList<FileNameExtensionFilter>();\n\n // Step through each engine factory\n for (ScriptEngineFactory factory : scriptFactories)\n {\n // Get the engine language name\n String name = factory.getLanguageName();\n\n // Check if the name begins with \"ECMA\"\n if (name.toLowerCase().startsWith(\"ecma\"))\n {\n // Use \"JavaScript\" in place of \"ECMAScript\"\n name = \"JavaScript\";\n }\n // Not JavaScript\n else\n {\n // Capitalize the first letter of the engine name\n name = Character.toString(name.charAt(0)).toUpperCase()\n + name.substring(1);\n }\n\n // Add the engine extension to the list\n filters.add(new FileNameExtensionFilter(name + \" files\",\n factory.getExtensions().toArray(new String[0])));\n }\n\n // Sort the engine extensions by extension description\n Collections.sort(filters, new Comparator<FileNameExtensionFilter>()\n {\n /******************************************************************\n * Compare the descriptions of two engine extensions. Force lower\n * case to eliminate case differences in the comparison\n *****************************************************************/\n @Override\n public int compare(FileNameExtensionFilter ext1, FileNameExtensionFilter ext2)\n {\n return ext1.getDescription().toLowerCase().compareTo(ext2.getDescription().toLowerCase());\n }\n });\n\n return filters.toArray(new FileNameExtensionFilter[0]);\n }", "public String[] getInitiators() { return this.initiators; }", "@Nonnull @NotEmpty public Map<PluginVersion, VersionInfo> getAvailableVersions() {\n ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);\n return versionInfo;\n }", "private void setValidators() {\n getUtils().addNoNumbers(getOriginTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDestinationTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getCollectionPlaceTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDeliveryPlaceTxt(), getValidatorTxt());\n getUtils().eurosListener(getTravelValueTxt(), getValidatorTxt());\n getUtils().eurosListener(getMoneyforDriverTxt(), getValidatorTxt());\n getUtils().eurosListener(getCustomsTxt(), getValidatorTxt());\n getUtils().eurosListener(getOtherExpensesTxt(), getValidatorTxt());\n getUtils().eurosListener(getShippingExpensesTxt(), getValidatorTxt());\n //No listenerValidator for distance because, finally it is a string\n// getUtils().distanceListener(getDistanceTxt(), getValidatorTxt());\n getUtils().dateValidator(getDateTxt(), getValidatorTxt());\n getUtils().timeListener(getArriveHourTxt(), getValidatorTxt());\n getUtils().timeListener(getExitHourTxt(), getValidatorTxt());\n getUtils().timeListener(getProvidedHourTxt(), getValidatorTxt());\n\n }", "Collection<PropertyValidationAnnotationHandler> getPropertyHandlers();", "public void initializeValidators(String[] validatorNames, ONDEXGraph graph) {\n if (validatorLogger == null) {\n validatorLogger = new ONDEXPluginLogger();\n }\n for (String validator : validatorNames) {\n String className = \"net.sourceforge.ondex.validator.\" + validator.toLowerCase() + \".Validator\";\n if (ValidatorRegistry.validators.keySet().contains(className)) {\n continue;\n }\n try {\n Class<?> validatorClass = Class.forName(className);\n Class<?>[] args = new Class<?>[] {};\n Constructor<?> constructor = validatorClass.getClassLoader().loadClass(className).getConstructor(args);\n AbstractONDEXValidator validatorInstance = (AbstractONDEXValidator) constructor.newInstance(new Object[] {});\n ValidatorRegistry.validators.put(validator.toLowerCase(), validatorInstance);\n File vout = new File(Config.ondexDir + File.separator + \"dbs\" + File.separator + graph.getName() + File.separator + \"validatorsout\" + File.separator + validatorInstance.getName());\n vout.mkdirs();\n vout.deleteOnExit();\n ValidatorArguments va = new ValidatorArguments();\n va.setInputDir(Config.ondexDir + File.separator + \"importdata\" + File.separator + validator.toLowerCase());\n System.out.println(\"Validator input dir ==> \" + va.getInputDir());\n va.setOutputDir(vout.getAbsolutePath());\n if (validatorInstance.requiresIndexedGraph()) {\n LuceneEnv lenv = getIndex(graph, validatorInstance.getName());\n }\n validatorInstance.addValidatorListener(validatorLogger);\n validatorInstance.setArguments(va);\n validatorInstance.start();\n } catch (ClassNotFoundException e) {\n fireEventOccurred(new InvalidArgumentEvent(validator.toLowerCase() + \" validator \" + className + \" does not exist\"));\n } catch (SecurityException e) {\n e.printStackTrace();\n } catch (IllegalArgumentException e) {\n e.printStackTrace();\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }", "protected WizardDescriptor.Panel[] getPanels() {\n if (panels == null) {\n panels = new WizardDescriptor.Panel[]{\n new ProjectImportWizardPanel1()\n };\n String[] steps = new String[panels.length];\n for (int i = 0; i < panels.length; i++) {\n Component c = panels[i].getComponent();\n // Default step name to component name of panel. Mainly useful\n // for getting the name of the target chooser to appear in the\n // list of steps.\n steps[i] = c.getName();\n if (c instanceof JComponent) { // assume Swing components\n JComponent jc = (JComponent) c;\n // Sets step number of a component\n jc.putClientProperty(\"WizardPanel_contentSelectedIndex\", new Integer(i));\n // Sets steps names for a panel\n jc.putClientProperty(\"WizardPanel_contentData\", steps);\n // Turn on subtitle creation on each step\n jc.putClientProperty(\"WizardPanel_autoWizardStyle\", Boolean.TRUE);\n // Show steps on the left side with the image on the background\n jc.putClientProperty(\"WizardPanel_contentDisplayed\", Boolean.FALSE);\n // Turn on numbering of all steps\n jc.putClientProperty(\"WizardPanel_contentNumbered\", Boolean.TRUE);\n }\n }\n }\n return panels;\n }", "public List<IRuleParser> getRuleParsers() {\n return ruleParsers;\n }", "public Collection<AbstractFilterPlugin> getFilters();", "public interface Plugin\n{\n\tpublic String getPluginName();\n}", "public String getPlugin() {\n\t\treturn adaptee.getPlugin();\n\t}", "public Collection<AbstractReaderPlugin> getReaders();", "public PropertyResourceBundle getPluginProperties() {\r\n\t\tif (pluginProperties == null) {\r\n\t\t\ttry {\r\n\t\t\t\tpluginProperties = JDTUtil.getPluginProperties(getBundle());\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.error(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn pluginProperties;\r\n\t}", "public Set<String> getStrategiesNames () {\n\t\treturn Collections.unmodifiableSet(serviceProvider.getStrategies().keySet());\n\t}", "public List<PluginWrapper> getSortedPlugins() throws PluginException {\r\n\t\tDirectedGraph<String> graph = new DirectedGraph<String>();\r\n\t\tfor (PluginWrapper pluginWrapper : plugins) {\r\n\t\t\tPluginDescriptor descriptor = pluginWrapper.getDescriptor();\r\n\t\t\tString pluginId = descriptor.getPluginId();\r\n\t\t\tList<PluginDependency> dependencies = descriptor.getDependencies();\r\n\t\t\tif (!dependencies.isEmpty()) {\r\n\t\t\t\tfor (PluginDependency dependency : dependencies) {\r\n\t\t\t\t\tgraph.addEdge(pluginId, dependency.getPluginId());\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tgraph.addVertex(pluginId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlog.debug(\"Graph: {}\", graph);\r\n\t\tList<String> pluginsId = graph.reverseTopologicalSort();\r\n\r\n\t\tif (pluginsId == null) {\r\n\t\t\tthrow new CyclicDependencyException(\"Cyclic dependences !!!\" + graph.toString());\r\n\t\t}\r\n\r\n\t\tlog.debug(\"Plugins order: {}\", pluginsId);\r\n\t\tList<PluginWrapper> sortedPlugins = new ArrayList<PluginWrapper>();\r\n\t\tfor (String pluginId : pluginsId) {\r\n\t\t\tsortedPlugins.add(getPlugin(pluginId));\r\n\t\t}\r\n\r\n\t\treturn sortedPlugins;\r\n\t}", "Iterable<String> getRegisteredNames();", "public List<String> getOptionsNames();", "public String[] getPropertyNames()\n {\n return ClassAnalyzer.getPropertyNames(m_Source.getClass());\n }", "List<RecordItemValidatorIF> getItemValidators();", "public String[] getTags() {\n WindowManager wm = TopManager.getDefault().getWindowManager();\n Workspace[] wss = wm.getWorkspaces();\n if (!namesInitialized) {\n namesInitialized = true;\n initializeNamesMap(wss);\n }\n // exclude browsing, running and debugging workspaces\n java.util.Vector tagList = new java.util.Vector ();\n for (int i = wss.length; --i >= 0; ) {\n String name = wss[i].getName();\n if (!(\"Browsing\".equals (name) || \"Running\".equals (name) || \"Debugging\".equals (name))) { // NOI18N\n tagList.add(name);\n }\n }\n // XXX(-tdt)\n // tagList.add(NbBundle.getBundle(WorkspaceEditor.class).getString(\"VALUE_WORKSPACE_NONE\"));\n String[] names = new String [tagList.size()];\n for (int i=0, n=tagList.size(); i<n; i++)\n names[i] = (String)namesMap.get(tagList.get(i));\n return names;\n }", "public Collection getBasicValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tString className = getClassName();\n\n\t\tlist.add(createClassExistenceComponent(className));\n\t\tlist.add(createClassPersistenceComponent(className));\n\n\t\tlist.addAll(getDatabaseValidationList());\n\t\tlist.addAll(getFieldsValidationList());\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "Iterable<String> getModuleNames();", "@GET\n @Path(\"/typesByPlugin\")\n public Map<Long, List<PluginType>> getTypesByPlugin() {\n return definitionsService.getTypesByPlugin();\n }", "@ApplicationScoped\n\t@Produces\n\tpublic Multimap<Class<?>, AbstractValidator<?>> create() {\n\t\tMultimap<Class<?>, AbstractValidator<?>> map = ArrayListMultimap.create();\n\t\tIterator<AbstractValidator<?>> iter = validators.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tAbstractValidator<?> validator = iter.next();\n\t\t\tClass<?> validatorBeanClass = Reflections.getGenericTypeArgument(validator.getClass(), 0);\n\t\t\tif (!validatorBeanClass.isAnnotationPresent(Ignore.class)) {\n\t\t\t\tmap.put(validatorBeanClass, validator);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "public String getPluginClassAttrNs() {\n return pluginClassAttrNs;\n }", "@Override\n\tpublic String getPluginName() {\n\t\treturn \"TextareaPlugin\";\n\t}", "public String getValidatorProperty() {\n return _validatorProperty;\n }", "private WizardDescriptor.Panel[] getPanels() {\n if (panels == null) {\n panels = new WizardDescriptor.Panel[]{\n new TCRWizardPanel1(),\n// new TCRWizardPanel2(),\n new UtilWizardPanel1(),\n new UtilWizardPanel2()\n };\n String[] steps = createSteps();\n for (int i = 0; i < panels.length; i++) {\n Component c = panels[i].getComponent();\n if (steps[i] == null) {\n // Default step name to component name of panel. Mainly\n // useful for getting the name of the target chooser to\n // appear in the list of steps.\n steps[i] = c.getName();\n }\n if (c instanceof JComponent) { // assume Swing components\n JComponent jc = (JComponent) c;\n // Sets step number of a component\n // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:\n jc.putClientProperty(\"WizardPanel_contentSelectedIndex\", new Integer(i));\n // Sets steps names for a panel\n jc.putClientProperty(\"WizardPanel_contentData\", steps);\n // Turn on subtitle creation on each step\n jc.putClientProperty(\"WizardPanel_autoWizardStyle\", Boolean.TRUE);\n // Show steps on the left side with the imageWithChars on the background\n jc.putClientProperty(\"WizardPanel_contentDisplayed\", Boolean.TRUE);\n // Turn on numbering of all steps\n jc.putClientProperty(\"WizardPanel_contentNumbered\", Boolean.TRUE);\n }\n }\n }\n return panels;\n }", "public String[] getInputConnectorNames();", "public static Set<Analyzer> getRegisteredAnalyzers() {\n\t\tHashSet<Analyzer> analyzers = new HashSet<Analyzer>();\n\t\tfor (Analyzer analyzer : ANALYZERS) {\n\t\t\tanalyzers.add(analyzer);\n\t\t}\n\t\treturn analyzers;\n\t}", "public static List<String> getNames() {\n return Collections.unmodifiableList(widgetNames);\n }", "public String[] getSelectedSchemas()\n {\n return coreSchemaSelectionWidget.getSelectedCoreSchemas();\n }", "public Set<YValidationAspekt> validateComponent() {\r\n\t\tthis.foundErrors = EnumSet.noneOf(YValidationAspekt.class);\r\n\t\tthis.foundWarnings = EnumSet.noneOf(YValidationAspekt.class);\r\n\r\n\t\tassertModelSpecification();\r\n\t\tassertModelImplementation();\r\n\r\n\t\tassertIdAndVarName();\r\n\t\tassertProperties();\r\n\r\n\t\treturn this.foundErrors;\r\n\t}", "public abstract List<String> getValidDescriptors();", "public static String[] getInfo(){\n\t\n\t\treturn new String[]{\n\t\t\t\t\"plugin_name\",\n\t\t\t\t\"plugin_host\",\n\t\t\t\t\"plugin_version\",\n\t\t\t\t\"plugin_author\"\n\t\t};\n\t\t\t\t\n\t}", "private WizardDescriptor.Panel[] getPanels() {\n if (panels == null) {\n panels = new WizardDescriptor.Panel[] {\n new WebLogicDDWizardPanel()\n };\n String[] steps = createSteps();\n for (int i = 0; i < panels.length; i++) {\n Component c = panels[i].getComponent();\n if (steps[i] == null) {\n // Default step name to component name of panel. Mainly\n // useful for getting the name of the target chooser to\n // appear in the list of steps.\n steps[i] = c.getName();\n }\n if (c instanceof JComponent) { // assume Swing components\n JComponent jc = (JComponent) c;\n // Sets step number of a component\n jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); // NOI18N\n // Sets steps names for a panel\n jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N\n // Turn on subtitle creation on each step\n jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N\n // Show steps on the left side with the image on the background\n jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N\n // Turn on numbering of all steps\n jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N\n }\n }\n }\n return panels;\n }", "public Collection getESBManagerNames()\n {\n \treturn( getFrameworkXMLParser().getAttributesForEachOccurance( \"esbManager\", \"name\" ) );\n }", "public void testAllPlugins() throws ProcessingException {\n JavaNet net = JavaNet.connect();\n JNProject hudson = net.getProject(\"hudson\");\n\n JNIssueComponent comp = hudson.getIssueTracker().getComponent(\"hudson\");\n\n Set<String> names = new HashSet<String>();\n for(String n : comp.getSubcomponents().keySet())\n names.add(n.toLowerCase());\n\n Set<String> problems = new TreeSet<String>();\n\n JNFileFolder folder = hudson.getFolder(\"/plugins\");\n for( JNFileFolder plugin : folder.getSubFolders().values() ) {\n String n = plugin.getName().toLowerCase();\n if(n.equals(\"bco\"))\n continue; // this isn't a plugin in Hudson SVN\n if(n.equals(\"ivy2\"))\n continue; // merged to the ivy plugin\n if(names.contains(n) || names.contains(n+\"-plugin\"))\n continue; // OK\n problems.add(plugin.getName());\n }\n if(!problems.isEmpty())\n fail(problems+\" doesn't have a component\");\n }", "public HtmlValidatorText getValidator() {\r\n\t\treturn _validator;\r\n\t}", "public List<String> getLinkedComponentNames() {\n return linkedComponentNames;\n }", "public String[] getMessageProcessorNames() throws AxisFault {\n SynapseConfiguration configuration = getSynapseConfiguration();\n\n assert configuration != null;\n Collection<String> names = configuration.getMessageProcessors().keySet();\n return names.toArray(new String[names.size()]);\n }", "public static Set<String> getRegisteredParameterNames() {\n\n\t\treturn REGISTERED_PARAMETER_NAMES;\n\t}", "public CellEditorListener[] getCellEditorListeners()\n {\n return myListenerList.getListeners(CellEditorListener.class);\n }", "private WizardDescriptor.Panel[] getPanels() {\n Project project = Templates.getProject(wizard);\n File f1 = new File(\"src\");\n \n // Templates.setTargetFolder(wizard);\n\n Sources sources = project.getLookup().lookup(Sources.class);\n SourceGroup[] sg = sources.getSourceGroups(Sources.TYPE_GENERIC);\n \n if (panels == null) {\n targetChooserPanel = \n Templates.createSimpleTargetChooser(project, sg);\n panels = new WizardDescriptor.Panel[]{\n targetChooserPanel\n };\n String[] steps = createSteps();\n for (int i = 0; i < panels.length; i++) {\n Component c = panels[i].getComponent();\n if (steps[i] == null) {\n // Default step name to component name of panel. Mainly\n // useful for getting the name of the target chooser to\n // appear in the list of steps.\n steps[i] = c.getName();\n }\n if (c instanceof JComponent) { // assume Swing components\n JComponent jc = (JComponent) c;\n // Sets step number of a component\n // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:\n jc.putClientProperty(\"WizardPanel_contentSelectedIndex\", Integer.valueOf(i));\n // Sets steps names for a panel\n jc.putClientProperty(\"WizardPanel_contentData\", steps);\n // Turn on subtitle creation on each step\n jc.putClientProperty(\"WizardPanel_autoWizardStyle\", Boolean.TRUE);\n // Show steps on the left side with the image on the background\n jc.putClientProperty(\"WizardPanel_contentDisplayed\", Boolean.TRUE);\n // Turn on numbering of all steps\n jc.putClientProperty(\"WizardPanel_contentNumbered\", Boolean.TRUE);\n }\n }\n }\n return panels;\n }", "public String[] getAllDependencyExtensions();", "public List getRuleFinders() {\n if (ruleFinders == null) {\n // when processing a plugin declaration, attempts are made to\n // find custom rules in the order in which the Finder objects\n // are added below. However this list can be modified\n ruleFinders = new LinkedList();\n ruleFinders.add(new FinderFromFile());\n ruleFinders.add(new FinderFromResource());\n ruleFinders.add(new FinderFromClass());\n ruleFinders.add(new FinderFromMethod());\n ruleFinders.add(new FinderFromDfltMethod());\n ruleFinders.add(new FinderFromDfltClass());\n ruleFinders.add(new FinderFromDfltResource());\n ruleFinders.add(new FinderFromDfltResource(\".xml\"));\n ruleFinders.add(new FinderSetProperties());\n }\n return ruleFinders;\n }", "Form setValidators(List<FormValidator> validators);", "public interface FormValidator {\r\n\r\n /**\r\n * Performs on-the-fly validation of the form field 'name'.\r\n *\r\n * @param value This parameter receives the value that the user has typed.\r\n * @return Indicates the outcome of the validation. This is sent to the\r\n * browser.\r\n */\r\n default FormValidation doCheckArtifactId(@QueryParameter String value) {\r\n if (value.length() == 0)\r\n return FormValidation.error(\"Please set an ArtifactId!\");\r\n return FormValidation.ok();\r\n }\r\n\r\n default FormValidation doCheckGroupId(@QueryParameter String value) {\r\n if (value.length() == 0)\r\n return FormValidation.error(\"Please set a GroupId!\");\r\n return FormValidation.ok();\r\n }\r\n\r\n default FormValidation doCheckVersion(@QueryParameter String value) {\r\n if (value.length() == 0)\r\n return FormValidation\r\n .error(\"Please set a Version for your artifact!\");\r\n return FormValidation.ok();\r\n }\r\n\r\n default FormValidation doCheckStagingRepository(\r\n @QueryParameter String value) {\r\n return checkURI(value);\r\n }\r\n\r\n default FormValidation doCheckReleaseRepository(\r\n @QueryParameter String value) {\r\n return checkURI(value);\r\n }\r\n\r\n /**\r\n * This method checks originally the URL if it is valid. On the way to\r\n * support tokens this behavior is build out. It will be reactivated\r\n * after a general refactoring for better token macro support.\r\n * <p>\r\n * TODO implment a URL validation which works with token macro plugin\r\n *\r\n * @param value\r\n * @return\r\n */\r\n default FormValidation checkURI(String value) {\r\n if (value.length() == 0) {\r\n return FormValidation\r\n .error(\"Please set an URL for the staging repository!\");\r\n }\r\n return FormValidation.ok();\r\n }\r\n\r\n /**\r\n * Generates LisBoxModel for available Repository systems\r\n *\r\n * @return available Promoters as ListBoxModel\r\n */\r\n default ListBoxModel doFillPromoterClassItems() {\r\n ListBoxModel promoterModel = new ListBoxModel();\r\n for (Promotor promotor : Jenkins.getInstance()\r\n .getExtensionList(Promotor.class)) {\r\n promoterModel.add(promotor.getDescriptor().getDisplayName(), promotor\r\n .getClass().getCanonicalName());\r\n }\r\n\r\n return promoterModel;\r\n }\r\n\r\n}", "public static Set<String> getRegisteredParameterNames() {\n\n return REGISTERED_PARAMETER_NAMES;\n }", "public String getLocators() {\n return agentConfig.getLocators();\n }" ]
[ "0.6969469", "0.6640481", "0.6399122", "0.63221663", "0.621367", "0.6114746", "0.6080746", "0.58773047", "0.5861151", "0.5735063", "0.56072235", "0.5578562", "0.55071807", "0.5483548", "0.5471386", "0.54676896", "0.5464017", "0.54457134", "0.54240954", "0.53479487", "0.53165704", "0.52629733", "0.52628934", "0.5176651", "0.5176058", "0.5166092", "0.5150708", "0.5145153", "0.51420236", "0.51214784", "0.51104945", "0.5085856", "0.50793004", "0.5077265", "0.5050912", "0.50285065", "0.5011708", "0.50035274", "0.49845806", "0.49646324", "0.4957252", "0.4957252", "0.49023142", "0.48966455", "0.48809537", "0.48776293", "0.48522326", "0.48392388", "0.48379725", "0.48311722", "0.48301408", "0.48196122", "0.48103097", "0.480612", "0.48017785", "0.47996178", "0.47882214", "0.4784913", "0.47831208", "0.4780684", "0.47701555", "0.47698215", "0.4759017", "0.47563735", "0.47556916", "0.47515857", "0.47503677", "0.47320214", "0.4728649", "0.47266597", "0.4710523", "0.46985158", "0.46947408", "0.4694046", "0.46887687", "0.46850368", "0.46827", "0.46792337", "0.4668572", "0.46650612", "0.46649137", "0.46635076", "0.4658393", "0.46541357", "0.46509242", "0.46283123", "0.4627185", "0.4618622", "0.46122363", "0.46065697", "0.4588359", "0.45738652", "0.4572332", "0.4566522", "0.45664072", "0.4562304", "0.45611474", "0.45586058", "0.45576984", "0.4549748" ]
0.7038495
0
Gets the validators used by this validator.
public IValidator[] getValidators();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Validator> getValidators() {\n return Collections.unmodifiableList(validators);\n }", "public String[] getValidators()\r\n {\r\n return m_validators;\r\n }", "List<FormValidator> getValidators();", "public List<ModelValidator> getDetailedValidators() {\n return detailedValidators;\n }", "public List<ModelValidator> getBasicValidators() {\n return basicValidators;\n }", "public List<CandidateValidator> getValidators(List<CandidateValidatorType> validatorTypes) {\n\n\t\tList<CandidateValidator> toReutrn = new LinkedList<>();\n\n\t\tthis.validators.stream().filter(v -> handlesAny(v, validatorTypes)).forEach(toReutrn::add);\n\t\treturn toReutrn;\n\t}", "public String[] getValidatorNames();", "public TypeValidator getValidator() {\n if (validator != null)\n return validator;\n return this;\n }", "public Validator getValidator() {\n return _validator;\n }", "public Map getValidatorMap();", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public org.exolab.castor.xml.TypeValidator getValidator()\n {\n return this;\n }", "public HtmlValidatorText getValidator() {\r\n\t\treturn _validator;\r\n\t}", "List<RecordItemValidatorIF> getItemValidators();", "public List<IRuleParser> getRuleParsers() {\n return ruleParsers;\n }", "public Validator<V> getValidator();", "public Validator getCustomerValidator() {\n return customerValidator;\n }", "private void setValidators() {\n getUtils().addNoNumbers(getOriginTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDestinationTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getCollectionPlaceTxt(), getValidatorTxt());\n getUtils().addNoNumbers(getDeliveryPlaceTxt(), getValidatorTxt());\n getUtils().eurosListener(getTravelValueTxt(), getValidatorTxt());\n getUtils().eurosListener(getMoneyforDriverTxt(), getValidatorTxt());\n getUtils().eurosListener(getCustomsTxt(), getValidatorTxt());\n getUtils().eurosListener(getOtherExpensesTxt(), getValidatorTxt());\n getUtils().eurosListener(getShippingExpensesTxt(), getValidatorTxt());\n //No listenerValidator for distance because, finally it is a string\n// getUtils().distanceListener(getDistanceTxt(), getValidatorTxt());\n getUtils().dateValidator(getDateTxt(), getValidatorTxt());\n getUtils().timeListener(getArriveHourTxt(), getValidatorTxt());\n getUtils().timeListener(getExitHourTxt(), getValidatorTxt());\n getUtils().timeListener(getProvidedHourTxt(), getValidatorTxt());\n\n }", "public String getValidatorProperty() {\n return _validatorProperty;\n }", "@ApplicationScoped\n\t@Produces\n\tpublic Multimap<Class<?>, AbstractValidator<?>> create() {\n\t\tMultimap<Class<?>, AbstractValidator<?>> map = ArrayListMultimap.create();\n\t\tIterator<AbstractValidator<?>> iter = validators.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tAbstractValidator<?> validator = iter.next();\n\t\t\tClass<?> validatorBeanClass = Reflections.getGenericTypeArgument(validator.getClass(), 0);\n\t\t\tif (!validatorBeanClass.isAnnotationPresent(Ignore.class)) {\n\t\t\t\tmap.put(validatorBeanClass, validator);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}", "@Override\n protected Validator getValidator() {\n return super.getValidator();\n }", "public List<IPropertyValidationRule> getRules() {\n\t\treturn _rules;\n\t}", "public Validator getValidator() throws InstantiationException, \r\n\t\t\tIllegalAccessException, ClassNotFoundException {\r\n\t\treturn ValidatorFactory.getValidator(getClassName());\r\n\t}", "public SoftAssert validator() {\n return pageValidator;\n }", "public String getValidatorClassName() {\n return configurationName + \"Validator\";\n }", "public Map<QName, Marshaller> getMarshallers() {\n return Collections.unmodifiableMap(marshallers);\n }", "Form setValidators(List<FormValidator> validators);", "public Iterator<RendererBean> renderers()\r\n {\r\n return _renderers.values().iterator();\r\n }", "public com.google.common.util.concurrent.ListenableFuture<cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsResponse> delegatorValidators(\n cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getDelegatorValidatorsMethod(), getCallOptions()), request);\n }", "public interface IAggregateValidator extends IValidator {\n\n\t/**\n\t * Gets a map of names to instances of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty map of name to delegate validators.\n\t */\n\tpublic Map getValidatorMap();\n\n\t/**\n\t * Gets the plugin names of the validators used by this validator.\n\t * FIXME: this operation is Eclipse-specific. Move it to an interface\n\t * in com.choicemaker.cm.validation.eclipse\n\t * @return a non-null, but possibly empty array of validator names.\n\t */\n\tpublic String[] getValidatorNames();\n\n\t/**\n\t * Gets the validators used by this validator.\n\t * @return a non-null, but possibly empty array of delegate validators.\n\t */\n\tpublic IValidator[] getValidators();\n\n}", "public ListProperty<IPropertyResolver> getResolvers() {\r\n return resolvers;\r\n }", "List<ContextBuilderConfigurator> getConfigurators() {\n return configurators;\n }", "public Set<String> getFonts() {\n return generators.keySet();\n }", "public Map<String, Mapper> getMappers() {\n return new HashMap<String, Mapper>(this.mappers);\n }", "public cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsResponse delegatorValidators(cosmos.distribution.v1beta1.QueryOuterClass.QueryDelegatorValidatorsRequest request) {\n return blockingUnaryCall(\n getChannel(), getDelegatorValidatorsMethod(), getCallOptions(), request);\n }", "public Validator getFeatureValidator() {\n\t\treturn featureValidator;\n\t}", "protected List<Matcher<? super T>> getMatchers() {\n return Arrays.asList(this.matchers);\n }", "public java.util.List<org.hyperledger.fabric.protos.token.Transaction.InputId.Builder> \n getInputsBuilderList() {\n return getInputsFieldBuilder().getBuilderList();\n }", "public java.util.List<org.hyperledger.fabric.protos.token.Transaction.InputId.Builder> \n getInputsBuilderList() {\n return getInputsFieldBuilder().getBuilderList();\n }", "public java.util.List<org.hyperledger.fabric.protos.token.Transaction.InputId.Builder> \n getInputsBuilderList() {\n return getInputsFieldBuilder().getBuilderList();\n }", "public List<Rule> getRules() {\r\n\t\treturn rules;\r\n\t}", "public List<RequestGenerator> getRequestGenerators() {\n return requestGenerators;\n }", "public String getRules() { \n\t\treturn getRulesElement().getValue();\n\t}", "public List<IEntranceValidation> validations(){\n\t\tList<IEntranceValidation> validations = new ArrayList<>();\n\t\tvalidations.add(new ValidationDayMonday(new DateToday()));\n\t\tvalidations.add(new ValidationDisplacement());\n\t\tvalidations.add(new ValidationTires());\n\t\treturn validations;\n\t}", "public ValidationErrors getErrors() {\n if (errors == null) errors = new ValidationErrors();\n return errors;\n }", "public RuleBasedValidator() {\n globalRules = new ArrayList();\n rulesByProperty = new HashMap();\n }", "public List<String> validate() {\n\t\t\n\t\tList<String> validationMessages = new ArrayList<String>();\n\t\tvalidate(validationMessages);\n\t\treturn validationMessages;\n\t}", "public List<RulesEngineRule> rules() {\n return this.innerProperties() == null ? null : this.innerProperties().rules();\n }", "protected final SearchControls getSearchControls() {\n final SearchControls constraints = new SearchControls();\n\n constraints.setSearchScope(this.scope);\n constraints.setReturningAttributes(new String[]{this.multiFactorAttributeName});\n constraints.setTimeLimit(this.timeout);\n constraints.setCountLimit(DEFAULT_MAX_NUMBER_OF_RESULTS);\n return constraints;\n }", "public ArrayList<RuleSet> getRuleSets() {\n return ruleSets;\n }", "public List<Constraint> getConstraints() {\r\n\t\treturn constraints;\r\n\t}", "public static List<MockResolver> getMockResolvers() {\n return registry.getMockResolvers();\n }", "public Collection<AbstractReaderPlugin> getReaders();", "public IContextInformationValidator getContextInformationValidator() {\n\t\treturn fValidator;\n\t}", "@Override\r\n\tpublic Validation<Escala> getValidation() {\n\t\treturn new EscalaValidation();\r\n\t\t\r\n\t}", "public List<ExcelImportException> getValidationErrors() {\n\t\treturn this.validationErrors;\n\t}", "public List getRuleFinders() {\n if (ruleFinders == null) {\n // when processing a plugin declaration, attempts are made to\n // find custom rules in the order in which the Finder objects\n // are added below. However this list can be modified\n ruleFinders = new LinkedList();\n ruleFinders.add(new FinderFromFile());\n ruleFinders.add(new FinderFromResource());\n ruleFinders.add(new FinderFromClass());\n ruleFinders.add(new FinderFromMethod());\n ruleFinders.add(new FinderFromDfltMethod());\n ruleFinders.add(new FinderFromDfltClass());\n ruleFinders.add(new FinderFromDfltResource());\n ruleFinders.add(new FinderFromDfltResource(\".xml\"));\n ruleFinders.add(new FinderSetProperties());\n }\n return ruleFinders;\n }", "public static Set<Analyzer> getRegisteredAnalyzers() {\n\t\tHashSet<Analyzer> analyzers = new HashSet<Analyzer>();\n\t\tfor (Analyzer analyzer : ANALYZERS) {\n\t\t\tanalyzers.add(analyzer);\n\t\t}\n\t\treturn analyzers;\n\t}", "Collection<PropertyValidationAnnotationHandler> getPropertyHandlers();", "public java.util.List<WorldUps.UErr.Builder> \n getErrorBuilderList() {\n return getErrorFieldBuilder().getBuilderList();\n }", "public Collection getBasicValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tString className = getClassName();\n\n\t\tlist.add(createClassExistenceComponent(className));\n\t\tlist.add(createClassPersistenceComponent(className));\n\n\t\tlist.addAll(getDatabaseValidationList());\n\t\tlist.addAll(getFieldsValidationList());\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public java.util.List<com.google.cloud.datafusion.v1beta1.Accelerator.Builder>\n getAcceleratorsBuilderList() {\n return getAcceleratorsFieldBuilder().getBuilderList();\n }", "public Set<Class<? extends Rule<?, ?>>> getTransformationRules();", "public List<IRuleFilter> getFilters() {\n return filters;\n }", "public java.util.List<io.grafeas.v1.Jwt.Builder> getJwtsBuilderList() {\n return getJwtsFieldBuilder().getBuilderList();\n }", "public java.util.List<Role.Builder>\n getRolesBuilderList() {\n return getRolesFieldBuilder().getBuilderList();\n }", "public java.util.List<Role.Builder>\n getRolesBuilderList() {\n return getRolesFieldBuilder().getBuilderList();\n }", "public List<ContextConstraint> getConstraints() {\n return getConstraintList();\n }", "public DescriptorExtensionList<Builder, Descriptor<Builder>> getBuilderDescriptors() {\n return Builder.all();\n }", "@Override\n public List getRules() {\n return rules;\n }", "public static Set<PrintWriter> getWriters() {\n return writers;\n }", "protected void validateForm() {\n for (Validator validator : validators) {\n validator.validate();\n }\n }", "public ArrayList<String> getRules() {\n return rules;\n }", "public PhaseValidator getPhaseValidator() {\r\n return this.delegate.getPhaseValidator();\r\n }", "public List<ColumnConstraintSet<R, ?>> getConstraintSets() {\n\t\treturn constraintSets;\n\t}", "Map<String, Decorator> getDecorators();", "public interface IValidator\n{\n /**\n * \n * @return the validator bean name\n */\n String getValidatorBeanName( );\n\n /**\n * \n * @return the validator display name\n */\n String getValidatorDisplayName( );\n\n /**\n * @param control\n * The control to build model\n * @return the HTML to display\n */\n String getDisplayHtml( Control control );\n\n /**\n * \n * @return the list of available entrytype for this validator\n */\n List<String> getListAvailableEntryType( );\n\n /**\n * @param questionResponse\n * The response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( FormQuestionResponse questionResponse, Control control );\n\n /**\n * @param questionResponse\n * The List response to control\n * @param control\n * The control to verify\n * @return boolean that indicate the validation result\n */\n boolean validate( List<FormQuestionResponse> questionResponse, Control control );\n\n /**\n * Only the content of the function should be returned. The parameter names are in FormsConstants, JS_PARAMETER_INPUT_VALUE and JS_PARAMETER_CONTROL_VALUE\n * \n * @return the javascript validation code for Conditional display control\n * \n */\n String getJavascriptValidation( );\n\n /**\n * @param control\n * The control\n * @return the control value needed for javascript\n */\n String getJavascriptControlValue( Control control );\n\n}", "public Map<String, NGPackageSpecification<WebObjectSpecification>> getWebComponentSpecifications()\n\t{\n\t\treturn reader.getWebComponentSpecifications();\n\t}", "public static Collection<TreeRendererDescriptor> registeredRenderers() {\n return Collections.unmodifiableCollection(REGISTRY.values());\n }", "public Set<YValidationAspekt> validateComponent() {\r\n\t\tthis.foundErrors = EnumSet.noneOf(YValidationAspekt.class);\r\n\t\tthis.foundWarnings = EnumSet.noneOf(YValidationAspekt.class);\r\n\r\n\t\tassertModelSpecification();\r\n\t\tassertModelImplementation();\r\n\r\n\t\tassertIdAndVarName();\r\n\t\tassertProperties();\r\n\r\n\t\treturn this.foundErrors;\r\n\t}", "public Collection<WriterProxy> getMatchedWriters() {\r\n\t\treturn writerProxies.values();\r\n\t}", "public List<ValidationProblem> getProblems() {\n return problems;\n }", "public List<AttachmentSourceTranslator> getTranslators() {\n\t\treturn translators;\n\t}", "public java.util.List<DocumentRequires> getRequires() {\n if (requires == null) {\n requires = new com.amazonaws.internal.SdkInternalList<DocumentRequires>();\n }\n return requires;\n }", "protected Iterable<ConfigSearcher.Domain> getSearcherDomains ()\n {\n return ImmutableList.<ConfigSearcher.Domain>of(new ConfigSearcher.ConfigDomain(this));\n }", "public ValidationController getValidationController()\r\n\t{\r\n\t\treturn validationController;\r\n\t}", "public RegisteredConstraintLinkValidator() {\r\n\t\tsetDomainID(RegisteredConstraintLinkValidator.class.getName());\r\n\t}", "public String[] getInitiators() { return this.initiators; }", "public void setValidators(@Nullable @NonnullElements final List<CredentialValidator> validators) {\n checkSetterPreconditions();\n if (validators != null) {\n credentialValidators = List.copyOf(validators);\n } else {\n credentialValidators = Collections.emptyList();\n }\n }", "public final RuleBaseFacility getRules()\n{\n\treturn _rules;\n}", "public Set<String> getValidMethods() {\n\t\treturn this.validMethods.keySet();\n\t}", "public EvaluatorRegistry getEvaluatorRegistry() {\r\n return this.evaluatorRegistry;\r\n }", "public Collection fullValidationCheck ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tIterator iterator = getFullValidationList().iterator();\n\n\t\twhile (iterator.hasNext())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t((ValidationComponent)iterator.next()).validate();\n\t\t\t}\n\t\t\tcatch (ModelValidationException e)\n\t\t\t{\n\t\t\t\tlist.add(e);\n\t\t\t}\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(list);\n\t}", "public static FASTAWriterFactory[] getRegisteredWriters(){\r\n return (FASTAWriterFactory[])writers.values().toArray(new FASTAWriterFactory[0]);\r\n }", "public IValidator get(String key)\n {\n \t return validatorMap.get(key);\n }", "@Override\n\tpublic DOMStringList getStyleSheetSets() {\n\t\tif (sheets.needsUpdate()) {\n\t\t\tsheets.update();\n\t\t}\n\t\treturn sheets.getStyleSheetSets();\n\t}", "public ImmutableList<String> getRequiredCssNamespaces() {\n return requiredCssNamespaces;\n }", "public List<NaaccrValidationError> getAllValidationErrors() {\n List<NaaccrValidationError> results = new ArrayList<>(getValidationErrors());\n results.addAll(getItems().stream().filter(item -> item.getValidationError() != null).map(Item::getValidationError).collect(Collectors.toList()));\n for (Tumor tumor : getTumors())\n results.addAll(tumor.getAllValidationErrors());\n return results;\n }", "public List<AbstractMatcher> getMatchers() {\n\t\tList<AbstractMatcher> list = new LinkedList<AbstractMatcher>();\n\t\tlist.addAll(matcherList);\n\t\t\n\t\t// HACK to show matcher\n\t\tAbstractMatcher partitionMatcher = new PartitionMatcher();\n\t\tlist.add(partitionMatcher);\n\t\t\n\t\treturn list;\n\t}" ]
[ "0.8155027", "0.7908102", "0.76333797", "0.7320084", "0.7119788", "0.65063256", "0.6294904", "0.6183695", "0.6174121", "0.60408103", "0.6008198", "0.6008198", "0.6008198", "0.5966167", "0.5924303", "0.5822002", "0.5663331", "0.5607449", "0.55546224", "0.55513823", "0.5538572", "0.55196387", "0.5492079", "0.5484557", "0.540609", "0.53851527", "0.53801817", "0.53318024", "0.529448", "0.52855295", "0.5263206", "0.5186596", "0.5176909", "0.51750284", "0.51506084", "0.5122661", "0.50970674", "0.5053471", "0.5050883", "0.5050883", "0.5050883", "0.5042371", "0.50411963", "0.5030538", "0.5016178", "0.49914026", "0.49756974", "0.49655524", "0.49550214", "0.495353", "0.49506354", "0.4934142", "0.49320078", "0.4917672", "0.49175307", "0.48993957", "0.48865306", "0.48817834", "0.48727894", "0.48641255", "0.4861149", "0.48597503", "0.4859047", "0.48535767", "0.48401168", "0.4838448", "0.48321867", "0.48321867", "0.48321295", "0.48283434", "0.48269027", "0.48265404", "0.48173195", "0.48145112", "0.48007637", "0.47988534", "0.47943777", "0.47851497", "0.4781968", "0.47798255", "0.4778559", "0.47698113", "0.4761805", "0.47572282", "0.47454602", "0.4733332", "0.4728731", "0.47256035", "0.47149652", "0.47138035", "0.47126865", "0.47120947", "0.47099578", "0.47000226", "0.46992522", "0.46951342", "0.46878043", "0.46811196", "0.4678479", "0.46780694" ]
0.75122446
3
/ parse user input to two part: command eg: user, pw, dir variable eg: username, filename
public void setUserinput(String userinput){ String[] inputs = userinput.split(" "); if(inputs.length > 1){ this.userinput_var = inputs[1]; } this.userinput_command = inputs[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void parseCommandLineArgs(String[] args) {\r\n // parse username/password;\r\n for(int i = 0; i < args.length; i++) {\r\n if(args[i].equals(\"-u\")) {\r\n username = args[i+1];\r\n }\r\n if(args[i].equals(\"-p\")) {\r\n password = args[i+1];\r\n }\r\n }\r\n \r\n }", "public void processUserInput(String input) {\n\t\tString[] request = this.getArguments(input); \n\t\tString command = request[0]; \n\n\t\ttry {\n\t\t\tswitch (command) {\n\t\t\t\tcase TUICommands.START_SESSION:\n\t\t\t\t\tif (!this.sessionActive) {\n\t\t\t\t\t\tthis.showNamedMessage(\"Initiating session with server...\");\n\t\t\t\t\t\twhile (!this.requestSession()) {\n\t\t\t\t\t\t\ttextUI.getBoolean(\"Try again?\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showNamedMessage(\"Session is already active\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\n\t\t\t\tcase TUICommands.LIST_FILES: \n\t\t\t\t\tthis.showNamedMessage(\"Requesting list of files...\");\n\t\t\t\t\tif (!this.requestListFiles()) { \n\t\t\t\t\t\tthis.showNamedError(\"Retrieving list of files failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.LIST_FILES_LOCAL: \n\t\t\t\t\tthis.showNamedMessage(\"Making list of local files...\");\n\t\t\t\t\tthis.printArrayOfFile(this.getLocalFiles()); \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_SINGLE:\n\t\t\t\t\tFile fileToDownload = this.selectServerFile();\n\t\t\t\t\tif (!this.downloadSingleFile(fileToDownload)) {\n\t\t\t\t\t\tthis.showNamedError(\"Downloading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_SINGLE:\n\t\t\t\t\tFile fileToUpload = this.selectLocalFile();\n\t\t\t\t\tif (!this.uploadSingleFile(fileToUpload)) { \n\t\t\t\t\t\tthis.showNamedError(\"Uploading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.DELETE_SINGLE:\n\t\t\t\t\tFile fileToDelete = this.selectServerFile();\n\t\t\t\t\tif (!this.deleteSingleFile(fileToDelete)) { \n\t\t\t\t\t\tthis.showNamedError(\"Deleting file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.CHECK_INTEGRITY:\n\t\t\t\t\tFile fileToCheck = this.selectLocalFile();\n\t\t\t\t\tif (!this.checkFile(fileToCheck)) { \n\t\t\t\t\t\tthis.showNamedError(\"Checking file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.uploads)) { \n\t\t\t\t\t\tthis.showNamedError(\"Upload manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.downloads)) {\n\t\t\t\t\t\tthis.showNamedError(\"Download manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.HELP:\n\t\t\t\t\tthis.textUI.printHelpMenu();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase TUICommands.EXIT:\n\t\t\t\t\tthis.shutdown();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthis.showNamedError(\"Unknow command received (and ignoring it)\"); \n\t\t\t}\n\t\t\tthis.showNamedMessage(\"... done!\");\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\tthis.showNamedError(\"Something went wrong: \" + e.getLocalizedMessage());\n\t\t}\n\t}", "public void processCommand(String userInput){\n if (userInput.contains(\" \")){ \n processSingleToken(userInput.split(\" \")); //Splits strings based on \" \" \n }\n \n else{\n List<String> tempStore = new ArrayList<String>();\n tempStore.add(userInput);\n String[] token = tempStore.toArray(new String[tempStore.size()]);\n processSingleToken(token);\n }\n }", "public String parseLine(String line) {\r\n String[] temp = line.split(\":\");\r\n\r\n if (temp[0].equalsIgnoreCase(\"user\")) {\r\n cmd = temp[0];\r\n userName = temp[1];\r\n } else if (temp[0].equalsIgnoreCase(\"play\")) {\r\n if (!playing) {\r\n cmd = temp[0];\r\n game = temp[1];\r\n } else {\r\n cmd = temp[0];\r\n userGuess = temp[1];\r\n }\r\n\r\n } else if(temp[0].equalsIgnoreCase(\"quit\")) {\r\n System.out.println(temp[0]);\r\n cmd = temp[0];\r\n } else if (temp[0].equalsIgnoreCase(\"reset\")) {\r\n cmd = temp[0];\r\n } else {\r\n cmd = \"invalid command\";\r\n }\r\n return cmd;\r\n }", "public boolean specialCommand(String userinput){\n return (userinput.equals(\"get\")) || (userinput.equals(\"dir\"));\n }", "public String getUserCommand() {\n out.print(\"Enter command: \");\n String fullInputLine = in.nextLine();\n\n return fullInputLine;\n }", "String getUsersInput(String outForUser) throws IOException;", "static String parse(String input, User user)\n {\n if(input.length()==0 || input==null || input.matches(\"^[ \\t]*$\"))\n return LinSim.EMPTY_STRING;\n\n // set the base command\n StringTokenizer token=new StringTokenizer(input, \" \\t\");\n String baseCommand=token.nextToken();\n\n // Let's use some introspection magic...\n try\n {\n Class<?> cmdClass=Class.forName(\"org.linsim.Command\");\n // Note that ALL commands in the Command class must be public in order to be seen by getMethod() below\n Method method=cmdClass.getMethod(baseCommand, String.class);\n Object output=method.invoke(null, input, user);\n if(!LinSim.graphicalMode)\n java.lang.System.out.print(output.toString());\n // ToDo: use setText() for GUI later\n }\n catch(Throwable e)\n {\n return baseCommand + \": command not found.\\n\";\n }\n // after the command finishes execution, return to the input loop\n return LinSim.EMPTY_STRING;\n }", "void parseCommand(String command){\n\t\tif(command!=null && command.length()>0){\n\t\t\tif(!subMenuFlag){\n\t\t\t\tmainMenuCommand(command);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsubMenuCommand(command);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter a valid command.\");\n\t\t}\n\t}", "public static void parseUserCommand(String userCommand) throws FileNotFoundException {\n ArrayList<String> commandTokens = new ArrayList<String>(Arrays.asList(userCommand.split(\" \")));\n\n\n\t\t/*\n\t\t* This switch handles a very small list of hardcoded commands of known syntax.\n\t\t* You will want to rewrite this method to interpret more complex commands.\n\t\t*/\n switch (commandTokens.get(0)) {\n case \"select\":\n parseQueryString(userCommand);\n break;\n case \"drop\":\n System.out.println(\"STUB: Calling your method to drop items\");\n dropTable(userCommand);\n break;\n case \"create\":\n parseCreateString(userCommand, false);\n break;\n case \"insert\":\n parseInsertString(userCommand);\n break;\n case \"help\":\n help();\n break;\n case \"version\":\n displayVersion();\n break;\n case \"exit\":\n isExit = true;\n break;\n case \"quit\":\n isExit = true;\n default:\n System.out.println(\"I didn't understand the command: \\\"\" + userCommand + \"\\\"\");\n break;\n }\n }", "private boolean parseArguments(String input) {\r\n\t\tString arguments[] = input.split(\" \");\r\n\t\tif (arguments.length == TWO_ARGUMENTS) {\r\n\t\t\tmailbox = arguments[ARRAY_SECOND_ELEMENT].trim();\r\n\t\t\tpassword = arguments[ARRAY_THIRD_ELEMENT].trim();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\t\t\r\n\t}", "public String userCommand(){\n return scanner.nextLine();\n }", "public static void main(String args[]) throws Exception {\n Scanner scan = new Scanner(System.in);\n\n CommandProcessor cmd = CommandProcessorFactory.getCommandProcessor();\n\n while (true) {\n\n String str = scan.nextLine();\n\n String[] obj = str.split(\" \");\n\n int len = obj.length;\n\n if (\"mkdir\".equals(obj[0])) {\n\n if (len != 2) {\n\n System.out.println(\"Invalid Directory Name\");\n\n continue;\n\n }\n\n cmd.createDirectory(obj[1]);\n\n } else if (\"cd\".equals(obj[0])) {\n\n if (len == 2) {\n cmd.changeDirectory(obj[1]);\n } else {\n cmd.changeDirectory(null);\n }\n\n } else if (\"touch\".equals(obj[0])) {\n\n if (len != 2) {\n\n System.out.println(\"Invalid Directory Name\");\n\n continue;\n\n } else {\n\n cmd.createFile(obj[1]);\n\n }\n\n } else if (\"ls\".equals(obj[0])) {\n\n cmd.listAllFiles();\n\n } else if (\"pwd\".equals(obj[0])) {\n\n cmd.pwd();\n\n } else if (\"quit\".equals(obj[0])) {\n\n break;\n\n } else {\n\n System.out.println(\"Unrecognized Command\");\n\n }\n\n }\n\n }", "public static String getArgs(String userInput) throws EmptyTaskException {\n String[] components = userInput.split(\" \", 2);\n if (components.length == 1) {\n throw new EmptyTaskException();\n } else {\n return components[1];\n }\n }", "public static Command parse(String input) throws DukeException {\r\n String[] inputArr = input.split(\" \", 2);\r\n String command = inputArr[0];\r\n\r\n switch (command) {\r\n case \"bye\":\r\n return new ExitCommand();\r\n case \"list\":\r\n return new ListCommand();\r\n case \"done\":\r\n try {\r\n return new DoneCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n mark as done!\");\r\n }\r\n case \"delete\":\r\n try {\r\n return new DeleteCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n delete!\");\r\n }\r\n case \"todo\":\r\n try {\r\n return new AddCommand(new Todo(inputArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"The description of a todo cannot be empty.\");\r\n }\r\n case \"deadline\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /by \");\r\n return new AddCommand(new Deadline(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n deadline <description> /by <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"event\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /at \");\r\n return new AddCommand(new Event(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n event <description> /at <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"find\":\r\n try {\r\n return new FindCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify what you are searching for!\");\r\n }\r\n default:\r\n throw new DukeException(\"I'm sorry, but I don't know what that means!\");\r\n }\r\n }", "public String parseShortcutCommandAndDetails(String userInput) {\n String[] commandAndDetails = userInput.split(COMMAND_WORD_DELIMITER, 2);\n String shortcutInput = parseShortcutCommands(commandAndDetails[0]);\n String remainingTaskInfo = \"\";\n if (commandAndDetails.length > 1) {\n remainingTaskInfo = commandAndDetails[1];\n }\n String fullInput = shortcutInput + \" \" + remainingTaskInfo;\n fullInput = fullInput.trim();\n return fullInput;\n }", "private void commandProgramBasic(String command)\n {\n String[] array = command.split(\" \");\n\n if(array[0].equals(\"init\"))\n {\n System.out.println(\"The program will now read the file.\");\n input.readFile();\n } else if(array[0].equals(\"run\"))\n {\n int runTime = Integer.parseInt(array[1]);\n System.out.println(\"Please wait while the data is stored.\");\n System.out.println(\"The filled data containers will be printed shortly.\");\n input.runProgram(runTime);\n } else if(array[0].equals(\"clear\"))\n {\n System.out.println(\"The data containers will now be cleared.\");\n input.clear();\n } else if(array[0].equals(\"exit\"))\n {\n scanner.close();\n } \n\n askUser();\n }", "private static void parseArgs (String[] args) {\n\t\tint n = args.length;\n\t\tif (n != 4) {\n\t\t\tSystem.out.println(\"Usage: BuildTranslations in dbname username password\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\tinPath = args[0];\n\t\tdbname = args[1];\n\t\tusername = args[2];\n\t\tpassword = args[3];\n\t}", "public void parseInput(String userInput) {\n this.userIn = userInput;\n\n this.identifier = userIn.split(\" \")[0];\n\n switch (identifier) {\n case \"done\":\n completeTask();\n return;\n\n case \"list\":\n listAllTasks();\n return;\n\n case \"todo\":\n addToDo();\n return;\n\n case \"event\":\n addEvent();\n return;\n\n case \"deadline\":\n addDeadline();\n return;\n\n case \"delete\":\n deleteTask();\n return;\n\n case \"find\":\n findTask();\n return;\n\n default:\n ui.showListOfCommands();\n }\n }", "private Command parseCommand(String input) {\r\n\r\n String[] splittedInput = input.toUpperCase().split(\" \");\r\n String command = splittedInput[0];\r\n\r\n switch (command) {\r\n case \"PLACE\":\r\n return new PlaceCommand(input);\r\n case \"MOVE\":\r\n return new MoveCommand();\r\n case \"LEFT\":\r\n return new RotateLeftCommand();\r\n case \"RIGHT\":\r\n return new RotateRightCommand();\r\n case \"REPORT\":\r\n return new ReportCommand();\r\n default:\r\n return new IgnoreCommand();\r\n }\r\n }", "private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }", "public static String getCommand(String userInput) {\n String[] components = userInput.split(\" \", 2);\n return components[0];\n }", "public static void parseUserCommand (String userCommand) {\n ArrayList<String> commandTokens = new ArrayList<String>(Arrays.asList(userCommand.split(\" \")));\n \n\n /*\n * This switch handles a very small list of hard coded commands of known syntax.\n * You will want to rewrite this method to interpret more complex commands. \n */\n switch (commandTokens.get(0)) {\n \tcase \"show\":\n \t\tdisplay(userCommand);\n \t\tbreak;\n case \"select\":\n parseQueryString(userCommand);\n break;\n case \"drop\":\n System.out.println(\"STUB: Calling your method to drop items\");\n dropTable(userCommand);\n break;\n case \"create\":\n parseCreateString(userCommand);\n break;\n case \"insert\":\n parseInsertString(userCommand);\n break;\n case \"delete\":\n parseDeleteString(userCommand); \n break;\n case \"help\":\n help();\n break;\n case \"version\":\n displayVersion();\n break;\n case \"exit\":\n isExit = true;\n break;\n case \"quit\":\n isExit = true;\n break;\n default:\n System.out.println(\"Unknown command: \\\"\" + userCommand + \"\\\"\");\n break;\n }\n }", "String getUserInput();", "private static void parseCommandLine(String[] args) {\r\n\t\tif (args.length != 3)\r\n\t\t\terror(\"usage: Tester server port url-file\");\r\n\t\t\t\r\n\t\tserverName = args[0];\r\n\t\tserverPort = Integer.parseInt(args[1]);\r\n\t\turlFileName = args[2];\r\n\t}", "public static String parseCommand(String command) {\n String keyWord = \"\";\n if (command.startsWith(\"list\")) {\n keyWord = \"list\";\n } else if (command.startsWith(\"notes\")) {\n keyWord = \"notes\";\n } else if (command.startsWith(\"done\")) {\n keyWord = \"done\";\n } else if (command.startsWith(\"delete note\")) {\n keyWord = \"delete note\";\n } else if (command.startsWith(\"delete\")) {\n keyWord = \"delete\";\n } else if (command.startsWith(\"todo\")) {\n keyWord = \"todo\";\n } else if (command.startsWith(\"deadline\")) {\n keyWord = \"deadline\";\n } else if (command.startsWith(\"event\")) {\n keyWord = \"event\";\n } else if (command.startsWith(\"today\")) {\n keyWord = \"today\";\n } else if (command.startsWith(\"find\")) {\n keyWord = \"find\";\n } else if (command.startsWith(\"bye\")) {\n keyWord = \"bye\";\n } else if (command.startsWith(\"note\")) {\n keyWord = \"note\";\n }\n return keyWord;\n }", "private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}", "static ParsedCommand parseCommand(String cmdline) {\n ParsedCommand res = new ParsedCommand();\n cmdline = cmdline.trim();\n String[] split = cmdline.split(\"\\\\/([-]?[a-zA-Z]*)\");\n List<String> args = new ArrayList<>();\n for (int i = 0; i < split.length; i++) {\n String[] tmp = split[i].split(\" \");\n for (int j = 0; j < tmp.length; j++) {\n if (tmp[j].length() > 0) {\n args.add(tmp[j]);\n }\n }\n }\n if (args.size() == 0) return null;\n res.argv.addAll(args);\n Pattern p = Pattern.compile(\"\\\\/([-]?[a-zA-Z]*)\");\n Matcher m = p.matcher(cmdline);\n while (m.find()) {\n String cur = m.group(1);\n if (cur.startsWith(\"-\")) {\n for (int i = 1; i < cur.length(); i++) {\n res.switches.remove(String.valueOf(cur.charAt(i)).toUpperCase());\n }\n } else {\n for (int i = 0; i < cur.length(); i++) {\n res.switches.add(String.valueOf(cur.charAt(i)).toUpperCase());\n }\n }\n }\n\n return res;\n }", "public static String parseUserInput(String inputMsg) {\n assert !inputMsg.isEmpty() : \"Input command should not be empty.\";\n TaskList tasks = Duke.tasks;\n ArchivedTaskList archivedTasks = Duke.archivedTasks;\n\n if (inputMsg.equals(\"list\")) {\n return Ui.getAllTasksMsg(tasks.getTaskList());\n } else if (inputMsg.equals(\"help\")) {\n return Ui.getHelpMsg();\n } else if (inputMsg.startsWith(\"done\")) {\n return parseDone(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"todo\")) {\n return parseToDo(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"deadline\")) {\n return parseDeadline(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"event\")) {\n return parseEvent(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"delete\")) {\n return parseDelete(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"find\")) {\n return parseFind(inputMsg, tasks);\n } else if (inputMsg.startsWith(\"archive\")) {\n return parseArchive(inputMsg, tasks, archivedTasks);\n } else if (inputMsg.equals(\"list archive\")) {\n return Ui.getAllArchivedTasksMsg(archivedTasks);\n } else if (inputMsg.equals(\"bye\")) {\n return Ui.getByeMsg();\n } else {\n // if the user randomly enter any other commands which are not inside the command list\n return Warnings.getInvalidInputMsg();\n }\n }", "private void handleCommand(String input) throws ClientOfflineException, ServerException {\n String[] params = input.split(\" \");\n Command command = this.availableCommandMap.get(params[0]);\n String argument = (params.length <= 1) ? null : params[1];\n command.execute(this, argument);\n }", "public String getUserCommand();", "public DummyCommand parse(String userInput) throws ParseException {\n HashMap<String, String> aliasList = getAliasManager().getAliasList();\n\n if (aliasList.isEmpty()) {\n return new DummyCommand(MESSAGE_EMPTY);\n }\n\n StringBuilder sb = new StringBuilder();\n aliasList.forEach((alias, command) -> sb.append(String.format(\"%s: %s\\n\", alias, command)));\n\n return new DummyCommand(sb.toString());\n }", "private void executeCommand(String c) {\n // split command and arguments\n int index = c.indexOf(' ');\n String command = ((index == -1) ? c.toUpperCase() : (c.substring(0, index)).toUpperCase());\n String args = ((index == -1) ? null : c.substring(index + 1));\n\n debugOutput(\"Command: \" + command + \" Args: \" + args);\n\n // dispatcher mechanism for different commands\n switch (command) {\n case \"USER\":\n handleUser(args);\n break;\n\n case \"PASS\":\n handlePass(args);\n break;\n\n case \"CWD\":\n handleCwd(args);\n break;\n\n case \"LIST\":\n handleNlst(args);\n break;\n\n case \"NLST\":\n handleNlst(args);\n break;\n\n case \"PWD\":\n case \"XPWD\":\n handlePwd();\n break;\n\n case \"QUIT\":\n handleQuit();\n break;\n\n case \"PASV\":\n handlePasv();\n break;\n\n case \"EPSV\":\n handleEpsv();\n break;\n\n case \"SYST\":\n handleSyst();\n break;\n\n case \"FEAT\":\n handleFeat();\n break;\n\n case \"PORT\":\n handlePort(args);\n break;\n\n case \"EPRT\":\n handleEPort(args);\n break;\n\n case \"RETR\":\n handleRetr(args);\n break;\n\n case \"MKD\":\n case \"XMKD\":\n handleMkd(args);\n break;\n\n case \"RMD\":\n case \"XRMD\":\n handleRmd(args);\n break;\n\n case \"TYPE\":\n handleType(args);\n break;\n\n case \"STOR\":\n handleStor(args);\n break;\n\n default:\n sendMsgToClient(\"501 Unknown command\");\n break;\n\n }\n\n }", "public Command getCommand(String userInput) {\n return this.parser.parse(userInput);\n }", "@Override\r\n\tpublic String execute(File workingDir, String stdin) {\r\n\t\tboolean checkCase = true;\r\n\t\tint skippedFieldCount = 0;\r\n\t\tArrayList<String> operands = new ArrayList<String>();\r\n\r\n\t\tif (args == null) {\r\n\t\t\treturn getUnique(checkCase, stdin);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < args.length; i++) {\r\n\t\t\tString arg = args[i];\r\n\r\n\t\t\t// Check for extra operands\r\n\t\t\tif (operands.size() >= 2) {\r\n\t\t\t\tsetStatusCode(ERR_CODE_EXTRA_OPERAND);\r\n\t\t\t\treturn String.format(ERR_MSG_EXTRA_OPERAND, arg);\r\n\t\t\t}\r\n\r\n\t\t\t// Check for valid file\r\n\t\t\tif (!arg.startsWith(\"-\")) {\r\n\t\t\t\tFile file = new File(arg);\r\n\r\n\t\t\t\t// Check if filePath is relative to working dir (i.e. not absolute path)\r\n\t\t\t\t// If it is we make the file relative to working dir.\r\n\t\t\t\tif (!file.isAbsolute() && workingDir.exists()) {\r\n\t\t\t\t\tfile = new File(workingDir, arg);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (operands.size() == 0 && !file.exists()) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_FILE_NOT_FOUND);\r\n\t\t\t\t\treturn String.format(ERR_MSG_FILE_NOT_FOUND, arg);\r\n\t\t\t\t}\r\n\t\t\t\toperands.add(file.toString());\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for stdin argument\r\n\t\t\tif (arg.equals(\"-\")) {\r\n\t\t\t\toperands.add(arg);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Option argument\r\n\t\t\tswitch (arg) {\r\n\t\t\tcase \"-i\":\r\n\t\t\t\tcheckCase = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-f\":\r\n\t\t\t\tif (i + 1 >= args.length) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_MISSING_OPTION_ARG);\r\n\t\t\t\t\treturn String.format(ERR_MSG_MISSING_OPTION_ARG, arg);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ti += 1;\r\n\t\t\t\targ = args[i];\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tskippedFieldCount = Integer.parseInt(arg);\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_INVALID_NUM_OF_FIELDS);\r\n\t\t\t\t\treturn String.format(ERR_MSG_INVALID_NUM_OF_FIELDS, arg);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-help\":\r\n\t\t\t\treturn getHelp();\r\n\t\t\tdefault:\r\n\t\t\t\tsetStatusCode(ERR_CODE_INVALID_OPTION);\r\n\t\t\t\treturn String.format(ERR_MSG_INVALID_OPTION, arg);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString input;\r\n\t\tif (operands.size() == 0 || operands.get(0).equals(\"-\")) {\r\n\t\t\tinput = stdin;\r\n\t\t} else {\r\n\t\t\tinput = readFile(operands.get(0), Charset.forName(\"UTF8\"));\r\n\t\t}\r\n\r\n\t\tString output;\r\n\t\tif (skippedFieldCount == 0) {\r\n\t\t\toutput = getUnique(checkCase, input);\r\n\t\t} else {\r\n\t\t\toutput = getUniqueSkipNum(skippedFieldCount, checkCase, input);\r\n\t\t}\r\n\r\n\t\t// Check if the user specify an output file\r\n\t\tif (operands.size() > 1) {\r\n\t\t\tString outputFilePath = operands.get(1);\r\n\r\n\t\t\tif (!outputFilePath.equals(\"-\")) {\r\n\t\t\t\t// Output is redirected to file\r\n\t\t\t\twriteToFile(outputFilePath, output);\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "private String parseArgs(String args[])\n {\n String fpath = null;\n \n for (String arg : args)\n {\n if (arg.startsWith(\"-\"))\n {\n // TODO: maybe add something here.\n }\n else // expect a filename.\n {\n fpath = arg;\n }\n }\n \n return fpath;\n }", "public void parse(String userInput) {\n\t\tString[] args = toStringArray(userInput, ' ');\n\t\tString key = \"\";\n\t\tArrayList<String> filePaths = new ArrayList<String>();\n\t\tboolean caseSensitive = true;\n\t\tboolean fileName = false;\n\n\t\t// resolves the given args\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i].equals(\"-i\")) {\n\t\t\t\tcaseSensitive = false;\n\t\t\t} else if (args[i].equals(\"-l\")) {\n\t\t\t\tfileName = true;\n\t\t\t} else if (args[i].contains(\".\")) {\n\t\t\t\tfilePaths.add(args[i]);\n\t\t\t} else {\n\t\t\t\tkey = args[i];\n\t\t\t}\n\t\t}\n\t\t// in the case of multiple files to parse this repeats until all files\n\t\t// have been searched\n\t\tfor (String path : filePaths) {\n\t\t\tthis.document = readFile(path);\n\t\t\tfindMatches(key, path, caseSensitive, fileName);\n\t\t}\n\t}", "public Command parseCommand(String userInput, Model model,\n seedu.address.person.model.CheckAndGetPersonByNameModel personModel) throws Exception {\n final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());\n if (!matcher.matches()) {\n throw new ParseException(CashierMessages.MESSAGE_NO_COMMAND);\n }\n\n final String commandWord = matcher.group(\"commandWord\");\n final String arguments = matcher.group(\"arguments\");\n\n switch (commandWord) {\n\n case AddCommand.COMMAND_WORD:\n return new AddCommandParser().parse(arguments, model, personModel);\n\n case DeleteCommand.COMMAND_WORD:\n return new DeleteCommandParser().parse(arguments, model, personModel);\n\n case EditCommand.COMMAND_WORD:\n return new EditCommandParser().parse(arguments, model, personModel);\n\n case SetCashierCommand.COMMAND_WORD:\n return new SetCashierCommandParser().parse(arguments, model, personModel);\n\n case CheckoutCommand.COMMAND_WORD:\n return new CheckoutCommandParser().parse(arguments, model, personModel);\n\n case ClearCommand.COMMAND_WORD:\n return new ClearCommandParser().parse(arguments, model, personModel);\n\n default:\n logger.info(\"There is no such command.\");\n throw new ParseException(CashierMessages.MESSAGE_NO_COMMAND);\n\n }\n }", "public Command parse(String fullCommand) throws InvalidInputException, UnknownException {\n checkDelimiters(fullCommand);\n String[] tokens = fullCommand.split(\"\\\\s+\");\n\n // If tokenized command returns an empty array (entered a string with only white spaces),\n // raise an exception\n if (tokens.length == 0) {\n throw new InvalidInputException(InvalidInputException.Type.EMPTY_STRING);\n }\n // If first token (command) is empty, there are empty spaces typed in at the front - so we remove it\n if (tokens[0].isEmpty()) {\n tokens = Arrays.copyOfRange(tokens, 1, tokens.length);\n // Check again to make sure it is not empty after removing first element\n if (tokens.length == 0) {\n throw new InvalidInputException(InvalidInputException.Type.EMPTY_STRING);\n }\n }\n\n HashMap<String, String> arguments = new HashMap<>();\n // Conver input command to lowercase to make it case insensitive\n String command = tokens[0].toLowerCase();\n arguments.put(\"command\", command);\n\n // Default key is \"payload\"\n String key = \"payload\";\n ArrayList<String> values = new ArrayList<>();\n for (int i = 1; i < tokens.length; ++i) {\n String token = tokens[i];\n // Check whether this token is a new key\n if (!token.isEmpty() && token.charAt(0) == '/') {\n // If it is, save current value into the map and start a new k-v pair\n arguments.put(key, String.join(DELIMITER, values));\n key = token.substring(1);\n values.clear();\n } else {\n // If not, append this token to the end of the value\n values.add(token);\n }\n }\n\n // Store the last k-v pair\n // Store even when `values` is empty, as that indicates an empty string\n arguments.put(key, String.join(DELIMITER, values));\n\n // Initialize a respective class from the command (by capitalize first character)\n String className = command + \"Command\";\n className = className.substring(0, 1).toUpperCase() + className.substring(1);\n className = Constants.COMMAND_CLASS_PREFIX + className;\n try {\n Class<?> cls = Class.forName(className);\n Constructor<?> constructor = cls.getDeclaredConstructor(Ui.class, Data.class, HashMap.class);\n Object obj = constructor.newInstance(ui, data, arguments);\n return (Command) obj;\n } catch (ClassNotFoundException classNotFoundException) {\n // *Command class cannot be found!\n throw new InvalidInputException(InvalidInputException.Type.UNKNOWN_COMMAND, classNotFoundException);\n } catch (Exception exception) {\n // Some other weird error occurred here (e.g. dev bugs)\n // We should NEVER reach this block, if we do, log under the highest level\n throw new UnknownException(exception);\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tSftpAuthenticator auth = new SftpAuthenticator();\n\t\tMap<String, String> props = new HashMap<String, String>();\n\t\tdo {\n\t\t\tprops.clear();\n\t\t\tfor (RequiredInputField input : auth.getRequiredInputFields()) {\n\t\t\t\tSystem.out.print(\"Enter \" + input.getName() + \": \");\n\t\t\t\tString entered = readLine();\n\t\t\t\tswitch (input.getType()) {\n\t\t\t\tcase Bool:\n\t\t\t\t\tBoolean.parseBoolean(entered);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Number:\n\t\t\t\t\tInteger.parseInt(entered);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tprops.put(input.getName(), entered);\n\t\t\t}\n\t\t} while (!auth.isValid(props));\n\t\tauth.authorize(props);\n\n\t\tfor (Map.Entry<String, String> entry : props.entrySet()) {\n\t\t\tSystem.out.println(entry.getKey() + \": \" + entry.getValue());\n\t\t}\n\t\tProperties tmp = new Properties();\n\t\ttmp.putAll(props);\n\t\ttmp.store(new FileWriter(new File(\"auth.props\")), null);\n\t}", "private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }", "public Command parse(String inputCommand) {\n Matcher matcher = BASIC_COMMAND_FORMAT.matcher(inputCommand.trim());\n if (!matcher.matches()) {\n return new IncorrectCommand(\"This is a incorrect format, \"\n + \" you may type the list to see all the commands.\"\n + \" the command should not contain the separator '|'\");\n }\n\n String commandWord = matcher.group(\"commandWord\");\n String arguments = matcher.group(\"arguments\");\n\n switch (commandWord) {\n case AddCommand.COMMAND_WORD:\n return prepareAdd(arguments);\n case ListCommand.COMMAND_WORD:\n return prepareList(arguments);\n\n case DoneCommand.COMMAND_WORD:\n return prepareDone(arguments);\n case DueCommand.COMMAND_WORD:\n return prepareDue(arguments);\n case DeleteCommand.COMMAND_WORD:\n return prepareDelete(arguments);\n\n case SetCommand.COMMAND_WORD:\n return prepareSet(arguments);\n\n case ExitCommand.COMMAND_WORD:\n return new ExitCommand();\n\n case ProjModeCommand.COMMAND_WORD:\n return new ProjModeCommand();\n\n // case HelpCommand.COMMAND_WORD:\n // default:\n // return new HelpCommand();\n\n default:\n return new IncorrectCommand(\"IncorrectCommand\");\n }\n\n }", "public Command getCommand() {\n String userInput = in.nextLine();\n String[] words = userInput.split(\" \", 2);\n try {\n return new Command(words[0].toLowerCase(), words[1]);\n } catch (ArrayIndexOutOfBoundsException e) {\n return new Command(words[0].toLowerCase(), Command.BLANK_DESCRIPTION);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void usercommand() throws ClassNotFoundException, IOException{\n\t\tString usercommand;\n\t\tSystem.out.println(\"Enter the user command\");\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner sc = new Scanner(System.in);\n\t\t\tif((usercommand=sc.nextLine())!=null){\n\t\t\t\tif(usercommand.contains(\"get\")){\n\t\t\t\t\tfilename = usercommand.split(\" \");\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\tObject obj =obj_in.readObject();// to get the list of portId and Ip\n\t\t\t\t\tList<String> portList = new ArrayList<String>();\n\t\t\t\t\tportList = (List<String>) obj;\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//return no such files if list is empty\n\t\t\t\t\t\tif (portList.isEmpty()){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t else{\n\t\t\t\t\t\t//if peer list is not empty\n\t\t\t\t\t for (String peerInfo : portList){\n\t\t\t\t\t \tint i = 0;\n\t\t\t\t\t \tgetportInformation = peerInfo.split(\":\");\n\t\t\t\t\t \tclientInfo.put(Integer.parseInt(getportInformation[i]),getportInformation[i+1]);\n\t\t\t\t\t \tSystem.out.println(\"The Port Id and The iP address is \"+peerInfo );\n\t\t\t\t\t \ti = i+2;\n\t\t\t\t\t }\n\t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\t// To check if the file is already in peer\n\t\t\t\t\t\t for (int i = 0; i < portList.size(); i++) {\n\t\t\t\t\t\t\tif(portList.contains(serverPortNumber+\":\"+ip.getHostAddress())){\n\t\t\t\t\t\t\t\tSystem.out.println(\"You already have this file in system\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Enter the following command to download file: download <portNumber>\");\n\t\t\t\t\t\tString command;\n\t\t\t\t\t\t@SuppressWarnings(\"resource\")\n\t\t\t\t\t\tScanner inputPort= new Scanner(System.in);\n\t\t\t\t\t\tcommand= inputPort.nextLine();\n\t\t\t\t\t\tString[] setPortInfo = command.split(\" \");\n\t\t\t\t\t\tint serverPortNum = 0;\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tserverPortNum = Integer.parseInt(setPortInfo[1]);\n\t\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Make sure you enter the command correctly:\");\n\t\t\t\t\t\t\t\tSystem.out.println(\"Get the file name again\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Connecting to the port\"+serverPortNum+\" \"+clientInfo.get(serverPortNum));\t\t\t\t\n\t\t\t\t\t\tSocket client_t = new Socket(clientInfo.get(serverPortNum),serverPortNum);\n\t\t\t\t\t\tPrintWriter out_temp = new PrintWriter(client_socket.getOutputStream(),true);\n\t\t\t\t\t\tout_temp.println(setPortInfo[0]);\n\t\t\t\t\t\tbyte[] bytearray = new byte[65000];\n\t\t\t\t\t\tInputStream temp_is = client_t.getInputStream();\n\t\t\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filename[1]));\n\t\t\t\t\t\tint Byteread = temp_is.read(bytearray,0,bytearray.length);\n\t\t\t\t\t\tbos.write(bytearray, 0, Byteread);\n\t\t\t\t\t\tbos.close();\n\t\t\t\t\t\tclient_t.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t}\n\t\t\t\t\t}//try\n\t\t\t\t\t\tcatch(NullPointerException e){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t}\n\t\t\t\t\tobj_in.close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\telse if(usercommand.contains(\"refresh\")){\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\t\n//\t\t\t\t\tout.println(\"Got the refresh command\");\n//\t\t\t\t\tout.println(\"File list updated\");\t\t\t\t\t\n\t\t\t\t\tusercommand();\n\t\t\t\t}\n\t\t\t\telse if(usercommand.contains(\"disconnect\")){\n\t\t\t\t\tout.print(usercommand);\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t}", "private void extractCommand() throws IllegalCommandException {\n if (userInput.contentEquals(COMMAND_WORD_BYE)) {\n commandType = CommandType.BYE;\n } else if (userInput.startsWith(COMMAND_WORD_LIST)) {\n commandType = CommandType.LIST;\n } else if (userInput.startsWith(COMMAND_WORD_DONE)) {\n commandType = CommandType.DONE;\n } else if (userInput.startsWith(COMMAND_WORD_TODO)) {\n commandType = CommandType.TODO;\n } else if (userInput.startsWith(COMMAND_WORD_DEADLINE)) {\n commandType = CommandType.DEADLINE;\n } else if (userInput.startsWith(COMMAND_WORD_EVENT)) {\n commandType = CommandType.EVENT;\n } else if (userInput.startsWith(COMMAND_WORD_DELETE)) {\n commandType = CommandType.DELETE;\n } else if (userInput.startsWith(COMMAND_WORD_FIND)) {\n commandType = CommandType.FIND;\n } else if (userInput.contentEquals(COMMAND_WORD_HELP)) {\n commandType = CommandType.HELP;\n } else {\n throw new IllegalCommandException();\n }\n }", "public void startCommandPrompt(String command) {\n\t\tString[] tokens = command.split(\" \", 2);\n\t\tString cmd = tokens[0];\n\t\tString fileName = null;\n\t\tif (tokens.length > 1) {\n\t\t\tfileName = tokens[1];\n\t\t}\n\t\tswitch (cmd) {\n\t\tcase \"mkdir\":\n\t\t\troot.mkDir(fileName);\n\t\t\tbreak;\n\n\t\tcase \"cd\":\n\t\t\troot = root.cd(fileName);\n\t\t\tif(root.getName().equals(fileName))\n\t\t\t\tpath = path + \"/\" + fileName;\n\t\t\tbreak;\n\n\t\tcase \"list\": root.list();\n\t\t\tbreak;\n\n\t\tcase \"back\": root = root.back();\n\t\t\tif(path.indexOf(\"/\") != -1)\n\t\t\t\tpath = path.substring(0,path.lastIndexOf(\"/\"));\n\t\t\tbreak;\n\n\t\tcase \"find\": root.find(fileName, path);\n\t\t\tbreak;\n\n\t\tcase \"tree\": root.tree(path);\n\t\t\tbreak;\n\n\t\tcase \"exit\":\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tSystem.out.println(\"Enter Correct Command.\");\n\t\t}\n\t}", "private static void parseCommandLine(String[] command) {\r\n\t\tint i = 0;\r\n\t\t\r\n\t\twhile (i < command.length) {\r\n\t\t\tif (command[i].equals(\"-f\")) { // input file\r\n\t\t\t\tdataFileName = command[i+1];\r\n\t\t\t\ti += 2;\r\n\t\t\t}\r\n\t\t\telse if (command[i].equals(\"-s\")) { // data split\r\n\t\t\t\tif (command[i+1].equals(\"simple\")) {\r\n\t\t\t\t\tevaluationMode = DataSplitManager.SIMPLE_SPLIT;\r\n\t\t\t\t\ttestRatio = Double.parseDouble(command[i+2]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (command[i+1].equals(\"pred\")) {\r\n\t\t\t\t\tevaluationMode = DataSplitManager.PREDEFINED_SPLIT;\r\n\t\t\t\t\tsplitFileName = command[i+2].trim();\r\n\t\t\t\t}\r\n\t\t\t\telse if (command[i+1].equals(\"kcv\")) {\r\n\t\t\t\t\tevaluationMode = DataSplitManager.K_FOLD_CROSS_VALIDATION;\r\n\t\t\t\t\tfoldCount = Integer.parseInt(command[i+2]);\r\n\t\t\t\t}\r\n\t\t\t\telse if (command[i+1].equals(\"rank\")) {\r\n\t\t\t\t\tevaluationMode = DataSplitManager.RANK_EXP_SPLIT;\r\n\t\t\t\t\tuserTrainCount = Integer.parseInt(command[i+2]);\r\n\t\t\t\t\tminTestCount = 10;\r\n\t\t\t\t}\r\n\t\t\t\ti += 3;\r\n\t\t\t}\r\n\t\t\telse if (command[i].equals(\"-a\")) { // algorithm\r\n\t\t\t\trunAllAlgorithms = false;\r\n\t\t\t\talgorithmCode = command[i+1];\r\n\t\t\t\t\r\n\t\t\t\t// parameters for the algorithm:\r\n\t\t\t\tint j = 0;\r\n\t\t\t\twhile (command.length > i+2+j && !command[i+2+j].startsWith(\"-\")) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\talgorithmParameters = new String[j];\r\n\t\t\t\tSystem.arraycopy(command, i+2, algorithmParameters, 0, j);\r\n\t\t\t\t\r\n\t\t\t\ti += (j + 2);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String readCommand() {\n String input = in.nextLine();\n while (input.trim().isEmpty()) {\n input = in.nextLine();\n }\n return input;\n }", "public String getFTPcommand(){\n String temp = this.map.get(this.userinput_command).toString().toUpperCase() +\n ( (this.userinput_var == null)? \"\" : \" \" + this.userinput_var );\n\n this.userinput_var = null;\n return temp;\n }", "public static Command parse(String fullCommand) throws DukeException {\n String[] arr = fullCommand.split(\"\\\\s+\", 2);\n String command = arr[0];\n if (command.equals(\"todo\")) {\n if (arr.length == 1) {\n throw new DukeException(\"OOPS!!! The description of a todo cannot be empty.\");\n } else {\n Task task = new Todo(arr[1]);\n return new AddCommand(task);\n }\n } else if (command.equals(\"deadline\")) {\n if (arr.length == 1) {\n throw new DukeException(\"OOPS!!! The description of a deadline cannot be empty.\");\n } else {\n String[] deadlineArr = arr[1].split(\" /by \", 2);\n if (deadlineArr.length == 1) {\n throw new DukeException(\"OOPS!!! You forgot to specify a date/time for the deadline.\");\n } else {\n Task task = new Deadline(deadlineArr[0], deadlineArr[1]);\n return new AddCommand(task);\n }\n }\n } else if (command.equals(\"event\")) {\n if (arr.length == 1) {\n throw new DukeException(\"OOPS!!! The description of an event cannot be empty.\");\n } else {\n String[] eventArr = arr[1].split(\" /at \", 2);\n if (eventArr.length == 1) {\n throw new DukeException(\"OOPS!!! You forgot to specify a date/time for the event.\");\n } else {\n Task task = new Event(eventArr[0], eventArr[1]);\n return new AddCommand(task);\n }\n }\n } else if (command.equals(\"done\")) {\n String[] array = arr[1].split(\"\\\\s+\");\n int[] options = new int[array.length];\n for (int i = 0; i < options.length; i++) {\n options[i] = Integer.parseInt(array[i]);\n }\n return new DoneCommand(options);\n } else if (command.equals(\"delete\")) {\n String[] array = arr[1].split(\"\\\\s+\");\n int[] options = new int[array.length];\n for (int i = 0; i < options.length; i++) {\n options[i] = Integer.parseInt(array[i]);\n }\n return new DeleteCommand(options);\n } else if (command.equals(\"list\")) {\n return new ListCommand();\n } else if (command.equals(\"find\")) {\n return new FindCommand(arr[1]);\n } else if (command.equals(\"bye\")) {\n return new ExitCommand();\n } else {\n throw new DukeException(\"OOPS!!! I'm sorry, but I don't know what that means :-(\");\n }\n }", "public static String parser(String input) throws IOException{\n\t\tif (input == null)\n\t\t\treturn \"Null input!\";\n\t\t\n\t\telse if (input.startsWith(\"HTTPClient \")){\n\t\t\tinput = input.replace(\"HTTPClient \", \"\"); // Cut HTTPClient of the string so we can handle the command more easily.\n\t\t\t\t\t\t\n\t\t\tif(\"exit\".equals(input))\n\t\t\t\treturn EXIT();\n\t\t\t\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tString[] splitted = input.split(\"\\\\s+\"); // Split around spaces\n\t\t\t\tString command = splitted[0];\n\t\t\t\tString uri = splitted[1];\n\t\t\t\tint port = Integer.parseInt(splitted[2]);\n\t\t\t\tSystem.out.println(uri);\n\t\t\t\tSystem.out.println(port);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (command.startsWith(\"HEAD\")){\n\t\t\t\t\treturn HEAD(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"GET\")){\n\t\t\t\t\treturn GET(uri, port);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (command.startsWith(\"PUT\")){\n\t\t\t\t\treturn PUT(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"POST\")){ \n\t\t\t\t\treturn POST(uri, port);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "public Command parseCommand(String userInput) throws ParseException {\n final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());\n if (!matcher.matches()) {\n throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));\n }\n\n final String commandWord = matcher.group(\"commandWord\");\n final String arguments = matcher.group(\"arguments\");\n switch (commandWord) {\n\n // ========================== Easy Travel Commands =========================\n case HelpCommand.COMMAND_WORD:\n return new HelpCommand();\n\n case ExitCommand.COMMAND_WORD:\n return new ExitCommand();\n\n // ========================== Trip Commands =========================\n case SetTripCommand.COMMAND_WORD:\n return new SetTripCommandParser().parse(arguments);\n\n case DeleteTripCommand.COMMAND_WORD:\n return new DeleteTripCommand();\n\n case CheckStatusCommand.COMMAND_WORD:\n return new CheckStatusCommand();\n\n case EditBudgetCommand.COMMAND_WORD:\n return new EditBudgetCommandParser().parse(arguments);\n\n case RenameCommand.COMMAND_WORD:\n return new RenameCommandParser().parse(arguments);\n // ========================== Schedule Commands =========================\n case ScheduleCommand.COMMAND_WORD:\n return new ScheduleCommandParser().parse(arguments);\n\n case UnscheduleCommand.COMMAND_WORD:\n return new UnscheduleCommandParser().parse(arguments);\n\n case ListScheduleCommand.COMMAND_WORD:\n return new ListScheduleCommand();\n\n // ========================== Fixed Expense Commands =========================\n case AddFixedExpenseCommand.COMMAND_WORD:\n return new AddFixedExpenseCommandParser().parse(arguments);\n\n case ClearFixedExpenseCommand.COMMAND_WORD:\n return new ClearFixedExpenseCommand();\n\n case DeleteFixedExpenseCommand.COMMAND_WORD:\n return new DeleteFixedExpenseCommandParser().parse(arguments);\n\n case EditFixedExpenseCommand.COMMAND_WORD:\n return new EditFixedExpenseCommandParser().parse(arguments);\n\n case CheckBudgetStatus.COMMAND_WORD:\n return new CheckBudgetStatus();\n\n case SortFixedExpenseCommand.COMMAND_WORD:\n return new SortFixedExpenseCommandParser().parse(arguments);\n\n case ListFixedExpenseCommand.COMMAND_WORD:\n return new ListFixedExpenseCommand();\n\n // ========================== Transport Booking Commands =========================\n case AddTransportBookingCommand.COMMAND_WORD:\n return new AddTransportBookingCommandParser().parse(arguments);\n\n case EditTransportBookingCommand.COMMAND_WORD:\n return new EditTransportBookingCommandParser().parse(arguments);\n\n case DeleteTransportBookingCommand.COMMAND_WORD:\n return new DeleteTransportBookingCommandParser().parse(arguments);\n\n case ClearTransportBookingCommand.COMMAND_WORD:\n return new ClearTransportBookingCommand();\n\n case SortTransportBookingCommand.COMMAND_WORD:\n return new SortTransportBookingCommandParser().parse(arguments);\n\n case ListTransportBookingCommand.COMMAND_WORD:\n return new ListTransportBookingCommand();\n\n // ========================== Packing List Commands =========================\n case AddItemCommand.COMMAND_WORD:\n return new AddItemCommandParser().parse(arguments);\n\n case AddPresetCommand.COMMAND_WORD:\n return new AddPresetCommandParser().parse(arguments);\n\n case CheckItemCommand.COMMAND_WORD:\n return new CheckItemCommandParser().parse(arguments);\n\n case ClearItemCommand.COMMAND_WORD:\n return new ClearItemCommand();\n\n case DeleteItemCommand.COMMAND_WORD:\n return new DeleteItemCommandParser().parse(arguments);\n\n case EditItemCommand.COMMAND_WORD:\n return new EditItemCommandParser().parse(arguments);\n\n case FindItemCommand.COMMAND_WORD:\n return new FindItemCommandParser().parse(arguments);\n\n case FindItemCategoryCommand.COMMAND_WORD:\n return new FindItemCategoryCommandParser().parse(arguments);\n\n case UncheckItemCommand.COMMAND_WORD:\n return new UncheckItemCommandParser().parse(arguments);\n\n case ListItemCommand.COMMAND_WORD:\n return new ListItemCommand();\n\n case ListPresetCommand.COMMAND_WORD:\n return new ListPresetCommand();\n\n case SortItemCommand.COMMAND_WORD:\n return new SortItemCommandParser().parse(arguments);\n\n\n // ========================== Activity Commands =========================\n case AddActivityCommand.COMMAND_WORD:\n return new AddActivityCommandParser().parse(arguments);\n\n case DeleteActivityCommand.COMMAND_WORD:\n return new DeleteActivityCommandParser().parse(arguments);\n\n case ClearActivityCommand.COMMAND_WORD:\n return new ClearActivityCommand();\n\n case EditActivityCommand.COMMAND_WORD:\n return new EditActivityCommandParser().parse(arguments);\n\n case FindActivityCommand.COMMAND_WORD:\n return new FindActivityCommandParser().parse(arguments);\n\n case FindActivityTagCommand.COMMAND_WORD:\n return new FindActivityTagCommandParser().parse(arguments);\n\n case ListActivityCommand.COMMAND_WORD:\n return new ListActivityCommand();\n\n case SortActivityCommand.COMMAND_WORD:\n return new SortActivityCommandParser().parse(arguments);\n\n // ========================== Accommodation Commands =========================\n case AddAccommodationBookingCommand.COMMAND_WORD:\n return new AddAccommodationBookingCommandParser().parse(arguments);\n\n case ClearAccommodationBookingCommand.COMMAND_WORD:\n return new ClearAccommodationBookingCommand();\n\n case DeleteAccommodationBookingCommand.COMMAND_WORD:\n return new DeleteAccommodationBookingCommandParser().parse(arguments);\n\n case EditAccommodationBookingCommand.COMMAND_WORD:\n return new EditAccommodationBookingCommandParser().parse(arguments);\n\n case SortAccommodationBookingCommand.COMMAND_WORD:\n return new SortAccommodationBookingParser().parse(arguments);\n\n case ListAccommodationBookingCommand.COMMAND_WORD:\n return new ListAccommodationBookingCommand();\n\n // ========================== Invalid Commands =========================\n default:\n throw new ParseException(MESSAGE_UNKNOWN_COMMAND);\n }\n }", "public static String KeyboardScan(){\n\n System.out.println(\"Enter a command : \");\n Scanner sc = new Scanner(System.in);\n String command = sc.next().toLowerCase();\n if(command.equals(\"help\") || command.equals(\"exit\") || command.equals(\"adduser\") || command.equals(\"edituser\") || command.equals(\"removeuser\") || command.equals(\"listusers\") || command.equals(\"addcar\") || command.equals(\"editcar\") || command.equals(\"removecar\") || command.equals(\"listcars\") || command.equals(\"rentcar\") || command.equals(\"returncar\") || command.equals(\"listrents\") || command.equals(\"saveusers\") || command.equals(\"restoreusers\") || command.equals(\"serialusers\" )|| command.equals(\"saverents\") || command.equals(\"loadrents\") || command.equals(\"savecars\") || command.equals(\"loadcars\") || command.equals(\"saveall\") || command.equals(\"loadall\")) {\n return command;\n } else {\n return \"error\";\n }\n\n }", "public static void processUserInput(String input){\n\t\t\n\t\t\tAlgorithm1 alg1 = new Algorithm1(input, distance, inputMap);\n\t\t\t// Calculates shortest path using distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg1.getShortestPath();\n\t\t\t\n\t\t\t\n\t\t\tAlgorithm2 alg2 = new Algorithm2(input, distance, inputMap);\n\t\t\t// Calculates shortest path using both input and distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg2.getShortestPath();\n\t\t\t\n\t\t\t\n\t}", "public void splitUserInput(String userInput) {\n\t\tuserArgs = userInput.split(\" \");\n\t}", "String getCommand(){\n\t\tString command=\"\";\n\t\ttry{\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tcommand = br.readLine();\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Somethinf went wrong with the system input!! Please try again.\");\n\t\t}\n\t\treturn command;\n\t}", "public CLI(String inputCommand)\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = inputCommand;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}", "private void commandPrompt(String command)\n { \n if(command.equals(\"list\"))\n {\n String city = \" \";\n String item = \" \";\n\n if(scanner.next().equals(\"city:\"))\n {\n city = scanner.next();\n } \n\n if(scanner.next().equals(\"item:\"))\n {\n item = scanner.next();\n } \n\n if(scanner.nextLine().equals(\"\"))\n {\n commandList(city, item);\n }\n }\n\n if(command.equals(\"findgoods\"))\n {\n String cityForGoods = scanner.nextLine(); \n\n if(scanner.nextLine().equals(\"\"))\n {\n commandFindGoods(cityForGoods);\n }\n }\n\n if(command.equals(\"findcities\"))\n {\n String goodsForCity = scanner.nextLine();\n if(scanner.nextLine().equals(\"\"))\n {\n commandFindCities(goodsForCity);\n }\n }\n\n if(command.equals(\"add\"))\n {\n String cityToAdd = scanner.nextLine();\n\n if(scanner.nextLine().equals(\"\"))\n {\n commandAddCity(cityToAdd);\n }\n }\n\n commandProgramBasic(command); \n }", "public Command parse(String userInput, TaskList taskList) throws CommandException {\n String fullInput = parseShortcutCommandAndDetails(userInput);\n String[] commandAndDetails = fullInput.split(COMMAND_WORD_DELIMITER, 2);\n String commandType = commandAndDetails[0];\n String taskInfo = \"\";\n if (commandAndDetails.length > 1) {\n taskInfo = commandAndDetails[1];\n }\n int namePos = taskInfo.indexOf(NAME_DELIMITER);\n int timePos = taskInfo.indexOf(TIME_DELIMITER);\n int durationPos = taskInfo.indexOf(DURATION_DELIMITER);\n int deadlinePos = taskInfo.indexOf(DEADLINE_DELIMITER);\n int recurrencePos = taskInfo.indexOf(RECURRENCE_DELIMITER);\n int importancePos = taskInfo.indexOf(IMPORTANCE_DELIMITER);\n int addNotesPos = taskInfo.indexOf(ADDITIONAL_NOTES_DELIMITER);\n int forecastPos = taskInfo.indexOf(FORECAST_DELIMITER);\n switch (commandType) {\n case \"add\": {\n return parseAddCommand(taskInfo, namePos, timePos, durationPos, deadlinePos,\n recurrencePos, importancePos, addNotesPos);\n }\n case \"edit\": {\n return parseEditCommand(taskInfo, namePos, timePos, durationPos, deadlinePos,\n recurrencePos, importancePos, addNotesPos, taskList);\n }\n case \"list\": {\n return parseListCommand(taskInfo, importancePos, forecastPos);\n }\n case \"done\": {\n return parseDoneCommand(taskInfo);\n }\n case \"delete\": {\n return parseDeleteCommand(taskInfo);\n }\n case \"view\": {\n return parseViewCommand(taskInfo);\n }\n case \"help\": {\n return new HelpCommand();\n }\n case \"exit\": {\n return new ExitCommand();\n }\n default: {\n throw new InvalidCommandException();\n }\n }\n }", "private void extractParameters() throws IndexOutOfBoundsException {\n switch (commandType) {\n case DONE:\n parameters = userInput.substring(INDEX_AFTER_DONE);\n break;\n case TODO:\n parameters = userInput.substring(INDEX_AFTER_TODO);\n break;\n case DEADLINE:\n parameters = userInput.substring(INDEX_AFTER_DEADLINE);\n break;\n case EVENT:\n parameters = userInput.substring(INDEX_AFTER_EVENT);\n break;\n case DELETE:\n parameters = userInput.substring(INDEX_AFTER_DELETE);\n break;\n case FIND:\n parameters = userInput.substring(INDEX_AFTER_FIND);\n break;\n case LIST:\n if (userInput.length() == LIST_LENGTH) {\n parameters = null;\n } else {\n parameters = userInput.substring(INDEX_AFTER_LIST);\n }\n break;\n case HELP:\n // Help does not take any parameters;\n case BYE:\n // Bye does not take any parameters\n default:\n parameters = null;\n }\n }", "private void parseCommand(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tString commandString;\n\t\tif(tokens.length == 4) {\n\t\t\tcommandString = tokens[2] + \" \" + tokens[3];\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tcommandString = tokens[2];\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid command argument\");\n\t\t}\n\t\tthis.registerCommand(tokens[1].charAt(0), commandString);\n\t}", "public static void main(String[] args) {\n // check for correct usage\n if (args.length < 1) {\n System.out.println(\"usage: java Vault [-au] <filename>\");\n System.exit(1);\n }\n\n // check for au option\n boolean addUser = false;\n if (args.length == 2)\n addUser = true;\n\n // open the file, or print error and exit\n Scanner sc = null;\n try {\n sc = new Scanner(new FileReader((addUser ? args[1] : args[0])));\n }catch (IOException e) {\n System.out.println(\"Error! File '\" + (addUser ? args[1] : args[0]) + \n \"' could not be opened.\");\n System.exit(2);\n }\n \n // read each line of the file, storing each user in users\n ArrayList<User> users = new ArrayList<User>();\n while (sc.hasNextLine()) {\n String[] line = sc.nextLine().split(\" \");\n \n if (line.length == 4 && line[0].equals(\"user\")) {\n users.add(new User(line[1], line[2], line[3]));\n\n }else if (line.length == 4 && line[0].equals(\"data\")) {\n for (int i = 0; i < users.size(); i++) {\n if (users.get(i).getName().equals(line[1]))\n users.get(i).addDatum(line[2], line[3]);\n }\n\n }else {\n System.out.println(\"Error! File '\" + (addUser ? args[1] : args[0]) + \n \"' improperly formatted.\");\n System.exit(3);\n }\n\n }\n //close read file\n sc.close();\n\n // ask user for username and password\n System.out.print(\"username: \");\n String name = System.console().readLine();\n System.out.print(\"password: \");\n char[] password = System.console().readPassword();\n\n // if au option, collect info and add to file, then quit\n if (addUser) {\n PrintWriter pw = null;\n try {\n pw = new PrintWriter(new File(args[1]));\n } catch (FileNotFoundException fnfe) {\n fnfe.printStackTrace();\n System.exit(6);\n }\n\n System.out.print(\"Hash algorithm: \");\n String hashAlg = System.console().readLine();\n\n // perform checks and hash password\n for (char c : password) {\n if ((int)c < 42 || (int)c > 122) {\n System.out.println(\"Error! Invalid symbol '\" + c + \"' in password.\");\n System.exit(7);\n }\n }\n Hasher hasher = null;\n String passhash = null;\n if (hashAlg.equals(\"clear\")) {\n hasher = new Clear();\n }else if (hashAlg.equals(\"shift+caesar\")) {\n hasher = new Caesar();\n }else if (hashAlg.equals(\"shift+vigenere\")) {\n hasher = new Vigenere();\n }else {\n System.out.println(\"Error! Hash algorithm '\" + hashAlg + \"' not supported.\");\n System.exit(8);\n }\n passhash = hasher.hash(password);\n for (User u : users) {\n if (u.getName().equals(name)) {\n System.out.print(\"Error! Username '\" + name + \"' already in use.\");\n System.exit(9);\n }\n }\n \n users.add(new User(name, hashAlg, passhash));\n for (User u : users) {\n pw.println(String.join(\" \", \"user\", u.getName(), u.getHashAlg(), u.getHash()));\n }\n\n pw.close();\n System.exit(0);\n }\n\n // determine access, exit if denied\n boolean access = false;\n User curr = null;\n for (User u : users) {\n if (u.getName().equals(name)) {\n try {\n if (u.validate(password)) {\n System.out.println(\"Access granted!\");\n access = true;\n curr = u;\n }\n break;\n }catch (UnsupportedHashException e) {\n System.out.println(\"Error! Hash algorithm '\" + u.getHashAlg() + \n \"' not supported.\");\n System.exit(4);\n }\n }\n }\n if (!access) {\n System.out.println(\"Access denied!\");\n System.exit(5);\n }\n\n // if granted access, open prompt for commands\n System.out.print(\"> \");\n sc = new Scanner(System.in);\n String cmd = null;\n ArrayList<Datum> data = curr.getData();\n while (!(cmd = sc.next()).equals(\"quit\")) {\n switch(cmd) {\n case \"labels\": for (Datum d : data) {\n d.getEnc().init(password);\n try {\n String plain = d.getEnc().decrypt(d.getCipher());\n if (!plain.contains(\"_\")) throw new Exception();\n System.out.println(plain.split(\"_\")[0]);\n }catch (Exception e) {\n System.out.println(\"Error! Corrupted entry '\" +\n d.getCipher() + \n \"' in vault file.\");\n }\n }\n break;\n\n case \"get\": cmd = sc.next();\n for (Datum d : data) {\n d.getEnc().init(password);\n try {\n String plain = d.getEnc().decrypt(d.getCipher());\n if (!plain.contains(\"_\")) throw new Exception();\n if (plain.split(\"_\", 2)[0].equals(cmd))\n System.out.println(plain.split(\"_\", 2)[1]);\n }catch (Exception e) {\n System.out.println(\"Error! Corrupted entry '\" + \n d.getCipher() + \n \"' in vault file.\");\n }\n }\n break; \n\n default: System.out.println(\"Unknown command '\" + cmd + \"'.\");\n break;\n }\n System.out.print(\"> \");\n\n }\n\n \n\n }", "public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\n }\n }\n }", "public String readCommand() {\n sc = new Scanner(System.in);\n userInput = new TextField();\n return userInput.getText();\n }", "private static void inputsLogin(String arg, String[] groups) {\n if (arg.matches(\"quit\") && REG_CMD.hasParam(groups, 0)) {\n running = false;\n } else if (arg.matches(\"reset\") && REG_CMD.hasParam(groups, 0)) {\n Core.reset();\n Terminal.printLine(\"OK\");\n } else if (arg.matches(\"logout-admin\") && REG_CMD.hasParam(groups, 0)) {\n Terminal.printLine(Core.getSystem().logout());\n } else if (arg.matches(\"add-sports-venue\") && REG_CMD.hasParam(groups, 6)) {\n int param0 = REG_CMD.getNum(REG_CMD.getParam(groups, 0));\n int param4 = REG_CMD.getNum(REG_CMD.getParam(groups, 4));\n int param5 = REG_CMD.getNum(REG_CMD.getParam(groups, 5));\n if (param0 != -1 && param4 != -1 && param5 != -1 && REG_CMD.getParam(groups, 0).length() == 3) {\n Terminal.printLine(Core.getVenueHandler().addSportsVenue(\n REG_CMD.getParam(groups, 0),\n REG_CMD.getParam(groups, 1),\n REG_CMD.getParam(groups, 2),\n REG_CMD.getParam(groups, 3),\n param4, param5));\n } else\n Terminal.printError(\"invalid input parameters.\");\n } else if (arg.matches(\"list-sports-venues\") && REG_CMD.hasParam(groups, 1)) {\n String output = Core.getVenueHandler().listSportVenues(REG_CMD.getParam(groups, 0));\n if (!output.isEmpty())\n Terminal.printLine(output);\n } else if (arg.matches(\"add-olympic-sport\") && REG_CMD.hasParam(groups, 2)) {\n Terminal.printLine(Core.getSportHandler().addDiscipline(REG_CMD.getParam(groups, 0),\n REG_CMD.getParam(groups, 1)));\n } else if (arg.matches(\"list-olympic-sports\") && REG_CMD.hasParam(groups, 0)) {\n String output = Core.getSportHandler().listSports();\n if (!output.isEmpty())\n Terminal.printLine(output);\n } else if (arg.matches(\"add-ioc-code\") && REG_CMD.hasParam(groups, 4)) {\n int param0 = REG_CMD.getNum(REG_CMD.getParam(groups, 0));\n int param3 = REG_CMD.getNum(REG_CMD.getParam(groups, 3));\n if (param0 != -1 && param3 != -1 && REG_CMD.getParam(groups, 0).length() == 3) {\n Terminal.printLine(Core.getIocHandler().addIOC(\n REG_CMD.getParam(groups, 0), REG_CMD.getParam(groups, 1), REG_CMD.getParam(groups, 2), param3));\n } else\n Terminal.printError(\"invalid input parameters.\");\n } else if (arg.matches(\"list-ioc-codes\") && REG_CMD.hasParam(groups, 0)) {\n String output = Core.getIocHandler().listIOC();\n if (!output.isEmpty())\n Terminal.printLine(output);\n } else if (arg.matches(\"add-athlete\") && REG_CMD.hasParam(groups, 6)) {\n int param0 = REG_CMD.getNum(REG_CMD.getParam(groups, 0));\n if (param0 != -1 && REG_CMD.getParam(groups, 0).length() == 4) {\n Terminal.printLine(Core.getAthleteHandler().addAthlete(\n REG_CMD.getParam(groups, 0), REG_CMD.getParam(groups, 1), REG_CMD.getParam(groups, 2),\n REG_CMD.getParam(groups, 3), REG_CMD.getParam(groups, 4), REG_CMD.getParam(groups, 5)));\n } else {\n Terminal.printError(\"invalid input parameters.\");\n }\n } else if (arg.matches(\"summary-athletes\") && REG_CMD.hasParam(groups, 2)) {\n String output = Core.getAthleteHandler().summaryAthletes(REG_CMD.getParam(groups, 0),\n REG_CMD.getParam(groups, 1));\n if (!output.isEmpty())\n Terminal.printLine(output);\n } else if (arg.matches(\"add-competition\") && REG_CMD.hasParam(groups, 8)) {\n int param0 = REG_CMD.getNum(REG_CMD.getParam(groups, 0));\n int param1 = REG_CMD.getNum(REG_CMD.getParam(groups, 1));\n int param5 = REG_CMD.getNum(REG_CMD.getParam(groups, 5));\n int param6 = REG_CMD.getNum(REG_CMD.getParam(groups, 6));\n int param7 = REG_CMD.getNum(REG_CMD.getParam(groups, 7));\n if (param0 != -1 && param1 != -1 && param5 != -1 && param6 != -1 && param7 != -1\n && REG_CMD.getParam(groups, 0).length() == 4) {\n Terminal.printLine(Core.getCompetitionHandler().addCompetition(\n REG_CMD.getParam(groups, 0), param1, REG_CMD.getParam(groups, 2),\n REG_CMD.getParam(groups, 3), REG_CMD.getParam(groups, 4), param5, param6, param7));\n } else {\n Terminal.printError(\"invalid input parameters.\");\n }\n } else if (arg.matches(\"olympic-medal-table\") && REG_CMD.hasParam(groups, 0)) {\n String output = Core.getMedalTableHandler().listMedals();\n if (!output.isEmpty())\n Terminal.printLine(output);\n } else {\n Terminal.printError(\"unknown command or the input parameters are invalid.\");\n }\n }", "static String getCommand() {\n\t\tString command;\n\t\twhile (true) {\n\t\t\tScanner sca = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Enter Command: \");\n\t\t\tcommand = sca.next();\n\t\t\tif (command.equals(\"ac\") || command.equals(\"dc\") || command.equals(\"as\") || command.equals(\"ds\") || command.equals(\"p\") || command.equals(\"q\"))\n\t\t\t\tbreak;\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Invalid command: \" + command);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(command);\n\t\treturn command;\n\t}", "private static String[] collectInput() {\n\t\tString command = sc.next();\n\t\tString i = sc.next();\n\t\tString destination = sc.next();\n\t\treturn new String[] { command, destination };\n\t\t\n\t}", "void mainMenuCommand(String command){\n\t\tString[] strArray=command.split(\"\\\\s\");\n\t\tString mainCommand=strArray[0];\n\t\t\n\t\t// if - else if - else loop to check for the particular command and take actions according those commands\n\t\t\n\t\t\n\t\t// Block to print the song details for given song id\n\t\tif(mainCommand.equals(\"song\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printSong(songID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid song id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to print the playlist details for given playlist id\n\t\telse if(mainCommand.equals(\"playlist\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint playlistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printPlaylist(playlistID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid playlist id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to whole song list or all playlist depending on the user input\n\t\telse if(mainCommand.equals(\"print\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"song\")){\n\t\t\t\t\t\tsongFile.printAllSongs();\n\t\t\t\t\t}\n\t\t\t\t\telse if(subCommand.equals(\"playlist\")){\n\t\t\t\t\t\tsongFile.printAllplaylist();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid print command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to perform search for songs in the song list with user given attribute and search terms\n\t\telse if(mainCommand.equals(\"search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length > 2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase(); \n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchSong(subCommand, songAttributeValue);\n\t\t\t\t\t\tsongFile.printArrayList(list);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!! \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid search command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to sort the song list on user given song attribute\n\t\telse if(mainCommand.equals(\"sort\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tsongFile.sortSongs(subCommand);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid sort command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to create the new playlist and go to playlist menu\n\t\telse if(mainCommand.equals(\"create\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString playlistName=strArray[1];\n\t\t\t\t\tcurrentPlaylistID=songFile.createPlaylist(playlistName);\n\t\t\t\t\t// Flag which takes to playlist menu / sub menu\n\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid create command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to edit the given playlist id\n\t\telse if(mainCommand.equals(\"edit\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tcurrentPlaylistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tif(songFile.isPlaylistIdAvailable(currentPlaylistID)){// currentPlaylistID<songFile.playlistID){\n\t\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Playlist ID!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid edit command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// For all other invalid commands\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter valid command.\");\n\t\t}\n\t\n\t}", "public static void main(String[] args) {\n try(\n\t\tFileInputStream in=new FileInputStream(\"credentials.properties\");\n \t)\n {\n \tProperties props=new Properties();\n \tprops.load(in);\n \tString uname=props.getProperty(\"username\");\n \tString pass=props.getProperty(\"password\");\n \t\n \tSystem.out.println(uname+\" \"+pass);\n \t\n } catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \n\t}", "private ConsoleCommand mapConsoleCommand( String[] parsedString ){\r\n\t\t\r\n\t\tFileSystemService fileSysSrv = new FileSystemService();\r\n\t\tStringBuilder errorSB = new StringBuilder();\r\n\t\tConsoleCommand consoleCommand = new ConsoleCommand();\r\n\t\t\r\n\t\tconsoleCommand.setCommand( parsedString[ AppConstanst.COMMAND_IDX ] );\r\n\t\t\t\t\r\n\t\tif ( parsedString.length < AppConstanst.MIN_SCAN_PARAM ){\r\n\t\t\terrorSB.append( AppConstanst.NOT_ALL_REQ_COMMAND_SET ) ;\r\n\t\t} else {\r\n\t\t\t// VALIDATE INPUTDIR COMMAND\r\n\t\t\tconsoleCommand.setInputDir( parsedString[ AppConstanst.INPUT_DIR_IDX ] );\r\n\t\t\tif ( !AppConstanst.SCAN_INPUT_DIR.equals( consoleCommand.getInputDir() ) ){\r\n\t\t\t\terrorSB.append( AppConstanst.WRONG_REQ_COMMAND+\" \"+consoleCommand.getInputDir()+AppConstanst.MUST_BE+AppConstanst.SCAN_INPUT_DIR+\"\\n\" );\r\n\t\t\t}\r\n\t\t\tconsoleCommand.setInputDirValue( parsedString[ AppConstanst.INPUT_DIR_VALUE_IDX ] );\r\n\t\t\tif ( ! consoleCommand.getInputDirValue().matches( AppConstanst.ABS_PATH) ){\r\n\t\t\t\terrorSB.append( AppConstanst.ILLEGAL_INPUT_PATH + consoleCommand.getInputDirValue()+\"\\n\");\r\n\t\t\t}\r\n\t\t\t//CHECK IS INPUT DIR EXIST, IF NOT TRY CREATE IT\r\n\t\t if ( !fileSysSrv.isDirectoryExist( consoleCommand.getInputDirValue() ) ){\r\n\t\t \tif ( !fileSysSrv.makeDirectory( consoleCommand.getInputDirValue() ) ){\r\n\t\t \t\terrorSB.append( AppConstanst.INPUT_DIR_NOT_EXISTS + consoleCommand.getInputDirValue()+\"\\n\");\r\n\t\t \t};\r\n\t\t }\r\n\t\t\t// VALIDATE OUTPUTDIR COMMAND\r\n\t\t\tconsoleCommand.setOutPutDir( parsedString[ AppConstanst.OUTPUT_DIR_IDX ] );\r\n\t\t\tif ( !AppConstanst.SCAN_OUTPUT_DIR.equals( consoleCommand.getOutPutDir() ) ){\r\n\t\t\t\terrorSB.append( AppConstanst.WRONG_REQ_COMMAND+\" \"+consoleCommand.getOutPutDir()+AppConstanst.MUST_BE+AppConstanst.SCAN_OUTPUT_DIR+\"\\n\" );\r\n\t\t\t}\r\n\t\t\tconsoleCommand.setOutPutDirValue( parsedString[ AppConstanst.OUTPUT_DIR_VALUE_IDX ] );\r\n\t\t\tif ( ! consoleCommand.getOutPutDirValue().matches( AppConstanst.ABS_PATH) ){\r\n\t\t\t\terrorSB.append( AppConstanst.ILLEGAL_OUTPUT_PATH + consoleCommand.getOutPutDirValue()+\"\\n\" );\r\n\t\t\t}\r\n\t\t\t//CHECK IS OUTPUT DIR EXIST, IF NOT TRY CREATE IT\r\n\t\t if ( !fileSysSrv.isDirectoryExist( consoleCommand.getOutPutDirValue() ) ){\r\n\t\t \tif ( !fileSysSrv.makeDirectory( consoleCommand.getOutPutDirValue() ) ){\r\n\t\t \t\terrorSB.append( AppConstanst.OUTPUT_DIR_NOT_EXISTS + consoleCommand.getOutPutDirValue()+\"\\n\");\r\n\t\t \t};\r\n\t\t }\r\n\t\t\t// VALIDATE MASK COMMAND\r\n\t\t\tconsoleCommand.setMask( parsedString[ AppConstanst.MASK_IDX ] );\r\n\t\t\tif ( !AppConstanst.SCAN_MASK.equals( consoleCommand.getMask() ) ){\r\n\t\t\t\terrorSB.append( AppConstanst.WRONG_REQ_COMMAND+\" \"+consoleCommand.getMask()+AppConstanst.MUST_BE+AppConstanst.SCAN_MASK+\"\\n\" );\r\n\t\t\t}\r\n\t\t\tconsoleCommand.setMaskValue( parsedString[ AppConstanst.MASK_VALUE_IDX ]);\r\n\t\t\tif ( ! AppUtils.isMaskCorrect( consoleCommand.getMaskValue() ) ){\r\n\t\t\t\terrorSB.append( AppConstanst.ILLEGAL_MASK + consoleCommand.getMaskValue()+\"\\n\" );\r\n\t\t\t}\r\n\t\t\t// VALIDATE WAIT INTERVAL COMMAND\r\n\t\t\tconsoleCommand.setWaitInterval( parsedString[ AppConstanst.WAIT_INTERVAL_IDX ] );\r\n\t\t\tif ( !AppConstanst.SCAN_WAIT_INTERVAL.equals( consoleCommand.getWaitInterval() ) ){\r\n\t\t\t\terrorSB.append( AppConstanst.WRONG_REQ_COMMAND+\" \"+consoleCommand.getWaitInterval()+AppConstanst.MUST_BE+AppConstanst.SCAN_WAIT_INTERVAL+\"\\n\" );\r\n\t\t\t}\r\n\t\t\tLong interval= null;\r\n\t\t\ttry{\r\n\t\t\t\tinterval = Long.parseLong( parsedString[ AppConstanst.WAIT_INTERVAL_VALUE_IDX ] );\r\n\t\t\t} catch (NumberFormatException e) {} \r\n\t\t\tconsoleCommand.setWaitIntervalValue( interval );\r\n\t\t\tif ( interval == null || interval < 0){\r\n\t\t\t\terrorSB.append( AppConstanst.INCORECT_WAIT_INTERVAL + parsedString[ AppConstanst.WAIT_INTERVAL_VALUE_IDX ]+AppConstanst.POSITIVE_INT+\"\\n\" );\r\n\t\t\t}\r\n\t\t\t// VALIDATE NOT REQUIRED COMMAND\r\n\t\t\t\r\n\t\t\t\tfor (int idx = AppConstanst.MIN_SCAN_PARAM+1; idx < parsedString.length; idx += 2){\r\n\t\t\t\t\tif ( AppConstanst.SCAN_INCLUDE_SUB.equals( parsedString[ idx ] ) ){\r\n\t\t\t\t\t\tconsoleCommand.setIncludeSubs( parsedString[ idx ] );\r\n\t\t\t\t\t\tconsoleCommand.setIncludeSubsValue( parsedString[ idx+1 ] );\r\n\t\t\t\t\t\tif ( !AppConstanst.TRUE.equals( parsedString[ idx+1 ]) && !AppConstanst.FALSE.equals( parsedString[ idx+1 ] ) ){\r\n\t\t\t\t\t\t\terrorSB.append( AppConstanst.INCORECT_INCLUDE_SUBFOLDERS+\" \"+parsedString[ idx+1 ]+AppConstanst.TRUE_OR_FALSE+\"\\n\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( AppConstanst.SCAN_AUTO_DELETE.equals( parsedString[ idx ] ) ){\r\n\t\t\t\t\t\tconsoleCommand.setAutoDelete( parsedString[ idx ] );\r\n\t\t\t\t\t\tconsoleCommand.setAutoDeleteValue( parsedString[ idx+1 ] );\r\n\t\t\t\t\t\tif ( !AppConstanst.TRUE.equals( parsedString[ idx+1 ]) && !AppConstanst.FALSE.equals( parsedString[ idx+1 ] ) ){\r\n\t\t\t\t\t\t\terrorSB.append( AppConstanst.INCORECT_AUTODELETE+\" \"+parsedString[ idx+1 ]+AppConstanst.TRUE_OR_FALSE+\"\\n\" );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tif ( errorSB.length() > 0 ){\r\n\t\t\tSystem.out.println(AppConstanst.ERROR_IN_SCAN_COMMAND+ errorSB.toString());\r\n\t\t\tconsoleCommand.setCommand( AppConstanst.UNKNOWN);\r\n\t\t} \r\n\t\treturn consoleCommand;\r\n\t}", "public static void main(String[] args) {\n\t\ttry {\n\t\t\tSystem.out.println(\"\\nReading tables from disk...\");\n\t\t\tDatabase.readTablesFromDisk();\n\t\t\tSystem.out.println(\"Successfully read tables from disk.\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Failed to read tables from disk!\");\n\t\t\tSystem.out.println(e.getMessage()+\"\\n\\nStarting with blank database...\");\n\t\t}\n\t\ttry {\n\t\t\tSystem.out.println(\"\\nReading users from disk...\");\n\t\t\tUsers.readUsersFromDisk();\n\t\t\tSystem.out.println(\"Successfully read users from disk.\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Failed to read users from disk!\");\n\t\t\tSystem.out.println(e.getMessage()+\"\\n\\nStarting with 'admin' as only user...\");\n\t\t}\n\t\t\n\t\t\n\t\t// prompt for username if not provided as an arg\n\t\tString userName;\n\t\tif (args.length < 1) {\n\t\t\tSystem.out.print(\"\\nUsername: \");\n\t\t\tuserName = (new Scanner(System.in)).nextLine();\n\t\t} else {\n\t\t\tuserName = args[0];\n\t\t}\n\t\t\n\t\t// login user\n\t\ttry {\n\t\t\tUsers.setCurrentUser(userName);\n\t\t} catch (DatabaseException e) {\n\t\t\tSystem.out.println(\"\\n\"+e.getMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t// parse and execute commands until QUIT\n\t\tCommandExtractor extractor = new CommandExtractor(System.in);\n\t\tSQLParser parser = new SQLParser(System.in);\n\t\tString commandString;\n\t\tInputStream commandStream;\n\t\tCommand command;\n\t\t\n\t\tboolean quit = false;\n\t\tdo {\n\t\t\t\n\t\t\tSystem.out.print(\"\\nSQL> \");\n\t\t\t\n\t\t\t// extract command\n\t\t\ttry {\n\t\t\t\tcommandString = extractor.readCommand();\n\t\t\t\tif (commandString==null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (IOException | ParseException e) {\n\t\t\t\tSystem.out.println(\"\\n\"+e.getMessage());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tcommandStream = new ByteArrayInputStream(\n\t\t\t\t\tcommandString.getBytes());\n\t\t\t\n\t\t\t// parse command\n\t\t\ttry {\n\t\t\t\tparser.ReInit(commandStream);\n\t\t\t\tcommand = parser.Command();\n\t\t\t}\n\t\t\tcatch (ParseException | TokenMgrError e) {\n\t\t\t\tSystem.out.println(\"\\n\"+e.getMessage());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// execute command\n\t\t\ttry {\n\t\t\t\tquit = CommandExecutor.execute(command);\n\t\t\t} catch (DatabaseException e) {\n\t\t\t\tSystem.out.println(\"\\nDatabase error:\\n\"+e.getMessage());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t} while (!quit);\n\t\t\n\t\textractor.close();\n\t\t\n\t\t\n\t\t// write database and users to disk\n\t\ttry {\n\t\t\tDatabase.writeTablesToDisk();\n\t\t\tSystem.out.println(\"\\nWrite tables to disk succeeded.\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"\\nWrite tables to disk failed!\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\ttry {\n\t\t\tUsers.writeUsersToDisk();\n\t\t\tSystem.out.println(\"\\nWrite users to disk succeeded.\");\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"\\nWrite users to disk failed!\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "private static Params parseCLI(String[] args) {\n Params params = new Params();\n\n if(args.length>1) {\n int paramIndex = 0;\n for(int i=0; i<args.length; i++) {\n String arg = args[i];\n OutputType type = OutputType.getOutputType(arg);\n if(type!=null) {\n params.outputType = type;\n paramIndex = i;\n break;\n } else if(\"-help\".equals(arg)) {\n usage();\n System.exit(0);\n }\n }\n\n params.inputFile = args[paramIndex+1];\n if(args.length>paramIndex+2) {\n params.outputFile = args[paramIndex+2];\n }\n\n } else if(args.length == 1 && \"-help\".equals(args[0])) {\n usage();\n System.exit(0);\n\n } else {\n \n System.err.println(\"Error, incorrect usage\");\n usage();\n System.exit(-1);\n\n }\n\n return params;\n }", "public static Command parseCommand(String command) throws DukeException {\n try {\n String[] args = getArgs(command.trim());\n String commandWord = args[0];\n boolean isOneWord = isOneWord(command.trim());\n\n if (isOneWord) {\n switch (commandWord.toLowerCase()) {\n case \"list\":\n return new ListCommand();\n case \"bye\":\n return new ExitCommand();\n case \"listtag\":\n return new ListTagCommand();\n default:\n throw new DukeException(MESSAGE_INVALID_INPUT);\n }\n\n } else {\n switch (commandWord.toLowerCase()) {\n case \"todo\":\n return new AddTodo(args[1]);\n case \"deadline\":\n return new AddDeadline(args[1]);\n case \"event\":\n return new AddEvent(args[1]);\n case \"done\":\n return new DoneCommand(args[1]);\n case \"delete\":\n return new DeleteCommand(args[1]);\n case \"find\":\n return new FindCommand(args[1]);\n case \"findtag\":\n return new FindTagCommand(args[1]);\n case \"addtag\":\n return new AddTagCommand(args[1]);\n case \"deltag\":\n return new DeleteTagCommand(args[1]);\n default:\n throw new DukeException(MESSAGE_INVALID_INPUT);\n }\n }\n\n } catch (ArrayIndexOutOfBoundsException e) {\n throw new DukeException(MESSAGE_INVALID_INPUT);\n }\n }", "private void command(){\n out.println(\"Enter command: \");\n String comInput = in.nextLine();\n\n if (comInput.toLowerCase().equals(\"vote\")) {\n voteCommand();\n }else if (comInput.toLowerCase().equals(\"trade\")){\n tradeCommand();\n }else if (comInput.toLowerCase().equals(\"next\")){\n out.println(waitPrint());\n await();\n// nextRound();\n }else if(comInput.toLowerCase().equals(\"logout\")){\n// login = false;\n logout();\n }\n }", "private void handleUserEntry(String command) {\r\n //---------------------------------\r\n if(command.startsWith(\"RETURN\") || command.startsWith(\"return\") || command.startsWith(\"Return\")){\r\n clearCommandPromptScreen();\r\n WELCOMESCREEN_INSTANCE.newSession();\r\n }\r\n //---------------------------------\r\n if(command.startsWith(\"EXIT\") || command.startsWith(\"exit\") || command.startsWith(\"Exit\")){\r\n EXITCONFIRM_INSTANCE.newSession();\r\n\r\n }else {\r\n\r\n try {\r\n\r\n if (command.length() > 0) {\r\n\r\n //------------------------------------------\r\n //> VALIDATE USER ENTRY\r\n //------------------------------------------\r\n File foundFile = searchForFile(command);\r\n\r\n if(foundFile != null) {\r\n\r\n\r\n clearCommandPromptScreen();\r\n\r\n //---------------- FUN COLORED COMMAND PROMPT -----------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {\r\n ProcessBuilder builder = new ProcessBuilder(\"cmd.exe\", \"/c\", \"@echo off & color A\");\r\n Process process = builder.inheritIO().start();\r\n } catch (IOException e) {\r\n //> If this fails, its no biggie...\r\n }\r\n }\r\n\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\"////////////// (SEARCH RESULT - 'SUCCESS- FILE FOUND IN LOCKED_ME DIRECTORY') ///////////////////\");\r\n System.out.println(\"/// FILE FOUND: (\" + foundFile.getAbsolutePath() + \")\");\r\n System.out.println(\"\\nPRESS <ENTER> TO CONTINUE\");\r\n //---------------------------------\r\n BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));\r\n try {\r\n reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally {\r\n clearCommandPromptScreen();\r\n newSession();\r\n }\r\n\r\n }else{\r\n\r\n clearCommandPromptScreen();\r\n\r\n //---------------- FUN COLORED COMMAND PROMPT -----------------\r\n if(APP_INSTANCE.isWindows) {\r\n try {\r\n ProcessBuilder builder = new ProcessBuilder(\"cmd.exe\", \"/c\", \"@echo off & color C\");\r\n Process process = builder.inheritIO().start();\r\n } catch (IOException e) {\r\n //> If this fails, its no biggie...\r\n }\r\n }\r\n\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\" \");\r\n System.out.println(\"//////////// (SEARCH RESULT - 'FILE WAS NOT FOUND' IN LOCKED_ME DIRECTORY') //////////////////\");\r\n System.out.println(\"\\nPRESS <ENTER> TO CONTINUE\");\r\n //---------------------------------\r\n BufferedReader reader = new BufferedReader( new InputStreamReader(System.in));\r\n try {\r\n reader.readLine();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }finally {\r\n clearCommandPromptScreen();\r\n newSession();\r\n }\r\n }\r\n\r\n }else{\r\n //------------------------------------------\r\n //> USERS ENTRY WAS EMPTY\r\n //------------------------------------------\r\n newSession();\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n newSession();\r\n }\r\n }\r\n }", "public static void main(String[] args) {\r\n\r\n Scanner scan =new Scanner(System.in);\r\n System.out.println(\"User Name:\");\r\n String userName = scan.next();\r\n System.out.println(\"Password:\");\r\n String password = scan.next();\r\n\r\n if (userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Login Succesfull\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Username is not Correct\");\r\n } else if (userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\")) {\r\n System.out.println(\"Password is not Correct\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"User name and Password is not correct\");\r\n }\r\n\r\n }", "private void runCmd(String input) {\n CommandDetails cmd = cmdParser.parse(input);\n if (cmd != null) {\n switch (cmd.getAction()) {\n case LIST:\n listAll(cmd.getType());\n break;\n case SEARCH:\n search(cmd);\n break;\n case SEND_HELP:\n sendHelp(cmd);\n break;\n case SEND_USAGE:\n sendUsage(cmd.getType());\n break;\n case EXIT:\n closeStreams();\n break;\n }\n }\n sendMsgToClient(END_TRANSMISSION);\n }", "@Override\r\n public void getInput() { \r\n \r\n String command;\r\n Scanner inFile = new Scanner(System.in);\r\n \r\n do {\r\n \r\n this.display();\r\n \r\n command = inFile.nextLine();\r\n command = command.trim().toUpperCase();\r\n \r\n switch (command) {\r\n case \"B\":\r\n this.helpMenuControl.displayBoardHelp();\r\n break;\r\n case \"C\":\r\n this.helpMenuControl.displayComputerPlayerHelp();\r\n break;\r\n case \"G\":\r\n this.helpMenuControl.displayGameHelp();\r\n break; \r\n case \"Q\": \r\n break;\r\n default: \r\n new Connect4Error().displayError(\"Invalid command. Please enter a valid command.\");\r\n }\r\n } while (!command.equals(\"Q\")); \r\n }", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\n\t\tint num = 0;\n\t\t\n\t\tnum = Integer.parseInt(getUserInput());\n\t\tString pw = null;\n\t\tswitch(num) {\n\t\tcase 1 :\n\n\t\t\t pw = getUserInput();\n\t\t\t\n\t\t\t switch (num) {\n\t\t\t case 1 :\n\t\t\t\t System.out.println(pw);\n\t\t\t }\n\t\t\t\n\t\t\t break;\n\t\tcase 2 :\t\n\t\t\tSystem.out.println(pw);\n\t\t\tbreak;\n\t\t}\n\t}", "public boolean parse(String input) {\n\t\tif (input.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString[] sp = input.split(\" \");\n\t\tthis.command = sp[0];\n\t\tif (sp.length > 1) {\n\t\t\tthis.arguments = Arrays.copyOfRange(sp, 1, sp.length);\n\t\t}\n\t\treturn true;\n\t}", "public static String parse(String command) throws IOException {\n assert tasks.size() >= 0;\n\n if (command.equals(\"bye\")) {\n return executeExit();\n } else if (command.equals(\"list\")) {\n return executeList();\n } else if (command.equals(\"yes\") || command.equals(\"no\")) {\n return executeDuplicateHandling(command);\n } else if (command.startsWith(\"done\")) {\n return executeDone(command);\n } else if (command.startsWith(\"delete\")) {\n return executeDelete(command);\n } else if (command.startsWith(\"find\")) {\n return executeFind(command);\n } else {\n return executeTask(command);\n }\n }", "private static Command<?> getCommand(@NonNull String inputStr) {\n int seperatorIndex = inputStr.indexOf(' ');\n String commandStr = seperatorIndex == -1 ? inputStr : inputStr.substring(0, seperatorIndex);\n String paramStr = seperatorIndex == -1 ? \"\" : inputStr.substring(seperatorIndex + 1).trim();\n\n if (\"Tag\".equalsIgnoreCase(commandStr)) {\n List<String> tagList = Splitter.on(\",\")\n .trimResults()\n .omitEmptyStrings()//可以 选择是否对 空字符串 做处理\n .splitToList(paramStr.replace(',', ','));\n return new TagCommand(tagList.toArray(new String[]{}));\n } else if (\"Name\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify file path\");\n }\n return new NameCommand(paramStr);\n } else if (\"Where\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify search criteria\");\n }\n return new WhereCommand(paramStr);\n } else if (\"Analyze\".equalsIgnoreCase(commandStr)) {\n return new AnalyzeCommand();\n } else if (\"Export\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify export file path\");\n }\n return new ExportCommand(paramStr);\n } else {\n throw new IllegalArgumentException(\"Use either Tag, Where, Name, Export, or Analyze\");\n }\n }", "private static String parseCommandStr(String cmd, String[] args) {\n return cmd + \" \" + String.join(\" \", args);\n }", "private void askUser()\n { \n System.out.println(\"What is your command?\");\n\n String command = scanner.nextLine();\n commandPrompt(command);\n }", "public static String getCommand(String input) {\n String[] strArr = input.split(\" \", 2);\n return strArr[0];\n }", "public String[] getArgs(String cmd) {\n String temp[] = cmd.split(\" \");\n String command = \"\", args = \"\", results[] = new String[3];\n if ((cmd.charAt(0)) == ((Config.handler).charAt(0)))\n results[0] = \"true\";\n else\n results[0] = \"false\";\n for (int i = 0; i < temp.length; i++) {\n if (i == 0)\n command = temp[i];\n else\n args += temp[i] + \" \";\n }\n if (results[0] == \"true\") {\n results[1] = command.substring(1);\n results[2] = args.trim();\n } else {\n results[1] = \"\";\n results[2] = command + \" \" + args;\n }\n return results;\n }", "public static void main(String[] args) throws IOException{\n\t\tScanner sc = new Scanner(System.in);\n\t\tValuesRecords values = new ValuesRecords(args[1]);\n\t\tBTreeStructure btree = new BTreeStructure(args[0]);\n\t\twhile(sc.hasNext()) {\n\t\t\t//get command here!\n\t\t\tString commline = sc.nextLine();\n\t\t\t//split, then check comm[0] if exit; break if true, else commandLine\n\t\t\t\n\t\t\tString[] comm = commline.split(\" \");\n\t\t\t\n\t\t\tif(comm[0].equals(\"exit\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//invalid command rejector\n\t\t\telse if (!comm[0].equals(\"insert\")||!comm[0].equals(\"select\")||!comm[0].equals(\"update\")) {\n\t\t\t\tSystem.out.println(\"ERROR: invalid command\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcommandLine(values, btree, commline);\n\t\t\t}\n\t\t}\n\t\tsc.close();\n\t}", "public interface CommandParser {\n String[] splitStringIntoCommands(String string);\n String[] splitCommandIntoParams(String string);\n String convertArrayToString(String... stringArray);\n}", "private void scanArgs(String [] args)\n{\n int start = 0;\n if (args.length > 0 && args[0].startsWith(\"-P\")) start = 1;\n\n while (args.length >= start + 2) {\n if (args[start].startsWith(\"-d\") && lock_file == null) { // -d <lock data file>\n\t lock_file = new File(args[start+1]);\n\t start += 2;\n }\n else if (args[start].startsWith(\"-i\") && lock_file == null) { // -i <input>\n\t lock_file = new File(args[start+1] + \".out\");\n\t start += 2;\n }\n else if (args[start].startsWith(\"-o\") && output_file == null) { // -o <output>\n\t output_file = new File(args[start+1]);\n }\n else if (args[start].startsWith(\"-t\") && input_file == null) { // -t <trace file>\n\t input_file = new File(args[start+1]);\n }\n else break;\n }\n if (args.length >= start+1) {\n if (args[start].startsWith(\"-r\")) ++start;\n }\n\n // handle socket connection and dylute as in DylockRunner\n\n if (lock_file == null) badArgs();\n if (output_file == null) {\n String fnm = lock_file.getPath();\n int idx = fnm.lastIndexOf(\".\");\n if (idx >= 0) output_file = new File(fnm.substring(0,idx) + \".pats\");\n else output_file = new File(fnm + \".pats\");\n }\n if (input_file == null) {\n String fnm = lock_file.getPath();\n int idx = fnm.lastIndexOf(\".\");\n if (idx >= 0) input_file = new File(fnm.substring(0,idx) + \".csv\");\n else input_file = new File(fnm + \".csv\");\n if (!input_file.exists()) input_file = null;\n }\n}", "public static void main(String[] args) {\n System.out.println(\"Hvad er dit navn\");\n Scanner input = new Scanner(System.in);\n String username = input.nextLine();\n\n // Første tal\n System.out.println(\"Hvad er dit første tal\");\n int a = input.nextInt();\n // Andet tal\n System.out.println(\"Hvad er dit andet tal\");\n int b = input.nextInt();\n\n // Hvordan skkal tallene behandles?\n System.out.println(\"Hvad skal der ske med tallene?\");\n String operator =\n\n // -, +, * eller /\n //System.out.println(\"Hvad skal der ske med tallene?\");\n //float f = input.nextFloat();\n\n input.close();\n\n System.out.println(\"Hej \" +username+ \" dit tal er\" + \" \" +(a+b));\n\n\n // er to Strings ens? password.equals(username)));\n // er to tal ens? (a == b));\n\n }", "public CommandArguments parse(String[] args) {\n ErrorSupport command = new ErrorSupport();\n command.checkLength(args);\n\n //parsing arguments\n CommandArguments arguments = new CommandArguments();\n for (int i = 0; i < args.length; i++) {\n if ((i == args.length - 1) && !args[i].equals(\"--help\")) {\n throw new IllegalArgumentException(\"Incorrect argument, --help for more information about app syntax\");\n }\n switch (args[i]) {\n case (\"--help\"):\n System.out.println(\"\\nHELP MENU \\nAvailable options and arguments: \\n \\t--latitude x \\t-enter latitude coordinate \\n \\t--longitude x\\t-enter longitude coordinate \\n \\t--sensorid x \\t-enter sensor's Id \\n \\t--apikey x \\t\\t-enter API key \\n \\t--history x \\t-enter number of hours to display from history data\\n\");\n System.exit(0);\n case (\"--latitude\"):\n i++;\n arguments.setLatitude(command.checkIsDouble(args[i]));\n break;\n case (\"--longitude\"):\n i++;\n arguments.setLongitude(command.checkIsDouble(args[i]));\n break;\n case (\"--sensorid\"):\n i++;\n arguments.setSensorId(command.checkIsInt(args[i]));\n break;\n case (\"--apikey\"):\n i++;\n arguments.setApiKey(command.checkApiKey(args[i]));\n break;\n case (\"--history\"):\n i++;\n arguments.setHistory(command.checkIsInt(args[i]));\n break;\n default:\n throw new IllegalArgumentException(\"Incorrect option, --help for more information about app syntax\");\n }\n }\n\n //checking environment API_KEY if there was no apikey in command line entered\n if (!arguments.hasApiKey() && System.getenv(\"API_KEY\") == null) {\n throw new IllegalArgumentException(\"No API Key found, check if you have entered the correct key or if there is a suitable environment variable ( API_KEY ), --help for more information about app syntax\");\n } else if (!arguments.hasApiKey()) {\n arguments.setApiKey(command.checkApiKey(System.getenv(\"API_KEY\")));\n }\n return arguments;\n }", "public static void inputs() {\n Core.init(true);\n\n while (running) {\n String input = Terminal.readLine();\n String[] groups = REG_CMD.createGroups(input);\n String[] groupsAdmin = REG_ADMIN.createGroups(input);\n String[] groupsLogin = REG_LOGIN.createGroups(input);\n String arg;\n\n //Set the regex type depending on input\n if (groups[1] == null && groupsAdmin[1] != null && groupsLogin[1] == null)\n arg = groupsAdmin[1];\n else if (groups[1] == null && groupsAdmin[1] == null && groupsLogin[1] != null)\n arg = groupsLogin[1];\n else\n arg = groups[1];\n\n if (arg != null && (REG_CMD.isValid(input) || REG_ADMIN.isValid(input) || REG_LOGIN.isValid(input))) {\n if (Core.getSystem().adminActive()) {\n inputsLogin(arg, groups);\n } else {\n inputsNoLogin(arg, groups, groupsAdmin, groupsLogin);\n }\n }\n else {\n Terminal.printError(\"command does not fit pattern.\");\n }\n }\n }", "public static String inputCommand() {\n String command;\n Scanner in = new Scanner(System.in);\n\n command = in.nextLine();\n\n return command;\n }", "public static Command parse(String command) throws DukeException {\n // remove trailing/leading whitespace and split by whitespace(s)\n command = command.strip();\n String[] commands = command.split(\"[ ]+\");\n String[] args = Arrays.copyOfRange(commands, 1, commands.length);\n\n assert args.length == commands.length - 1 : \"Incorrect array copy\";\n\n switch (commands[0]) {\n case \"todo\":\n return parseTodoCommand(args);\n case \"event\":\n return parseEventCommand(args);\n case \"deadline\":\n return parseDeadlineCommand(args);\n case \"find\":\n return parseFindCommand(args);\n case \"done\":\n return parseDoneCommand(args);\n case \"delete\":\n return parseDeleteCommand(args);\n case \"list\":\n return parseListCommand(args);\n case \"remindme\":\n return parseRemindCommand(args);\n case \"bye\":\n return parseBye(args);\n default:\n throw new DukeMissingDescriptionException(\"Hmm... I'm sorry, but I don't know what that means...\");\n }\n }", "public static void processCommand(String command) {\n\n\t\tString commandType = command.substring(0, command.indexOf(\" \"));\n\n\t\tswitch (commandType) {\n\t\t\n\t\tcase COMMAND_ADD:\n\t\t\tFileStorage.addEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_DELETE:\n\t\t\tFileStorage.deleteEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_EDIT:\n\t\t\tFileStorage.editEvent(command);\n\t\t\tbreak;\n\t\t\n\t\tcase COMMAND_RECUR:\n\t\t\tFileStorage.recurEvent(command);\n\t\t\tbreak;\n\t\t\t\n\t\tcase COMMAND_NAVIGATE:\n\t\t\tFileStorage.navigateDay(command);\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tSystem.out.println(MESSAGE_INVALID);\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}", "public void commandEntered(String cmd)\n {\n String cleaned = StringUtils.cleanWhiteSpace(cmd.trim());\n String args[] = cleaned.split(\" \");\n \tString c = args[0];\n \n Runnable cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n \tif (c.equals(\"name\"))\n cb = new Runnable() { public void run() { cbName(); } };\n else if (c.equals(\"version\")) \n cb = new Runnable() { public void run() { cbVersion(); } };\n else if (c.equals(\"genmove\")) \n cb = new Runnable() { public void run() { cbGenMove(); } };\n else if (c.equals(\"all_legal_moves\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"get_absorb_group\"))\n cb = new Runnable() { public void run() { cbGetAbsorbGroup(); } };\n \n \telse if (c.equals(\"shortest_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \telse if (c.equals(\"shortest_vc_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"compute_dead_cells\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build-incremental\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n \n \n else if (c.equals(\"solver-find-winning\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } }; \n \n else if (c.equals(\"find_sealed\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"strengthen_vcs\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n \n else if (c.equals(\"book-depths\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-sizes\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-scores\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \telse if (c.equals(\"book-priorities\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"db-get\")) \n cb = new Runnable() { public void run() { cbDBGet(); } };\n \n else if (c.equals(\"vc-connected-to\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-between-cells\"))\n cb = new Runnable() { public void run() { cbBetweenCells(); } };\n else if (c.equals(\"vc-get-mustplay\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-intersection\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-union\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"eval_twod\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"eval_resist\")) \n cb = new Runnable() { public void run() { cbEvalResist(); } };\n else if (c.equals(\"eval_resist_delta\")) \n cb = new Runnable() { public void run() { cbEvalResistDelta(); } };\n \telse if (c.equals(\"eval_influence\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"mohex-show-rollout\")) \n cb = new Runnable() { public void run() { cbMohexShowRollout(); } };\n else if (c.equals(\"quit\")) \n cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n sendCommand(cmd, cb);\n }", "public static void main(String[] args) {\n\t final String BLANK=\"\";\n\t\tString name=BLANK;\n\t\tString room=BLANK;\n\t\tString pwd=BLANK;\n\t\tScanner scanner=new Scanner(System.in);\n\t\t\n\t\ttry {\n\t\t\twhile(!name.equals(\"Admin\") && !room.equals(\"X123\") && !pwd.equals(\"$maTrix%Two$\")) {\n\t\t\t\tSystem.out.print(\"Enter name: \");\n\t\t\t\tname=scanner.next();\n\t\t\t\tSystem.out.print(\"Enter room number: \");\n\t\t\t\troom=scanner.next();\n\t\t\t\tSystem.out.print(\"Enter password: \");\n\t\t\t\tpwd=scanner.next();\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.print(\"Programm terminated successfully\");\n\t\t}\n\n\t}", "private String buildSvnWithUsername(final String subCmd) {\n final StringBuilder command = new StringBuilder();\n if (username != null) {\n command.append(\"--username \").append(username).append(' ');\n }\n if (password != null) {\n command.append(\"--password \").append(password).append(' ');\n }\n command.append(subCmd);\n return buildSvnCommand(command.toString());\n }", "private static String getUserSalt(String args[]) {\n return args[2].trim() ;\n }" ]
[ "0.68117076", "0.6441856", "0.62724495", "0.62475234", "0.6192336", "0.6114934", "0.6026296", "0.58955383", "0.5893219", "0.5883881", "0.585425", "0.5836883", "0.57967293", "0.57961273", "0.5788738", "0.5788002", "0.5754625", "0.5733012", "0.57310843", "0.571904", "0.5705054", "0.57037926", "0.5703777", "0.56516594", "0.5618408", "0.5595738", "0.5589803", "0.55628383", "0.5555517", "0.5543407", "0.5523938", "0.55123156", "0.5497651", "0.5477999", "0.54700094", "0.54648215", "0.5460165", "0.5454517", "0.54530644", "0.5443014", "0.54271233", "0.54121524", "0.5394725", "0.536694", "0.5366428", "0.5362346", "0.53607076", "0.5349206", "0.53439796", "0.5341335", "0.5337935", "0.53346443", "0.5333167", "0.53310734", "0.5322322", "0.53186196", "0.5313222", "0.5298267", "0.52965873", "0.5292057", "0.5279586", "0.5278133", "0.52632785", "0.5260456", "0.5246538", "0.5244082", "0.5244072", "0.524124", "0.5231379", "0.5224333", "0.5222534", "0.5222337", "0.52219945", "0.521586", "0.52153635", "0.5206818", "0.5200986", "0.5185791", "0.5178389", "0.51761216", "0.51725876", "0.51710695", "0.51680374", "0.5163071", "0.5161082", "0.516023", "0.5159315", "0.5156596", "0.514695", "0.5143006", "0.51402336", "0.5138298", "0.5133925", "0.51293683", "0.5126859", "0.512138", "0.5106564", "0.5102087", "0.5095344", "0.50928485" ]
0.59176326
7
/ map user input to ftp command
public void buildMap(){ this.map = new HashMap<String, String>(); map.put("user", "user"); map.put("pw", "pass"); map.put("quit", "quit"); map.put("features", "feat"); map.put("cd", "cwd"); map.put("dir", "list"); map.put("get", "retr"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getFTPcommand(){\n String temp = this.map.get(this.userinput_command).toString().toUpperCase() +\n ( (this.userinput_var == null)? \"\" : \" \" + this.userinput_var );\n\n this.userinput_var = null;\n return temp;\n }", "public void processUserInput(String input) {\n\t\tString[] request = this.getArguments(input); \n\t\tString command = request[0]; \n\n\t\ttry {\n\t\t\tswitch (command) {\n\t\t\t\tcase TUICommands.START_SESSION:\n\t\t\t\t\tif (!this.sessionActive) {\n\t\t\t\t\t\tthis.showNamedMessage(\"Initiating session with server...\");\n\t\t\t\t\t\twhile (!this.requestSession()) {\n\t\t\t\t\t\t\ttextUI.getBoolean(\"Try again?\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showNamedMessage(\"Session is already active\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\n\t\t\t\tcase TUICommands.LIST_FILES: \n\t\t\t\t\tthis.showNamedMessage(\"Requesting list of files...\");\n\t\t\t\t\tif (!this.requestListFiles()) { \n\t\t\t\t\t\tthis.showNamedError(\"Retrieving list of files failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.LIST_FILES_LOCAL: \n\t\t\t\t\tthis.showNamedMessage(\"Making list of local files...\");\n\t\t\t\t\tthis.printArrayOfFile(this.getLocalFiles()); \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_SINGLE:\n\t\t\t\t\tFile fileToDownload = this.selectServerFile();\n\t\t\t\t\tif (!this.downloadSingleFile(fileToDownload)) {\n\t\t\t\t\t\tthis.showNamedError(\"Downloading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_SINGLE:\n\t\t\t\t\tFile fileToUpload = this.selectLocalFile();\n\t\t\t\t\tif (!this.uploadSingleFile(fileToUpload)) { \n\t\t\t\t\t\tthis.showNamedError(\"Uploading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.DELETE_SINGLE:\n\t\t\t\t\tFile fileToDelete = this.selectServerFile();\n\t\t\t\t\tif (!this.deleteSingleFile(fileToDelete)) { \n\t\t\t\t\t\tthis.showNamedError(\"Deleting file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.CHECK_INTEGRITY:\n\t\t\t\t\tFile fileToCheck = this.selectLocalFile();\n\t\t\t\t\tif (!this.checkFile(fileToCheck)) { \n\t\t\t\t\t\tthis.showNamedError(\"Checking file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.uploads)) { \n\t\t\t\t\t\tthis.showNamedError(\"Upload manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.downloads)) {\n\t\t\t\t\t\tthis.showNamedError(\"Download manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.HELP:\n\t\t\t\t\tthis.textUI.printHelpMenu();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase TUICommands.EXIT:\n\t\t\t\t\tthis.shutdown();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthis.showNamedError(\"Unknow command received (and ignoring it)\"); \n\t\t\t}\n\t\t\tthis.showNamedMessage(\"... done!\");\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\tthis.showNamedError(\"Something went wrong: \" + e.getLocalizedMessage());\n\t\t}\n\t}", "public static void main(String [] args) throws IOException //added this line\n {\n if (args.length != ARG_CNT) {\n System.out.print(\"Usage: cmd ServerAddress ServerPort\\n\");\n return;\n }\n\n String hostName = args[0];\n String subHostname;\n int portNumber = Integer.parseInt(args[1]);\n int subPortNumber;\n\n try {\n Socket kkSocket = new Socket(hostName, portNumber);\n kkSocket.setSoTimeout(TIMEOUT); //sets Socket Timeout for FFFC in milliseconds\n\n // from client to server\n PrintWriter out1 = new PrintWriter(kkSocket.getOutputStream(), true);\n BufferedWriter out=new BufferedWriter(out1);\n //from server to client\n BufferedReader in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));\n //from user\n BufferedReader stdIn =new BufferedReader(new InputStreamReader(System.in));\n\n String fromUserString;\n fromServer = in.readLine();\n while (fromServer != null) {\n String[] fromUser = new String[2];\n System.out.print(\"csftp> \");\n String command = \"\";\n\n try {\n fromUserString = stdIn.readLine();\n fromUser = fromUserString.split(\" \");\n command = fromUser[0].toLowerCase().trim();\n\n }catch(IOException e){\n printErrorMsg(\"FFFE\", null, null);\n System.exit(1);\n }\n\n switch (command) {\n case \"user\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"USER \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> USER \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"pw\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASS \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> PASS \" + fromUser[1]); //print out what we send\n readMultiLine(in);\n break;\n case \"cd\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"CWD \"+fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> CWD \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"quit\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"QUIT\\n\");\n out.flush();\n System.out.println(\"--> QUIT\");\n System.out.println(in.readLine());\n System.exit(1);\n break;\n case \"features\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"FEAT\\n\");\n out.flush();\n System.out.println(\"--> FEAT\");\n readMultiLine(in);\n break;\n case \"dir\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n String response = in.readLine();\n Pattern pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n Matcher matcher = pattern.matcher(response);\n\n try {\n if (matcher.find()) {\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n BufferedReader inSub = new BufferedReader(\n new InputStreamReader(subSocket.getInputStream()));\n subSocket.setSoTimeout(IO_TIMEOUT);\n out.write(\"LIST\\n\");\n out.flush();\n System.out.println(\"--> LIST\");\n\n String currentLine;\n while (true) {\n if ((currentLine = inSub.readLine()) != null) {\n System.out.println(\"<-- \" + currentLine);\n } else {\n break;\n }\n }\n inSub.close();\n subSocket.close();\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n readMultiLine(in);\n readMultiLine(in);\n break;\n case \"get\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n response = in.readLine();\n\n out.write(\"TYPE I\"+\"\\n\");\n out.flush();\n readMultiLine(in);\n\n pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n matcher = pattern.matcher(response);\n try {\n if (matcher.find()) {\n\n System.out.println(\"<--\" + matcher.group(1));\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n subSocket.setSoTimeout(IO_TIMEOUT); //sets socket timeout for 0x3A2\n FileOutputStream tempFile = new FileOutputStream(fromUser[1]);\n\n out.write(\"RETR \" + fromUser[1] + \"\\n\");\n out.flush();\n System.out.println(\"--> RETR\");\n String reply = in.readLine();\n\n //Data transfer connection fail to open\n if (reply.startsWith(\"425\")) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n break;\n }\n\n //fail to access file\n if (reply.startsWith(\"550\")) {\n printErrorMsg(\"38E\", fromUser[1], \"\");\n break;\n }\n\n //save remote file to local machine\n int line;\n byte[] buf=new byte[4096];\n InputStream inSub = subSocket.getInputStream();\n while ((line = inSub.read(buf)) > 0) {\n tempFile.write(buf,0 ,line);\n }\n\n tempFile.close();\n tempFile.flush();\n inSub.close();\n subSocket.close();\n readMultiLine(in);\n\n } catch(SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n break;\n //if not one of these cases, invalid command error\n default: printErrorMsg(\"001\",\"\",\"\");\n }\n\n }\n } catch (UnknownHostException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (IOException e) {\n printErrorMsg(\"FFFD\", null, null);\n System.exit(1);\n } catch (Exception e) {\n printErrorMsg(\"FFFF\", null, e.getMessage());\n System.exit(1);\n }\n }", "public static void main(String[] args) {\n\t\t//num of args\n\t\tif (args.length != 2) {\n\t\t\tSystem.out.println(\"Error: Invalid number of arguments\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//port number\n\t\tint port = 0;\n\t\ttry {\n\t\t\tport = Integer.parseInt(args[1]);\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Error: Invalid port number\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//hostname\n\t\ttry {\n\t\t\tInetAddress.getByName(args[0]);\n\t\t} catch (Exception f) {\n\t\t\tSystem.out.println(\"Error: hostname does not resolve to an IP address\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//server\n\t\ttry {\n\t\t\tmyftp instance = new myftp(args[0], port);\n\t\t\tinstance.input();\n\t\t} catch(SocketTimeoutException ste) {\n\t\t\tSystem.out.println(\"Error: host could not be reached\");\n\t\t} catch(ConnectException ce) {\n\t\t\tSystem.out.println(\"Error: no running FTP at remote host\");\n\t\t} catch(Exception h) {\n\t\t\tSystem.out.println(\"Error: program quit unexpectedly\");\n\t\t}\n\t}", "private void handleCommand(String input) throws ClientOfflineException, ServerException {\n String[] params = input.split(\" \");\n Command command = this.availableCommandMap.get(params[0]);\n String argument = (params.length <= 1) ? null : params[1];\n command.execute(this, argument);\n }", "public boolean specialCommand(String userinput){\n return (userinput.equals(\"get\")) || (userinput.equals(\"dir\"));\n }", "private void runCmd(String input) {\n CommandDetails cmd = cmdParser.parse(input);\n if (cmd != null) {\n switch (cmd.getAction()) {\n case LIST:\n listAll(cmd.getType());\n break;\n case SEARCH:\n search(cmd);\n break;\n case SEND_HELP:\n sendHelp(cmd);\n break;\n case SEND_USAGE:\n sendUsage(cmd.getType());\n break;\n case EXIT:\n closeStreams();\n break;\n }\n }\n sendMsgToClient(END_TRANSMISSION);\n }", "public static void main(String[] args) throws IOException {\n\t\tString masterIP = args[0];\n\n\t\ttry {\n\t\t\tsock = new DatagramSocket(Machine.FILE_OPERATIONS_PORT);\n\t\t} catch (SocketException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tmyName = InetAddress.getLocalHost().getHostName();\n\t\t} catch (UnknownHostException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tScanner s = new Scanner(System.in);\n\t\tString cmd = null;\n\n\t\tserver = new FileTransferServer();\n\t\tserver.start();\n\n\t\twhile ((cmd = s.nextLine()) != null) {\n\n\t\t\tWriteLog.writelog(myName, cmd);\n\n\t\t\tif (\"exit\".equals(cmd)) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"put \")){\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(localFileName);\n\t\t\t\tputMsg.add(sdfsFileName);\n\t\t\t\tputMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\" + putMsg.elementAt(1)+putMsg.elementAt(2));\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"get \")){\n\t\t\t\tVector<String> getMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\n\t\t\t\tgetMsg.add(\"G\");\n\t\t\t\tgetMsg.add(sdfsFileName);\n\t\t\t\tgetMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\"+getMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(getMsg, masterIP);\n\t\t\t\tVector<String> serverIP = recvListMsg();\n\t\t\t\t//String copyFN = cmd.substring(cmd.lastIndexOf(' ')+1);\n\n\t\t\t\t//Runnable runnable = new FileTransferClient(copyFN, cmd.substring(4, cmd.indexOf(' ', 4)),serverIP.elementAt(0));\n\t\t\t\tRunnable runnable = new FileTransferClient(localFileName, sdfsFileName,serverIP.elementAt(0));\n\n\t\t\t\tThread thread = new Thread(runnable);\n\t\t\t\tthread.start();\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"delete \")){\n\t\t\t\tVector<String> delMsg = new Vector<String>();\n\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tdelMsg.add(\"D\");\n\t\t\t\tdelMsg.add(sdfsFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg: \" + delMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(delMsg, masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"updateMaster \")){\n\t\t\t\tmasterIP = cmd.substring(cmd.lastIndexOf(' ')+1);\n\t\t\t\tSystem.out.println(\"New master - \"+masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"maple \")) {\n\n\t\t\t\tVector<String> mapleMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, dirPath;\n\t\t\t\tFile[] listFiles = null;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tdirPath = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile directory = new File(dirPath);\n\t\t\t\tlistFiles = directory.listFiles();\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tif (tfile.isFile()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\t\tString dirname = directory.getName();\n\t\t\t\t\t\tSystem.out.println(filename);\n\t\t\t\t\t\tputMsg = new Vector<String>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tputMsg.add(\"P\");\n\t\t\t\t\t\tputMsg.add(dirPath+filename);\n\t\t\t\t\t\tputMsg.add(\"mj_\"+filename);\n\t\t\t\t\t\tputMsg.add(myName);\n\t\t\t\t\t\tSystem.out.println(\"client sending \"+putMsg+\" to master\");\n\t\t\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmapleMsg.add(\"maple\");\n\t\t\t\tmapleMsg.add(jarName);\n\t\t\t\tmapleMsg.add(sdfsFilePrefix);\n\n\t\t\t\t/*for(String sdfsFile : sdfsFiles) {\n\t\t\t\t\tmapleMsg.add(sdfsFile);\n\t\t\t\t}*/\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\tmapleMsg.add(\"mj_\"+filename);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"client sending \"+mapleMsg+\" to master\");\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 500);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(mapleMsg, masterIP);\n\n\t\t\t}else if(cmd.startsWith(\"juice \")) {\n\t\t\t\tVector<String> juiceMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, juiceFileName;\n\t\t\t\tInteger numJuices;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tnumJuices = lineScanner.nextInt();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tjuiceFileName = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tjuiceMsg.add(\"juice\");\n\t\t\t\tjuiceMsg.add(jarName);\n\t\t\t\tjuiceMsg.add(numJuices.toString());\n\t\t\t\tjuiceMsg.add(sdfsFilePrefix);\n\t\t\t\tjuiceMsg.add(juiceFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendJuiceMsg: \" + juiceMsg.elementAt(1));\n\n\t\t\t\tsendMsgToMaster(juiceMsg, masterIP);\n\t\t\t}\n\n\t\t}\n\n\t}", "private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void usercommand() throws ClassNotFoundException, IOException{\n\t\tString usercommand;\n\t\tSystem.out.println(\"Enter the user command\");\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner sc = new Scanner(System.in);\n\t\t\tif((usercommand=sc.nextLine())!=null){\n\t\t\t\tif(usercommand.contains(\"get\")){\n\t\t\t\t\tfilename = usercommand.split(\" \");\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\tObject obj =obj_in.readObject();// to get the list of portId and Ip\n\t\t\t\t\tList<String> portList = new ArrayList<String>();\n\t\t\t\t\tportList = (List<String>) obj;\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//return no such files if list is empty\n\t\t\t\t\t\tif (portList.isEmpty()){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t else{\n\t\t\t\t\t\t//if peer list is not empty\n\t\t\t\t\t for (String peerInfo : portList){\n\t\t\t\t\t \tint i = 0;\n\t\t\t\t\t \tgetportInformation = peerInfo.split(\":\");\n\t\t\t\t\t \tclientInfo.put(Integer.parseInt(getportInformation[i]),getportInformation[i+1]);\n\t\t\t\t\t \tSystem.out.println(\"The Port Id and The iP address is \"+peerInfo );\n\t\t\t\t\t \ti = i+2;\n\t\t\t\t\t }\n\t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\t// To check if the file is already in peer\n\t\t\t\t\t\t for (int i = 0; i < portList.size(); i++) {\n\t\t\t\t\t\t\tif(portList.contains(serverPortNumber+\":\"+ip.getHostAddress())){\n\t\t\t\t\t\t\t\tSystem.out.println(\"You already have this file in system\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Enter the following command to download file: download <portNumber>\");\n\t\t\t\t\t\tString command;\n\t\t\t\t\t\t@SuppressWarnings(\"resource\")\n\t\t\t\t\t\tScanner inputPort= new Scanner(System.in);\n\t\t\t\t\t\tcommand= inputPort.nextLine();\n\t\t\t\t\t\tString[] setPortInfo = command.split(\" \");\n\t\t\t\t\t\tint serverPortNum = 0;\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tserverPortNum = Integer.parseInt(setPortInfo[1]);\n\t\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Make sure you enter the command correctly:\");\n\t\t\t\t\t\t\t\tSystem.out.println(\"Get the file name again\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Connecting to the port\"+serverPortNum+\" \"+clientInfo.get(serverPortNum));\t\t\t\t\n\t\t\t\t\t\tSocket client_t = new Socket(clientInfo.get(serverPortNum),serverPortNum);\n\t\t\t\t\t\tPrintWriter out_temp = new PrintWriter(client_socket.getOutputStream(),true);\n\t\t\t\t\t\tout_temp.println(setPortInfo[0]);\n\t\t\t\t\t\tbyte[] bytearray = new byte[65000];\n\t\t\t\t\t\tInputStream temp_is = client_t.getInputStream();\n\t\t\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filename[1]));\n\t\t\t\t\t\tint Byteread = temp_is.read(bytearray,0,bytearray.length);\n\t\t\t\t\t\tbos.write(bytearray, 0, Byteread);\n\t\t\t\t\t\tbos.close();\n\t\t\t\t\t\tclient_t.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t}\n\t\t\t\t\t}//try\n\t\t\t\t\t\tcatch(NullPointerException e){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t}\n\t\t\t\t\tobj_in.close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\telse if(usercommand.contains(\"refresh\")){\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\t\n//\t\t\t\t\tout.println(\"Got the refresh command\");\n//\t\t\t\t\tout.println(\"File list updated\");\t\t\t\t\t\n\t\t\t\t\tusercommand();\n\t\t\t\t}\n\t\t\t\telse if(usercommand.contains(\"disconnect\")){\n\t\t\t\t\tout.print(usercommand);\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t}", "public void run() {\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tString cmd;\r\n\t\tRequest.Type t = null;\r\n\t\tString fileName;\r\n\t\tString filePath;\r\n\t\tboolean badDirectory;\r\n\t\t\r\n\t\tdo\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Do you want to run with the error simulator? (y/n)\");\r\n\t\t\tString decision = in.next();\r\n\t\t\tif (decision.equalsIgnoreCase(\"y\"))\r\n\t\t\t{\r\n\t\t\t\tsendPort = ERRSIM_PORT;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (decision.equalsIgnoreCase(\"n\"))\r\n\t\t\t{\r\n\t\t\t\tsendPort = SERVER_PORT;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter y/Y or n/N.\");\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t\t\r\n\t\t// Get the IP address or host name from user input\r\n\t\tfor (boolean validHost = false; validHost == false; ) {\r\n\t\t\tSystem.out.println(\"Please enter the IP address of the server:\");\r\n\t\t\tString host = in.next();\r\n\t\t\ttry {\r\n\t\t\t\tsendAddr = InetAddress.getByName(host);\r\n\t\t\t} catch(UnknownHostException e) {\r\n\t\t\t\tSystem.out.println(\"Invalid host name or IP address. Please try again.\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tvalidHost = true;\r\n\t\t}\r\n\t\t\r\n\t\t// Sets the directory for the client\r\n\t\tdo {\r\n\t\t\tbadDirectory = false;\r\n\t\t\tSystem.out.println(\"Please enter the directory that you want to use for the client files:\");\r\n\t\t\tdirectory = in.next();\r\n\t\t\tchar lastChar = directory.charAt(directory.length()-1);\r\n\t\t\tif (!TFTP.isDirectory(directory)) {\r\n\t\t\t\tSystem.out.println(\"Directory does not exist.\");\r\n\t\t\t\tbadDirectory = true;\r\n\t\t\t}\r\n\t\t\telse if (lastChar != '/' && lastChar != '\\\\')\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Valid directory must end with either a '/' or a '\\\\'\");\r\n\t\t\t\tbadDirectory = true;\r\n\t\t\t}\r\n\t\t} while (badDirectory);\r\n\t\tif (verbose) System.out.println(\"The directory you entered is: \" + directory + \"\\n\");\r\n\r\n\t\twhile (true) {\r\n\t\t\tboolean validCmd = false;\r\n\t\t\twhile(!validCmd) {\r\n\t\t\t\t// Get get command\r\n\t\t\t\tSystem.out.println(\"Please enter a command (read/write/exit):\");\r\n\t\t\t\tcmd = in.next();\r\n\t\t\t\t// Quit server if exit command given\r\n\t\t\t\tif (cmd.equalsIgnoreCase(\"exit\")) {\r\n\t\t\t\t\tin.close();\r\n\t\t\t\t\tSystem.out.println(\"Shutting down...\");\r\n\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t} else if (cmd.equalsIgnoreCase(\"read\")) {\r\n\t\t\t\t\tvalidCmd = true;\r\n\t\t\t\t\tt = Request.Type.READ;\r\n\t\t\t\t} else if (cmd.equalsIgnoreCase(\"write\")) {\r\n\t\t\t\t\tvalidCmd = true;\r\n\t\t\t\t\tt = Request.Type.WRITE;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalidCmd = false;\r\n\t\t\t\t\tSystem.out.println(\"Invalid command. Valid commands are read, write, and exit.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Get file name\r\n\t\t\tdo {\r\n\t\t\t\tSystem.out.println(\"Please enter the name of the file to transfer:\");\r\n\t\t\t\tfileName = in.next();\r\n\t\t\t\tif (!TFTP.isPathless(fileName))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"File names must not contain a path. The directory that you designated for transfer is: \" + directory);\r\n\t\t\t\t}\r\n\t\t\t} while (!TFTP.isPathless(fileName));\r\n\t\t\tfilePath = directory + fileName;\r\n\t\t\t\r\n\t\t\t// Check if the file exists and file readable on client if WRITE request, otherwise continue loop\r\n\t\t\tif (t == Request.Type.WRITE) {\r\n\t\t\t\tif (TFTP.fileExists(filePath) && !TFTP.isDirectory(filePath)) {\r\n\t\t\t\t\tif (!TFTP.isReadable(filePath)) {\r\n\t\t\t\t\t\t// Echo error message for access violation\r\n\t\t\t\t\t\tSystem.out.println(\"File access violation.\\n\");\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Echo successful file found\r\n\t\t\t\t\t\tSystem.out.println(\"File found.\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Echo error message for file not found\r\n\t\t\t\t\tSystem.out.println(\"File not found.\\n\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t// For read requests, check if file already exists on the client\r\n\t\t\t} else if (t == Request.Type.READ) {\r\n\t\t\t\tif (TFTP.fileExists(filePath) && !TFTP.isDirectory(filePath)) {\r\n\t\t\t\t\t// Echo error message\r\n\t\t\t\t\tSystem.out.println(\"File already exists.\\n\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Newline\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Make sure packet buffer is clear before processing transfer\r\n\t\t\tif (verbose) System.out.println(\"Clearing socket receive buffer...\");\r\n\t\t\tDatagramPacket throwAwayPacket = TFTP.formPacket();\r\n\t\t\t// Receive packets until a timeout occurs\r\n\t\t\tdo {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsendReceiveSocket.receive(throwAwayPacket);\r\n\t\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} while (true);\r\n\t\t\tif (verbose) System.out.println(\"Socket cleared.\\n\");\r\n\r\n\t\t\t// Send the request\r\n\t\t\ttry {\r\n\t\t\t\tswitch (t) {\r\n\t\t\t\t\tcase READ:\r\n\t\t\t\t\t\tSystem.out.println(\"Reading \" + filePath + \" from server...\");\r\n\t\t\t\t\t\tthis.read(sendAddr, filePath, \"netascii\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase WRITE:\r\n\t\t\t\t\t\tSystem.out.println(\"Writing \" + filePath + \" to server...\");\r\n\t\t\t\t\t\tthis.write(sendAddr, filePath, \"netascii\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid request type. Quitting...\");\r\n\t\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t}\r\n\t\t\t} catch(Exception e) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String args[])\n {\n if (args.length != 2) {\n System.err.println(\"Usage: java myftp <host name> <port number>\");\n System.exit(1);\n }\n\n myftp mfp = new myftp();\n mfp.createSocket(args[0], Integer.parseInt(args[1]));\n }", "public interface IFTPOperationListener {\n\n /**\n * Called when ftp login is done.\n */\n void loginDone();\n\n /**\n * Called when info are being fetched for a remote file\n *\n * @param remotePath The remote file or folder path\n */\n void fetchingInfo(String remotePath);\n\n /**\n * Called when a file listing is being done\n *\n * @param remoteFolder The remote folder path\n */\n void listingFiles(String remoteFolder);\n\n /**\n * Called before a file is being uploaded.\n *\n * @param path The path of the file\n */\n void uploadingFile(String path);\n\n /**\n * Called when a file is uploaded\n *\n * @param path The remote file path\n */\n void fileUploaded(String path);\n\n /**\n * Called when a folder is being uploaded\n *\n * @param remoteFolder Called when the folder is being uploaded\n */\n void uploadingFolder(String remoteFolder);\n\n /**\n * Called when a folder is uploaded\n *\n * @param remoteFolder The remote folder path\n */\n void folderUploaded(String remoteFolder);\n\n /**\n * Called when a file is being downloaded\n *\n * @param path The path of the file\n */\n void downloadingFile(String path);\n\n /**\n * Called when a remote file is downloaded\n *\n * @param path The remote file path\n */\n void fileDownloaded(String path);\n\n /**\n * Called when a folder is being downloaded\n *\n * @param remoteFolder The remote folder being downloaded\n */\n void downloadingFolder(String remoteFolder);\n\n /**\n * Called when a remote folder is downloaded\n *\n * @param remoteFolder The remote folder path\n */\n void folderDownloaded(String remoteFolder);\n\n /**\n * Called when a remote folder is created\n *\n * @param remoteFolder The remote folder path\n */\n void folderCreated(String remoteFolder);\n\n /**\n * Called when a remote folder is deleted\n *\n * @param remoteFolder The remote folder path\n */\n void folderDeleted(String remoteFolder);\n\n /**\n * Called when a remote file is delete\n *\n * @param path The remote file path\n */\n void fileDeleted(String path);\n\n /**\n * Called when ftp logout is done.\n */\n void logoutDone();\n\n\n}", "private void inputHandler(String input) throws Exception{\n\n switch (input) {\n\n case \"/quit\":\n done = true;\n break;\n\n default:\n PduMess mess = new PduMess(input);\n outStream.writeToServer(mess.getByteArray());\n break;\n }\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tFTPClient client = new FTPClient();\n\t\tint firstMenu=0;\n\t\tint secondMenu=0;\n\t\tString connetNetAdress = null ;\n\t\tint portNumber =0 ;\n\t\tString downFile = null ;\n\t\tString downFileLocal = null ;\n\t\tString ID =null;\n\t\tString passWord=null;\n\t\tString upFile =null ;\n\t\tString[] FilelList = null ;\n\t\tString[] FilelList2 = null ;\n\t\tint FileList3 = 0 ;\n\t\tlong FileList4= 0;\n\t\tint fileHowMany =0 ;\n\t\t//client.listNames();\n\t\tSystem.out.println(\"===FTP Client Program===\");\n\t\twhile(true) {\n\t\t\tSystem.out.println(\"1. Connect FTP server\");\n\t\t\tSystem.out.println(\"2. Exit Program\");\n\t\t\tSystem.out.print(\">>> \");\n\t\t\ttry {\n\t\t\t\tfirstMenu = Integer.parseInt(sc.nextLine());\n\t\t\t}catch (Exception e){\n\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\n\t\t\tswitch (firstMenu) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println(\"Input url\");\n\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\tconnetNetAdress = sc.nextLine();\n\t\t\t\tSystem.out.println(\"Input Port\");\n\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\tportNumber = Integer.parseInt(sc.nextLine());\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"Try to connet :\" + connetNetAdress +\"(port : \"+portNumber+\")\");\n\t\t\t\t\tclient.connect(connetNetAdress, portNumber);\t\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Fail --- Exit Program\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"FTP Server is conneted!\");\n\n\t\t\t\tSystem.out.print(\"Input ID : \");\n\t\t\t\t//ID = sc.nextLine();\n\t\t\t\tSystem.out.println(\"Input Password : \");\n\t\t\t\t//passWord = sc.nextLine();\n\n\t\t\t\tfor(int i= 1;i<10;i++) {\n\t\t\t\t\tint a=i;\n\t\t\t\t\tfor(int j=1;j<10;j++) {\n\t\t\t\t\t\tint b=j;\n\t\t\t\t\t\tfor(int k=1;k<10;k++){\n\t\t\t\t\t\t\tint c=k;\n\t\t\t\t\t\t\tfor(int l= 1;l<10;l++){\t\n\t\t\t\t\t\t\t\tint d=l;\n\t\t\t\t\t\t\t\tString ab = \"\"+a+b+c+d;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\"+a+b+c+d);\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tclient.login(\"java\", ab);\n\t\t\t\t\t\t\t\t\twhile(true) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"login success!\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"1. Upload File\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"2. Download File\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"3. Disconnect FTP Server\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tsecondMenu = Integer.parseInt(sc.nextLine());\n\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif(secondMenu==0) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tswitch (secondMenu) {\n\t\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Current Directory : /\");\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tFTPFile[] list = client.list(\"*.*\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor(int p=0; p <list.length ;p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList[i] = list[i].getName();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList2[i] = list[i].getLink();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList3 = list[i].getType();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList4 = list[i].getSize();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tSystem.out.println(FilelList[i]+\" \"+FilelList2[i]+\" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t+FileList3+\" \"+FileList4+\" \");\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(list[p]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일목록을 불어올수가 없습니다. \");\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input file's full name you want to upload\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tupFile = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tclient.upload(new File(upFile));;\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e){\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일업로드 완성\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Current Directory : /\");\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tFTPFile[] list = client.list(\"*.*\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor(int p=0; p <list.length ;p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList[i] = list[i].getName();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList2[i] = list[i].getLink();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList3 = list[i].getType();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList4 = list[i].getSize();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tSystem.out.println(FilelList[i]+\" \"+FilelList2[i]+\" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t+FileList3+\" \"+FileList4+\" \");\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(list[p]);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일목록을 불어올수가 없습니다. \");\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input file's full name you want to download\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tdownFile = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input path + New Name\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tdownFileLocal = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t\t\t\t\tclient.download(downFile, new File(downFileLocal));\n\t\t\t\t\t\t\t\t\t\t\t}catch(Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일 다운로드에 실패했습니다.\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일다운로드 완료\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"연결을 끊습니다.\");\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\tclient.disconnect (true);\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"연결 끊기에 실패하였습니다.\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//main(args);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (FTPIllegalReplyException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (FTPException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println(\"Exit Program\");\n\t\t\t\tSystem.exit(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Wrong Code\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private static void command() {\n Scanner reader = new Scanner(System.in);\n System.out.print(\"Write action (buy, fill, take):\\n> \");\n String input = reader.next();\n\n switch (input) {\n case \"buy\" :\n buy();\n break;\n case \"fill\" :\n fill();\n break;\n case \"take\" :\n take();\n break;\n default:\n System.out.println(\"not accepted command\");\n }\n }", "public void doCommand(String input) {\r\n\r\n if (input == null || input.isEmpty()) {\r\n return;\r\n }\r\n\r\n Command command = parseCommand(input);\r\n\r\n if (!activated && !isPlaceCommand(command)) {\r\n return;\r\n }\r\n command.execute(this);\r\n }", "private void executeCommand(String c) {\n // split command and arguments\n int index = c.indexOf(' ');\n String command = ((index == -1) ? c.toUpperCase() : (c.substring(0, index)).toUpperCase());\n String args = ((index == -1) ? null : c.substring(index + 1));\n\n debugOutput(\"Command: \" + command + \" Args: \" + args);\n\n // dispatcher mechanism for different commands\n switch (command) {\n case \"USER\":\n handleUser(args);\n break;\n\n case \"PASS\":\n handlePass(args);\n break;\n\n case \"CWD\":\n handleCwd(args);\n break;\n\n case \"LIST\":\n handleNlst(args);\n break;\n\n case \"NLST\":\n handleNlst(args);\n break;\n\n case \"PWD\":\n case \"XPWD\":\n handlePwd();\n break;\n\n case \"QUIT\":\n handleQuit();\n break;\n\n case \"PASV\":\n handlePasv();\n break;\n\n case \"EPSV\":\n handleEpsv();\n break;\n\n case \"SYST\":\n handleSyst();\n break;\n\n case \"FEAT\":\n handleFeat();\n break;\n\n case \"PORT\":\n handlePort(args);\n break;\n\n case \"EPRT\":\n handleEPort(args);\n break;\n\n case \"RETR\":\n handleRetr(args);\n break;\n\n case \"MKD\":\n case \"XMKD\":\n handleMkd(args);\n break;\n\n case \"RMD\":\n case \"XRMD\":\n handleRmd(args);\n break;\n\n case \"TYPE\":\n handleType(args);\n break;\n\n case \"STOR\":\n handleStor(args);\n break;\n\n default:\n sendMsgToClient(\"501 Unknown command\");\n break;\n\n }\n\n }", "public void inputCommand(String line) {\n if (!validCommand(line)) {\n return;\n } else if (line.startsWith(\"PUT\")) {\n if (model.isGameOver()) {\n System.out.println(GAME_OVER_NO_PUTS_ERROR_MESSAGE);\n return;\n }\n String[] tokens = line.split(\" \");\n int column = Integer.parseInt(tokens[1]);\n System.out.println(model.putToken(column));\n } else if (line.equals(\"GET\")) {\n view.printMoves(model.getMoves());\n } else if (line.equals(\"BOARD\")) {\n view.printBoard(model.getBoard());\n }\n }", "public void findFile(Packet packet) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tchar reqFile;\r\n\t\t// If packet has circled network\r\n\t\tif(peerNode.peerClientID == packet.packetSenderID) {\r\n\t\t\t// If peer has file in its own DHT\r\n\t\t\tif(peerNode.distributedHashTable.containsKey(packet.fileName)) {\r\n\t\t\t\tjava.util.Date hasFileDate = new java.util.Date();\r\n\t\t\t\tSystem.out.print(hasFileDate + \": File is in my Distributed Hash Table at \" );\r\n\t\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\t\r\n\t\t\t\t\tSystem.out.println(peerNode.distributedHashTable.get(packet.fileName).get(i) + \" \");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tArrayList<InetSocketAddress> fileLocations = new ArrayList<InetSocketAddress>();\r\n\t\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\r\n\t\t\t\t\tfileLocations.add(peerNode.distributedHashTable.get(packet.fileName).get(i));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Propmpt user if they want to transfer file\r\n\t\t\t\tjava.util.Date inDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(inDate + \": Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t\t// input validation\r\n\t\t\t\twhile(reqFile == 0 && (reqFile != 'y' || reqFile != 'n')) {\r\n\t\t\t\t\tjava.util.Date errDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(errDate + \": You did not enter a valid command. Try Again. Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t\t}\r\n\t\t\t\t// if yes to transfer\r\n\t\t\t\tif(reqFile == 'y') {\r\n\t\t\t\t\tif(fileLocations.size() == 1) {\r\n\t\t\t\t\t\tif(fileLocations.get(0).getPort() == peerNode.peerClientListenPort) {\r\n\t\t\t\t\t\t\tjava.util.Date haveFile = new java.util.Date();\r\n\t\t\t\t\t\t\tSystem.out.println(haveFile + \": I already have this file\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + fileLocations.get(0).getAddress() + \":\" + fileLocations.get(0).getPort());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(fileLocations.get(0).getAddress(), fileLocations.get(0).getPort());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tint index = (int) (Math.random() * (fileLocations.size()+1));\r\n\t\t\t\t\t\twhile( fileLocations.get(index).getPort() == peerNode.peerClientListenPort) {\r\n\t\t\t\t\t\t\tindex = (int) (Math.random() * (fileLocations.size()+1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + packet.fileLocations.get(index).getAddress() + \":\" + packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(packet.fileLocations.get(index).getAddress(), packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(reqFile == 'n') {\r\n\t\t\t\t\tjava.util.Date noReqDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(noReqDate + \": File transfer is not requested\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tjava.util.Date notFndDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(notFndDate + \": File was not found in the network. Please try again later\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Check if peer DHT has file and if so, send response\r\n\t\telse if(peerNode.peerClientID != packet.packetSenderID && peerNode.distributedHashTable.containsKey(packet.fileName)) {\r\n\t\t\tjava.util.Date fileFoundDate = new java.util.Date();\r\n\t\t\tSystem.out.println(fileFoundDate + \": I have the file in my Distributed Hash Table\");\r\n\t\t\tPacket fileLocationPacket = new Packet();\r\n\t\t\tfileLocationPacket.eventCode = 4;\r\n\t\t\tfileLocationPacket.fileName = packet.fileName;\r\n\t\t\tfileLocationPacket.packetSenderID = peerNode.peerClientID;\r\n\t\t\tfileLocationPacket.packetRecipientID = packet.packetSenderID;\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\r\n\t\t\t\tfileLocationPacket.fileLocations.add(peerNode.distributedHashTable.get(packet.fileName).get(i));\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tjava.util.Date fileLocSentDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(fileLocSentDate + \": Sending file location to Peer Node \" + packet.packetSenderID);\r\n\t\t\t\tpeerNode.peer2Peer = new Socket(packet.peerClientIP, packet.peerClientListenPort);\r\n\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(fileLocationPacket);\r\n\t\t\t\t\r\n\t\t\t\t// Close socket/connection\r\n\t\t\t\tcloseConnection();\r\n\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Forward packet to Successor Peer Nodes until Peer with file in their Distributed Hash Table is found\r\n\t\telse {\r\n\t\t\tPacket p = packet;\r\n\t\t\ttry {\r\n\t\t\t\tpeerNode.peer2Peer = new Socket(peerNode.succPeerIP, peerNode.succPeerPort);\r\n\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(p);\r\n\t\t\t\t\r\n\t\t\t\t// Close socket/connection\r\n\t\t\t\tcloseConnection();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcloseConnection();\r\n\t}", "public void processFileLocation(Packet packet) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tchar reqFile;\r\n\t\tjava.util.Date recFileLocDate = new java.util.Date();\r\n\t\tSystem.out.println(recFileLocDate + \": Received the file locations from Peer Node \" + packet.packetSenderID);\r\n\t\t\r\n\t\tif(packet.fileLocations.size() == 0) {\r\n\t\t\tjava.util.Date fileNotFoundDate = new java.util.Date();\r\n\t\t\tSystem.out.println(fileNotFoundDate + \": File location was not found in any other Peer Node's Distributed Hash Table. Try again later when new Peer Nodes connect to the network\");\r\n\t\t}\r\n\t\t\r\n\t\t// Print File Locations\r\n\t\telse {\r\n\t\t\tfor(int i = 0; i < packet.fileLocations.size(); i++) {\r\n\t\t\t\tjava.util.Date fileLocDate = new java.util.Date();\r\n\t\t\t\tInetAddress fileIP = packet.fileLocations.get(i).getAddress();\r\n\t\t\t\tint filePort = packet.fileLocations.get(i).getPort();\r\n\t\t\t\tSystem.out.println(fileLocDate + \": The file is located at \" + fileIP + \" : \" + filePort);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// input to request file transfer\r\n\t\t\tjava.util.Date inDate = new java.util.Date();\r\n\t\t\tSystem.out.println(inDate + \": Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t// input validation\r\n\t\t\twhile(reqFile == 0 && (reqFile != 'y' || reqFile != 'n')) {\r\n\t\t\t\tjava.util.Date errDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(errDate + \": You did not enter a valid command. Try Again. Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// user wants to request file transfer\r\n\t\t\tif(reqFile == 'y') {\r\n\t\t\t\tif(packet.fileLocations.size() == 1) {\r\n\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + packet.fileLocations.get(0).getAddress() + \":\" + packet.fileLocations.get(0).getPort());\r\n\t\t\t\t\t\r\n\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(packet.fileLocations.get(0).getAddress(), packet.fileLocations.get(0).getPort());\r\n\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t} \r\n\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(packet.fileLocations.size() > 1) {\r\n\t\t\t\t\tint index = (int) (Math.random() * (packet.fileLocations.size()+1));\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile(packet.fileLocations.get(index).getPort() == peerNode.peerClientListenPort) {\r\n\t\t\t\t\t\tindex = (int) (Math.random() * (packet.fileLocations.size()+1));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + packet.fileLocations.get(index).getAddress() + \":\" + packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\r\n\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(packet.fileLocations.get(index).getAddress(), packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t} \r\n\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(reqFile == 'n') {\r\n\t\t\t\tjava.util.Date noReqDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(noReqDate + \": File transfer is not requested\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws UnableToParseException, IOException, IllegalArgumentException {\n BufferedReader userInputBR = new BufferedReader(new InputStreamReader(System.in));\n String userInput = userInputBR.readLine();\n String[] arguments = userInput.split(\"\\\\s+\");\n \n boolean hostExists = false;\n String hostName = \"\";\n int portNumber = 10987; // default port number\n String filename = \"boards/default.fb\";\n \n assert (arguments[0].equals(\"Flingball\"));\n \n if (arguments.length == 4) {\n hostExists = true;\n hostName = arguments[1];\n portNumber = Integer.parseInt(arguments[2]);\n filename = arguments[3];\n } \n \n else if (arguments.length == 3) {\n // host + port OR host + file\n if (arguments[1].matches(HOST)) {\n hostExists = true;\n hostName = arguments[1];\n if (arguments[2].matches(PORT)) {\n portNumber = Integer.parseInt(arguments[2]);\n } else {\n filename = arguments[2];\n }\n } else {\n // port + file\n portNumber = Integer.parseInt(arguments[1]);\n filename = arguments[2];\n }\n }\n \n else if (arguments.length == 2) {\n if(arguments[1].matches(PORT)) {\n portNumber = Integer.parseInt(arguments[1]);\n } else if (arguments[1].matches(HOST)) {\n hostExists = true;\n hostName = arguments[1];\n \n } else {\n filename = arguments[1];\n }\n } \n \n else if (arguments.length == 1) {\n // do nothing\n }\n \n else {\n throw new IllegalArgumentException(\"that is not a valid command.\");\n } \n \n Board board = BoardParser.parse(new File(filename));\n \n /*\n * WIRE PROTOCOL EXPLANATION:\n * The structure of our client-server interaction is one that mimics echoClient and echoSocket (example can be found from Oracle). The client sends a message\n * to the the server, and the server broadcasts it out to all the other active boards on a particular host. From there each board will parse that message\n * and only act if it is applicable to them. The first argument of each message is the indicator for what type of action is happening. \n * \n * - Sending message to Server to be broadcasted:\n * . \"passBall From To xPos yPos xVel yVel\"\n * o this message is for passing a ball from one board to another if the boards are conjoined. The first argument is the action type, the second is the board\n * that is sending that particular message, the third is the board that the \"From\" board is sending the ball to, and the 4, 5, 6, 7th arguments are the \n * necessary arguments to create a Ball to the \"To\" board with such that the position and velocity are preserved in the passing. \n * . \"portalBall From To portalName xVel yVel\"\n * o this message is for transporting a ball from one portal to its connected active board portal. The first argument is the action type, the second is the board\n * that is sending that particular message, the third is the board that the \"From\" board is sending the ball to, the 4th argument is the portalName (we have a \n * map of portals with their names as keys, and their position on the board as values) so that we can create a ball at the correct positioning of the \"To\" board, \n * and the 5, 6th arguments are the velocity preserved for the creation of the ball to the \"To\" board to emulate the transportation of a portal.\n * \n * - Receiving broadcasted message from Server after an occurrence has occurred:\n * . \"joined boardName\"\n * o the first time a board connects to a host, all other active boards on that host will receive this message and keep track of all the active boards\n * . \"disconnected boardName\"\n * o when a player closes out of his/her board, all other active boards on that board's same host will receive this message and remove it from it's \n * active boards. Additionally, any boards that were conjoined to the disconnected board will no longer be connected and its walls will revert to solid\n * . \"h Board1 Board2\"\n * o joining Board1 to Board2 horizontally such that Board1's east wall and Board2's west wall become permeable\n * . \"v Board1 Board2\"\n * o join in Board1 to Board2 vertically such that Board1's south wall and Board2's north wall becomes permeable\n * . \"passBall From To xPos yPos xVel yVel\"\n * o see explanation above\n * . \"portalBall From To portnalName xVel yVel\"\n * o see explanation above\n */\n \n \n if (hostExists) {\n try {\n @SuppressWarnings(\"resource\")\n Socket echoSocket = new Socket(hostName, portNumber);\n PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true);\n BufferedReader in = new BufferedReader(new InputStreamReader(echoSocket.getInputStream()));\n out.println(\"joined \" + board.getBoardName());\n \n \n Thread sendingMessage = new Thread(new Runnable() {\n public void run() {\n board.attachListener(new StateChangeListener() {\n public void notifyStateChange(String str) {\n // str = from, to, action, position/portal, velocity\n out.println(str); \n }\n \n });\n }\n }); sendingMessage.start();\n \n \n \n Thread receivingMessage = new Thread(new Runnable() {\n public void run() {\n String receivingInput;\n try {\n while ((receivingInput = in.readLine()) != null) {\n String[] args = receivingInput.split(\"\\\\s+\");\n\n\n // add active board\n if (args[0].equals(\"joined\")) {\n board.addActiveBoard(args[1]);\n } \n \n // remove disconnected board\n else if (args[0].equals(\"disconnected\")) {\n for (int i = 0; i < board.getBoardJoins().length; i++) {\n if (board.getBoardJoins()[i].equals(args[1])) {\n board.removeConcatBoard(i);\n }\n }\n board.removeActiveBoard(args[1]);\n }\n \n // horizontal concatenation of boards\n else if (args[0].equals(\"h\")) {\n // leftBoard --> set East wall index to args[2] = rightBoard\n if (args[1].equals(board.getBoardName())) {\n board.concatBoard(args[2], \"E\");\n }\n \n // rightBoard --> set West wall index to args[1] = leftBoard\n else if (args[2].equals(board.getBoardName())) {\n board.concatBoard(args[1], \"W\");\n }\n \n // check if joinedBoards of my Board are being joined\n else {\n String[] joinedBoards = board.getBoardJoins();\n for (int i=0; i < joinedBoards.length; i++) {\n if (joinedBoards[i].equals(args[1]) && board.getBoardJoins()[3].equals(joinedBoards[i])) {\n board.removeConcatBoard(i);\n } else if (joinedBoards[i].equals(args[2]) && board.getBoardJoins()[1].equals(joinedBoards[i])) {\n board.removeConcatBoard(i);\n }\n }\n }\n }\n \n // vertical concatenation of boards\n else if (args[0].equals(\"v\")) {\n // topBoard --> set South wall index to args[2] = bottomBoard\n if (args[1].equals(board.getBoardName())) {\n board.concatBoard(args[2], \"S\");\n }\n \n // bottomBoard --> set North wall index to args[1] = topBoard\n else if (args[2].equals(board.getBoardName())) {\n board.concatBoard(args[1], \"N\");\n }\n \n // check if joinedBoards of my Board are being joined\n else {\n String[] joinedBoards = board.getBoardJoins();\n for (int i=0; i < joinedBoards.length; i++) {\n if (joinedBoards[i].equals(args[1]) && board.getBoardJoins()[0].equals(joinedBoards[i])) {\n board.removeConcatBoard(i);\n } else if (joinedBoards[i].equals(args[2]) && board.getBoardJoins()[2].equals(joinedBoards[i])) {\n board.removeConcatBoard(i);\n }\n }\n }\n }\n \n \n \n // passBall: passball, From, To, xpos, ypos, xvel, yvel\n else if (args[0].equals(\"passBall\")) {\n // check if this board is the TO board\n if (board.getBoardName().equals(args[2])) {\n String[] joinedBoards = board.getBoardJoins();\n \n // check if partnered wall is truly a current joined wall\n if (joinedBoards[0].equals(args[1]) || joinedBoards[1].equals(args[1]) || joinedBoards[2].equals(args[1]) || joinedBoards[3].equals(args[1])) {\n int passWall = 0; // [N, E, S, W] -> [0, 1, 2, 3]\n for (int i=0; i < joinedBoards.length; i++) {\n if (joinedBoards[i].equals(args[1])) {\n passWall = i;\n }\n }\n\n \n if (passWall == 0) { // coming from the north\n Ball passBall = new Ball(\"passBall\", Double.parseDouble(args[3]), 0, Double.parseDouble(args[5]), Double.parseDouble(args[6]));\n board.addBall(passBall);\n } else if (passWall == 1) { // coming from the east\n Ball passBall = new Ball(\"passBall\", 20*L, Double.parseDouble(args[4]), Double.parseDouble(args[5]), Double.parseDouble(args[6]));\n board.addBall(passBall);\n } else if (passWall == 2) { // coming from the south\n Ball passBall = new Ball(\"passBall\", Double.parseDouble(args[3]), 20*L, Double.parseDouble(args[5]), Double.parseDouble(args[6]));\n board.addBall(passBall);\n } else if (passWall == 3) { // coming from the west\n Ball passBall = new Ball(\"passBall\", 0, Double.parseDouble(args[4]), Double.parseDouble(args[5]), Double.parseDouble(args[6]));\n board.addBall(passBall);\n }\n }\n \n }\n }\n \n \n // portalBall: portalball, From, To, portalName, xvel, yvel\n else if (args[0].equals(\"portalBall\")) {\n // check if this board is the TO board\n if (board.getBoardName().equals(args[2])) {\n \n if (board.getPortalMap().containsKey(args[3])) {\n Vect neededLoc = board.getPortalMap().get(args[3]);\n double x_loc = neededLoc.x();\n double y_loc = neededLoc.y();\n \n Ball portalBall = new Ball(\"portalBall\", x_loc, y_loc, Double.valueOf(args[4]), Double.valueOf(args[5]));\n board.addBall(portalBall);\n }\n \n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }); receivingMessage.start();\n\n } catch (UnknownHostException e) {\n System.err.println(\"Don't know about host \" + hostName);\n } catch (IOException e) {\n System.err.println(\"Couldn't get I/O for the connection to \" + hostName);\n System.exit(1);\n\n } \n } \n \n Simulator sim = new Simulator(board, fps);\n sim.run();\n }", "@Override\r\n public void getInput() { \r\n \r\n String command;\r\n Scanner inFile = new Scanner(System.in);\r\n \r\n do {\r\n \r\n this.display();\r\n \r\n command = inFile.nextLine();\r\n command = command.trim().toUpperCase();\r\n \r\n switch (command) {\r\n case \"B\":\r\n this.helpMenuControl.displayBoardHelp();\r\n break;\r\n case \"C\":\r\n this.helpMenuControl.displayComputerPlayerHelp();\r\n break;\r\n case \"G\":\r\n this.helpMenuControl.displayGameHelp();\r\n break; \r\n case \"Q\": \r\n break;\r\n default: \r\n new Connect4Error().displayError(\"Invalid command. Please enter a valid command.\");\r\n }\r\n } while (!command.equals(\"Q\")); \r\n }", "public static void processCommand(String command) {\n\n\t\tString commandType = command.substring(0, command.indexOf(\" \"));\n\n\t\tswitch (commandType) {\n\t\t\n\t\tcase COMMAND_ADD:\n\t\t\tFileStorage.addEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_DELETE:\n\t\t\tFileStorage.deleteEvent(command);\n\t\t\tbreak;\n\n\t\tcase COMMAND_EDIT:\n\t\t\tFileStorage.editEvent(command);\n\t\t\tbreak;\n\t\t\n\t\tcase COMMAND_RECUR:\n\t\t\tFileStorage.recurEvent(command);\n\t\t\tbreak;\n\t\t\t\n\t\tcase COMMAND_NAVIGATE:\n\t\t\tFileStorage.navigateDay(command);\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tSystem.out.println(MESSAGE_INVALID);\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}", "public void testFtpFileTransferNamesAndCommands() throws Exception {\n System.out.println(\"FtpFileTransferNamesAndCommands\");\n // abstract now \n /*\n assertNotNull(new FtpFileTransferNamesAndCommands(ftp));\n assertNotNull(new FtpFileTransferNamesAndCommands(new FtpFileTransferNamesAndCommands(ftp), new FtpFileConfiguration(ftp)));\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null, null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null, new FtpFileConfiguration(ftp)));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(new FtpFileTransferNamesAndCommands(ftp), null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n */\n }", "private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }", "public void run()\n\t {\n\t stdin = new Scanner(System.in);\n\t boolean done = false;\n\t while ( !done )\n\t {\n\t String command = stdin.next();\n\t char ccommand=command.charAt(0);\n\t switch (ccommand) \n\t { \n\t case 'I': add('I');\n\t\t\t break; \n\t case 'O': add('O');\n\t break;\n\t case 'N': add('N');\n\t break;\n\t case 'R': remove();\n\t break;\n\t case 'P': print();\n\t break;\n\t case 'Q': \n\t System.out.println(\"Program terminated\");\n\t done = true;\n\t break;\n\t default: //deal with bad command here \n\t System.out.println(\"Command\"+\"'\"+command+\"'\"+\"not supported!\");\t\t\n\t } \n\t }\n\t }", "public interface CommandInterface {\n\n\tpublic static class Commands\n\t{\n\t\tpublic static final String ABORT = \"ABOR\";\n\t\tpublic static final String ACCOUNT_INFO = \"ACCT\";\n\t\tpublic static final String AUTHENTICATION_DATA = \"ADAT\";\n\t\tpublic static final String ALLOCATE_DISK_SPACE = \"ALLO\";\n\t\tpublic static final String APPEND = \"APPE\";\n\t\tpublic static final String AUTHENTICATION_MECHANISM = \"AUTH\";\n\t\tpublic static final String GET_AVAILABLE_SPACE = \"AVBL\";\n\t\tpublic static final String CLEAR_COMMAND_CHANNEL = \"CCC\";\n\t\tpublic static final String CHANGE_TO_PARENT_DIRECTORY = \"CDUP\";\n\t\tpublic static final String CONFIDENTIALITY_PROTECTION_COMMAND = \"CONF\";\n\t\tpublic static final String SERVER_IDENTIFICATION = \"CSID\";\n\t\tpublic static final String CHANGE_WORKING_DIRECTORY = \"CWD\";\n\t\tpublic static final String DELETE_FILE = \"DELE\";\n\t\tpublic static final String GET_DIRECTORY_SIZE = \"DSIZ\";\n\t\tpublic static final String PRIVACY_PROTECTED = \"ENC\";\n\t\tpublic static final String SPECIFY_ADDRESS_AND_PORT = \"EPRT\";\n\t\tpublic static final String ENTER_EXTENDED_PASSIVE_MODE = \"EPSV\";\n\t\tpublic static final String GET_FEATURE_LIST = \"FEAT\";\n\t\tpublic static final String HELP = \"HELP\";\n\t\tpublic static final String GET_HOST_BY_NAME = \"HOST\";\n\t\tpublic static final String LANGUAGE_NEGOTIATION = \"LANG\";\n\t\tpublic static final String GET_FILES_LIST = \"LIST\";\n\t\tpublic static final String SPECIFY_LONGADDRESS_AND_PORT = \"LPRT\";\n\t\tpublic static final String ENTER_LONG_PASSIVE_MODE = \"LPSV\";\n\t\tpublic static final String GET_LAST_MODIFICATION_TIME = \"MDTM\";\n\t\tpublic static final String MODIFY_CREATION_TIME = \"MFCT\";\n\t\tpublic static final String MODIFY_FACT = \"MFF\";\n\t\tpublic static final String MODIFY_MODYFICATION_TIME = \"MFMT\";\n\t\tpublic static final String INTEGRITY_PROTECTION = \"MIC\";\n\t\tpublic static final String MAKE_DIRECTORY = \"MKD\";\n\t\tpublic static final String LIST_A_CONTENT = \"MLSD\";\n\t\tpublic static final String PROVIDES_DATA = \"MLST\";\n\t\tpublic static final String SET_TRANSFER_MODE = \"MODE\";\n\t\tpublic static final String LIST_OF_FILE_NAMES = \"NLST\";\n\t\tpublic static final String NO_OPERATION = \"NOOP\";\n\t\tpublic static final String SELECT_OPTIONS = \"OPTS\";\n\t\tpublic static final String AUTHENTICATION_PASSWORD = \"PASS\";\n\t\tpublic static final String ENTER_PASSIVE_MODE = \"PASV\";\n\t\tpublic static final String PROTECTION_BUFFER_SIZE = \"PBSZ\";\n\t\tpublic static final String SPECIFY_PORT = \"PORT\";\n\t\tpublic static final String DATA_CHANNEL_PROTECTION_LEVEL = \"PROT\";\n\t\tpublic static final String PRINT_WORKING_DIRECTORY = \"PWD\";\n\t\tpublic static final String DISCONNECT = \"QUIT\";\n\t\tpublic static final String REINITIALIZE = \"REIN\";\n\t\tpublic static final String RESTART = \"REST\";\n\t\tpublic static final String RETRIEVE_A_COPY = \"RETR\";\n\t\tpublic static final String REMOVE_DIRECTORY = \"RMD\";\n\t\tpublic static final String REMOVE_DIRECTORY_TREE = \"RMDA\";\n\t\tpublic static final String RENAME_FROM = \"RNFR\";\n\t\tpublic static final String RENAME_TO = \"RNTO\";\n\t\tpublic static final String SITE_SPECIFFIC_COMMAND = \"SITE\";\n\t\tpublic static final String SIZE_OF_FILE = \"SIZE\";\n\t\tpublic static final String MOUNT_FILE_STRUCTURE = \"SMNT\";\n\t\tpublic static final String USE_SINGLE_PORT_PASSIVE_MODE = \"SPSV\";\n\t\tpublic static final String GET_STATUS = \"STAT\";\n\t\tpublic static final String ACCEPT_AND_STORE = \"STOR\";\n\t\tpublic static final String STORE_FILE_UNIQUELY = \"STOU\";\n\t\tpublic static final String SET_FILE_TRANSFER_STRUCT = \"STRU\";\n\t\tpublic static final String GET_SYSTEM_TYPE = \"SYST\";\n\t\tpublic static final String GET_THUMBNAIL = \"THMB\";\n\t\tpublic static final String SET_TRANSFER_TYPE = \"TYPE\";\n\t\tpublic static final String AUTHENTICATION_USERNAME = \"USER\";\n\t}\n\t\n\t/**\n\t * Types of transmission.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class TransmissionTypes\n\t{\n\t\tpublic static final String BINARY = \"I\";\n\t\tpublic static final String ASCII = \"A\";\n\t}\n\n\t/**\n\t * Inner class for responses from server.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class ServerResonses\n\t{\n\t\t/**\n\t\t * 1xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitivePreliminaryReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"100\";\n\t\t\tpublic static final String RESTART_REPLY = \"110\";\n\t\t\tpublic static final String SERVICE_READY = \"120\";\t\n\t\t\tpublic static final String DATA_CONNECTION_ALREADY_OPENED = \"125\";\n\t\t\tpublic static final String FILE_STATUS_OKAY = \"150\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 2xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitiveCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"200\";\n\t\t\tpublic static final String SYSTEM_STATUS = \"211\";\n\t\t\tpublic static final String DIRECTORY_STATUS = \"212\";\n\t\t\tpublic static final String FILE_STATUS = \"213\";\n\t\t\tpublic static final String HELP_MESSAGE = \"214\";\n\t\t\tpublic static final String NAME_SYSTEM_TYPE = \"215\";\n\t\t\tpublic static final String READY_FOR_NEW_USER = \"220\";\n\t\t\tpublic static final String SERVICE_CLOSING_CONTROL_CONNECTION = \"221\";\n\t\t\tpublic static final String OPEN_DATA_CONNECTION = \"225\";\t\t\t\n\t\t\tpublic static final String CLOSING_DATA_CONNECTION = \"226\";\n\t\t\tpublic static final String PASSIVE_MODE = \"227\";\n\t\t\tpublic static final String LONG_PASSIVE_MODE = \"228\";\n\t\t\tpublic static final String EXTENDED_PASSIVE_MODE = \"229\";\n\t\t\tpublic static final String USER_LOG_IN = \"230\";\n\t\t\tpublic static final String USER_LOG_OUT = \"231\";\n\t\t\tpublic static final String LOGOUT_NOTED = \"232\";\n\t\t\tpublic static final String REQUESTED_OK = \"250\";\n\t\t\tpublic static final String PATHNAME_CREATED = \"257\";\t\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 3xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PositiveIntermediateReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"300\";\n\t\t\tpublic static final String USERNAME_OK_PASSWORD_NEEDED = \"331\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_LOGIN = \"332\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION = \"350\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 4xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class TransientNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"400\";\n\t\t\tpublic static final String SERVICE_NOT_AVAILABLE = \"421\";\n\t\t\tpublic static final String CANT_OPEN_DATA_CONNECTION = \"425\";\n\t\t\tpublic static final String CONNECTION_CLOSED = \"426\";\n\t\t\tpublic static final String INVALID_USERNAME_OR_PASSWORD = \"430\";\n\t\t\tpublic static final String REQUESTED_HOST_UNAVAILABLE = \"434\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION_NOT_TAKEN = \"450\";\n\t\t\tpublic static final String LOCAL_ERROR = \"451\";\n\t\t\tpublic static final String FILE_BUSY = \"452\";\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 5xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PermamentNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"500\";\n\t\t\tpublic static final String SYNTAX_ERROR = \"501\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED = \"502\";\n\t\t\tpublic static final String BAD_SEQUENCE_OF_COMMANDS = \"503\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = \"504\";\n\t\t\tpublic static final String NOT_LOGGED_IN = \"530\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_STORING_FILES = \"532\";\n\t\t\tpublic static final String POLICY_REQUIRES_SSL = \"534\";\n\t\t\tpublic static final String FILE_NOT_FOUND = \"550\";\n\t\t\tpublic static final String PAGE_TYPE_UNKNOWN = \"551\";\t\t\t\n\t\t\tpublic static final String EXCEEDED_STORAGE_ALLOCATION = \"552\";\n\t\t\tpublic static final String FILE_NAME_NOT_ALLOWED = \"553\";\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 6xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class ProtectedReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"600\";\n\t\t\tpublic static final String INTEGRITY_PROTECTED_REPLY = \"631\";\n\t\t\tpublic static final String CONFIDENTIALITY_AND_INTEGRITY_PROTECTED_REPLY = \"632\";\t\t\t\n\t\t\tpublic static final String CONFIDENTIALITY_PROTECTED_REPLY = \"633\";\t\t\t\n\t\t}\n\t}\n\t\n\t/**\n\t * Language controller.\n\t */\n\tpublic final static LanguageController lc = LanguageController.getInstance();\n\t\n\tpublic void execute(FTPLexer lexer);\n}", "private static void doFsCommand(final FsShell shell, final String [] args)\n throws Exception {\n int errcode = shell.run(args);\n if (errcode != 0) throw new IOException(\"Failed put; errcode=\" + errcode);\n }", "@Override\n\tpublic void doAction(FTPSession sessionData, String message) {\n\t}", "protected void handleInput(String input) {}", "private void processCommand(String command) {\n if (command.equals(\"a\")) {\n doAddTask();\n } else if (command.equals(\"r\")) {\n doRemoveTask();\n } else if (command.equals(\"c\")) {\n doMarkTaskAsCompleted();\n } else if (command.equals(\"m\")) {\n doModifyTask();\n } else if (command.equals(\"v\")) {\n doViewAllTasks();\n } else if (command.equals(\"ct\")) {\n doViewAllCompletedTasks();\n } else if (command.equals(\"s\")) {\n saveTasks();\n } else {\n System.out.println(\"Invalid selection, kindly select from the options available.\");\n }\n }", "@Override\n\tpublic void run() {\n\t\twhile (receivingCommands) {\n\t\t\ttry {\n\t\t\t\tCommandHandler commandHandler = new CommandHandler(readNextLine());\n\t\t\t\tswitch (commandHandler.getCommand()) {\n\t\t\t\tcase REGISTER:\n\t\t\t\t\tString username = commandHandler.getParam(1);\n\t\t\t\t\tString password = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.register(username, password);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGIN:\n\t\t\t\t\tString username1 = commandHandler.getParam(1);\n\t\t\t\t\tString password1 = commandHandler.getParam(2);\n\t\t\t\t\tjwtToken = fileCatalog.login(username1, password1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIST:\n\t\t\t\t\tList<? extends FileDTO> files = fileCatalog.list(jwtToken);\n\t\t\t\t\tfor (FileDTO file : files) {\n\t\t\t\t\t\tprintDetails(file);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DETAILS:\n\t\t\t\t\tString fileName = commandHandler.getParam(1);\n\t\t\t\t\tFileDTO file = fileCatalog.details(jwtToken, fileName);\n\t\t\t\t\tprintDetails(file);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPR:\n\t\t\t\t\tString pathFileToUploadReadOnly = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServerReadOnly = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServerReadOnly, false);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPW:\n\t\t\t\t\tString pathFileToUpload = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServer = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServer, true);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOWN:\n\t\t\t\t\tString fileNameToDL = commandHandler.getParam(1);\n\t\t\t\t\tString targetDirectory = commandHandler.getParam(2);\n\t\t\t\t\tString newNameDL = commandHandler.getParam(3);\n\t\t\t\t\tfileCatalog.download(jwtToken, fileNameToDL, targetDirectory, newNameDL);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DELETE:\n\t\t\t\t\tString fileNameToDelete = commandHandler.getParam(1);\n\t\t\t\t\tfileCatalog.delete(jwtToken, fileNameToDelete);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGOUT:\n\t\t\t\t\tjwtToken = null;\n\t\t\t\t\tsafePrintln(\"You have been logged out.\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase QUIT:\n\t\t\t\t\treceivingCommands = false;\n\t\t\t\t\tsafePrintln(\"Good bye!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase HELP:\n\t\t\t\t\tfor (Command command : Command.values()) {\n\t\t\t\t\t\tif (command == Command.UNKNOWN) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsafePrintln(command.toString().toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsafePrintln(\"Unrecognized command.\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tniceErrorPrint(e);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n System.err.println(\"This is a work in progress and I have no idea what I'm doing...\");\n\n var server = new TftpServer();\n\n try (var ss = new DatagramSocket(69)) {\n while (!ss.isClosed()) {\n byte[] buf = new byte[512];\n var p = new DatagramPacket(buf, buf.length);\n ss.receive(p);\n\n server.parse(p);\n }\n } catch (IOException ex) {\n System.err.println(\"IOException: \" + ex.getMessage());\n }\n }", "public static void main(String[] args) {\n\n try {\n System.out.println((FtpUtil.storeFile(\"http://v2.ifaceshow.com/a/2012/1102/0955/\", new InputStream[] { new FileInputStream(\"d:/pic/123.jpg\")}, \"video\", \"a64cbbe_13b377221fe51\",new String[]{\"0\"}, \"jpg\"))[0]);\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Key \t Description\");\n\t\tSystem.out.println(\"-----------------------------\");\n\t\tSystem.out.println(\"FC \t\tFahrenheit -> Celsius\");\n\t\tSystem.out.println(\"CF\t\tCelsius -> Fahrenheit\");\n\t\tString key = RUI.readUserStringInput(\"Enter Key:\");\n\t\tString input = key.toUpperCase();\n\t\tif (input.equals(\"FC\")) {\n\t\t\tfloat far = RUI.readUserIntInput(\"Enter Fahrenheit Measurement: \");\n\t\t\tfloat toCel = (far - 32) * 5/9;\n\t\t\tSystem.out.println(far + \" degrees Fahrenheit is \" + toCel + \" degrees Celsius\");\n\t\t\t\n\t\t} else if (input.equals(\"CF\")) {\n\t\t\tfloat cel = RUI.readUserIntInput(\"Enter Celsius Measurement: \");\n\t\t\tfloat toFar = (cel * 9/5) + 32;\n\t\t\tSystem.out.println(cel + \" degrees Celsius is \" + toFar + \" degrees Fahrenheit\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Invalid Input, Please Try Again\");\n\t\t} \n\t\t\n\t\t\n\t\t\n\t}", "private Command parseCommand(String input) {\r\n\r\n String[] splittedInput = input.toUpperCase().split(\" \");\r\n String command = splittedInput[0];\r\n\r\n switch (command) {\r\n case \"PLACE\":\r\n return new PlaceCommand(input);\r\n case \"MOVE\":\r\n return new MoveCommand();\r\n case \"LEFT\":\r\n return new RotateLeftCommand();\r\n case \"RIGHT\":\r\n return new RotateRightCommand();\r\n case \"REPORT\":\r\n return new ReportCommand();\r\n default:\r\n return new IgnoreCommand();\r\n }\r\n }", "public void handleCommand(String command);", "void processCommand (String command, ZMsg msg);", "public abstract void doCommand(String command);", "public interface CommandHandler {\n void handleInput(String msg, DataInputStream input, DataOutputStream output);\n}", "private void doOperation(String[] separatedInput) {\n\t\tswitch (separatedInput.length) {\n\t\tcase 1 -> {\n\t\t\tswitch (separatedInput[0]) {\n\t\t\tcase \"P\" -> display();\n\t\t\tcase \"C\" -> checkout();\n\t\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t\t}\n\t\t}\n\t\tcase 4 -> {\n\t\t\tString itemName = separatedInput[1];\n\t\t\tdouble itemPrice = Double.parseDouble(separatedInput[2]);\n\t\t\tboolean itemTaxable = Boolean.parseBoolean(separatedInput[3]);\n\t\t\tGroceryItem itemObj = new GroceryItem(itemName, itemPrice, itemTaxable);\n\t\t\tswitch (separatedInput[0]) {\n\t\t\tcase \"A\" -> add(itemObj, itemName);\n\t\t\tcase \"R\" -> remove(itemObj, itemName, itemPrice);\n\t\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t\t}\n\t\t}\n\t\tdefault -> System.out.println(\"Invalid command!\");\n\t\t}\n\t}", "void mainMenuCommand(String command){\n\t\tString[] strArray=command.split(\"\\\\s\");\n\t\tString mainCommand=strArray[0];\n\t\t\n\t\t// if - else if - else loop to check for the particular command and take actions according those commands\n\t\t\n\t\t\n\t\t// Block to print the song details for given song id\n\t\tif(mainCommand.equals(\"song\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint songID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printSong(songID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid song id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to print the playlist details for given playlist id\n\t\telse if(mainCommand.equals(\"playlist\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tint playlistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tsongFile.printPlaylist(playlistID);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Enter valid playlist id!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to whole song list or all playlist depending on the user input\n\t\telse if(mainCommand.equals(\"print\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"song\")){\n\t\t\t\t\t\tsongFile.printAllSongs();\n\t\t\t\t\t}\n\t\t\t\t\telse if(subCommand.equals(\"playlist\")){\n\t\t\t\t\t\tsongFile.printAllplaylist();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid print command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to perform search for songs in the song list with user given attribute and search terms\n\t\telse if(mainCommand.equals(\"search\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length > 2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\t// Get search string from command\n\t\t\t\t\tString songAttributeValue=command.substring(command.indexOf(\"\\\"\")+1,command.lastIndexOf(\"\\\"\")).toLowerCase(); \n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tArrayList<Song> list=songFile.searchSong(subCommand, songAttributeValue);\n\t\t\t\t\t\tsongFile.printArrayList(list);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!! \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!No search terms\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid search command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to sort the song list on user given song attribute\n\t\telse if(mainCommand.equals(\"sort\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString subCommand=strArray[1];\n\t\t\t\t\tif(subCommand.equals(\"artist\")||subCommand.equals(\"title\")){\n\t\t\t\t\t\tsongFile.sortSongs(subCommand);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid sort command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to create the new playlist and go to playlist menu\n\t\telse if(mainCommand.equals(\"create\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tString playlistName=strArray[1];\n\t\t\t\t\tcurrentPlaylistID=songFile.createPlaylist(playlistName);\n\t\t\t\t\t// Flag which takes to playlist menu / sub menu\n\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid create command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Block to edit the given playlist id\n\t\telse if(mainCommand.equals(\"edit\")){\n\t\t\ttry{\n\t\t\t\tif(strArray.length==2){\n\t\t\t\t\tcurrentPlaylistID=Integer.parseInt(strArray[1]);\n\t\t\t\t\tif(songFile.isPlaylistIdAvailable(currentPlaylistID)){// currentPlaylistID<songFile.playlistID){\n\t\t\t\t\t\tthis.subMenuFlag=true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Invalid Playlist ID!!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Invalid Command!!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch(Exception e){\n\t\t\t\tSystem.out.println(\"Invalid edit command!!\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// For all other invalid commands\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter valid command.\");\n\t\t}\n\t\n\t}", "@Override\n protected void onHandleIntent(Intent intent) {\n messenger = intent.getParcelableExtra(\"messenger\");\n int action = intent.getIntExtra(\"action\", 0);\n switch (action) {\n //Initializes the FTP client. Must be called before other actions.\n case SET_FTP_ACTION:\n FtpBuilder builder = (FtpBuilder) intent.getSerializableExtra(\"ftp\");\n ftp = builder.build();\n break;\n //Connects to the FTP server.\n case CONNECT_ACTION:\n connect();\n break;\n //Logs into the FTP server.\n case LOGIN_ACTION:\n if (ftp.login()) sendResponse(\"Logged in\");\n else sendResponse(\"Failed to log in, error: \");\n break;\n //Uploads a file to the FTP server. Will try to reconnect if the connection has been closed.\n case SEND_ACTION:\n Uri path = intent.getParcelableExtra(\"file\");\n InputStream stream;\n try {\n stream = getContentResolver().openInputStream(path);\n } catch (FileNotFoundException e) {\n sendResponse(\"Could not open file \" + path + \", \" + e.toString());\n break;\n }\n String[] strings = path.getPath().split(\"/\");\n String fileName = strings[strings.length - 1];\n int reply = ftp.sendFile(stream, fileName);\n if (reply == 0) {\n sendResponse(\"File uploaded\");\n break;\n }\n if (reply == Ftp.FTPCONNECTIONCLOSEDEXCEPTION_CODE) { //try to reconnect if connection has been closed\n sendResponse(\"Connection closed, reconnecting...\");\n connect();\n reply = ftp.sendFile(stream, fileName);\n if (reply == 0) sendResponse(\"File uploaded\");\n else sendResponse(\"Failed to send file\");\n break;\n } else sendResponse(\"Failed to send file\");\n break;\n //Logs out of the FTP server.\n case LOGOUT_ACTION:\n if (ftp.logout()) sendResponse(\"Logged out\");\n else sendResponse(\"Failed to log out\");\n break;\n //Disconnects from the FTP server.\n case DISCONNECT_ACTION:\n if (ftp.disconnect()) sendResponse(\"Disconnected\");\n else sendResponse(\"Error while trying to disconnect\");\n break;\n }\n }", "public void processInput( String input ){\n\t\tString opponent;//holds either \"client\" or \"server\". Whichever is the opponent\n\t\tif( parent.whichPlayer.equals(\"server\") ) opponent = \"client\";\n\t\telse opponent = \"server\";\n\t\t\n\t\t//create a string array to hold the input split around spaces\n\t\tString[] split = input.split(\" \");\n\t\t\n\t\t//input was mouseclick\n\t\tif( split[0].equals(\"C\") ) {\n\t\t\t//If the line contains mouseClick information, then send it to handleMouseClick\n\t\t\tparent.handleMouseClick(Integer.parseInt(split[1]), Integer.parseInt(split[2]), opponent);\n\t\t}\n\n\t\t//input was name\n\t\telse if(split[0].equals(\"N\")) {\n\t\t\t//if this window is the server, set the recieved name to the client\n\t\t\tif( parent.serverRadio.isSelected() ) {\n\t\t\t\tparent.playerTwoTextField.setText(split[1]);\n\t\t\t}\n\t\t\t//if this window is the client, set the recieved name to the server\n\t\t\telse {\n\t\t\t\tparent.playerOneTextField.setText(split[1]);\n\t\t\t}\n\t\t}\n\t\t//if a quit flag was sent\n\t\telse if(split[0].equals(\"Q\")){\n\t\t\ttry {\n\t\t\t\tsock.close();\n\t\t\t\tss.close();\n\t\t\t\tpw.close();\n\t\t\t\tsc.close();\n\t\t\t}catch(Exception e) {\n\t\t\t\tSystem.out.println(\"Unable to close the connection!\");\n\t\t\t}\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in); // reads in which type of request to choose\n\t\tSystem.out.println(\"choose FCFS, Closest, or Urgency\");\n\t\tString pickRequest = sc.next();\n\t\t\n\t\t\n\t\tnew Server(Integer.parseInt(args[0]), pickRequest);\n\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent evt) {\n\t\t\t\tLinkFTPKeyPressed(evt);\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent evt) {\n\t\t\t\tLinkFTPKeyPressed(evt);\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent evt) {\n\t\t\t\tLinkFTPKeyPressed(evt);\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent evt) {\n\t\t\t\tLinkFTPKeyPressed(evt);\n\t\t\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"What task: \");\r\n\t\tint option = scan.nextInt();\r\n\t\tswitch (option) {\r\n\t\tcase 1:\r\n\t\t\tpositionalNumbers();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tpassword();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tmean();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tbase();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void processUserInput(String input){\n\t\t\n\t\t\tAlgorithm1 alg1 = new Algorithm1(input, distance, inputMap);\n\t\t\t// Calculates shortest path using distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg1.getShortestPath();\n\t\t\t\n\t\t\t\n\t\t\tAlgorithm2 alg2 = new Algorithm2(input, distance, inputMap);\n\t\t\t// Calculates shortest path using both input and distance file for distance metric\n\t\t\t// Prints the path nodes\n\t\t\t// Prints the distance\n\t\t\talg2.getShortestPath();\n\t\t\t\n\t\t\t\n\t}", "public void processCommand(String userInput){\n if (userInput.contains(\" \")){ \n processSingleToken(userInput.split(\" \")); //Splits strings based on \" \" \n }\n \n else{\n List<String> tempStore = new ArrayList<String>();\n tempStore.add(userInput);\n String[] token = tempStore.toArray(new String[tempStore.size()]);\n processSingleToken(token);\n }\n }", "private void processCommand(String command) {\n if (command.equals(\"1\")) {\n insertItem();\n } else if (command.equals(\"2\")) {\n removeItem();\n } else if (command.equals(\"3\")) {\n viewList();\n } else if (command.equals(\"4\")) {\n saveToDoList();\n } else if (command.equals(\"5\")) {\n loadToDoList();\n } else {\n System.out.println(\"Selection not valid...\");\n }\n }", "public void sendCommands (String input, String language) {\n myController.parseCommand(input, language);\n }", "public static void main(String[] args) throws NumberFormatException,\n IOException\n {\n int port = 0;\n String address = \"127.0.0.1\";\n String path = \"\";\n\n if (args.length % 2 == 0) {\n for (int i = 0; i < args.length; i++) {\n if (args[i].equals(\"-a\")) {\n address = args[i + 1];\n }\n if (args[i].equals(\"-d\")) {\n path = args[i + 1];\n }\n if (args[i].equals(\"-p\")) {\n port = Integer.parseInt(args[i + 1]);\n }\n }\n }\n\n if (port != 0 && !path.equals(\"\")) {\n new FileServer().launch(port, path, address);\n } else {\n System.out\n .println(\"> arguments must be : -p [port] -d [path of the file system] -a (optionnal) [address]\");\n }\n }", "public static void main(String[] args) throws NumberFormatException, IOException {\n if (args.length != 3) {\n usage();\n return;\n }\n if (args[0].length() > 9) {\n System.out.println(\"Login name cannot exceed 9 caracters\");\n return;\n }\n Pattern pattern = Pattern.compile(\"[^a-zA-Z0-9]\");\n Matcher matcher = pattern.matcher(args[0]);\n if (matcher.find()) {\n System.out.println(\"Login cannot contains special characters\");\n return;\n }\n new ClientChatOs(args[0], new InetSocketAddress(args[1], Integer.parseInt(args[2]))).launch();\n }", "boolean processCommand() throws IOException\n\t{\n\t\tString[] commands = in.readLine().split(\" \");\n\t\tif (commands[0].equalsIgnoreCase(\"F\") && isNum(commands[1]) && isNum(commands[2])) {\n\t\t\tprocessFireCmd(new String[] {commands[1], commands[2]});\n\t\t} else if (commands[0].equalsIgnoreCase(\"C\")) {\n\t\t\tprocessChatCmd (Arrays.copyOfRange(commands, 1, commands.length).toString());\n\t\t} else if (commands[0].equalsIgnoreCase(\"D\")) {\n\t\t\tout.println(\"My board: \\n\");\n\t\t\tboard.draw();\n\t\t\tout.println(\"Target's board: \\n\");\n\t\t\ttargets.draw();\n\t\t\tout.flush();\n\t\t} else {\n\t\t\tout.println(\"Unknown command.\");\n\t\t\tout.flush();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "boolean execute(FTPClient client) throws SocketException, IOException;", "public static Command parse(String input) throws DukeException {\r\n String[] inputArr = input.split(\" \", 2);\r\n String command = inputArr[0];\r\n\r\n switch (command) {\r\n case \"bye\":\r\n return new ExitCommand();\r\n case \"list\":\r\n return new ListCommand();\r\n case \"done\":\r\n try {\r\n return new DoneCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n mark as done!\");\r\n }\r\n case \"delete\":\r\n try {\r\n return new DeleteCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n delete!\");\r\n }\r\n case \"todo\":\r\n try {\r\n return new AddCommand(new Todo(inputArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"The description of a todo cannot be empty.\");\r\n }\r\n case \"deadline\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /by \");\r\n return new AddCommand(new Deadline(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n deadline <description> /by <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"event\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /at \");\r\n return new AddCommand(new Event(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n event <description> /at <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"find\":\r\n try {\r\n return new FindCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify what you are searching for!\");\r\n }\r\n default:\r\n throw new DukeException(\"I'm sorry, but I don't know what that means!\");\r\n }\r\n }", "String getUserInput();", "private void command(){\n out.println(\"Enter command: \");\n String comInput = in.nextLine();\n\n if (comInput.toLowerCase().equals(\"vote\")) {\n voteCommand();\n }else if (comInput.toLowerCase().equals(\"trade\")){\n tradeCommand();\n }else if (comInput.toLowerCase().equals(\"next\")){\n out.println(waitPrint());\n await();\n// nextRound();\n }else if(comInput.toLowerCase().equals(\"logout\")){\n// login = false;\n logout();\n }\n }", "public SnoozeCommand(String userInputCommand) {\n this.userInputCommand = userInputCommand;\n }", "@RequestMapping(value=\"/ask\", method = RequestMethod.POST)\r\n\tpublic List<Message> ask(@AuthenticationPrincipal User activeUser, @RequestParam String command) {\r\n\t\tLOGGER.debug(\"command : {}\", command);\r\n\t\tList<Message> result = null;\r\n\t\ttry {\r\n\t\t\tString[] split = command.split(\" \");\r\n\t\t\tswitch (split[0]) {\r\n\t\t\tcase \"echo\" : result = service.echo(command); break;\r\n\t\t\tcase \"ls\" : result = service.ls(activeUser.getUsername(), command); break;\r\n\t\t\tcase \"ts\" : result = service.ts(activeUser.getUsername(), command); break;\r\n\t\t\tcase \"go\" : result = service.go(activeUser.getUsername(), command); break;\r\n\t\t\tdefault: result = new ArrayList<Message>();\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tresult = Arrays.asList(new Message(e.getMessage()));\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private static void inputInstallerCommand() {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tString commandLine = scanner.nextLine();\n\t\t//Case-sensitive ans should be always Upper case\n\t\tif (!commandLine.equals(\"END\")) {\n\t\t\tcallIstallerCommand(commandLine);\n\t\t\tinputInstallerCommand();\n\t\t}\n\t}", "public static void tranferFile() {\n\n FTPClient ftpClient = new FTPClient();\n try {\n ftpClient.connect(\"192.168.231.237\", 80);\n ftpClient.login(\"root\", \"xpsr@350\");\n ftpClient.enterLocalPassiveMode();\n\n ftpClient.setFileType(FTP.BINARY_FILE_TYPE);\n File sourceFile = new File(\"/home/sthiyagaraj/eclipse-workspace/KonnectAPI/target/APIURL.tar.gz\");\n InputStream inputStream = new FileInputStream(sourceFile);\n\n boolean done = ftpClient.storeFile(\"filename which receiver get\", inputStream);\n inputStream.close();\n if (done) {\n System.out.println(\"file is uploaded successfully..............\");\n }\n\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp : \"+e);\n } finally {\n try {\n if (ftpClient.isConnected()) {\n ftpClient.logout();\n ftpClient.disconnect();\n }\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp logout/disconnect : \"+e);\n }\n }\n\n }", "public void chooseFunction(){\n\t\t\n\t\tString commands=keyBoard.nextLine();\n\t\t\n\t\tswitch(interp.getFunctionName(commands)){\n\t\t\tcase \"addplayer\":\n\t\t\t\tplayerMgr.addPlayer(interp.getParameter(commands));\n\t\t\t\tbreak;\n\t\t\tcase \"removeplayer\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.removePlayer();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.removePlayer(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"editplayer\":\n\t\t\t\tplayerMgr.editPlayer(interp.getParameter(commands));\n\t\t\t\tbreak;\n\t\t\tcase \"resetstats\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.resetStats();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.resetStats(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"displayplayer\":\n\t\t\t\tif(interp.getParameter(commands)==null){\n\t\t\t\t\tplayerMgr.displayPlayer();\n\t\t\t\t}else{\n\t\t\t\t\tplayerMgr.displayPlayer(interp.getParameter(commands));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"rankings\":\n\t\t\t\tplayerMgr.displayRanking();\n\t\t\t\tbreak;\n\t\t\tcase \"playgame\":\n\t\t\t\tplayerMgr.assignPlayerToGM(interp.getParameter(commands),gameMgr);\n\t\t\t\tgameMgr.playGame();\n\t\t\t\tbreak;\n\t\t\tcase \"exit\":\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.exit(0);\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Welcome to the FileTransfer Client! \\n Starting...\");\n\t\t\n\t\tint port; \n\t\t\n\t\tif (args.length < 0 || args.length > 1) {\n\t\t\tSystem.out.println(\"Syntax: FileTranferClient <port>\");\n\t\t\treturn;\n\t\t} else if (args.length == 1) {\n\t\t\tport = Integer.parseInt(args[0]);\n\t\t\tSystem.out.println(\"Using specified client port \" + port + \"...\");\n\t\t} else {\n\t\t\tport = FileTransferProtocol.DEFAULT_CLIENT_PORT;\n\t\t\tSystem.out.println(\"Using default client port \" + port + \"...\");\n\t\t}\n\t\t\t\n\t\tFileTransferClient client = new FileTransferClient(port);\n\t\tSystem.out.println(\"Starting client...\");\n\t}", "private void readCommand(String[] splitRequest, TaskManager taskManager) {\n if (splitRequest.length >= 2) {\n ArrayList list = new ArrayList<Task>();\n switch (splitRequest[1]) {\n case \"all\":\n output.println(\"READ COMMAND\");\n list = taskManager.getTaskList();\n sendTasks(list);\n break;\n case \"today\":\n output.println(\"READ COMMAND\");\n list = taskManager.getTaskListForToday();\n sendTasks(list);\n break;\n case \"before\":\n output.println(\"READ COMMAND\");\n list = taskManager.getTaskListBeforeToday();\n sendTasks(list);\n break;\n case \"after\":\n output.println(\"READ COMMAND\");\n list = taskManager.getTaskListAfterToday();\n sendTasks(list);\n break;\n default:\n output.println(\"WRONG PARAMETER\");\n output.println(\"To read task enter: 'r all/today/before/after'\");\n }\n } else {\n output.println(\"WRONG PARAMETER\");\n output.println(\"To read task enter: 'r all/today/before/after'\");\n }\n }", "public void setUserinput(String userinput){\n String[] inputs = userinput.split(\" \");\n if(inputs.length > 1){\n this.userinput_var = inputs[1];\n }\n this.userinput_command = inputs[0];\n }", "@Override\r\n public void run() {\r\n AccountDTO acct = null;\r\n while (rCmds) {\r\n try {\r\n CmdLine cmdLine = new CmdLine(readNextLine());\r\n switch (cmdLine.getCmd()) {\r\n case HELP:\r\n defineCommandUsage();\r\n break;\r\n case QUIT:\r\n activeUser = null;\r\n rCmds = false;\r\n break;\r\n case REGISTER:\r\n fserver.createAccount(cmdLine.getParameter(0), cmdLine.getParameter(1));\r\n break;\r\n case LOGIN:\r\n login(cmdLine.getParameter(0), cmdLine.getParameter(1), acct);\r\n break;\r\n case LISTMY:\r\n listMy();\r\n break;\r\n case LISTALL:\r\n listAll();\r\n break;\r\n case UPLOAD:\r\n upload(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DOWNLOAD:\r\n download(cmdLine.getParameter(0));\r\n break;\r\n case CHANGE:\r\n change(cmdLine.getParameter(0), cmdLine.getParameter(1), cmdLine.getParameter(2));\r\n break;\r\n case DELETE:\r\n delete(cmdLine.getParameter(0));\r\n break;\r\n case LOGOUT:\r\n activeUser = null;\r\n lIn = false;\r\n break;\r\n default:\r\n outMgr.println(\"illegal command\");\r\n }\r\n } catch (Exception e) {\r\n outMgr.println(\"Operation failed\");\r\n outMgr.println(e.getMessage());\r\n }\r\n }\r\n }", "public interface Command {\n\t public String execute(String[] request);\n}", "public static String executeOrder(String order, HashMap<String, String> map) {\r\n\t\tString[] parts = order.split(\"\\\\s+\");\r\n\t\tString value = null;\r\n\t\tString result = null;\r\n\t\tString reply = null;\r\n\t\tif(parts.length < 1){\r\n\t\t\treply = \"Please input your command!\";\r\n\t\t\treturn reply;\r\n\t\t}\r\n\t\tswitch (parts[0]) {\r\n\t\tcase \"put\"://put operation\r\n\t\t\tif(parts.length < 3){//order less than 3 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you forget the value.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tif(parts.length > 3){//order more than 3 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you offer more than one value.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tmap.put(parts[1], parts[2]);\r\n\t\t\treply = parts[0]+\" \"+parts[1]+\" \"+parts[2] + \" success!\";\r\n\t\t\tbreak;\r\n\t\tcase \"get\":\r\n\t\t\tif(parts.length > 2){//order less than 2 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you offer more than one key.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tif(parts.length < 2){//order more than 2 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you forget the key.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tvalue = map.get(parts[1]);\r\n\t\t\tif(value == null)\r\n\t\t\t\treply = parts[0]+\" \"+parts[1] + \" fails because no matching key!\";\r\n\t\t\telse\r\n\t\t\t\treply = \"the value of \"+parts[1]+\" is \"+value;\r\n\t\t\tbreak;\r\n\t\tcase \"delete\":\r\n\t\t\tif(parts.length > 2){//order less than 2 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you offer more than one key.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tif(parts.length < 2){//order more than 2 parts\r\n\t\t\t\treply = \"cannot read your command! Maybe you forget the key.\";\r\n\t\t\t\treturn reply;\r\n\t\t\t}\r\n\t\t\tresult = map.remove(parts[1]);\r\n\t\t\tif(result == null)\r\n\t\t\t\treply = parts[0]+\" \"+parts[1] + \" fails because no matching keys!\";\r\n\t\t\telse\r\n\t\t\t\treply = \"delete the key \"+parts[1]+ \" success!\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treply = \"cannot read your command!\";\r\n\t\t}\t\t\r\n\t\treturn reply;\r\n\t}", "private void commandProgramBasic(String command)\n {\n String[] array = command.split(\" \");\n\n if(array[0].equals(\"init\"))\n {\n System.out.println(\"The program will now read the file.\");\n input.readFile();\n } else if(array[0].equals(\"run\"))\n {\n int runTime = Integer.parseInt(array[1]);\n System.out.println(\"Please wait while the data is stored.\");\n System.out.println(\"The filled data containers will be printed shortly.\");\n input.runProgram(runTime);\n } else if(array[0].equals(\"clear\"))\n {\n System.out.println(\"The data containers will now be cleared.\");\n input.clear();\n } else if(array[0].equals(\"exit\"))\n {\n scanner.close();\n } \n\n askUser();\n }", "@Override\n\t/*\n\t * (non-Javadoc)\n\t * @see AbCommand#dispatch(java.lang.String)\n\t */\n\t// @param request\n\tpublic void dispatch(String request) throws Exception {\n\t\t{\n\t\t\t \n\t\t\t if(request.equalsIgnoreCase(\"Admin\"))\n\t\t\t {\n\t\t\t\t admin.showView();\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t System.out.println(\"Enter only specified options\");\n\t\t\t }\n\t\t }\n\t}", "private void handleInput()\n {\n String instructions = \"Options:\\n<q> to disconnect\\n<s> to set a value to the current time\\n<p> to print the map contents\\n<?> to display this message\";\n System.out.println(instructions);\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n try {\n while (true) {\n String line = br.readLine();\n if (line.equals(\"q\")) {\n System.out.println(\"Closing...\");\n break;\n } else if (line.equals(\"s\")) {\n System.out.println(\"setting value cli_app to current time\");\n collabMap.set(\"cli_app\", System.currentTimeMillis());\n } else if (line.equals(\"?\")) {\n System.out.println(instructions);\n } else if (line.equals(\"p\")) {\n System.out.println(\"Map contents:\");\n for (String key : collabMap.keys()) {\n System.out.println(key + \": \" + collabMap.get(key));\n }\n }\n }\n } catch (Exception ex) {\n }\n\n if (document != null)\n document.close();\n System.out.println(\"Closed\");\n }", "public void commandEntered(String cmd)\n {\n String cleaned = StringUtils.cleanWhiteSpace(cmd.trim());\n String args[] = cleaned.split(\" \");\n \tString c = args[0];\n \n Runnable cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n \tif (c.equals(\"name\"))\n cb = new Runnable() { public void run() { cbName(); } };\n else if (c.equals(\"version\")) \n cb = new Runnable() { public void run() { cbVersion(); } };\n else if (c.equals(\"genmove\")) \n cb = new Runnable() { public void run() { cbGenMove(); } };\n else if (c.equals(\"all_legal_moves\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"get_absorb_group\"))\n cb = new Runnable() { public void run() { cbGetAbsorbGroup(); } };\n \n \telse if (c.equals(\"shortest_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \telse if (c.equals(\"shortest_vc_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"compute_dead_cells\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build-incremental\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n \n \n else if (c.equals(\"solver-find-winning\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } }; \n \n else if (c.equals(\"find_sealed\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"strengthen_vcs\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n \n else if (c.equals(\"book-depths\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-sizes\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-scores\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \telse if (c.equals(\"book-priorities\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"db-get\")) \n cb = new Runnable() { public void run() { cbDBGet(); } };\n \n else if (c.equals(\"vc-connected-to\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-between-cells\"))\n cb = new Runnable() { public void run() { cbBetweenCells(); } };\n else if (c.equals(\"vc-get-mustplay\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-intersection\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-union\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"eval_twod\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"eval_resist\")) \n cb = new Runnable() { public void run() { cbEvalResist(); } };\n else if (c.equals(\"eval_resist_delta\")) \n cb = new Runnable() { public void run() { cbEvalResistDelta(); } };\n \telse if (c.equals(\"eval_influence\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"mohex-show-rollout\")) \n cb = new Runnable() { public void run() { cbMohexShowRollout(); } };\n else if (c.equals(\"quit\")) \n cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n sendCommand(cmd, cb);\n }", "protected abstract void execute(INPUT input);", "public String userCommand(){\n return scanner.nextLine();\n }", "public void processCommand(String line) {\n\t\ttry {\n\t\t\tString[] command = line.replaceAll(\"[$]\", \"\").split(\" \");\n\t\t\tif (command[0].equals(\"Add\") && command.length == 4) {\n\t\t\t\tadd(command[1], command[2], Integer.valueOf(command[3]));\n\t\t\t} else if (command[0].equals(\"Charge\") && command.length == 3) {\n\t\t\t\tcharge(command[1], Integer.valueOf(command[2]));\n\t\t\t} else if (command[0].equals(\"Credit\") && command.length == 3) {\n\t\t\t\tcredit(command[1], Integer.valueOf(command[2]));\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "abstract protected String performAction(String input);", "public static AbstractCommand getFromLine(FtpSession session, String line) {\r\n \t\tFtpCommandCode ftpCommandCode = null;\r\n \t\tif (line == null) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t\tline = \"\";\r\n \t\t}\r\n \t\tString command = null;\r\n \t\tString arg = null;\r\n \t\tif (line.indexOf(' ') == -1) {\r\n \t\t\tcommand = line;\r\n \t\t\targ = null;\r\n \t\t} else {\r\n \t\t\tcommand = line.substring(0, line.indexOf(' '));\r\n \t\t\targ = line.substring(line.indexOf(' ')+1);\r\n \t\t\tif (arg.length() == 0) {\r\n \t\t\t\targ = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\tString COMMAND = command.toUpperCase();\r\n \t\ttry {\r\n \t\t\tftpCommandCode = FtpCommandCode.valueOf(COMMAND);\r\n \t\t} catch (IllegalArgumentException e) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t}\r\n \t\tAbstractCommand abstractCommand;\r\n \t\ttry {\r\n \t\t\tabstractCommand = (AbstractCommand) ftpCommandCode.command.newInstance();\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t} catch (IllegalAccessException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t}\r\n \t\tabstractCommand.setArgs(session, COMMAND, arg, ftpCommandCode);\r\n \t\treturn abstractCommand;\r\n \t}", "public static void ircInput(String directive, String msg) {\n\n String fullMessage;\n if (directive == \"MSG\"){\n fullMessage = \"PRIVMSG \" + chatRoom + \" :\"+ msg;\n //System.out.println(\"<-localhost@ \" + you.getPref(\"NICK\") +\"$ \"+ fullMessage);\n }else if(directive == \"NICK\") {\n fullMessage = directive +\" :\"+ msg;\n } else {\n fullMessage = directive +\" \"+ msg;\n }\n\n socketOutput.print(fullMessage + \"\\r\\n\");\n socketOutput.flush();\n }", "public static void main(String[] args) throws MqttException {\n try {\n mqttClient = Communication.connect(PUBLISHER_ID );\n } catch (MqttException e) {\n e.printStackTrace();\n }\n // args[0] is the file name\n // args[1] is the drone type : airdrone or landdrone\n // args[2] is the drone name\n\n if (args.length > 1 && (args[0].equals(\"airdrone\") | args[0].equals(\"landdrone\" ))) {\n DroneType = args[0];\n DroneName = args[1];\n\n delegateMissionRequest(DroneType, DroneName);\n\n } else {\n System.out.println(\" Specify existing drone to assign mission to \");\n\n }\n\n}", "public static void parseUserCommand(String userCommand) throws FileNotFoundException {\n ArrayList<String> commandTokens = new ArrayList<String>(Arrays.asList(userCommand.split(\" \")));\n\n\n\t\t/*\n\t\t* This switch handles a very small list of hardcoded commands of known syntax.\n\t\t* You will want to rewrite this method to interpret more complex commands.\n\t\t*/\n switch (commandTokens.get(0)) {\n case \"select\":\n parseQueryString(userCommand);\n break;\n case \"drop\":\n System.out.println(\"STUB: Calling your method to drop items\");\n dropTable(userCommand);\n break;\n case \"create\":\n parseCreateString(userCommand, false);\n break;\n case \"insert\":\n parseInsertString(userCommand);\n break;\n case \"help\":\n help();\n break;\n case \"version\":\n displayVersion();\n break;\n case \"exit\":\n isExit = true;\n break;\n case \"quit\":\n isExit = true;\n default:\n System.out.println(\"I didn't understand the command: \\\"\" + userCommand + \"\\\"\");\n break;\n }\n }", "private void submitInput(String txt){\n switch(inputType){\n case MAZE:\n loadMaze(txt);\n break;\n case LROUTE:\n loadRoute(txt);\n break;\n case SROUTE:\n saveRoute(txt);\n break;\n }\n }", "public void mainCommands() {\n\t\tint inputId = taskController.getInt(\"Please input the number of your option: \", \"You must input an integer!\");\n\t\tswitch (inputId) {\n\t\tcase 1:\n\t\t\tthis.taskController.showTaskByTime();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tthis.taskController.filterAProject();\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tthis.taskController.addTask();\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tthis.taskController.EditTask();\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tthis.taskController.removeTask();\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tSystem.out.println(\"Thank you for coming, Bye!\");\n\t\t\tthis.exit = true;\n\t\t\t// save the task list before exit all the time.\n\t\t\tthis.taskController.saveTaskList();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"This is not a valid option, please input 1 ~ 7.\");\n\t\t\tbreak;\n\t\t}\n\n\t}", "public final void mT__54() throws RecognitionException {\n try {\n int _type = T__54;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:54:7: ( 'FTP' )\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:54:9: 'FTP'\n {\n match(\"FTP\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public static void main(String[] args) throws IOException {\n\t\tSftpAuthenticator auth = new SftpAuthenticator();\n\t\tMap<String, String> props = new HashMap<String, String>();\n\t\tdo {\n\t\t\tprops.clear();\n\t\t\tfor (RequiredInputField input : auth.getRequiredInputFields()) {\n\t\t\t\tSystem.out.print(\"Enter \" + input.getName() + \": \");\n\t\t\t\tString entered = readLine();\n\t\t\t\tswitch (input.getType()) {\n\t\t\t\tcase Bool:\n\t\t\t\t\tBoolean.parseBoolean(entered);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Number:\n\t\t\t\t\tInteger.parseInt(entered);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tprops.put(input.getName(), entered);\n\t\t\t}\n\t\t} while (!auth.isValid(props));\n\t\tauth.authorize(props);\n\n\t\tfor (Map.Entry<String, String> entry : props.entrySet()) {\n\t\t\tSystem.out.println(entry.getKey() + \": \" + entry.getValue());\n\t\t}\n\t\tProperties tmp = new Properties();\n\t\ttmp.putAll(props);\n\t\ttmp.store(new FileWriter(new File(\"auth.props\")), null);\n\t}", "public void CRUDOperation() {\n\t\tCRUD: while (true) {\n\n\t\t\tprintCRUDDoctorOption();\n\t\t\tScanner sc = new Scanner(System.in);\n\n\t\t\tString input = sc.nextLine();\n\n\t\t\tswitch (input) {\n\n\t\t\tcase \"1\":\n\t\t\t\tthis.insertDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"2\":\n\t\t\t\tthis.listDoctors();\n\t\t\t\tbreak;\n\n\t\t\tcase \"3\":\n\t\t\t\tthis.updateDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"4\":\n\t\t\t\tthis.deleteDoctor();\n\t\t\t\tbreak;\n\n\t\t\tcase \"5\":\n\t\t\t\tbreak CRUD;\n\n\t\t\tdefault:\n\t\t\t\tlogger.info(\"Invalid Input!\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}", "public static String parser(String input) throws IOException{\n\t\tif (input == null)\n\t\t\treturn \"Null input!\";\n\t\t\n\t\telse if (input.startsWith(\"HTTPClient \")){\n\t\t\tinput = input.replace(\"HTTPClient \", \"\"); // Cut HTTPClient of the string so we can handle the command more easily.\n\t\t\t\t\t\t\n\t\t\tif(\"exit\".equals(input))\n\t\t\t\treturn EXIT();\n\t\t\t\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tString[] splitted = input.split(\"\\\\s+\"); // Split around spaces\n\t\t\t\tString command = splitted[0];\n\t\t\t\tString uri = splitted[1];\n\t\t\t\tint port = Integer.parseInt(splitted[2]);\n\t\t\t\tSystem.out.println(uri);\n\t\t\t\tSystem.out.println(port);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (command.startsWith(\"HEAD\")){\n\t\t\t\t\treturn HEAD(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"GET\")){\n\t\t\t\t\treturn GET(uri, port);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (command.startsWith(\"PUT\")){\n\t\t\t\t\treturn PUT(uri, port);\n\t\t\t\t}\n\t\t\t\n\t\t\t\telse if (command.startsWith(\"POST\")){ \n\t\t\t\t\treturn POST(uri, port);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "private void linkButtonActionPerformed(ActionEvent evt) {\n\t\ttry {\n\t\t\tString server = serverTextField.getText();\n\t\t\tif(server == null)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tString portStr = portTextField.getText();\n\t\t\tif(portStr == null)\n\t\t\t{\n\t\t\t\tportStr = \"21\";\n\t\t\t}\n\t\t\tint port = Integer.parseInt(portStr.trim());\n\t\t\tuserStr = userTextField.getText();\n\t\t\tif(userStr.equals(\"\") && checkBoxes.isSelected())\n\t\t\t{\n\t\t\t\tuserStr = \"Anonymous\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tuserStr = userStr.trim();\n\t\t\t}\n\t\t\tpassStr = passField.getText();\n\t\t\tif(passStr.equals(\"\") && checkBoxes.isSelected())\n\t\t\t{\n\t\t\t\tpassStr = \"331\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpassStr = passStr.trim();\n\t\t\t}\n\t\t\tcutLinkButton.doClick();\n\t\t\tftpClient = new FTPClient();\n\t\t\t\n\t\t\t/*还没写完。。。。。。。。。。*/\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static String KeyboardScan(){\n\n System.out.println(\"Enter a command : \");\n Scanner sc = new Scanner(System.in);\n String command = sc.next().toLowerCase();\n if(command.equals(\"help\") || command.equals(\"exit\") || command.equals(\"adduser\") || command.equals(\"edituser\") || command.equals(\"removeuser\") || command.equals(\"listusers\") || command.equals(\"addcar\") || command.equals(\"editcar\") || command.equals(\"removecar\") || command.equals(\"listcars\") || command.equals(\"rentcar\") || command.equals(\"returncar\") || command.equals(\"listrents\") || command.equals(\"saveusers\") || command.equals(\"restoreusers\") || command.equals(\"serialusers\" )|| command.equals(\"saverents\") || command.equals(\"loadrents\") || command.equals(\"savecars\") || command.equals(\"loadcars\") || command.equals(\"saveall\") || command.equals(\"loadall\")) {\n return command;\n } else {\n return \"error\";\n }\n\n }", "public FTPFile parseFTPEntry(String entry) {\n\t\t// one block in VMS equals 512 bytes\n\t\tlong longBlock = 512;\n\n\t\tif (matches(entry)) {\n\t\t\tFTPFile f = new FTPFile();\n\t\t\tf.setRawListing(entry);\n\t\t\tString name = group(1);\n\t\t\tString size = group(2);\n\t\t\tString datestr = group(3) + \" \" + group(4);\n\t\t\tString owner = group(5);\n\t\t\tString permissions[] = new String[3];\n\t\t\tpermissions[0] = group(9);\n\t\t\tpermissions[1] = group(10);\n\t\t\tpermissions[2] = group(11);\n\t\t\ttry {\n\t\t\t\tf.setTimestamp(super.parseTimestamp(datestr));\n\t\t\t}\n\t\t\tcatch (ParseException e) {\n\t\t\t\t// intentionally do nothing\n\t\t\t}\n\n\t\t\tString grp;\n\t\t\tString user;\n\t\t\tStringTokenizer t = new StringTokenizer(owner, \",\");\n\t\t\tswitch (t.countTokens()) {\n\t\t\tcase 1:\n\t\t\t\tgrp = null;\n\t\t\t\tuser = t.nextToken();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tgrp = t.nextToken();\n\t\t\t\tuser = t.nextToken();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tgrp = null;\n\t\t\t\tuser = null;\n\t\t\t}\n\n\t\t\tif (name.lastIndexOf(\".DIR\") != -1) {\n\t\t\t\tf.setType(FTPFile.DIRECTORY_TYPE);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tf.setType(FTPFile.FILE_TYPE);\n\t\t\t}\n\t\t\t// set FTPFile name\n\t\t\t// Check also for versions to be returned or not\n\t\t\tif (isVersioning()) {\n\t\t\t\tf.setName(name);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tname = name.substring(0, name.lastIndexOf(\";\"));\n\t\t\t\tf.setName(name);\n\t\t\t}\n\t\t\t// size is retreived in blocks and needs to be put in bytes\n\t\t\t// for us humans and added to the FTPFile array\n\t\t\tlong sizeInBytes = Long.parseLong(size) * longBlock;\n\t\t\tf.setSize(sizeInBytes);\n\n\t\t\tf.setGroup(grp);\n\t\t\tf.setUser(user);\n\t\t\t// set group and owner\n\n\t\t\t// Set file permission.\n\t\t\t// VMS has (SYSTEM,OWNER,GROUP,WORLD) users that can contain\n\t\t\t// R (read) W (write) E (execute) D (delete)\n\n\t\t\t// iterate for OWNER GROUP WORLD permissions\n\t\t\tfor (int access = 0; access < 3; access++) {\n\t\t\t\tString permission = permissions[access];\n\n\t\t\t\tf.setPermission(access, FTPFile.READ_PERMISSION, permission.indexOf('R') >= 0);\n\t\t\t\tf.setPermission(access, FTPFile.WRITE_PERMISSION, permission.indexOf('W') >= 0);\n\t\t\t\tf.setPermission(access, FTPFile.EXECUTE_PERMISSION, permission.indexOf('E') >= 0);\n\t\t\t}\n\n\t\t\treturn f;\n\t\t}\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\tString str = \"\";\n\t\t\n\t\tScanner input = new Scanner(System.in);\n\t\n\t\tSystem.out.println(\"Enter a string \");\n\t\tstr = input.next();\n\t\tbackwardChars(str);\n\t\tinput.close();\n\t\t\t\n\t}", "@Override\r\n\tpublic String execute(File workingDir, String stdin) {\r\n\t\tboolean checkCase = true;\r\n\t\tint skippedFieldCount = 0;\r\n\t\tArrayList<String> operands = new ArrayList<String>();\r\n\r\n\t\tif (args == null) {\r\n\t\t\treturn getUnique(checkCase, stdin);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < args.length; i++) {\r\n\t\t\tString arg = args[i];\r\n\r\n\t\t\t// Check for extra operands\r\n\t\t\tif (operands.size() >= 2) {\r\n\t\t\t\tsetStatusCode(ERR_CODE_EXTRA_OPERAND);\r\n\t\t\t\treturn String.format(ERR_MSG_EXTRA_OPERAND, arg);\r\n\t\t\t}\r\n\r\n\t\t\t// Check for valid file\r\n\t\t\tif (!arg.startsWith(\"-\")) {\r\n\t\t\t\tFile file = new File(arg);\r\n\r\n\t\t\t\t// Check if filePath is relative to working dir (i.e. not absolute path)\r\n\t\t\t\t// If it is we make the file relative to working dir.\r\n\t\t\t\tif (!file.isAbsolute() && workingDir.exists()) {\r\n\t\t\t\t\tfile = new File(workingDir, arg);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (operands.size() == 0 && !file.exists()) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_FILE_NOT_FOUND);\r\n\t\t\t\t\treturn String.format(ERR_MSG_FILE_NOT_FOUND, arg);\r\n\t\t\t\t}\r\n\t\t\t\toperands.add(file.toString());\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for stdin argument\r\n\t\t\tif (arg.equals(\"-\")) {\r\n\t\t\t\toperands.add(arg);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Option argument\r\n\t\t\tswitch (arg) {\r\n\t\t\tcase \"-i\":\r\n\t\t\t\tcheckCase = true;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-f\":\r\n\t\t\t\tif (i + 1 >= args.length) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_MISSING_OPTION_ARG);\r\n\t\t\t\t\treturn String.format(ERR_MSG_MISSING_OPTION_ARG, arg);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ti += 1;\r\n\t\t\t\targ = args[i];\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tskippedFieldCount = Integer.parseInt(arg);\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\tsetStatusCode(ERR_CODE_INVALID_NUM_OF_FIELDS);\r\n\t\t\t\t\treturn String.format(ERR_MSG_INVALID_NUM_OF_FIELDS, arg);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"-help\":\r\n\t\t\t\treturn getHelp();\r\n\t\t\tdefault:\r\n\t\t\t\tsetStatusCode(ERR_CODE_INVALID_OPTION);\r\n\t\t\t\treturn String.format(ERR_MSG_INVALID_OPTION, arg);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString input;\r\n\t\tif (operands.size() == 0 || operands.get(0).equals(\"-\")) {\r\n\t\t\tinput = stdin;\r\n\t\t} else {\r\n\t\t\tinput = readFile(operands.get(0), Charset.forName(\"UTF8\"));\r\n\t\t}\r\n\r\n\t\tString output;\r\n\t\tif (skippedFieldCount == 0) {\r\n\t\t\toutput = getUnique(checkCase, input);\r\n\t\t} else {\r\n\t\t\toutput = getUniqueSkipNum(skippedFieldCount, checkCase, input);\r\n\t\t}\r\n\r\n\t\t// Check if the user specify an output file\r\n\t\tif (operands.size() > 1) {\r\n\t\t\tString outputFilePath = operands.get(1);\r\n\r\n\t\t\tif (!outputFilePath.equals(\"-\")) {\r\n\t\t\t\t// Output is redirected to file\r\n\t\t\t\twriteToFile(outputFilePath, output);\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}", "public interface IFuzzyCommand {\n\t\n\t/**\n\t * Run the command on the given fuzzy engine\n\t * @param engine a fuzzy engine\n\t * @throws FuzzyEngineException in case of errors\n\t */\n\tpublic void run(FuzzyEngine engine) throws FuzzyEngineException;\n\n}", "protected String processCommand(String command)\n {\n switch (command)\n {\n case \"HELLO\":\n return \"h\";\n case \"MOVE N\":\n return \"mn\";\n case \"MOVE S\":\n return \"ms\";\n case \"MOVE E\":\n return \"me\";\n case \"MOVE W\":\n return \"mw\";\n case \"PICKUP\":\n return \"p\";\n case \"LOOK\":\n return \"l\";\n case \"QUIT\":\n return \"q\";\n default:\n return \"i\";\n }\n }", "private static void taskProcess(String input)\r\n\t{\r\n\t\tswitch (input.toUpperCase())\r\n\t\t{\r\n\t\t\tcase CREATE:\r\n\t\t\t{\r\n\t\t\t\tPostTaskService postTask = new PostTaskService();\r\n\t\t\t\tpostTask.createTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase GET:\r\n\t\t\t{\r\n\t\t\t\tGetTaskService getTask = new GetTaskService();\r\n\t\t\t\tList<Task> taskList = getTask.getAllTasks();\r\n\t\t\t\tTaskSchedulerUtil.getInstance().printTasks(taskList);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase START:\r\n\t\t\t{\r\n\t\t\t\tStartTaskService startTask = new StartTaskService();\r\n\t\t\t\tstartTask.startTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase END:\r\n\t\t\t{\r\n\t\t\t\tEndTaskService endTask = new EndTaskService();\r\n\t\t\t\tendTask.endTask();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void sendReceive(){\r\n\r\n String remotePath=\"Batch\\\\Export\\\\\" + DAL.getStoreID();\r\n String localPath=\"Batch\\\\Import\\\\\";\r\n String filename=\"\";\r\n File dir;\r\n String[] children;//list of files at local\r\n\r\n CustomFtpClient ftpClient = new CustomFtpClient();\r\n try {\r\n //1---------- connect Ftp\r\n//System.out.println(DAL.getStoreID()+\" \"+DAL.getFtpServer()+\" \"+DAL.getFtpUser()+\" \"+DAL.getFtpPassword());\r\n ftpClient.openServer(DAL.getFtpServer());\r\n ftpClient.login(DAL.getFtpUser(), DAL.getFtpPassword());\r\n ftpClient.cd(remotePath);\r\n ftpClient.binary();\r\n\r\n //2---------- copy from SIM Export to POS Export\r\n StringBuffer pathList = new StringBuffer();\r\n InputStream is = ftpClient.list();\r\n int c;\r\n\r\n //read all file and directory at remote\r\n while ( (c = is.read()) != -1) {\r\n String s = (new Character( (char) c)).toString();\r\n pathList.append(s);\r\n }\r\n\r\n StringTokenizer st = new StringTokenizer(pathList.toString(),\"\\r\\n\");\r\n //get file from SIM Export\r\n while (st.hasMoreTokens()){\r\n filename=st.nextToken().substring(55);\r\n if(filename.indexOf(\".txt\")!=-1){\r\n is = ftpClient.get(filename);\r\n File file_out = new File(localPath + filename);\r\n FileOutputStream os = new\r\n FileOutputStream(file_out);\r\n byte[] bytes = new byte[1024];\r\n\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n //3--------- delete SIM Export\r\n ftpClient.delete(filename);\r\n }\r\n }\r\n\r\n //4--------- copy POS Import to SIM Backup\r\n remotePath=\"..\\\\..\\\\..\\\\Batch\\\\Backup\\\\Export\";\r\n localPath=\"Batch\\\\Import\\\\\";\r\n\r\n ftpClient.cd(remotePath);\r\n\r\n //get list of file\r\n dir = new File(localPath);\r\n children = dir.list();\r\n if (children != null) {\r\n for (int i = 0; i < children.length; i++) {\r\n // Get filename of file or directory\r\n filename = children[i];\r\n TelnetOutputStream os = ftpClient.put(filename);\r\n File file_in = new File(localPath + filename);\r\n is = new FileInputStream(file_in);\r\n byte[] bytes = new byte[1024];\r\n\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n }\r\n }\r\n\r\n //5--------- copy from POS Export to SIM Import\r\n remotePath=\"..\\\\..\\\\..\\\\Batch\\\\Import\";\r\n localPath=\"Batch\\\\Export\\\\\";\r\n ftpClient.cd(remotePath);\r\n\r\n //get list of file\r\n dir = new File(localPath);\r\n children = dir.list();\r\n if (children != null) {\r\n for (int i = 0; i < children.length; i++) {\r\n // Get filename of file or directory\r\n filename = children[i];\r\n TelnetOutputStream os = ftpClient.put(filename);\r\n File file_in = new File(filename);\r\n is = new FileInputStream(localPath + file_in);\r\n byte[] bytes = new byte[1024];\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n }\r\n }\r\n\r\n //---------- close ftp\r\n ftpClient.closeServer();\r\n }\r\n catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }" ]
[ "0.6753235", "0.61266696", "0.6102813", "0.58472216", "0.5789162", "0.57557034", "0.56441265", "0.5606026", "0.5592744", "0.55157906", "0.5509956", "0.54875416", "0.5457425", "0.5376909", "0.53123456", "0.53073376", "0.53058606", "0.5214858", "0.52125907", "0.5200604", "0.51999915", "0.5147811", "0.5128423", "0.5080197", "0.5079926", "0.5079489", "0.5076621", "0.5076329", "0.50697", "0.5058892", "0.505093", "0.5044544", "0.50235474", "0.50090146", "0.4960861", "0.49288273", "0.49255055", "0.4918043", "0.49109125", "0.4900536", "0.4896515", "0.487754", "0.48750767", "0.48748642", "0.48707345", "0.48632857", "0.4860743", "0.4860743", "0.4860743", "0.4860743", "0.4848485", "0.4846264", "0.48421985", "0.48158637", "0.48150566", "0.48135963", "0.48108247", "0.4805927", "0.48049754", "0.4804922", "0.48043934", "0.47998914", "0.47984082", "0.47937685", "0.47842404", "0.47827098", "0.47716656", "0.4769525", "0.4768656", "0.47654018", "0.47631145", "0.47604805", "0.47452775", "0.47406933", "0.47313583", "0.47247455", "0.47235253", "0.4723187", "0.4713857", "0.47046626", "0.47009137", "0.46877614", "0.468545", "0.46850374", "0.46835676", "0.46788523", "0.4678199", "0.46772435", "0.46731514", "0.46729", "0.46709606", "0.46707574", "0.46706998", "0.466743", "0.46662313", "0.46629384", "0.46622965", "0.46512663", "0.46486294", "0.46474388", "0.46438244" ]
0.0
-1
/ check whether command needs extra data connection; return true if it does, otherwise false
public boolean specialCommand(String userinput){ return (userinput.equals("get")) || (userinput.equals("dir")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean isDataConnectionAsDesired();", "boolean hasCommand();", "boolean hasCommand();", "public boolean hasCommand() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasCommand() {\n return ((bitField0_ & 0x00000004) == 0x00000004);\n }", "public boolean hasCommand() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasCommand() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private boolean canSend() {\n\n if (StringUtils.isEmpty(constructedCommand())) return false;\n\n int beginIndex = constructedCommand()\n .indexOf(serialProperties.getCmdBeginMarker());\n int endIndex = constructedCommand()\n .indexOf(serialProperties.getCmdEndMarker());\n\n return beginIndex != -1 && endIndex != -1 && beginIndex < endIndex;\n }", "public boolean hasCommand() {\n return this.command != null;\n }", "boolean needSeparateConnectionForDdl();", "boolean hasData()\n {\n logger.info(\"server: \" + server + \" addr: \" + addr + \"text:\" + text);\n return server != null && addr != null && text != null;\n }", "public boolean checkConnection() {\n\treturn getBoolean(ATTR_CONNECTION, false);\n }", "private boolean isComplete() {\n return redisCommand != null && redisCommand.getAction() != null && !\"\".equals(redisCommand.getAction().trim()) && redisCommand.getArgList().size() == argSize - 1;\n }", "public boolean hasMoreCommands(){\r\n\t\t/*\r\n\t\tif (nextCommand != null)\r\n\t\t\treturn true;\r\n\t\telse return false;\r\n\t\t*/\r\n\t\treturn (tokenizer.ttype != StreamTokenizer.TT_EOF);\r\n\t}", "public boolean hasMoreCommands() {\r\n return in.hasNextLine();\r\n }", "boolean hasConnProps();", "@Override\npublic boolean hasCommands() {\n\treturn false;\n}", "boolean hasExecBroker();", "public final boolean isNeedParseeErrorMsg() {\r\n return getCommand() == 10;\r\n }", "public boolean isDataAvailable(){return true;}", "boolean hasServiceCmd();", "protected boolean isCommandExecuting() {\n // long start = System.nanoTime();\n // boolean inCommand = false;\n // for (StackTraceElement e : Thread.currentThread().getStackTrace()) {\n // if (e.getMethodName().equals(\"handleCommand\")) {\n // inCommand = true;\n // break;\n // }\n // }\n // long now = System.nanoTime();\n // double elapsedMillis = (now - start) * 1e-6;\n // getLogger().info(\"handleCommand: \" + inCommand + \" elapsed ms: \" +\n // elapsedMillis);\n\n try {\n Field playerCommandState = Bukkit.getServer().getClass().getField(\"playerCommandState\");\n return playerCommandState.getBoolean(Bukkit.getServer());\n } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException ex) {\n getLogger().severe(\"This plugin needs to be updated for the current server (EasyRider.isCommandExecuting()).\");\n return false;\n }\n }", "boolean hasAvailableConnection();", "public boolean hasMoreCommands() {\n return fileStream.hasNext();\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"quit\"))\n wantToQuit = quit(command);\n\n return wantToQuit;\n }", "public boolean areCommandsAllowed()\n {\n return allowCommands;\n }", "public boolean isExternalCommand() {\n Boolean external = KEY_EXTERNAL_OR_FUNCTION.get(this);\n return external != null && external && !isFunctionCall();\n }", "public static boolean isDataconnected(){\n return dataconnected;\n }", "protected boolean onSendExtraCommand(@Nullable String command, @Nullable Bundle extras) {\n return false;\n }", "public boolean isDataAvailable()\r\n {\r\n return true;\r\n }", "public static boolean hasConnection() {\n \t\treturn connPool.getConnectionCount() > 0;\n \t}", "boolean isFetchData();", "public boolean needsConnectionLeftOpen() {\n return false;\n }", "boolean hasData();", "boolean hasData();", "boolean hasData();", "boolean hasData();", "boolean hasData();", "boolean hasData();", "boolean hasData();", "@Override\r\n\tpublic boolean validCommand(CommandStack stack) {\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean canOperate()\n\t{\n\t\treturn s_ctx.isConnected();\n\t}", "@Override\n\tpublic boolean combine(EHICommand anotherCommand) {\n\t\treturn false;\n\t}", "public boolean satisfiesMinimumDoneCommandLength(String[] command) {\n return (command.length > 1);\n }", "public boolean isEligible() throws Exception {\n Long commandId = getMainEvent().getEligibilityCommandId();\n \n // by default is eligible\n if (commandId == null) {\n return true;\n }\n \n Command cmd = (Command) createEJB(getInitialContext(), Command.class);\n String cmdName = cmd.getCommandDesc(commandId, DBMS.OLTP_DATASOURCE_NAME);\n \n Request r = new Request();\n r.setContentHandle(cmdName);\n \n r.setProperty(\"cr\", String.valueOf(user.getId()));\n r.setProperty(\"eid\", String.valueOf(getEvent().getId()));\n \n Iterator it = new DataAccess(DBMS.OLTP_DATASOURCE_NAME).getData(r).values().iterator();\n \n ResultSetContainer rsc = (ResultSetContainer) it.next();\n \n return !rsc.isEmpty(); \n }", "private boolean managingConnections() {\n\n if (configWrapper.getConfig().getConnectionInfo().getDataSource() == null) {\n return false;\n }\n\n return true;\n\n }", "boolean hasOperation();", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if (commandWord.equals(\"go\")) {\n player.goRoom(command); \n }\n else if (commandWord.equals(\"look\")) { \n player.look();\n }\n else if (commandWord.equals(\"eat\")) {\n player.eat();\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"back\")) {\n player.goBack(); \n }\n else if (commandWord.equals(\"take\")) {\n player.take(command);\n }\n else if (commandWord.equals(\"drop\")) {\n player.drop(command);\n }\n else if (commandWord.equals(\"items\")) {\n player.getItems();\n }\n else if (commandWord.equals(\"equipar\")) {\n player.equipar(command);\n }\n return wantToQuit;\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n if(commandWord == CommandWord.UNKNOWN) {\n Logger.Log(\"I don't know what you mean...\");\n return false;\n }\n \n if (commandWord == CommandWord.HELP) {\n printHelp();\n }\n else if (commandWord == CommandWord.GO) {\n goRoom(command);\n }\n \n else if (commandWord == CommandWord.TAKE) {\n takeItem(command);\n }\n \n else if (commandWord == CommandWord.USE) {\n useItem(command);\n }\n \n else if (commandWord == CommandWord.LOOK) {\n Logger.Log(currentRoom.getLongDescription());\n }\n \n else if (commandWord == CommandWord.VIEW) {\n viewPlayer(command);\n }\n \n else if (commandWord == CommandWord.QUIT) {\n wantToQuit = quit(command);\n }\n // else command not recognised.\n return wantToQuit;\n }", "public boolean testConnection() {\r\n boolean toReturn = true;\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"ping\", SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n SocketMessage response = handleMessage(request);\r\n if (isSuccessful(response)) {\r\n toReturn = true;\r\n } else {\r\n toReturn = false;\r\n }\r\n\r\n return toReturn;\r\n }", "public static boolean isSpecialCommand(FtpCommandCode command) {\r\n \t\treturn ((command == QUIT) || (command == ABOR) || (command == NOOP) || (command == STAT));\r\n \t}", "private boolean addChecksumStateCommand() {\n // assume that caller has checked that command array is large enough\n commands[commandCount++] = checksumState();\n commands[commandCount++] = Command.CHECKSUM;\n return true;\n }", "public boolean canCommandSenderUseCommand(int p_70003_1_, String p_70003_2_)\n {\n return true;\n }", "private boolean isConnected() {\n\t\treturn (this.serverConnection!=null); \n }", "public abstract boolean doCommand() throws Exception;", "boolean isDataConnectionAsDesired() {\n boolean roaming = phone.getServiceState().getRoaming();\n\n if (phone.mSIMRecords.getRecordsLoaded() &&\n phone.mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&\n (!roaming || getDataOnRoamingEnabled()) &&\n !mIsWifiConnected ) {\n return (state == State.CONNECTED);\n }\n return true;\n }", "protected boolean ValidateCommand()\n {\n //Create a new ArrayList object and add the valid commands\n ArrayList<String> validCommands = new ArrayList<>();\n validCommands.add(\"^\");\n validCommands.add(\"$\");\n validCommands.add(\"-\");\n validCommands.add(\"+\");\n validCommands.add(\"a\");\n validCommands.add(\"t\");\n validCommands.add(\"d\");\n validCommands.add(\"l\");\n validCommands.add(\"n\");\n validCommands.add(\"p\");\n validCommands.add(\"q\");\n validCommands.add(\"w\");\n validCommands.add(\"x\");\n validCommands.add(\"=\");\n validCommands.add(\"#\");\n validCommands.add(\"c\");\n validCommands.add(\"v\");\n validCommands.add(\"s\");\n validCommands.add(\"b\");\n \n //Check if the inserted command is valid\n return validCommands.contains(this.Command);\n }", "private void isCommandInstance() throws SystemException {\r\n\t\tif (commandInstance != null) return;\r\n\t\tif (commandResponder != null) SystemException.softwareProblem(\"This was not a command instance. There is a bug. Either the super for the command is not well formed or it called a method it shouldn't.\");\r\n\t\tinstantiateCommand();\r\n\t}", "public boolean isCommand()\n {\n return aCommands.containsKey(this);\n }", "private boolean isConnect(ConnectionSpec connectionSpec) {\r\n\t\tif (connectionSpec == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tJRedis jredis = new JRedisClient(connectionSpec.getAddress().getHostAddress(), connectionSpec.getPort());\r\n\t\ttry {\r\n\t\t\tjredis.ping();\r\n\t\t\tjredis.quit();\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "boolean hasSendReading();", "public boolean isNativeConnectionNecessaryForNativePreparedStatements()\r\n/* 21: */ {\r\n/* 22: 72 */ return false;\r\n/* 23: */ }", "private boolean readCommand() {\r\n String s = null;\r\n try {\r\n s = (String) is.readObject();\r\n } \r\n catch (Exception e){ // catch a general exception\r\n \tthis.closeSocket();\r\n return false;\r\n }\r\n System.out.println(\"01. <- Received a String object from the client (\" + s + \").\");\r\n \r\n // At this point there is a valid String object\r\n // invoke the appropriate function based on the command \r\n if (s.equalsIgnoreCase(\"GetDate\")){ \r\n this.getDate(); \r\n } else if (s.equalsIgnoreCase(\"GetTemperature\")) {\r\n \t\r\n \tthis.getTemperature();\r\n \t\r\n }\r\n \r\n else { \r\n this.sendError(\"Invalid command: \" + s); \r\n }\r\n return true;\r\n }", "public boolean hasData();", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n \n case LOOK:\n look();\n break;\n \n case RELAX:\n relax();\n break;\n \n case BACK:\n back();\n break;\n }\n return wantToQuit;\n }", "public boolean checkConnection() {\n\t\ttry {\n\t\t\tif (con.isClosed() || !isAlive) {\n\t\t\t\treturn connect();\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (SQLException e) {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasChatData();", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-03-25 14:24:54.425 -0400\", hash_original_method = \"1FD932A179999665DABCE38CECB75BAA\", hash_generated_method = \"5409B7E260D2EFF5BB62F9C967BABDFF\")\n \n public static boolean reconnectCommand(){\n \tdouble taintDouble = 0;\n \n \treturn ((taintDouble) == 1);\n }", "public boolean canStartConnection(ICreateConnectionContext context) {\n if (getFlowNode(context.getSourceAnchor()) != null) {\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean hasConnProps() {\n return connPropsBuilder_ != null || connProps_ != null;\n }", "@Override\n\tprotected boolean isOkToExecute()\n\t{\n\n\t\tif((super.isOkToExecute())\n\t\t\t&& isColumAvailable(IPersistentObject.R_OBJECT_ID))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\tMessageView.getInstance().addMessage(\n\t\t\tConnectionView.getInstance().getSelectedConnection().getTag()\n\t\t\t\t+ \" No '\" + IPersistentObject.R_OBJECT_ID //$NON-NLS-1$\n\t\t\t\t+ \"' column found.\"); //$NON-NLS-1$\n\t\treturn false;\n\t}", "boolean hasActionCommand();", "public boolean dataIsReady()\n {\n boolean[] status = m_receiver.getBufferStatus();\n if (status.length == 0)\n {\n return false;\n }\n for (boolean b : status)\n {\n if (!b)\n return false;\n }\n return true;\n }", "private boolean isConnected() {\n try {\n return (conn != null) && conn.isValid(0);\n } catch (SQLException ex) {\n Logger.getLogger(DB.class.getName()).log(Level.SEVERE, null, ex);\n }\n return false;\n }", "final boolean checkAlive() {\r\n\t\t\r\n\t\tif (this.conn == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = null;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (--this.loops < 0 || this.date < System.currentTimeMillis()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = null;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif (this.databaseType == ConnectionHolder.DT_UNKNOWN) {\r\n\t\t\t\tthis.databaseType = this.conn.getMetaData().getDatabaseProductName().toUpperCase().indexOf(\"ORACLE\") == -1\r\n\t\t\t\t\t? ConnectionHolder.DT_NORMAL\r\n\t\t\t\t\t: ConnectionHolder.DT_ORACLE;\r\n\t\t\t}\r\n\t\t\ttry (final Statement st = this.conn.createStatement()) {\r\n\t\t\t\t/** Do not use it here, may be unsupported? */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.setQueryTimeout(10);\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tst.execute(\r\n\t\t\t\t\t\tthis.databaseType == ConnectionHolder.DT_ORACLE\r\n\t\t\t\t\t\t\t? \"SELECT 5 FROM DUAL\"\r\n\t\t\t\t\t\t\t: \"SELECT 5\");\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} catch (final SQLException e) {\r\n\t\t\tif (this.conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = null;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private boolean isThereMoreData() {\n return nextUrl != null;\n }", "private boolean readCommand() {\n\n\t\ttry {\n\t\t\ttab = (String[]) is.readObject();\n\t\t} \n\t\tcatch (Exception e){ // catch a general exception\n\t\t\tthis.closeSocket();\n\t\t\treturn false;\n\t\t}\n\t\tSystem.out.println(\"01. <- Received a String object from the client (\" + tab + \").\");\n\n\t\t// At this point there is a valid String object\n\t\t// invoke the appropriate function based on the command \n\n\t\tString s=tab[0];\n\n\t\t// Connexion of the Client to the Server\n\t\tif (s.equalsIgnoreCase(\"connexion\")){ \n\t\t\tthis.connexion(); \n\t\t} \n\n\t\t// Case of Send New Message\n\t\tif (s.equalsIgnoreCase(\"remplirTabNewMess\")){\n\t\t\tthis.remplirTabNewMess();\n\t\t}\n\n\t\t// Recuperation of all messages\n\t\tif (s.equalsIgnoreCase(\"RecupArray\")){\n\t\t\tthis.RecupArray();\n\t\t}\n\n\n\t\treturn true;\n\t}", "@java.lang.Override\n public boolean hasOperation() {\n return operation_ != null;\n }", "@Override\n\tpublic boolean hasOperation() {\n\t\treturn false;\n\t}", "public boolean hasExecBroker() {\n return ((bitField0_ & 0x00000200) == 0x00000200);\n }", "public boolean hasExecBroker() {\n return ((bitField0_ & 0x00000200) == 0x00000200);\n }", "private boolean _autoGet() throws SessionException\n {\n if (this._argTable.get(CMD.PUSH) != null)\n return this._autoGetPush();\n else if (this._argTable.get(CMD.QUERY) != null)\n return this._autoGetQuery();\n else \n return this._autoGetPull();\n }", "@Override\r\n\tpublic boolean isReady() {\n\t\tResultSetDTO dto = mongoManager.fetchAndUpdateAvailableToRead(previousCollectionName);\r\n\t\t\r\n\t\tlogger.info(\"ready to start a new transaction? : [\"+(dto.isNotEmpty()?\"Yes\":\"No\")+\"], fetch size : \"+dto.getBatchRowsSize());\r\n\t\tif(dto.isNotEmpty()){\r\n\t\t\t\r\n\t\t\tnextBatchRows = dto.getBatchRows();\r\n\t\t\tcollectionName = dto.getCollectionName();\r\n\t\t\tpreviousCollectionName = collectionName;\r\n//\t\t\tlong idletime = 1 * 1000;\r\n//\t\t\tlogger.info(\"sleeping(has data)... idle time:\"+idletime+\" ms\");\r\n//\t\t\tUtils.sleep(idletime);\r\n\t\t\tlogger.debug(\"received data, prepare to sleep for a while...\");\r\n\t\t\tUtil.sleepForawhile(3 * 1000);\r\n\t\t\treturn true;\r\n\t\t} else{ //sleep while there is no data found\r\n\t\t\tlogger.warn(\"no data found, sleeping...\");\r\n\t\t\tUtil.sleepForawhile(6 * 1000);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n//\t\treturn mongoManager.getAvailableToRead(nextRead) > 0;\r\n\t}", "public boolean hasOperation() {\n return operationBuilder_ != null || operation_ != null;\n }", "public boolean isData();", "default boolean onCommand(CommandSender sender, ConnectionCommand connectionCommand) {\n String[] split = connectionCommand.getCommand().split(\" \");\n\n return onCommand(sender, split[0], Arrays.copyOfRange(split, 1, split.length), connectionCommand.getArgs());\n }", "boolean hasData2();", "boolean hasData2();", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) \n {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n //my command expect when i Quit\n case PICK:\n pickItem();\n break;\n \n //drink the redbull\n case DRINK:\n drink();\n break;\n \n //show inventory\n case SHOW:\n showInventory();\n break;\n \n //show objective\n case GOAL:\n remindGoal();\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n }\n return wantToQuit;\n }", "boolean hasDisconnect();", "public boolean hasConnProps() {\n return connProps_ != null;\n }", "protected synchronized boolean updateConnection() \n {\n if (!enabled) \n {\n \td(\"is disabled\");\n return false;\n }\n if (mpd == null) \n {\n \td(\"no MPD! \");\n return false;\n }\n mpdconnection = mpd.getMpdConnection();\n if (mpdconnection == null) \n {\n \td(\"no MPDConnection! \");\n return false;\n }\n if (this.server == null) \n {\n this.server = mpdconnection.getHostAddress().getHostName();\n this.port = mpdconnection.getHostPort();\n this.filesdir = MPD.getApplicationContext().getCacheDir();\n d(\"server \" + server + \" port \" + port + \" dir \" + filesdir);\n if (!load()) \n {\n refresh(true);\n }\n }\n return true;\n }", "protected synchronized boolean updateConnection() {\n\t\tif (!this.mEnabled) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.mMPD == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.mMPD.isConnected()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.mServer == null) {\n\t\t\tthis.mServer = this.mMPD.getHostAddress().getHostName();\n\t\t\tthis.mPort = this.mMPD.getHostPort();\n\t\t\tif (!this.load()) {\n\t\t\t\tthis.refresh(true);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean supportsConnects();", "private boolean checkMsgIntegrity(Connection con, JsonObject json) throws NullPointerException {\n\t\tInvalidMessage response = new InvalidMessage();\n\t\tif (json.get(\"command\") == null) {\n\t\t\tresponse.setInfo(\"No command\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\treturn false;\n\t\t}\n\t\tswitch (json.get(\"command\").getAsString()) {\n\t\tcase LOGIN:\n\t\t\tif (json.get(\"username\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct username\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase REGISTER:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct username or secret\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase AUTHENTICATE:\n\t\t\tif (json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing secret\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase ACTIVITY_MESSAGE:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"activity\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Activity message not complete\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase SERVER_ANNOUNCE:\n\t\t\tif (json.get(\"hostname\").isJsonNull() || json.get(\"port\").isJsonNull() || json.get(\"load\").isJsonNull()\n\t\t\t\t\t|| json.get(\"id\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing correct server info\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase ACTIVITY_BROADCAST:\n\t\t\tif (json.get(\"activity\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"No activity\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_REQUEST:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_ALLOWED:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOCK_DENIED:\n\t\t\tif (json.get(\"username\").isJsonNull() || json.get(\"secret\").isJsonNull()) {\n\t\t\t\tresponse.setInfo(\"Not providing username or secret correctly\");\n\t\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\tcase LOGOUT:\n\t\t\treturn true;\n\t\tcase INVALID_MESSAGE:\n\t\t\tcon.closeCon();\n\t\t\treturn false;\n\t\tdefault:\n\t\t\tresponse.setInfo(\"No such command\");\n\t\t\tcon.writeMsg(response.toJsonString());\n\t\t\tcon.closeCon();\n\t\t\treturn false;\n\t\t}\n\n\t}", "private boolean promptCommand() {}", "@Override\n\tpublic boolean updateCMD(CMD cmd) {\n\t\treturn false;\n\t}", "protected abstract boolean isConnected();", "private boolean isGettingData(){\n int available;\n long startTime = System.nanoTime();\n int timeout = 100;\n InputStream inStream = null;\n flushStream();\n try {\n if(socket!=null)\n inStream = socket.getInputStream();\n Thread.sleep(100); //The Arduino keeps sending data for 100ms after it is told to stop\n }catch(IOException | InterruptedException e){}\n try {\n while (true) {\n available = inStream.available();\n if (available > 0) {\n return true;\n }\n Thread.sleep(1);\n long estimatedTime = System.nanoTime() - startTime;\n long estimatedMillis = TimeUnit.MILLISECONDS.convert(estimatedTime,\n TimeUnit.NANOSECONDS);\n if (estimatedMillis > timeout){\n return false; //timeout, no data coming\n }\n }\n }catch(IOException | InterruptedException | NullPointerException e){\n Log.d(\"Exception\", \"Exception\");\n }\n return false;\n }" ]
[ "0.7299585", "0.6699166", "0.6699166", "0.6552978", "0.6529703", "0.64871585", "0.6470575", "0.6450616", "0.64162356", "0.63374496", "0.62812674", "0.627844", "0.6268275", "0.6172985", "0.61457855", "0.61150604", "0.59633255", "0.5929302", "0.5926193", "0.5920607", "0.59054697", "0.588027", "0.5870455", "0.58536124", "0.58535194", "0.58309203", "0.5827688", "0.5820272", "0.58175945", "0.5783366", "0.5761976", "0.5750571", "0.5737137", "0.57318425", "0.57318425", "0.57318425", "0.57318425", "0.57318425", "0.57318425", "0.57318425", "0.57131964", "0.56993115", "0.56838965", "0.5673834", "0.5669261", "0.56665725", "0.56662834", "0.5665301", "0.5665301", "0.5660632", "0.56546986", "0.56518734", "0.5644292", "0.5643821", "0.56340045", "0.56317526", "0.56306505", "0.56271195", "0.5623038", "0.56225234", "0.56176746", "0.56109154", "0.56092936", "0.56078583", "0.56020427", "0.5599915", "0.5598553", "0.55950785", "0.55941814", "0.55829924", "0.55823696", "0.5574342", "0.55720365", "0.5565245", "0.5564946", "0.5551502", "0.55488056", "0.55375195", "0.5536502", "0.5530385", "0.5521452", "0.55186075", "0.551325", "0.5506809", "0.5506229", "0.5497571", "0.5485211", "0.54845417", "0.54830915", "0.54830915", "0.54795176", "0.5476385", "0.54762894", "0.54736304", "0.547027", "0.54678625", "0.5463315", "0.546024", "0.545933", "0.5446587", "0.5443818" ]
0.0
-1
/ check whether user input belongs to a valid command; return true if it does, otherwise false
public boolean commandExist(String userinput){ return this.map.containsKey(userinput.split(" ")[0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean commands(String userInput) {\n\t\tboolean isCmdValid = false;\n\t\tList<String> validCommands = new ArrayList<>();\n\t\tvalidCommands.add(\"rules\");\n\t\tvalidCommands.add(\"giveall\");\n\t\t\n\t\t// Find if command is valid\n\t\tfor (String cmd: validCommands) {\n\t\t\tif (userInput.equalsIgnoreCase(cmd.trim())) {\n\t\t\t\tisCmdValid = true;\n\t\t\t\t// If cmd valid, execute the command\n\t\t\t\tswitch (validCommands.indexOf(cmd)) {\n\t\t\t\t\n\t\t\t\tcase 0:\n\t\t\t\t\tGameLauncher.showGameRules();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tGameLauncher.giveAll();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isCmdValid;\n\t}", "protected boolean ValidateCommand()\n {\n //Create a new ArrayList object and add the valid commands\n ArrayList<String> validCommands = new ArrayList<>();\n validCommands.add(\"^\");\n validCommands.add(\"$\");\n validCommands.add(\"-\");\n validCommands.add(\"+\");\n validCommands.add(\"a\");\n validCommands.add(\"t\");\n validCommands.add(\"d\");\n validCommands.add(\"l\");\n validCommands.add(\"n\");\n validCommands.add(\"p\");\n validCommands.add(\"q\");\n validCommands.add(\"w\");\n validCommands.add(\"x\");\n validCommands.add(\"=\");\n validCommands.add(\"#\");\n validCommands.add(\"c\");\n validCommands.add(\"v\");\n validCommands.add(\"s\");\n validCommands.add(\"b\");\n \n //Check if the inserted command is valid\n return validCommands.contains(this.Command);\n }", "public boolean isValidCommand(String cmd) {\r\n\t\tboolean isValidCmd = false;\r\n\t\tList validOtherCmd = Arrays.asList(\"MOVE\", \"LEFT\", \"RIGHT\", \"REPORT\");\r\n\r\n\t\tif (validOtherCmd.contains(cmd.toUpperCase())) {\r\n\t\t\tisValidCmd = true;\r\n\t\t}\r\n\r\n\t\tif (isValidPlaceCommand(cmd)) {\r\n\t\t\tisValidCmd = true;\r\n\t\t}\r\n\t\treturn isValidCmd;\r\n\t}", "public boolean isCommandValid(Character character, String command)\n\n {\n\n \n\n if(command.length() > 4 && isKill(command))\n { \n HandleKill(character, command);\n return true;\n }\n if(isPossess(command))\n {\n HandlePossess(character);\n return true;\n }\n if(isDontPossess(command))\n {\n HandleDontPossess(character);\n return true;\n }\n if(isJump(command))\n\n {\n\n HandleJump();\n\n return true;\n\n }\n\n if(isSit(command))\n\n {\n\n HandleSit();\n\n return true;\n\n }\n\n if(isSing(command))\n\n {\n\n HandleSing();\n\n return true;\n\n }\n\n if(isDance(command))\n\n {\n\n HandleDance();\n\n return true;\n\n }\n\n if(isDirections(command))\n\n {\n\n HandleDirections(character.currentArea);\n\n return true;\n\n }\n\n if(isExit(command))\n\n {\n\n HandleExit();\n\n return true;\n\n }\n \n if(isHeal(command))\n\n {\n\n HandleHeal(character);\n\n return true;\n\n }\n\n if(isStats(command))\n\n {\n\n HandleStats(character);\n\n return true;\n\n }\n\n \n\n switch(character.currentArea.paths)\n\n {\n\n case Constants.North:\n\n if(isNorth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.South:\n\n if(isSouth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.East:\n\n if(isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.West:\n\n if(isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthAndSouth:\n\n if(isNorth(command) || isSouth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthAndEast:\n\n if(isNorth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthAndWest:\n\n if(isNorth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthAndEast:\n\n if(isSouth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthAndWest:\n\n if(isSouth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.EastAndWest:\n\n if(isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthSouthAndEast:\n\n if(isNorth(command) || isSouth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthSouthAndWest:\n\n if(isNorth(command) || isSouth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthEastAndWest:\n\n if(isNorth(command) || isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthEastAndWest:\n\n if(isSouth(command) || isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n if(isNorth(command) || isSouth(command) || isWest(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n default:\n\n break;\n\n \n\n }\n\n \n character.canPossess = false;\n return false;\n\n \n\n }", "public boolean specialCommand(String userinput){\n return (userinput.equals(\"get\")) || (userinput.equals(\"dir\"));\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"quit\"))\n wantToQuit = quit(command);\n\n return wantToQuit;\n }", "boolean hasCommand();", "boolean hasCommand();", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if (commandWord.equals(\"go\")) {\n player.goRoom(command); \n }\n else if (commandWord.equals(\"look\")) { \n player.look();\n }\n else if (commandWord.equals(\"eat\")) {\n player.eat();\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"back\")) {\n player.goBack(); \n }\n else if (commandWord.equals(\"take\")) {\n player.take(command);\n }\n else if (commandWord.equals(\"drop\")) {\n player.drop(command);\n }\n else if (commandWord.equals(\"items\")) {\n player.getItems();\n }\n else if (commandWord.equals(\"equipar\")) {\n player.equipar(command);\n }\n return wantToQuit;\n }", "private boolean promptCommand() {}", "private static boolean validateInput1(String[] input) {\n\t\tif (input.length != 1) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean checkInput();", "protected abstract boolean checkInput();", "private static boolean validCommand(String line) {\n if (line.equals(\"GET\") || line.equals(\"BOARD\")) {\n return true;\n } else if (line.matches(\"PUT .*\")) {\n if (line.matches(\"PUT [1234]\")) {\n return true;\n } else {\n System.out.println(INVALID_PUT_COLUMN_ERROR_MESSAGE);\n return false;\n }\n } else {\n System.out.println(INVALID_COMMAND_ERROR_MESSAGE);\n return false;\n }\n }", "private boolean isValid(String structure, String command) {\n\t\t// checks to see if the provided structure matches the\n\t\t// command\n\t\t// 'c' = char\n\t\t// 'n' = number (can take up more than one character, and\n\t\t// can be\n\t\t// negative\n\t\t// ' ' = space\n\t\t// 's' = string (that has to go till the end of the command\n\t\t// with no\n\t\t// spaces\n\t\tString[] format = structure.split(\"|\");\n\t\tboolean valid = true;\n\t\tint curIndex = 0;\n\t\tforloop: for (String str : format) {\n\t\t\tswitch (str.charAt(0)) {\n\t\t\tcase 'c':\n\t\t\t\tif (command.length() > curIndex) {\n\t\t\t\t\tif (!Character\n\t\t\t\t\t\t\t.isAlphabetic(command.charAt(curIndex))\n\t\t\t\t\t\t\t&& !Character.isWhitespace(\n\t\t\t\t\t\t\t\t\tcommand.charAt(curIndex))) {\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak forloop;\n\t\t\t\t\t}\n\t\t\t\t\tcurIndex++;\n\t\t\t\t} else {\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak forloop;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'n':\n\t\t\t\tif (command.length() > curIndex) {\n\t\t\t\t\tboolean wait = false;\n\t\t\t\t\tif (!Character.isDigit(command.charAt(curIndex))\n\t\t\t\t\t\t\t&& command.charAt(curIndex) != '-') {\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak forloop;\n\t\t\t\t\t}\n\t\t\t\t\tif (command.charAt(curIndex) == '-') {\n\t\t\t\t\t\twait = true;\n\t\t\t\t\t}\n\t\t\t\t\tcurIndex++;\n\t\t\t\t\twhile (command.length() > curIndex && Character\n\t\t\t\t\t\t\t.isDigit(command.charAt(curIndex))) {\n\t\t\t\t\t\twait = false;\n\t\t\t\t\t\tcurIndex++;\n\t\t\t\t\t}\n\t\t\t\t\tif (wait) {\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak forloop;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak forloop;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ' ':\n\t\t\t\tif (command.length() > curIndex) {\n\t\t\t\t\tif (!Character.isWhitespace(\n\t\t\t\t\t\t\tcommand.charAt(curIndex))) {\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak forloop;\n\t\t\t\t\t}\n\t\t\t\t\tcurIndex++;\n\t\t\t\t} else {\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak forloop;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\tif (command.length() > curIndex) {\n\t\t\t\t\twhile (command.length() > curIndex) {\n\t\t\t\t\t\tif (!Character.isAlphabetic(\n\t\t\t\t\t\t\t\tcommand.charAt(curIndex))\n\t\t\t\t\t\t\t\t&& command\n\t\t\t\t\t\t\t\t\t\t.charAt(curIndex) != '.') {\n\t\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\t\tbreak forloop;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurIndex++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak forloop;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (curIndex != command.length()) {\n\t\t\tvalid = false;\n\t\t}\n\t\treturn valid;\n\t}", "String[] checkIfLegalCommand(String strToChck);", "@Override\r\n\tpublic boolean validCommand(CommandStack stack) {\r\n\t\treturn true;\r\n\t}", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "public boolean isValidCommandWord(String commandWord) {\n if (commandWord.equals(\"\")) {\n return false;\n } else {\n return true;\n }\n }", "private void checkUserInput() {\n }", "public boolean isCommand(String command) {\n for(int i = 0; i < commandWords.length; i++) {\n if(commandWords[i].equalsIgnoreCase(command))\n return true;\n }\n return false;\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n \n case LOOK:\n look();\n break;\n \n case RELAX:\n relax();\n break;\n \n case BACK:\n back();\n break;\n }\n return wantToQuit;\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n if(commandWord == CommandWord.UNKNOWN) {\n Logger.Log(\"I don't know what you mean...\");\n return false;\n }\n \n if (commandWord == CommandWord.HELP) {\n printHelp();\n }\n else if (commandWord == CommandWord.GO) {\n goRoom(command);\n }\n \n else if (commandWord == CommandWord.TAKE) {\n takeItem(command);\n }\n \n else if (commandWord == CommandWord.USE) {\n useItem(command);\n }\n \n else if (commandWord == CommandWord.LOOK) {\n Logger.Log(currentRoom.getLongDescription());\n }\n \n else if (commandWord == CommandWord.VIEW) {\n viewPlayer(command);\n }\n \n else if (commandWord == CommandWord.QUIT) {\n wantToQuit = quit(command);\n }\n // else command not recognised.\n return wantToQuit;\n }", "private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n switch (commandWord) \n {\n case UNKNOWN:\n System.out.println(\"I don't know what you mean...\");\n break;\n\n case HELP:\n printHelp();\n break;\n\n case GO:\n goRoom(command);\n break;\n\n //my command expect when i Quit\n case PICK:\n pickItem();\n break;\n \n //drink the redbull\n case DRINK:\n drink();\n break;\n \n //show inventory\n case SHOW:\n showInventory();\n break;\n \n //show objective\n case GOAL:\n remindGoal();\n break;\n\n case QUIT:\n wantToQuit = quit(command);\n break;\n }\n return wantToQuit;\n }", "public String getValidCommand(String msg) {\n String enteredCmd = getCommand(msg);\n while (enteredCmd.isEmpty()||isSpecialCharacter(enteredCmd)) {\n enteredCmd = getCommand(ANSI_RED+\"Not a valid input. Please enter again\"+ANSI_RESET);\n }\n return enteredCmd;\n }", "boolean processCommand() throws IOException\n\t{\n\t\tString[] commands = in.readLine().split(\" \");\n\t\tif (commands[0].equalsIgnoreCase(\"F\") && isNum(commands[1]) && isNum(commands[2])) {\n\t\t\tprocessFireCmd(new String[] {commands[1], commands[2]});\n\t\t} else if (commands[0].equalsIgnoreCase(\"C\")) {\n\t\t\tprocessChatCmd (Arrays.copyOfRange(commands, 1, commands.length).toString());\n\t\t} else if (commands[0].equalsIgnoreCase(\"D\")) {\n\t\t\tout.println(\"My board: \\n\");\n\t\t\tboard.draw();\n\t\t\tout.println(\"Target's board: \\n\");\n\t\t\ttargets.draw();\n\t\t\tout.flush();\n\t\t} else {\n\t\t\tout.println(\"Unknown command.\");\n\t\t\tout.flush();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean clineIsValid(String cmd) {\n\t\tString [] parsedCmd = RunCommand.stripAndSplit(cmd);\r\n\t\tString opName = \"\";\r\n\t\tboolean flag_out = false;\r\n\t\tfor (String element: parsedCmd) {\r\n\t\t\tif (flag_out) {\r\n\t\t\t\topName = FileInfo.fileName(element);\r\n\t\t\t\tflag_out = false;\r\n\t\t\t}\r\n\t\t\tflag_out = element.equals(\"--out\");\r\n\t\t}\r\n\t\treturn (opName != \"\");\r\n\t}", "ACommand CheckCommand(String NameCommand);", "private static boolean validateInput2(String[] input) {\n\t\tif (input.length != 2) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private boolean processCommand(String line) {\n if (line.length() == 0) {\n return true;\n }\n Matcher command = COMMAND_PATN.matcher(line);\n if (command.matches()) {\n switch (command.group(1).toLowerCase()) {\n case \"#\":\n return true;\n case \"manual\":\n manualCommand(command.group(2).toLowerCase());\n return true;\n case \"auto\":\n autoCommand(command.group(2).toLowerCase());\n return true;\n case \"seed\":\n seedCommand(command.group(2));\n return true;\n case \"board\": case \"b\":\n System.out.println(_board.toString2());\n return true;\n case \"autoprint\":\n autoPrintCommand();\n return true;\n case \"set\":\n setCommand(command.group(2), command.group(3));\n return true;\n case \"dump\":\n System.out.println(_board.toString());\n return true;\n case \"start\":\n _playing = true;\n return true;\n case \"clear\":\n _playing = false;\n _board.clear();\n return true;\n case \"quit\":\n quit();\n return true;\n case \"help\": case \"?\":\n help();\n return true;\n default:\n return false;\n }\n }\n return false;\n }", "private boolean processCommand(Command command)//Method was given\n {\n if(command.isUnknown())\n {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"talk\"))\n talkToCharacter(currentRoom);\n else if (commandWord.equals(\"grab\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Grab what?\");\n }\n else\n {\n grabItem(secondWord);\n }\n }\n else if (commandWord.equals(\"eat\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Eat what?\");\n }\n else\n {\n eatItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inventory\")) \n player.getInventory();\n else if (commandWord.equals(\"drop\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Drop what?\");\n }\n else\n {\n dropItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inspect\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Inspect what?\");\n }\n else\n {\n inspectItem(secondWord);\n }\n }\n else if (commandWord.equals(\"quit\"))\n {\n if(command.hasSecondWord())\n System.out.println(\"Quit what?\");\n else\n return true; // signal that we want to quit\n }\n else if (commandWord.equals(\"look\"))\n {\n System.out.println(currentRoom.longDescription());\n }\n return false;\n }", "protected abstract boolean isInputValid();", "public boolean isValidPlaceCommand(String cmd) {\r\n\t\tboolean isValidPlaceCmd = true;\r\n\t\tString[] splitedSpaceArr = cmd.split(\"\\\\s+\");\r\n\r\n\t\tif (splitedSpaceArr.length == 2) {\r\n\t\t\tif (!splitedSpaceArr[0].equalsIgnoreCase(\"PLACE\")) {\r\n\t\t\t\tisValidPlaceCmd = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (isValidPlaceCmd) {\r\n\t\t\t\tString[] splitedCommaArr = splitedSpaceArr[1].split(\"\\\\s*,\\\\s*\");\r\n\r\n\t\t\t\tif (splitedCommaArr.length == 3) {\r\n\t\t\t\t\tint row = RobotSimulator.isInteger(splitedCommaArr[0]) ? Integer.parseInt(splitedCommaArr[0]) : -1;\r\n\t\t\t\t\tint col = RobotSimulator.isInteger(splitedCommaArr[1]) ? Integer.parseInt(splitedCommaArr[1]) : -1;\r\n\t\t\t\t\tString faceStr = splitedCommaArr[2];\r\n\r\n\t\t\t\t\t// check is position value out of bounds\r\n\t\t\t\t\tif (row > 4 || row < 0 || col > 4 || col < 0) {\r\n\t\t\t\t\t\tisValidPlaceCmd = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// check is valid face value\r\n\t\t\t\t\tList validFaceArr = Arrays.asList(\"WEST\", \"NORTH\", \"EAST\", \"SOUTH\");\r\n\t\t\t\t\tif (!validFaceArr.contains(faceStr.toUpperCase())) {\r\n\t\t\t\t\t\tisValidPlaceCmd = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tisValidPlaceCmd = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tisValidPlaceCmd = false;\r\n\t\t}\r\n\t\treturn isValidPlaceCmd;\r\n\t}", "public static boolean checkInput(String response) {\r\n\t\t\r\n\r\n\t\tif(response.length() != 1)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tswitch(response) {\r\n\t\tcase \"y\":\r\n\t\tcase \"Y\":return true;\r\n\t\tcase \"n\":\r\n\t\tcase \"N\":return true;\r\n\t\tdefault: return false;\r\n\t\t}\r\n\t\t\r\n\t}", "private boolean isInValidInput(String input) {\n\n\t\tif (input == null || input.isEmpty())\n\t\t\treturn true;\n\n\t\tint firstPipeIndex = input.indexOf(PARAM_DELIMITER);\n\t\tint secondPipeIndex = input.indexOf(PARAM_DELIMITER, firstPipeIndex + 1);\n\n\t\t/*\n\t\t * if there are no PARAM_DELIMITERs or starts with a PARAM_DELIMITER\n\t\t * (Meaning command is missing) or only single PARAM_DELIMITER input is\n\t\t * not valid\n\t\t */\n\t\tif (firstPipeIndex == -1 || firstPipeIndex == 0 || secondPipeIndex == -1)\n\t\t\treturn true;\n\n\t\t// Means package name is empty\n\t\tif (secondPipeIndex - firstPipeIndex < 2)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "private boolean runCommand( String command ) throws SQLException, NoDatabaseConnectionException, InputValidationException{\r\n\t\t\r\n\t\tif(command.length() == 0)\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tboolean syntaxProblems = false;\r\n\t\t//String[] input = StringUtils.split(command);\r\n\t\tString[] input;\r\n\t\t\r\n\t\ttry{\r\n\t\t\tinput = parseCommand( command );\r\n\t\t}catch( QuoteSequenceException e){\r\n\t\t\tSystem.out.println( e.getDescription() );\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t\t// 1 -- Try to execute the desired command\r\n\t\t\r\n\t\tfor( int c = 0; c < consoleCommands.length; c++){\r\n\t\t\t\r\n\t\t\tif( consoleCommands[c].matchesName( input[0] )){\r\n\t\t\t\tSystem.out.println();//Inserts a space before the command to make easier for the user to parse the output\r\n\t\t\t\tCommandResult result = consoleCommands[c].run(input);\r\n\t\t\t\tsyntaxProblems = (result == CommandResult.ERROR);\r\n\t\t\t\t\r\n\t\t\t\tif( result == CommandResult.TERMINATE_CONSOLE )\r\n\t\t\t\t\treturn false;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// 2 -- Show a message if the command was not recognized (execution will not get to this point unless the command failed). \r\n\t\tSystem.out.println(\"Command not recognized\");\r\n\t\tsyntaxProblems = true;\r\n\t\t\r\n\t\t// 3 -- Show the help if the syntax used was incorrect\r\n\t\tif( syntaxProblems ){\r\n\t\t\tdefaultCommand.run(input);\r\n\t\t\t/*System.out.println(\"Type \\\"help\\\" to see the available commands\");\r\n\t\t\t//boolean firstPrinted = false;\r\n\t\t\tVector<String[]> commands = new Vector<String[]>();\r\n\t\t\tcommands.add(new String[]{\"Similar Command\", \"Usage\"});\r\n\t\t\t\r\n\t\t\tfor( int c = 0; c < consoleCommands.length; c++){\r\n\t\t\t\t\r\n\t\t\t\tif( consoleCommands[c].getName().toLowerCase().startsWith( input[0].toLowerCase() ) ){\r\n\t\t\t\t\tcommands.add(new String[]{consoleCommands[c].getName(), consoleCommands[c].description});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( commands.size() > 1 ){\r\n\t\t\t\tString[][] commandsArray = new String[commands.size()][];\r\n\t\t\t\tcommands.toArray(commandsArray);\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\tSystem.out.println(ConsoleCommand.getTableFromString(commandsArray, true));\r\n\t\t\t}*/\r\n\t\t}\r\n\t\t\r\n\t\t// 4 -- Return true, noting that the console listener should not shutdown\r\n\t\treturn true;\r\n\t\t\r\n\t}", "public static boolean isCommand(String aString) {\n // if we get here, the string was not found in the commands\n return validCommands.containsKey(aString);\n }", "private static Boolean errorCheck(String Buffer){\n if(Buffer.matches(\"Y\")) return true;\n if(Buffer.matches(\"N\")) return false;\n screenClear(); //Clears the screen and applies an error message.\n return moreInput(); //Recursive repeat upon error.\n }", "private static boolean grabCommand() {\n\t\tif (input.hasNextLine()) {\n\t\t\tString temp = input.nextLine();\n\t\t\tcommand = temp.substring(0, 2);\n\t\t\tif (command.equals(\"SC\"))\n\t\t\t\tcode = temp.substring(3, temp.length()).trim();\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "private boolean handleStartMenuCommands(String command) {\n if (command.equals(\"1\")) {\n toggleVisibleArrays();\n } else if (command.equals(\"2\")) {\n comparisonMenu();\n } else if (command.equalsIgnoreCase(\"x\")) {\n return false;\n } else {\n System.out.println(\"\\nWrong Input\\n\");\n }\n return true;\n }", "public boolean checkIfHasCorrectFormat(String command, String commandType) {\r\n\t\t//begin\r\n\t\tboolean isCorrect = true;\r\n\t\tint i = 0;\r\n\t\tint counter = 0;\r\n\t\twhile(i < command.length()) {\r\n\t\t\tif(command.charAt(i) == ',') {\r\n\t\t\t\tcounter++;\r\n\t\t\t\tif( i < command.length() - 2) {\r\n\t\t\t\t\tif(command.charAt(i + 1) == ',' || command.charAt(i + 2) == ',') {\r\n\t\t\t\t\t\tisCorrect = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\tif(commandType.compareTo(\"publish\") == 0) {\r\n\t\t\tif(counter != 3) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(commandType.compareTo(\"subscribe\") == 0) {\r\n\t\t\tif(counter != 2) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(commandType.compareTo(\"unsubscribe\") == 0) {\r\n\t\t\tif(counter != 2) {\r\n\t\t\t\tisCorrect = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn isCorrect;\r\n\t\t//end\r\n\t\t//return false;\r\n\t}", "public boolean isARawCommand(String input) {\r\n return input.startsWith(\"/\");\r\n }", "public static String KeyboardScan(){\n\n System.out.println(\"Enter a command : \");\n Scanner sc = new Scanner(System.in);\n String command = sc.next().toLowerCase();\n if(command.equals(\"help\") || command.equals(\"exit\") || command.equals(\"adduser\") || command.equals(\"edituser\") || command.equals(\"removeuser\") || command.equals(\"listusers\") || command.equals(\"addcar\") || command.equals(\"editcar\") || command.equals(\"removecar\") || command.equals(\"listcars\") || command.equals(\"rentcar\") || command.equals(\"returncar\") || command.equals(\"listrents\") || command.equals(\"saveusers\") || command.equals(\"restoreusers\") || command.equals(\"serialusers\" )|| command.equals(\"saverents\") || command.equals(\"loadrents\") || command.equals(\"savecars\") || command.equals(\"loadcars\") || command.equals(\"saveall\") || command.equals(\"loadall\")) {\n return command;\n } else {\n return \"error\";\n }\n\n }", "private boolean isInputValid() {\n return true;\n }", "private void commandCheck() {\n\t\t//add user command\n\t\tif(cmd.getText().toLowerCase().equals(\"adduser\")) {\n\t\t\t/*\n\t\t\t * permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\t * There will be more user level commands added in version 2, like changing rename to allow a\n\t\t\t * user to rename themselves, but not any other user. Admins can still rename all users.\n\t\t\t */\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\taddUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//delete user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"deluser\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdelUser();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t};\n\t\t}\n\t\t//rename user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"rename\")) {\n\t\t\t//permissions check: if user is an admin, allow the user o chose a user to rename.\n\t\t\t//If not, allow the user to rename themselves only.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\trename(ALL);\n\t\t\t}\n\t\t\telse {\n\t\t\t\trename(SELF);\n\t\t\t}\n\t\t}\n\t\t//promote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"promote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tpromote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//demote user command\n\t\telse if(cmd.getText().toLowerCase().equals(\"demote\")) {\n\t\t\t//permissions check: if user is an admin, proceed. If not, error with a permission error.\n\t\t\tif(type.equals(\"admin\")) {\n\t\t\t\tdemote();\n\t\t\t}\n\t\t\telse {\n\t\t\t\terror(PERMISSIONS);\n\t\t\t}\n\t\t}\n\t\t//the rest of the commands are user level, no permission checking\n\t\telse if(cmd.getText().toLowerCase().equals(\"ccprocess\")) {\n\t\t\tccprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"cprocess\")) {\n\t\t\tcprocess();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opentill\")) {\n\t\t\topenTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"closetill\")) {\n\t\t\tcloseTill();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"opendrawer\")) {\n\t\t\topenDrawer();\n\t\t}\n\t\telse if(cmd.getText().toLowerCase().equals(\"sale\")) {\n\t\t\tsale();\n\t\t}\n\t\t//if the command that was entered does not match any command, return an error.\n\t\telse {\n\t\t\terror(CMD_NOT_FOUND);\n\t\t}\n\t}", "public boolean parse(String input) {\n\t\tif (input.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString[] sp = input.split(\" \");\n\t\tthis.command = sp[0];\n\t\tif (sp.length > 1) {\n\t\t\tthis.arguments = Arrays.copyOfRange(sp, 1, sp.length);\n\t\t}\n\t\treturn true;\n\t}", "public boolean isFactionsCommand(String check)\n \t{\n \t\tif (check == null || check.isEmpty()) return false;\n \t\treturn this.handleCommand(null, check, true);\n \t}", "protected void checkCommand(String com) throws IllegalArgumentException {\n if (com.length() != PushCacheProtocol.COMMAND_LEN) {\n throw new IllegalArgumentException(\"Command \\\"\" + com + \"\\\" is wrong length\");\n }\n if (com.charAt(3) != '\\0') {\n throw new IllegalArgumentException(\"Command \\\"\" + com + \"\\\" is not null terminated\");\n }\n }", "@Override\r\n public boolean isValidCommandLine(String inputLine) {\r\n String strippedLine = inputLine.strip();\r\n String[] tokens = strippedLine.split(\" \", -1);\r\n int flagIndex = findFlagIndex(tokens);\r\n\r\n if (flagIndex == NOT_FOUND) {\r\n return false;\r\n }\r\n\r\n String[] argumentTokens = Arrays.copyOfRange(tokens, 1, flagIndex);\r\n String[] flagTokens = Arrays.copyOfRange(tokens, flagIndex + 1, tokens.length);\r\n\r\n String argumentValue = String.join(\" \", argumentTokens);\r\n String flagValue = String.join(\" \", flagTokens);\r\n\r\n boolean isStartWithCommand = strippedLine.startsWith(super.getCommand() + \" \");\r\n boolean isNonEmptyArgument = argumentValue.length() > 0;\r\n boolean isNonEmptyFlag = flagValue.length() > 0;\r\n\r\n return isStartWithCommand && isNonEmptyArgument && isNonEmptyFlag;\r\n }", "boolean hasIsInputTo();", "public static boolean handle(String arguments) {\n String[] args = arguments.split(\" \");\n if (args.length == 0 || arguments.length() == 0) {\n System.out.println(\"No commands are given.\");\n return false;\n }\n switch (args[0]) {\n case \"C\":\n if (args.length != 2) {\n System.out.println(\"Wrong usage for C <Name>.\");\n return false;\n }\n CCommand(args[1]);\n return true;\n case \"S\":\n if (args.length <= 2) {\n System.out.println(\"Wrong usage for S <Name> <Song>.\");\n return false;\n }\n SCommand(args[1], arguments.replace(args[0] + \" \" + args[1] + \" \", \"\"));\n return true;\n case \"E\":\n if (args.length <= 2) {\n System.out.println(\"Wrong usage for E <Name> <Song>.\");\n return false;\n }\n ECommand(args[1], arguments.replace(args[0] + \" \" + args[1] + \" \", \"\"));\n return true;\n case \"L\":\n if (args.length != 2) {\n System.out.println(\"Wrong usage for L <Name>.\");\n return false;\n }\n LCommand(args[1]);\n return true;\n case \"N\":\n if (args.length != 1) {\n System.out.println(\"Wrong usage for N.\");\n return false;\n }\n NCommand();\n return true;\n case \"M\":\n if (args.length != 1) {\n System.out.println(\"Wrong usage for M.\");\n return false;\n }\n MCommand();\n return true;\n case \"R\":\n if (args.length != 1) {\n System.out.println(\"Wrong usage for R.\");\n return false;\n }\n RCommand();\n return true;\n default:\n System.out.println(\"Given argument is not suitable.\");\n return false;\n }\n }", "public abstract boolean verifyInput();", "public static boolean isValid(String fullCommand) {\n String strWeek = fullCommand.replaceFirst(DukeConstants.SHOW_WEEK_HEADER, DukeConstants.NO_FIELD);\n if (!strWeek.isEmpty()) {\n char checkSpace = strWeek.charAt(0);\n if (checkSpace != ' ') {\n return false;\n }\n }\n strWeek = strWeek.trim();\n if (strWeek.isEmpty()) {\n return false;\n } else if (strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_RECESS)\n || strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_READING)\n || strWeek.equals(DukeConstants.WEEK_FORMAT_KEYWORD_EXAM)) {\n return true;\n } else {\n try {\n Integer week = Integer.parseInt(strWeek);\n if (week >= 1 && week <= 13) {\n return true;\n } else {\n return false;\n }\n } catch (NumberFormatException e) {\n return false;\n }\n }\n }", "public boolean execute(Command command){\n if(!command.hasSecondWord()) {\n // if there is no second word, we don't know what to pick up...\n System.out.println(\"Eat what?\");\n return false;\n }\n String goodItems = \"ChocolateCake,\";//, badItems = \"goo,\";\n String itemName = command.getSecondWord();\n Player currentPlayer = game.getCurrentPlayer();\n Item item = currentPlayer.getCurrentInventory().getItem(itemName);\n if(item != null){\n if(item.isEdible()){\n if(goodItems.indexOf(item.getItemName()) >=0){\n currentPlayer.changeMaxWeight(item.getWeight());\n currentPlayer.getCurrentInventory().removeItem(item);\n System.out.println(\"Your maximum weight capacity went up!: \" +\n currentPlayer.getMaxWeight());\n return false;\n }\n else{\n currentPlayer.changeMaxWeight(-item.getWeight());\n currentPlayer.getCurrentInventory().removeItem(item);\n System.out.println(\"Your maximum weight capacity went down!: \" +\n currentPlayer.getMaxWeight());\n return false;\n }\n }\n else{\n System.out.println(\"That's not edible!!\");\n return false;\n }\n }\n \n System.out.println(\"You don't have that item!\");\n return false;\n }", "private boolean commandAnalyzerLR(List<Token> lineLexTokens) {\r\n\t\tToken cmdToken = lineLexTokens.get(0);\r\n\t\t// command declaration must have NUM_PARAM_CMD parameters\r\n\t\tif (lineLexTokens.size()!= NUM_PARAMS_CMD) {\r\n\t\t\tlog.error(\"Command '\" + cmdToken.value + \"' must contain \" \r\n\t\t\t\t\t+ NUM_PARAMS_CMD + \" parameters.\", new ParserException());\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tToken valToken = lineLexTokens.get(1);\r\n\t\tString lineLex = cmdToken.lexSymbol + \r\n\t\t\t\t valToken.lexSymbol;\r\n\t\tString regex = \"\"; // regular expression\r\n\r\n\t\t// Check the syntax of this command declaration \r\n\t\tKeywords cmdKeyword = Keywords.lookup(cmdToken.value);\r\n\t\t\r\n\t\t// default error message\r\n\t\tfinal String errMsg = \"Command declaration '\" + cmdToken.value + \r\n\t\t \t\t\t \t\"' is in a wrong format.\";\r\n\t\t\r\n\t\tswitch(cmdKeyword){\r\n\t\t\tcase _COORD_SYSTEM:\r\n\t\t\t\t// \"\\\\$cmd$space\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol +\r\n\t\t\t\t\t \"\\\\\"+Symbols.CoordinateSysSymbol;\r\n\t\t\t\tif (!lineLex.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Check coordinates system types \"\r\n\t\t\t\t\t\t\t+ \"definition.\", new ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase _SPATIAL_DIM:\r\n\t\t\t\t// \"\\\\$cmd[1-3]\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol + \"[1-3]\";\r\n\t\t\t\tString dimCmd = cmdToken.lexSymbol + valToken.value;\r\n\t\t\t\tif (!dimCmd.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Dimensions must be 1, 2 or 3.\", \r\n\t\t\t\t\t\t\tnew ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase _IGNORE_LINES:\r\n\t\t\t\t// \"\\\\$cmd[1-9,15,18]\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol + \r\n\t\t\t\t \"\\\\[[^,]{0}(,{0,1}[0-9]|,{0,1}[0-9]\\\\-[0-9])+\\\\]\";\r\n\t\t\t\tString ignoreCmd = cmdToken.lexSymbol + valToken.value;\r\n\t\t\t\tif (!ignoreCmd.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg, new ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\tcase _AUTO_ID:\r\n\t\t\t\t// \"\\\\$cmd\\\\$str\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol +\r\n\t\t\t\t\t \"\\\\\"+Symbols.StringSymbol;\r\n\t\t\t\tif (!lineLex.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Check ID prefix declaration.\", \r\n\t\t\t\t\t\t\tnew ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase _IGNORE_ATTR:\r\n\t\t\t\t// \"\\\\$cmd\\\\$delim\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol +\r\n\t\t\t\t\t \"\\\\\"+Symbols.DelimiterSymbol;\r\n\t\t\t\tif (!lineLex.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Check attribute delimiter.\", \r\n\t\t\t\t\t\t\tnew ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase _RECORDS_DELIM:\t\r\n\t\t\t\t// \"\\\\$cmd\\\\$delim\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol +\r\n\t\t\t\t\t \"\\\\\"+Symbols.DelimiterSymbol;\r\n\t\t\t\tif (!lineLex.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Check records delimiter.\", \r\n\t\t\t\t\t\t\tnew ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase _DECIMAL_PREC:\r\n\t\t\t\t// \"\\\\$cmd\\\\d+\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol + \"\\\\d+\";\r\n\t\t\t\tString precisionCmd = cmdToken.lexSymbol + valToken.value;\r\n\t\t\t\tif (!precisionCmd.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg + \" Decimal precision must be an \"\r\n\t\t\t\t\t\t\t+ \"integer number.\", new ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t// default format for commands\r\n\t\t\t\t// \"\\\\$cmd(\\\\$str|\\\\$delim)\"\r\n\t\t\t\tregex = \"\\\\\"+Symbols.CommandSymbol + \r\n\t\t\t\t\t \"(\\\\\"+Symbols.StringSymbol + \"|\" +\r\n\t\t\t\t\t \"\\\\\"+Symbols.DelimiterSymbol + \")\";\r\n\t\t\t\tif (!lineLex.matches(regex)) {\r\n\t\t\t\t\tlog.error(errMsg, new ParserException());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// no syntax error in this command declaration\r\n\t\treturn true;\r\n\t}", "public static boolean isCommand(String s) {\n \treturn commands.containsKey(s.toLowerCase());\n }", "private static boolean valid_input(String user_input) {\n \n boolean output = false;\n \n if(user_input.length() == 2){\n \n output = (user_input.substring(0,1).matches(\"[0-9]\") && user_input.substring(1,2).matches(\"[a-zA-Z]\"));\n } else if (user_input.length() == 3) {\n \n output = (user_input.substring(0,2).matches(\"[1-2][0-9]\") && user_input.substring(2,3).matches(\"[a-zA-Z]\"));\n \n if(Integer.parseInt(user_input.substring(0,2))>TicTacToe.game.gridSize){\n output = false;\n }\n }\n \n return output;\n }", "public static boolean isCommand(String str) {\n for (UserCommand command : UserCommand.values()) {\n if (str.contains(command.getCommand())) {\n return true;\n }\n }\n\n return false;\n }", "public static boolean userInput(){\n String tempInput = \"y\"; //string to hold input for bulletproofing, default length is one character\n Scanner input = new Scanner(System.in);\n\n do { //bulletproofing input\n\n if (tempInput.length() != 1){ //if looping for second time, output error message\n System.out.println(\"Unaccepted input. Please reenter.\");\n }\n\n tempInput = input.nextLine(); //take input\n\n }while(tempInput.length() != 1); //loops again if input is not single character\n\n return tempInput.charAt(0) == 'y';\n }", "private boolean isArithmeticCmd() {\r\n for (String cmd : ARITHMETIC_CMDS) {\r\n if (command.equals(cmd)) return true;\r\n }\r\n return false;\r\n }", "private static boolean valid(String arg) {\n\n /* check if valid option */\n if ( arg.equals(\"-v\") || arg.equals(\"-i\") || arg.equals(\"-p\") || arg.equals(\"-h\") )\n return true;\n\n /* check if valid port */\n try {\n int port = Integer.parseInt(arg);\n if ( ( 0 < port ) && ( port < 65354 ) )\n return true;\n } catch (NumberFormatException ignored) {}\n\n /* check if valid ip address */\n String[] ips = arg.split(\"\\\\.\");\n if ( ips.length != 4 )\n return false;\n try{\n for (int i=0; i<4; i++){\n int ip = Integer.parseInt(ips[i]);\n if ( ( ip < 0) || (255 < ip ) )\n return false;\n }\n } catch (NumberFormatException ignored) {return false;}\n\n return true;\n }", "private static boolean validLine(String[] splitLine) {\n\t\tif (splitLine.length < 1) {\n\t\t\tSystem.out.println(\"Not enough arguments on the transaction line, continuing to next line\");\n\t\t\treturn false;\n\t\t}\n\t\tString op = splitLine[0];\n\t\tif (!validOperation(op)) {\n\t\t\tSystem.out.println(op + \" is not a valid operation\");\n\t\t\treturn false;\n\t\t}\n\t\tif (op.equalsIgnoreCase(\"insert\")) {\n\t\t\tif (!validInsert(splitLine)) {\n\t\t\t\tSystem.out.println(\"Invalid insert operation, continuing to next line\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (op.equalsIgnoreCase(\"delete\") || op.equals(\"search\")) {\n\t\t\tif (!validSearchOrDelete(splitLine)) {\n\t\t\t\tSystem.out.println(\"Invalid \" + op + \" operation, continuing to next line\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (op.equalsIgnoreCase(\"update\")) {\n\t\t\tif (!validUpdate(splitLine)) {\n\t\t\t\tSystem.out.println(\"Invalid update operation, continuing to next line\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (op.equalsIgnoreCase(\"print\")) {\n\t\t\tif (!validPrint(splitLine)) {\n\t\t\t\tSystem.out.println(\"Invalid print operation, continuing to next line\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true; // passed all the tests\n\t}", "public boolean isInputValid(ConversationContext context, String s)\r\n/* */ {\r\n/* 135 */ return (s.equalsIgnoreCase(\"one\")) || (s.equals(\"1\")) || (s.equalsIgnoreCase(\"two\")) || (s.equals(\"2\")) || (s.equalsIgnoreCase(\"zero\")) || (s.equals(\"0\"));\r\n/* */ }", "private static boolean validOperation(String op) {\n\t\tfor (String goodOp : validOps) {\n\t\t\tif (goodOp.equalsIgnoreCase(op)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean isValidInput() {\n if (null == mUsername || mUsername.length() <= 0) {\n return false;\n } else if (null == mPassword || mPassword.length() <= 0) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}", "private boolean checkingAllArguments() {\n\t\t\n\t\t// test if the four player types have been selected\n\t\tfor(int i=0;i<allButtons.size();i++) {\n\t\t\tif(allButtons.get(i)==null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// test if the seed is in the correct format\n\t\tif(!(seed.textProperty().get().isEmpty())){\n\t\t\ttry {\n\t\t\t\tgameSeed = Long.parseLong(seed.getText());\n\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\tmenuMessage.setText(\"Given seed is not a valid number\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\t\n\t\t// test if for each of the players the given arguments are correct\n\t\tfor(int i = 0; i < allButtons.size(); ++i) {\n\t\t\tchar playerType = allButtons.get(i).getText().charAt(0);\n\t\t\tString argument = texts.get(2 * i + 1).getText();\n\t\t\t\n\t\t\tif(!argument.isEmpty()) {\n\t\t\t\tswitch(playerType) {\n\t\t\t\t\n\t\t\t\tcase 'S' : \n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlong l = Long.parseLong(texts.get(2 * i + 1).getText());\n\t\t\t\t\t\tif(l < 9) {\n\t\t\t\t\t\t\tmenuMessage.setText(\"The iteration value must be at least 9\");\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NumberFormatException e) {\n\t\t\t\t\t\tmenuMessage.setText(\"One of the iteration number is not a valid number\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'R' :\n\t\t\t\t\t\n\t\t\t\t\tString[] parts = StringSerializer.split(\"\\\\.\", argument); \n\t\t\t\t\t\n\t\t\t\t\tif (parts.length != 4) { \n\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tfor (String str : parts) { \n\t\t\t\t\t\tint j = Integer.parseInt(str); \n\t\t\t\t\t\tif ((j < 0) || (j > 255)) { \n\t\t\t\t\t\t\tmenuMessage.setText(\"One of the IP Address is not a valid address\");\n\t\t\t\t\t\t\treturn false; \n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn true;\n\t}", "private static String[] checkInput(String input) throws Exception{\n String[] in = input.trim().split(\" \");\n\n if(in.length == 0){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(CommandEnum.getCommandEnumFrom(in[0]) == null){\n throw new CommandException(ExceptionEnum.INCORRECT_COMMAND_EXCEPTION);\n }\n\n if(isSpecificCommandENum(in[0],BYE)){\n return in;\n }\n if(isSpecificCommandENum(in[0],TERMINATE)){\n return in;\n }\n\n if(in.length < MIN_PARAM){\n throw new CommandException(ExceptionEnum.LESS_INPUT_EXCEPTION);\n }\n\n if(in.length > MAX_PARAM){\n throw new CommandException(ExceptionEnum.EXTRA_INPUT_EXCEPTION);\n }\n\n //check input value\n for(int i = 1; i < in.length; i++){\n try{\n Integer.parseInt(in[i]);\n }catch(NumberFormatException e){\n throw new CommandException(ExceptionEnum.INVALID_INPUT_EXCEPTION);\n }\n }\n\n return in;\n }", "Optional<String> validate(String command, List<String> args);", "private boolean isMovement(Command cmd) {\n return Arrays.asList(MOVE_UP, MOVE_DOWN, MOVE_LEFT, MOVE_RIGHT).contains(cmd);\n }", "boolean hasActionCommand();", "public boolean parseCommand(String [] clargs){\n\t\tif (clargs.length < 1 || !this.command_name.equals(clargs[0])){\n\t\t\treturn false;\n\t\t}\n\t\t// Otherwise we can parse the remainder of the flags and arguments\n\t\tint index = 1;\n\t\targuments = new LinkedList<String>();\n\t\tflags = new LinkedList<String[]>();\n\t\terrors = new LinkedList<String>();\n\t\twhile (index < clargs.length){\n\t\t\tif (is_flag(clargs[index])){\n\t\t\t boolean recognised = false;\n\t\t\t for (CLOption clopt : options){\n\t\t\t\t // Should check that the arguments are not flags.\n\t\t\t\t if (clopt.is_matching_flag(clargs[index]) &&\n\t\t\t\t\t \tindex + clopt.getNumberOfArgs() < clargs.length){\n\t\t\t\t\t String[] flag = new String[1 + clopt.getNumberOfArgs()];\n\t\t\t\t\t flag[0] = clopt.getName();\n\t\t\t\t\t index++;\n\t\t\t\t\t for (int i = 1; i < clopt.getNumberOfArgs(); i++){\n\t\t\t\t\t\t flag[i] = clargs[index];\n\t\t\t\t\t\t index++;\n\t\t\t\t\t }\n\t\t\t\t\t flags.addLast(flag);\n\t\t\t\t\t recognised = true;\n\t\t\t\t\t break;\n\t\t\t\t }\n\t\t\t }\n\t\t\t if (!recognised){\n\t\t\t\t errors.addLast(\"Unrecognised flag: \" + clargs[index]);\n\t\t\t }\n\t\t\t} else {\n\t\t\t\targuments.addLast(clargs[index]);\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t\t// Eventually if we get to here and we haven't reported an\n\t\t// error then we are good to go\n\t\treturn true;\n\t}", "void parseCommand(String command){\n\t\tif(command!=null && command.length()>0){\n\t\t\tif(!subMenuFlag){\n\t\t\t\tmainMenuCommand(command);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsubMenuCommand(command);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"Please enter a valid command.\");\n\t\t}\n\t}", "protected abstract int isValidInput();", "private void processInput(String command) {\r\n\r\n if (command.equals(\"1\")) {\r\n displayListings();\r\n } else if (command.equals(\"2\")) {\r\n listYourCar();\r\n } else if (command.equals(\"3\")) {\r\n removeYourCar(user);\r\n } else if (command.equals(\"4\")) {\r\n checkIfWon();\r\n } else if (command.equals(\"5\")) {\r\n saveCarListings();\r\n } else if (command.equals(\"6\")) {\r\n exitApp = true;\r\n } else {\r\n System.out.println(\"Invalid selection\");\r\n }\r\n }", "public boolean containsCommand(TokenizedCommand tc);", "public final void invalidInput() {\n\t\tout.println(\"Command not recognized. Please try again.\");\n\t}", "public abstract void checkingCommand(String nameOfCommand, ArrayList<Unit> units);", "public boolean isCommandString(String word, boolean isActive);", "public boolean handleUserInput(String userInput) {\n return this.duke.processOneCommand(userInput);\n }", "private boolean canSend() {\n\n if (StringUtils.isEmpty(constructedCommand())) return false;\n\n int beginIndex = constructedCommand()\n .indexOf(serialProperties.getCmdBeginMarker());\n int endIndex = constructedCommand()\n .indexOf(serialProperties.getCmdEndMarker());\n\n return beginIndex != -1 && endIndex != -1 && beginIndex < endIndex;\n }", "static String getCommand() {\n\t\tString command;\n\t\twhile (true) {\n\t\t\tScanner sca = new Scanner(System.in);\n\t\t\tSystem.out.print(\"Enter Command: \");\n\t\t\tcommand = sca.next();\n\t\t\tif (command.equals(\"ac\") || command.equals(\"dc\") || command.equals(\"as\") || command.equals(\"ds\") || command.equals(\"p\") || command.equals(\"q\"))\n\t\t\t\tbreak;\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Invalid command: \" + command);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t// System.out.println(command);\n\t\treturn command;\n\t}", "public boolean satisfiesMinimumDoneCommandLength(String[] command) {\n return (command.length > 1);\n }", "protected boolean isCommand(String string) {\n\t\treturn myLanguages.containsKey(string);\n\t}", "private boolean isUserInputValid(String[] packetData)\n\t{\n\t\tif(packetData.length < 3 ) return false;\n\t\tString address = packetData[0];\n\t\tint port = Integer.parseInt(packetData[1]);\n\n\t\tint addressPeriodsCount = address.length() - address.replace(\".\", \"\").length();\n\n\t\tif (packetData.length < 3)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if(address.equals(\"localhost\") && (port > 0 || port <= 65535))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (addressPeriodsCount == 3 ||addressPeriodsCount == 2 ) && (port > 0 || port <= 65535);\n\t\t}\n\t}", "public boolean hasValidArgs() {\r\n // if it has has zero argument, it is valid\r\n boolean zeroArgs = this.getCmd().getArguments().size() == 0;\r\n // return the boolean value\r\n return zeroArgs;\r\n }", "public boolean hasCommand() {\n return this.command != null;\n }", "public void toCheckIn(String newCommand){\n if(this.serveOrNot == false){\n this.println(\"Please serve first!\");\n }\n else{\n String bookNumbers = newCommand.substring(7).trim();\n if (bookNumbers.length() == 0){\n this.println(\"Please enter the book number to check in!\");\n }\n else{\n String[] bookNumberList = bookNumbers.split(\",\");\n //check see if the numberlist is out of range or not, if everything is correct, within the checkNum function, we implement checkIn\n checkNum(bookNumberList, true);\n } \n //this.println(printPatronInfo());\n }\n \n }", "abstract public boolean isVariableCommand();", "@Test\n\t//Test for invalid command\n\tpublic void testForInvalidCommand() {\n\t\t\t\n\t\t//-d option present but no delimiter given\n\t\tString command1 = \"paste -d a.txt\";\n\t\t\n\t\tpasteTool = new PASTETool();\n\t\t\n\t\tString actual = pasteTool.execute(workingDirectory, command1);\n\t\tString expected = \"Invalid Command\";\n\t\t\t\n\t\tassertEquals(expected, actual);\n\t\tassertEquals(pasteTool.getStatusCode(),-1);\n\t}", "private boolean validInput()\n {\n boolean completeForm = true; //all textfields have been filled in\n boolean noExceptions = true; //all textfields (except name) have int\n boolean selectionMade = true; //user has selected a ship type\n\n if (shipNameInput.getText()==\"Ship name\" ||\n xcoordInput.getText()==\"Starting x coordinate\" ||\n ycoordInput.getText()==\"Starting y coordinate\")\n {\n System.out.println(\"ERROR: Please fill in all text fields before \"+\n \"adding your ship.\");\n completeForm = false;\n }\n try\n {\n xcoord = Integer.parseInt(xcoordInput.getText());\n ycoord = Integer.parseInt(ycoordInput.getText());\n }\n catch (NumberFormatException except)\n {\n System.out.println(\"ERROR: Ship coordinates and speed need to be \"+\n \"entered as integers.\");\n noExceptions = false;\n }\n if (directionInput.getResponse() == \"none\")\n {\n System.out.println(\"ERROR: Please choose a direction.\");\n selectionMade = false;\n }\n else\n {\n String d = directionInput.getResponse();\n if (d == \"N\") direction = 0;\n else if (d == \"NE\") direction = Ship.NE;\n else if (d == \"E\") direction = Ship.E;\n else if (d == \"SE\") direction = Ship.SE;\n else if (d == \"S\") direction = Ship.S;\n else if (d == \"SW\") direction = Ship.SW;\n else if (d == \"W\") direction = Ship.W;\n else if (d == \"NW\") direction = Ship.NW;\n }\n shipName = shipNameInput.getText();\n speed = speedSlider.getValue();\n\n return (completeForm && noExceptions && selectionMade);\n }", "public static boolean isAutocompleteable(String command) {\r\n\t\tassert command != null;\r\n\t\tcommandType = Logic.determineCommandType(command);\r\n\t\tswitch (commandType) {\r\n\t\tcase EDIT:\r\n\t\tcase DELETE:\r\n\t\tcase DONE:\r\n\t\tcase UNDONE:\r\n\t\t\treturn true;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static boolean isSortedByPriority(String userInput) throws InvalidCommandException {\n String[] components = userInput.split(\" \", 2);\n if (components.length == 1) {\n return false;\n } else if (components[1].equals(\"priority\")) {\n return true;\n } else {\n throw new InvalidCommandException();\n }\n }", "protected abstract boolean isInputValid(@NotNull ConversationContext context, @NotNull String input);", "public boolean checkInput(){\n if(spelerIDField.getText().equals(\"\") || typeField.getText().equals(\"\") || codeField.getText().equals(\"\") || heeftBetaaldField.getText().equals(\"\")){\n return true;\n } else { return false; }\n }", "public static boolean isCommand(String aString)\n {\n boolean isCommand = false;\n \n for(CommandWord command : CommandWord.values()) {\n if(command.toString().equalsIgnoreCase(aString)) {\n isCommand = true;\n }\n }\n return isCommand;\n }", "private boolean validateInput() {\n boolean isValid = true;\n Alert errMsg = Util.getAlert(Alert.AlertType.ERROR);\n if (connectionsCB.getEditor().getText() == null || !Util.isValidAddress(connectionsCB.getEditor().getText())) {\n errMsg.setContentText(\"Invalid TRex Host Name or IP address\");\n isValid = false;\n } else if (!Util.isValidPort(rpcPort.getText())) {\n errMsg.setContentText(\"Invalid TRex Sync Port Number(\" + rpcPort.getText() + \")\");\n isValid = false;\n } else if (!Util.isValidPort(asyncPort.getText())) {\n errMsg.setContentText(\"Invalid Async Port Number(\" + asyncPort.getText() + \")\");\n isValid = false;\n } else if (Util.isNullOrEmpty(nameTF.getText())) {\n errMsg.setContentText(\"Name should not be empty\");\n isValid = false;\n }\n\n if (!isValid) {\n errMsg.show();\n }\n return isValid;\n }", "@Test\n\tpublic void parseCommandTest() {\n\t\tassertFalse(myManager.parseCommand(\"quit\"));\n\t\tassertFalse(myManager.parseCommand(\"Quit\"));\n\t\tassertFalse(myManager.parseCommand(\"q uit\"));\n\t\t\n\t\tassertTrue(myManager.parseCommand(\"new job\"));\n\t\tassertTrue(myManager.parseCommand(\"NEW job\"));\n\t\tassertTrue(myManager.parseCommand(\"new\"));\n\t\tassertFalse(myManager.parseCommand(\"new jobzo\"));\n\t}", "public boolean chooseArgs(String arg) {\n\t\tSystem.out.println(\"Do you want \" + arg + \"? (y/n)\");\n\t\tString s = Main.sc.next();\n\t\twhile (s.length() != 1 && !(s.contains(\"y\") || s.contains(\"n\"))) {\n\t\t\tMain.wrongEntry();\n\t\t\tSystem.out.print(\"Press 'y' for yes and 'n' for no >\");\n\t\t}\n\t\treturn (s.contains(\"y\"));\n\t}", "public boolean areCommandsAllowed()\n {\n return allowCommands;\n }" ]
[ "0.78494656", "0.77524096", "0.76761085", "0.75341207", "0.7321052", "0.72290295", "0.7211447", "0.7211447", "0.7201226", "0.71527785", "0.71374106", "0.712861", "0.7122108", "0.7075023", "0.7064993", "0.706035", "0.69872797", "0.6983796", "0.6967479", "0.69578487", "0.6957766", "0.6934616", "0.69232434", "0.69157714", "0.6903167", "0.68991303", "0.6857542", "0.6834529", "0.681419", "0.6790681", "0.6738772", "0.6733789", "0.6711519", "0.670509", "0.66737854", "0.66545695", "0.66144395", "0.6601648", "0.6579826", "0.6570483", "0.65529406", "0.6552517", "0.6523812", "0.6515264", "0.6501675", "0.6489892", "0.6485199", "0.645448", "0.6453025", "0.6443716", "0.6437827", "0.64215297", "0.6412213", "0.63823754", "0.63804096", "0.6375571", "0.6364533", "0.6352752", "0.63357013", "0.63120645", "0.6297363", "0.6296672", "0.62959427", "0.6292441", "0.6285727", "0.62712795", "0.6262088", "0.6260421", "0.6258038", "0.62422734", "0.6239534", "0.6232799", "0.6210338", "0.61994797", "0.6194236", "0.6187244", "0.6175802", "0.6174101", "0.6167533", "0.61562014", "0.61527586", "0.6152046", "0.61493546", "0.6148923", "0.61422706", "0.61393267", "0.6128703", "0.6125298", "0.61251795", "0.61113816", "0.61006695", "0.60888433", "0.60855967", "0.60692126", "0.606561", "0.6065394", "0.60634816", "0.6043038", "0.6041487", "0.603324" ]
0.7112906
13
/ return ftp command
public String getFTPcommand(){ String temp = this.map.get(this.userinput_command).toString().toUpperCase() + ( (this.userinput_var == null)? "" : " " + this.userinput_var ); this.userinput_var = null; return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean execute(FTPClient client) throws SocketException, IOException;", "public static final String getCommand(final FTPCommand command) {\n return command.command();\n }", "public String getFileTransferServer();", "public static void main(String [] args) throws IOException //added this line\n {\n if (args.length != ARG_CNT) {\n System.out.print(\"Usage: cmd ServerAddress ServerPort\\n\");\n return;\n }\n\n String hostName = args[0];\n String subHostname;\n int portNumber = Integer.parseInt(args[1]);\n int subPortNumber;\n\n try {\n Socket kkSocket = new Socket(hostName, portNumber);\n kkSocket.setSoTimeout(TIMEOUT); //sets Socket Timeout for FFFC in milliseconds\n\n // from client to server\n PrintWriter out1 = new PrintWriter(kkSocket.getOutputStream(), true);\n BufferedWriter out=new BufferedWriter(out1);\n //from server to client\n BufferedReader in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));\n //from user\n BufferedReader stdIn =new BufferedReader(new InputStreamReader(System.in));\n\n String fromUserString;\n fromServer = in.readLine();\n while (fromServer != null) {\n String[] fromUser = new String[2];\n System.out.print(\"csftp> \");\n String command = \"\";\n\n try {\n fromUserString = stdIn.readLine();\n fromUser = fromUserString.split(\" \");\n command = fromUser[0].toLowerCase().trim();\n\n }catch(IOException e){\n printErrorMsg(\"FFFE\", null, null);\n System.exit(1);\n }\n\n switch (command) {\n case \"user\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"USER \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> USER \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"pw\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASS \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> PASS \" + fromUser[1]); //print out what we send\n readMultiLine(in);\n break;\n case \"cd\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"CWD \"+fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> CWD \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"quit\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"QUIT\\n\");\n out.flush();\n System.out.println(\"--> QUIT\");\n System.out.println(in.readLine());\n System.exit(1);\n break;\n case \"features\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"FEAT\\n\");\n out.flush();\n System.out.println(\"--> FEAT\");\n readMultiLine(in);\n break;\n case \"dir\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n String response = in.readLine();\n Pattern pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n Matcher matcher = pattern.matcher(response);\n\n try {\n if (matcher.find()) {\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n BufferedReader inSub = new BufferedReader(\n new InputStreamReader(subSocket.getInputStream()));\n subSocket.setSoTimeout(IO_TIMEOUT);\n out.write(\"LIST\\n\");\n out.flush();\n System.out.println(\"--> LIST\");\n\n String currentLine;\n while (true) {\n if ((currentLine = inSub.readLine()) != null) {\n System.out.println(\"<-- \" + currentLine);\n } else {\n break;\n }\n }\n inSub.close();\n subSocket.close();\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n readMultiLine(in);\n readMultiLine(in);\n break;\n case \"get\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n response = in.readLine();\n\n out.write(\"TYPE I\"+\"\\n\");\n out.flush();\n readMultiLine(in);\n\n pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n matcher = pattern.matcher(response);\n try {\n if (matcher.find()) {\n\n System.out.println(\"<--\" + matcher.group(1));\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n subSocket.setSoTimeout(IO_TIMEOUT); //sets socket timeout for 0x3A2\n FileOutputStream tempFile = new FileOutputStream(fromUser[1]);\n\n out.write(\"RETR \" + fromUser[1] + \"\\n\");\n out.flush();\n System.out.println(\"--> RETR\");\n String reply = in.readLine();\n\n //Data transfer connection fail to open\n if (reply.startsWith(\"425\")) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n break;\n }\n\n //fail to access file\n if (reply.startsWith(\"550\")) {\n printErrorMsg(\"38E\", fromUser[1], \"\");\n break;\n }\n\n //save remote file to local machine\n int line;\n byte[] buf=new byte[4096];\n InputStream inSub = subSocket.getInputStream();\n while ((line = inSub.read(buf)) > 0) {\n tempFile.write(buf,0 ,line);\n }\n\n tempFile.close();\n tempFile.flush();\n inSub.close();\n subSocket.close();\n readMultiLine(in);\n\n } catch(SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n break;\n //if not one of these cases, invalid command error\n default: printErrorMsg(\"001\",\"\",\"\");\n }\n\n }\n } catch (UnknownHostException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (IOException e) {\n printErrorMsg(\"FFFD\", null, null);\n System.exit(1);\n } catch (Exception e) {\n printErrorMsg(\"FFFF\", null, e.getMessage());\n System.exit(1);\n }\n }", "public interface IFTPOperationListener {\n\n /**\n * Called when ftp login is done.\n */\n void loginDone();\n\n /**\n * Called when info are being fetched for a remote file\n *\n * @param remotePath The remote file or folder path\n */\n void fetchingInfo(String remotePath);\n\n /**\n * Called when a file listing is being done\n *\n * @param remoteFolder The remote folder path\n */\n void listingFiles(String remoteFolder);\n\n /**\n * Called before a file is being uploaded.\n *\n * @param path The path of the file\n */\n void uploadingFile(String path);\n\n /**\n * Called when a file is uploaded\n *\n * @param path The remote file path\n */\n void fileUploaded(String path);\n\n /**\n * Called when a folder is being uploaded\n *\n * @param remoteFolder Called when the folder is being uploaded\n */\n void uploadingFolder(String remoteFolder);\n\n /**\n * Called when a folder is uploaded\n *\n * @param remoteFolder The remote folder path\n */\n void folderUploaded(String remoteFolder);\n\n /**\n * Called when a file is being downloaded\n *\n * @param path The path of the file\n */\n void downloadingFile(String path);\n\n /**\n * Called when a remote file is downloaded\n *\n * @param path The remote file path\n */\n void fileDownloaded(String path);\n\n /**\n * Called when a folder is being downloaded\n *\n * @param remoteFolder The remote folder being downloaded\n */\n void downloadingFolder(String remoteFolder);\n\n /**\n * Called when a remote folder is downloaded\n *\n * @param remoteFolder The remote folder path\n */\n void folderDownloaded(String remoteFolder);\n\n /**\n * Called when a remote folder is created\n *\n * @param remoteFolder The remote folder path\n */\n void folderCreated(String remoteFolder);\n\n /**\n * Called when a remote folder is deleted\n *\n * @param remoteFolder The remote folder path\n */\n void folderDeleted(String remoteFolder);\n\n /**\n * Called when a remote file is delete\n *\n * @param path The remote file path\n */\n void fileDeleted(String path);\n\n /**\n * Called when ftp logout is done.\n */\n void logoutDone();\n\n\n}", "public static void tranferFile() {\n\n FTPClient ftpClient = new FTPClient();\n try {\n ftpClient.connect(\"192.168.231.237\", 80);\n ftpClient.login(\"root\", \"xpsr@350\");\n ftpClient.enterLocalPassiveMode();\n\n ftpClient.setFileType(FTP.BINARY_FILE_TYPE);\n File sourceFile = new File(\"/home/sthiyagaraj/eclipse-workspace/KonnectAPI/target/APIURL.tar.gz\");\n InputStream inputStream = new FileInputStream(sourceFile);\n\n boolean done = ftpClient.storeFile(\"filename which receiver get\", inputStream);\n inputStream.close();\n if (done) {\n System.out.println(\"file is uploaded successfully..............\");\n }\n\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp : \"+e);\n } finally {\n try {\n if (ftpClient.isConnected()) {\n ftpClient.logout();\n ftpClient.disconnect();\n }\n } catch (IOException e) {\n System.err.println(\"Exception occured while ftp logout/disconnect : \"+e);\n }\n }\n\n }", "void sendReceive(){\r\n\r\n String remotePath=\"Batch\\\\Export\\\\\" + DAL.getStoreID();\r\n String localPath=\"Batch\\\\Import\\\\\";\r\n String filename=\"\";\r\n File dir;\r\n String[] children;//list of files at local\r\n\r\n CustomFtpClient ftpClient = new CustomFtpClient();\r\n try {\r\n //1---------- connect Ftp\r\n//System.out.println(DAL.getStoreID()+\" \"+DAL.getFtpServer()+\" \"+DAL.getFtpUser()+\" \"+DAL.getFtpPassword());\r\n ftpClient.openServer(DAL.getFtpServer());\r\n ftpClient.login(DAL.getFtpUser(), DAL.getFtpPassword());\r\n ftpClient.cd(remotePath);\r\n ftpClient.binary();\r\n\r\n //2---------- copy from SIM Export to POS Export\r\n StringBuffer pathList = new StringBuffer();\r\n InputStream is = ftpClient.list();\r\n int c;\r\n\r\n //read all file and directory at remote\r\n while ( (c = is.read()) != -1) {\r\n String s = (new Character( (char) c)).toString();\r\n pathList.append(s);\r\n }\r\n\r\n StringTokenizer st = new StringTokenizer(pathList.toString(),\"\\r\\n\");\r\n //get file from SIM Export\r\n while (st.hasMoreTokens()){\r\n filename=st.nextToken().substring(55);\r\n if(filename.indexOf(\".txt\")!=-1){\r\n is = ftpClient.get(filename);\r\n File file_out = new File(localPath + filename);\r\n FileOutputStream os = new\r\n FileOutputStream(file_out);\r\n byte[] bytes = new byte[1024];\r\n\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n //3--------- delete SIM Export\r\n ftpClient.delete(filename);\r\n }\r\n }\r\n\r\n //4--------- copy POS Import to SIM Backup\r\n remotePath=\"..\\\\..\\\\..\\\\Batch\\\\Backup\\\\Export\";\r\n localPath=\"Batch\\\\Import\\\\\";\r\n\r\n ftpClient.cd(remotePath);\r\n\r\n //get list of file\r\n dir = new File(localPath);\r\n children = dir.list();\r\n if (children != null) {\r\n for (int i = 0; i < children.length; i++) {\r\n // Get filename of file or directory\r\n filename = children[i];\r\n TelnetOutputStream os = ftpClient.put(filename);\r\n File file_in = new File(localPath + filename);\r\n is = new FileInputStream(file_in);\r\n byte[] bytes = new byte[1024];\r\n\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n }\r\n }\r\n\r\n //5--------- copy from POS Export to SIM Import\r\n remotePath=\"..\\\\..\\\\..\\\\Batch\\\\Import\";\r\n localPath=\"Batch\\\\Export\\\\\";\r\n ftpClient.cd(remotePath);\r\n\r\n //get list of file\r\n dir = new File(localPath);\r\n children = dir.list();\r\n if (children != null) {\r\n for (int i = 0; i < children.length; i++) {\r\n // Get filename of file or directory\r\n filename = children[i];\r\n TelnetOutputStream os = ftpClient.put(filename);\r\n File file_in = new File(filename);\r\n is = new FileInputStream(localPath + file_in);\r\n byte[] bytes = new byte[1024];\r\n while ( (c = is.read(bytes)) != -1) {\r\n os.write(bytes, 0, c);\r\n }\r\n is.close();\r\n os.close();\r\n }\r\n }\r\n\r\n //---------- close ftp\r\n ftpClient.closeServer();\r\n }\r\n catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public List<String> ftpFileList(String userid, String pwd , String Url , String FilePath, int portNum){\r\n\t\t\r\n FTPClient client = new FTPClient();\r\n \r\n List<String> fileName = new ArrayList<String>();\r\n try {\r\n \tclient.connect(Url,portNum);\r\n \t\r\n client.login(userid , pwd);\r\n \r\n //client.enterRemotePassiveMode();\r\n //client.changeWorkingDirectory(\"/board\");\r\n\r\n //\r\n // Obtain a list of filenames in the current working \r\n // directory. When no file found an empty array will \r\n // be returned.\r\n //\r\n //client.changeWorkingDirectory(\"KC1\");\r\n client.setControlEncoding(\"utf-8\");\r\n client.changeWorkingDirectory(FilePath);\r\n \r\n String workDirectory = client.printWorkingDirectory();\r\n \r\n// LOGGER.debug(\"workDirectory::::::::::\"+workDirectory);\r\n String[] names = client.listNames();\r\n// for (String name : names) {\r\n// \tLOGGER.info(\"Name = \" + name);\r\n// }\r\n\r\n\r\n FTPFile[] ftpFiles = client.listFiles(\"/\"+FilePath);\r\n \r\n for (FTPFile ftpFile : ftpFiles) {\r\n //\r\n // Check if FTPFile is a regular file\r\n //\r\n if (ftpFile.getType() == FTPFile.FILE_TYPE) {\r\n// \tLOGGER.debug(\"====================================================\");\r\n// LOGGER.info(\"FTPFile: \" + ftpFile.getName() + \r\n// \"; \" + FileUtils.byteCountToDisplaySize(\r\n// ftpFile.getSize()));\r\n fileName.add(ftpFile.getName().toString());\r\n// LOGGER.debug(\"fileName :\" + fileName);\r\n }\r\n }\r\n client.logout();\r\n \r\n } catch (IOException e) {\r\n //e.printStackTrace();\r\n LOGGER.info(e.getMessage());\r\n } finally {\r\n try {\r\n client.disconnect();\r\n } catch (IOException e) {\r\n //e.printStackTrace();\r\n \tLOGGER.info(e.getMessage());\r\n }\r\n }\r\n return fileName;\r\n\t}", "int getCmd();", "public static boolean isRetrLikeCommand(FtpCommandCode command) {\r\n \t\treturn (command == RETR);\r\n \t}", "public final void mT__54() throws RecognitionException {\n try {\n int _type = T__54;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:54:7: ( 'FTP' )\n // ../org.xtext.example.mydslsample/src-gen/org/xtext/example/mydsl/parser/antlr/internal/InternalMyDslSample.g:54:9: 'FTP'\n {\n match(\"FTP\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "private void connect() {\n ftp.connect();\n if (ftp.goodReply()) sendResponse(\"Connected\");\n else sendResponse(\"Could not connect to server\");\n }", "public int send2FtpServer()\n\t{\n\t\tCoFile file = null;\n\t\tCoFile to = null;\n\t\tString filename = \"\";\n\t\tString dest_filename = \"\";\n\t\tString sum_line = \"\";\n\t\tboolean loadResult = false;\n\t\tboolean renameFileResult = false;\n\t\tfor (int i = 0; i < vFiles.size(); i++)\n\t\t{\n\t\t\tfilename = ((File) (vFiles.elementAt(i))).getName();\n\t\t\t/* source FtpFile remote file */\n\t\t\tfile = new LocalFile(FtpData.LOCAL_FOLDER, filename);\n\t\t\t// System.out.println(\"From: \" + file.toString());\n\t\t\t/* destination LocalFile home dir */\n\t\t\t// ---------------------count ftp file\n\t\t\t// site--------------------------------\n\t\t\tFile f = new File(FtpData.LOCAL_FOLDER + \"/\" + filename);\n\t\t\tString fileLength = String.valueOf(f.length());\n\t\t\t// System.out.println(\"file size: \" + fileLength);\n\t\t\t// ---------------------count ftp file\n\t\t\t// site--------------------------------\n\n\t\t\tto = new FtpFile(\"tmp_\" + filename, this.ftp);\n\n\t\t\t// System.out.println(\"To: \" + to.toString());\n\t\t\t/* download file */\n\t\t\tloadResult = CoLoad.copy(to, file);\n\t\t\tLogger.info(\"FTP-SIZE: \" + loadResult);\n\t\t\t// System.out.println(\"Load: \" + loadResult);\n\t\t\t// rename file sau khi ftp sang\n\t\t\t// System.out.print(\"Start rename file cdr: \" + \"tmp_\" + filename +\n\t\t\t// \"-->\" + filename);\n\t\t\trenameFileResult = this.ftp.mv( \"tmp_\" + filename, \"\" + filename);\n\t\t\t// System.out.println(\"Rename: \" + renameFileResult);\n\t\t\tLogger.info(\"FTP-RENAME: \" + renameFileResult);\n\t\t\tif (loadResult && renameFileResult)\n\t\t\t{ // ok -->delete file.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tString sDateFolder = DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp(), \"\");\n\n\t\t\t\t\t// File dest_dir = new File(FtpData.SENT_FOLDER + \"\\\\\" +\n\t\t\t\t\t// sDateFolder);\n\t\t\t\t\tFile dest_dir = new File(FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder);\n\n\t\t\t\t\tboolean exists = dest_dir.exists();\n\t\t\t\t\tif (!exists)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Directory does not exist --> create it\n\t\t\t\t\t\tboolean success = dest_dir.mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\t// fileTool.copy(FtpData.LOCAL_FOLDER + \"\\\\\" +\n\t\t\t\t\t// file.getName(),\n\t\t\t\t\t// FtpData.SENT_FOLDER + \"\\\\\" + sDateFolder + \"\\\\\" +\n\t\t\t\t\t// file.getName());\n\t\t\t\t\tfileTool.copy(FtpData.LOCAL_FOLDER + \"/\" + file.getName(), FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder + \"/\" + file.getName());\n\t\t\t\t\t\n\t\t\t\t\tLogger.info(\"backup file: from: \" + FtpData.LOCAL_FOLDER + \"/\" + file.getName() + \" to: \" + FtpData.SENT_FOLDER_VMS + \"/\" + sDateFolder\n\t\t\t\t\t\t\t+ \"/\" + file.getName());\n\t\t\t\t\tfile.delete();\n\t\t\t\t\tCdrFilename4vms.setNewFilenameVMS(filename);\n\t\t\t\t\tLogger.info(\"FTP : file name: \" + filename + \"# filesize: \" + fileLength + \" bytes\");\n\t\t\t\t}\n\t\t\t\tcatch (IOException ex)\n\t\t\t\t{\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\tLogger.info(\"FTP\", ex.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif ((loadResult = false) && (renameFileResult = true))\n\t\t\t\t\t{\n\t\t\t\t\t\t// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Khong ftp duoc file cuoc sang telcos!\",\n\t\t\t\t\t\t// 1, Preference.alert_person,\n\t\t\t\t\t\t// Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Khong ftp duoc file cuoc sang telcos! \", 1, 0, \"serious\", Preference.alert_person);\n\t\t\t\t\t}\n\t\t\t\t\telse if ((loadResult = true) && (renameFileResult = false))\n\t\t\t\t\t{\n\t\t\t\t\t\t// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Khong rename duoc file cuoc sau khi ftp sang telcos!\",\n\t\t\t\t\t\t// 1, Preference.alert_person,\n\t\t\t\t\t\t// Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Khong rename duoc file cuoc sau khi ftp ! \", 1, 0, \"serious\", Preference.alert_person);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// DBTools.log_alert(Preference.sourceAddressList.toString(),\n\t\t\t\t\t\t// \"CDR->FTP\",\n\t\t\t\t\t\t// \"<-\" + Preference.mobileOperator +\n\t\t\t\t\t\t// \"-> ERROR: Loi ftp file cuoc\",\n\t\t\t\t\t\t// 1, Preference.alert_person, Preference.alert_mobile);\n\t\t\t\t\t\tDBTools.log_alert(\"Billing system\", \"-> ERROR: Loi ftp file cuoc ! \", 1, 0, \"serious\", Preference.alert_person);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.vFiles.size();\n\t}", "@FunctionName(\"FTPDirectoryInfo\")\r\n @StorageAccount(\"StorageAccount\")\r\n public HttpResponseMessage run(\r\n @HttpTrigger(name = \"req\", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.FUNCTION) HttpRequestMessage<Optional<String>> request,\r\n final ExecutionContext context) {\r\n context.getLogger().info(\"Java HTTP trigger processed a request.\");\r\n\r\n // Setup FTP connection information.\r\n Boolean isImplicit = Boolean.TRUE;\r\n FTPSClient ftpsClient = new FTPSClient(isImplicit);\r\n Map<String, String> ftpClientProperties = FTPFunctionsUtil.getPropertiesMap(\"ftps-connection.properties\");\r\n\r\n try {\r\n context.getLogger().info(\"Connecting to FTP Server...\");\r\n ftpsClient.connect(ftpClientProperties.get(\"ftpsServer\"));\r\n ftpsClient.login(ftpClientProperties.get(\"user\"), ftpClientProperties.get(\"password\"));\r\n ftpsClient.setFileType(FTP.BINARY_FILE_TYPE);\r\n ftpsClient.changeWorkingDirectory(ftpClientProperties.get(\"popDirectory\"));\r\n ftpsClient.enterLocalPassiveMode();\r\n\r\n context.getLogger().info(\"Downloading file from server directory...\");\r\n FTPFile[] files = ftpsClient.listFiles(ftpClientProperties.get(\"popDirectory\"));\r\n int returnCode = ftpsClient.getReplyCode();\r\n if (returnCode == 550) {\r\n return request.createResponseBuilder(HttpStatus.NOT_ACCEPTABLE).body(\"( 'response' : 'File does not exist.' }\").build();\r\n }\r\n context.getLogger().info(String.valueOf(ftpsClient.getReplyCode()));\r\n context.getLogger().info(ftpsClient.getReplyString());\r\n ftpsClient.logout();\r\n\r\n StringJoiner joiner = new StringJoiner(\"\");\r\n for (int i = 0; i < files.length; i++) {\r\n joiner.add(\"'\" + files[i].getName() + \"'\");\r\n if (i < files.length - 1) {\r\n joiner.add(\",\");\r\n }\r\n }\r\n String response = \"{ 'response' : [\" + joiner.toString() + \"] }\";\r\n return request.createResponseBuilder(HttpStatus.OK).body(response).build();\r\n } catch (IOException e) {\r\n return request.createResponseBuilder(HttpStatus.FAILED_DEPENDENCY).body(\"{ 'response' : 'Unsuccessful in connecting to the FTP server and deleting the file.' }\").build();\r\n }\r\n }", "public interface CommandInterface {\n\n\tpublic static class Commands\n\t{\n\t\tpublic static final String ABORT = \"ABOR\";\n\t\tpublic static final String ACCOUNT_INFO = \"ACCT\";\n\t\tpublic static final String AUTHENTICATION_DATA = \"ADAT\";\n\t\tpublic static final String ALLOCATE_DISK_SPACE = \"ALLO\";\n\t\tpublic static final String APPEND = \"APPE\";\n\t\tpublic static final String AUTHENTICATION_MECHANISM = \"AUTH\";\n\t\tpublic static final String GET_AVAILABLE_SPACE = \"AVBL\";\n\t\tpublic static final String CLEAR_COMMAND_CHANNEL = \"CCC\";\n\t\tpublic static final String CHANGE_TO_PARENT_DIRECTORY = \"CDUP\";\n\t\tpublic static final String CONFIDENTIALITY_PROTECTION_COMMAND = \"CONF\";\n\t\tpublic static final String SERVER_IDENTIFICATION = \"CSID\";\n\t\tpublic static final String CHANGE_WORKING_DIRECTORY = \"CWD\";\n\t\tpublic static final String DELETE_FILE = \"DELE\";\n\t\tpublic static final String GET_DIRECTORY_SIZE = \"DSIZ\";\n\t\tpublic static final String PRIVACY_PROTECTED = \"ENC\";\n\t\tpublic static final String SPECIFY_ADDRESS_AND_PORT = \"EPRT\";\n\t\tpublic static final String ENTER_EXTENDED_PASSIVE_MODE = \"EPSV\";\n\t\tpublic static final String GET_FEATURE_LIST = \"FEAT\";\n\t\tpublic static final String HELP = \"HELP\";\n\t\tpublic static final String GET_HOST_BY_NAME = \"HOST\";\n\t\tpublic static final String LANGUAGE_NEGOTIATION = \"LANG\";\n\t\tpublic static final String GET_FILES_LIST = \"LIST\";\n\t\tpublic static final String SPECIFY_LONGADDRESS_AND_PORT = \"LPRT\";\n\t\tpublic static final String ENTER_LONG_PASSIVE_MODE = \"LPSV\";\n\t\tpublic static final String GET_LAST_MODIFICATION_TIME = \"MDTM\";\n\t\tpublic static final String MODIFY_CREATION_TIME = \"MFCT\";\n\t\tpublic static final String MODIFY_FACT = \"MFF\";\n\t\tpublic static final String MODIFY_MODYFICATION_TIME = \"MFMT\";\n\t\tpublic static final String INTEGRITY_PROTECTION = \"MIC\";\n\t\tpublic static final String MAKE_DIRECTORY = \"MKD\";\n\t\tpublic static final String LIST_A_CONTENT = \"MLSD\";\n\t\tpublic static final String PROVIDES_DATA = \"MLST\";\n\t\tpublic static final String SET_TRANSFER_MODE = \"MODE\";\n\t\tpublic static final String LIST_OF_FILE_NAMES = \"NLST\";\n\t\tpublic static final String NO_OPERATION = \"NOOP\";\n\t\tpublic static final String SELECT_OPTIONS = \"OPTS\";\n\t\tpublic static final String AUTHENTICATION_PASSWORD = \"PASS\";\n\t\tpublic static final String ENTER_PASSIVE_MODE = \"PASV\";\n\t\tpublic static final String PROTECTION_BUFFER_SIZE = \"PBSZ\";\n\t\tpublic static final String SPECIFY_PORT = \"PORT\";\n\t\tpublic static final String DATA_CHANNEL_PROTECTION_LEVEL = \"PROT\";\n\t\tpublic static final String PRINT_WORKING_DIRECTORY = \"PWD\";\n\t\tpublic static final String DISCONNECT = \"QUIT\";\n\t\tpublic static final String REINITIALIZE = \"REIN\";\n\t\tpublic static final String RESTART = \"REST\";\n\t\tpublic static final String RETRIEVE_A_COPY = \"RETR\";\n\t\tpublic static final String REMOVE_DIRECTORY = \"RMD\";\n\t\tpublic static final String REMOVE_DIRECTORY_TREE = \"RMDA\";\n\t\tpublic static final String RENAME_FROM = \"RNFR\";\n\t\tpublic static final String RENAME_TO = \"RNTO\";\n\t\tpublic static final String SITE_SPECIFFIC_COMMAND = \"SITE\";\n\t\tpublic static final String SIZE_OF_FILE = \"SIZE\";\n\t\tpublic static final String MOUNT_FILE_STRUCTURE = \"SMNT\";\n\t\tpublic static final String USE_SINGLE_PORT_PASSIVE_MODE = \"SPSV\";\n\t\tpublic static final String GET_STATUS = \"STAT\";\n\t\tpublic static final String ACCEPT_AND_STORE = \"STOR\";\n\t\tpublic static final String STORE_FILE_UNIQUELY = \"STOU\";\n\t\tpublic static final String SET_FILE_TRANSFER_STRUCT = \"STRU\";\n\t\tpublic static final String GET_SYSTEM_TYPE = \"SYST\";\n\t\tpublic static final String GET_THUMBNAIL = \"THMB\";\n\t\tpublic static final String SET_TRANSFER_TYPE = \"TYPE\";\n\t\tpublic static final String AUTHENTICATION_USERNAME = \"USER\";\n\t}\n\t\n\t/**\n\t * Types of transmission.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class TransmissionTypes\n\t{\n\t\tpublic static final String BINARY = \"I\";\n\t\tpublic static final String ASCII = \"A\";\n\t}\n\n\t/**\n\t * Inner class for responses from server.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class ServerResonses\n\t{\n\t\t/**\n\t\t * 1xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitivePreliminaryReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"100\";\n\t\t\tpublic static final String RESTART_REPLY = \"110\";\n\t\t\tpublic static final String SERVICE_READY = \"120\";\t\n\t\t\tpublic static final String DATA_CONNECTION_ALREADY_OPENED = \"125\";\n\t\t\tpublic static final String FILE_STATUS_OKAY = \"150\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 2xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitiveCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"200\";\n\t\t\tpublic static final String SYSTEM_STATUS = \"211\";\n\t\t\tpublic static final String DIRECTORY_STATUS = \"212\";\n\t\t\tpublic static final String FILE_STATUS = \"213\";\n\t\t\tpublic static final String HELP_MESSAGE = \"214\";\n\t\t\tpublic static final String NAME_SYSTEM_TYPE = \"215\";\n\t\t\tpublic static final String READY_FOR_NEW_USER = \"220\";\n\t\t\tpublic static final String SERVICE_CLOSING_CONTROL_CONNECTION = \"221\";\n\t\t\tpublic static final String OPEN_DATA_CONNECTION = \"225\";\t\t\t\n\t\t\tpublic static final String CLOSING_DATA_CONNECTION = \"226\";\n\t\t\tpublic static final String PASSIVE_MODE = \"227\";\n\t\t\tpublic static final String LONG_PASSIVE_MODE = \"228\";\n\t\t\tpublic static final String EXTENDED_PASSIVE_MODE = \"229\";\n\t\t\tpublic static final String USER_LOG_IN = \"230\";\n\t\t\tpublic static final String USER_LOG_OUT = \"231\";\n\t\t\tpublic static final String LOGOUT_NOTED = \"232\";\n\t\t\tpublic static final String REQUESTED_OK = \"250\";\n\t\t\tpublic static final String PATHNAME_CREATED = \"257\";\t\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 3xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PositiveIntermediateReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"300\";\n\t\t\tpublic static final String USERNAME_OK_PASSWORD_NEEDED = \"331\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_LOGIN = \"332\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION = \"350\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 4xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class TransientNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"400\";\n\t\t\tpublic static final String SERVICE_NOT_AVAILABLE = \"421\";\n\t\t\tpublic static final String CANT_OPEN_DATA_CONNECTION = \"425\";\n\t\t\tpublic static final String CONNECTION_CLOSED = \"426\";\n\t\t\tpublic static final String INVALID_USERNAME_OR_PASSWORD = \"430\";\n\t\t\tpublic static final String REQUESTED_HOST_UNAVAILABLE = \"434\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION_NOT_TAKEN = \"450\";\n\t\t\tpublic static final String LOCAL_ERROR = \"451\";\n\t\t\tpublic static final String FILE_BUSY = \"452\";\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 5xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PermamentNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"500\";\n\t\t\tpublic static final String SYNTAX_ERROR = \"501\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED = \"502\";\n\t\t\tpublic static final String BAD_SEQUENCE_OF_COMMANDS = \"503\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = \"504\";\n\t\t\tpublic static final String NOT_LOGGED_IN = \"530\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_STORING_FILES = \"532\";\n\t\t\tpublic static final String POLICY_REQUIRES_SSL = \"534\";\n\t\t\tpublic static final String FILE_NOT_FOUND = \"550\";\n\t\t\tpublic static final String PAGE_TYPE_UNKNOWN = \"551\";\t\t\t\n\t\t\tpublic static final String EXCEEDED_STORAGE_ALLOCATION = \"552\";\n\t\t\tpublic static final String FILE_NAME_NOT_ALLOWED = \"553\";\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 6xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class ProtectedReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"600\";\n\t\t\tpublic static final String INTEGRITY_PROTECTED_REPLY = \"631\";\n\t\t\tpublic static final String CONFIDENTIALITY_AND_INTEGRITY_PROTECTED_REPLY = \"632\";\t\t\t\n\t\t\tpublic static final String CONFIDENTIALITY_PROTECTED_REPLY = \"633\";\t\t\t\n\t\t}\n\t}\n\t\n\t/**\n\t * Language controller.\n\t */\n\tpublic final static LanguageController lc = LanguageController.getInstance();\n\t\n\tpublic void execute(FTPLexer lexer);\n}", "Optional<String> command();", "@Override\n\tpublic void doAction(FTPSession sessionData, String message) {\n\t}", "@SuppressWarnings(\"deprecation\")\n\tpublic void test1() throws Exception {\n\t\t\tFTPClient ftp = new FTPClient(); \n\t\t\tftp.connect(\"192.168.1.137\",21 );\n\t\t\tboolean blogin = ftp.login(\"ftp\", \"ftp\");\n\t\t\tif (!blogin) {\n\t\t\t\tSystem.out.println(\"测试\");\n\t\t\t\tftp.disconnect();\n\t\t\t\tftp = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t/*\n\t\t\t * boolean bMakeFlag = ftp.makeDirectory(new\n\t\t\t * String(\"中共中央政治局常委\".getBytes( \"gb2312\"), \"iso-8859-1\")); \n\t\t\t * //File file = new File(\"c:\\\\test.properties\");\n\t\t\t * ftp.storeFile(\"test.properties\",new FileInputStream(file));\n\t\t\t */\n\t\t\tSystem.out.println(ftp.getSystemName());\n\t\t\tFTPFile[] ftpFiles = ftp.listFiles();\n\t\t\tif (ftpFiles != null){\n\t\t\t\tfor (int i = 0; i < ftpFiles.length; i++) {\n\t\t\t\t\tSystem.out.println(ftpFiles[i].getName()); \n\t\t\t\t\t// System.out.println(ftpFiles[i].isFile());\n\t\t\t\t\t// if(ftpFiles[i].isFile()){\n\t\t\t\t\t//FTPFile ftpf = new FTPFile();\n\t\t\t\t\t /*System.err.println(ftpf.hasPermission(FTPFile.GROUP_ACCESS,\n\t\t\t\t\t FTPFile.EXECUTE_PERMISSION));\n\t\t\t\t\t System.err.println(\"READ_PERMISSION=\"+ftpf.hasPermission(FTPFile.USER_ACCESS,\n\t\t\t\t\t FTPFile.READ_PERMISSION));\n\t\t\t\t\t System.err.println(\"EXECUTE_PERMISSION=\"+ftpf.hasPermission(FTPFile.USER_ACCESS,\n\t\t\t\t\t FTPFile.EXECUTE_PERMISSION));\n\t\t\t\t\t System.err.println(\"WRITE_PERMISSION=\"+ftpf.hasPermission(FTPFile.USER_ACCESS,\n\t\t\t\t\t FTPFile.WRITE_PERMISSION));\n\t\t\t\t\t System.err.println(ftpf.hasPermission(FTPFile.WORLD_ACCESS,\n\t\t\t\t\t FTPFile.READ_PERMISSION));*/\n\t\t\t\t}\n\t\t\t\t// System.out.println(ftpFiles[i].getUser());\n\t\t\t}\n\t\t}", "java.lang.String getCommand();", "public interface FtpClientInterface {\n\n\t/**\n\t * Connects to an FTP server and logs in with the supplied username and\n\t * password.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void connect() throws IOException;\n\n\t/**\n\t * Disconnects from the FTP server.\n\t * \n\t * @throws IOException\n\t */\n\tpublic void disconnect() throws IOException;\n\n\t/**\n\t * Browse the current directory in depth\n\t * \n\t * @throws Exception\n\t */\n\tpublic void deepList() throws Exception;\n\n}", "public String exec(String cmd) throws IOException {\n\t\tSocket socket = null;\n\t\ttry {\n\t\t\tsocket = new Socket(host, port);\n\t\t\tInputStream in = socket.getInputStream();\n\t\t\tOutputStream out = socket.getOutputStream();\n\t\t\tProtocolSupport.send(\"host:transport:\" + serial, in, out);\n\n\t\t\tProtocolSupport.send(\"shell:\" + cmd, in, out);\n\t\t\tint i = -1;\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\twhile ((i = in.read()) != -1) {\n\t\t\t\tsb.append((char) i);\n\t\t\t}\n\t\t\treturn sb.toString();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\ttry {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\tcatch (IOException e1) {\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tFTPClient client = new FTPClient();\n\t\tint firstMenu=0;\n\t\tint secondMenu=0;\n\t\tString connetNetAdress = null ;\n\t\tint portNumber =0 ;\n\t\tString downFile = null ;\n\t\tString downFileLocal = null ;\n\t\tString ID =null;\n\t\tString passWord=null;\n\t\tString upFile =null ;\n\t\tString[] FilelList = null ;\n\t\tString[] FilelList2 = null ;\n\t\tint FileList3 = 0 ;\n\t\tlong FileList4= 0;\n\t\tint fileHowMany =0 ;\n\t\t//client.listNames();\n\t\tSystem.out.println(\"===FTP Client Program===\");\n\t\twhile(true) {\n\t\t\tSystem.out.println(\"1. Connect FTP server\");\n\t\t\tSystem.out.println(\"2. Exit Program\");\n\t\t\tSystem.out.print(\">>> \");\n\t\t\ttry {\n\t\t\t\tfirstMenu = Integer.parseInt(sc.nextLine());\n\t\t\t}catch (Exception e){\n\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\n\t\t\tswitch (firstMenu) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println(\"Input url\");\n\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\tconnetNetAdress = sc.nextLine();\n\t\t\t\tSystem.out.println(\"Input Port\");\n\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\tportNumber = Integer.parseInt(sc.nextLine());\n\t\t\t\ttry {\n\t\t\t\t\tSystem.out.println(\"Try to connet :\" + connetNetAdress +\"(port : \"+portNumber+\")\");\n\t\t\t\t\tclient.connect(connetNetAdress, portNumber);\t\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"Fail --- Exit Program\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"FTP Server is conneted!\");\n\n\t\t\t\tSystem.out.print(\"Input ID : \");\n\t\t\t\t//ID = sc.nextLine();\n\t\t\t\tSystem.out.println(\"Input Password : \");\n\t\t\t\t//passWord = sc.nextLine();\n\n\t\t\t\tfor(int i= 1;i<10;i++) {\n\t\t\t\t\tint a=i;\n\t\t\t\t\tfor(int j=1;j<10;j++) {\n\t\t\t\t\t\tint b=j;\n\t\t\t\t\t\tfor(int k=1;k<10;k++){\n\t\t\t\t\t\t\tint c=k;\n\t\t\t\t\t\t\tfor(int l= 1;l<10;l++){\t\n\t\t\t\t\t\t\t\tint d=l;\n\t\t\t\t\t\t\t\tString ab = \"\"+a+b+c+d;\n\t\t\t\t\t\t\t\tSystem.out.println(\"\"+a+b+c+d);\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tclient.login(\"java\", ab);\n\t\t\t\t\t\t\t\t\twhile(true) {\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"login success!\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"1. Upload File\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"2. Download File\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"3. Disconnect FTP Server\");\n\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tsecondMenu = Integer.parseInt(sc.nextLine());\n\t\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif(secondMenu==0) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tswitch (secondMenu) {\n\t\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Current Directory : /\");\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tFTPFile[] list = client.list(\"*.*\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor(int p=0; p <list.length ;p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList[i] = list[i].getName();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList2[i] = list[i].getLink();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList3 = list[i].getType();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList4 = list[i].getSize();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tSystem.out.println(FilelList[i]+\" \"+FilelList2[i]+\" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t+FileList3+\" \"+FileList4+\" \");\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(list[p]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일목록을 불어올수가 없습니다. \");\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input file's full name you want to upload\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tupFile = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tclient.upload(new File(upFile));;\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e){\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일업로드 완성\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Current Directory : /\");\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tFTPFile[] list = client.list(\"*.*\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor(int p=0; p <list.length ;p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList[i] = list[i].getName();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFilelList2[i] = list[i].getLink();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList3 = list[i].getType();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tFileList4 = list[i].getSize();\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\tSystem.out.println(FilelList[i]+\" \"+FilelList2[i]+\" \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t//\t\t\t\t\t\t\t\t\t\t+FileList3+\" \"+FileList4+\" \");\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(list[p]);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일목록을 불어올수가 없습니다. \");\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input file's full name you want to download\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tdownFile = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Input path + New Name\");\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\">>> \");\n\t\t\t\t\t\t\t\t\t\t\tdownFileLocal = sc.nextLine();\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\t\t\t\t\t\tclient.download(downFile, new File(downFileLocal));\n\t\t\t\t\t\t\t\t\t\t\t}catch(Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\t//e.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일 다운로드에 실패했습니다.\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"파일다운로드 완료\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"연결을 끊습니다.\");\n\t\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\t\tclient.disconnect (true);\n\t\t\t\t\t\t\t\t\t\t\t}catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"연결 끊기에 실패하였습니다.\");\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t//main(args);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"메뉴를 확인해주세요\");\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (FTPIllegalReplyException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t} catch (FTPException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tSystem.out.println(\"Exit Program\");\n\t\t\t\tSystem.exit(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Wrong Code\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\n\t\tSystem.out.println(\"ftp download \" + sdf.format(new Date()) );\n\t\t\n\t\ttry {\n\t\t\t// 从FTP中下载对账文件 参数 (ftp对象,本地地址,文件名)\n\t\t\tFtpUtil fu = new FtpUtil() ;\n\t\t\tfu.startDown(f, downloadUrl, f.getPath());//下载ftp文件测试\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\n\t\t}\n\t}", "java.lang.String getServiceCmd();", "public void onFTP(\r\n final String senderIP, \r\n final String senderName, \r\n final String fileName,\r\n final String fullpath,\r\n final int socketNo,\r\n final long fileLength) {\n // Process this ftp request with a thread so that\r\n // further messages can be processed without waiting for\r\n // finishing of this ftp.\r\n //\r\n Thread ftpThread = new Thread() {\r\n public void run() {\r\n\t\t\t\tFile \tselectedFile\t= null;\r\n\r\n\t\t\t\tsynchronized (FTPListenerImpl.this) {\r\n\t\t\t\t\tif (fFileChooser == null) {\r\n\t\t\t\t\t\tfFileChooser = new JFileChooser(\".\");\r\n\t\t\t\t\t\tfFileChooser.setDialogTitle(\"MessagingTool: \" + StringDefs.SAVE_FILE_AS);\r\n\t\t\t\t\t}\r\n\t\t\t\t \tselectedFile = new File(fFileChooser.getCurrentDirectory(), fileName);\r\n\t\t\t\t\tComponentUtil.overlapComponents(fFileChooser, fParentFrame, 32, false);\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\tfFileChooser.setSelectedFile(selectedFile);\r\n\t\t\t\t\t\tint status = fFileChooser.showSaveDialog(fParentFrame);\r\n\t\t\t\t\t\tif (status != JFileChooser.APPROVE_OPTION)\r\n \t\t\t\t \t\treturn;\r\n\r\n\t\t\t\t \t\tselectedFile = fFileChooser.getSelectedFile();\r\n\t\t\t\t\t\tif (!selectedFile.exists()) \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tObject[] options = { StringDefs.YES, StringDefs.NO };\r\n\r\n\t\t\t\t\t\t\tfParentFrame.getToolkit().beep();\r\n\t\t\t\t\t\t\tint choice = JOptionPane.showOptionDialog(fParentFrame,\r\n\t\t\t\t\t\t\t\tselectedFile + StringDefs.FILE_EXISTS,\r\n\t\t\t\t\t\t\t\t\"\",\r\n\t\t\t\t\t\t\t\tJOptionPane.YES_NO_OPTION,\r\n\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE,\r\n\t\t\t\t\t\t\t\tnull, options, options[0]);\r\n\t\t\t\t\t \t\tif (choice == JOptionPane.YES_OPTION)\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \r\n FileOutputStream outStream = null;\r\n\r\n try {\r\n outStream = new FileOutputStream(selectedFile);\r\n if (FTP.getInstance().retrieve(senderIP, fullpath, fileName, outStream, socketNo, fileLength))\r\n outStream.close();\r\n else {\r\n outStream.close();\r\n selectedFile.delete();\r\n }\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n selectedFile.delete();\r\n return;\r\n }\r\n }\r\n };\r\n\r\n ftpThread.setDaemon(true);\r\n ftpThread.start();\r\n }", "public static AbstractCommand getFromLine(FtpSession session, String line) {\r\n \t\tFtpCommandCode ftpCommandCode = null;\r\n \t\tif (line == null) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t\tline = \"\";\r\n \t\t}\r\n \t\tString command = null;\r\n \t\tString arg = null;\r\n \t\tif (line.indexOf(' ') == -1) {\r\n \t\t\tcommand = line;\r\n \t\t\targ = null;\r\n \t\t} else {\r\n \t\t\tcommand = line.substring(0, line.indexOf(' '));\r\n \t\t\targ = line.substring(line.indexOf(' ')+1);\r\n \t\t\tif (arg.length() == 0) {\r\n \t\t\t\targ = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\tString COMMAND = command.toUpperCase();\r\n \t\ttry {\r\n \t\t\tftpCommandCode = FtpCommandCode.valueOf(COMMAND);\r\n \t\t} catch (IllegalArgumentException e) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t}\r\n \t\tAbstractCommand abstractCommand;\r\n \t\ttry {\r\n \t\t\tabstractCommand = (AbstractCommand) ftpCommandCode.command.newInstance();\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t} catch (IllegalAccessException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t}\r\n \t\tabstractCommand.setArgs(session, COMMAND, arg, ftpCommandCode);\r\n \t\treturn abstractCommand;\r\n \t}", "public static void main(String[] args) throws IOException {\n\t\tString masterIP = args[0];\n\n\t\ttry {\n\t\t\tsock = new DatagramSocket(Machine.FILE_OPERATIONS_PORT);\n\t\t} catch (SocketException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tmyName = InetAddress.getLocalHost().getHostName();\n\t\t} catch (UnknownHostException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tScanner s = new Scanner(System.in);\n\t\tString cmd = null;\n\n\t\tserver = new FileTransferServer();\n\t\tserver.start();\n\n\t\twhile ((cmd = s.nextLine()) != null) {\n\n\t\t\tWriteLog.writelog(myName, cmd);\n\n\t\t\tif (\"exit\".equals(cmd)) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"put \")){\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(localFileName);\n\t\t\t\tputMsg.add(sdfsFileName);\n\t\t\t\tputMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\" + putMsg.elementAt(1)+putMsg.elementAt(2));\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"get \")){\n\t\t\t\tVector<String> getMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\n\t\t\t\tgetMsg.add(\"G\");\n\t\t\t\tgetMsg.add(sdfsFileName);\n\t\t\t\tgetMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\"+getMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(getMsg, masterIP);\n\t\t\t\tVector<String> serverIP = recvListMsg();\n\t\t\t\t//String copyFN = cmd.substring(cmd.lastIndexOf(' ')+1);\n\n\t\t\t\t//Runnable runnable = new FileTransferClient(copyFN, cmd.substring(4, cmd.indexOf(' ', 4)),serverIP.elementAt(0));\n\t\t\t\tRunnable runnable = new FileTransferClient(localFileName, sdfsFileName,serverIP.elementAt(0));\n\n\t\t\t\tThread thread = new Thread(runnable);\n\t\t\t\tthread.start();\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"delete \")){\n\t\t\t\tVector<String> delMsg = new Vector<String>();\n\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tdelMsg.add(\"D\");\n\t\t\t\tdelMsg.add(sdfsFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg: \" + delMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(delMsg, masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"updateMaster \")){\n\t\t\t\tmasterIP = cmd.substring(cmd.lastIndexOf(' ')+1);\n\t\t\t\tSystem.out.println(\"New master - \"+masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"maple \")) {\n\n\t\t\t\tVector<String> mapleMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, dirPath;\n\t\t\t\tFile[] listFiles = null;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tdirPath = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile directory = new File(dirPath);\n\t\t\t\tlistFiles = directory.listFiles();\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tif (tfile.isFile()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\t\tString dirname = directory.getName();\n\t\t\t\t\t\tSystem.out.println(filename);\n\t\t\t\t\t\tputMsg = new Vector<String>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tputMsg.add(\"P\");\n\t\t\t\t\t\tputMsg.add(dirPath+filename);\n\t\t\t\t\t\tputMsg.add(\"mj_\"+filename);\n\t\t\t\t\t\tputMsg.add(myName);\n\t\t\t\t\t\tSystem.out.println(\"client sending \"+putMsg+\" to master\");\n\t\t\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmapleMsg.add(\"maple\");\n\t\t\t\tmapleMsg.add(jarName);\n\t\t\t\tmapleMsg.add(sdfsFilePrefix);\n\n\t\t\t\t/*for(String sdfsFile : sdfsFiles) {\n\t\t\t\t\tmapleMsg.add(sdfsFile);\n\t\t\t\t}*/\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\tmapleMsg.add(\"mj_\"+filename);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"client sending \"+mapleMsg+\" to master\");\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 500);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(mapleMsg, masterIP);\n\n\t\t\t}else if(cmd.startsWith(\"juice \")) {\n\t\t\t\tVector<String> juiceMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, juiceFileName;\n\t\t\t\tInteger numJuices;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tnumJuices = lineScanner.nextInt();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tjuiceFileName = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tjuiceMsg.add(\"juice\");\n\t\t\t\tjuiceMsg.add(jarName);\n\t\t\t\tjuiceMsg.add(numJuices.toString());\n\t\t\t\tjuiceMsg.add(sdfsFilePrefix);\n\t\t\t\tjuiceMsg.add(juiceFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendJuiceMsg: \" + juiceMsg.elementAt(1));\n\n\t\t\t\tsendMsgToMaster(juiceMsg, masterIP);\n\t\t\t}\n\n\t\t}\n\n\t}", "String getCommand();", "public void testFtpFileTransferNamesAndCommands() throws Exception {\n System.out.println(\"FtpFileTransferNamesAndCommands\");\n // abstract now \n /*\n assertNotNull(new FtpFileTransferNamesAndCommands(ftp));\n assertNotNull(new FtpFileTransferNamesAndCommands(new FtpFileTransferNamesAndCommands(ftp), new FtpFileConfiguration(ftp)));\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null, null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(null, new FtpFileConfiguration(ftp)));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n \n try {\n assertNotNull(new FtpFileTransferNamesAndCommands(new FtpFileTransferNamesAndCommands(ftp), null));\n fail(\"An exception is expected - invalid input\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n */\n }", "public static void main(String[] args) {\n\t\t//num of args\n\t\tif (args.length != 2) {\n\t\t\tSystem.out.println(\"Error: Invalid number of arguments\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//port number\n\t\tint port = 0;\n\t\ttry {\n\t\t\tport = Integer.parseInt(args[1]);\n\t\t} catch(Exception e) {\n\t\t\tSystem.out.println(\"Error: Invalid port number\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//hostname\n\t\ttry {\n\t\t\tInetAddress.getByName(args[0]);\n\t\t} catch (Exception f) {\n\t\t\tSystem.out.println(\"Error: hostname does not resolve to an IP address\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//server\n\t\ttry {\n\t\t\tmyftp instance = new myftp(args[0], port);\n\t\t\tinstance.input();\n\t\t} catch(SocketTimeoutException ste) {\n\t\t\tSystem.out.println(\"Error: host could not be reached\");\n\t\t} catch(ConnectException ce) {\n\t\t\tSystem.out.println(\"Error: no running FTP at remote host\");\n\t\t} catch(Exception h) {\n\t\t\tSystem.out.println(\"Error: program quit unexpectedly\");\n\t\t}\n\t}", "@GET\n @Path(\"/data/{dir}/{name}\")\n @Produces(\"text/html\")\n public String getFile(@PathParam( \"name\" ) String name,@PathParam( \"dir\" ) String dir)throws IOException {\n\n if(!login)\n return logIn();\n\n System.out.println(commandes.getCurrentDir());\n if(commandes.CMDCWD(\"/data/\"+dir)){\n String result = AdditionnalResources.searchFile(name);\n if(commandes.getCurrentDir().equals(\"data/\"+dir)){\n result += \"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/\"+name+\"/edit\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Edit\\\">\"+\n \"</form></br>\";\n result += \"<button onclick= \\\"p()\\\">Delete</button>\"+\n \"<script type=\\\"text/javascript\\\">\"+\n \"function p(){\"+\n \"console.log(\\\"Ici\\\");\"+\n \"xhr=window.ActiveXObject ? new ActiveXObject(\\\"Microsoft.XMLHTTP\\\") : new XMLHttpRequest();\"+\n \"xhr.onreadystatechange=function(){};\"+\n \"xhr.open(\\\"DELETE\\\", \\\"http://localhost:8080/rest/tp2/ftp/data/\"+dir+\"/\"+name+\"\\\");\"+\n \"xhr.send(null);\"+\n \"};\"+\n \"</script>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/data/\"+dir+\"\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Return\\\">\"+\n \"</form></br>\";\n }else{\n result +=\"<form action=\\\"/rest/tp2/ftp/\"+commandes.getCurrentDir()+\"/add\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Add File\\\">\"+\n \"</form></br>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/logout\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Logout\\\">\"+\n \"</form></br>\";\n }\n return result;\n\n }\n return \"<h1>PATH NOT FOUND</h1>\";\n }", "public boolean sendFile(String[] arg)\n\t{\n\t\tif(arg.length!=2){\n\t\t System.err.println(\"usage: java ScpTo file1 user@remotehost:file2\");\n\t\t}\n\n\t FileInputStream fis=null;\n\t boolean returnValue = true;\n\n\t System.out.println(\"arg[0][\" + arg[0] + \"]\");\n\t System.out.println(\"arg[1][\" + arg[1] + \"]\");\n\t \n\t\ttry{\n\t\t\tString lfile=arg[0];\n\t\t\targ[1]=arg[1].substring(arg[1].indexOf('@')+1);\n\t\t\tString host=arg[1].substring(0, arg[1].indexOf(':'));\n\t\t\tString rfile=arg[1].substring(arg[1].indexOf(':')+1);\n\n\t\t JSch jsch=new JSch();\n\t\t Session session=jsch.getSession(bigxcontext.getiXerciseAccountName(), host, BiGXConnectionToBackend.ScpServerPort);\n\t\t session.setUserInfo(new UserInfo() {\n\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void showMessage(String arg0) {\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean promptYesNo(String arg0) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean promptPassword(String arg0) {\n\t\t\t\t\t\tif(bigxcontext.getiXercisePassword() != \"\")\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean promptPassphrase(String arg0) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic String getPassword() {\n\t\t\t\t\t\treturn bigxcontext.getiXercisePassword();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic String getPassphrase() {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t });\n\t\t session.setPassword(bigxcontext.getiXercisePassword());\n\t\t session.connect();\n\n\t\t boolean ptimestamp = false;\n\n\t\t // exec 'scp -t rfile' remotely\n\t\t String command=\"scp \" + (ptimestamp ? \"-p \" :\"\") +\"-t \"+rfile;\n\t\t Channel channel=session.openChannel(\"exec\");\n\t\t ((ChannelExec)channel).setCommand(command);\n\n\t\t // get I/O streams for remote scp\n\t\t OutputStream out=channel.getOutputStream();\n\t\t InputStream in=channel.getInputStream();\n\n\t\t channel.connect();\n\n\t\t if(checkAck(in)!=0){\n\t\t \t System.err.println(\"checkAck(in)[\" + checkAck(in) + \"]: line[\" + new Exception().getStackTrace()[0].getLineNumber() + \"]\");\n\t\t \t return false;\n\t\t }\n\n\t\t File _lfile = new File(lfile);\n\n\t\t if(ptimestamp){\n\t\t command=\"T \"+(_lfile.lastModified()/1000)+\" 0\";\n\t\t // The access time should be sent here,\n\t\t // but it is not accessible with JavaAPI ;-<\n\t\t command+=(\" \"+(_lfile.lastModified()/1000)+\" 0\\n\"); \n\t\t out.write(command.getBytes()); out.flush();\n\t\t if(checkAck(in)!=0){\n\t\t\t \t System.err.println(\"checkAck(in)[\" + checkAck(in) + \"]: line[\" + new Exception().getStackTrace()[0].getLineNumber() + \"]\");\n\t\t\t \t return false;\n\t\t }\n\t\t }\n\n\t\t // send \"C0644 filesize filename\", where filename should not include '/'\n\t\t long filesize=_lfile.length();\n\t\t command=\"C0644 \"+filesize+\" \";\n\t\t if(lfile.lastIndexOf('/')>0){\n\t\t command+=lfile.substring(lfile.lastIndexOf('/')+1);\n\t\t }\n\t\t else{\n\t\t command+=lfile;\n\t\t }\n\t\t command+=\"\\n\";\n\t\t out.write(command.getBytes()); out.flush();\n\t\t if(checkAck(in)!=0){\n\t\t \t System.err.println(\"checkAck(in)[\" + checkAck(in) + \"]: line[\" + new Exception().getStackTrace()[0].getLineNumber() + \"]\");\n\t\t \t return false;\n\t\t }\n\n\t\t // send a content of lfile\n\t\t fis=new FileInputStream(lfile);\n\t\t byte[] buf=new byte[1024];\n\t\t while(true){\n\t\t int len=fis.read(buf, 0, buf.length);\n\t\t\tif(len<=0) break;\n\t\t out.write(buf, 0, len); //out.flush();\n\t\t }\n\t\t fis.close();\n\t\t fis=null;\n\t\t // send '\\0'\n\t\t buf[0]=0; out.write(buf, 0, 1); out.flush();\n\t\t if(checkAck(in)!=0){\n\t\t \t System.err.println(\"checkAck(in)[\" + checkAck(in) + \"]: line[\" + new Exception().getStackTrace()[0].getLineNumber() + \"]\");\n\t\t \t return false;\n\t\t }\n\t\t out.close();\n\n\t\t channel.disconnect();\n\t\t session.disconnect();\n\t\t }\n\t\t catch(Exception e){\n\t\t \te.printStackTrace();\n\t\t \treturnValue = false;\n\t\t try{if(fis!=null)fis.close();}\n\t\t catch(Exception ee){\n\t\t \t return false;\n\t\t \t }\n\t\t }\n\t\treturn returnValue;\n\t}", "public int cmdXfer(byte[] request, byte[] response) \n throws IOException {\n int bytes_read;\n \n if ((bytes_read = cmdXfer0(request, response)) < 0) {\n String err_msg = getErrorMessage0();\n if (err_msg != null)\n throw new IOException(err_msg);\n else\n throw new IOException(\"cmdXfer failed\");\n }\n return bytes_read;\n }", "@Override\n\tpublic String execute() throws Exception {\n\t\tHttpServletRequest request = getRequest();\n\t\tDaoFactory df = new DaoFactory();\n\t\tString nature = request.getParameter(\"nature\") == null ? \"¹ÄÀøÐÔ\": new String(request.getParameter(\"nature\").getBytes(\"iso8859-1\"), \"utf-8\");\n\t\t\n\t\tif (flag.equals(\"query\")) {\n\t\t\tFtpResultUtil = ftpResultBO.dofind(page,poolName,brName,curNo);\n\t\t\trequest.setAttribute(\"FtpResultUtil\", FtpResultUtil);\n\t\t\trequest.setAttribute(\"nature\", nature);\n\t\t\treturn flag;\n\t\t}\n\t\tif (flag.equals(\"update\")) {\n\t\t\tString value=request.getParameter(\"value\");\n\t\t\tString resultIds=request.getParameter(\"resultId\");\n\t\t\tString[] resultId=resultIds.substring(0, resultIds.length()-1).split(\",\");\n\t\t\tString [] afresValue=value.substring(0, value.length()-1).split(\",\");\n\t\t\tint j=0;\n\t\t\tfor(int i=0;i<afresValue.length;i++){\n\t\t\t\tif(afresValue[i]!=null&&!afresValue[i].equals(\"\")){\n\t\t\tString hsql = \"update FtpResult set afresValue='\"+afresValue[i]+\"' where result_Id='\" + resultId[i] + \"'\";\n\tdf.update(hsql, null);\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tfor(int i=j;i<resultId.length;i++){\n\t\t\t\t\tString hsql = \"update FtpResult set afresValue='' where result_Id='\" + resultId[i] + \"'\";\n\t\t\t\t\tdf.update(hsql, null);\t\n\t\t\t}\n\t\t\tFtpResultUtil = ftpResultBO.dofind(page,poolName,brName,curNo);\n\t\t\trequest.setAttribute(\"FtpResultUtil\", FtpResultUtil);\n\t\t\trequest.setAttribute(\"nature\", nature);\n\t\t\treturn flag;\n\t\t}\n\t\t\treturn null;\n}", "@Override\r\n\tpublic void additionalFuntion() {\n\t\tSystem.out.println(\"에디트 플러스에는 FTP 및 빌드 기능이 있습니다.\");\r\n\t}", "@Override\n protected Void doInBackground(String... strings) {\n FTPClient client = new FTPClient();\n try {\n client.connect(\"ftp.earwormfix.com\", 21);\n client.login(\"XXXX\", \"XXXXX\"); // TODO: change when testing- leave no whitespace!!\n\n client.sendNoOp(); //used so server timeout exception will not rise\n int reply = client.getReplyCode();\n if(!FTPReply.isPositiveCompletion(reply)){\n client.disconnect();\n Log.e(TAG,\"FTP server refuse connection Code- \"+ reply);\n this.taskListener.onFinished(false);\n cancel(true);\n }\n client.enterLocalPassiveMode();//Switch to passive mode\n client.setFileType(FTP.BINARY_FILE_TYPE, FTP.BINARY_FILE_TYPE);\n client.setFileTransferMode(FTP.BINARY_FILE_TYPE);\n String remoteFile = \"post/\"+strings[1] +\n File.separator +\n strings[0].substring(strings[0].lastIndexOf(File.separator)+1);\n File videoFile = new File(strings[0]);\n InputStream inputStream = new FileInputStream(videoFile);\n\n Log.i(TAG,\"storing...\");\n boolean stored = client.storeFile(remoteFile, inputStream);\n if (stored) {\n Log.i(TAG,\"Done!!!\");\n }\n else{\n Log.e(TAG,\"Failed to send ftp \"+ reply);\n this.taskListener.onFinished(false);\n inputStream.close();\n client.logout();\n cancel(true);\n }\n inputStream.close();\n //logout will close the connection\n client.logout();\n } catch (IOException e) {\n e.printStackTrace();\n this.taskListener.onFinished(false);\n cancel(true);\n }\n return null;\n }", "private native int cmdXfer0(byte[] request, byte[] response);", "public static boolean isSpecialCommand(FtpCommandCode command) {\r\n \t\treturn ((command == QUIT) || (command == ABOR) || (command == NOOP) || (command == STAT));\r\n \t}", "private void verificar_comando(String comando, InterfazRemota interfaz, int puerto) {\n\tString cmd[] = comando.split(\"[\\\\s]+\");\n\tString aux[];\n\tString servidor;\n\tString archivo;\n\n\tif (cmd[0].equalsIgnoreCase(\"C\") && cmd.length == 3){\n\t if (cmd[1].equalsIgnoreCase(\"-t\") || cmd[1].equalsIgnoreCase(\"-k\")){\n\t\ttry {\n\t\t SalidaDFS salida = interfaz.dfs_distribuido(cmd[1] + \" \" + cmd[2], new Vector<String>());\n\t\t if ((salida.resultado).equals(\"\")){\n\t\t\tSystem.out.println(\"No hubo resultados \\n\");\n\t\t }\n\t\t else {\n\t\t\tSystem.out.println(salida.resultado);\n\t\t }\n\t\t \n\t\t}\n\t\tcatch (java.rmi.RemoteException r) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor\");\n\t\t}\n\t\tfinally {\n\t\t return;\n\t\t}\n\t }\n\t /* Comando invalido */\n\t else System.out.println(\"Codigo Invalido\");\n\t}\n\t/* Solicitar una foto */\n\telse if (cmd[0].equalsIgnoreCase(\"D\") && cmd.length == 2 && cmd[1].matches(\"[\\\\S]+[:][\\\\S]+jpg\")){\n\t aux = cmd[1].split(\":\");\n\t servidor = aux[0];\n\t archivo = aux[1];\n\t try {\n\t\tInterfazRemota transferencia = null;\n\t\t\n\t\ttry {\n\t\t transferencia = (InterfazRemota)java.rmi.Naming.lookup(\"//\" + servidor + \":\" + puerto + \"/fotop2p\");\n\t\t}\n\t\tcatch (NotBoundException e) {\n\t\t System.err.println(\"No existe el servicio solicitado en \" + servidor + \":\" + puerto);\n\t\t System.exit(-1);\n\t\t}\n\t\tcatch (MalformedURLException m) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor: URL incorrecta\");\n\t\t System.exit(-1);\n\t\t}\n\t\tcatch (java.rmi.RemoteException r) {\n\t\t System.err.println(\"No se pudo establecer conexion con el servidor\");\n\t\t System.exit(-1);\n\t\t}\n\n\t\tbyte [] foto = transferencia.archivo_a_bytes(archivo);\n\t\t\n\t\tif (foto == null) {\n\t\t System.out.println(\"Foto no encontrada o error al abrirla en el servidor\");\n\t\t}\n\t\telse {\n\t\t FileOutputStream fos = new FileOutputStream(\"./\" + archivo);\n\t\t BufferedOutputStream bos = new BufferedOutputStream(fos);\n\t\t bos.write(foto,0,foto.length);\n\t\t System.out.println(\"Foto recibida exitosamente \\n\");\n\n\t\t}\n\t }\n\t catch (java.rmi.RemoteException r) {\n\t\tSystem.err.println(\"No se pudo establecer conexion con el servidor\");\n\t }\n\t catch(IOException i) {\n\t\tSystem.err.println(\"Error al escribir el archivo\");\n\t }\n\t finally {\n\t\treturn;\n\t }\n\t}\n\t/* obterner numero de alcanzables */\n\telse if (cmd[0].equalsIgnoreCase(\"A\") && cmd.length == 1){\n\t try {\n\t\tVector<String> alc = interfaz.alcanzables(new Vector<String>());\n\t\tSystem.out.println(\"Alcanzables: \" + alc.size());\n\t }\n\t catch (java.rmi.RemoteException r) {\n\t\tSystem.out.println(\"No se pudo establecer conexion con el servidor\");\n\t\t\n\t\tSystem.out.println(r.getMessage());\n\t\tr.printStackTrace();\n\t }\n\t finally {\n\t\treturn;\n\t }\n\t}\n\t/* Salir */\n\telse if (cmd[0].equalsIgnoreCase(\"Q\") && cmd.length == 1 ){\n\t System.out.println(\"Chao\");\n\t System.exit(0);\n\t}\n \telse {\n\t System.out.println(\"Comando Invalido\");\n\t return;\n\t}\n }", "public String getUserCommand();", "public FTPFile parseFTPEntry(String entry) {\n\t\t// one block in VMS equals 512 bytes\n\t\tlong longBlock = 512;\n\n\t\tif (matches(entry)) {\n\t\t\tFTPFile f = new FTPFile();\n\t\t\tf.setRawListing(entry);\n\t\t\tString name = group(1);\n\t\t\tString size = group(2);\n\t\t\tString datestr = group(3) + \" \" + group(4);\n\t\t\tString owner = group(5);\n\t\t\tString permissions[] = new String[3];\n\t\t\tpermissions[0] = group(9);\n\t\t\tpermissions[1] = group(10);\n\t\t\tpermissions[2] = group(11);\n\t\t\ttry {\n\t\t\t\tf.setTimestamp(super.parseTimestamp(datestr));\n\t\t\t}\n\t\t\tcatch (ParseException e) {\n\t\t\t\t// intentionally do nothing\n\t\t\t}\n\n\t\t\tString grp;\n\t\t\tString user;\n\t\t\tStringTokenizer t = new StringTokenizer(owner, \",\");\n\t\t\tswitch (t.countTokens()) {\n\t\t\tcase 1:\n\t\t\t\tgrp = null;\n\t\t\t\tuser = t.nextToken();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tgrp = t.nextToken();\n\t\t\t\tuser = t.nextToken();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tgrp = null;\n\t\t\t\tuser = null;\n\t\t\t}\n\n\t\t\tif (name.lastIndexOf(\".DIR\") != -1) {\n\t\t\t\tf.setType(FTPFile.DIRECTORY_TYPE);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tf.setType(FTPFile.FILE_TYPE);\n\t\t\t}\n\t\t\t// set FTPFile name\n\t\t\t// Check also for versions to be returned or not\n\t\t\tif (isVersioning()) {\n\t\t\t\tf.setName(name);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tname = name.substring(0, name.lastIndexOf(\";\"));\n\t\t\t\tf.setName(name);\n\t\t\t}\n\t\t\t// size is retreived in blocks and needs to be put in bytes\n\t\t\t// for us humans and added to the FTPFile array\n\t\t\tlong sizeInBytes = Long.parseLong(size) * longBlock;\n\t\t\tf.setSize(sizeInBytes);\n\n\t\t\tf.setGroup(grp);\n\t\t\tf.setUser(user);\n\t\t\t// set group and owner\n\n\t\t\t// Set file permission.\n\t\t\t// VMS has (SYSTEM,OWNER,GROUP,WORLD) users that can contain\n\t\t\t// R (read) W (write) E (execute) D (delete)\n\n\t\t\t// iterate for OWNER GROUP WORLD permissions\n\t\t\tfor (int access = 0; access < 3; access++) {\n\t\t\t\tString permission = permissions[access];\n\n\t\t\t\tf.setPermission(access, FTPFile.READ_PERMISSION, permission.indexOf('R') >= 0);\n\t\t\t\tf.setPermission(access, FTPFile.WRITE_PERMISSION, permission.indexOf('W') >= 0);\n\t\t\t\tf.setPermission(access, FTPFile.EXECUTE_PERMISSION, permission.indexOf('E') >= 0);\n\t\t\t}\n\n\t\t\treturn f;\n\t\t}\n\t\treturn null;\n\t}", "protected String executeCommand(String line)\n throws IOException\n {\n String[] command = line.split(\" \");\n if (command.length == 0)\n {\n command = new String[1];\n command[0] = line;\n }\n \n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n PrintStream out = new PrintStream(bout);\n\n // repeat last command?\n if (command[0].equals(\"r\"))\n {\n if (lastCommand == null)\n {\n return \"No command entered yet.\";\n }\n \n if (command.length > 1 && command[1].equals(\"show\"))\n {\n return lastCommand + \"\\n\\n\";\n }\n else\n {\n return \"repeating command \" + lastCommand + \"\\n\\n\" + interpretCommand(lastCommand);\n }\n }\n \n // remember last command\n lastCommand = line;\n\n // execute command\n if (command[0].equals(\"help\"))\n {\n String helpFile = m_messages.getMessage(\"testserver.help\", null, null);\n ClassPathResource helpResource = new ClassPathResource(helpFile);\n byte[] helpBytes = new byte[500];\n InputStream helpStream = helpResource.getInputStream();\n try\n {\n int read = helpStream.read(helpBytes);\n while (read != -1)\n {\n bout.write(helpBytes, 0, read);\n read = helpStream.read(helpBytes);\n }\n }\n finally\n {\n helpStream.close();\n }\n }\n \n else if (command[0].equals(\"user\"))\n {\n if (command.length == 2)\n {\n username = command[1];\n }\n out.println(\"using user \" + username);\n }\n \n else if (command[0].equals(\"get\") ||\n command[0].equals(\"delete\"))\n {\n String uri = (command.length > 1) ? command[1] : null;\n Response res = submitRequest(command[0], uri, headers, null, null, null);\n bout.write((\"Response status: \" + res.getStatus()).getBytes());\n out.println();\n bout.write(res.getContentAsByteArray());\n out.println();\n }\n\n else if (command[0].equals(\"post\"))\n {\n String uri = (command.length > 1) ? command[1] : null;\n String contentType = (command.length > 2) ? command[2] : null;\n String body = \"\";\n for (int i = 3; i < command.length; i++)\n {\n body += command[i] + \" \";\n }\n Response res = submitRequest(command[0], uri, headers, body.getBytes(), null, contentType);\n bout.write((\"Response status: \" + res.getStatus()).getBytes());\n out.println();\n bout.write(res.getContentAsByteArray());\n out.println();\n }\n\n else if (command[0].equals(\"put\"))\n {\n String uri = (command.length > 1) ? command[1] : null;\n String contentType = (command.length > 2) ? command[2] : null;\n String body = \"\";\n for (int i = 3; i < command.length; i++)\n {\n body += command[i] + \" \";\n }\n Response res = submitRequest(command[0], uri, headers, body.getBytes(), null, contentType);\n bout.write((\"Response status: \" + res.getStatus()).getBytes());\n out.println();\n bout.write(res.getContentAsByteArray());\n out.println();\n }\n \n else if (command[0].equals(\"tunnel\"))\n {\n if (command.length < 4)\n {\n return \"Syntax Error.\\n\";\n }\n \n if (command[1].equals(\"param\"))\n {\n String uri = command[3];\n if (uri.indexOf('?') == -1)\n {\n uri += \"?alf:method=\" + command[2];\n }\n else\n {\n uri += \"&alf:method=\" + command[2];\n }\n Response res = submitRequest(\"post\", uri, headers, null, null, null);\n bout.write(res.getContentAsByteArray());\n out.println();\n }\n \n else if (command[1].equals(\"header\"))\n {\n Map<String, String> tunnelheaders = new HashMap<String, String>();\n tunnelheaders.putAll(headers);\n tunnelheaders.put(\"X-HTTP-Method-Override\", command[2]);\n Response res = submitRequest(\"post\", command[3], tunnelheaders, null, null, null);\n bout.write(res.getContentAsByteArray());\n out.println();\n }\n \n else\n {\n return \"Syntax Error.\\n\";\n }\n }\n\n else if (command[0].equals(\"header\"))\n {\n if (command.length == 1)\n {\n for (Map.Entry<String, String> entry : headers.entrySet())\n {\n out.println(entry.getKey() + \" = \" + entry.getValue());\n }\n }\n else if (command.length == 2)\n {\n String[] param = command[1].split(\"=\");\n if (param.length == 0)\n {\n return \"Syntax Error.\\n\";\n }\n if (param.length == 1)\n {\n headers.remove(param[0]);\n out.println(\"deleted header \" + param[0]);\n }\n else if (param.length == 2)\n {\n headers.put(param[0], param[1]);\n out.println(\"set header \" + param[0] + \" = \" + headers.get(param[0]));\n }\n else\n {\n return \"Syntax Error.\\n\";\n }\n }\n else\n {\n return \"Syntax Error.\\n\";\n }\n } \n\n else if (command[0].equals(\"reset\"))\n {\n container.reset();\n out.println(\"Runtime context '\" + container.getName() + \"' reset.\");\n }\n \n else\n {\n return \"Syntax Error.\\n\";\n }\n \n out.flush();\n String retVal = new String(bout.toByteArray());\n out.close();\n return retVal;\n }", "FTCommand getFeature();", "public List<String> ftpDirectoryList(String userid, String pwd , String Url , String FilePath, int portNum){\r\n\r\n FTPClient client = new FTPClient();\r\n \r\n List<String> fileName = new ArrayList<String>();\r\n try {\r\n \tclient.connect(Url,portNum);\r\n \t\r\n client.login(userid , pwd);\r\n \r\n client.setControlEncoding(\"utf-8\");\r\n client.changeWorkingDirectory(FilePath);\r\n \r\n FTPFile[] ftpFiles = client.listFiles(\"/\"+FilePath);\r\n \r\n for (FTPFile ftpFile : ftpFiles) {\r\n\r\n if (ftpFile.getType() == FTPFile.DIRECTORY_TYPE) {\r\n fileName.add(ftpFile.getName().toString());\r\n }\r\n }\r\n client.logout();\r\n \r\n } catch (IOException e) {\r\n LOGGER.info(e.getMessage());\r\n } finally {\r\n try {\r\n client.disconnect();\r\n } catch (IOException e) {\r\n \tLOGGER.info(e.getMessage());\r\n }\r\n }\r\n return fileName;\r\n\t}", "public static void main(String[] args) {\n\n try {\n System.out.println((FtpUtil.storeFile(\"http://v2.ifaceshow.com/a/2012/1102/0955/\", new InputStream[] { new FileInputStream(\"d:/pic/123.jpg\")}, \"video\", \"a64cbbe_13b377221fe51\",new String[]{\"0\"}, \"jpg\"))[0]);\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (Exception e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public boolean isOnlyPassive();", "public static boolean isListLikeCommand(FtpCommandCode command) {\r\n \t\treturn ((command == LIST) || (command == NLST) || (command == MLSD) || (command == MLST));\r\n \t}", "@Override\n protected void onHandleIntent(Intent intent) {\n messenger = intent.getParcelableExtra(\"messenger\");\n int action = intent.getIntExtra(\"action\", 0);\n switch (action) {\n //Initializes the FTP client. Must be called before other actions.\n case SET_FTP_ACTION:\n FtpBuilder builder = (FtpBuilder) intent.getSerializableExtra(\"ftp\");\n ftp = builder.build();\n break;\n //Connects to the FTP server.\n case CONNECT_ACTION:\n connect();\n break;\n //Logs into the FTP server.\n case LOGIN_ACTION:\n if (ftp.login()) sendResponse(\"Logged in\");\n else sendResponse(\"Failed to log in, error: \");\n break;\n //Uploads a file to the FTP server. Will try to reconnect if the connection has been closed.\n case SEND_ACTION:\n Uri path = intent.getParcelableExtra(\"file\");\n InputStream stream;\n try {\n stream = getContentResolver().openInputStream(path);\n } catch (FileNotFoundException e) {\n sendResponse(\"Could not open file \" + path + \", \" + e.toString());\n break;\n }\n String[] strings = path.getPath().split(\"/\");\n String fileName = strings[strings.length - 1];\n int reply = ftp.sendFile(stream, fileName);\n if (reply == 0) {\n sendResponse(\"File uploaded\");\n break;\n }\n if (reply == Ftp.FTPCONNECTIONCLOSEDEXCEPTION_CODE) { //try to reconnect if connection has been closed\n sendResponse(\"Connection closed, reconnecting...\");\n connect();\n reply = ftp.sendFile(stream, fileName);\n if (reply == 0) sendResponse(\"File uploaded\");\n else sendResponse(\"Failed to send file\");\n break;\n } else sendResponse(\"Failed to send file\");\n break;\n //Logs out of the FTP server.\n case LOGOUT_ACTION:\n if (ftp.logout()) sendResponse(\"Logged out\");\n else sendResponse(\"Failed to log out\");\n break;\n //Disconnects from the FTP server.\n case DISCONNECT_ACTION:\n if (ftp.disconnect()) sendResponse(\"Disconnected\");\n else sendResponse(\"Error while trying to disconnect\");\n break;\n }\n }", "Future<Object> execCmd(byte[] cmd, byte[]... params);", "@Override\n public void help()\n {\n System.out.println(\"\\tcd [DEST]\");\n }", "private Response simpleCommand(String string2) throws IOException {\n int n;\n String string3;\n if (this.socket == null) {\n throw new IOException(\"Folder is closed\");\n }\n if (string2 != null) {\n if (this.debug) {\n this.out.println(\"C: \" + string2);\n }\n String string4 = String.valueOf((Object)string2) + CRLF;\n this.output.print(string4);\n this.output.flush();\n }\n if ((string3 = this.input.readLine()) == null) {\n if (this.debug) {\n this.out.println(\"S: EOF\");\n }\n throw new EOFException(\"EOF on socket\");\n }\n if (this.debug) {\n this.out.println(\"S: \" + string3);\n }\n Response response = new Response();\n if (string3.startsWith(\"+OK\")) {\n response.ok = true;\n } else {\n if (!string3.startsWith(\"-ERR\")) {\n throw new IOException(\"Unexpected response: \" + string3);\n }\n response.ok = false;\n }\n if ((n = string3.indexOf(32)) >= 0) {\n response.data = string3.substring(n + 1);\n }\n return response;\n }", "java.lang.String getTransferTxt();", "public static UploadFtp createFtpClient(String ip, String userName, String passwd, int port, String domain, String subPath){\n FtpItem ftpItem = new FtpItem();\n ftpItem.setUser(userName);\n ftpItem.setPasswd(passwd);\n ftpItem.setPort(port);\n ftpItem.setIp(ip);\n ftpItem.setBaseDir(subPath);\n ftpItem.setBaseUrl(domain);\n UploadFtp client = getFtpClient(ftpItem);\n return client;\n }", "private static void doFsCommand(final FsShell shell, final String [] args)\n throws Exception {\n int errcode = shell.run(args);\n if (errcode != 0) throw new IOException(\"Failed put; errcode=\" + errcode);\n }", "public interface FSInterface extends Remote\n{\n\tpublic String browseDirs(String dir) throws RemoteException;\n\tpublic String browseFiles(String dir) throws RemoteException;\n\tpublic String search(String file, String startDir) throws RemoteException;\n\tpublic boolean createFile(String file) throws RemoteException;\n\tpublic boolean createDir(String dir) throws RemoteException;\n\tpublic boolean delete(String file) throws RemoteException;\n\tpublic boolean rename(String oldName, String newName) throws RemoteException;\n\tpublic String getOSName()throws RemoteException;\n\tpublic String getHostName() throws RemoteException;\n\tpublic String getHostAddress() throws RemoteException;\n\tpublic void sendClientAddress(String clientAddress) throws RemoteException;\n\tpublic String getClientAddress() throws RemoteException;\n\tpublic Path [] getFileList() throws RemoteException;\n\t//public String sendClientName(String clientName) throws RemoteException; //ToDo\n\t//public String sendClientOS(String clientOS) throws RemoteException; //ToDo\n}", "@GET\n @Path(\"/data/{name}\")\n @Produces(\"text/html\")\n public String getFile(@PathParam( \"name\" ) String name)throws IOException {\n\n if(!login)\n return logIn();\n\n if(commandes.CMDCWD(\"/data\")){\n String result = AdditionnalResources.searchFile(name);\n if(commandes.getCurrentDir().equals(\"data\")){\n result += \"<form action=\\\"/rest/tp2/ftp/\"+ commandes.getCurrentDir()+\"/\"+name+\"/edit\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Edit\\\">\"+\n \"</form>\";\n result += \"<button onclick= \\\"p()\\\">Delete</button>\"+\n \"<script type=\\\"text/javascript\\\">\"+\n \"function p(){\"+\n \"console.log(\\\"Ici\\\");\"+\n \"xhr=window.ActiveXObject ? new ActiveXObject(\\\"Microsoft.XMLHTTP\\\") : new XMLHttpRequest();\"+\n \"xhr.onreadystatechange=function(){};\"+\n \"xhr.open(\\\"DELETE\\\", \\\"http://localhost:8080/rest/tp2/ftp/data/\"+name+\"\\\");\"+\n \"xhr.send(null);\"+\n \"};\"+\n \"</script>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/data\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Return\\\">\"+\n \"</form></br>\";\n }else{\n result +=\"<form action=\\\"/rest/tp2/ftp/\"+ commandes.getCurrentDir()+\"/add\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Add File\\\">\"+\n \"</form></br>\";\n result +=\"<form action=\\\"/rest/tp2/ftp/logout\\\">\"+\n \"<input type=\\\"submit\\\" value=\\\"Logout\\\">\"+\n \"</form></br>\";\n }\n return result;\n }\n return \"<h1>PATH NOT FOUND</h1>\";\n }", "CommandResult execute();", "@Override\n public boolean execute() {\n String url = \"\";\n String name, content;\n try {\n this.checkNumArgs();\n url = arguments.get(0);\n this.checkRedirectionParam();\n content = fetcher.getURLContent(url);\n name = getFileName(url);\n if (fs.getCurrWorkDir().findChild(name)!=null) {\n StandardError.displayError(\"cannot create \" + name+\" because \"\n + \" there already \"\n + \"exist file with this name\");\n return false;\n }\n // create file with the string from the input method and \n // file name then attach it to cwd\n File<String> file = new File<String>(name, content, \n this.fs.getCurrWorkDir());\n // check if the file is actually added\n if (fs.getCurrWorkDir().findChild(name)==null) {\n StandardError.displayError(\"cannot create \" + name+\" because \"\n + \"of the illegal\"\n + \"characters\");\n return false;\n }\n \n } catch (MalformedURLException e) {\n StandardError.displayError(url + \" is not a valid url\");\n return false;\n } catch (IOException e) {\n StandardError.displayError(\"an error occured when reading this url\");\n return false;\n } catch (InvalidArgumentSizeException e) {\n StandardError.displayError(\"get needs only the url as argument\");\n return false;\n } catch (CanNotRedirectException e) {\n StandardError.displayError(\"redirection params are wrong:\" \n + e.getMessage());\n return false;\n }\n return true;\n }", "int getCommand();", "private String executeCommand(String zipCommand) {\n\t\tString res = \"\";\n\t\t//String command = zipCommand + \" \" + givenFile + targetDir;\n\t\tString command = zipCommand;\n\t\tString[] commandAndArgs = new String[]{ \"/bin/sh\", \"-c\", command};\n\t\t//System.out.println(commandAndArgs);\n\t\t// Get Runtime instance.\n\t\tRuntime rt = Runtime.getRuntime();\n\t\t// Declare a process.\n\t\tProcess p0 = null;\n\t\ttry {\n\t\t\t// Let's execute the command.\n\t\t\tp0 = rt.exec(commandAndArgs);\n\t\t\t// Get any input stream.\n\t\t\tInputStream instd = p0.getInputStream();\n\t\t\t// Let's get it through buffered reader.\n\t\t\tBufferedReader buf_reader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(instd));\n\t\t\tString temp = \"\";\n\t\t\t// System.out.println(\"new line executed command: \" + command);\n\t\t\twhile ((temp = buf_reader.readLine()) != null) {\n\t\t\t\t// System.out.println(\"temp: \" + temp);\n\t\t\t\t//res += temp + \"\\n\";\n\t\t\t}\n\t\t\t// Let's close buffered reader\n\t\t\tbuf_reader.close();\n\n\t\t\t// Get any error stream.\n\t\t\tInputStream errstd = p0.getErrorStream();\n\t\t\t// Let's get it through buffered reader.\n\t\t\tBufferedReader buf_err_reader = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(errstd));\n\t\t\t// Initialize a temporary variable.\n\t\t\ttemp = \"\";\n\t\t\t// Until there's no more error message,\n\t\t\twhile ((temp = buf_err_reader.readLine()) != null) {\n\t\t\t\t// Append a current error message to the error message\n\t\t\t\t// container.\n\t\t\t\tres += temp + \"\\n\";\n\t\t\t}\n\t\t\t// Report an error.\n\t\t\tSystem.err.println(res);\n\t\t\t// Close buffered error reader.\n\t\t\tbuf_err_reader.close();\n\t\t\t// Let's wait p0 for completion.\n\t\t\tp0.waitFor();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}", "public void __noop() {\n __send(__buildMessage(FTPCommand.getCommand(32), null));\n __getReplyNoReport();\n }", "public String getCxfByPython(String txtFilePath) {\n try {\n String cmd = \"C:/Python25/python txt2cxf.py \" + txtFilePath + \" \" +\n txtFilePath + \".cxf\";\n //String cmd = \"dir\";\n String[] params = cmd.split(\" \");\n\n Runtime rt = Runtime.getRuntime();\n Process proc = rt.exec(params);\n\n MessageCapturer errcapturer = new MessageCapturer(proc.getErrorStream(),\n \"ERROR\");\n MessageCapturer outcapturer = new MessageCapturer(proc.getInputStream(),\n \"OUTPUT\");\n\n int exitValue = proc.waitFor();\n\n this.errormessage_ = errcapturer.getMessage();\n this.outputmessage_ = outcapturer.getMessage();\n\n return txtFilePath + \".cxf\";\n //System.out.println(\"Exit value = \"+exitValue);\n }\n catch (Throwable t) {\n t.printStackTrace();\n }\n return null;\n }", "public IFtpConfig getFtpConfig() {\n return m_ftpConfig;\n }", "private void retriveCommand(){\n\t\tdirections.add(\"Turn left.\");\n\t\tdirections.add(\"Walk 20 meters and turn right.\");\n\t\tdirections.add(\"Arrive destination.\");\n\t}", "protected String send4LetterWord(String host, int port, String cmd)\n throws IOException {\n Preconditions.checkArgument(quorumPeer != null || zkServerMain != null);\n Preconditions.checkArgument(cmd.length() == 4);\n Socket sock = new Socket(host, port);\n BufferedReader reader = null;\n try {\n OutputStream outstream = sock.getOutputStream();\n outstream.write(cmd.getBytes());\n outstream.flush();\n\n reader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\n StringBuilder sb = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n sb.append(line + \"\\n\");\n }\n return sb.toString();\n } finally {\n sock.close();\n if (reader != null) {\n reader.close();\n }\n }\n }", "public String Command() {\n\treturn command;\n }", "public static String getCommandResponse(TaskList taskList, File file,\n PrintWriter writer, String action) throws DukeException {\n String command = Parser.getCommand(action);\n\n switch (command) {\n case \"done\":\n int taskNum = Parser.taskNumber(action);\n String oldDescription = taskList.getIndividualTaskInString(taskNum - 1);\n taskList.completeTask(taskNum);\n Storage.saveAsCompleted(file, taskList.getIndividualTask(taskNum - 1), oldDescription);\n return Response.showCompletedMessage(taskList.getIndividualTask(taskNum - 1));\n case \"todo\":\n case \"deadline\":\n case \"event\":\n Task task = identifyType(action);\n taskList.addTask(task);\n Storage.addData(writer, identifyType(action));\n return Response.showAddedTask(task, taskList.getLength());\n case \"list\":\n return Response.showList(taskList);\n case \"delete\":\n int num = Parser.taskNumber(action);\n Task taskToDelete = taskList.getIndividualTask(num - 1);\n Storage.markAsDeleted(file, taskToDelete);\n taskList.deleteTask(num);\n return Response.showSuccessfulDelete(taskToDelete, taskList.getLength());\n case \"find\":\n String keyword = getKeyword(action);\n return taskList.findTasks(keyword);\n default:\n return Response.showInvalidInputMessage();\n }\n }", "public Socket openDataConnection(int command, String path)\n throws IOException {\n Socket socket = _openDataConnection_(command, path);\n if (socket == null) {\n throw new FTPException(this.getReplyCode());\n }\n return socket;\n }", "public static void settingCommand(String command1,String Download)\r\n {\r\n try\r\n {\r\n File temp_file = new File(path);\r\n Download = Download + \"/\" + temp_file.getName();\r\n channel=session.openChannel(\"exec\");\r\n ((ChannelExec)channel).setCommand(command1);\r\n\t channel.setInputStream(null);\r\n\t ((ChannelExec)channel).setErrStream(System.err); \r\n\t in=channel.getInputStream();\r\n\t channel.connect();\r\n writer = new PrintWriter(new FileOutputStream(new File(Download),true)); //destination file\r\n int i;\r\n char c;\r\n while(true)\r\n {\r\n while(in.available()>0)\r\n {\r\n System.out.println(\"avail: \"+in.available());\r\n while((i = in.read())!=-1) \r\n {\r\n c = (char)i; \r\n writer.print(c);\r\n }\r\n writer.close();\r\n }\r\n if(channel.isClosed())\r\n break;\r\n }\r\n in.close();\r\n channel.disconnect();\r\n }\r\n catch(Exception e)\r\n {\r\n System.out.println(e);\r\n }\r\n }", "public ClientFTP() {\n }", "public interface Callback\n {\n void cbAnalyze();\n \n /** @see GtpShell#send */\n boolean sendGtpCommand(String command, boolean sync) throws GtpError;\n }", "FunctionCall getFc();", "public void run() {\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tString cmd;\r\n\t\tRequest.Type t = null;\r\n\t\tString fileName;\r\n\t\tString filePath;\r\n\t\tboolean badDirectory;\r\n\t\t\r\n\t\tdo\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Do you want to run with the error simulator? (y/n)\");\r\n\t\t\tString decision = in.next();\r\n\t\t\tif (decision.equalsIgnoreCase(\"y\"))\r\n\t\t\t{\r\n\t\t\t\tsendPort = ERRSIM_PORT;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse if (decision.equalsIgnoreCase(\"n\"))\r\n\t\t\t{\r\n\t\t\t\tsendPort = SERVER_PORT;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Please enter y/Y or n/N.\");\r\n\t\t\t}\r\n\t\t} while (true);\r\n\t\t\r\n\t\t// Get the IP address or host name from user input\r\n\t\tfor (boolean validHost = false; validHost == false; ) {\r\n\t\t\tSystem.out.println(\"Please enter the IP address of the server:\");\r\n\t\t\tString host = in.next();\r\n\t\t\ttry {\r\n\t\t\t\tsendAddr = InetAddress.getByName(host);\r\n\t\t\t} catch(UnknownHostException e) {\r\n\t\t\t\tSystem.out.println(\"Invalid host name or IP address. Please try again.\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tvalidHost = true;\r\n\t\t}\r\n\t\t\r\n\t\t// Sets the directory for the client\r\n\t\tdo {\r\n\t\t\tbadDirectory = false;\r\n\t\t\tSystem.out.println(\"Please enter the directory that you want to use for the client files:\");\r\n\t\t\tdirectory = in.next();\r\n\t\t\tchar lastChar = directory.charAt(directory.length()-1);\r\n\t\t\tif (!TFTP.isDirectory(directory)) {\r\n\t\t\t\tSystem.out.println(\"Directory does not exist.\");\r\n\t\t\t\tbadDirectory = true;\r\n\t\t\t}\r\n\t\t\telse if (lastChar != '/' && lastChar != '\\\\')\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Valid directory must end with either a '/' or a '\\\\'\");\r\n\t\t\t\tbadDirectory = true;\r\n\t\t\t}\r\n\t\t} while (badDirectory);\r\n\t\tif (verbose) System.out.println(\"The directory you entered is: \" + directory + \"\\n\");\r\n\r\n\t\twhile (true) {\r\n\t\t\tboolean validCmd = false;\r\n\t\t\twhile(!validCmd) {\r\n\t\t\t\t// Get get command\r\n\t\t\t\tSystem.out.println(\"Please enter a command (read/write/exit):\");\r\n\t\t\t\tcmd = in.next();\r\n\t\t\t\t// Quit server if exit command given\r\n\t\t\t\tif (cmd.equalsIgnoreCase(\"exit\")) {\r\n\t\t\t\t\tin.close();\r\n\t\t\t\t\tSystem.out.println(\"Shutting down...\");\r\n\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t} else if (cmd.equalsIgnoreCase(\"read\")) {\r\n\t\t\t\t\tvalidCmd = true;\r\n\t\t\t\t\tt = Request.Type.READ;\r\n\t\t\t\t} else if (cmd.equalsIgnoreCase(\"write\")) {\r\n\t\t\t\t\tvalidCmd = true;\r\n\t\t\t\t\tt = Request.Type.WRITE;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalidCmd = false;\r\n\t\t\t\t\tSystem.out.println(\"Invalid command. Valid commands are read, write, and exit.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Get file name\r\n\t\t\tdo {\r\n\t\t\t\tSystem.out.println(\"Please enter the name of the file to transfer:\");\r\n\t\t\t\tfileName = in.next();\r\n\t\t\t\tif (!TFTP.isPathless(fileName))\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"File names must not contain a path. The directory that you designated for transfer is: \" + directory);\r\n\t\t\t\t}\r\n\t\t\t} while (!TFTP.isPathless(fileName));\r\n\t\t\tfilePath = directory + fileName;\r\n\t\t\t\r\n\t\t\t// Check if the file exists and file readable on client if WRITE request, otherwise continue loop\r\n\t\t\tif (t == Request.Type.WRITE) {\r\n\t\t\t\tif (TFTP.fileExists(filePath) && !TFTP.isDirectory(filePath)) {\r\n\t\t\t\t\tif (!TFTP.isReadable(filePath)) {\r\n\t\t\t\t\t\t// Echo error message for access violation\r\n\t\t\t\t\t\tSystem.out.println(\"File access violation.\\n\");\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Echo successful file found\r\n\t\t\t\t\t\tSystem.out.println(\"File found.\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Echo error message for file not found\r\n\t\t\t\t\tSystem.out.println(\"File not found.\\n\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t// For read requests, check if file already exists on the client\r\n\t\t\t} else if (t == Request.Type.READ) {\r\n\t\t\t\tif (TFTP.fileExists(filePath) && !TFTP.isDirectory(filePath)) {\r\n\t\t\t\t\t// Echo error message\r\n\t\t\t\t\tSystem.out.println(\"File already exists.\\n\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Newline\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Make sure packet buffer is clear before processing transfer\r\n\t\t\tif (verbose) System.out.println(\"Clearing socket receive buffer...\");\r\n\t\t\tDatagramPacket throwAwayPacket = TFTP.formPacket();\r\n\t\t\t// Receive packets until a timeout occurs\r\n\t\t\tdo {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsendReceiveSocket.receive(throwAwayPacket);\r\n\t\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t} while (true);\r\n\t\t\tif (verbose) System.out.println(\"Socket cleared.\\n\");\r\n\r\n\t\t\t// Send the request\r\n\t\t\ttry {\r\n\t\t\t\tswitch (t) {\r\n\t\t\t\t\tcase READ:\r\n\t\t\t\t\t\tSystem.out.println(\"Reading \" + filePath + \" from server...\");\r\n\t\t\t\t\t\tthis.read(sendAddr, filePath, \"netascii\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase WRITE:\r\n\t\t\t\t\t\tSystem.out.println(\"Writing \" + filePath + \" to server...\");\r\n\t\t\t\t\t\tthis.write(sendAddr, filePath, \"netascii\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid request type. Quitting...\");\r\n\t\t\t\t\t\tSystem.exit(1);\r\n\t\t\t\t}\r\n\t\t\t} catch(Exception e) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public abstract String getCommand();", "public static void main(String args[])\n {\n if (args.length != 2) {\n System.err.println(\"Usage: java myftp <host name> <port number>\");\n System.exit(1);\n }\n\n myftp mfp = new myftp();\n mfp.createSocket(args[0], Integer.parseInt(args[1]));\n }", "private Object[] execCommand(String command) throws FileSystemUtilException\r\n\t{\r\n\t\tOutputStream out;\r\n\t\tInputStream in;\r\n\t\t\r\n\t\tlogger.debug(\"Begin: \"+getClass().getName()+\":execCommand()\");\r\n\t\ttry \r\n\t\t{\t\t\t\r\n\t\t\tchannel = session.openChannel(\"exec\");\r\n\t\t\tlogger.debug(\"channel is opened\");\r\n\t\t} \r\n\t\tcatch (JSchException e) \r\n\t\t{\t\t\t\r\n\t\t\tlogger.debug(\"JSchException :: excepion Reaseon ::\",e);\r\n\t\t\tthrow new FileSystemUtilException(\"EL0005\",null,Level.ERROR,e);\t\t\t\r\n\t\t}\r\n\r\n\t\t((ChannelExec) channel).setCommand(command);\r\n\t\t//get I/O streams for remote scp\r\n\t\ttry \r\n\t\t{\r\n\t\t\tout = channel.getOutputStream();\r\n\t\t\tlogger.debug(\"execCommand :: Output stream ::\"+out);\r\n\t\t} \r\n\t\tcatch (IOException ie) \r\n\t\t{\r\n\t\t\tlogger.debug(\"IOException :: excepion $#### Reaseon ::\",ie);\r\n\t\t\tthrow new FileSystemUtilException(\"EL0006\",null,Level.ERROR,ie);\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\tin = channel.getInputStream();\r\n\t\t} \r\n\t\tcatch (IOException ie) \r\n\t\t{\r\n\t\t\tlogger.debug(\"IOException :: excepion reassss Reaseon ::\",ie);\r\n\t\t\tthrow new FileSystemUtilException(\"EL0007\",null,Level.ERROR,ie);\r\n\t\t}\r\n\t\ttry \r\n\t\t{\r\n\t\t\tlogger.debug(\"excuting command \"+command);\r\n\t\t\tchannel.connect();\r\n\t\t\tlogger.debug(\"executed command \"+command);\r\n\t\t} \r\n\t\tcatch (JSchException jse) \r\n\t\t{\r\n\t\t\tlogger.debug(\"JSchException :: excepion reassss Reaseon ::\",jse);\r\n\t\t\tthrow new FileSystemUtilException(\"EL0008\",null,Level.ERROR,jse);\r\n\t\t}\r\n\r\n\t\tObject iostreams[]={out,in};\r\n\t\tlogger.debug(\"End: \"+getClass().getName()+\":execCommand()\");\r\n\t\treturn iostreams;\t\t\r\n\t}", "private boolean analyzeCommand(String line, PrintWriter outputStream)\n\t{\n\t\t\n\t\t\n\t\tint periodIndex =line.indexOf('.');\n\t\tthis.adjustPing(System.currentTimeMillis());\n\t\t\n\t\tif (periodIndex <= 0 || periodIndex == line.length() - 1)\n\t\t{\n\t\t\toutputStream.println(\"Invalid Command: \" + line);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString command = line.substring(0, periodIndex);\n\t\tString subCommand = line.substring(periodIndex + 1);\n\t\t\n\t\tif (command.equals(\"UID\"))\n\t\t{\n\t\t\tif(verifyUID(subCommand))\n\t\t\t{\n\t\t\t\t//System.out.println(\"Valid uid\");\n\t\t\t\toutputStream.println(\"Valid UID. Accepting client connection.\");\n\t\t\t\treturn true;\n\t\t\t} else\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(command.equals(\"A\"))\n\t\t{\n\t\t\toutputStream.println(\"Thank you for the audio bytes! (Old TCP implementation)\");\n\t\t\t\n\t\t\t//if the number of buffers is > than the ping ratio, play the audio from one buffer\n\t\t\t\n\t\t\t//if the ping is greater than the audio rate, then create a buffer of twice the size and play from there.\n\t\t\treturn true;\n\t\t\t \n\t\t\n\t\t}\n\n\t\tif (command.equals(\"F\"))\n\t\t{\n\t\t\t\n\t\t\tString[] specifications = subCommand.split(this.regex);\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tfloat sampleRate = Float.parseFloat(specifications[0]);\n\t\t\t\tint sampleSizeInBits = Integer.parseInt(specifications[1]);\n\t\t\t\tint channels = Integer.parseInt(specifications[2]);\n\t\t\t\tint frameSize = Integer.parseInt(specifications[3]);\n\t\t\t\tfloat frameRate = Float.parseFloat(specifications[4]);\n\t\t\t\tclientAudioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, sampleRate, sampleSizeInBits, channels, frameSize, frameRate, false);\n\t\t\t\n\t\t\t} catch (NumberFormatException e)\n\t\t\t{\n\t\t\t\t\n\t\t\t\toutputStream.println(\"Invalid number format for one or more audio format specifications\");\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t} catch(ArrayIndexOutOfBoundsException e)\n\t\t\t{\n\t\t\t\t\n\t\t\t\toutputStream.println(\"Invalid number of audio format specifications\");\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (command.equals(\"S\"))\n\t\t{\n\t\t\tString[] specifications = subCommand.split(this.regex);\n\n\t\t\tif (!specifications[0].equals(\"clumpSize\")) {\n\t\t\t\tif (subCommand.equals(\"disconnect\")) {\n\t\t\t\t\t//reset client stuff\n\t\t\t\t\t//System.out.println(\"Closing client connection.\");\n\t\t\t\t\tthis.closeClientConnection();\n\t\t\t\t}\n\n\t\t\t\tif (subCommand.equals(\"close\")) {\n\t\t\t\t\t//closes the server.\n\t\t\t\t\t//System.out.println(\"Closing server.\");\n\t\t\t\t\tthis.closeServer();\n\t\t\t\t}\n\n\t\t\t\tif (subCommand.equals(\"udp\")) {\n\t\t\t\t\t//System.out.println(\"Beginning UDP transition.\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tsetupUDP(this.portNumber);\n\t\t\t\t\t} catch (SocketException e) {\n\t\t\t\t\t\t//System.out.println(\"Could not open socket\");\n\t\t\t\t\t\te.printStackTrace();\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif (specifications[0].equals(\"clumpSize\")) {\n\t\t\t\t\tint clumpSize = Integer.parseInt(specifications[1]);\n\t\t\t\t\t//System.out.println(\"Setting clump size to : \" + clumpSize);\n\t\t\t\t\tthis.clumpSize = clumpSize;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public abstract void doCommand(String command);", "public org.apache.axis2.databinding.types.soapencoding.String getCmdFileURL(){\n return localCmdFileURL;\n }", "public static native void send( String cmd );", "public boolean isFactionsCommand(String check)\n \t{\n \t\tif (check == null || check.isEmpty()) return false;\n \t\treturn this.handleCommand(null, check, true);\n \t}", "public MountLV( String cmd ){\r\n super( cmd );\r\n }", "void processCommand (String command, ZMsg msg);", "Commands getIf_commands();", "abstract String getFileRoute() throws IOException;", "@SuppressWarnings(\"unchecked\")\n\tpublic void usercommand() throws ClassNotFoundException, IOException{\n\t\tString usercommand;\n\t\tSystem.out.println(\"Enter the user command\");\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner sc = new Scanner(System.in);\n\t\t\tif((usercommand=sc.nextLine())!=null){\n\t\t\t\tif(usercommand.contains(\"get\")){\n\t\t\t\t\tfilename = usercommand.split(\" \");\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\tObject obj =obj_in.readObject();// to get the list of portId and Ip\n\t\t\t\t\tList<String> portList = new ArrayList<String>();\n\t\t\t\t\tportList = (List<String>) obj;\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t//return no such files if list is empty\n\t\t\t\t\t\tif (portList.isEmpty()){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t else{\n\t\t\t\t\t\t//if peer list is not empty\n\t\t\t\t\t for (String peerInfo : portList){\n\t\t\t\t\t \tint i = 0;\n\t\t\t\t\t \tgetportInformation = peerInfo.split(\":\");\n\t\t\t\t\t \tclientInfo.put(Integer.parseInt(getportInformation[i]),getportInformation[i+1]);\n\t\t\t\t\t \tSystem.out.println(\"The Port Id and The iP address is \"+peerInfo );\n\t\t\t\t\t \ti = i+2;\n\t\t\t\t\t }\n\t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\t// To check if the file is already in peer\n\t\t\t\t\t\t for (int i = 0; i < portList.size(); i++) {\n\t\t\t\t\t\t\tif(portList.contains(serverPortNumber+\":\"+ip.getHostAddress())){\n\t\t\t\t\t\t\t\tSystem.out.println(\"You already have this file in system\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Enter the following command to download file: download <portNumber>\");\n\t\t\t\t\t\tString command;\n\t\t\t\t\t\t@SuppressWarnings(\"resource\")\n\t\t\t\t\t\tScanner inputPort= new Scanner(System.in);\n\t\t\t\t\t\tcommand= inputPort.nextLine();\n\t\t\t\t\t\tString[] setPortInfo = command.split(\" \");\n\t\t\t\t\t\tint serverPortNum = 0;\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tserverPortNum = Integer.parseInt(setPortInfo[1]);\n\t\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Make sure you enter the command correctly:\");\n\t\t\t\t\t\t\t\tSystem.out.println(\"Get the file name again\");\n\t\t\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Connecting to the port\"+serverPortNum+\" \"+clientInfo.get(serverPortNum));\t\t\t\t\n\t\t\t\t\t\tSocket client_t = new Socket(clientInfo.get(serverPortNum),serverPortNum);\n\t\t\t\t\t\tPrintWriter out_temp = new PrintWriter(client_socket.getOutputStream(),true);\n\t\t\t\t\t\tout_temp.println(setPortInfo[0]);\n\t\t\t\t\t\tbyte[] bytearray = new byte[65000];\n\t\t\t\t\t\tInputStream temp_is = client_t.getInputStream();\n\t\t\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filename[1]));\n\t\t\t\t\t\tint Byteread = temp_is.read(bytearray,0,bytearray.length);\n\t\t\t\t\t\tbos.write(bytearray, 0, Byteread);\n\t\t\t\t\t\tbos.close();\n\t\t\t\t\t\tclient_t.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t\t}\n\t\t\t\t\t}//try\n\t\t\t\t\t\tcatch(NullPointerException e){\n\t\t\t\t\t\tSystem.out.println(\"No such file on system\");\n\t\t\t\t\t\tusercommand();\n\t\t\t\t\t}\n\t\t\t\t\tobj_in.close();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\telse if(usercommand.contains(\"refresh\")){\n\t\t\t\t\tout.println(usercommand);\n\t\t\t\t\t\n//\t\t\t\t\tout.println(\"Got the refresh command\");\n//\t\t\t\t\tout.println(\"File list updated\");\t\t\t\t\t\n\t\t\t\t\tusercommand();\n\t\t\t\t}\n\t\t\t\telse if(usercommand.contains(\"disconnect\")){\n\t\t\t\t\tout.print(usercommand);\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t}", "public String doWhatWithFlights();", "public FTP(String host, int port, String user, String password) {\n super(host, port, user);\n setPassword(password);\n }", "public void findFile(Packet packet) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tchar reqFile;\r\n\t\t// If packet has circled network\r\n\t\tif(peerNode.peerClientID == packet.packetSenderID) {\r\n\t\t\t// If peer has file in its own DHT\r\n\t\t\tif(peerNode.distributedHashTable.containsKey(packet.fileName)) {\r\n\t\t\t\tjava.util.Date hasFileDate = new java.util.Date();\r\n\t\t\t\tSystem.out.print(hasFileDate + \": File is in my Distributed Hash Table at \" );\r\n\t\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\t\r\n\t\t\t\t\tSystem.out.println(peerNode.distributedHashTable.get(packet.fileName).get(i) + \" \");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tArrayList<InetSocketAddress> fileLocations = new ArrayList<InetSocketAddress>();\r\n\t\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\r\n\t\t\t\t\tfileLocations.add(peerNode.distributedHashTable.get(packet.fileName).get(i));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Propmpt user if they want to transfer file\r\n\t\t\t\tjava.util.Date inDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(inDate + \": Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t\t// input validation\r\n\t\t\t\twhile(reqFile == 0 && (reqFile != 'y' || reqFile != 'n')) {\r\n\t\t\t\t\tjava.util.Date errDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(errDate + \": You did not enter a valid command. Try Again. Request the file? Yes: 'y' | No: 'n'\");\r\n\t\t\t\t\treqFile = input.next().charAt(0);\r\n\t\t\t\t}\r\n\t\t\t\t// if yes to transfer\r\n\t\t\t\tif(reqFile == 'y') {\r\n\t\t\t\t\tif(fileLocations.size() == 1) {\r\n\t\t\t\t\t\tif(fileLocations.get(0).getPort() == peerNode.peerClientListenPort) {\r\n\t\t\t\t\t\t\tjava.util.Date haveFile = new java.util.Date();\r\n\t\t\t\t\t\t\tSystem.out.println(haveFile + \": I already have this file\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + fileLocations.get(0).getAddress() + \":\" + fileLocations.get(0).getPort());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(fileLocations.get(0).getAddress(), fileLocations.get(0).getPort());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tint index = (int) (Math.random() * (fileLocations.size()+1));\r\n\t\t\t\t\t\twhile( fileLocations.get(index).getPort() == peerNode.peerClientListenPort) {\r\n\t\t\t\t\t\t\tindex = (int) (Math.random() * (fileLocations.size()+1));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tjava.util.Date reqDate = new java.util.Date();\r\n\t\t\t\t\t\tSystem.out.println(reqDate + \": Requesting the file named \" + packet.fileName + \" from Peer at IP\" + packet.fileLocations.get(index).getAddress() + \":\" + packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tPacket reqFilePckt = new Packet();\r\n\t\t\t\t\t\treqFilePckt.eventCode = 5;\r\n\t\t\t\t\t\treqFilePckt.packetSenderID = peerNode.peerClientID;\r\n\t\t\t\t\t\treqFilePckt.peerClientIP = peerNode.peerClientIP;\r\n\t\t\t\t\t\treqFilePckt.peerClientListenPort = peerNode.peerClientListenPort;\r\n\t\t\t\t\t\treqFilePckt.fileName = packet.fileName;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t// req file\r\n\t\t\t\t\t\t\tpeerNode.peer2Peer = new Socket(packet.fileLocations.get(index).getAddress(), packet.fileLocations.get(index).getPort());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(reqFilePckt);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Close socket/connection\r\n\t\t\t\t\t\t\tcloseConnection();\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t\tcatch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated catch blo\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if(reqFile == 'n') {\r\n\t\t\t\t\tjava.util.Date noReqDate = new java.util.Date();\r\n\t\t\t\t\tSystem.out.println(noReqDate + \": File transfer is not requested\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tjava.util.Date notFndDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(notFndDate + \": File was not found in the network. Please try again later\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Check if peer DHT has file and if so, send response\r\n\t\telse if(peerNode.peerClientID != packet.packetSenderID && peerNode.distributedHashTable.containsKey(packet.fileName)) {\r\n\t\t\tjava.util.Date fileFoundDate = new java.util.Date();\r\n\t\t\tSystem.out.println(fileFoundDate + \": I have the file in my Distributed Hash Table\");\r\n\t\t\tPacket fileLocationPacket = new Packet();\r\n\t\t\tfileLocationPacket.eventCode = 4;\r\n\t\t\tfileLocationPacket.fileName = packet.fileName;\r\n\t\t\tfileLocationPacket.packetSenderID = peerNode.peerClientID;\r\n\t\t\tfileLocationPacket.packetRecipientID = packet.packetSenderID;\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < peerNode.distributedHashTable.get(packet.fileName).size(); i++) {\r\n\t\t\t\tfileLocationPacket.fileLocations.add(peerNode.distributedHashTable.get(packet.fileName).get(i));\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tjava.util.Date fileLocSentDate = new java.util.Date();\r\n\t\t\t\tSystem.out.println(fileLocSentDate + \": Sending file location to Peer Node \" + packet.packetSenderID);\r\n\t\t\t\tpeerNode.peer2Peer = new Socket(packet.peerClientIP, packet.peerClientListenPort);\r\n\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(fileLocationPacket);\r\n\t\t\t\t\r\n\t\t\t\t// Close socket/connection\r\n\t\t\t\tcloseConnection();\r\n\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Forward packet to Successor Peer Nodes until Peer with file in their Distributed Hash Table is found\r\n\t\telse {\r\n\t\t\tPacket p = packet;\r\n\t\t\ttry {\r\n\t\t\t\tpeerNode.peer2Peer = new Socket(peerNode.succPeerIP, peerNode.succPeerPort);\r\n\t\t\t\tpeerNode.peer2PeerOutStream = new ObjectOutputStream(peerNode.peer2Peer.getOutputStream());\r\n\t\t\t\tpeerNode.peer2PeerInStream = new ObjectInputStream(peerNode.peer2Peer.getInputStream());\r\n\t\t\t\tpeerNode.peer2PeerOutStream.writeObject(p);\r\n\t\t\t\t\r\n\t\t\t\t// Close socket/connection\r\n\t\t\t\tcloseConnection();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tcloseConnection();\r\n\t}", "boolean getToForeman();", "public int execute(String cmd) throws IOException, TapisException\n {\n return execute(cmd, new ByteArrayOutputStream(DEFAULT_OUTPUT_LEN));\n }", "public void run() {\n\t\tString currentDirectory = System.getProperty(\"user.home\");\n\n\t\ttry {\n\t\t\tbis = new BufferedInputStream(socket.getInputStream());\n\t\t\tisr = new InputStreamReader(bis);\n\t\t\tbos = new BufferedOutputStream(socket.getOutputStream());\n\t\t\tosw = new OutputStreamWriter(bos);\n\n\t\t\tosw.write(\"Welcome to Java Telnet Server\\n\");\n\t\t\tosw.write(\"\\t\" + System.getProperty(\"os.name\") + \" - \"\n\t\t\t\t\t+ System.getProperty(\"os.arch\"));\n\t\t\tosw.write(\"\\n\\n\");\n\t\t\tosw.flush();\n\n\t\t\twhile (stopper) {\n\t\t\t\tosw.write(\"$ \");\n\t\t\t\tosw.flush();\n\n\t\t\t\t// read until enter or return (13) key is pressed\n\t\t\t\tint character;\n\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\twhile ((character = isr.read()) != 13)\n\t\t\t\t\tsb.append((char) character);\n\n\t\t\t\t// split buffer and extract - command, options and arguments\n\t\t\t\tString[] commandArray = sb.toString().trim().split(\"\\\\s+\");\n\n\t\t\t\tString command = (commandArray.length >= 1) ? commandArray[0]\n\t\t\t\t\t\t: null;\n\t\t\t\tArrayList<String> commandOptions = new ArrayList<String>();\n\t\t\t\tArrayList<String> commandArguments = new ArrayList<String>();\n\n\t\t\t\tfor (int i = 1; i < commandArray.length; i++) {\n\t\t\t\t\tif (commandArray[i].startsWith(\"-\")) {\n\t\t\t\t\t\tcommandOptions.add(commandArray[i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommandArguments.add(commandArray[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlogger.info(\"Command : \" + command + \" Options : \"\n\t\t\t\t\t\t+ commandOptions.toString() + \" Arguments : \"\n\t\t\t\t\t\t+ commandArguments.toString());\n\n\t\t\t\t// process command\n\t\t\t\t// check if command is to exit\n\t\t\t\tif (command.equals(\"exit\") || command.equals(\"quit\")\n\t\t\t\t\t\t|| command.equals(\"bye\")) {\n\t\t\t\t\tosw.write(\"See ya!\\n\");\n\t\t\t\t\tosw.flush();\n\t\t\t\t\tstopper = false;\n\t\t\t\t} else {\n\t\t\t\t\t// get the command from factory and execute\n\t\t\t\t\tAbstractCommand abstractCommand = CommandFactory\n\t\t\t\t\t\t\t.getCommandInstance(command);\n\t\t\t\t\tif (abstractCommand != null) {\n\t\t\t\t\t\t// set command options\n\t\t\t\t\t\tabstractCommand.setOptions(commandOptions\n\t\t\t\t\t\t\t\t.toArray(new String[commandOptions.size()]));\n\t\t\t\t\t\t//set command arguments\n\t\t\t\t\t\tabstractCommand.setArguments(commandArguments\n\t\t\t\t\t\t\t\t.toArray(new String[commandArguments.size()]));\n\t\t\t\t\t\t// set console to output\n\t\t\t\t\t\tabstractCommand.setConsole(osw);\n\t\t\t\t\t\t// set current working directory\n\t\t\t\t\t\tabstractCommand.setCurrentDirectory(currentDirectory);\n\t\t\t\t\t\tabstractCommand.execute();\n\t\t\t\t\t\t// get the current directory after command execution\n\t\t\t\t\t\tcurrentDirectory = abstractCommand\n\t\t\t\t\t\t\t\t.getCurrentDirectory();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tosw.write(command + \": command not found\\n\");\n\t\t\t\t\t\tosw.flush();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tlogger.debug(\"Failed to read/write from input/output streams\\n\");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// Close all open streams\n\t\t\ttry {\n\t\t\t\tbis.close();\n\t\t\t\tisr.close();\n\t\t\t\tbos.close();\n\t\t\t\tosw.close();\n\t\t\t} catch (IOException e1) {\n\t\t\t\tlogger.debug(\"Failed closing input/output streams\\n \");\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\n\t\t\t// Try closing client connection\n\t\t\ttry {\n\t\t\t\tsocket.close();\n\t\t\t} catch (IOException e2) {\n\t\t\t\tlogger.debug(\"Closing of client socket failed\\n \");\n\t\t\t\te2.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public String getCmd() {\r\n return cmd;\r\n }", "public static ArrayList<String> commandList() {\n\r\n\t\tArrayList<String> commands = new ArrayList<String>();\r\n\r\n\t\tcommands.add(\"/HELP\");\r\n\t\tcommands.add(\"/QUIT\");\r\n\t\tcommands.add(\"/REMOVE\");\r\n\t\tcommands.add(\"/BAN\");\r\n\t\tcommands.add(\"/BANIP\");\r\n\t\tcommands.add(\"/REMOVEIP\");\r\n\t\tcommands.add(\"/CLEAR\");\r\n\t\tcommands.add(\"/SHOW\");\r\n\t\tcommands.add(\"/WARN\");\r\n\r\n\t\treturn commands;\r\n\t}", "public void sendCommand(Command cmd);", "public static void main(String[] args) {\n\n System.err.println(\"This is a work in progress and I have no idea what I'm doing...\");\n\n var server = new TftpServer();\n\n try (var ss = new DatagramSocket(69)) {\n while (!ss.isClosed()) {\n byte[] buf = new byte[512];\n var p = new DatagramPacket(buf, buf.length);\n ss.receive(p);\n\n server.parse(p);\n }\n } catch (IOException ex) {\n System.err.println(\"IOException: \" + ex.getMessage());\n }\n }", "private void getCommand(String cmlet) {\n\t\tSystem.out.println(\"Command Version\");\n\t\tSystem.out.println(\"----------- -------\");\n\t\tSystem.out.println(\" Exit 1.0\");\n\t\tSystem.out.println(\" Get-Host 1.0\");\n\t\tSystem.out.println(\" Get-Command 1.0\");\n\t\tSystem.out.println(\" Write-Host 1.0\");\n\t}", "public byte[] download(String username,String filename) throws java.rmi.RemoteException{\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbyte download[] = null;\n \t\ttry \n {\n \tFile fileIn = new File(\"C:\\\\FTPManager\\\\SERVER\\\\\"+username+\"\\\\\"+filename);\n \tdownload = new byte[(int) fileIn.length()];\n \tFileInputStream fileInStream = new FileInputStream(fileIn);\n \tfileInStream.read(download);\n \t\n \n } \n catch (RemoteException ex) \n {\n \n } \n catch (IOException ex) \n {\n System.out.println(\"IOException : \" + ex);\n } \n catch (ArrayIndexOutOfBoundsException ex) \n {\n System.out.println(\"Folder is empty\" + ex);\n } \n\t\t\t\t\n\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\n\t\t\t\t\tFile file = new File(\"C:\\\\FTPManager\\\\CLIENT\\\\Downloads\\\\\"+username+\"\\\\\"+filename);\n\t\t\t\t\tFileOutputStream downLoadFile = new FileOutputStream(file);\n \tdownLoadFile.write(download);\n \n \n \tJOptionPane.showMessageDialog(null,\"Download completed\");\n \n \tdownLoadFile.flush();\n\t\t\t\t\tdownLoadFile.close();\n \n \n \n \t\t\t} \n \t\t\t\tcatch (IOException ex) \n \t\t\t{\n \t\t\tJOptionPane.showMessageDialog(null,\"There was an issue downloading - to the users download folder.\");\n \t\t\t}\n\t\t\t\n \n \t\treturn buffer;\n \n \n\t\t\t\n\t\n\t\t\t\t}", "public interface Command {\n /**@param request from client\n * @return path for jsp file / image, encoded to string / xml file as string\n */\n String execute(HttpServletRequest request);\n}", "@Override\r\n\tpublic boolean downloadFile() throws FileSystemUtilException {\r\n\t\tlogger.debug(\"Begin: \" + getClass().getName() + \":download()\");\r\n\t\ttry {\r\n\t\t\tconnect();\r\n\t\t\tgetFileData(0, \"\");\r\n\t\t\tdisconnect();\r\n\t\t\tif (stop) {\r\n\t\t\t\tthrow new FileSystemUtilException(\"999\");\r\n\t\t\t}\r\n\t\t\tFileSystemUtilsPlugin zu = new FileSystemUtilPluginFactory().getFileUtils(FileSystemTypeConstants.ZIP);\r\n\t\t\tif (zu.isZip(localFilePath)) {\r\n\r\n\t\t\t\t// unzip the localfilepath (a common method at import util level\r\n\t\t\t\t// can be used)\r\n\t\t\t\t// rename the extracted file to localfilepath+\".txt\r\n\t\t\t\t// delete the localfilepath\r\n\t\t\t}\r\n\t\t\tzu = null;\r\n\t\t\tlogger.debug(\"End: \" + getClass().getName() + \":download()\");\r\n\t\t\treturn true;\r\n\t\t} catch (FileSystemUtilException e) {\r\n\t\t\tdisconnect();\r\n\t\t\tlogger.info(new Date() + \":: Unable to download with parameters \" + \", username= \" + username\r\n\t\t\t\t\t+ \" , password = \" + password + \" , remotefilePath = \" + remoteFilePath + \", \" + \"localFilePath = \"\r\n\t\t\t\t\t+ localFilePath + \" , host= \" + hostname + \" and port =\" + port);\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t}" ]
[ "0.5927398", "0.57910305", "0.5761216", "0.5654345", "0.56482303", "0.55643576", "0.55049014", "0.5480499", "0.5280572", "0.5251641", "0.52223253", "0.5166895", "0.51639265", "0.51326054", "0.5119901", "0.5065551", "0.5047971", "0.5023427", "0.50079143", "0.49924722", "0.4957786", "0.49411616", "0.49404314", "0.49390066", "0.49134088", "0.49028134", "0.48952174", "0.48868382", "0.48721126", "0.4861013", "0.48571703", "0.48409814", "0.4818805", "0.4799746", "0.47807196", "0.47781223", "0.47716352", "0.47706974", "0.4770602", "0.47609735", "0.47584447", "0.47444066", "0.47124413", "0.4708678", "0.4701478", "0.4689114", "0.468891", "0.46773586", "0.4676916", "0.46749878", "0.46731326", "0.46680364", "0.46649224", "0.46577984", "0.46420962", "0.4639361", "0.4634297", "0.46255916", "0.4622421", "0.46196645", "0.46178058", "0.46089518", "0.46020633", "0.46008357", "0.4585696", "0.45803496", "0.4575016", "0.4575009", "0.4572722", "0.45725998", "0.45620525", "0.45591548", "0.45355257", "0.4531954", "0.45278746", "0.4519202", "0.4509416", "0.44989341", "0.44983667", "0.4496648", "0.44922382", "0.44894716", "0.44866386", "0.44832024", "0.4474615", "0.44600394", "0.445498", "0.4445389", "0.44420242", "0.44411623", "0.44368517", "0.44343966", "0.442905", "0.44084764", "0.43926162", "0.43858352", "0.43837714", "0.43826404", "0.4382621", "0.43824014" ]
0.65539074
0
TODO Autogenerated method stub
public static void main(String[] args) { Metho Method = new Metho(); Time Time = new Time(); Constructor Const = new Constructor(); MonthDay Date = new MonthDay(22,01,1999); BirthReference Refer = new BirthReference("Mateus", Date); FinalAreaCalc Circle = new FinalAreaCalc(); String sample = "This is an string :p."; byte b = 127; short s = 32767; int i = 1; int age = 18; float f = 3 * 2131231243; double d = 3.12345678987654321 * 3.231321; double tuna = 1.3; boolean z = false; char c = '\u0003'; System.out.println("Hello World!"); System.out.print("Hello World!"); System.out.print("Hello World!"); System.out.println(""); System.out.println(b); System.out.println(s); System.out.println(i); System.out.println(f); System.out.println("\t\t" + d); System.out.println(z); System.out.println(c); System.out.println(Math.abs(-1.2)); System.out.println(Math.ceil(1.1)); System.out.println(Math.floor(1.9)); System.out.println(Math.max(.3, .2)); System.out.println(Math.min(.3, .2)); System.out.println(Math.pow(2, 3)); System.out.println(Math.sqrt(9)); System.out.print("I want "); System.out.print(tuna); System.out.println(" g of tuna."); System.out.printf("%s\n", sample); Method.print("This is a print from another class!"); System.out.println(age >= 18 ? "You can enter." : "You can't enter."); System.out.println("The average = " + Metho.average(1,2,3,4,5,6,7,8,9,10)); System.out.println(Time.toMilitary()); Time.setime(0, 0,8400); System.out.println(Time.toMilitary()); System.out.println(Time.toString()); Time.setime(5); System.out.println(Time.toMilitary()); Const.printString(5, 6, 7); Const.printThisString(5, 6, 7); System.out.println(Refer); Circle.calcArea(2); double area = Circle.returnArea(); System.out.println("The area of the circle is: "+area); System.out.println("The average = " + Metho.average(1,2,3,4,54,6,7,8,3,34,24,213,42,4,6,87)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66713095", "0.6567948", "0.652319", "0.648097", "0.64770466", "0.64586824", "0.64132667", "0.6376419", "0.62759", "0.62545097", "0.62371093", "0.62237984", "0.6201738", "0.619477", "0.619477", "0.61924416", "0.61872935", "0.6173417", "0.613289", "0.6127952", "0.6080854", "0.6076905", "0.6041205", "0.6024897", "0.60200036", "0.59985113", "0.5967729", "0.5967729", "0.5965808", "0.5949083", "0.5941002", "0.59236866", "0.5909713", "0.59030116", "0.589475", "0.58857024", "0.58837134", "0.586915", "0.58575684", "0.5850424", "0.5847001", "0.5824116", "0.5810248", "0.5809659", "0.58069366", "0.58069366", "0.5800507", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.5792168", "0.57900196", "0.5790005", "0.578691", "0.578416", "0.578416", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5774115", "0.5761079", "0.57592577", "0.57592577", "0.5749888", "0.5749888", "0.5749888", "0.5748457", "0.5733414", "0.5733414", "0.5733414", "0.57209575", "0.57154554", "0.57149583", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.57140404", "0.571194", "0.57043016", "0.56993437", "0.5696782", "0.5687825", "0.5677794", "0.5673577", "0.5672046", "0.5669512", "0.5661156", "0.56579345", "0.5655569", "0.5655569", "0.5655569", "0.56546396", "0.56543446", "0.5653163", "0.56502634" ]
0.0
-1
Encrypt() will process a string as input, build and return a resulting encrypted version of the input string.
private static String encrypt(String str) { String result = ""; /* STEP 1: remove spaces */ str = str.replaceAll("\\s+", ""); /* STEP 2: calculate dimensions */ double dim = Math.sqrt(str.length()); int rows = (int) Math.floor(dim); int columns = (int) Math.ceil(dim); /* STEP 3: check dimensions */ if(columns*rows < str.length()) { if(columns > rows) { rows = columns; } else { columns = rows; } } /* STEP 4: build resulting string from column and index offset */ for(int i = 0; i < columns; i++) { for(int j = 0; j < rows; j++) { if(j*columns+i < str.length()) result += str.charAt(j*columns+i); } if(i < columns-1) result += " "; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String encrypt(String input) {\n \n StringBuilder sb = new StringBuilder(input);\n \n for (int i=0; i< sb.length(); i++) {\n char encrypted = encrypt(sb.charAt(i));\n sb.setCharAt(i, encrypted);\n }\n \n return sb.toString();\n }", "String encrypt(String input) throws IllegalArgumentException, EncryptionException;", "public EncryptorReturn encrypt(String in) throws CustomizeEncryptorException;", "String encrypt(String input) {\n\t\treturn BaseEncoding.base64().encode(input.getBytes());\n\t}", "public String encrypt (String input) {\n // parameter checks. If input has nothing, or both keys\n // are zero, we have no work to do.\n if (!hasValue(input)) return \"\";\n if (mainKey1 == 0 && mainKey2 == 0) return input;\n\n // Start with a StringBuilder we can update below.\n StringBuilder encrypted = new StringBuilder(input);\n\n // Walk the input string and transform each letter that exists in\n // our alphabet\n for (int i = 0; i < encrypted.length(); i++) {\n char currChar = encrypted.charAt(i);\n int idx = alphabet.indexOf(currChar);\n if (idx != -1) {\n // Which alphabet do I use? even i is key1, odd i is key2\n String shiftedAlphabet = (i % 2 == 0) ? shiftedAlphabet1: shiftedAlphabet2;\n char newChar = shiftedAlphabet.charAt(idx);\n encrypted.setCharAt(i, newChar);\n }\n }\n\n return encrypted.toString();\n }", "public String encrypt(String plainText);", "String encryptString(String toEncrypt) throws NoUserSelectedException;", "public String encrypt(String text) {\n return content.encrypt(text);\n }", "public String encryptString(String s){\r\n\t\tchar[] cArr = s.toCharArray();\r\n\t\tString rStr = \"\";\r\n\t\tfor(char c : cArr){\r\n\t\t\trStr += encryptChar(c);\r\n\t\t}\r\n\t\treturn rStr;\r\n\t}", "public static String encrypt(String input) {\n\t\tBase64.Encoder encoder = Base64.getMimeEncoder();\n String message = input;\n String key = encoder.encodeToString(message.getBytes());\n return key;\n\t}", "public static String encrypt(String str)\n {\n StringBuilder sb = new StringBuilder(str);\n\n int lenStr = str.length();\n int lenKey = key.length();\n\n //\n // For each character in our string, encrypt it...\n for ( int i = 0, j = 0; i < lenStr; i++, j++ )\n {\n if ( j >= lenKey ) j = 0; // Wrap 'round to beginning of key string.\n\n //\n // XOR the chars together. Must cast back to char to avoid compile error.\n //\n sb.setCharAt(i, (char)(str.charAt(i) ^ key.charAt(j)));\n }\n\n return sb.toString();\n }", "public String encrypt(String input) {\n String result = \"\";\n for (int i = 0; i < input.length(); i += 2) {\n result += input.charAt(i);\n }\n for (int i = 1; i < input.length(); i += 2) {\n result += input.charAt(i);\n }\n return result;\n }", "public String encrypt(final String value) {\n\t\treturn encryptor.encrypt(value);\n\t}", "public String encrypt(String unencryptedString) throws InvalidKeyException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException {\n String encryptedString = null;\n try{\n cipher.init(Cipher.ENCRYPT_MODE, key);\n byte[] plainText = unencryptedString.getBytes(UNICODE_FORMAT);\n byte[] encryptedText = cipher.doFinal(plainText);\n BASE64Encoder base64encoder = new BASE64Encoder();\n // encryptedString = base64encoder.<span class=\"\\IL_AD\\\" id=\"\\IL_AD9\\\">encode</span>(encryptedText);\n encryptedString = base64encoder.encode(encryptedText);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n return encryptedString;\n }", "Encryption encryption();", "byte[] encrypt(String plaintext);", "public String encrypt(String input)\n {\n StringBuilder encrypted = new StringBuilder(input);\n\n String alphabetLower = alphabet.toLowerCase();\n String shiftedAlphabetLower1 = shiftedAlphabet1.toLowerCase();\n String shiftedAlphabetLower2 = shiftedAlphabet2.toLowerCase();\n\n for (int k = 0; k < encrypted.length() ; k++)\n {\n char currentChar = encrypted.charAt(k);\n int indexOfCurrentCharAlphabet = alphabet.indexOf(currentChar);\n int indexOfCurrentCharLower = alphabetLower.indexOf(currentChar);\n\n if (indexOfCurrentCharAlphabet != -1 && k % 2 == 0)\n {\n char newCurrentCharAlphabet = shiftedAlphabet1.charAt(indexOfCurrentCharAlphabet);\n encrypted.setCharAt(k, newCurrentCharAlphabet);\n }\n\n if (indexOfCurrentCharAlphabet != -1 && k % 2 != 0)\n {\n char newCurrentCharAlphabet = shiftedAlphabet2.charAt(indexOfCurrentCharAlphabet);\n encrypted.setCharAt(k, newCurrentCharAlphabet);\n }\n\n if (indexOfCurrentCharLower != -1 && k % 2 == 0)\n {\n char newCurrentCharLower = shiftedAlphabetLower1.charAt(indexOfCurrentCharLower);\n encrypted.setCharAt(k, newCurrentCharLower);\n }\n\n if (indexOfCurrentCharLower != -1 && k % 2 != 0)\n {\n char newCurrentCharLower = shiftedAlphabetLower2.charAt(indexOfCurrentCharLower);\n encrypted.setCharAt(k, newCurrentCharLower);\n }\n }\n return encrypted.toString();\n }", "public static String encrypt(String strToEncrypt) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"AES/ECB/PKCS5PADDING\");\n\t\t\tfinal SecretKeySpec secretKey = new SecretKeySpec(key, \"AES\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, secretKey);\n\t\t\tfinal String encryptedString = Base64.encodeBase64String(cipher\n\t\t\t\t\t.doFinal(strToEncrypt.getBytes()));\n\t\t\treturn encryptedString;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t}", "public static String encrypt(String strToEncrypt)\n {\n try\n {\n Cipher cipher = Cipher.getInstance(\"AES/ECB/PKCS5Padding\");\n final SecretKeySpec secretKey = new SecretKeySpec(key, \"AES\");\n cipher.init(Cipher.ENCRYPT_MODE, secretKey);\n final String encryptedString = Base64.encodeBase64String(cipher.doFinal(strToEncrypt.getBytes()));\n return encryptedString;\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n return null;\n\n }", "public static String encrypt(String string)\n\t{\n\t\tif(string == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn DigestUtils.sha256Hex(string + salt);\n\t\t}\n\t}", "public String encrypt(String text) {\n\t\t\n\t\t//If key is shorter than the text, repeat keyword along length of text\n\t\tif(key.length() < text.length()) {\n\t\t\trepeatKey(text);\n\t\t}\n\t\t\n\t\ttext = text.toLowerCase();\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tfor(int i = 0 ; i < text.length(); i++) {\n\t\t\tchar textLetter = text.charAt(i);\n\t\t\tchar keyLetter = key.charAt(i);\n\t\t\t\t\t\t\n\t\t\t//Char to encode's position in alphabet\n\t\t\tint textCharacterIndex = alphabet.indexOf(textLetter);\n\t\t\t\n\t\t\t//Only encrypt letters\n\t\t\tif(Character.isLetter(textLetter)) {\n\t\t\t\t\n\t\t\t\t//If character is in the second half of cipher A-M\n\t\t\t\tif(charMap.get(textLetter) > 12 && charMap.get(textLetter) <= 25) {\n\t\t\t\t\t\n\t\t\t\t\tint keyValue = charMapKey.get(keyLetter);\n\t\t\t\t\tString cipher = shiftLeft(baseCipherRHS, keyValue);\t\t\t\t\t\n\t\t\t\t\tsb.append(cipher.charAt(textCharacterIndex % 13));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tint keyValue = charMapKey.get(keyLetter);\n\t\t\t\t\tString cipher = shiftRight(baseCipherLHS, keyValue);\n\t\t\t\t\tsb.append(cipher.charAt(textCharacterIndex % 13));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsb.append(text.charAt(i));\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\t}", "public static String encrypt(String data){\n\t\tif (data.equals(\"\") || data.equals(\"null\"))\n\t\t\treturn data;\n\t\ttry{\n\t\t\tjavax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance(CIPHER);\n\t\t\tcipher.init(javax.crypto.Cipher.ENCRYPT_MODE, new SecretKeySpec(ENCRYPTION_KEY.getBytes(Charset.forName(\"UTF-8\")), \"AES\"), new IvParameterSpec(new byte[16]));\n\t\t\tbyte[] encryptedBytes = cipher.doFinal(data.getBytes(Charset.forName(\"UTF-8\")));\n\t\t\treturn ENCRYPTION_PREFIX + new String(Base64.encodeBase64(encryptedBytes), Charset.forName(\"UTF-8\"));\n\t\t}catch (Exception e) {\n\t\t\tSystem.err.println( \"Error in EncryptionUtil.encrypt: \" + e );\n\t\t\treturn data;\n\t\t}\n\t}", "public String encryptString(String message) {\n byte[] data = message.getBytes();\n return encrypt(new BigInteger(data)).toString();\n }", "public static String encipher(String string, String key){\n key = key != null ? key : defaultKey;\n String newString = \"\";\n string = Enigma.handleStringOnInput(string);\n string = string.toUpperCase();\n for (int i = 0; i < string.length(); i++){\n int temp = alphabetL.indexOf(string.charAt(i));\n newString += key.charAt(temp);\n }\n return newString;\n }", "public static String Encrypt(String inputText, String key) {\n String retVal = \"\";\n try {\n Cipher cipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n byte[] keyBytes = new byte[16];\n byte[] b = key.getBytes();\n int len = b.length;\n if (len > keyBytes.length) {\n len = keyBytes.length;\n }\n System.arraycopy(b, 0, keyBytes, 0, len);\n SecretKeySpec keySpec = new SecretKeySpec(keyBytes, \"AES\");\n IvParameterSpec ivSpec = new IvParameterSpec(keyBytes);\n cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);\n BASE64Encoder _64e = new BASE64Encoder();\n byte[] encryptedData = cipher.doFinal(inputText.getBytes());\n retVal = _64e.encode(encryptedData);\n\n } catch (Exception ex) {\n ApiLog.One.WriteException(ex);\n }\n return retVal;\n }", "private static String encrypt(String in){\n\n\t String alphabet = \"1234567890\";\n\n\t String scramble1 = \"<;\\'_$,.?:|)\";\n\t String scramble2 = \"XYZVKJUTHM\";\n\t String scramble3 = \"tuvwxyz&*}\";\n\t String scramble4 = \"~!-+=<>%@#\";\n\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t char messageIn[] = in.toCharArray();\n\t String r = \"\";\n\n\t for(int i = 0; i < in.length(); i++){\n\n\t int letterIndex = alphabet.indexOf(in.charAt(i));\n\n\t if(i % 3 == 0){\n\t r += scramble1.charAt(letterIndex);\n\t }else if (i % 3 == 1){\n\t \tr += scramble2.charAt(letterIndex);\n\t }else if(i % 3 == 2){\n\t \tr += scramble3.charAt(letterIndex);\n\t }\n\t }\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\" Encoded Message: \" + r);\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\\n\\n\");\n\t\treturn r;\n\t}", "public static String encrypt(String input, String key){\n\t\treturn encrypt(input, key, shift);\n\t}", "public static String encrypt(String text) {\r\n\t\tString modifiedText = \"\";\r\n\t\tchar character;\r\n\t\tint code = 0;\r\n\t\tfor (int i = 0; i < text.length(); i++) {\r\n\t\t\tcharacter = text.charAt(i);\r\n\t\t\tcode = character + 7;\r\n\t\t\tcharacter = (char) code;\r\n\t\t\tmodifiedText += Character.toString(character);\r\n\t\t}\r\n\t\treturn modifiedText;\r\n\t}", "public static String encrypt(String message) {\n\t\tStringBuilder encryption = new StringBuilder();\n\t\tfor(int i=0;i<message.length();i++) {\n\t\t\tchar letter = message.charAt(i);\n\t\t\tif(letter >= 'a' && letter <= 'm') {\n\t\t\t\tletter +=13;\n\t\t\t}if(letter >= 'n' && letter <= 'z') {\n\t\t\t\tletter -=13;\n\t\t\t}if(letter >= 'A' && letter <= 'M') {\n\t\t\t\tletter +=13;\n\t\t\t}if(letter >= 'N' && letter <= 'Z') {\n\t\t\t\tletter -=13;\n\t\t\t}encryption.append(letter);\n\t\t}\n\t\treturn encryption.toString();\n\t}", "public String Crypt(String s);", "public String encryptString(String plainText) {\n return encStr(plainText, new Random().nextLong());\n }", "public String encrypt(String geheimtext);", "public interface EncryptionAlgorithm {\n\n public String encrypt(String plaintext);\n\n}", "public static String encode(String inString, String type, String Key) throws Exception{\r\n\t\tStringBuilder encodedString = new StringBuilder();\r\n\t\tString thisString;\r\n\t\tencodedString.append(\"<encrypted type=\" + type + \" key=\");\r\n\t\tif(type==\"Caesar\"){\r\n\t\t\tencodedString.append(Integer.toHexString(Integer.parseInt(Key)) + \"> \");\r\n\t\t\tchar[] alphabet ={'a','b','c','d','e','f','g','h','i','j','k','l','m',\r\n\t\t\t\t\t'n','o','p','q','r','s','t','u','v','w','x','y','z','å','ä','ö','A','B',\r\n\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U',\r\n\t\t\t\t\t'V','W','X','Y','Z','Å','Ä','Ö','0','1','2','3','4','5','6','7','8','9',\r\n\t\t\t\t\t'!','?',')','(','=','>','<','/','&','%','#','@','$','[',']'};\r\n\t\t\tfor(int i = 0; i < inString.length(); i++){\r\n\t\t\t\tchar a = inString.charAt(i);\r\n\t\t\t\tint used = 0;\r\n\t\t\t\tfor(char b: alphabet){\r\n\t\t\t\t\tif(b==a){\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tthisString = String.format(\"%02x\",(int)alphabet[(indexOf(alphabet,b)\r\n\t\t\t\t\t\t\t\t\t+Integer.parseInt(Key))%alphabet.length]);\r\n\t\t\t\t\t\t\tencodedString.append(thisString);\r\n\t\t\t\t\t\t\tused = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}catch(Exception c){\r\n\t\t\t\t\t\t\tSystem.out.print(c.getMessage());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(used==0){\r\n\t\t\t\t\tthisString = String.format(\"%02x\", (int)a);\r\n\t\t\t\t\tencodedString.append(thisString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(type==\"AES\"){\r\n\t\t\tfor(int i = 0; i<Key.length();i++){\r\n\t\t\t\tencodedString.append(String.format(\"%02x\", (int)Key.charAt(i)));\r\n\t\t\t}\r\n\t\t\tencodedString.append(\">\");\r\n\t\t\tencodedString.append(\" \");\r\n\t\t\tbyte[] keyContent = Base64.getDecoder().decode(Key);\r\n\t\t\tSecretKeySpec AESkey = new SecretKeySpec(keyContent,0,keyContent.length, \"AES\");\r\n\t\t\tSystem.out.println(keyContent);\r\n\t\t\t\r\n\t\t\tCipher AEScipher = Cipher.getInstance(\"AES\");\r\n\t\t\tAEScipher.init(Cipher.ENCRYPT_MODE, AESkey);\r\n\t\t\tbyte[] cipherData = AEScipher.doFinal(inString.getBytes());\r\n\t\t\tfor(byte b: cipherData){\r\n\t\t\t\tencodedString.append(String.format(\"%02x\", b));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tthrow new Exception(\"Unknown encryption\");\r\n\t\t}\r\n\t\tencodedString.append(\" </encrypted> \");\r\n\t\treturn encodedString.toString();\r\n\t\t\r\n\t}", "String encryption(Long key, String encryptionContent);", "public static String encryption(String s) {\n // Extract valid charcters (a-z) from s\n StringBuffer src = new StringBuffer();\n int L = 0; // # of valid characters\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (c != ' ') { // not empty space\n src.append(c);\n L += 1;\n }\n }\n\n // find floor(sqrt(L)) & ceiling(sqrt(L))\n int n = 2;\n while (n*n < L) {\n n += 1;\n }\n // m <= sqrt(L) <= n\n\n StringBuffer result = new StringBuffer();\n for (int j = 0; j < n; j++) {\n for (int k = j; k < L; k += n) {\n result.append(src.charAt(k));\n }\n if (j != n-1) { // last set, no need to add space at end\n result.append(' ');\n }\n }\n\n return result.toString();\n }", "private String encrypt(String input){\n\t\tbyte[] crypt = null;\n\t\t\n\t\ttry {\n\t\t\t// Génération d'une spec de clé secrète à partir de la clé \"secret\"\n\t\t\tSecretKeySpec KS = new SecretKeySpec(SECRET_KEY.getBytes(), \"Blowfish\");\n\t\t\t\n\t\t\t// Initialisation d'un code basé sur blowfish\n\t\t Cipher cipher = Cipher.getInstance(\"Blowfish\");\n\t\t cipher.init(Cipher.ENCRYPT_MODE, KS);\n\n\t\t // chiffrement du message\n\t\t crypt = cipher.doFinal(input.getBytes());\n\t\t\t\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(\"Algorithme inconnu \" + e.getMessage());\n\t\t} catch (NoSuchPaddingException e) {\n\t\t\tSystem.err.println(\"Offset inconnu \" + e.getMessage());\n\t\t} catch (InvalidKeyException e) {\n\t\t\tSystem.err.println(\"Clé non valide \" + e.getMessage());\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\tSystem.err.println(\"Bloc de taille invalide \" + e.getMessage());\n\t\t} catch (BadPaddingException e) {\n\t\t\tSystem.err.println(\"Mauvais Padding : \" + e.getMessage());\n\t\t}\n\t\t\n\t\t// (pour des raisons d'encodage des caractères et de sauvegarde des bytes[] en base, on gardera les HexValues)\n\t\treturn byteArrayToHexString(crypt);\n\t}", "public String encryptText(String input) {\n\n String inputUC = input.toUpperCase();\n\n StringBuilder outputSB = new StringBuilder();\n\n for (int i = 0; i < input.length(); i++) {\n\n if (Character.toString(inputUC.charAt(i)).equalsIgnoreCase(\" \")) {\n\n outputSB.append(Character.toString(inputUC.charAt(i)));\n }\n else {\n for (int j = 0; j < this.charLibrary.length(); j++) {\n if (Character.toString(inputUC.charAt(i)).equalsIgnoreCase(Character.toString(this.charLibrary.charAt(j)))) {\n\n outputSB.append(this.key.charAt(j));\n }\n }\n }\n }\n return outputSB.toString();\n }", "private static void encodeString(String in){\n\n\t\tString officalEncodedTxt = officallyEncrypt(in);\n\t\tSystem.out.println(\"Encoded message: \" + officalEncodedTxt);\n\t}", "PBEncryptStorage encrypt(String inputString, String password, byte[] salt);", "@Override\n public String encrypt(String text) {\n if (StringUtils.isBlank(text)) {\n return null;\n }\n\n try {\n byte[] iv = new byte[GCM_IV_LENGTH];\n RandomUtils.RANDOM.nextBytes(iv);\n\n Cipher cipher = Cipher.getInstance(ENCRYPT_ALGORITHM);\n GCMParameterSpec ivSpec = new GCMParameterSpec(GCM_TAG_LENGTH * Byte.SIZE, iv);\n cipher.init(Cipher.ENCRYPT_MODE, getKeyFromPassword(), ivSpec);\n\n byte[] ciphertext = cipher.doFinal(text.getBytes(StandardCharsets.UTF_8));\n byte[] encrypted = new byte[iv.length + ciphertext.length];\n System.arraycopy(iv, 0, encrypted, 0, iv.length);\n System.arraycopy(ciphertext, 0, encrypted, iv.length, ciphertext.length);\n\n return Base64.getEncoder().encodeToString(encrypted);\n } catch (NoSuchAlgorithmException\n | IllegalArgumentException\n | InvalidKeyException\n | InvalidAlgorithmParameterException\n | IllegalBlockSizeException\n | BadPaddingException\n | NoSuchPaddingException e) {\n LOG.debug(ERROR_ENCRYPTING_DATA, e);\n throw new EncryptionException(e);\n }\n }", "public String encrypt() {\n StringBuilder encryptedText = new StringBuilder();\n //Make sure the key is valid.\n if (key < 0 || key > 25) {\n Log.d(\"TAG\", \"encrypt: Error in Keu=y \");\n return \"Key Must be 0 : 25\";\n }\n if (plaintext.length() <= 0) {\n Log.d(\"TAG\", \"encrypt: Error in Plain\");\n return \"Error in Plaintext\";\n }\n //Eliminates any whitespace and non alpha char's.\n plaintext = plaintext.trim();\n plaintext = plaintext.replaceAll(\"\\\\W\", \"\");\n if (plaintext.contains(\" \")) {\n plaintext = plaintext.replaceAll(\" \", \"\");\n }\n //Makes sure that all the letters are uppercase.\n plaintext = plaintext.toUpperCase();\n Log.i(\"Caesar\", \"encrypt: plainis : \" + plaintext);\n for (int i = 0; i < plaintext.length(); i++) {\n char letter = plaintext.charAt(i);\n if (charMap.containsKey(letter) && charMap.get(letter) != null) {\n int lookUp = (charMap.get(letter) + key) % 26;\n encryptedText.append(encryptionArr[lookUp]);\n }\n }\n Log.d(\"Caesar.java\", \"encrypt: the Data is \" + encryptedText.toString());\n return encryptedText.toString();\n }", "@Test\n\tpublic void doEncrypt() {\n\t\tString src = \"18903193260\";\n\t\tString des = \"9oytDznWiJfLkOQspiKRtQ==\";\n\t\tAssert.assertEquals(Encryptor.getEncryptedString(KEY, src), des);\n\n\t\t/* Encrypt some plain texts */\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.add(\"18963144219\");\n\t\tlist.add(\"13331673185\");\n\t\tlist.add(\"18914027730\");\n\t\tlist.add(\"13353260117\");\n\t\tlist.add(\"13370052053\");\n\t\tlist.add(\"18192080531\");\n\t\tlist.add(\"18066874640\");\n\t\tlist.add(\"15357963496\");\n\t\tlist.add(\"13337179174\");\n\t\tfor (String str : list) {\n\t\t\tSystem.out.println(Encryptor.getEncryptedString(KEY, str));\n\t\t}\n\t}", "public static String officallyEncrypt(String in){\n\t BigInteger bigIntEncrypt = bigIntEncrypt(in);\n\n\t String finalEncrypt = encrypt(bigIntEncrypt.toString());\n\t\treturn finalEncrypt;\n\t}", "public String encrypt(String value) throws Exception \n\t{\n\t\treturn value;\n\t}", "private static void encrypt(String userString) {\n String[] words = userString.split(\"\");\n userInput = new ArrayList<String>(Arrays.asList(words));\n ArrayList<String> encryptedText = new ArrayList<String>();\n\n for (int i = 0; i < userInput.size(); i++) {\n if (userInput.get(i).equals(\" \")) {\n userInput.set(i, \"-\");\n }\n }\n\n userInput.remove(0);\n for (int i = 0; i < userInput.size(); i++) {\n oddChar = userInput.get(i);\n encryptedText.add(oddCipher.get((letters.indexOf(oddChar))));\n\n if (i == userInput.size() - 1) {\n break;\n } else {\n evenChar = userInput.get(i + 1);\n encryptedText.add(evenCipher.get((letters.indexOf(evenChar))));\n }\n i++;\n }\n finalOutput = encryptedText.toString().replace(\",\", \"\")\n .replace(\" \", \"\")\n .replace(\"[\", \"\")\n .replace(\"]\", \"\")\n .trim();\n output.setText(finalOutput);\n }", "void encryptText() {\n\n ArrayList<Character> punctuation = new ArrayList<>(\n Arrays.asList('\\'', ':', ',', '-', '-', '.', '!', '(', ')', '?', '\\\"', ';'));\n\n for (int i = 0; i < text.length(); ++i) {\n\n if (punctuation.contains(this.text.charAt(i))) {\n\n // only remove punctuation if not ? or . at the very end\n if (!((i == text.length() - 1) && (this.text.charAt(i) == '?' || this.text.charAt(i) == '.'))) {\n this.text.deleteCharAt(i);\n\n // go back to previous position since current char was deleted,\n // meaning the length of the string is now 1 less than before\n --i;\n }\n }\n }\n \n \n // Step 2: convert phrase to lowerCase\n\n this.setText(new StringBuilder(this.text.toString().toLowerCase()));\n\n \n // Step 3: split the phrase up into words and encrypt each word separately using secret key\n\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n \n // Step 3.1:\n\n ArrayList<Character> vowels = new ArrayList<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if first char is vowel, add y1x3x4 to the end of word\n if (vowels.contains(words.get(i).charAt(0))) \n words.set(i, words.get(i).substring(0, words.get(i).length()) + this.secretKey.substring(3, 6));\n\n // otherwise, move first char to end of the word, then add x1x2 to the end of word\n else \n words.set(i, words.get(i).substring(1, words.get(i).length()) + words.get(i).charAt(0) + this.secretKey.substring(0, 2));\n }\n\n StringBuilder temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n\n \n // Step 3.2:\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // if position is a multiple of z, insert the special char y2\n if ((i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) && (i != 0)) {\n this.getText().replace(0, this.getText().length(), this.getText().substring(0, i) + this.secretKey.charAt(8)\n + this.getText().substring(i, this.getText().length()));\n }\n }\n \n }", "public String encryptString(char[] sPlainText)\n\t{\n\t\tlong lCBCIV = _rnd.nextLong();\n\t\treturn encStr(sPlainText, lCBCIV);\n\t}", "private String encrypt (String password){\r\n String encrypted = \"\";\r\n char temp;\r\n int ASCII;\r\n //For each letter in password.\r\n for (int i = 0; i < password.length(); i++){\r\n temp = password.charAt(i);\r\n ASCII = (int) temp;\r\n //If the letter is a character.\r\n if (ASCII >= 32 && ASCII <= 127){\r\n int x = ASCII - 32;\r\n x = (x + 6) % 96; /*Mod the characters so that it cannot go over the amount.\r\n The letters are all shifted plus 6 characters along. */\r\n encrypted += (char) (x + 32);\r\n }\r\n }\r\n return encrypted;\r\n }", "public String encryptAsNeeded(final String value) {\n\t\ttry {\n\t\t\t// Try a decryption\n\t\t\tdecrypt(value);\n\n\t\t\t// Value is already encrypted\n\t\t\treturn value;\n\t\t} catch (final EncryptionOperationNotPossibleException ignored) {\n\t\t\t// This value could be encrypted, but was not\n\t\t\treturn encrypt(value);\n\t\t}\n\t}", "@NonNull\n @Override\n public byte[] encryptString(@NonNull final Key key, @NonNull final String value)\n throws GeneralSecurityException, IOException {\n\n return encryptString(key, value, IV.encrypt);\n }", "String encryptQueryString(String query) throws EncryptionException;", "public void encrypt(String s)\n\t{\n\t\tconvertToNum(s);\n\t\tfor(int i = 0; i < myMessage.length; i++)\n\t\t{\n\t\t\tmyView.setEncryptText((myMessage[i].modPow(E, publicKey)).toString() + \" \");\n\t\t}\n\t}", "private String encrypt(String logMessage) {\n logMessage = logMessage.substring(logMessage.length() - 1)\n + logMessage.substring(0, logMessage.length() - 1);\n\n return logMessage;\n }", "public interface TextEncryptor {\n\n /**\n * Returns encrypted text.\n * @param text - text to be encrypted.\n * @return encrypted text.\n */\n String encrypt(String text);\n}", "static String encryption(String s) {\n\n s = s.replaceAll(\" \",\"\");\n StringBuffer sb = new StringBuffer(s);\n int len = sb.length();\n int L = (int)Math.floor(Math.sqrt(len));\n int M = (int)Math.ceil(Math.sqrt(len));\n int p = M;\n List<String> list = new ArrayList<>();\n for (int i = 0; i < sb.length();) {\n if(i+M < sb.length()){\n list.add(sb.substring(i, i+M));\n }else{\n list.add(sb.substring(i, len));\n }\n i=i+M;\n }\n\n StringBuffer[] tps = new StringBuffer[M];\n for (int i = 0; i < M ; i++) {\n StringBuffer tpsi = new StringBuffer();\n for (String str:\n list) {\n if(i < str.length())\n tpsi.append(str.charAt(i));\n }\n tps[i] = tpsi;\n }\n\n StringBuffer ans = new StringBuffer();\n for (StringBuffer str:\n tps) {\n ans.append(str.toString()+\" \");\n }\n return ans.toString();\n }", "private String teaEncrypt(String plaintext, String password) {\n if (plaintext.length() == 0) {\n return (\"\"); // nothing to encrypt\n }\n // 'escape' plaintext so chars outside ISO-8859-1 work in single-byte packing, but keep\n // spaces as spaces (not '%20') so encrypted text doesn't grow too long (quick & dirty)\n String asciitext = plaintext;\n int[] v = strToLongs(asciitext); // convert string to array of longs\n\n if (v.length <= 1) {\n int[] temp = new int[2];\n temp[0] = 0; // algorithm doesn't work for n<2 so fudge by adding a null\n temp[1] = v[0];\n v = temp;\n }\n int[] k = strToLongs(password.substring(0, 16).toLowerCase()); // simply convert first 16 chars of password as\n // key\n int n = v.length;\n\n // int z = v[n - 1], y = v[0], delta = 0x9E3779B9;\n // int mx, e, q = (int) Math.floor(6 + 52 / n), sum = 0;\n int z = v[n - 1];\n int y = v[0];\n int delta = 0x9E3779B9;\n int mx;\n int e;\n int q = (int) Math.floor(6 + 52 / n);\n int sum = 0;\n\n while (q-- > 0) { // 6 + 52/n operations gives between 6 & 32 mixes on each word\n sum += delta;\n e = sum >>> 2 & 3;\n for (int p = 0; p < n; p++) {\n y = v[(p + 1) % n];\n mx = (z >>> 5 ^ y << 2) + (y >>> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);\n z = v[p] += mx;\n }\n }\n\n String ciphertext = longsToHexStr(v);\n\n return ciphertext;\n }", "public String encrypt(String input) throws Throwable {\n\n byte[] inputByteArray = input.getBytes();\n String keyString = \"\";\n\n // reading the public key\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(\"Put your public key in assets and Enter its name here\"), \"UTF-8\"));\n String line;\n while ((line = reader.readLine()) != null) {\n keyString += line;\n }\n reader.close();\n }catch (IOException e){\n Toast.makeText(context, \"Couldn't create file reader\", Toast.LENGTH_SHORT).show();\n }\n\n // fetching the key from public key\n keyString = keyString.replaceAll(NEW_LINE_CHARACTER, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_START_KEY_STRING, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_END_KEY_STRING, EMPTY_STRING);\n\n byte[] publicKey = keyString.getBytes();\n\n Key generatePublic = KeyFactory.getInstance(\"RSA\").\n generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKey)));\n\n // create RSA Cipher instance\n Cipher cipherInstance = Cipher.getInstance(\"RSA/None/PKCS1Padding\");\n cipherInstance.init(Cipher.ENCRYPT_MODE, generatePublic);\n\n // encrypt string\n byte[] encryptedByteArray = cipherInstance.doFinal(inputByteArray);\n return Base64.getEncoder().encodeToString(encryptedByteArray);\n }", "public String encrypt(String plaintext) {\n\t\tCipher rsaCipher, aesCipher;\n\t\ttry {\n\t\t\t// Create AES key\n\t\t\tKeyGenerator keyGen = KeyGenerator.getInstance(\"AES\");\n\t\t\tkeyGen.init(AES_BITS);\n\t\t\tKey aesKey = keyGen.generateKey();\n\n\t\t\t// Create Random IV\n\t\t\tbyte[] iv = SecureRandom.getSeed(16);\n\t\t\tIvParameterSpec ivSpec = new IvParameterSpec(iv);\n\n\t\t\t// Encrypt data using AES\n\t\t\taesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\taesCipher.init(Cipher.ENCRYPT_MODE, aesKey, ivSpec);\n\t\t\tbyte[] data = aesCipher.doFinal(plaintext.getBytes());\n\n\t\t\t// Encrypt AES key using RSA public key\n\t\t\trsaCipher = Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n\t\t\trsaCipher.init(Cipher.ENCRYPT_MODE, this.pubKey);\n\t\t\tbyte[] encKey = rsaCipher.doFinal(aesKey.getEncoded());\n\n\t\t\t// Create output\n\t\t\tString keyResult = new String(Base64.encodeBytes(encKey, 0));\n\t\t\tString ivResult = new String(Base64.encodeBytes(iv, 0));\n\t\t\tString dataResult = new String(Base64.encodeBytes(data, 0));\n\t\t\tString result = FORMAT_ID + \"|\" + VERSION + \"|\" + this.keyId + \"|\"\n\t\t\t\t\t+ keyResult + \"|\" + ivResult + \"|\" + dataResult;\n\t\t\treturn Base64.encodeBytes(result.getBytes(), Base64.URL_SAFE);\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidAlgorithmParameterException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn \"Encryption_Failed\";\n\t}", "public static String encrypt(String seed, String plain) throws Exception {\r\nbyte[] rawKey = getRawKey(seed.getBytes());\r\nbyte[] encrypted = encrypt(rawKey, plain.getBytes());\r\nreturn Base64.encodeToString(encrypted, Base64.DEFAULT);\r\n}", "@Test\r\n public void testEncrypt()\r\n {\r\n System.out.println(\"encrypt\");\r\n String input = \"Hello how are you?\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n String result = instance.encrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }", "private String encrypt(String plainData) throws Exception {\n Key key = generateKey();\n Cipher c = Cipher.getInstance(ALGO);\n c.init(Cipher.ENCRYPT_MODE, key);\n byte[] encValue = c.doFinal(plainData.getBytes());\n return Base64.getEncoder().encodeToString(encValue);\n }", "public static String encode(String string){\n return encode(string.getBytes());\n }", "public static String createHash(String str) {\n return encrypt(str);\n }", "public static String decrypt(String str)\n {\n return encrypt(str);\n }", "public static String crypt(String str) {\n if (str == null || str.length() == 0) {\n throw new IllegalArgumentException(\"String to encript cannot be null or zero length\");\n }\n StringBuffer hexString = new StringBuffer();\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n byte[] hash = md.digest();\n for (int i = 0; i < hash.length; i++) {\n if ((0xff & hash[i]) < 0x10) {\n hexString.append(\"0\" + Integer.toHexString((0xFF & hash[i])));\n } else {\n hexString.append(Integer.toHexString(0xFF & hash[i]));\n }\n }\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return hexString.toString();\n }", "public String encrypt(String plainText) throws DataLengthException,\n\tIllegalStateException, InvalidCipherTextException {\n\t\tcipher.reset();\n\t\tcipher.init(true, new KeyParameter(key));\n\n\t\t// byte[] input = plainText.getBytes();\n\t\tbyte[] input = Str.toBytes(plainText.toCharArray());\n\t\tbyte[] output = new byte[cipher.getOutputSize(input.length)];\n\n\t\tint length = cipher.processBytes(input, 0, input.length, output, 0);\n\t\tint remaining = cipher.doFinal(output, length);\n\t\tbyte[] result = Hex.encode(output, 0, output.length);\n\n\t\treturn new String(Str.toChars(result));\n\t}", "public static String encrypt(String str)\n {\n String returnValue = null;\n\n if (str != null && str.length() > 0)\n {\n StringBuffer encryptedID = new StringBuffer();\n\n // put the ascii value - 32 of each char of str into string buffer\n encodeStringToBuffer(str, encryptedID);\n\n // reverse each group of 2 numbers i.e. 1234 ==> 2143\n reverseIntraStringCharacterGroups(encryptedID, 2);\n\n // get a random number between 3 and 9\n int randomInt = (int) (Math.round(Math.random() * 100) % 7) + 3;\n\n // reverse each group of numbers\n reverseIntraStringCharacterGroups(encryptedID, randomInt);\n\n // add the randon int to the front of the stringBuffer\n encryptedID.insert(0, randomInt);\n\n // convert each number to a letter\n convertNumericToRandomAlpha(encryptedID);\n returnValue = encryptedID.toString();\n }\n return returnValue;\n }", "public static String encryptPw(String string) throws NoSuchAlgorithmException {\n\n if (isBlankOrNull(string)) return \"\";\n\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(string.getBytes());\n byte[] digest = md.digest();\n\n String hashedString = DatatypeConverter\n .printHexBinary(digest).toUpperCase();\n\n return hashedString;\n }", "public synchronized void encryptText() {\n setSalt(ContentCrypto.generateSalt());\n try {\n mText = ContentCrypto.encrypt(mText, getSalt(), Passphrase.INSTANCE.getPassPhrase().toCharArray());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "public BigInteger Encryption(String text){\n \tcypherText = BigInteger.valueOf(0);\n \tint bposition = 0;\n \t/*\n \t * Cursor move from 128 to 1 each time. Do & operation between chvalue\n \t * and cursor, if not 0, means in bit format this position is 1, add\n \t * the corresponding BigInteger in the b list to cypherText.\n \t */\n \tfor(byte ch: text.getBytes()){\n \t\tint cursor = 128;\n \t\tint chvalue = ch;\n \t\tfor(int i = 0;i < 8;i++){\n \t\t\tif((chvalue & cursor) != 0){\n \t\t\t\tcypherText = cypherText.add(b[bposition]);\n \t\t\t}\n \t\t\tcursor >>= 1;\n \t\t bposition ++;\n \t\t}\n \t}\n \treturn cypherText;\n }", "public static String encryptCookie(String string) {\n byte[] encryptArray = Base64.getEncoder().encode(string.getBytes());\n String encstr = null;\n try {\n encstr = new String(encryptArray, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return encstr;\n }", "public static String encrypt(String str,String salt) throws UnsupportedEncodingException {\n\t\tif(null==str || null==salt) return null;\n\t\tbyte[] hash = (str + salt).getBytes(\"UTF-8\");\n\t\tif(m!=null) {\n\t\t\tm.update(hash,0,hash.length);\n\t\t\thash = m.digest();\n\t\t}\n\t\treturn new String(Base64.encodeBase64(hash)).replaceAll(\"\\r\\n\", \"\").trim();\n\t}", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n encMsg[ind] = (char) ('a' + ((letter - 'a' + key) % 26));\n } else if (letter >= 'A' && letter <= 'Z') {\n encMsg[ind] = (char) ('A' + ((letter - 'A' + key) % 26));\n } else {\n encMsg[ind] = letter;\n }\n }\n return new String(encMsg);\n }\n }", "@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n encMsg[ind] = (char) ((letter + key) % 65536);\n }\n return new String(encMsg);\n }\n }", "public static final String encrypt(String password) {\r\n\t\t \r\n\t\tMessageDigest md = null;\r\n\t\t \r\n\t\ttry { \r\n\t\t\tmd = MessageDigest.getInstance(\"SHA\"); //step 2 \r\n\t\t} catch(NoSuchAlgorithmException e) {\r\n\t\t\tthrow new IllegalStateException(\"User : encrypting the password does not have the algorithm in the env.\", e); \r\n\t\t}\r\n\t\t \r\n\t\ttry { \r\n\t\t\tmd.update(password.getBytes(\"UTF-8\")); //step 3 \r\n\t\t} catch(UnsupportedEncodingException e) { \r\n\t\t\tthrow new IllegalStateException(\"User : encrypting the password with unsupport encoding in the env.\", e); \r\n\t\t}\r\n\r\n byte raw[] = md.digest(); //step 4\r\n String hash = Base64.encodeBytes(raw); //step 5\r\n return hash; //step 6\r\n\t}", "public String encryptTextUsingAES(String plainText, String aesKeyString) throws Exception {\r\n byte[] decodedKey = Base64.getDecoder().decode(aesKeyString);\r\n SecretKey originalSecretKey = new SecretKeySpec(decodedKey, 0, decodedKey.length, \"AES\");\r\n\r\n // AES defaults to AES/ECB/PKCS5Padding in Java 7\r\n Cipher aesCipher = Cipher.getInstance(\"AES/CBC/PKCS5PADDING\");\r\n \r\n IV = \"AAAAAAAAAAAAAAAA\";\r\n \r\n aesCipher.init(Cipher.ENCRYPT_MODE, originalSecretKey, new IvParameterSpec(IV.getBytes()));\r\n // aesCipher.init(Cipher.ENCRYPT_MODE, originalSecretKey);\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes(\"UTF8\"));\r\n return Base64.getEncoder().encodeToString(byteCipherText);\r\n }", "@Override\n public void encrypt() {\n algo.encrypt();\n String cypher = vigenereAlgo(true);\n this.setValue(cypher);\n }", "public static String encrypt(String s, char key) {\n \tbyte[] arr = s.getBytes();\n \treturn Utilities.encrypt(arr, (byte) key);\n }", "private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }", "private String encStr(char[] sPlainText, long lNewCBCIV)\n\t{\n\t\tint nI, nPos, nStrLen;\n\t\tchar cActChar;\n\t\tbyte bPadVal;\n\t\tbyte[] buf;\n\t\tbyte[] newCBCIV;\n\t\tint nNumBytes;\n\t\tnStrLen = sPlainText.length;\n\t\tnNumBytes = ((nStrLen << 1) & ~7) + 8;\n\t\tbuf = new byte[nNumBytes];\n\t\tnPos = 0;\n\t\tfor (nI = 0; nI < nStrLen; nI++)\n\t\t{\n\t\t\tcActChar = sPlainText[nI];\n\t\t\tbuf[nPos++] = (byte) ((cActChar >> 8) & 0x0ff);\n\t\t\tbuf[nPos++] = (byte) (cActChar & 0x0ff);\n\t\t}\n\t\tbPadVal = (byte) (nNumBytes - (nStrLen << 1));\n\t\twhile (nPos < buf.length)\n\t\t{\n\t\t\tbuf[nPos++] = bPadVal;\n\t\t}\n\t\t// System.out.println(\"CBCIV = [\" + Long.toString(lNewCBCIV) + \"] hex = [\" + Long.toHexString(lNewCBCIV) + \"]\");\n\t\t// System.out.print(\"unencryp bytes=[\");\n\t\t// for (int i = 0; i < nNumBytes; i++){\n\t\t// System.out.print( (int)buf[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\tm_bfc.setCBCIV(lNewCBCIV);\n\t\tm_bfc.encrypt(buf, 0, buf, 0, nNumBytes);\n\t\t// System.out.print(\" encryp bytes=[\");\n\t\t// for (int i = 0; i < nNumBytes; i++){\n\t\t// System.out.print( (int)buf[i]);\n\t\t// System.out.print( \",\");\n\t\t// }\n\t\t// System.out.println(\"]\");\n\t\tString strEncrypt = EQBinConverter.bytesToHexStr(buf, 0, nNumBytes);\n\t\tnewCBCIV = new byte[EQBlowfishECB.BLOCKSIZE];\n\t\tEQBinConverter.longToByteArray(lNewCBCIV, newCBCIV, 0);\n\t\tString strCBCIV = EQBinConverter.bytesToHexStr(newCBCIV, 0, EQBlowfishECB.BLOCKSIZE);\n\t\t// System.out.println(\"encrypt = [\" + strEncrypt + \"]\");\n\t\t// System.out.println(\"strCBCIV = [\" + strCBCIV + \"]\");\n\t\treturn strCBCIV + strEncrypt;\n\t}", "public String encrypt(String word) {\n String [] encr = new String[word.length()];\n StringBuilder encrRet = new StringBuilder();\n for (int i = 0; i<word.length();i++)\n {\n char shift = (char) (((word.charAt(i) - 'a' + 3) % 26) + 'a');\n encrRet = encrRet.append(shift);\n }\n\n return encrRet.toString();\n }", "private String cipher(String s)\n {\n char[] alphabet = \"abcdefghijklmnopqrstuvwxyz\".toCharArray();\n char[] input = s.toCharArray();\n \n int pos = 0;\n String finalString = \"\";\n for( int i = 0; i < input.length; i++ )\n {\n if((input[i] >= 'a' && input[i] <= 'z') || (input[i] >= 'A' && input[i] <= 'Z'))\n {\n for( int j = 0; j < alphabet.length; j++ )\n {\n if( alphabet[j] == input[i] )\n {\n pos = j;\n break;\n }\n }\n finalString += alphabet[(rotateValue+pos)%26];\n }\n else{ finalString += input[i]; }\n }\n return finalString;\n }", "public static String encrypt(String plaintext)\n {\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(plaintext.getBytes(\"UTF-8\"));\n byte raw[] = md.digest();\n String hash = Converter.encodeBase64(raw);\n return hash;\n } catch (Exception ex) {\n /**\n * @logging\n * @reason Beim asymetrischen verschluesssseln ist ein Fehler aufgetreten.\n * @action Check Java -Installation\n */\n throw new RuntimeException(\"Error while executing hashing encryption: \" + ex.getMessage(), ex);\n }\n }", "public static String encode(String string){\n\t\treturn new String(encode(string.getBytes()));\n\t}", "@Override\n public String encrypt(String s) throws NotInAlphabetException{ \n passwordPos = 0; //initialize to 0\n return super.encrypt(s); //invoke parent\n }", "public String encrypt(String word) {\n char[] encrypted = word.toCharArray();\n for (int i = 0; i < encrypted.length; i++){\n if (encrypted[i] == 'x' || encrypted[i] == 'y' || encrypted[i] == 'z'){\n encrypted[i] -= 23;\n } else {\n encrypted[i] += 3;\n }\n \n }\n String encryptedResult = new String(encrypted);\n return encryptedResult;\n }", "public XoxoMessage encrypt(String message) {\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey));\n }", "public static String encryptPassword(String input) {\n\t\tStringBuilder hexadecimalString = null;\n\t\tbyte[] byteArray;\n\t\t\n\t\ttry {\n\t\t\t//convert input string into a SHA encrypted byte array\n\t\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyteArray = messageDigest.digest(input.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t//Now convert that byte array into hexadecimal\n\t\t\thexadecimalString = new StringBuilder(2 * byteArray.length);\n\t\t\tfor(byte i : byteArray) {\n\t\t\t\t//Hex value of a byte\n\t\t\t\tString hexValue = Integer.toHexString(0xff & i);\n\t\t\t\t\n\t\t\t\t//If the hex value is only a single digit, add a 0\n\t\t\t\tif(hexValue.length() == 1) \n\t\t\t\t\thexadecimalString.append('0');\n\t\t\t\t\n\t\t\t\t//Add the hex value to the entire string of hex values\n\t\t\t\thexadecimalString.append(hexValue);\n\t\t\t}\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn hexadecimalString.toString();\n\t}", "public abstract String encryptMsg(String msg);", "public static String encryptString(String text, int key, int groupSize) {\r\n return groupify(caesarify(normalizeText(text), key), groupSize);\r\n }", "public static String encrypt(String rawPassword) {\n\t\treturn rawPassword;\r\n\t}", "public CryptObject reencrypt(Ciphertext ciphertext);", "public static String sEncrypt(String clearString){\n\t\tStringBuffer buffer = new StringBuffer();\n\t\ttry {\n\t\t\tjava.security.MessageDigest d =null;\n\t\t\td = java.security.MessageDigest.getInstance(\"SHA-1\");\n\t\t\td.reset();\n\t\t\td.update(clearString.getBytes());\n\t\t\tbyte[] b = d.digest();\n\t\t\tfor (int i = 0; i < b.length; i++) {\n\t\t\t\t// pwe = pwe + b[i];\n\t\t\t\tbuffer.append(b[i]);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"sEncrypt Exceptione :\" + e);\n\t\t}\n\t\treturn buffer.toString();\n\t\t//\t\treturn pwe;\n\t}", "String decrypt(String input) {\n\t\treturn new String(BaseEncoding.base64().decode(input));\n\t}", "public String preprocessingEncryptToDisplay(String in);", "public static String encrypt(String strClearText,byte[] digest) throws Exception {\n \n \tString strData=\"\";\n byte [] encrypted = null;\n\n try {\n \t\n SecretKeySpec skeyspec=new SecretKeySpec(digest,\"AES\");\n Cipher cipher=Cipher.getInstance(\"AES\");\n cipher.init(Cipher.ENCRYPT_MODE, skeyspec);\n encrypted=cipher.doFinal(strClearText.getBytes());\n strData=new String(encrypted, \"ISO-8859-1\");\n \n\n } \n catch (Exception ex) {\n \t\n ex.printStackTrace();\n throw new Exception(ex);\n \n }\n \n return strData;\n }", "public String encrypt(String message) {\t\n\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//this creates an array with the numbers that are keys \n\t\tint [] numberOfLetters = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i< newMessage.length(); i++){\n\t\t\tfor(int j=0; j< alphabet.length(); j++){\n\t\t\t\tif(newMessage.charAt(i) == alphabet.charAt(j)){ //if they have the same letter\n\t\t\t\t\tnumberOfLetters[i]=j+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\n\t\t//creates an array of the keys\n\t\tint [] key = new int[numberOfLetters.length];\n\t\tint keys;\n\t\tfor(int i=0; i< numberOfLetters.length; i++){\n\t\t\tkeys = getKey();\n\t\t\tkey[i] = keys;\n\t\t}\n\t\n\t\t//create an array for what we encrypted \n\t\tint [] encryptNum = new int[key.length];\n\t\tfor(int i=0; i< key.length; i++){\n\t\t\tint value = numberOfLetters[i] + key[i];\n\t\t\tif(value > 26){\n\t\t\t\tvalue = value-26;\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}else{\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}\n\t\t}\n\n\t\t//turn encryption into letters \n\t\tString encrypt = \"\";\n\t\tchar [] let = new char [encryptNum.length];\n\n\t\tfor(int i=0; i< encryptNum.length; i++){\n\t\t\tint x = encryptNum[i]-1;\n\t\t\tlet[i] = alphabet.charAt(x);\n\t\t}\n\n\t\tfor(int j=0; j< let.length; j++){\n\t\t\tencrypt += let[j];\n\t\t}\n\n\t\t// COMPLETE THIS METHOD\n\t\t// THE FOLLOWING LINE HAS BEEN ADDED TO MAKE THE METHOD COMPILE\n\n\t\treturn encrypt;\n\t}", "public String encrypt() throws LRException\n\t{\n\t\treturn LUEncrypt.encrypt(getFields(),\n\t\t\t((DataHRecordData)getData()).encryptKey.getStringValue());\n\t}", "public static String encode(String string, String encodingName) {\r\n\t\tString encodedString = \"\";\r\n\t\tif (encodingName.equalsIgnoreCase(\"base64\")) {\r\n\t\t\tbyte[] byteArray = Base64.encodeBase64(string.getBytes());\r\n\t\t\tencodedString = new String(byteArray);\r\n\r\n\t\t} else if (encodingName.equalsIgnoreCase(\"PBEWithMD5AndDES\")) {\r\n\t\t\t// Key generation for enc and desc\r\n\t\t\tKeySpec keySpec = new PBEKeySpec(secretKey.toCharArray(), salt, iterationCount);\r\n\t\t\tSecretKey key = null;\r\n\t\t\tString charSet = \"UTF-8\";\r\n\t\t\tbyte[] in = null;\r\n\t\t\tbyte[] out = null;\r\n\t\t\ttry {\r\n\t\t\t\tkey = SecretKeyFactory.getInstance(\"PBEWithMD5AndDES\").generateSecret(keySpec);\r\n\t\t\t\tAlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);\r\n\t\t\t\tecipher = Cipher.getInstance(key.getAlgorithm());\r\n\t\t\t\tecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);\r\n\t\t\t\tin = string.getBytes(charSet);\r\n\t\t\t\tout = ecipher.doFinal(in);\r\n\t\t\t} catch (InvalidKeySpecException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException\r\n\t\t\t\t\t| InvalidAlgorithmParameterException | UnsupportedEncodingException | IllegalBlockSizeException\r\n\t\t\t\t\t| BadPaddingException e) {\r\n\t\t\t\tlog.error(\"encode :\" + e.getMessage());\r\n\t\t\t}\r\n\t\t\tencodedString = new Base64().encodeAsString(out);\r\n\t\t\tif (encodedString.indexOf(\"/\", 0) > -1) {\r\n\t\t\t\tencodedString = encodedString.replace('/', '(');\r\n\t\t\t}\r\n\t\t} else if (encodingName.equalsIgnoreCase(\"DES/ECB/PKCS5Padding\")) {\r\n\t\t\ttry {\r\n\t\t\t\t// Get a cipher object.\r\n\t\t\t\tCipher cipher = Cipher.getInstance(\"DES/ECB/PKCS5Padding\");\r\n\t\t\t\tcipher.init(Cipher.ENCRYPT_MODE, generateKey());\r\n\r\n\t\t\t\t// Gets the raw bytes to encrypt, UTF8 is needed for\r\n\t\t\t\t// having a standard character set\r\n\t\t\t\tbyte[] stringBytes = string.getBytes(\"UTF8\");\r\n\r\n\t\t\t\t// encrypt using the cypher\r\n\t\t\t\tbyte[] raw = cipher.doFinal(stringBytes);\r\n\r\n\t\t\t\t// converts to base64 for easier display.\r\n\t\t\t\tBASE64Encoder encoder = new BASE64Encoder();\r\n\t\t\t\tencodedString = encoder.encode(raw);\r\n\t\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException\r\n\t\t\t\t\t| UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e) {\r\n\t\t\t\tlog.error(\"encode :\" + e.getMessage());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn encodedString;\r\n\t}" ]
[ "0.7446393", "0.7266147", "0.704699", "0.67633516", "0.6728752", "0.6708503", "0.66935915", "0.6623936", "0.6513223", "0.64872354", "0.6461843", "0.64016443", "0.63823193", "0.6359961", "0.6277998", "0.6255144", "0.62161785", "0.6211081", "0.61795986", "0.6177616", "0.6173939", "0.6171231", "0.60678023", "0.60260224", "0.60069525", "0.5973923", "0.5953415", "0.59481555", "0.59338987", "0.5911734", "0.58896595", "0.5836337", "0.5835617", "0.582434", "0.5821021", "0.58130056", "0.58127594", "0.57875675", "0.5786911", "0.57538825", "0.5742722", "0.574127", "0.5731957", "0.57264644", "0.569249", "0.5675853", "0.56405663", "0.5597061", "0.5561827", "0.55276054", "0.55220324", "0.55163145", "0.55118585", "0.5498867", "0.5467427", "0.5463921", "0.54580075", "0.54501915", "0.5446601", "0.54409534", "0.5414186", "0.5409607", "0.5378234", "0.53782195", "0.5365436", "0.5355647", "0.5352493", "0.5349727", "0.5320553", "0.5305378", "0.52987546", "0.529425", "0.5287525", "0.5286107", "0.52745193", "0.52741766", "0.5236498", "0.5226357", "0.52222425", "0.52156496", "0.5209372", "0.5208784", "0.5207364", "0.52035934", "0.51930994", "0.51895237", "0.51843166", "0.517928", "0.5176938", "0.5168292", "0.51539755", "0.51518404", "0.5142039", "0.513872", "0.5138523", "0.51259625", "0.51122886", "0.5112149", "0.510944", "0.50990945" ]
0.558672
48
Use wordnet to induce synonyms. Use the synset relations
private static List<String> induceSynonims(String word) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void addAllSynset(ArrayList<String> synsets, String chw, IDictionary dictionary) {\n\t\tWordnetStemmer stemmer = new WordnetStemmer(dictionary);\n\t\tchw = stemmer.findStems(chw, POS.NOUN).size()==0?chw:stemmer.findStems(chw, POS.NOUN).get(0);\n\t\t\n\t\tIIndexWord indexWord = dictionary.getIndexWord(chw, POS.NOUN);\n\t\tList<IWordID> sensesID = indexWord.getWordIDs();\n\t\tList<ISynsetID> relaWordID = new ArrayList<ISynsetID>();\n\t\tList<IWord> words;\n\t\t\n\t\tfor(IWordID set : sensesID) {\n\t\t\tIWord word = dictionary.getWord(set);\n\t\t\t\n\t\t\t//Add Synonym\n\t\t\trelaWordID.add(word.getSynset().getID());\n\n\t\t\t//Add Antonym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.ANTONYM));\n\t\t\t\n\t\t\t//Add Meronym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_MEMBER));\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.MERONYM_PART));\n\t\t\t\n\t\t\t//Add Hypernym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPERNYM));\n\t\t\t\n\t\t\t//Add Hyponym\n\t\t\trelaWordID.addAll(word.getSynset().getRelatedSynsets(Pointer.HYPONYM));\n\t\t}\n\t\t\n\t\tfor(ISynsetID sid : relaWordID) {\n\t\t\twords = dictionary.getSynset(sid).getWords();\n\t\t\tfor(Iterator<IWord> i = words.iterator(); i.hasNext();) {\n\t\t\t\tsynsets.add(i.next().getLemma());\n\t\t\t}\n\t\t}\n\t}", "String getSynonyms();", "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsetScanner = new In(synsetFilename);\n\n synsetNouns = new HashMap<Integer, ArrayList<String>>();\n nouns = new HashSet<String>();\n\n while (synsetScanner.hasNextLine()) {\n ArrayList<String> synsetArrayList = new ArrayList<String>();\n String row = synsetScanner.readLine();\n String[] tokens = row.split(\",\");\n String[] synset = tokens[1].split(\" \");\n for (int i = 0; i < synset.length; i++) {\n synsetArrayList.add(synset[i]);\n nouns.add(synset[i]);\n }\n synsetNouns.put(Integer.parseInt(tokens[0]), synsetArrayList);\n }\n\n In hyponymScanner = new In(hyponymFilename);\n hyponym = new Digraph(synsetNouns.size());\n while (hyponymScanner.hasNextLine()) {\n String row = hyponymScanner.readLine();\n String[] tokens = row.split(\",\");\n for (int i = 1; i < tokens.length; i++) {\n hyponym.addEdge(Integer.parseInt(tokens[0]), Integer.parseInt(tokens[i]));\n }\n }\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n In synsets = new In(synsetFilename);\n In hyponyms = new In(hyponymFilename);\n int count = 0;\n while (synsets.hasNextLine()) {\n String line = synsets.readLine();\n String[] linesplit = line.split(\",\");\n String[] wordsplit = linesplit[1].split(\" \");\n Set<String> synset = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n for (int i = 0; i < wordsplit.length; i += 1) {\n synset.add(wordsplit[i]);\n if (wnetsi.containsKey(wordsplit[i])) {\n wordIndexes = wnetsi.get(wordsplit[i]);\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n } else {\n wordIndexes.add(Integer.parseInt(linesplit[0]));\n wnetsi.put(wordsplit[i], wordIndexes);\n }\n }\n wnetis.put(Integer.parseInt(linesplit[0]), synset);\n count += 1;\n }\n \n \n \n String[] allVerts = hyponyms.readAllLines();\n g = new Digraph(count);\n for (int i = 0; i < allVerts.length; i += 1) {\n String[] linesplit = allVerts[i].split(\",\");\n for (int j = 0; j < linesplit.length; j += 1) {\n g.addEdge(Integer.parseInt(linesplit[0]), Integer.parseInt(linesplit[j]));\n }\n }\n \n }", "public void setSynonyms(java.util.Collection<String> synonyms) {\n if (synonyms == null) {\n this.synonyms = null;\n return;\n }\n\n this.synonyms = new java.util.ArrayList<String>(synonyms);\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) {\n throw new IllegalArgumentException(\"synsets and hypernyms can't be empty\");\n }\n int lineCount = 0;\n In inputFile = new In(synsets);\n while (inputFile.hasNextLine()) {\n String aLine = inputFile.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n String[] nounSyn = splitArr[1].split(\" \");\n nouns.put(synID, nounSyn);\n for (String word : nounSyn) {\n LinkedList<Integer> nounList = synsetList.get(word);\n if (nounList == null) {\n nounList = new LinkedList<Integer>();\n }\n nounList.add(synID);\n synsetList.put(word, nounList);\n\n }\n lineCount += 1;\n\n }\n inputFile.close();\n aDigraph = new Digraph(lineCount);\n In hyperInput = new In(hypernyms);\n while (hyperInput.hasNextLine()) {\n String aLine = hyperInput.readLine();\n String[] splitArr = aLine.split(\",\");\n int synID = Integer.parseInt(splitArr[0]);\n for (int i = 1; i < splitArr.length; i++) {\n aDigraph.addEdge(synID, Integer.parseInt(splitArr[i]));\n }\n }\n hyperInput.close();\n shortestCA = new ShortestCommonAncestor(aDigraph);\n\n\n }", "public WordNet(String synsets, String hypernyms) {\n\t\tif (synsets == null || hypernyms == null)\n\t\t\tthrow new IllegalArgumentException();\n\t\t\n\t\tidToNouns = new HashMap<Integer, String>();\n\t\tnounToId = new HashMap<String, ArrayList<Integer>>();\n\n\t\tIn in1 = new In(synsets);\n\t\tIn in2 = new In(hypernyms);\n\n\t\twhile (in1.hasNextLine()) {\n\t\t\tString line = in1.readLine();\n\t\t\tString[] parts = line.split(\",\");\n\t\t\tint id = Integer.parseInt(parts[0]);\n\t\t\tidToNouns.put(id, parts[1]);\n\n\t\t\tString[] nouns = parts[1].split(\" \");\n\t\t\tfor (String s : nouns) {\n\t\t\t\tif (nounToId.containsKey(s))\n\t\t\t\t\tnounToId.get(s).add(id);\n\t\t\t\telse {\n\t\t\t\t\tnounToId.put(s, new ArrayList<Integer>());\n\t\t\t\t\tnounToId.get(s).add(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tgraph = new Digraph(idToNouns.size());\n\n\t\twhile (in2.hasNextLine()) {\n\t\t\tString line = in2.readLine();\n\t\t\tString[] parts = line.split(\",\");\n\t\t\tfor (int i = 1; i < parts.length; i++) {\n\t\t\t\tgraph.addEdge(Integer.parseInt(parts[0]), Integer.parseInt(parts[i]));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!isRootedDAG(graph))\n\t\t\tthrow new IllegalArgumentException(); \n\t\t\n\t\tsap = new SAP(graph);\n\t}", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n synset = new HashMap<Integer, ArrayList<String>>();\n synsetRev = new HashMap<ArrayList<String>, Integer>();\n hyponym = new ArrayList<ArrayList<Integer>>();\n // hyponym = new HashMap<Integer,ArrayList<Integer>>();\n\n In syn = new In(synsetFilename);\n In hypo = new In(hyponymFilename);\n\n while (!syn.isEmpty()) {\n String line = syn.readLine();\n String[] split1 = line.split(\",\");\n int stempkey = Integer.parseInt(split1[0]);\n String syns = split1[1];\n String[] temps = syns.split(\" \");\n ArrayList<String> stempval = new ArrayList<String>();\n for (String s : temps) {\n stempval.add(s);\n }\n synset.put(stempkey, stempval);\n synsetRev.put(stempval, stempkey);\n }\n\n while (!hypo.isEmpty()) {\n String line = hypo.readLine();\n String[] arrayOfStrings = line.split(\",\");\n ArrayList<Integer> integersAL = new ArrayList<Integer>();\n for (int i = 0; i < arrayOfStrings.length; i++) {\n integersAL.add(Integer.parseInt(arrayOfStrings[i]));\n }\n hyponym.add(integersAL);\n\n // ArrayList<Integer> valuesAL = new ArrayList<Integer>();\n // for (Integer i : integersAL) {\n // valuesAL.add(i);\n // }\n // int comma1 = line.indexOf(\",\");\n // int htempkey = Integer.parseInt(line.substring(0,comma1));\n // String sub = line.substring(comma1 + 1);\n // String[] arrayOfStrings = sub.split(\",\");\n // hyponym.put(htempkey, integersAL);\n }\n }", "private List<Query> generateSynonymQueries(Analyzer synonymAnalyzer, SolrParams solrParams) {\n\n\tString origQuery = getQueryStringFromParser();\n\tint queryLen = origQuery.length();\n\t\n // TODO: make the token stream reusable?\n TokenStream tokenStream = synonymAnalyzer.tokenStream(Const.IMPOSSIBLE_FIELD_NAME,\n new StringReader(origQuery));\n \n SortedSetMultimap<Integer, TextInQuery> startPosToTextsInQuery = TreeMultimap.create();\n \n \n boolean constructPhraseQueries = solrParams.getBool(Params.SYNONYMS_CONSTRUCT_PHRASES, false);\n \n boolean bag = solrParams.getBool(Params.SYNONYMS_BAG, false);\n List<String> synonymBag = new ArrayList<>();\n \n try {\n tokenStream.reset();\n while (tokenStream.incrementToken()) {\n CharTermAttribute term = tokenStream.getAttribute(CharTermAttribute.class);\n OffsetAttribute offsetAttribute = tokenStream.getAttribute(OffsetAttribute.class);\n TypeAttribute typeAttribute = tokenStream.getAttribute(TypeAttribute.class);\n \n if (!typeAttribute.type().equals(\"shingle\")) {\n // ignore shingles; we only care about synonyms and the original text\n // TODO: filter other types as well\n \n String termToAdd = term.toString();\n \n if (typeAttribute.type().equals(\"SYNONYM\")) {\n synonymBag.add(termToAdd); \t\n }\n \n //Don't quote sibgle term term synonyms\n\t\t if (constructPhraseQueries && typeAttribute.type().equals(\"SYNONYM\") &&\n\t\t\ttermToAdd.contains(\" \")) \n\t\t {\n\t\t \t//Don't Quote when original is already surrounded by quotes\n\t\t \tif( offsetAttribute.startOffset()==0 || \n\t\t \t offsetAttribute.endOffset() == queryLen ||\n\t\t \t origQuery.charAt(offsetAttribute.startOffset()-1)!='\"' || \n\t\t \t origQuery.charAt(offsetAttribute.endOffset())!='\"')\n\t\t \t{\n\t\t \t // make a phrase out of the synonym\n\t\t \t termToAdd = new StringBuilder(termToAdd).insert(0,'\"').append('\"').toString();\n\t\t \t}\n\t\t }\n if (!bag) {\n // create a graph of all possible synonym combinations,\n // e.g. dog bite, hound bite, dog nibble, hound nibble, etc.\n\t TextInQuery textInQuery = new TextInQuery(termToAdd, \n\t offsetAttribute.startOffset(), \n\t offsetAttribute.endOffset());\n\t \n\t startPosToTextsInQuery.put(offsetAttribute.startOffset(), textInQuery);\n }\n }\n }\n tokenStream.end();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n } finally {\n try {\n tokenStream.close();\n } catch (IOException e) {\n throw new RuntimeException(\"uncaught exception in synonym processing\", e);\n }\n }\n \n List<String> alternateQueries = synonymBag;\n \n if (!bag) {\n // use a graph rather than a bag\n\t List<List<TextInQuery>> sortedTextsInQuery = new ArrayList<>(\n startPosToTextsInQuery.values().size());\n sortedTextsInQuery.addAll(startPosToTextsInQuery.asMap().values().stream().map(ArrayList::new).collect(Collectors.toList()));\n\t \n\t // have to use the start positions and end positions to figure out all possible combinations\n\t alternateQueries = buildUpAlternateQueries(solrParams, sortedTextsInQuery);\n }\n \n // save for debugging purposes\n expandedSynonyms = alternateQueries;\n \n return createSynonymQueries(solrParams, alternateQueries);\n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n synsets = new TreeMap<Integer, TreeSet<String>>();\n numVertices = 0;\n In syns = new In(synsetFilename);\n while (syns.hasNextLine()) {\n numVertices++;\n String line = syns.readLine();\n String[] split1 = line.split(\",\");\n String[] split2 = split1[1].split(\" \");\n TreeSet<String> hs = new TreeSet<String>();\n for (String s: split2) {\n hs.add(s);\n }\n synsets.put(Integer.parseInt(split1[0]), hs);\n }\n dg = new Digraph(numVertices);\n In hyms = new In(hyponymFilename);\n while (hyms.hasNextLine()) {\n String line = hyms.readLine();\n String[] split = line.split(\"[, ]+\");\n int v = Integer.parseInt(split[0]);\n for (int i = 1; i < split.length; i++) {\n dg.addEdge(v, Integer.parseInt(split[i]));\n }\n }\n }", "public WordNet(String synsets, String hypernyms)\n {\n In text = new In(synsets);\n synsetList = new ArrayList<String>();\n synsetHash = new HashMap<String, ArrayList<Integer>>();\n // parse words into array synsetList\n synsetNum = 0;\n while (!text.isEmpty())\n {\n String temp = text.readLine().split(\",\")[1];\n synsetList.add(temp);\n synsetNum++;\n }\n //initialize synsetHash with word:list of integers\n for (int i = 0; i < synsetNum; i++)\n {\n String[] stringArray = synsetList.get(i).split(\" \");\n for (String s : stringArray)\n {\n if (synsetHash.containsKey(s))\n {\n ArrayList<Integer> temp = synsetHash.get(s);\n temp.add(i);\n }\n else\n {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(i);\n synsetHash.put(s, temp);\n }\n }\n }\n\n wordGraph = new Digraph(synsetNum);\n text = new In(hypernyms);\n while (!text.isEmpty())\n {\n String[] edges = text.readLine().split(\",\");\n int mainEdge = Integer.parseInt(edges[0]);\n for (int i = 1; i < edges.length; i++)\n {\n wordGraph.addEdge(mainEdge, Integer.parseInt(edges[i]));\n }\n }\n // check if input is a rooted DAG\n int count = 0;\n for (int v = 0; v < synsetNum; v++)\n {\n if (wordGraph.outdegree(v) == 0) count++;\n if (count > 1) throw new IllegalArgumentException();\n }\n // may be redundant check, but wanna make sure\n if (count != 1) throw new IllegalArgumentException();\n\n DirectedCycle cycle = new DirectedCycle(wordGraph);\n if (cycle.hasCycle()) throw new IllegalArgumentException();\n\n shortestPath = new SAP(wordGraph);\n \n }", "public WordNet(String synsetFilename, String hyponymFilename) {\n\n File hyponymPath = new File(hyponymFilename);\n Scanner s;\n try {\n s = new Scanner(hyponymPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n hyponymParse(currLine);\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + hyponymFilename);\n } \n File synsetPath = new File(synsetFilename);\n try {\n s = new Scanner(synsetPath);\n while (s.hasNextLine()) {\n String currLine = s.nextLine();\n synsetParse(currLine);\n numberOfSynsets += 1;\n }\n } catch (FileNotFoundException ex) {\n System.out.println(\"Could not find \" + synsetFilename);\n } \n g = new Digraph(numberOfSynsets);\n Set<Integer> keys = hyponymMap.keySet();\n for (Integer k : keys) {\n ArrayList<Integer> al = hyponymMap.get(k);\n for (Integer i : al) {\n g.addEdge(k, i);\n }\n }\n }", "public WordNet(String synsets, String hypernyms) {\n\n\t\tString[] vw;\n\t\tInteger synset = 0;\n\n\t\t// step1: build noun TreeSet\n\t\tIn br = new In(synsets);\n\t\tif (!br.hasNextLine())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tdo {\n\t\t\tString line = br.readLine();\n\t\t\tsize++;\n\t\t\tvw = line.split(\",\");\n\t\t\tsynset = new Integer(vw[0]);\n\t\t\t// save the set\n\t\t\tsets.put(Integer.parseInt(vw[0]), vw[1]);\n\t\t\t// save the nouns\n\t\t\tvw = vw[1].split(\" \");\n\t\t\n\t\t\tfor (String noun: vw) {\n\t\t\t\tif (nouns.containsKey(noun))\n\t\t\t\t\tnouns.get(noun).add(synset);\n\t\t\t\telse {\n\t\t\t\t\tArrayList<Integer> al = new ArrayList<Integer>();\n\t\t\t\t\tal.add(synset);\n\t\t\t\t\tnouns.put(noun, al);\n\t\t\t\t}\n\t\t\t}\n\t\t} while (br.hasNextLine());\n\t\tbr.close();\n\n\t\t// step2: build graph\n\t\tbr = new In(hypernyms);\n\t\tDigraph dg = new Digraph(size);\n\t\tdo {\n\t\t\tString line = br.readLine();\n\t\t\tvw = line.split(\",\");\n\t\t\tfor (int i = 1; i < vw.length; i++)\n\t\t\t\tdg.addEdge(Integer.parseInt(vw[0].trim()),\n\t\t\t\t\t\tInteger.parseInt(vw[i].trim()));\n\n\t\t}while (br.hasNextLine());\n\t\t\t\n\t\tbr.close();\n\t\tDirectedCycle dc = new DirectedCycle(dg);\n\t\tif (dc.hasCycle())\n\t\t\tthrow new IllegalArgumentException();\n\n\t\tcheck(dg);\n\t\tsap = new SAP(dg);\n\n\t}", "public WordNet(String synsets, String hypernyms) throws IOException {\n\n this.synsetsMap = new HashMap<Integer, ArrayList<String>>();\n this.nounsMap = new HashMap<String, ArrayList<Integer>>();\n this.edgesMap = new HashMap<Integer, ArrayList<Integer>>();\n int graphNodes = 0; \n \n // Process synsets.txt\n BufferedReader br = new BufferedReader(new FileReader(synsets));\n String line;\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int synsetID = Integer.parseInt(items[0]);\n String[] nouns = items[1].split(\" \");\n \n for (String noun : nouns) {\n if (!nounsMap.containsKey(noun)) {\n nounsMap.put(noun, new ArrayList<Integer>());\n }\n nounsMap.get(noun).add(synsetID);\n }\n \n if (!synsetsMap.containsKey(synsetID)) {\n synsetsMap.put(synsetID, new ArrayList<String>());\n }\n \n for (String noun : nouns) {\n synsetsMap.get(synsetID).add(noun);\n }\n graphNodes++; \n }\n br.close();\n\n // Process hypernyms.txt\n br = new BufferedReader(new FileReader(hypernyms));\n while ((line = br.readLine()) != null) {\n String[] items = line.split(\",\");\n int hypernymID = Integer.parseInt(items[0]);\n \n if (!edgesMap.containsKey(hypernymID)) {\n edgesMap.put(hypernymID, new ArrayList<Integer>());\n }\n \n for (int i = 1; i < items.length; i++) {\n edgesMap.get(hypernymID).add(Integer.parseInt(items[i]));\n }\n }\n br.close();\n \n // Construct Graph\n this.G = new Digraph(graphNodes);\n for (Map.Entry<Integer, ArrayList<Integer>> entry : edgesMap.entrySet()) {\n for (int edge : entry.getValue()) {\n this.G.addEdge(entry.getKey(), edge);\n }\n }\n \n // Check if there's a cycle\n DirectedCycle cycle = new DirectedCycle(this.G);\n if (cycle.hasCycle()) {\n throw new java.lang.IllegalArgumentException();\n }\n \n // Construct SAP \n this.sap = new SAP(this.G);\n }", "private static void demo_WordNetOps() throws Exception {\n\n RoWordNet r1, r2, result;\n Synset s;\n Timer timer = new Timer();\n String time = \"\";\n\n IO.outln(\"Creating two RoWN objects R1 and R2\");\n timer.start();\n r1 = new RoWordNet();\n r2 = new RoWordNet();\n\n // adding synsets to O1\n s = new Synset();\n s.setId(\"S1\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L1\"))));\n r1.addSynset(s, false); // adding synset S1 to O2;\n\n s = new Synset();\n s.setId(\"S2\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L2\"))));\n r1.addSynset(s, false); // adding synset S2 to O1;\n\n // adding synsets to O2\n s = new Synset();\n s.setId(\"S1\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L1\"))));\n r2.addSynset(s, false); // adding synset S1 to O2;\n\n s = new Synset();\n s.setId(\"S2\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L4\"))));\n r2.addSynset(s, false); // adding synset S2 to O2, but with literal L4\n // not L2;\n\n s = new Synset();\n s.setId(\"S3\");\n s.setLiterals(new ArrayList<Literal>(asList(new Literal(\"L3\"))));\n r2.addSynset(s, false); // adding synset S3 to O2;\n time = timer.mark();\n\n // print current objects\n IO.outln(\"\\n Object R1:\");\n for (Synset syn : r1.synsets) {\n IO.outln(syn.toString());\n }\n\n IO.outln(\"\\n Object R2:\");\n for (Synset syn : r2.synsets) {\n IO.outln(syn.toString());\n }\n IO.outln(\"Done: \" + time);\n\n // DIFFERENCE\n IO.outln(\"\\nOperation DIFFERENCE(R1,R2) (different synsets in R1 and R2 having the same id):\");\n timer.start();\n String[] diff = Operation.diff(r1, r2);\n time = timer.mark();\n\n for (String id : diff) {\n IO.outln(\"Different synset having the same id in both RoWN objects: \" + id);\n }\n\n IO.outln(\"Done: \" + time);\n\n // UNION\n IO.outln(\"\\nOperation UNION(R1,R2):\");\n timer.start();\n try {\n result = new RoWordNet(r1);// we copy-construct the result object\n // after r1 because the union and merge\n // methods work in-place directly on the\n // first parameter of the methods\n result = Operation.union(result, r2);\n IO.outln(\" Union object:\");\n for (Synset syn : result.synsets) {\n IO.outln(syn.toString());\n }\n } catch (Exception ex) {\n IO.outln(\"Union operation failed (as it should, as synset S2 is in both objects but has a different literal and are thus two different synsets having the same id that cannot reside in a single RoWN object). \\nException message: \" + ex\n .getMessage());\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // MERGE\n IO.outln(\"\\nOperation MERGE(R1,R2):\");\n\n result = new RoWordNet(r1);\n timer.start();\n result = Operation.merge(result, r2);\n time = timer.mark();\n\n IO.outln(\" Merged object (R2 overwritten on R1):\");\n for (Synset syn : result.synsets) {\n IO.outln(syn.toString());\n }\n IO.outln(\"Done: \" + time);\n\n // COMPLEMENT\n IO.outln(\"\\nOperation COMPLEMENT(R2,R1) (compares only synset ids):\");\n timer.start();\n String[] complement = Operation.complement(r2, r1);\n time = timer.mark();\n IO.outln(\" Complement ids:\");\n for (String id : complement) {\n IO.outln(\"Synset that is in R2 but not in R1: \" + id);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // INTERSECTION\n IO.outln(\"\\nOperation INTERSECTION(R1,R2) (fully compares synsets):\");\n timer.start();\n String[] intersection = Operation.intersection(r1, r2);\n time = timer.mark();\n IO.outln(\" Intersection ids:\");\n for (String id : intersection) {\n IO.outln(\"Equal synset in both R1 and R2: \" + id);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n // IO.outln(((Synset) r1.getSynsetById(\"S1\")).equals((Synset)\n // r2.getSynsetById(\"S1\")));\n\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) throw new IllegalArgumentException();\n In synsetsFile = new In(synsets);\n synsetsNumToStr = new HashMap<>();\n synsetsStrToNum = new HashMap<>();\n while (!synsetsFile.isEmpty()) {\n String read = synsetsFile.readLine();\n String[] item = read.split(\",\");\n int id = Integer.parseInt(item[0]);\n String[] str = item[1].split(\" \");\n Queue<String> strStack = new Queue<>();\n for (String ss : str) {\n strStack.enqueue(ss);\n Queue<Integer> si;\n if (!synsetsStrToNum.containsKey(ss)) {\n si = new Queue<>();\n si.enqueue(id);\n synsetsStrToNum.put(ss, si);\n }\n else synsetsStrToNum.get(ss).enqueue(id);\n }\n synsetsNumToStr.put(id, strStack);\n }\n In hypernymsFile = new In(hypernyms);\n Digraph wnDigraph = new Digraph(synsetsNumToStr.size());\n while (!hypernymsFile.isEmpty()) {\n String[] hypID = hypernymsFile.readLine().split(\",\");\n int rootID = Integer.parseInt(hypID[0]);\n for (int i = 1; i < hypID.length; i++)\n wnDigraph.addEdge(rootID, Integer.parseInt(hypID[i]));\n }\n Stack<Integer> root = new Stack<>();\n for (int v = 0; v < wnDigraph.V(); v++)\n if (wnDigraph.outdegree(v) == 0) {\n root.push(v);\n }\n if (root.size() > 1) throw new IllegalArgumentException(\"More than 1 roots in DAG\");\n DirectedCycle dcGraph = new DirectedCycle(wnDigraph);\n if (dcGraph.hasCycle()) throw new IllegalArgumentException(\"Cycles detected in the graph\");\n wnSAP = new SAP(wnDigraph);\n }", "public List<String> getSynonyms() {\n return synonyms;\n }", "public WordNet(String synsets, String hypernyms) {\n if (synsets == null || hypernyms == null) {\n throw new IllegalArgumentException();\n }\n\n In in = new In(synsets);\n int vcnt = 0;\n while (in.hasNextLine()) {\n vcnt++;\n String line = in.readLine();\n String[] splited = line.split(\",\");\n int num = Integer.parseInt(splited[0]);\n String synset = splited[1];\n synMap.put(num, synset);\n String[] nouns = synset.split(\" \");\n for (String noun : nouns) {\n nounMap.computeIfAbsent(noun, k -> new Bag<>()).add(num);\n }\n }\n in.close();\n\n in = new In(hypernyms);\n Digraph digraph = new Digraph(vcnt);\n while (in.hasNextLine()) {\n String line = in.readLine();\n String[] splited = line.split(\",\");\n int child = Integer.parseInt(splited[0]);\n for (int i = 1; i < splited.length; i++) {\n digraph.addEdge(child, Integer.parseInt(splited[i]));\n }\n }\n in.close();\n\n DirectedCycle cycle = new DirectedCycle(digraph);\n if (cycle.hasCycle()) {\n throw new IllegalArgumentException();\n }\n DepthFirstOrder dfo = new DepthFirstOrder(digraph);\n int root = dfo.post().iterator().next();\n if (digraph.outdegree(root) != 0) {\n throw new IllegalArgumentException();\n }\n\n Digraph reversed = digraph.reverse();\n DepthFirstDirectedPaths dfs = new DepthFirstDirectedPaths(reversed, root);\n for (int i = 0; i < reversed.V(); i++) {\n if (!dfs.hasPathTo(i)) {\n throw new IllegalArgumentException();\n }\n }\n\n this.sap = new SAP(digraph);\n }", "public CellValueSynonym withSynonyms(java.util.Collection<String> synonyms) {\n setSynonyms(synonyms);\n return this;\n }", "private void populateDictionaryBySynonyms() {\n\n Enumeration e = dictionaryTerms.keys();\n while (e.hasMoreElements()) {\n String word = (String) e.nextElement();\n String tag = dictionaryTerms.get(word);\n\n ArrayList<String> synonyms = PyDictionary.findSynonyms(word);\n\n for (int i = 0; i < synonyms.size(); i++) {\n if (!dictionaryTerms.containsKey(synonyms.get(i))) {\n dictionaryTerms.put(synonyms.get(i), tag);\n }\n }\n }\n }", "public void createManufacturerSynonyms() {\n\t\t\n\t\tfor (String m : productsByManufacturer.keySet() ) {\n\t\t\t\n\t\t\tString mWords[] = m.split(\"\\\\s+\");\n\t\t\t\n\t\t\tif (mWords.length > 1) {\n\t\t\t\tSet<Product> products = productsByManufacturer.get(m);\n\t\t\t\tfor (String mw: mWords) {\n\t\t\t\t manufacturerSynonyms.put(mw, products);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static private void adjustSynonyms(DataManager manager, SchemaInfo schemaInfo, List<Term> oldTerms, ArrayList<Term> newTerms) throws Exception\r\n\t{\r\n\t\t// Create a hash of all old terms\r\n\t\tHashMap<Integer,Term> oldTermHash = new HashMap<Integer,Term>();\r\n\t\tfor(Term oldTerm : oldTerms) oldTermHash.put(oldTerm.getId(), oldTerm);\r\n\t\t\r\n\t\t// Store the list of new and updated synonyms\r\n\t\tArrayList<AssociatedElement> newElements = new ArrayList<AssociatedElement>();\r\n\t\tArrayList<SchemaElement> updatedSynonyms = new ArrayList<SchemaElement>();\r\n\t\t\r\n\t\t/** Cycle through all terms to examine associated elements */\r\n\t\tfor(Term newTerm : newTerms)\r\n\t\t{\r\n\t\t\t// Get the associated old term\r\n\t\t\tTerm oldTerm = oldTermHash.get(newTerm.getId());\r\n\t\t\t\r\n\t\t\t// Identify which synonyms to add and update\r\n\t\t\tfor(AssociatedElement element : newTerm.getElements())\r\n\t\t\t{\r\n\t\t\t\tif(element.getElementID()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Swap out term names in element already exists\r\n\t\t\t\t\tSchemaElement oldElement = schemaInfo.getElement(element.getElementID());\r\n\t\t\t\t\tString description = element.getDescription()==null ? \"\" : element.getDescription();\r\n\t\t\t\t\tif(!element.getName().equals(oldElement.getName()) || !description.equals(oldElement.getDescription()))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSchemaElement updatedElement = oldElement.copy();\r\n\t\t\t\t\t\tupdatedElement.setName(element.getName());\r\n\t\t\t\t\t\tupdatedElement.setDescription(element.getDescription());\r\n\t\t\t\t\t\tupdatedSynonyms.add(updatedElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\telement.setElementID(newTerm.getId());\r\n\t\t\t\t\tnewElements.add(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Generate a hash map of all new associated elements\r\n\t\t\tHashMap<Integer,AssociatedElement> newElementHash = new HashMap<Integer,AssociatedElement>();\r\n\t\t\tfor(AssociatedElement newElement : newTerm.getElements())\r\n\t\t\t\tnewElementHash.put(newElement.getElementID(), newElement);\r\n\t\t\t\r\n\t\t\t// Delete old synonyms\r\n\t\t\tif(oldTerm!=null)\r\n\t\t\t\tfor(AssociatedElement oldElement : oldTerm.getElements())\r\n\t\t\t\t\tif(!newElementHash.containsKey(oldElement.getElementID()))\r\n\t\t\t\t\t\tif(!manager.getSchemaElementCache().deleteSchemaElement(oldElement.getElementID()))\r\n\t\t\t\t\t\t\tthrow new Exception(\"Failed to delete thesaurus synonym\");\r\n\t\t}\r\n\r\n\t\t// Create the new synonyms\r\n\t\tArrayList<SchemaElement> newSynonyms = new ArrayList<SchemaElement>();\r\n\t\tInteger counter = manager.getUniversalIDs(newElements.size());\r\n\t\tfor(AssociatedElement element : newElements)\r\n\t\t\tnewSynonyms.add(new Synonym(counter++,element.getName(),element.getDescription(),element.getElementID(),schemaInfo.getSchema().getId()));\r\n\t\t\r\n\t\t// Add the new and updated synonyms to the thesaurus schema\r\n\t\tboolean success = manager.getSchemaElementCache().addSchemaElements(newSynonyms);\r\n\t\tif(success) success = manager.getSchemaElementCache().updateSchemaElements(updatedSynonyms);\r\n\t\tif(!success) throw new Exception(\"Failed to update vocabulary schema\");\r\n\t}", "private void getSynsets(HashSet<WordProvider.Word> words) {\n HashMap<String, String> synsets_map = new HashMap<>();\n for (WordProvider.Word word: words) {\n ArrayList<String> synsetList = new ArrayList<>(Arrays.asList(word.getSynsets().trim().split(\" \")));\n for (String synset_tag: synsetList)\n synsets_map.put(synset_tag, word.getPos());\n }\n // for each synset load the meanings in the background\n final Object[] params= {synsets_map};\n new FetchRows().execute(params);\n }", "public static void main(final String[] args)\r\n {\r\n // Set the path to the data files\r\n Dictionary.initialize(\"c:/Program Files/WordNet/2.1/dict\");\r\n \r\n // Get an instance of the Dictionary object\r\n Dictionary dict = Dictionary.getInstance();\r\n \r\n // Declare a filter for all terms starting with \"car\", ignoring case\r\n TermFilter filter = new WildcardFilter(\"car*\", true);\r\n \r\n // Get an iterator to the list of nouns\r\n Iterator<IndexTerm> iter = \r\n dict.getIndexTermIterator(PartOfSpeech.NOUN, 1, filter);\r\n \r\n // Go over the list items\r\n while (iter.hasNext())\r\n {\r\n // Get the next object\r\n IndexTerm term = iter.next();\r\n \r\n // Write out the object\r\n System.out.println(term.toString());\r\n \r\n // Write out the unique pointers for this term\r\n int nNumPtrs = term.getPointerCount();\r\n if (nNumPtrs > 0)\r\n {\r\n // Print out the number of pointers\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumPtrs) +\r\n \" pointers\");\r\n \r\n // Print out all of the pointers\r\n String[] ptrs = term.getPointers();\r\n for (int i = 0; i < nNumPtrs; ++i)\r\n {\r\n String p = Pointer.getPointerDescription(term.getPartOfSpeech(), ptrs[i]);\r\n System.out.println(ptrs[i] + \": \" + p);\r\n }\r\n }\r\n \r\n // Get the definitions for this term\r\n int nNumSynsets = term.getSynsetCount();\r\n if (nNumSynsets > 0)\r\n {\r\n // Print out the number of synsets\r\n System.out.println(\"\\nThis term has \" + Integer.toString(nNumSynsets) +\r\n \" synsets\");\r\n \r\n // Print out all of the synsets\r\n Synset[] synsets = term.getSynsets();\r\n for (int i = 0; i < nNumSynsets; ++i)\r\n {\r\n System.out.println(synsets[i].toString());\r\n }\r\n }\r\n }\r\n \r\n System.out.println(\"Demo processing finished.\");\r\n }", "public static void main(String[] args){\n In fileSynset = new In(args[0]);\n In fileHypernyms = new In(args[1]);\n String Hypernyms = fileHypernyms.readAll();\n String Synset = fileSynset.readAll();\n WordNet Net = new WordNet(Synset, Hypernyms);\n }", "Neuron setSynapses(List<Neuron> synapses);", "public static void getSynonyms(ArrayList<String> keywords) {\n final String endpoint = \"http://www.dictionaryapi.com/api/v1/references/collegiate/xml/\";\n final String key = \"79b70eee-858c-486a-b155-a44db036bfe0\";\n try {\n for (String keyword : keywords) {\n String url = endpoint + keyword + \"?key=\" + key;\n System.out.print(\"url--\" + url);\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n String inputLine;\n StringBuffer response = new StringBuffer();\n\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine);\n }\n in.close();\n\n //print result\n System.out.println(response.toString());\n\n DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n DocumentBuilder builder;\n InputSource is;\n try {\n builder = factory.newDocumentBuilder();\n is = new InputSource(new StringReader(response.toString()));\n Document doc = builder.parse(is);\n NodeList list = doc.getElementsByTagName(\"syn\");\n System.out.println(\"synonyms\" + list.item(0).getTextContent());\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n }", "public ElementDefinitionDt setSynonym(java.util.List<StringDt> theValue) {\n\t\tmySynonym = theValue;\n\t\treturn this;\n\t}", "public WordNet(String synsets, String hypernyms) {\n synsetStream = new In(synsets);\n hypernymStream = new In(hypernyms);\n\n // go through all synsets\n while (synsetStream != null && synsetStream.hasNextLine()) {\n synsetString = synsetStream.readLine();\n String[] synsetStrLine = synsetString.split(\",\");\n Integer id = Integer.parseInt(synsetStrLine[0]);\n String[] synsetsArray = synsetStrLine[1].split(\"\\\\s+\");\n sFile.put(id, synsetsArray);\n }\n for (String[] nounSet : sFile.values()) {\n for (String str : nounSet) {\n sNounSet.add(str);\n }\n }\n while (hypernymStream != null && hypernymStream.hasNextLine()) {\n hypernymString = hypernymStream.readLine();\n String[] hyponymArray = hypernymString.split(\",\");\n Integer synsetID = Integer.parseInt(hyponymArray[0]);\n TreeSet hyponymSet = new TreeSet();\n for (int i = 1; i < hyponymArray.length; i++) {\n Integer hyponymID = Integer.parseInt(hyponymArray[i]);\n if (hFile.containsKey(synsetID)) {\n hFile.get(synsetID).add(hyponymID);\n } else {\n hyponymSet.add(hyponymID);\n hFile.put(synsetID, hyponymSet);\n }\n }\n\n }\n theDigraph = new Digraph(sFile.size());\n for (Integer key : hFile.keySet()) {\n for (Object curr : hFile.get(key)) {\n theDigraph.addEdge(key, (int) curr);\n }\n }\n }", "public static List<Synset> getAllMeronymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getInheritedMeronyms(wordSynset,4,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public static void main(String[] args) {\n\t\tWordNet deneme = new WordNet(\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\synsets.txt\",\n\t\t\t\t\"C:\\\\Users\\\\zzlawlzz\\\\Desktop\\\\hypernyms.txt\");\n\t\tSystem.out.println(deneme.sap(\"arm\", \"leg\"));\n\t\tSystem.out.println(deneme.distance(\"arm\", \"eyes\"));\n\t\tSystem.out.println(deneme.distance(\"eyes\", \"mouth\"));\n\t}", "public Set<String> hyponyms(String word) {\n HashSet<String> set = new HashSet<String>();\n for (Integer id: synsets.keySet()) {\n TreeSet<String> hs = synsets.get(id);\n if (hs.contains(word)) {\n for (String s: hs) {\n set.add(s);\n }\n TreeSet<Integer> ids = new TreeSet<Integer>();\n ids.add(id);\n Set<Integer> desc = GraphHelper.descendants(dg, ids);\n for (Integer i: desc) {\n for (String s: synsets.get(i)) {\n set.add(s);\n }\n }\n }\n }\n return set;\n }", "public List<String> getRelatedWords(String word) throws IOException {\n List<String> result = new ArrayList<String>();\n IDictionary dict = new Dictionary(new File(WORDNET_LOCATION));\n try {\n dict.open();\n IStemmer stemmer = new WordnetStemmer(dict);\n for (POS pos : EnumSet.of(POS.ADJECTIVE, POS.ADVERB, POS.NOUN, POS.VERB)) {\n List<String> resultForPos = new ArrayList<String>();\n List<String> stems = new ArrayList<String>();\n stems.add(word);\n for (String stem : stemmer.findStems(word, pos)) {\n if (!stems.contains(stem))\n stems.add(stem);\n }\n for (String stem : stems) {\n if (!resultForPos.contains(stem)) {\n resultForPos.add(stem);\n IIndexWord idxWord = dict.getIndexWord(stem, pos);\n if (idxWord == null) continue;\n List<IWordID> wordIDs = idxWord.getWordIDs();\n if (wordIDs == null) continue;\n IWordID wordID = wordIDs.get(0);\n IWord iword = dict.getWord(wordID);\n \n ISynset synonyms = iword.getSynset();\n List<IWord> iRelatedWords = synonyms.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n \n List<ISynsetID> hypernymIDs = synonyms.getRelatedSynsets();\n if (hypernymIDs != null) {\n for (ISynsetID relatedSynsetID : hypernymIDs) {\n ISynset relatedSynset = dict.getSynset(relatedSynsetID);\n if (relatedSynset != null) {\n iRelatedWords = relatedSynset.getWords();\n if (iRelatedWords != null) {\n for (IWord iRelatedWord : iRelatedWords) {\n String relatedWord = iRelatedWord.getLemma();\n if (!resultForPos.contains(relatedWord))\n resultForPos.add(relatedWord);\n }\n }\n }\n }\n }\n }\n }\n for (String relatedWord : resultForPos) {\n if (relatedWord.length() > 3\n && !relatedWord.contains(\"-\")\n && !result.contains(relatedWord)) {\n // TODO: Hack alert!\n // The - check is to prevent lucene from interpreting hyphenated words as negative search terms\n // Fix!\n result.add(relatedWord);\n }\n }\n }\n } finally {\n dict.close();\n }\n return result;\n }", "public Set<String> hyponyms(String word) {\n HashSet<String> allhyponyms = new HashSet<String>();\n int maxV = synset.size();\n // int maxV = 0;\n // for (Integer i : synset.keySet()) {\n // if (maxV < i) {\n // maxV = i;\n // }\n // }\n // maxV += 1;\n Digraph digraph = new Digraph(maxV);\n\n // ArrayList<Integer> hypoKeys = new ArrayList<Integer>();\n // for (int i = 0; i < hyponym.size(); i++) {\n // hypoKeys.add(hyponym.get(0).get(i));\n // }\n \n for (ArrayList<Integer> a : hyponym) {\n int key = a.get(0);\n for (int j = 1; j < a.size(); j++) {\n digraph.addEdge(key, a.get(j));\n }\n }\n\n // get synonyms (in same synset), ex. given \"jump\", will get \"parachuting\" as well as \"leap\"\n ArrayList<String> strArray = new ArrayList<String>();\n for (Integer k : getSynsetKeys(word)) {\n strArray.addAll(synset.get(k));\n }\n for (String str : strArray) {\n allhyponyms.add(str);\n }\n\n // for each int from set<int> with all synset IDS\n for (Integer s : GraphHelper.descendants(digraph, getSynsetKeys(word))) {\n for (String t : synset.get(s)) {\n allhyponyms.add(t);\n }\n }\n return allhyponyms;\n }", "@Override\n public String getName() {\n return \"synonym\";\n }", "public java.util.List<String> getSynonyms() {\n return synonyms;\n }", "public Set<String> nouns() {\n HashSet<String> set = new HashSet<String>();\n for (TreeSet<String> hs: synsets.values()) {\n for (String s: hs) {\n set.add(s);\n }\n }\n return set;\n }", "public WordNet(String synsets, String hypernyms)\n {\n if (synsets==null || hypernyms==null) throw new IllegalArgumentException();\n h=new TreeMap<>();\n In i1=new In(synsets);\n int i=0;\n h2=new ArrayList<>();\n while(!i1.isEmpty())\n {\n String[] temp=i1.readLine().split(\",\");\n String[] temp2=temp[1].trim().split(\"\\\\s+\");\n String t=\"\";\n for (String s:temp2)\n {\n if (h.containsKey(s))\n {\n h.get(s).add(i);\n }\n else\n {\n ArrayList<Integer> a=new ArrayList<>();\n a.add(i);\n h.put(s,a);\n }\n\n t=t+s+\" \";\n }\n h2.add(t);\n i++;\n }\n\n g=new Digraph(i);\n In i2=new In(hypernyms);\n while (!i2.isEmpty())\n {\n String[] temp=i2.readLine().split(\",\");\n int j=Integer.parseInt(temp[0].trim());\n for (int k=1;k<temp.length;k++)\n g.addEdge(j, Integer.parseInt(temp[k].trim()));\n }\n\n sap=new SAP(g);\n\n //All the below lines check for Illegal Arguments\n DirectedCycle obj=new DirectedCycle(g);\n boolean b=obj.hasCycle();\n if (b) throw new IllegalArgumentException();\n\n int numberOfRoots=0;\n for (int j=0;j<g.V() && numberOfRoots < 2;j++)\n if (g.outdegree(j)==0) numberOfRoots++;\n\n //System.out.println(\"The number of roots is \"+numberOfRoots);\n if (numberOfRoots!=1) throw new IllegalArgumentException();\n }", "public Iterable<String> nouns(){\n List<String> ReturnType = new ArrayList<String>();\n for(int i =0; i< SynSets.length; i++)\n ReturnType.add(SynSets[i][0]);\n return ReturnType;\n }", "public WordNet(String synsets, String hypernyms) {\n boolean RootedDAG = false;\n String[] sets = synsets.split(\"\\n\");\n SynSets= new String[sets.length][2];\n Wordnet = new Digraph(sets.length);\n for (int i =0; i< sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n SynSets[i][0] = Delimiter[1];\n SynSets[i][1] = Delimiter[2];\n }\n sets = hypernyms.split(\"\\n\");\n for(int i = 0; i < sets.length; i++){\n String[] Delimiter = sets[i].split(\",\");\n int Above = Integer.parseInt(Delimiter[0]);\n if(Delimiter.length==1) {\n if(!RootedDAG) RootedDAG = true;\n else throw new IllegalArgumentException();\n }\n for(int j = 1; j< Delimiter.length; j++){\n Wordnet.addEdge(Above, Integer.parseInt(Delimiter[j]));\n }\n }\n //if(!RootedDAG) throw new IllegalArgumentException();\n }", "public void setAutoGenerateMultiTermSynonymsPhraseQuery(boolean enable) {\n this.autoGenerateMultiTermSynonymsPhraseQuery = enable;\n }", "public static void main(String[] args) {\n WordNet tester = new WordNet(\"synsets.txt\", \"hypernyms.txt\");\n StdOut.println(\n \"isNoun test: This should return true and it returns \" + tester.isNoun(\"mover\"));\n StdOut.println(\"distance test: This should return 3 and it returns \" + tester\n .distance(\"African\", \"renegade\"));\n StdOut.println(\n \"sca test: This should return person individual someone somebody mortal soul and it returns \"\n + tester\n .sca(\"African\", \"renegade\"));\n\n // Commented because output is large\n //StdOut.println(\"nouns test: This should return all of the nouns and it returns \" + tester.nouns());\n\n }", "public final void mT__31() throws RecognitionException {\n try {\n int _type = T__31;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalReqLNG.g:30:7: ( 'Synonyms' )\n // InternalReqLNG.g:30:9: 'Synonyms'\n {\n match(\"Synonyms\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public Set<String> hyponyms(String word) {\n Set<String> hyponyms = new HashSet<String>();\n Set<Integer> ids = new HashSet<Integer>();\n for (Integer key: synsetNouns.keySet()) {\n if (synsetNouns.get(key).contains(word)) {\n ids.add(key);\n }\n }\n Set<Integer> descendants = GraphHelper.descendants(hyponym, ids);\n for (Integer j: descendants) {\n for (String value: synsetNouns.get(j)) {\n hyponyms.add(value);\n }\n }\n return hyponyms;\n }", "public static List<Synset> getAllHyponymSynset(IndexWord word) throws JWNLException {\n List<Synset> result=new ArrayList<>();\n\n for(Synset wordSynset:word.getSenses()){\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(wordSynset,4);\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n LinkedList<PointerTargetTreeNode> stack = new LinkedList<>();\n if(rootnode==null){\n return result;\n }\n stack.add(rootnode);\n while(!stack.isEmpty()){\n PointerTargetTreeNode node = stack.pollLast();\n result.add(node.getSynset());\n PointerTargetTreeNodeList childList = node.getChildTreeList();\n if(childList!=null){\n for(int i=0;i<childList.size();i++){\n stack.add((PointerTargetTreeNode)childList.get(i));\n }\n }\n\n }\n\n }\n\n return result;\n }", "public static void initializeToolsAndResourcesForDemo(IDictionary dict) throws MalformedURLException, IOException {\n wordnet_dict = dict;\n wordnet_dict.open();\n\n // Choose wordnet sources to be used\n wordnetResources.add(\"synonyms\");\n //wordnetResources.add(\"antonyms\");\n //wordnetResources.add(\"hypernyms\");\n\n Properties split_props = new Properties();\n //Properties including lemmatization\n //props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n //Properties without lemmatization\n split_props.put(\"annotators\", \"tokenize, ssplit, pos\");\n split_props.put(\"tokenize.language\", \"en\");\n split_pipeline = new StanfordCoreNLP(split_props);\n\n Properties lemma_props = new Properties();\n lemma_props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n lemma_props.put(\"tokenize.language\", \"en\");\n lemma_pipeline = new StanfordCoreNLP(lemma_props);\n\n Properties entityMentions_props = new Properties();\n entityMentions_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, lemma, ner, entitymentions\");\n entityMentions_props.put(\"tokenize.language\", \"en\");\n entityMentions_props.put(\"truecase.overwriteText\", \"true\");\n entityMentions_pipeline = new StanfordCoreNLP(entityMentions_props);\n\n Properties compound_props = new Properties();\n compound_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, parse\");\n compound_props.put(\"tokenize.language\", \"en\");\n compound_props.put(\"truecase.overwriteText\", \"true\");\n compounds_pipeline = new StanfordCoreNLP(compound_props);\n\n spotlight = new Spotlight();\n\n chanel = new LODSyndesisChanel();\n\n }", "public static void main(String[] args) {\n String s1 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/synsets.txt\";\n String s2 = \"/Users/ElvisLee/Dropbox/workspace/drjava_workspace/algorithms/WordNet/wordnet/hypernyms.txt\";\n WordNet wordnet = new WordNet(s1, s2);\n Outcast outcast = new Outcast(wordnet);\n for (int t = 0; t < args.length; t++) {\n In in = new In(args[t]);\n String[] nouns = in.readAllStrings();\n StdOut.println(args[t] + \": \" + outcast.outcast(nouns));\n }\n }", "public Set<String> hyponyms(String word) {\n hypernymSet = new TreeSet<String>();\n firstsIDset = new HashSet<Integer>();\n for (String[] synStrings : sFile.values()) {\n for (String synset : synStrings) {\n if (synset.equals(word)) {\n for (String synset2 : synStrings) {\n hypernymSet.add(synset2);\n }\n for (Integer key : sFile.keySet()) {\n if (sFile.get(key).equals(synStrings)) {\n firstsIDset.add(key);\n }\n }\n }\n }\n }\n\n sIDset = GraphHelper.descendants(theDigraph, firstsIDset);\n for (Integer id : sIDset) {\n synsetWordStrings = sFile.get(id);\n for (String word2 : synsetWordStrings) {\n hypernymSet.add(word2);\n }\n }\n return hypernymSet;\n }", "public Iterable<String> nouns() {\n return synsetList.keySet();\n }", "public Set<String> hyponyms(String word) {\n Set<Integer> synIDs = new TreeSet<Integer>();\n Set<Integer> synKeys = synsetMap.keySet();\n for (Integer id : synKeys) {\n if (synsetMap.get(id).contains(word)) {\n synIDs.add(id);\n }\n }\n Set<Integer> hypIDs = GraphHelper.descendants(g, synIDs);\n Set<String> result = new TreeSet<String>();\n\n for (Integer i : hypIDs) {\n ArrayList<String> al = synsetMap.get(i);\n result.addAll(al);\n }\n return result;\n }", "public Iterable<String> nouns()\n {\n return synsetHash.keySet();\n }", "public static void main(String[] args)\n {\n WordNet obj=new WordNet(\"synsets.txt\", \"hypernyms.txt\");\n System.out.println(obj.g.V()+\" \"+obj.g.E());\n System.out.println(obj.h2.size());\n System.out.println(obj.distance(\"American_water_spaniel\", \"histology\"));\n }", "public WordNet(String synsetsFile, String hypernymsFile){\n if(synsetsFile == null || hypernymsFile == null){\n throw new IllegalArgumentException();\n }\n this.nounToIdMap = new HashMap<String, ArrayList<Integer>>();\n this.IdToNounMap = new HashMap<Integer, ArrayList<String>>();\n this.IdToSynsetMap = new HashMap<Integer, String>();\n this.numberOfSynsets = 0;\n processSynsetFile(synsetsFile);\n this.wordNetDigraph = new Digraph(this.numberOfSynsets);\n \n In hypernymsIn = new In(hypernymsFile);\n while(hypernymsIn.hasNextLine()){\n String line = hypernymsIn.readLine();\n String[] list = line.split(\",\");\n int synsetId = Integer.parseInt(list[0]);\n for(int i=1; i<list.length; i++){\n int hypernym = Integer.parseInt(list[i]);\n this.wordNetDigraph.addEdge(synsetId, hypernym);\n }\n }\n checkIfRootedDigraph();\n }", "public static void demo_basicOps(RoWordNet rown) throws Exception {\n Timer timer = new Timer();\n\n\t\t/* Objects and components. */\n Literal literal;\n /* Print stats about the recently loaded object. */\n IO.outln(\"\\n*** Displaying statistics ...\");\n timer.start();\n IO.outln(rown.getStats());\n IO.outln(\"Done: \" + timer.mark());\n\n\t\t/* Iterate through all synsets. */\n IO.outln(\"\\n*** Iterating through all synsets ...\");\n timer.start();\n int synNo = 0;\n for (String synsetID : rown.synsetsMap.keySet()) {\n Synset syn;\n\t\t\t/* method 1 */\n syn = rown.getSynsetById(synsetID);\n\t\t\t/* method 2 */\n syn = rown.synsetsMap.get(synsetID);\n synNo++;\n }\n IO.outln(synNo + \" synsets found in the dictionary.\");\n IO.outln(\"Done: \" + timer.mark());\n // Get list of words & set of relations\n ArrayList<String> words = new ArrayList<>();\n HashSet<String> relations = new HashSet<>();\n for (Synset s : rown.synsetsMap.values()) {\n if (s.getLiterals() != null)\n for (Literal l : s.getLiterals()) {\n words.add(l.getLiteral());\n }\n for (Relation r : s.getRelations()) {\n relations.add(r.getRelation());\n }\n }\n\n IO.outln(\"\\n*** Searching for literals in RoWordNet ...\");\n timer.start();\n literal = new Literal(\"demo_literal\");\n if (rown.containsLiteral(literal))\n IO.outln(\"Literal '\" + literal.getLiteral() + \"' found in synset \" + rown\n .getSynsetFromLiteral(literal).getId() + \".\");\n else\n IO.outln(\"Literal '\" + literal.getLiteral() + \"' not found.\");\n\n literal = rown.synsets.get(13).getLiterals().get(0);\n if (rown.containsLiteral(literal))\n IO.outln(\"Literal '\" + literal.getLiteral() + \"' found in synset \" + rown\n .getSynsetFromLiteral(literal).getId() + \".\");\n else\n IO.outln(\"Literal '\" + literal.getLiteral() + \"' not found.\");\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Extracting noun synsets ...\");\n timer.start();\n HashMap<String, Synset> nounSynsets = rown\n .getHashedSynsetsByPos(Synset.Type.Noun);\n IO.outln(nounSynsets.keySet().size() + \" noun synsets found.\");\n IO.outln(\"Done: \" + timer.mark());\n\n literal = new Literal(\"con\");\n IO.outln(\"\\n*** Fetching the synsets that contain literal '\" + literal\n .getLiteral() + \"' ...\");\n timer.start();\n ArrayList<String> ids = rown.getIdsFromLiteral(literal);\n IO.outln(ids.size() + \" synsets found.\");\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Extracting verb synsets ...\");\n timer.start();\n ArrayList<Synset> verbSynsets = rown\n .getListedSynsetsByPos(Synset.Type.Verb);\n IO.outln(verbSynsets.size() + \" verb synsets found.\");\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Generating id for new prefix using getNewID ...\");\n timer.start();\n String newId = rown.getNewId(\"GetNew-\", \"-demo\");\n System.out.println(\"\\t New Id for new prefix: \" + newId);\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Generating id for existing prefix using getNewID ...\");\n timer.start();\n newId = rown.getNewId(\"ENG30-\", \"-n\");\n System.out.println(\"\\t New Id for new prefix: \" + newId);\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Generating ids for new prefix using getIncrementalID ...\");\n timer.start();\n for (int i = 0; i < 5; i++) {\n newId = rown.getNewIncrementalId(\"NEW12-\", \"-p\");\n System.out\n .println(\"\\t Incremental Id \" + i + \" for new prefix: \" + newId);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n IO.outln(\"\\n*** Generating ids for existing prefix using getIncrementalID ...\");\n timer.start();\n for (int i = 0; i < 5; i++) {\n newId = rown.getNewIncrementalId(\"ENG30-\", \"-n\");\n System.out\n .println(\"\\t Incremental Id \" + i + \" for existing prefix: \" + newId);\n }\n IO.outln(\"Done: \" + timer.mark());\n\n\t\t/*\n\t\t * Adding a new synset, setting only its ID, POS, Definition, Domain as\n\t\t * well as 2 Literals and 2 Relations\n\t\t */\n IO.outln(\"\\n*** Adding a new synset with 2 Literals and 2 Relations ...\");\n timer.start();\n\n Synset s = new Synset();\n\n s.setId(rown.getNewIncrementalId(\"ENG30-\", \"-n\"));\n s.setPos(Synset.Type.Noun);\n s.setDefinition(\"New definition\");\n s.setDomain(\"New domain\");\n\n\t\t/*---Literals---*/\n\n\t\t/* Creating a Literal ArrayList (container) */\n ArrayList<Literal> literalArray = new ArrayList<>();\n\n\t\t/* Creating and adding the first Literal */\n Literal l = new Literal();\n l.setLiteral(\"Literal 1\");\n l.setSense(\"S1\");\n literalArray.add(l);\n\n\t\t/* Creating and adding the second Literal (direct method) */\n literalArray.add(new Literal(\"Literal 2\", \"S2\"));\n\n\t\t/* Adding the Literal container to the Synset */\n s.setLiterals(literalArray);\n\n\t\t/*---Relations---*/\n\n\t\t/* Creating a Relation ArrayList (container) */\n ArrayList<Relation> relationArray = new ArrayList<>();\n\n\t\t/* Creating and adding the first new Relation */\n Relation r = new Relation();\n r.setRelation(\"hypernym\");\n r.setSourceSynset(s.getId());\n r.setTargetSynset(\"NEWSYNSET-002-N\");\n relationArray.add(r);\n\n\t\t/* Creating and adding the second Relation (direct method) */\n relationArray\n .add(new Relation(s.getId(), \"NEWSYNSET-002-N\", \"hyponym\"));\n\n\t\t/* Adding the Relation container to the Synset */\n s.setRelations(relationArray);\n\n\t\t/* Adding the synset to the RoWordNet object */\n rown.addSynset(s, true);\n\n\t\t/* Printing the synset's details */\n IO.outln(rown.getSynsetById(s.getId()).toString());\n IO.outln(\"Done: \" + timer.mark());\n }", "private List<Query> createSynonymQueries(SolrParams solrParams, List<String> alternateQueryTexts) {\n \n String nullsafeOriginalString = getQueryStringFromParser();\n \n List<Query> result = new ArrayList<>();\n for (String alternateQueryText : alternateQueryTexts) {\n if (alternateQueryText.equalsIgnoreCase(nullsafeOriginalString)) { \n // alternate query is the same as what the user entered\n continue;\n }\n \n synonymQueryParser.setString(alternateQueryText);\n try {\n result.add(synonymQueryParser.parse());\n } catch (SyntaxError e) {\n // TODO: better error handling - for now just bail out; ignore this synonym\n e.printStackTrace(System.err);\n }\n }\n \n return result;\n }", "private List<String> findSynonyms(String gene,String scope){\n\t\t\n\t\tList<String> li = new ArrayList<String> ();\n\t\t\n\t\tif (this.termSet.contains(gene)){\n\t\t\tfor (String str:this.synonymDictionary.get(gene).get(scope)){\n\t\t\t\tli.add(str);\n\t\t\t};\n\t\t}\n\t\treturn li;\n\t\n\t}", "public Iterable<String> nouns() {\n Stack<String> iter = new Stack<>();\n for (String ss : synsetsStrToNum.keySet())\n iter.push(ss);\n return iter;\n }", "public static void testDictionary() throws IOException {\n String wnhome=\"c:\\\\Users\\\\Katherine\\\\Documents\\\\2nd sem\\\\IR\\\\project\\\\WordNet_3.1\";\n String path = wnhome + File.separator + \"dict\";\n\n\n URL url = new URL(\"file\", null, path);\n\n IDictionary dictionary = new Dictionary(url);\n dictionary.open();\n // /Users/Ward/Downloads\n IIndexWord indexWord = dictionary.getIndexWord(\"use\", POS.VERB);\n\n for (IWordID wordID : indexWord.getWordIDs()) {\n\n IWord word = dictionary.getWord(wordID);\n for (IWord word1 : word.getSynset().getWords()) {\n System.out.println(word1.getLemma());\n }\n// System.out.println(\"Id = \" + wordID);\n// System.out.println(\" Lemma = \" + word.getLemma());\n// System.out.println(\" Gloss = \" + word.getSynset().getGloss());\n\n List<ISynsetID> hypernyms =\n word.getSynset().getRelatedSynsets(Pointer.HYPERNYM);\n // print out each h y p e r n y m s id and synonyms\n List<IWord> words;\n for (ISynsetID sid : hypernyms) {\n words = dictionary.getSynset(sid).getWords();\n System.out.print(sid + \" {\");\n for (Iterator<IWord> i = words.iterator(); i.hasNext(); ) {\n System.out.print(i.next().getLemma());\n if (i.hasNext())\n System.out.print(\", \");\n }\n System.out.println(\"}\");\n }\n }\n }", "public boolean isNoun (String word){\n for(int i = 0; i< SynSets.length; i++){\n if(SynSets[0][1].contains(\" \"+word+\" \")) return true;\n }\n return false;\n }", "static private AssociatedElement getSynonym(String name, ArrayList<AssociatedElement> synonyms)\r\n\t{\r\n\t\tfor(AssociatedElement synonym : synonyms)\r\n\t\t\tif(synonym.getName().equals(name)) return synonym;\r\n\t\treturn null;\r\n\t}", "public ElementDefinitionDt addSynonym( String theString) {\n\t\tif (mySynonym == null) {\n\t\t\tmySynonym = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\tmySynonym.add(new StringDt(theString));\n\t\treturn this; \n\t}", "@Override\n public boolean isStrongFormSynonymous(String link1, String link2){\n if(link1 == null || link2 == null) {\n return false;\n }\n\n Set<String> synonyms1 = new HashSet<>();\n Set<String> synonyms2 = new HashSet<>();\n\n synonyms1.addAll(linker.getUris(link1));\n synonyms2.addAll(linker.getUris(link2));\n\n // remove empty strings to avoid false positives\n synonyms1.remove(\"\");\n synonyms2.remove(\"\");\n\n for(String s : linker.getUris(link2)){\n if(synonyms1.contains(s)) return true;\n }\n for(String s : linker.getUris(link1)){\n if(synonyms2.contains(s)) return true;\n }\n\n return false;\n }", "public List<String> findRelatedSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"related\");\n\t}", "public interface Ontology {\n\n /**\n * Load an array URIs which resolve to ontology resources.\n *\n * @param urls a {@link java.lang.String} containing ontology URIs.\n */\n public void load(String[] urls);\n\n /**\n * Load a collection of default ontology resources.\n */\n public void load() ;\n\n /**\n * merge relevant ontology subgraphs into a new subgraph which can\n * be used within Mudrod\n *\n * @param o an ontology to merge with the current ontology held\n * within Mudrod.\n */\n public void merge(Ontology o);\n\n /**\n * Retreive all subclasses for a particular entity provided within the\n * search term e.g.subclass-based query expansion.\n *\n * @param entitySearchTerm an input search term\n * @return an {@link java.util.Iterator} object containing subClass entries.\n */\n public Iterator<String> subclasses(String entitySearchTerm);\n\n /**\n * Retreive all synonyms for a particular entity provided within the\n * search term e.g.synonym-based query expansion.\n *\n * @param queryKeyPhrase a phrase to undertake synonym expansion on.\n * @return an {@link java.util.Iterator} object containing synonym entries.\n */\n public Iterator<String> synonyms(String queryKeyPhrase);\n\n}", "public Set<String> hyponyms(String word) {\n Set<String> toReturn = new HashSet<String>();\n Set<Integer> wordIndexes = new HashSet<Integer>();\n wordIndexes = wnetsi.get(word);\n Set<Integer> toReturnInt = GraphHelper.descendants(g, wordIndexes);\n Object[] returnArray = toReturnInt.toArray();\n for (int i = 0; i < returnArray.length; i += 1) {\n Set<String> stringReturn = wnetis.get(returnArray[i]);\n Iterator<String> strIter = stringReturn.iterator();\n while (strIter.hasNext()) {\n toReturn.add(strIter.next());\n }\n }\n return toReturn;\n }", "public Set<String> hyponyms(String word) {\n Set<Integer> wordIds = revrseSynsetMapper.get(word);\n Set<String> superSet = new HashSet<String>();\n Set<Integer> descendant = GraphHelper.descendants(hypGraph, wordIds);\n Iterator<Integer> iter = descendant.iterator();\n while (iter.hasNext()) {\n Set<String> string_word = synsetMapper.get(iter.next());\n Iterator<String> A = string_word.iterator();\n while (A.hasNext()) {\n superSet.add(A.next());\n }\n }\n return superSet;\n }", "Ontology getTargetOntology();", "private static void demonstrateListOperation(IndexWord word) throws JWNLException {\n PointerTargetNodeList hypernyms = PointerUtils.getInstance().getDirectHypernyms(word.getSense(1));\n System.out.println(\"Direct hypernyms of \\\"\" + word.getLemma() + \"\\\":\");\n for(int idx = 0; idx < hypernyms.size(); idx++){\n PointerTargetNode nn = (PointerTargetNode)hypernyms.get(idx);\n for(int wrdIdx = 0; wrdIdx < nn.getSynset().getWordsSize(); wrdIdx++){\n System.out.println(\"Syn\" + idx + \" of direct hypernyms of\\\"\" + word.getLemma() + \"\\\" : \" +\n nn.getSynset().getWord(wrdIdx).getLemma());\n }\n }\n hypernyms.print();\n }", "public static void main(String[] args) {\n\n\t\tWordNet wn = new WordNet(args[0], args[1]);\n\t\tassert (wn.sap(\"'hood\", \"1780s\").compareTo(\"entity\") == 0);\n\t\tassert (wn.distance(\"1530s\", \"1530s\") == 0);\n\t\tassert (wn.distance(\"collar_blight\", \"top\") == 11);\n\n\t\ttry {\n\t\t\tWordNet wn1 = new WordNet(\"syntest.txt\", \"2rootsnym.txt\");\n\t\t\tassert (wn1.distance(\"1840s\", \"'hood\") == -1);\n\t\t\twn1.sap(\"1840s\", \"'hood\");\n\n\t\t\t// wn1.distance(\"1830s\", \"'hood\");\n\t\t\t// wn1.sap(\"1830s\", \"'hood\");\n\t\t\tassert false : \"A graph with 2 roots should throw exception\";\n\n\t\t} catch (java.lang.IllegalArgumentException e) {\n\t\t\tSystem.out.println(\"2 Roots detected: \" + e);\n\t\t}\n\n\t\ttry {\n\t\t\tWordNet wn2 = new WordNet(\"syntest.txt\", \"cycnym.txt\");\n\t\t\tassert false : \"A cyclic graph should throw exception\";\n\n\t\t} catch (java.lang.IllegalArgumentException e) {\n\t\t\tSystem.out.println(\"Cycle detected: \" + e);\n\t\t}\n\n\t}", "public String showAddSynonym(String word, ArrayList<String> synonyms, ArrayList<String> synonymHashSet) {\n String returnedString = \"I have added \"\n + (synonyms.size() == 1 ? \"this synonym \\\"\"\n + synonyms.get(0) + \"\\\"\" : \"these synonyms\")\n + \" to word \\\"\" + word + \"\\\"\" + \"\\n\";\n returnedString += \"Here \" + (synonymHashSet.size() == 1 ? \"is the synonym \" : \"are the synonyms \")\n + \"of word \\\"\" + word + \"\\\"\" + \"\\n\";\n StringBuilder stringBuilder = new StringBuilder();\n for (String synonym : synonymHashSet) {\n stringBuilder.append(synonym + \"\\n\");\n }\n return returnedString + stringBuilder.toString();\n }", "public void loadNames(boolean addSynonyms) {\n\t\tBufferedReader namesRdr = null;\n\t\ttry {\n\t\t\tnamesRdr = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tnamesUrl.openStream()));\n\n\t\t\tString line;\n\t\t\twhile ((line = namesRdr.readLine()) != null) {\n\t\t\t\tString[] parts = line.split(\"\\\\|\");\n\t\t\t\tInteger taxonId = Integer.valueOf(parts[0].trim());\n\t\t\t\tString name = parts[1].trim();\n\t\t\t\tString nameClass = parts[3].trim();\n\n\t\t\t\t// Get the taxon object\n\t\t\t\tTaxon t;\n\t\t\t\tif ((t = taxonomyMap.get(taxonId)) == null) {\n\t\t\t\t\tt = new Taxon(taxonId);\n\t\t\t\t\ttaxonomyMap.put(taxonId, t);\n\t\t\t\t}\n\n\t\t\t\t// Set the scientific name and/or synonyms\n\t\t\t\tif (nameClass.equals(\"scientific name\")) {\n\t\t\t\t\tt.setName(name);\n\t\t\t\t} else if (addSynonyms) {\n\t\t\t\t\t// t.addName(name);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tthis.close(namesRdr);\n\t\t}\n\t}", "private static void demonstrateTreeOperation(IndexWord word) throws JWNLException {\n PointerTargetTree hyponyms = PointerUtils.getInstance().getHyponymTree(word.getSense(1));\n PointerTargetTreeNode rootnode = hyponyms.getRootNode();\n Synset rootsynset = rootnode.getSynset();\n System.out.println(rootsynset.getWord(0).getLemma());\n PointerTargetTreeNodeList childList = rootnode.getChildTreeList();\n PointerTargetTreeNode rootnode1=(PointerTargetTreeNode)childList.get(0);\n System.out.println(rootnode1.getSynset().getWord(0).getLemma());\n System.out.println(\"Hyponyms of \\\"\" + word.getLemma() + \"\\\":\");\n hyponyms.print();\n }", "public void parseThesaurus() throws IOException {\r\n\t\t\t//We create an object below to read the thesaurus file\r\n\t\t\tFileInputStream fis = new FileInputStream(\"src//ie//gmit//dip//resources//MobyThesaurus3.txt\");\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(fis));\r\n\t\t\t List <List<String>> listOflist= new ArrayList<>();\r\n\t\t\t// HashMap<String,List> tMap = new HashMap<>();\t\t\r\n\t\t\t List <String> individualListOfSynonyms= new ArrayList <String>();\r\n\r\n\t\t\t \r\n\t\t\t //we create a hashmap with the first word being the key value and the rest a list of synonims we will use\r\n\t\t\twhile(br.readLine()!=null) {\r\n\t\t\t\t\r\n\t\t\t\tString somestring = br.readLine();\r\n\t\t\t\tString[] testsplit= somestring.split(\",\");\r\n\t\t\t\tindividualListOfSynonyms=Arrays.asList(testsplit);\r\n\t\t\t\tString indexvalue=individualListOfSynonyms.get(0).toString();\r\n\t\t\t tMap.put(indexvalue, individualListOfSynonyms);\r\n\t\t\t //br.close();\r\n\t\t\t //System.out.println(tMap);\r\n\t\t\t }\r\n\t\t\t}", "public static Iterator<ContextNode> getSynonymContextNodes(ContextNode contextNode) {\r\n\r\n\t\tIterator<Relation> relations = contextNode.getIncomingRelations(XDIDictionaryConstants.XRI_S_IS);\r\n\r\n\t\treturn new MappingRelationContextNodeIterator(relations);\r\n\t}", "public List<String> findAllSynonyms(String gene){\n\t\tList<String> synonyms = new ArrayList<String> ();\n\t\tif (this.termSet.contains(gene)){\n\t\t\tMap<String,List<String>> geneSynonyms = this.synonymDictionary.get(gene);\n\t\t\tSet<String> keys = geneSynonyms.keySet();\n\t\t\tfor(String k:keys){\n\t\t\t\tList<String> subList = geneSynonyms.get(k);\n\t\t\t\tfor(String s:subList){\n\t\t\t\t\tsynonyms.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn synonyms;\n\t}", "Ontology getSourceOntology();", "public Set<String> nouns() {\n return wnetsi.keySet();\n }", "public String showSearchSynonym(String searchWord, ArrayList<String> words) {\n StringBuilder stringBuilder = new StringBuilder(\"Your word \\\"\" + searchWord + \"\\\" has \" + words.size()\n + (words.size() == 1 ? \" synonym:\\n\" : \" synonyms:\\n\"));\n for (int i = 0; i < words.size(); i++) {\n stringBuilder.append(words.get(i) + \"\\n\");\n }\n return stringBuilder.toString();\n }", "private void synsetParse(String line) {\n String[] tokens = line.split(\",\");\n Integer key = Integer.parseInt(tokens[0]);\n ArrayList<String> al = new ArrayList<String>();\n String[] words = tokens[1].split(\" \");\n for (String w : words) {\n al.add(w);\n nounSet.add(w); // build nounSet at the same time\n }\n synsetMap.put(key, al);\n }", "public String getOntologyURI();", "public java.util.List<StringDt> getSynonym() { \n\t\tif (mySynonym == null) {\n\t\t\tmySynonym = new java.util.ArrayList<StringDt>();\n\t\t}\n\t\treturn mySynonym;\n\t}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tModel model = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null );\n\n\t\t// Load ontology 1\n\t\tmodel.read(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book1-test1.owl\");\n\n\t\t// Query in ontology 1\n\t\tQueryExecution qe = QueryExecutionFactory.create( QueryFactory.read( \"E:\\\\Kuliah\\\\TUGASAKHIR\\\\TugasAkhirLatestFolder\\\\Software\\\\ontologyandmappingsanddatasources\\\\endtoendtest\\\\book1-query1.sparql\" ), model );\n\t\tResultSet results = qe.execSelect();\n\t\t// PrefixMapping query;\n\t\t// Output query results\t\n\t\t// ResultSetFormatter.out(System.out, results, query);\n\n\t\t// Load ontology 2\n\t\tmodel = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null );\n\t\tmodel.read(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book2-test1.owl\");\n\t\t\t\n\t\t// Transform query\n\t\tString transformedQuery = null;\n\t\tString firstQuery = null;\n\t\ttry {\n\t\t InputStream in = new FileInputStream(\"E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/ontologyandmappingsanddatasources/endtoendtest/book1-query1.sparql\");\n\t\t BufferedReader reader = new BufferedReader( new InputStreamReader(in) );\n\t\t String line = null;\n\t\t String queryString = \"\";\n\t\t while ((line = reader.readLine()) != null) {\n\t\t\tqueryString += line + \"\\n\";\n\t\t }\n\t\t firstQuery = queryString;\n\t\t Properties parameters = new Properties();\n\t\t \n\t\t AlignmentParser aparser = new AlignmentParser(0);\n//\t\t Mapping\n\t\t Alignment alu = aparser.parse(\"file:///E:/Kuliah/TUGASAKHIR/TugasAkhirLatestFolder/Software/align-4.9/html/tutorial/tutorial4/bookalignment.rdf\");\n\t\t BasicAlignment al = (BasicAlignment) alu;\n\t\t\ttransformedQuery = ((BasicAlignment)al).rewriteQuery( queryString, parameters );\n//\t\t transformedQuery = ((ObjectAlignment)al).\n\t\t} catch ( Exception ex ) { ex.printStackTrace(); }\n\n\t\t// Query ontology 2\n\t\tSystem.out.println(transformedQuery);\n//\t\tdisplayQueryAnswer( model, QueryFactory.create( transformedQuery ) );\n\t\tqe = QueryExecutionFactory.create( QueryFactory.create( firstQuery ), model );\n\t\tresults = qe.execSelect();\n\t\tSystem.out.println(results);\n\t\t\n\t\t// Output query results\t\n\t\t// ResultSetFormatter.out(System.out, results, query);\n\t}", "public void setOverrideIncludeSynonymsDefault(boolean override) {\r\n\t\tthis.tableMetaDataContext.setOverrideIncludeSynonymsDefault(override);\r\n\t}", "public String findAntonyms(String word) throws IOException {\n try {\n word = word.toLowerCase();\n String check = dictionaryDao.readDB(word);\n if(!check.contains(\"null\"))\n return dictionaryDao.readDB(word); //checkFile(word);\n DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();\n URL url = new URL(PATH + word + XML);\n URLConnection connection = url.openConnection();\n Document doc = parseXML(connection.getInputStream());\n NodeList xml = doc.getElementsByTagName(\"w\");\n String xmlElementValue = null;\n ArrayList<String> antonymsCollection = new ArrayList<>();\n\n for (int i = 0; i < xml.getLength(); i++) {\n Element element = (Element) xml.item(i);\n if (isAntonym(element.getAttribute(\"r\"))) {\n xmlElementValue = element.getTextContent();\n antonymsCollection.add(xmlElementValue);\n }\n }\n\n String lastElement = antonymsCollection.get(antonymsCollection.size()-1);\n String antonymsCollectionString = \"\";\n\n for(String s : antonymsCollection) {\n if(!s.equals(lastElement))\n antonymsCollectionString += s + \", \";\n else\n antonymsCollectionString += s + \".\";\n }\n dictionaryDao.addToDB(word, antonymsCollectionString); //saveToFile(word, antonymsCollectionString);\n return \"Antonym/s for \" + word + \": \" + antonymsCollectionString;\n } catch (UnknownHostException e) {\n return INTERNECT_CONNECTION;\n } catch (NullPointerException e) {\n return INCORRECT_WORD;\n } catch (ArrayIndexOutOfBoundsException e) {\n return INCORRECT_WORD;\n } catch(IOException e){\n return INCORRECT_WORD;\n } catch (JdbcSQLException e) {\n return DATABASE_ERROR;\n } catch (Exception e) {\n StringWriter errors = new StringWriter();\n e.printStackTrace(new PrintWriter(errors));\n return errors.toString();\n }\n }", "public List<String> findBroadSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"broad\");\n\t}", "public boolean getAutoGenerateMultiTermSynonymsPhraseQuery() {\n return autoGenerateMultiTermSynonymsPhraseQuery;\n }", "public StrColumn getSynonym() {\n return delegate.getColumn(\"synonym\", DelegatingStrColumn::new);\n }", "private void createOntologyResources(String conceptName, String conditionName, \r\n\t\t\t\t\t\t\t\t\t\tVector<String> syndromeSensDefNames, Vector<String> syndromeSpecDefNames, \r\n\t\t\t\t\t\t\t\t\t\tString relation, String inclusionKeywords, String exclusionKeywords, \r\n\t\t\t\t\t\t\t\t\t\tVector<Coding> codes) throws Exception{\n\t\tOWLDatatypeProperty codeIDProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODE_ID);\r\n\t\tOWLDatatypeProperty codeTitleProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODE_TITLE);\r\n\t\tOWLDatatypeProperty codingSystemProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_CODESYSTEM_NAME);\r\n\t\tOWLDatatypeProperty nameProperty = owlModel.getOWLDatatypeProperty(Constants.PROPERTY_HAS_NAME);\r\n\t\tOWLObjectProperty externalCodingsProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_EXTERNAL_CODES);\r\n\r\n\t\tOWLNamedClass newConcept = null;\r\n\t\tif (conceptName == null) {\r\n\t\t\t// We need to have at least one concept associated with a condition (exact concept),\r\n\t\t\t// so if there isn't one, we need to create it.\r\n\t\t\tSystem.out.println(\"WARNING: Missing concept for condition \" + conditionName + \". A concept with the same name will be created.\");\r\n\r\n\t\t\tconceptName = conditionName.toLowerCase();\r\n\t\t\trelation = \"concept name\";\r\n\t\r\n\t\t\t// check if such concept already exists:\r\n\t\t\tnewConcept = owlModel.getOWLNamedClass(conceptName.replace(' ', '_'));\r\n\t\t}\r\n\t\t\r\n\t\tif (newConcept == null) {\r\n\t\t\t\r\n\t\t\t// 1. Create new subclass(instance) of Concept:\r\n\t\t\tOWLNamedClass conceptClass = owlModel.getOWLNamedClass(Constants.CLASS_CONCEPT);\r\n\t\t\tOWLNamedClass conceptMetaClass = owlModel.getOWLNamedClass(Constants.METACLASS_CONCEPT);\r\n\t\t\tnewConcept = (OWLNamedClass) conceptMetaClass.createInstance(conceptName.replace(' ', '_'));\r\n\t\t\tnewConcept.addSuperclass(conceptClass);\r\n\t\t\tnewConcept.removeSuperclass(owlModel.getOWLThingClass());\r\n\t\t\tnewConcept.setPropertyValue(nameProperty, conceptName);\r\n\t\t\t\r\n\t\t\t// 2. Add external codes:\r\n\t\t\tCoding c = null;\r\n\t\t\tString codeName = null;\r\n\t\t\tOWLIndividual code = null;\r\n\t\t\tOWLNamedClass codeClass = null;\r\n\r\n\t\t\tfor (int i=0; i<codes.size(); i++){\r\n\t\t\t\tc = codes.get(i);\r\n\t\t\t\tcodeName = c.system + \"_\" + c.codeID.trim().replace(' ', '_');\r\n\t\t\t\tcode = owlModel.getOWLIndividual(codeName);\r\n\t\t\t\tif (code == null) {\r\n\t\t\t\t\tcodeClass = owlModel.getOWLNamedClass(c.system);\r\n\t\t\t\t\tcode = codeClass.createOWLIndividual(codeName);\r\n\t\t\t\t\tcode.setPropertyValue(codingSystemProperty, c.system);\r\n\t\t\t\t\tcode.setPropertyValue(codeIDProperty, c.codeID);\r\n\t\t\t\t\tif (c.codeTitle != null) code.setPropertyValue(codeTitleProperty, c.codeTitle);\r\n\t\t\t\t}\r\n\t\t\t\tnewConcept.addPropertyValue(externalCodingsProperty, code);\r\n\t\t\t}\r\n\r\n\t\t\t// 3. Process keywords:\r\n\t\t\tprocessKeywordString(inclusionKeywords, newConcept, Constants.PROPERTY_HAS_INCLUSION_KEYWORDS);\r\n\t\t\tprocessKeywordString(exclusionKeywords, newConcept, Constants.PROPERTY_HAS_EXCLUSION_KEYWORDS);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"WARNING: Non-unique concept '\" + conceptName + \"' resulting from artificially creating an exact concept for a condition that did not have any associated concepts listed.\");\r\n\t\t}\r\n\t\t \t\t\r\n\t\t// 4. Check if ClinicalCondition exists, if not, create new subclass:\r\n\t\tOWLNamedClass conditionClass = owlModel.getOWLNamedClass(Constants.CLASS_CONDITION);\r\n\t\tOWLNamedClass conditionMetaClass = owlModel.getOWLNamedClass(Constants.METACLASS_CONDITION);\r\n\t\tOWLNamedClass condition = owlModel.getOWLNamedClass(conditionName.replace(' ', '_'));\r\n\r\n\t\tif (condition == null) {\r\n\t\t\tcondition = (OWLNamedClass) conditionMetaClass.createInstance(conditionName.replace(' ', '_'));\r\n\t\t\tcondition.addSuperclass(conditionClass);\r\n\t\t\tcondition.removeSuperclass(owlModel.getOWLThingClass());\r\n\t\t\tcondition.setPropertyValue(nameProperty, conditionName);\r\n\t\t\t\r\n\t\t\t// 5. Add new condition to syndrome definition(s):\r\n\t\t\tOWLObjectProperty sensitiveDefinitionProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SENSITIVE_DEFINITION);\r\n\t\t\tOWLObjectProperty specificDefinitionProperty = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SPECIFIC_DEFINITION);\r\n\t\t\tOWLNamedClass syndromeSens = null; \r\n\t\t\tOWLNamedClass syndromeSpec = null; \r\n\t\t\tif (syndromeSensDefNames != null && syndromeSensDefNames.size() > 0) {\r\n\t\t\t\tfor (int i=0; i<syndromeSensDefNames.size(); i++){\r\n\t\t\t\t\tsyndromeSens = owlModel.getOWLNamedClass(syndromeSensDefNames.get(i));\r\n\t\t\t\t\tsyndromeSens.addPropertyValue(sensitiveDefinitionProperty, condition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (syndromeSpecDefNames != null && syndromeSpecDefNames.size() > 0) {\r\n\t\t\t\tfor (int i=0; i<syndromeSpecDefNames.size(); i++){\r\n\t\t\t\t\tsyndromeSpec = owlModel.getOWLNamedClass(syndromeSpecDefNames.get(i));\r\n\t\t\t\t\tsyndromeSpec.addPropertyValue(specificDefinitionProperty, condition);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// 6. Add Concept to one of the slots of ClinicalCondition\r\n\t\tOWLObjectProperty p = null;\r\n\t\tif (relation.equalsIgnoreCase(\"concept name\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_EXACT_CONCEPT);\r\n\t\t} \r\n\t\telse if (relation.substring(0, 7).equalsIgnoreCase(\"related\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_RELATED_CONCEPTS);\r\n\t\t} \r\n\t\telse if (relation.equalsIgnoreCase(\"synonym\")){\r\n\t\t\tp = owlModel.getOWLObjectProperty(Constants.PROPERTY_HAS_SYNONYMOUS_CONCEPTS);\r\n\t\t}\r\n\t\telse throw new Exception(\"Cannot determine the relation of a concept to clinical condition! Relation specified is '\" + relation + \"'.\");\r\n\t\tcondition.addPropertyValue(p, newConcept);\r\n\t}", "public abstract void substitutedConcepts(long ms, int n);", "public List<String> findExactSynonyms(String gene){\n\t\t\n\t\treturn findSynonyms(gene, \"exact\");\n\t}", "public static void initializeToolsAndResources(String wordnetPath) throws MalformedURLException, IOException {\n\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.INFO, \"...Generating stop-words lists...\");\n StringUtils.generateStopListsFromExternalSource(filePath_en, filePath_gr);\n\n Properties split_props = new Properties();\n //Properties without lemmatization\n split_props.put(\"annotators\", \"tokenize, ssplit, pos\");\n split_props.put(\"tokenize.language\", \"en\");\n split_pipeline = new StanfordCoreNLP(split_props);\n\n Properties lemma_props = new Properties();\n lemma_props.put(\"annotators\", \"tokenize, ssplit, pos, lemma\");\n lemma_props.put(\"tokenize.language\", \"en\");\n lemma_pipeline = new StanfordCoreNLP(lemma_props);\n\n Properties entityMentions_props = new Properties();\n entityMentions_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, lemma, ner, entitymentions\");\n entityMentions_props.put(\"tokenize.language\", \"en\");\n entityMentions_props.put(\"truecase.overwriteText\", \"true\");\n entityMentions_pipeline = new StanfordCoreNLP(entityMentions_props);\n\n Properties compound_props = new Properties();\n compound_props.put(\"annotators\", \"tokenize, ssplit, truecase, pos, parse\");\n compound_props.put(\"tokenize.language\", \"en\");\n compound_props.put(\"truecase.overwriteText\", \"true\");\n compounds_pipeline = new StanfordCoreNLP(compound_props);\n\n spotlight = new Spotlight();\n\n chanel = new LODSyndesisChanel();\n\n }", "public static void runExample() {\n\t\tString wnhome = \"C:\\\\bdaduy\\\\Software\\\\Wordnet3.1\\\\WordNet-3.0\";\n\t\tString path = wnhome + File.separator + \"dict\";\n\t\tURL url = null;\n\t\ttry {\n\t\t\turl = new URL(\"file\", null, path);\n\t\t} catch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (url == null)\n\t\t\treturn;\n\n\t\t// construct the dictionary object and open it\n\t\tIDictionary dict = new Dictionary(url);\n\t\ttry {\n\t\t\tdict.open();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// look up first sense of the word \"dog\"\n\t\tWordnetStemmer s=new WordnetStemmer(dict);\n\t\tList<String> stems=s.findStems(\"food\", POS.NOUN);\n\t\tDebug.print(stems);\n\t\tIIndexWord idxWord = dict.getIndexWord(\"food\", POS.NOUN);\n\t\tIWordID wordID = idxWord.getWordIDs().get(0);\n\t\tIWord word = dict.getWord(wordID);\n\t\tSystem.out.println(\"Id = \" + wordID);\n\t\tSystem.out.println(\"Lemma = \" + word.getLemma());\n\t\tSystem.out.println(\"Gloss = \" + word.getSynset().getGloss());\n\t\tSystem.out.println(\"test = \" + word.getSynset().getLexicalFile());\n\n\n\t}", "private void createNeuralNet() {\n\t\tMSimulationConfig simConfig;\n\t\tHashMap<Integer, MNeuron> neuronMap = new HashMap<Integer, MNeuron>();\n\t\tArrayList<MNeuron> neurons = new ArrayList<MNeuron>();\n\t\tArrayList<MSynapse> synapses = new ArrayList<MSynapse>();\n\n\t\tNeatGenome genome = (NeatGenome) geneticObject;\n\t\t/* Create neurons. */\n\t\tfor (NeatNode nn : genome.getNodes()) {\n\t\t\tint id = nn.getId();\n\t\t\tMNeuronParams params = nn.getParams();\n\t\t\tMNeuronState state =\n\t\t\t\t\tMFactory.createInitialRSNeuronState();\n\n\t\t\t/* Create a neuron. */\n\t\t\tMNeuron neuron = new MNeuron(params, state, id);\n\n\t\t\t/* Add it to temporary NID->Neuron map. */\n\t\t\tneuronMap.put(id, neuron);\n\n\t\t\t/* Add neuron to the list. */\n\t\t\tneurons.add(neuron);\n\t\t}\n\n\t\t/* Create synapses. */\n\t\tfor (GenomeEdge<NeatNode> g : genome.getGene()) {\n\t\t\t/* Get the synapse information. */\n\t\t\tNeatNode preNode = g.getIn();\n\t\t\tNeatNode postNode = g.getOut();\n\t\t\tdouble weight = g.getWeight();\n\t\t\tint delay = g.getDelay();\n\t\t\tInteger preNid = new Integer(preNode.getId());\n\t\t\tInteger postNid = new Integer(postNode.getId());\n\n\t\t\t/* Find the pre and post neurons. */\n\t\t\tMNeuron preNeuron = neuronMap.get(preNid);\n\t\t\tMNeuron postNeuron = neuronMap.get(postNid);\n\n\t\t\t/* Create the synapse. */\n\t\t\tMSynapse synapse = new MSynapse(preNeuron, postNeuron,\n\t\t\t\t\tweight, delay);\n\t\t\t/*\n\t\t\tAdd the synapse to the pre and post neuron synapse list\n\t\t\t */\n\t\t\tArrayList<MSynapse> postSynapses\n\t\t\t= preNeuron.getPostSynapses();\n\t\t\tArrayList<MSynapse> preSynapses\n\t\t\t= postNeuron.getPreSynapses();\n\n\t\t\tpostSynapses.add(synapse);\n\t\t\tpreSynapses.add(synapse);\n\n\t\t\tpreNeuron.setPostSynapses(postSynapses);\n\t\t\tpostNeuron.setPreSynapses(preSynapses);\n\n\t\t\t/* Add the synapse to the list. */\n\t\t\tsynapses.add(synapse);\n\t\t}\n\n\t\t/* Create the network. */\n\t\tthis.mnetwork = new MNetwork(neurons, synapses);\n\n\t\t/* Create and set the simulation configuration parameters. */\n\t\tsimConfig = new MSimulationConfig(20);\n\n\t\t/* Create the simulation instance with our network. */\n\t\tthis.msimulation = new MSimulation(this.mnetwork, simConfig);\n\t}", "public static void Pubmed() throws IOException \n\t{\n\t\t\n\t\tMap<String,Map<String,List<String>>> trainset = null ; \n\t\t//Map<String, List<String>> titles = ReadXMLFile.ReadCDR_TestSet_BioC() ;\n\t File fFile = new File(\"F:\\\\TempDB\\\\PMCxxxx\\\\articals.txt\");\n\t List<String> sents = readfiles.readLinesbylines(fFile.toURL()); \n\t\t\n\t\tSentinfo sentInfo = new Sentinfo() ; \n\t\t\n\t\ttrainset = ReadXMLFile.DeserializeT(\"F:\\\\eclipse64\\\\eclipse\\\\TrainsetTest\") ;\n\t\tLinkedHashMap<String, Integer> TripleDict = new LinkedHashMap<String, Integer>();\n\t\tMap<String,List<Integer>> Labeling= new HashMap<String,List<Integer>>() ;\n\t\t\n\t\tMetaMapApi api = new MetaMapApiImpl();\n\t\tList<String> theOptions = new ArrayList<String>();\n\t theOptions.add(\"-y\"); // turn on Word Sense Disambiguation\n\t theOptions.add(\"-u\"); // unique abrevation \n\t theOptions.add(\"--negex\"); \n\t theOptions.add(\"-v\");\n\t theOptions.add(\"-c\"); // use relaxed model that containing internal syntactic structure, such as conjunction.\n\t if (theOptions.size() > 0) {\n\t api.setOptions(theOptions);\n\t }\n\t \n\t\t\n\t\tif (trainset == null )\n\t\t{\n\t\t\ttrainset = new HashMap<String, Map<String,List<String>>>();\n\t\t}\n\t\t\n\t\t\n\t\t/************************************************************************************************/\n\t\t//Map<String, Integer> bagofwords = semantic.getbagofwords(titles) ; \n\t\t//trainxmllabeling(trainset,bagofwords); \n\t\t/************************************************************************************************/\n\t\t\n\t\t\n\t\tint count = 0 ;\n\t\tint count1 = 0 ;\n\t\tModel candidategraph = ModelFactory.createDefaultModel(); \n\t\tMap<String,List<String>> TripleCandidates = new HashMap<String, List<String>>();\n\t\tfor(String title : sents)\n\t\t{\n\t\t\t\n\t\t\tModel Sentgraph = sentInfo.graph;\n\t\t\tif (trainset.containsKey(title))\n\t\t\t\tcontinue ; \n\t\t\t//8538\n\t\t\tcount++ ; \n\n\t\t\tMap<String, List<String>> triples = null ;\n\t\t\t// get the goldstandard concepts for current title \n\t\t\tList<String> GoldSndconcepts = new ArrayList<String> () ;\n\t\t\tMap<String, Integer> allconcepts = null ; \n\t\t\t\n\t\t\t// this is optional and not needed here , it used to measure the concepts recall \n\t\t\tMap<String, List<String>> temptitles = new HashMap<String, List<String>>(); \n\t\t\ttemptitles.put(title,GoldSndconcepts) ;\n\t\t\t\t\t\t\n\t\t\t// get the concepts \n\t\t\tallconcepts = ConceptsDiscovery.getconcepts(temptitles,api);\n\t\t\t\n\t\t\tArrayList<String> RelInstances1 = SyntaticPattern.getSyntaticPattern(title,allconcepts,FILE_NAME_Patterns) ;\n\t\t\t//Methylated-CpG island recovery assay: a new technique for the rapid detection of methylated-CpG islands in cancer\n\t\t\tif (RelInstances1 != null && RelInstances1.size() > 0 )\n\t\t\t{\n\t\t\t\tcount1++ ;\n\t\t\t\tTripleCandidates.put(title, RelInstances1) ;\n\t\t\t\t\n\t\t\t\tif (count1 == 30)\n\t\t\t\t{\n\t\t\t\t\tReadXMLFile.Serialized(TripleCandidates,\"F:\\\\eclipse64\\\\eclipse\\\\Relationdisc1\") ;\n\t\t\t\t\tcount1 = 0 ;\n\t\t\t\t}\n\t\t\t}\n \n\t\t}\n\t\t\n\t\tint i = 0 ;\n\t\ti++ ; \n\t}", "public StringDt addSynonym() {\n\t\tStringDt newType = new StringDt();\n\t\tgetSynonym().add(newType);\n\t\treturn newType; \n\t}", "public static void demo_SimilarityMetrics(RoWordNet RoWN, String textCorpus_FilePath) throws Exception {\n boolean allowAllRelations = true;\n\n Literal l1 = new Literal(\"salvare\");\n Literal l2 = new Literal(\"dotare\");\n String id1 = RoWN.getSynsetsFromLiteral(l1).get(0).getId();\n String id2 = RoWN.getSynsetsFromLiteral(l2).get(0).getId();\n Synset s1, s2;\n\n s1 = RoWN.getSynsetById(id1);\n s2 = RoWN.getSynsetById(id2);\n\n IO.outln(\"Computed IC for synset_1: \" + s1.getInformationContent());\n IO.outln(\"Computed IC for synset_2: \" + s2.getInformationContent());\n IO.outln(\"Custom distance: \" + SimilarityMetrics.distance(RoWN, s1\n .getId(), s2.getId(), true, null));\n IO.outln(\"Custom hypernymy distance: \" + SimilarityMetrics\n .distance(RoWN, s1.getId(), s2.getId()));\n\n IO.outln(\"Sim Resnik: \" + SimilarityMetrics.Resnik(RoWN, s1.getId(), s2\n .getId(), allowAllRelations));\n IO.outln(\"Sim Lin: \" + SimilarityMetrics.Lin(RoWN, s1.getId(), s2\n .getId(), allowAllRelations));\n IO.outln(\"Sim JCN: \" + SimilarityMetrics.JiangConrath(RoWN, s1.getId(), s2\n .getId(), allowAllRelations));\n IO.outln(\"Dist JCN: \" + SimilarityMetrics\n .JiangConrath_distance(RoWN, s1.getId(), s2.getId(), allowAllRelations));\n }", "static private ArrayList<Term> getAlignedTerms(DataManager manager, ThesaurusTerms oldThesaurus, ThesaurusTerms newThesaurus)\r\n\t{\r\n\t\t// Gather up references to old terms\r\n\t\tHashMap<Integer,Term> oldTerms = new HashMap<Integer,Term>();\r\n\t\tfor(Term term : oldThesaurus.getTerms())\r\n\t\t\toldTerms.put(term.getId(), term);\r\n\t\t\r\n\t\t// Clear out all duplicate associated elements\r\n\t\tfor(Term term : newThesaurus.getTerms())\r\n\t\t{\r\n\t\t\t// Identify the list of non-duplicated elements\r\n\t\t\tArrayList<AssociatedElement> synonyms = new ArrayList<AssociatedElement>();\r\n\t\t\tELEMENT_LOOP: for(AssociatedElement element : term.getElements())\r\n\t\t\t{\r\n\t\t\t\t// Add synonym\r\n\t\t\t\tAssociatedElement synonym = getSynonym(element.getName(),synonyms);\r\n\t\t\t\tif(synonym!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(element.getDescription()!=null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Add description if unique\r\n\t\t\t\t\t\tString description = synonym.getDescription();\r\n\t\t\t\t\t\tfor(String descriptionPart : description.split(\"\\\\|\"))\r\n\t\t\t\t\t\t\tif(element.getDescription().equals(descriptionPart)) continue ELEMENT_LOOP;\r\n\t\t\t\t\t\tsynonym.setDescription(description + \"|\" + element.getDescription().replaceAll(\"|\",\"\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse synonyms.add(element);\r\n\t\t\t}\r\n\r\n\t\t\t// Update the elements if duplicates were found\r\n\t\t\tif(term.getElements().length!=synonyms.size())\r\n\t\t\t\tterm.setElements(synonyms.toArray(new AssociatedElement[0]));\r\n\t\t}\r\n\t\t\r\n\t\t// Align terms while adjusting term name changes\r\n\t\tArrayList<Term> alignedTerms = new ArrayList<Term>();\r\n\t\tfor(Term term : newThesaurus.getTerms())\r\n\t\t{\r\n\t\t\t// Set the aligned term\r\n\t\t\tTerm oldTerm = oldTerms.get(term.getId());\r\n\t\t\tif(oldTerm==null) term.setId(null);\r\n\t\t\tfor(AssociatedElement element : term.getElements())\r\n\t\t\t{\r\n\t\t\t\tboolean elementExists = false;\r\n\t\t\t\tif(oldTerm!=null)\r\n\t\t\t\t\tfor(AssociatedElement oldElement : oldTerm.getElements())\r\n\t\t\t\t\t\tif(oldElement.getElementID().equals(element.getElementID()))\r\n\t\t\t\t\t\t\telementExists = true;\r\n\t\t\t\tif(!elementExists) element.setElementID(null);\r\n\t\t\t}\r\n\t\t\talignedTerms.add(term);\r\n\t\t}\r\n\t\treturn alignedTerms;\r\n\t}", "public void GenSetAnnotation(List<String> symb) throws Exception {\t\t\n\t\tString module = \"GS_\"+((int)(Math.random()*10000));\n\t\tSystem.out.println(\"Your module name is: \"+module);\n\t\tString workspace = \"results/\";\n\n\t\tFile dossier = new File(workspace);\n\t\tif(!dossier.exists()){\n\t\t\tdossier.mkdir();\n\t\t}\n\n\t\t\n\t\tStringBuffer plossb = new StringBuffer();\n\n\t\tplossb.append(\"SS\\tModule\\tCoverGenes\\tNumTerms\\tGNTotal\\n\");\n\t\t\n\t\t\tString sub = \"GO:0008150\";\n//\t\t\tfor( String sub: this.go.subontology.keySet()) {\n\t\t\t\tSystem.out.println(\"####### SubOntology : \" +sub );\n\t\t\t\tString statfolder = workspace+\"newBriefings_Incomplete/OwnModules/\"+module+\"/is_a/\";\n\n\t\t\t\tdossier = new File(statfolder);\n\t\t\t\tif(!dossier.exists()){\n\t\t\t\t\tdossier.mkdir();\n\t\t\t\t}\n\n\t\t\t\tSet<String> terminosinc = new HashSet<String>(this.goa.getTerms(symb, sub,go)); // Get terms to GOA with removed incomplete terms \n\n\t\t\t\tString export = statfolder+ this.go.allStringtoInfoTerm.get(sub).toName(); // url folder to save the information\n\n\t\t\t\tArrayList<String> listTerm = new ArrayList<String>(terminosinc); // change to list the terms set\n\n\t\t\t\tWrite.exportSSM(go, sub, this.goa,listTerm, symb,export+\"/SemanticMatrix\"); // computed and export the semantic similarity\n\n\t\t\t\tString[] methods = {\"DF\",\"Ganesan\",\"LC\",\"PS\",\"Zhou\",\"Resnik\",\"Lin\",\"NUnivers\",\"AIC\"};\n\t\t\t\t\n\t\t\t\tRepresentative.onemetric(module, ic,sub,methods, \"average\", new HashSet<String>(symb), export+\"/SemanticMatrix\", export, go, listTerm,this.goa,\n\t\t\t\t\t\ttailmin,RepCombinedSimilarity,precision,nbGeneMin);\n\n\t\t\t\n\t\t\tfor(String t : this.go.allStringtoInfoTerm.keySet()) {\n\t\t\t\tthis.go.allStringtoInfoTerm.get(t).geneSet.clear();\n\t\t\t}\n//\t\t}\n\t\t\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\r\npublic static void ruleResolvePronouns(AnnotationSet basenp, Document doc)\r\n{\n Annotation[] basenpArray = basenp.toArray();\r\n\r\n // Initialize coreference clusters\r\n int maxID = basenpArray.length;\r\n\r\n // Create an array of pointers\r\n // clust = new UnionFind(maxID);\r\n fvm = new RuleResolvers.FeatureVectorMap();\r\n ptrs = new int[maxID];\r\n clusters = new HashSet[maxID];\r\n for (int i = 0; i < clusters.length; i++) {\r\n ptrs[i] = i;\r\n HashSet<Annotation> cluster = new HashSet<Annotation>();\r\n cluster.add(basenpArray[i]);\r\n clusters[i] = cluster;\r\n }\r\n Annotation zero = new Annotation(-1, -1, -1, \"zero\");\r\n\r\n for (int i = 1; i < basenpArray.length; i++) {\r\n Annotation np2 = basenpArray[i];\r\n if (FeatureUtils.isPronoun(np2, doc)) {\r\n Annotation ant = ruleResolvePronoun(basenpArray, i, doc);\r\n if (ant != null) {\r\n np2.setProperty(Property.PRO_ANTES, ant);\r\n }\r\n else {\r\n np2.setProperty(Property.PRO_ANTES, zero);\r\n }\r\n }\r\n }\r\n}", "protected Query newSynonymQuery(String field, TermAndBoost[] terms) {\n SynonymQuery.Builder builder = new SynonymQuery.Builder(field);\n for (TermAndBoost t : terms) {\n builder.addTerm(t.term, t.boost);\n }\n return builder.build();\n }" ]
[ "0.70553553", "0.7005798", "0.6661012", "0.6593528", "0.6583588", "0.6492693", "0.6431627", "0.63908017", "0.6351848", "0.6329908", "0.6317089", "0.61855215", "0.61753905", "0.61698085", "0.6163139", "0.6152639", "0.61287355", "0.6120794", "0.6103239", "0.6099475", "0.6089946", "0.6077439", "0.6068867", "0.5998979", "0.5974723", "0.5966881", "0.59593993", "0.5954539", "0.5950785", "0.594847", "0.5927091", "0.59258235", "0.59237677", "0.5910238", "0.58810085", "0.5857689", "0.58561915", "0.5852715", "0.58465505", "0.58093774", "0.5770024", "0.5761154", "0.5721858", "0.57019526", "0.5696898", "0.56878227", "0.565401", "0.5650807", "0.5643837", "0.56401783", "0.5626757", "0.5613622", "0.5604383", "0.55990577", "0.5592584", "0.5583431", "0.55754596", "0.5557052", "0.55478764", "0.5543565", "0.55333155", "0.5531714", "0.5510076", "0.5477073", "0.5447076", "0.54462105", "0.54429567", "0.542093", "0.5410008", "0.53983504", "0.5367099", "0.5365346", "0.5328441", "0.5317955", "0.53152543", "0.5298494", "0.52832097", "0.5278453", "0.5277754", "0.5232809", "0.5217082", "0.5215579", "0.5210682", "0.5173656", "0.5170069", "0.5142396", "0.5138666", "0.5134371", "0.5132019", "0.50981575", "0.50974345", "0.50871336", "0.5082942", "0.5075921", "0.5060792", "0.5059869", "0.5059688", "0.50590307", "0.50537854", "0.5050806" ]
0.5693848
45
FIXME: how to implement?
public void filterBy(Map<String, List<String>> queryMap) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "protected abstract Set method_1559();", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n protected void prot() {\n }", "@Override public int describeContents() { return 0; }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void method_4270() {}", "protected boolean func_70814_o() { return true; }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tprotected void parseResult() {\n\t\t\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public abstract void mo70713b();", "public void gored() {\n\t\t\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\r\n\tpublic void init() {}", "public void identify() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void smell() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public int describeContents() {\n// ignore for now\n return 0;\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tpublic void accept(Visitor visitor) {\n\t\t\n\t}", "Object getXtrf();", "Object getXtrf();", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\n public void init() {\n }", "@Override\n public void init() {\n\n }", "public abstract String mo118046b();", "public abstract void mo56925d();", "@Override\n void init() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "public abstract String mo41079d();", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n public void init() {}", "public abstract Object mo26777y();", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void interpretBytes() {\n\t\t\n\t}", "Object getXtrc();", "Object getXtrc();", "public abstract String mo13682d();", "@Override\n public void apply() {\n }", "public abstract void mo6549b();", "@Override\r\n\tpublic void init() {\n\r\n\t}" ]
[ "0.57258755", "0.5722925", "0.57130426", "0.565459", "0.5607843", "0.5595222", "0.55532455", "0.5502495", "0.54554427", "0.5433953", "0.540684", "0.53967947", "0.53852034", "0.53852034", "0.5370665", "0.5339407", "0.5334167", "0.53265315", "0.531918", "0.53055227", "0.5295119", "0.5294367", "0.5287444", "0.5282282", "0.5252618", "0.52431595", "0.5237349", "0.52291644", "0.52291644", "0.5220463", "0.52124083", "0.52060115", "0.5202304", "0.51972884", "0.5194807", "0.51892364", "0.5166009", "0.5144834", "0.5126931", "0.51257783", "0.51210886", "0.5114181", "0.51140183", "0.5108549", "0.5103107", "0.50875926", "0.5084291", "0.5082568", "0.5071075", "0.5070835", "0.5062754", "0.5061429", "0.5061429", "0.5061429", "0.5061429", "0.5061429", "0.50438154", "0.50366336", "0.50297284", "0.5028218", "0.502728", "0.5023543", "0.5023259", "0.5022636", "0.50205964", "0.50205964", "0.50205964", "0.5020154", "0.5019346", "0.5019346", "0.50121385", "0.501084", "0.500939", "0.50065136", "0.5001719", "0.49999994", "0.49999994", "0.49986562", "0.49986082", "0.4997255", "0.49946707", "0.499098", "0.4990265", "0.49873948", "0.49764892", "0.4971243", "0.49655128", "0.49605605", "0.49605605", "0.49556786", "0.49544486", "0.4951363", "0.49474517", "0.49474517", "0.49459285", "0.4941154", "0.4941154", "0.49350184", "0.4934832", "0.4933707", "0.49240783" ]
0.0
-1
this.i = in.readInt(); this.s = (String) in.readObject();
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {\n in.defaultReadObject();\n company = in.readUTF();\n // Just for test static member\n company = \"pica8_from_serialization\";\n password = encryptor.xor(in.readUTF());\n }", "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException\n {\n // TODO - temp?\n }", "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException\r\n\t{\r\n\t\tthis.deserialize(in);\r\n\t}", "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n\t\tname = in.readUTF();\n\t\tdesc = (String[]) in.readObject();\n\t\tmembers = (Members) in .readObject();\n\t\tbanlist = (List<UUID>) in .readObject();\n\t\tterritoryIds = (List<String>) in .readObject();\n\t\tinvite = in.readBoolean();\n\t}", "private void readObject(ObjectInputStream in)\n\tthrows IOException, ClassNotFoundException\n {\n\tin.defaultReadObject();\n\tservID = new ServiceID(in);\n }", "private void readObject(java.io.ObjectInputStream s)\r\n throws java.io.IOException, ClassNotFoundException {\r\n // Read in any hidden serialization magic\r\n s.defaultReadObject();\r\n\r\n // Read in size\r\n int size = s.readInt();\r\n\r\n // Initialize header\r\n//INSTRUMENTATION BEGIN\r\n //header = new Entry(null, null, null);\r\n header = new Entry(null, null, null, this);\r\n//INSTRUMENTATION END\r\n header.next = header.previous = header;\r\n\r\n // Read in all elements in the proper order.\r\n for (int i = 0; i < size; i++)\r\n add(s.readObject());\r\n }", "void readObject(InputSerializer in) throws java.io.IOException;", "private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {\n in.defaultReadObject();\n\n _firstTime = true;\n _isReset = false;\n }", "private void readObject(ObjectInputStream s) throws IOException,\n\t\t\tClassNotFoundException {\n\t\ts.defaultReadObject();\n\t\t// Read in size\n\t\tint size = s.readInt();\n\t\t// Read in all elements\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tadd((Statement) s.readObject());\n\t\t}\n\t}", "String read();", "String read();", "@Override\n\tpublic void readExternal(ObjectInput in) throws IOException,\n\t\t\tClassNotFoundException {\n\t\t\n\t\tname = (String) in.readObject();\n\t\ti = in.readInt();\n\t\t\n\t}", "String readString();", "public String receiveString(){\n\t\ttry{\n\t\t\tString s = (String) in.readObject();\n\t\t\tSystem.out.println(\"Empfange Nachricht \" + s);\n\t\t\treturn s;\n\t\t} catch (ClassNotFoundException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic Object readObject() {\n\t\treturn super.readObject();\n\t}", "private void readObject(ObjectInputStream inStream) \r\n\t\t\tthrows IOException, ClassNotFoundException {\r\n\t\tmPublicKey = (String)inStream.readObject();\r\n\t\tmIssuer = (String)inStream.readObject();\r\n\t\tmSubject = (String)inStream.readObject();\r\n\t}", "ObjectInputStream newObjectInputStream(InputStream in) throws Exception;", "protected void unserialize(InputStream paramInputStream) throws IOException {\n/* 336 */ this.m_index_ = new char[this.m_dataOffset_];\n/* 337 */ DataInputStream dataInputStream = new DataInputStream(paramInputStream);\n/* 338 */ for (byte b = 0; b < this.m_dataOffset_; b++) {\n/* 339 */ this.m_index_[b] = dataInputStream.readChar();\n/* */ }\n/* */ }", "public void startReader() throws Exception{\n byte[] buf = new byte[8];\n buf[0] = (byte) 0x02;\n buf[1] = (byte)0x08;\n buf[2] = (byte)0xB0;\n buf[3] = (byte) 0x00;\n buf[4] = (byte) 0x00;\n buf[5] = (byte) 0x00;\n buf[6] = (byte) 0x00;\n CheckSum(buf,(byte) buf.length);\n OutputStream outputStream = socket.getOutputStream();\n outputStream.write(buf);\n\n InputStream in = socket.getInputStream();\n System.out.println(in.available());\n if (in.available() == 0){\n System.out.println(\"null\");\n }else {\n byte[] bytes = new byte[8];\n in.read(bytes);\n CheckSum(bytes,(byte)8);\n String str = toHex(bytes);\n //String[] str1 = str.split(\"\");\n //ttoString(str1);\n System.out.println(str);\n }\n\n\n\n /*byte[] by2 = new byte[17];\n in.read(by2);\n String str2 = toHex(by2);\n String[] str4 = str2.split(\"\");\n String[] str5 = new String[getInt(str4)];\n System.arraycopy(str4,0,str5,0,getInt(str4));\n if(getInt(str4)>3)\n System.out.println(ttoString(str5));\n set = new HashSet();\n set.add(ttoString(str5));\n list = new ArrayList(set);\n System.out.println(list);*/\n }", "private void method_158(ObjectInputStream var1) {\n var1.defaultReadObject();\n this.a((Collection)var1.readObject());\n }", "public void readObject (ObjectInputStream in)\n throws IOException\n {\n int topSlots = in.readByte();\n long flips = in.readLong();\n long balls = in.readLong();\n long holes = in.readLong();\n\n populate(topSlots, flips, balls, holes);\n }", "public void read(DataInputStream in) throws IOException;", "private void readObject(java.io.ObjectInputStream in) throws NotSerializableException {\n throw new NotSerializableException(\"Not serializable.\");\n }", "public void deserialize(JoyBuffer in) {\n\t\t\n\t}", "public String read();", "@SuppressWarnings(\"unchecked\")\r\n private void readObject(java.io.ObjectInputStream s)\r\n throws java.io.IOException, ClassNotFoundException {\r\n // Read in any hidden serialization magic\r\n s.defaultReadObject();\r\n\r\n // Read in HashMap capacity and load factor and create backing HashMap\r\n // int capacity = s.readInt();\r\n // float loadFactor = s.readFloat();\r\n this.map = new HashMap<Integer, E>();\r\n\r\n // Read in size\r\n int size = s.readInt();\r\n\r\n // Read in all elements in the proper order.\r\n for (int i = 0; i < size; i++) {\r\n E e = (E) s.readObject();\r\n this.map.put(e.hashCode(), e);\r\n }\r\n }", "private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {\n ois.defaultReadObject();\n /*if(serializeEverything)\n {\n //cardPower = (List<CardPower>)ois.readObject();\n weapons = (List<CardWeapon>)ois.readObject();\n points = ois.readInt();\n }\n else{*/\n weapons = new ArrayList<>();\n //}\n }", "public static void main(String [] args) throws IOException {\n String hostName = \"localhost\";\n int portNumber = 1234;\n Socket socket = new Socket(hostName, portNumber);\n ObjectInputStream in =\n new ObjectInputStream(socket.getInputStream());\n ObjectOutputStream out =\n new ObjectOutputStream(socket.getOutputStream());\n TestSerial ts = null;\n\n BufferedReader stdIn =\n new BufferedReader(new InputStreamReader(System.in));\n\n try {\n ts = (TestSerial) in.readObject();\n\n } catch (ClassNotFoundException cnf) {\n cnf.printStackTrace();\n }\n\n String fromServer = ts.getStringField();\n\n while ( fromServer != null ) {\n System.out.println(\"Server: \" + fromServer);\n if ( fromServer.equals(\"Bye.\") ) {\n break;\n }\n String fromUser = stdIn.readLine();\n if ( fromUser != null ) {\n System.out.println(\"Client: \" + fromUser);\n out.writeObject(new TestSerial(fromUser));\n out.flush();\n }\n try {\n ts = (TestSerial) in.readObject();\n } catch( ClassNotFoundException cnf ) {\n cnf.printStackTrace();\n }\n\n fromServer = ts.getStringField();\n }\n\n //Test comment for git stuff\n // And a follow-up comment!\n\n // the commented-out code below was part of the original code\n // which simply passed strings back and forth over the network\n// try (\n// Socket socket = new Socket(hostName , portNumber );\n// PrintWriter out =\n// new PrintWriter(socket.getOutputStream (), true);\n// BufferedReader in =\n// new BufferedReader(\n// new InputStreamReader(socket.getInputStream ())\n// );\n// )\n// {\n// BufferedReader stdIn =\n// new BufferedReader(new InputStreamReader(System.in));\n// String fromServer = in.readLine ();\n// while(fromServer != null) {\n// System.out.println(\"Server: \" + fromServer );\n// if(fromServer.equals(\"Bye.\")) { break; }\n// String fromUser = stdIn.readLine ();\n// if(fromUser != null) {\n// System.out.println(\"Client: \" + fromUser );\n// out.println(fromUser );\n// }\n// fromServer = in.readLine ();\n// }\n// }\n }", "private void method_278(ObjectInputStream var1) {\n var1.defaultReadObject();\n this.a = (Map)var1.readObject();\n }", "protected String readString(DataInput in) throws IOException {\n if (in.readBoolean())\n return (in.readUTF());\n return null;\n }", "String objectRead();", "private void readObject(ObjectInputStream paramObjectInputStream) throws IOException, ClassNotFoundException {\n/* 91 */ paramObjectInputStream.defaultReadObject();\n/* 92 */ this.types = null;\n/* */ }", "public void readExternal(ObjectInput in) throws IOException, FileNotFoundException, ClassNotFoundException{\n\t\tSystem.out.println(\"Inside readExternal()\");\n\t\tthis.age = in.readInt();\n\t\tthis.name = (String) in.readObject();\n\t\tthis.address = (String) in.readObject();\n\t\tthis.job = (String) in.readObject();\n\t}", "@Override\n\tpublic void readFields(DataInput in) throws IOException {\n\t\tbytes = in.readInt();\n\t\tbuffer = new byte[bytes];\n\t\tint num = 0;\t\t\n\t\twhile(num < bytes){\n\t\t\tbuffer[num] = in.readByte();\n\t\t\tnum++;\n\t\t}\n\t}", "private Artikel liesArtikel(ObjectInputStream ois) throws IOException, ClassNotFoundException {\n \n try {\n return (Artikel) ois.readObject();\n\n \n } catch (EOFException exc) {\n return null;\n }\n \n \n }", "@Override\r\n\tpublic void read(DataInput in) throws IOException {\n\t\t\r\n\t}", "@SuppressWarnings({\"unchecked\"})\n private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n /** Response string */\n this.responseString = (String) in.readObject();\n\n /** Code */\n this.code = in.readInt();\n\n /** Response headers */\n final Map headers = (Map) in.readObject();\n this.headers.clear();\n this.headers.putAll(headers);\n\n /** Response body */\n final byte[] body = (byte[]) in.readObject();\n //System.out.println(\"[] body \"+body.length );\n sosi = new ServletByteArrayOutputStream();\n sosi.write(body);\n writer = new PrintWriter(sosi);\n\n }", "private static InPacket deserializePacket(ByteArrayDataInput in)\n\t\t\tthrows IOException\n\t{\n\t\tbyte id = in.readByte();\n\t\tint len = in.readInt();\n\t\tbyte[] array = new byte[len];\n\t\tin.readFully(array);\n\n\t\treturn deserializeRawPacket(id, array);\n\t}", "protected abstract Object read ();", "void deserialize(@NotNull InputStream in) throws IOException;", "private void readObject(ObjectInputStream ois)\n throws IOException, ClassNotFoundException {\n ois.defaultReadObject();\n myhash = -1;\n timestamp = new Date(timestamp.getTime());\n }", "private void readObject(ObjectInputStream s) throws InvalidObjectException {\n throw new InvalidObjectException(\"Deserialization via serialization delegate\");\n }", "InputStream deserialize(InputStream toDeserialize);", "private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {\n\t\tois.defaultReadObject(); // Calling the default deserialization logic\n\n\t}", "private void readObject(ObjectInputStream os) throws IOException, ClassNotFoundException {\n \t// rebuild this object\n \tos.defaultReadObject();\n \tthis.stat = new EdgeStat(this.edgeId);\n \tthis.curPackets = new ArrayList<ITransmissible>();\n }", "private void readObject(\n\t\tObjectInputStream aInputStream\n \t\t) throws ClassNotFoundException, IOException {\n \t\taInputStream.defaultReadObject();\n \t}", "private void readObject(java.io.ObjectInputStream s)\n throws java.lang.ClassNotFoundException,\n\t java.io.IOException\n {\n s.defaultReadObject();\n if (pointSize == 0) {\n\t\tpointSize = (float)size;\n \t }\n width = 1f; // init transient field\n initializeFont(fRequestedAttributes);\n }", "@Override\n\tpublic void read(InStream inStream) {\n\t}", "public void deserialize() {\n\t\t\n\t}", "@Override\r\n\tprotected Object readObject() throws IOException, SerializeException {\r\n\t\treturn AdvancedDeserializerUtil.readObject(super.readObject());\r\n\t}", "private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {\n throw new NotSerializableException();\n }", "public void read(DataInput in) throws IOException {\r\n int size = in.readInt();\r\n\r\n buffer = new byte[size];\r\n in.readFully(buffer);\r\n }", "private void readObject() {}", "private void readObject() {}", "private void readObject() {}", "private void readObject (java.io.ObjectInputStream in) throws IOException {\n message(AX_PROGRESS,\"Deserialize activeX control\");\n try {\n in.defaultReadObject();\n long length = in.readLong();\n message(AX_PROGRESS, \"Read the size of COM storage: \" + length);\n String componentFileName = generateComponentFileName(\"x1p\");\n if (length > 0) {\n FileOutputStream fi = new FileOutputStream(componentFileName);\n byte[] buffer = new byte[1024];\n long sofar = 0;\n int num = -1;\n int bytesToRead = 0;\n\n /* The storage file could be many Megs so work in 1K chunks */\n while (sofar < length) {\n /* don't read more than we wrote */\n bytesToRead = (int)Math.min(1024, length - sofar);\n num = in.read(buffer, 0, bytesToRead);\n if (num < 0 ) {\n message(AX_ERROR,\n \"Unexpectedly encountered the end of the serialization stream\");\n break;\n }\n \n sofar += num;\n fi.write(buffer, 0, num);\n } \n\n fi.close();\n message(AX_PROGRESS, \"Created a \" + sofar + \" byte storage file.\");\n }\n boolean libraryIsLoaded = NativeMethodBroker.loadLibrary();\n if (!libraryIsLoaded) {\n throw new IOException(\"Could not locate JavaContainer dynamic library\");\n }\n \n messagesWaiting = new ThreadRequestQueue();\n if (length > 0) {\n loaded = true;\n fileLoadedFrom = componentFileName;\n }\n transientEventSets = new Hashtable();\n }\n catch (ClassNotFoundException e) {\n throw new IOException(e.toString());\n }\n }", "public abstract Object decode(InputStream is) ;", "@Override\n public void read(DataInput in) throws IOException {\n int cordinatesSize = in.readInt();\n\n ByteArrayInputStream bi = new ByteArrayInputStream(b.toByteArray());\n ObjectInputStream o = new ObjectInputStream(bi);\n\n for(Coordinate coordinate : cordinates){\n try {\n coordinate = (Coordinate)o.readObject();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }\n\n\n }", "@Deprecated\n\tprivate void readObject(final java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {\n\t\t// Reset all nonread objects.\n\t\t/*\n\t\t * resetForLoad();\n\t\t *\n\t\t * // Do the reading in of objects. int version = in.readInt(); if\n\t\t * (version >= 0) { // Adjust by version. // The reading for version 0\n\t\t * of this object. Set s = (Set) in.readObject(); Iterator it =\n\t\t * s.iterator(); while (it.hasNext()) addState((State) it.next());\n\t\t *\n\t\t * initialState = (State) in.readObject(); finalStates = (Set)\n\t\t * in.readObject(); // Let the class take care of the transition stuff.\n\t\t * Set trans = (Set) in.readObject(); it = trans.iterator(); while\n\t\t * (it.hasNext()) addTransition((Transition) it.next()); if (this\n\t\t * instanceof TuringMachine) { ((TuringMachine) this).tapes =\n\t\t * in.readInt(); } } while (!in.readObject().equals(\"SENT\")) ; // Read\n\t\t * until sentinel.\n\t\t */\n\t}", "@Override\n\tpublic void readFields(DataInput in) throws IOException {\n\t\tthis.id=in.readInt();\n\t\tthis.date=in.readUTF();\n\t\tthis.pid=in.readUTF();\n\t\tthis.amount=in.readInt();\n\t\tthis.name=in.readUTF();\n\t\tthis.category_id=in.readUTF();\n\t\tthis.price=in.readInt();\n\t\tthis.flag=in.readUTF();\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t}", "public Object read();", "public int readInt() throws IOException {\n return in.readInt();\n }", "private void readObject(ObjectInputStream in)\n/* */ throws IOException\n/* */ {\n/* 912 */ String description = in.readUTF();\n/* */ ULocale loc;\n/* */ try\n/* */ {\n/* 916 */ loc = (ULocale)in.readObject();\n/* */ } catch (Exception e) {\n/* 918 */ loc = ULocale.getDefault(ULocale.Category.FORMAT);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 925 */ RuleBasedNumberFormat temp = new RuleBasedNumberFormat(description, loc);\n/* 926 */ this.ruleSets = temp.ruleSets;\n/* 927 */ this.defaultRuleSet = temp.defaultRuleSet;\n/* 928 */ this.publicRuleSetNames = temp.publicRuleSetNames;\n/* 929 */ this.decimalFormatSymbols = temp.decimalFormatSymbols;\n/* 930 */ this.decimalFormat = temp.decimalFormat;\n/* 931 */ this.locale = temp.locale;\n/* */ }", "void readFrom(DataInputStream din) throws IOException {\r\n throw new Error(\"Method no longer available\");\r\n// commit_id = din.readInt();\r\n// table_id = din.readInt();\r\n//// if (table_id != din.readInt()) {\r\n//// throw new IOException(\r\n//// \"'table id' in given format is not the same. Does this journal \" +\r\n//// \"really belong to another table?\");\r\n//// }\r\n// journal_entries = din.readInt();\r\n// command_journal = new byte[journal_entries];\r\n// din.readFully(command_journal, 0, journal_entries);\r\n// int size = din.readInt();\r\n// for (int i = 0; i < size; ++i) {\r\n// command_parameters.addInt(din.readInt());\r\n// }\r\n }", "@Override\n public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { in.readByte(); // version\n type = in.readUTF();\n subType = in.readUTF();\n // allow for more data from future version\n int extra = in.readShort();\n if (extra > 0) {\n byte[] extraBytes = new byte[extra];\n in.read(extraBytes, 0, extra);\n }\n }", "String intRead();", "OutputStream read(String id);", "int readInt();", "private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {\n/* 210 */ stream.defaultReadObject();\n/* 211 */ this.store = new TreeMap();\n/* 212 */ int keyCount = stream.readInt();\n/* 213 */ for (int i = 0; i < keyCount; i++) {\n/* 214 */ Comparable key = (Comparable)stream.readObject();\n/* 215 */ Stroke stroke = SerialUtilities.readStroke(stream);\n/* 216 */ this.store.put(key, stroke);\n/* */ } \n/* */ }", "private void readObject(java.io.ObjectInputStream s)\n throws java.io.IOException, ClassNotFoundException {\n s.defaultReadObject();\n\n // Read in size (number of Mappings)\n int size = s.readInt();\n if (size < 0)\n throw new java.io.StreamCorruptedException\n (\"Illegal mappings count: \" + size);\n int cap = capacity(size);\n SharedSecrets.getJavaOISAccess().checkArray(s, Object[].class, cap);\n init(cap);\n\n // Read the keys and values, and put the mappings in the table\n for (int i=0; i<size; i++) {\n @SuppressWarnings(\"unchecked\")\n K key = (K) s.readObject();\n @SuppressWarnings(\"unchecked\")\n V value = (V) s.readObject();\n putForCreate(key, value);\n }\n }", "void read ();", "@Override\r\n\tpublic void read() {\n\r\n\t}", "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n in.defaultReadObject();\n\n // initialize non-gui transient objects\n this.trackManager = new TrackManager();\n this.trackListener = new TrackListenerImpl();\n this.trackManager.addListener(this.trackListener);\n\n System.out.println(\"eigen vector\");\n System.out.println(tempEigen);\n double eigenValue = eigen.getEigenvalue(eigen.getIndexMax()).getReal();\n double consistencyIndex = (eigenValue - eigenVector.getNumElements())/(eigenVector.getNumElements()-1);\n double consistencyRatio = consistencyIndex / 0.58;\n System.out.println(\"Eigen value: \" + eigenValue);\n System.out.println(\"Consistency Index: \" + consistencyIndex);\n System.out.println(\"Consistency Ratio: \" + consistencyRatio * 100. + \"%\");\n System.out.println(\"normalized eigen vector\");\n System.out.println(eigenVector);\n /*\n this.fusedTrackTrackManager = new TrackManager();\n this.fusedTrackTrackListener = new FusedTrackListenerImpl();\n this.fusedTrackTrackManager.addListener(this.fusedTrackTrackListener);\n */\n\n this.tracksRelations = new HashMap<>();\n this.lostBids = new HashMap<>();\n }", "abstract void read();", "private void readObject() {\n }", "public int readFromDataStream( MixedDataInputStream in )\n {\n try {\n etype = new Integer( in.readInt() );\n pad = in.readInt();\n color = in.readString( StrColor.BYTESIZE );\n name = in.readString( StrDesc.BYTESIZE );\n format = in.readString( StrFormat.BYTESIZE );\n } catch ( IOException ioerr ) {\n ioerr.printStackTrace();\n return 0;\n }\n\n return BYTESIZE;\n }", "@Override\n\tpublic void read() {\n\n\t}", "private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {\n/* 486 */ stream.defaultReadObject();\n/* 487 */ this.errorIndicatorPaint = SerialUtilities.readPaint(stream);\n/* 488 */ this.errorIndicatorStroke = SerialUtilities.readStroke(stream);\n/* */ }", "@Override\r\n\tpublic void readFields(DataInput in) throws IOException {\n\t\tthis.id = WritableUtils.readVInt(in);\r\n\t}", "private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {\n \n \t// Default de-serialization\n \tois.defaultReadObject();\n \t\n \t// Set default estimator if de-serializing an older object\n if (this.estimator == null) {\n this.estimator = EntropyEstimator.SHANNON;\n }\n }", "static String loadStream(InputStream in) throws IOException { \n\t\tint ptr = 0; \n\t\tin = new BufferedInputStream(in); \n\t\tStringBuffer buffer = new StringBuffer(); \n\t\twhile( (ptr = in.read()) != -1 ) { \n\t\t\tbuffer.append((char)ptr); \n\t\t} \n\t\treturn buffer.toString(); \n\t}", "public void _read(org.omg.CORBA.portable.InputStream istream)\r\n {\r\n value = NiveauEtudeHelper.read(istream);\r\n }", "private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {\n\t\tthreadLocalDedup = new ThreadLocal<Dedup>() {\n\t\t\t@Override\n\t\t\tprotected Dedup initialValue() {\n\t\t\t\treturn new Dedup();\n\t\t\t}\n\t\t};\n\t\tin.defaultReadObject();\n\t}", "public abstract String read_string();", "private void readObject( final ObjectInputStream ois ) \n\t\tthrows ClassNotFoundException, IOException {\n\t\tObjectInputStream.GetField fields = ois.readFields();\n\t\tstreetNumbers = (String) fields.get(\"streetNumbers\", NA );\n\t\tcity = (String) fields.get(\"city\", NA);\n\t\tstate = (StateCode) fields.get(\"state\", StateCode.NY);\n\t\tpostalCode = (String) fields.get(\"postalCode\", NA);\n\t\thashCode = fields.get(\"hashCode\", 0);\n\t}", "public void load(){\n Player temp;\n try{\n FileInputStream inputFile = new FileInputStream(\"./data.sec\");\n ObjectInputStream objectIn = new ObjectInputStream(inputFile);\n temp = (Player)objectIn.readObject();\n Arena.CUR_PLAYER = temp;\n objectIn.close();\n inputFile.close(); \n }\n catch(FileNotFoundException e ){\n System.err.print(\"data.sec not found\");\n }\n catch(IOException e){\n System.out.println(\"Error 201\");\n }\n catch(ClassNotFoundException e){\n System.out.println(\"Error 202\");\n }\n }", "GeneratedMessage deserialize(InputStream in) throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException;", "@Override\n\tpublic void readFields(DataInput in) throws IOException {\n\t\tword = in.readUTF();\n\t\ttitle = in.readUTF();\n\t}", "private void readObject(ObjectInputStream in) throws IOException,\n \t\t\tClassNotFoundException {\n \t\tin.defaultReadObject();\n \t\tlog.debug(\"GalleryFeed has been deserialized.\");\n \t}", "int readFrom(byte[] iStream, int pos, ORecordVersion version);", "private Object receive() {\n Object o = null;\n try {\n System.out.println(\"03. -- About to receive an object...\");\n o = is.readObject();\n System.out.println(\"04. <- Object received...\");\n } catch (Exception e) {\n System.out.println(\"XX. Exception Occurred on Receiving:\" + e.toString());\n }\n return o;\n }", "public void readObject (ObjectInputStream ins)\n throws IOException, ClassNotFoundException\n {\n ins.defaultReadObject();\n\n PropertySpaceHelper.readProperties(this, ins);\n }", "public void _read(org.omg.CORBA.portable.InputStream istream)\r\n {\r\n value = PropositionHelper.read(istream);\r\n }", "@Override\n public void readFrom(InputStream in) throws IOException {\n }", "public int readInt();", "@Override\n\tprotected void readDataStream(DataInputStream dataInStream) throws IOException {\n\t\tid = dataInStream.readLong();\n\t\tsuper.read(dataInStream);\n\t}", "static int readInt() throws Exception {\n\t\treturn Integer.parseInt(readString());\n\t}", "static String loadStream(InputStream in) throws IOException {\n int ptr = 0;\n in = new BufferedInputStream(in);\n StringBuffer buffer = new StringBuffer();\n while( (ptr = in.read()) != -1 ) {\n buffer.append((char)ptr);\n }\n return buffer.toString();\n }", "public String readString() throws IOException {\n return WritableUtils.readString(in);\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n FileInputStream fis =new FileInputStream(\"test.txt\");\n BufferedInputStream bis=new BufferedInputStream(fis);\n ObjectInputStream ois=new ObjectInputStream(bis);\n ArrayList<Goods> list = (ArrayList<Goods>)ois.readObject();\n for (int i = 0; i < list.size(); i++) {\n Goods goods = list.get(i);\n System.out.println(goods);\n }\n\n // Goods goods= (Goods)ois.readObject();\n // System.out.println(goods);\n ois.close();\n\n }", "public Serializable readObject(){\n Serializable loadedObject = null;\n try {\n FileInputStream fileIn = new FileInputStream(name);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n loadedObject = (Serializable) in.readObject();\n in.close();\n fileIn.close();\n System.out.println(\"Data loaded from: \"+ name);\n } \n catch (IOException i) {\n System.out.println(\"File not found.\");\n } \n catch (ClassNotFoundException c) {\n System.out.println(\"Class not found\");\n }\n return loadedObject;\n }" ]
[ "0.70164853", "0.690437", "0.67536163", "0.6683802", "0.6660507", "0.6626726", "0.65418035", "0.65146995", "0.644296", "0.6416477", "0.6416477", "0.6362086", "0.63367414", "0.6311576", "0.6265365", "0.6251602", "0.62274647", "0.6223713", "0.6217546", "0.6208432", "0.61750984", "0.6174926", "0.61699724", "0.6169788", "0.61410165", "0.61397177", "0.6128634", "0.6128586", "0.6115377", "0.6113652", "0.60771894", "0.6064218", "0.6061822", "0.60468626", "0.60420173", "0.60396624", "0.60395926", "0.6037019", "0.60192156", "0.60014325", "0.5997301", "0.59715647", "0.59709394", "0.59632796", "0.595921", "0.5953506", "0.5948379", "0.59169453", "0.58951265", "0.5882713", "0.5876337", "0.5862964", "0.5858158", "0.5858158", "0.5858158", "0.5846955", "0.58363336", "0.58298874", "0.5807889", "0.5807148", "0.57912016", "0.57875896", "0.57856053", "0.5784243", "0.578164", "0.5778732", "0.57750154", "0.57726556", "0.57524073", "0.57482284", "0.5724625", "0.5714726", "0.57094264", "0.5702074", "0.5701711", "0.56986797", "0.5688884", "0.5685176", "0.5670342", "0.56697613", "0.5665818", "0.5662977", "0.565761", "0.5629845", "0.5623424", "0.5603871", "0.5598192", "0.55951005", "0.5592766", "0.55920833", "0.5583861", "0.55804414", "0.55729", "0.55699384", "0.555301", "0.5536362", "0.5524087", "0.5522871", "0.5521713", "0.5520092", "0.5516832" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int numero; char opc = ' '; for (int i = 1; i <= 1000; i++) { System.out.println("Digite um numero: "); numero = sc.nextInt(); System.out.println("Deseja continuar?"); opc = sc.next().charAt(0); if(opc == 's' || opc == 'S') { System.out.println("Digite outro numero: "); numero = sc.nextInt(); }else { break; } } // while(x <=1000) { // System.out.println(x + " "); // x++; // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Special handling for client update packets
public void readClient(CompoundTag tag) { load(tag); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void receivedUpdateFromServer();", "@Override\n\tpublic void updateClient() {\n\t\t\n\t}", "private void sendUpdateConnectionInfo() {\n\n }", "@Override\r\n\tpublic void updateclient(Client client) {\n\t\t\r\n\t}", "public interface ClientUpdateListener {\n\n /**\n * This method notify the implementer that a message has been received\n *\n * @param message the received message from the server\n */\n void onUpdate(Message message);\n}", "private void processPacket(Packet msg, int sourceClientID)\n\t{\n\t\tif (msg.getPacketID() == 1)\n\t\t{\n\t\t\t// Position updates, broadcast to everyone else\n\t\t\tPCSPosRotUpdate posUpdate = (PCSPosRotUpdate)msg;\n\t\t\t\n\t\t\t// CSPosRotUpdate\n\t\t\t// Get the specific entity to update\n\t\t\tEntityPlayer player = (EntityPlayer) entityMap.getEntity(posUpdate.clientID, EntityPlayer.class);\n\t\t\t\n\t\t\t// If non-existant, move on (probably a stale id)\n\t\t\tif (player == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tSystem.out.printf(\"\\t Ply%d-Pos: (%f, %f, %f) - (%f, %f)\\n\", posUpdate.clientID, posUpdate.xPos, posUpdate.yPos, posUpdate.zPos, posUpdate.pitch, posUpdate.yaw);\n\t\t\tplayer.setPos(posUpdate.xPos, posUpdate.yPos, posUpdate.zPos);\n\t\t\tplayer.setVelocity(posUpdate.xVel, posUpdate.yVel, posUpdate.zVel);\n\t\t\tplayer.setOrientation(posUpdate.pitch, posUpdate.yaw);\n\t\t\tplayer.xAccel = posUpdate.xAccel;\n\t\t\tplayer.zAccel = posUpdate.zAccel;\n\t\t\t\n\t\t\tplayer.isFlying = posUpdate.isFlying;\n\t\t\tplayer.isSneaking = posUpdate.isSneaking;\n\t\t\tplayer.isSprinting = posUpdate.isSprinting;\n\t\t\t\n\t\t\tclientChannels.write(posUpdate);\n\t\t}\n\t\telse if (msg.getPacketID() == 5)\n\t\t{\n\t\t\t// Block place, handle that\n\t\t\tPCSPlaceBlock blockPlace = (PCSPlaceBlock)msg;\n\t\t\tRaycastResult lastHit = blockPlace.hitResult;\n\t\t\tBlock block = blockPlace.placingBlock;\n\t\t\t\n\t\t\t// If the block can't be placed, don't place it\n\t\t\tif(!block.canPlaceBlock(\n\t\t\t\t\tinstance.world,\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ()))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tinstance.world.setBlock(\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ(),\n\t\t\t\t\tblock);\n\t\t\tblock.onBlockPlaced(\n\t\t\t\t\tinstance.world,\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ());\n\t\t\t\n\t\t\t// Broadcast to the other players\n\t\t\t// TODO: Correct for misplaces\n\t\t\tclientChannels.write(blockPlace);\n\t\t}\n\t\telse if (msg.getPacketID() == 6)\n\t\t{\n\t\t\t// Block break, handle that\n\t\t\tPCSBreakBlock blockBreak = (PCSBreakBlock)msg;\n\t\t\tRaycastResult lastHit = blockBreak.hitResult;\n\t\t\t\n\t\t\t// Break the block, with the appropriate block callbacks being called\n\t\t\tBlock block = instance.world.getBlock(lastHit.blockX, lastHit.blockY, lastHit.blockZ);\n\t\t\tblock.onBlockBroken(instance.world, lastHit.blockX, lastHit.blockY, lastHit.blockZ);\n\t\t\tinstance.world.setBlock(lastHit.blockX, lastHit.blockY, lastHit.blockZ, Blocks.AIR);\n\t\t\t\n\t\t\t// Broadcast to the other players\n\t\t\t// TODO: Correct for mis-breaks\n\t\t\tclientChannels.write(blockBreak);\n\t\t}\n\t\telse if (msg.getPacketID() == 7)\n\t\t{\n\t\t\t// Load the requested chunk column\n\t\t\tPCLoadChunkColumn loadRequest = (PCLoadChunkColumn)msg;\n\t\t\t// Get the channel id\n\t\t\tChannelId channelId = clientToChannelId.get(sourceClientID);\n\t\t\t\n\t\t\t// No id found means stale id\n\t\t\tif (channelId == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tChannel clientChannel = clientChannels.find(channelId);\n\t\t\t\n\t\t\t// Null channel means stale id\n\t\t\tif (clientChannel == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t// Send back the chunk column\n\t\t\tif (sendChunkColumnTo(loadRequest.columnX, loadRequest.columnZ, clientChannel))\n\t\t\t{\n\t\t\t\t// TODO: Queue up requests\n\t\t\t\tSystem.out.println(\"Fulfilled rq for \" + loadRequest.columnX + \", \" + loadRequest.columnZ + \" to Ply\" + sourceClientID);\n\t\t\t\t// Flush pending requests\n\t\t\t\tclientChannel.flush();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void onPacket(JPackectX packet) {\r\n System.out.println(\"Packet Received:\\n\\t\" + packet.toString());\r\n if (packet.getType() == JPacketTypeX.UPDATE) {\r\n try {\r\n //null for now\r\n }\r\n catch (Exception e) {\r\n }\r\n }\r\n }", "public void updateClient()\n\t{\n\t\t// TODO\n\t}", "private void handleUpdateProxyEvent(UpdateProxyEvent event) throws AppiaEventException {\n \n \t\tevent.loadMessage();\n \n \t\t//Get the parameters\n \t\tEndpt servertThatSentEndpt = event.getServerThatSentEndpt();\n \t\tVsGroup[] passedGroups = event.getAllGroups();\n \n \t\t//Say that the view was received (this also merges the temporary views)\n \t\tUpdateManager.addUpdateMessageReceived(servertThatSentEndpt, passedGroups);\n \n \t\t//If i have received from all live servers\n \t\tif(UpdateManager.receivedUpdatesFromAllLiveServers(vs.view) && amIleader()){\n \t\t\tSystem.out.println(\"Received an update proxy event from all alive and I am leader\");\n \n \t\t\t//Let go get our temporary view\n \t\t\tVsGroup[] newGroupList= UpdateManager.getTemporaryUpdateList();\n \n \t\t\t//Send the nre decided view to all\n \t\t\tUpdateDecideProxyEvent updateDecideProxy = new UpdateDecideProxyEvent(newGroupList);\n \t\t\tsendToOtherServers(updateDecideProxy);\n \t\t\tsendToMyself(updateDecideProxy);\t\t\n \t\t}\n \t}", "void onUpdate(Message message);", "public void handle(EntityPlayerMP player, GUIUpdatePacket message) {\n Container container = player.openContainer;\n if(container != null){\n if(container instanceof SyncableContainer){\n SyncableContainer synCont = (SyncableContainer) container;\n SyncableTileEntity tileSyncable = synCont.getSyncableTileEntity();\n tileSyncable.doSync(message.toSync);\n // We have adjusted the clientside values for at least one client. We need to send these updated\n // values to all players so that they can all see it\n TileEntity tile = (TileEntity) tileSyncable;\n for(EntityPlayerMP pl : player.getServerWorld().getPlayers(EntityPlayerMP.class, new Predicate<EntityPlayerMP>() {\n @Override\n public boolean apply(@Nullable EntityPlayerMP input) {\n if(Math.sqrt(input.getPosition().distanceSq(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ())) < 5D){\n if(input.openContainer != null){\n if(input.openContainer instanceof SyncableContainer){\n return true;\n }\n }\n }\n return false;\n }\n })){\n TonePacketHandler.sendTo(new PlayerGuiSyncMessage(message.toSync), pl);\n }\n }\n }\n }", "@Override\n\tpublic void update(CcNoticereceive entity) {\n\t\t\n\t}", "@Override\n\tpublic void update()\n\t{\n\t\tfor (int i = 0; i < 16 && !processQueue.isEmpty(); i++)\n\t\t{\n\t\t\tProcessEntry entry = processQueue.remove();\n\t\t\tprocessPacket(entry.packet, entry.sourceClient);\n\t\t}\n\t\t\n\t\t// Flush pending packets\n\t\tclientChannels.flush();\n\t}", "@Override\n\tpublic void checkUpdateClient() {\n\t}", "private void updateReceivedData(byte[] data) {\n }", "EventChannel.Update update();", "@Override\n public void clientObjectUpdate(ClientObjectInterface client)\n throws SimpleException {\n }", "public void processPacket(IServerPlayNetHandler handler) {\n handler.handleRecipeBookUpdate(this);\n }", "@Override\n public void update() {\n updateBuffs();\n }", "public void update(DroitsMembre client) {\n\n\t}", "public void updateClientBadges()\n\t{\n\t\tString data = \"\";\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tdata += m_badges[i];\n\t\tServerMessage message = new ServerMessage(ClientPacket.BADGES_PACKET);\n\t\tmessage.addInt(0);\n\t\tmessage.addString(data);\n\t\tgetSession().Send(message);\n\t}", "@Override\n\tpublic void onUpdatePeersReceived(UpdateEvent arg0) {\n\t\t\n\t}", "public Object getUpdate(IObserver obj);", "public abstract void clientStatusChanged(ClientManager client, Object object);", "public void update(Packet p, Node node) {\n }", "private void processPacket(DatagramPacket packet) {\n String data = new String(packet.getData());\n if (data.startsWith(\"/c/\")) {\n int ID = UniqueIdentifier.getIdentifier();\n clients.add(new ServerClient(data.split(\"/c/|/e/\")[1], packet.getAddress(), packet.getPort(), ID));\n System.out.println(\"Client connected with the name: '\" + data.split(\"/c/|/e/\")[1] + \"' @ \" + packet.getAddress() + \":\" + packet.getPort() + \" and is now using the ID: \" + ID);\n send((\"/c/\" + ID + \"/e/\").getBytes(), packet.getAddress(), packet.getPort());\n } else if (data.startsWith(\"/d/\")) {\n disconnect(Integer.parseInt(data.split(\"/d/|/e/\")[1]), true);\n } else if (data.startsWith(\"/sa/\")) {\n sendToAll((\"/m/\" + data.split(\"/sa/|/e/\")[1] + \"/e/\").getBytes());\n } else if (data.startsWith(\"/s/\")) { //TODO - FIX INDIVIDUAL PACKET SENDING\n String decodedData = data.split(\"/s/|/e/\")[1];\n String targetID = decodedData;\n targetID = targetID.substring(targetID.indexOf(\"&\") + 1);\n targetID = targetID.substring(0, targetID.indexOf(\"&\"));\n int id = Integer.parseInt(targetID);\n decodedData = decodedData.replace(\"&\" + id + \"&\", \"\");\n ServerClient targetClient = null;\n for (ServerClient item : clients) {\n if (item.getID() == id) {\n targetClient = item;\n break;\n }\n }\n assert targetClient != null;\n send(decodedData.getBytes(), targetClient.getAddress(), targetClient.getPort());\n } else if (data.startsWith(\"/p/\")) {\n clientResponse.add(Integer.parseInt(data.split(\"/p/|/e/\")[1]));\n } else if (data.startsWith(\"/dp/\")) {\n sendToAll(data.substring(0, data.length() - 3).getBytes());\n } else {\n System.out.println(packet.getAddress() + \":\" + packet.getPort() + \" sent an unknown packet: \" + data);\n }\n }", "public void handleTopologyUpdateEvent() {\n\t\t\n\t\tif(!Constants.MY_ADDR.equals(Constants.CLIENT_ADDR))\n\t\t{\n\t\t\tif(RoutingInterface.instance().isConnected(session.getDestination()))\n\t\t\t{\n\t\t\t\t// Disable EOR\n\t\t\t\tsessionManager.setLive();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Enable EOR and put it into DT...\n\t\t\t\tsessionManager.setDT();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void update(BaseGameHandler gameHandler)\r\n\t{\n\t}", "@Override\r\n\tpublic void onUpdateIO(int device, int type, int code, int value,\r\n\t\t\tint timestamp) {\n\t\t\r\n\t}", "public abstract void update(Message message);", "void update(T message);", "@Override\n\tpublic void updateAction(Client input) {\n\t\t\n\t}", "public void processPacket(IClientPlayNetHandler handler) {\n handler.handleEntityEffect(this);\n }", "void requestReceived( C conn ) ;", "void onClientsUpdated(String[] clients);", "boolean requestUpdate(ITemplateKey key, PacketDistributor.PacketTarget target);", "@Override\r\n\t\tpublic void run()\r\n\t\t{\r\n\r\n\t\t\t\r\n\t\t\twhile(clientsocket.isConnected())\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t// get type for update. 1 for object update, 2 for new attack object\r\n\t\t\t\t\tint type = rdata.readInt();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(type == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString playerupdatestr = rdata.readUTF();\r\n\t\t\t\t\t\tJsonObject jsonObject = server.gson.fromJson(playerupdatestr, JsonObject.class);\r\n\t\t\t\t\t\tint index = findlistindex(jsonObject.get(\"ID\").getAsInt());\r\n\t\t\t\t\t\tArrayList<CollideObject> templist = server.cdc.collideObjectManager[mode].collideObjectList;\r\n\t\t\t\t\t\tCollideObject obj = server.gson.fromJson(jsonObject, templist.get(index).getClass());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttemplist.set(index,obj);\r\n\t\t\t\t\t\tif(obj.getFlag())\r\n\t\t\t\t\t\t\tserver.cdc.calculatecollide(mode);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tserver.broacast_update(mode , obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString classname = rdata.readUTF();\r\n\t\t\t\t\t\tint id = rdata.readInt();\r\n\t\t\t\t\t\tint index = findlistindex(id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tserver.cdc.collideObjectManager[mode].addAttackObject(collideObjecctClass.valueOf(classname), server.idcount[mode], server.randposition(),(Character) server.cdc.collideObjectManager[mode].collideObjectList.get(index));\r\n\t\t\t\t\t\t++server.idcount[mode];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}", "void update(String message, Command command, String senderNickname);", "@Override\n\tpublic Client update(Client obj) {\n\t\treturn null;\n\t}", "public void update(Object updateMsg) {\n\t\tSystem.out.println(\"\\n-----------------------Update message from server---------------------\");\n\t\tSystem.out.println(updateMsg);\n\t}", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "public void processPacket(INetHandler handler)\r\n {\r\n this.processPacket((INetHandlerPlayClient)handler);\r\n }", "public void update(){\n \t//NOOP\n }", "@Override\n\tpublic void update(Game game) {\n\t\t\n\t\tObject packet = game.connectionManager.mostRecentPacket;\n\t\tif (packet instanceof StatePacket)\n\t\t{\n\t\t\tgame.manager.receiveUpdate(game, (StatePacket) packet);\n\t\t}\n\t}", "public void process(Player player) {\n if (playerPacketId != -1) {\n updatePlayer(player, createUpdate(true));\n }\n if (npcPacketId != -1) {\n updateMobs(player, createUpdate(false));\n }\n //grounditem update\n }", "@Override\n\tpublic void update() { }", "private static ResponseCode update(InternalRequestHeader header,\n CommandPacket commandPacket,\n String guid, JSONObject json, UpdateOperation operation,\n String writer, String signature, String message,\n Date timestamp, ClientRequestHandlerInterface handler) {\n try {\n return NSUpdateSupport.executeUpdateLocal(header, commandPacket, guid, null,\n writer, signature, message, timestamp, operation,\n null, null, -1, new ValuesMap(json), handler.getApp(), false);\n } catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException |\n SignatureException | JSONException | IOException | InternalRequestException |\n FailedDBOperationException | RecordNotFoundException | FieldNotFoundException e) {\n LOGGER.log(Level.FINE, \"Update threw error: {0}\", e);\n return ResponseCode.UPDATE_ERROR;\n }\n }", "@Override\n\tpublic void onDataChanged(long timestamp, int msg) {\n\t\tif(msg==AgentMessage.ERROR.getCode()) \n\t\t\tToolBox.showRemoteErrorMessage(connBean, error);\n\t\t\n\t\tsynchronized (mutex) {\n setEnabled(false);\n if (solid != null && timestamp > lastestTimeStamp+1500*1000000) {\n int result = JOptionPane.showConfirmDialog(StartUI.getFrame(), \"The config of this lift has changed. Reload it?\", \"Update\",\n JOptionPane.YES_NO_OPTION);\n if (result == JOptionPane.OK_OPTION) {\n solid = null;\n event = new Parser_Event( connBean.getIp(), connBean.getPort() );\n setHot();\n }\n } else {\n setHot();\n }\n setEnabled(true);\n }\n\t}", "public boolean onUpdate(Session s) throws CallbackException;", "public void updated(ServerList list);", "@Override\r\n\tpublic void update() {\n\t}", "@Override\r\n\tpublic void update() {\n\t}", "protected void onUpdate() {\r\n\r\n\t}", "public void handleMessage(Msg clientMsg) {\n switch (clientMsg.getMsgType()) {\n case ID_IS_SET:\n handle_id_is_set(clientMsg);\n break;\n\n case SHIPS_PLACED:\n handle_ships_placed(clientMsg);\n break;\n\n case WAITING:\n break;\n\n case SHOT_PERFORMED:\n handle_shot_performed(clientMsg);\n break;\n }\n }", "@Override\r\n\tpublic void update() {\r\n\r\n\t}", "public void sendUpdateToServer(EntityHandler eh) {\n if (!started)\n return;\n\n // Always send update if a shot is fired\n boolean shotFired = Input.mouseHeldTime > -1\n && ((Tank) game.entityHandler.getEntity(game.tankID)).checkIfCanFire();\n\n if (shotFired || cycleCount++ % TICK_COUNT == 0) {\n Integer[] keys = new Integer[Input.keysPressed.size()];\n Input.keysPressed.toArray(keys);\n\n Message message = new Message(\"update\");\n message.entityHandler = eh;\n message.keysPressed = keys;\n message.currentMouseHeldTime = Input.currentMouseHeldTime;\n System.out.println(\"Current held time according to client: \" + Input.currentMouseHeldTime);\n message.mouseHeldTime = Input.mouseHeldTime;\n\n sendMessage(message);\n }\n }", "@Override\r\n\tpublic void update() {\r\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "public synchronized void update(String updatedItem, ArrayList<Integer> update){\n if(updatedItem.equals(\"marketplace\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(4);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if(updatedItem.equals(\"developmentGrid\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(5);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if (updatedItem.equals(\"actionTile\")) {\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(6);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else {\n Player toUpdate = players.get(updatedItem);\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(toUpdate.getOrder());\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "public boolean update() {\n\t\ttry {\n\t\t\tbyte[] buffer = \"UPDATE\".getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (deviceId + \" \" + user).getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (byte[]) ois.readObject();\n\t\t\tString reply = (new String(buffer));\n\t\t\tif (reply.equals(\"NULL\"))\n\t\t\t\treturn true;\n\t\t\t// System.out.println(\"REPLY IS : \" + reply);\n\t\t\tString[] namespaces = reply.split(\"\\n\");\n\t\t\tLong[] rowids = dh.getRowIds(namespaces);\n\t\t\tint l = rowids.length;\n\t\t\tString ids;\n\t\t\tif (l == 1)\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\telse {\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\t\tint i;\n\t\t\t\tfor (i = 1; i < l; i++) {\n\t\t\t\t\tids = ids + \"\\n\" + Long.toString(rowids[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"IDs : \" + ids);\n\t\t\tbuffer = ids.getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "void handlePacket(String devReplyStr);", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n public void onData(SocketIOClient client, Message data, AckRequest ackRequest) {\n data = new Message(\"hello i'm server\");\n //yuyuenamespace.getBroadcastOperations().sendEvent(\"message\", data);\n }", "void update(storage_server_connections connection);", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "private byte[] handleUpdate(byte[] message) {\n\t\tbyte[] newSecretBytes = Arrays.copyOfRange(message, \"update:\".getBytes().length, message.length);\n\n/*\n\t\tSystem.out.println(\"THIS IS A TEST:\");\n\t\tSystem.out.println(\"newSecretBytes:\");\n\t\tComMethods.charByChar(newSecretBytes, true);\n\t\tSystem.out.println(\"newSecretBytes, reversed:\");\n\t\tString toStr = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tbyte[] fromStr = DatatypeConverter.parseBase64Binary(toStr);\n\t\tComMethods.charByChar(fromStr, true);\n*/\n\t\tString newSecret = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tboolean success = replaceSecretWith(currentUser, newSecret);\n\t\t\n\t\tif (success) {\n\t\t\tComMethods.report(\"SecretServer has replaced \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"secretupdated\".getBytes());\n\t\t} else {\n\t\t\tComMethods.report(\"SecretServer has FAILED to replace \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"writingfailure\".getBytes());\n\t\t}\n\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "public void updateClientMoney()\n\t{\n\t\tServerMessage message = new ServerMessage(ClientPacket.MONEY_CHANGED);\n\t\tmessage.addInt(m_money);\n\t\tgetSession().Send(message);\n\t}", "@Override\n\t\tpublic void onDeviceEventReceived(DeviceEvent ev, String client) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "@Override\n public void onUpdateReceived(Update update) {\n if (update.hasMessage() && update.getMessage().hasText()) {\n SendMessage reply = new SendMessage(); // Create a SendMessage object with mandatory fields\n String chatId = update.getMessage().getChatId().toString();\n reply.setChatId(chatId);\n // message.setText(update.getMessage().getText());\n\n String userId = update.getMessage().getChat().getId().toString();\n String firstName = update.getMessage().getChat().getFirstName();\n String lastName = update.getMessage().getChat().getLastName();\n String channel = TELEGRAM_STRING;\n\n User user = getUser(userId, channel);\n if(user == null) {\n user = createUser(userId, firstName, lastName, channel, chatId);\n }\n\n String message = update.getMessage().getText();\n String[] splittedMessage = message.split(\" \");\n\n String command = getCommand(message);\n\n switch (command) {\n case START_COMMAND:\n createReplyMessage(reply, START_MESSAGE);\n break;\n\n case SUBSCRIBE_COMMAND:\n if (splittedMessage.length > 1) {\n if (splittedMessage[1].length() != 6) {\n createReplyMessage(reply, String.format(INVALID_PINCODE, splittedMessage[1]));\n break;\n }\n String pincode = getPincode(splittedMessage[1], userId);\n Integer age = getAge(splittedMessage[2]);\n if (pincode == null || age == null) {\n createReplyMessage(reply, String.format(INVALID_MESSAGE, splittedMessage[1]));\n break;\n }\n Boolean subscribed = subscribe(user, pincode, age);\n if (subscribed) {\n createReplyMessage(reply, String.format(SUBSCRIBED_MESSAGE, pincode, age));\n } else {\n createReplyMessage(reply, String.format(ALREADY_SUBSCRIBED_MESSAGE, pincode, age));\n }\n } else {\n createReplyMessage(reply, INVALID_MESSAGE);\n }\n break;\n\n case UNSUBSCRIBE_COMMAND:\n if (splittedMessage.length > 1) {\n if (splittedMessage[1].length() != 6) {\n createReplyMessage(reply, String.format(INVALID_PINCODE, splittedMessage[1]));\n break;\n }\n String pincode = getPincode(splittedMessage[1], userId);\n Integer age = getAge(splittedMessage[2]);\n if (pincode == null || age == null) {\n createReplyMessage(reply, String.format(INVALID_MESSAGE, String.format(\"%s %s\", splittedMessage[1], splittedMessage[2])));\n break;\n }\n Boolean unsubscribed = unsubscribe(user, pincode, age);\n if (unsubscribed) {\n createReplyMessage(reply, String.format(UNSUBSCRIBED_MESSAGE, pincode, age));\n } else {\n createReplyMessage(reply, String.format(NO_SUBSCRIPTION_FOUND, pincode, age));\n }\n } else {\n createReplyMessage(reply, INVALID_MESSAGE);\n }\n break;\n\n case LIST_SUBSCRIPTION_COMMAND:\n List<String> subscriptionList = getAllSubscription(user);\n String replyMessString = \"\";\n if (!(subscriptionList.size() > 0)) {\n replyMessString = NO_SUBSCRIPTION_MESSAGE;\n }\n int i = 1;\n for (String string : subscriptionList) {\n replyMessString += String.format(\"%s. %s\\n\", i, string);\n i++;\n }\n createReplyMessage(reply, replyMessString);\n break;\n\n case HELP_COMMAND:\n createReplyMessage(reply, HELP_MESSAGE);\n break;\n\n default:\n createReplyMessage(reply, UNRECOGNIZED_COMMAND);\n }\n sendMessage(reply);\n }\n }", "public void updateClient(){\n\n System.out.println(\"Update client with ID: \");\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n System.out.println(\"Enter new characteristics: \");\n System.out.println(\"Name: \");\n String newName = bufferRead.readLine();\n System.out.println(\"Age: \");\n int newAge = Integer.parseInt(bufferRead.readLine());\n System.out.println(\"Membership type: \");\n String newMembershipType = bufferRead.readLine();\n\n Client newClient = new Client(newName, newAge, newMembershipType);\n newClient.setId(id);\n this.ctrl.updateClient(newClient);\n\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "@Override\n public void update() {\n }", "public abstract void handleClientSide(T message, EntityPlayer player);" ]
[ "0.7425878", "0.68982375", "0.6572485", "0.65106475", "0.64580363", "0.64388573", "0.63993657", "0.63919866", "0.6365731", "0.6351667", "0.62941", "0.62046385", "0.6115909", "0.61006534", "0.6094722", "0.6087314", "0.60851276", "0.6076161", "0.6060747", "0.60448784", "0.6017327", "0.60012054", "0.59893256", "0.59817183", "0.59807706", "0.59800565", "0.5960882", "0.59589565", "0.5930347", "0.5921552", "0.59173626", "0.59127575", "0.5895088", "0.58822024", "0.5867049", "0.58608395", "0.5840774", "0.5833953", "0.5826338", "0.5824012", "0.5808096", "0.5808096", "0.579552", "0.57926095", "0.5789565", "0.5778881", "0.5760584", "0.57065976", "0.56998175", "0.569871", "0.5692946", "0.56900555", "0.56900555", "0.5688494", "0.568377", "0.5679415", "0.5679115", "0.56774753", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.56655705", "0.56655705", "0.56655705", "0.56644726", "0.5663016", "0.56615275", "0.56609064", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.56552774", "0.56506526", "0.56502306", "0.56502306", "0.56502306", "0.56502306", "0.56502306", "0.56451946", "0.56428766", "0.56428766", "0.56411177", "0.5629265", "0.5624163", "0.5624163", "0.5624163", "0.56237984", "0.56170213", "0.56138146", "0.5612164", "0.56120276" ]
0.0
-1
Special handling for client update packets
public CompoundTag writeClient(CompoundTag tag) { saveAdditional(tag); return tag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void receivedUpdateFromServer();", "@Override\n\tpublic void updateClient() {\n\t\t\n\t}", "private void sendUpdateConnectionInfo() {\n\n }", "@Override\r\n\tpublic void updateclient(Client client) {\n\t\t\r\n\t}", "public interface ClientUpdateListener {\n\n /**\n * This method notify the implementer that a message has been received\n *\n * @param message the received message from the server\n */\n void onUpdate(Message message);\n}", "private void processPacket(Packet msg, int sourceClientID)\n\t{\n\t\tif (msg.getPacketID() == 1)\n\t\t{\n\t\t\t// Position updates, broadcast to everyone else\n\t\t\tPCSPosRotUpdate posUpdate = (PCSPosRotUpdate)msg;\n\t\t\t\n\t\t\t// CSPosRotUpdate\n\t\t\t// Get the specific entity to update\n\t\t\tEntityPlayer player = (EntityPlayer) entityMap.getEntity(posUpdate.clientID, EntityPlayer.class);\n\t\t\t\n\t\t\t// If non-existant, move on (probably a stale id)\n\t\t\tif (player == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tSystem.out.printf(\"\\t Ply%d-Pos: (%f, %f, %f) - (%f, %f)\\n\", posUpdate.clientID, posUpdate.xPos, posUpdate.yPos, posUpdate.zPos, posUpdate.pitch, posUpdate.yaw);\n\t\t\tplayer.setPos(posUpdate.xPos, posUpdate.yPos, posUpdate.zPos);\n\t\t\tplayer.setVelocity(posUpdate.xVel, posUpdate.yVel, posUpdate.zVel);\n\t\t\tplayer.setOrientation(posUpdate.pitch, posUpdate.yaw);\n\t\t\tplayer.xAccel = posUpdate.xAccel;\n\t\t\tplayer.zAccel = posUpdate.zAccel;\n\t\t\t\n\t\t\tplayer.isFlying = posUpdate.isFlying;\n\t\t\tplayer.isSneaking = posUpdate.isSneaking;\n\t\t\tplayer.isSprinting = posUpdate.isSprinting;\n\t\t\t\n\t\t\tclientChannels.write(posUpdate);\n\t\t}\n\t\telse if (msg.getPacketID() == 5)\n\t\t{\n\t\t\t// Block place, handle that\n\t\t\tPCSPlaceBlock blockPlace = (PCSPlaceBlock)msg;\n\t\t\tRaycastResult lastHit = blockPlace.hitResult;\n\t\t\tBlock block = blockPlace.placingBlock;\n\t\t\t\n\t\t\t// If the block can't be placed, don't place it\n\t\t\tif(!block.canPlaceBlock(\n\t\t\t\t\tinstance.world,\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ()))\n\t\t\t\treturn;\n\t\t\t\n\t\t\tinstance.world.setBlock(\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ(),\n\t\t\t\t\tblock);\n\t\t\tblock.onBlockPlaced(\n\t\t\t\t\tinstance.world,\n\t\t\t\t\tlastHit.blockX + lastHit.face.getOffsetX(),\n\t\t\t\t\tlastHit.blockY + lastHit.face.getOffsetY(),\n\t\t\t\t\tlastHit.blockZ + lastHit.face.getOffsetZ());\n\t\t\t\n\t\t\t// Broadcast to the other players\n\t\t\t// TODO: Correct for misplaces\n\t\t\tclientChannels.write(blockPlace);\n\t\t}\n\t\telse if (msg.getPacketID() == 6)\n\t\t{\n\t\t\t// Block break, handle that\n\t\t\tPCSBreakBlock blockBreak = (PCSBreakBlock)msg;\n\t\t\tRaycastResult lastHit = blockBreak.hitResult;\n\t\t\t\n\t\t\t// Break the block, with the appropriate block callbacks being called\n\t\t\tBlock block = instance.world.getBlock(lastHit.blockX, lastHit.blockY, lastHit.blockZ);\n\t\t\tblock.onBlockBroken(instance.world, lastHit.blockX, lastHit.blockY, lastHit.blockZ);\n\t\t\tinstance.world.setBlock(lastHit.blockX, lastHit.blockY, lastHit.blockZ, Blocks.AIR);\n\t\t\t\n\t\t\t// Broadcast to the other players\n\t\t\t// TODO: Correct for mis-breaks\n\t\t\tclientChannels.write(blockBreak);\n\t\t}\n\t\telse if (msg.getPacketID() == 7)\n\t\t{\n\t\t\t// Load the requested chunk column\n\t\t\tPCLoadChunkColumn loadRequest = (PCLoadChunkColumn)msg;\n\t\t\t// Get the channel id\n\t\t\tChannelId channelId = clientToChannelId.get(sourceClientID);\n\t\t\t\n\t\t\t// No id found means stale id\n\t\t\tif (channelId == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\tChannel clientChannel = clientChannels.find(channelId);\n\t\t\t\n\t\t\t// Null channel means stale id\n\t\t\tif (clientChannel == null)\n\t\t\t\treturn;\n\t\t\t\n\t\t\t// Send back the chunk column\n\t\t\tif (sendChunkColumnTo(loadRequest.columnX, loadRequest.columnZ, clientChannel))\n\t\t\t{\n\t\t\t\t// TODO: Queue up requests\n\t\t\t\tSystem.out.println(\"Fulfilled rq for \" + loadRequest.columnX + \", \" + loadRequest.columnZ + \" to Ply\" + sourceClientID);\n\t\t\t\t// Flush pending requests\n\t\t\t\tclientChannel.flush();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void onPacket(JPackectX packet) {\r\n System.out.println(\"Packet Received:\\n\\t\" + packet.toString());\r\n if (packet.getType() == JPacketTypeX.UPDATE) {\r\n try {\r\n //null for now\r\n }\r\n catch (Exception e) {\r\n }\r\n }\r\n }", "public void updateClient()\n\t{\n\t\t// TODO\n\t}", "private void handleUpdateProxyEvent(UpdateProxyEvent event) throws AppiaEventException {\n \n \t\tevent.loadMessage();\n \n \t\t//Get the parameters\n \t\tEndpt servertThatSentEndpt = event.getServerThatSentEndpt();\n \t\tVsGroup[] passedGroups = event.getAllGroups();\n \n \t\t//Say that the view was received (this also merges the temporary views)\n \t\tUpdateManager.addUpdateMessageReceived(servertThatSentEndpt, passedGroups);\n \n \t\t//If i have received from all live servers\n \t\tif(UpdateManager.receivedUpdatesFromAllLiveServers(vs.view) && amIleader()){\n \t\t\tSystem.out.println(\"Received an update proxy event from all alive and I am leader\");\n \n \t\t\t//Let go get our temporary view\n \t\t\tVsGroup[] newGroupList= UpdateManager.getTemporaryUpdateList();\n \n \t\t\t//Send the nre decided view to all\n \t\t\tUpdateDecideProxyEvent updateDecideProxy = new UpdateDecideProxyEvent(newGroupList);\n \t\t\tsendToOtherServers(updateDecideProxy);\n \t\t\tsendToMyself(updateDecideProxy);\t\t\n \t\t}\n \t}", "void onUpdate(Message message);", "public void handle(EntityPlayerMP player, GUIUpdatePacket message) {\n Container container = player.openContainer;\n if(container != null){\n if(container instanceof SyncableContainer){\n SyncableContainer synCont = (SyncableContainer) container;\n SyncableTileEntity tileSyncable = synCont.getSyncableTileEntity();\n tileSyncable.doSync(message.toSync);\n // We have adjusted the clientside values for at least one client. We need to send these updated\n // values to all players so that they can all see it\n TileEntity tile = (TileEntity) tileSyncable;\n for(EntityPlayerMP pl : player.getServerWorld().getPlayers(EntityPlayerMP.class, new Predicate<EntityPlayerMP>() {\n @Override\n public boolean apply(@Nullable EntityPlayerMP input) {\n if(Math.sqrt(input.getPosition().distanceSq(tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ())) < 5D){\n if(input.openContainer != null){\n if(input.openContainer instanceof SyncableContainer){\n return true;\n }\n }\n }\n return false;\n }\n })){\n TonePacketHandler.sendTo(new PlayerGuiSyncMessage(message.toSync), pl);\n }\n }\n }\n }", "@Override\n\tpublic void update(CcNoticereceive entity) {\n\t\t\n\t}", "@Override\n\tpublic void update()\n\t{\n\t\tfor (int i = 0; i < 16 && !processQueue.isEmpty(); i++)\n\t\t{\n\t\t\tProcessEntry entry = processQueue.remove();\n\t\t\tprocessPacket(entry.packet, entry.sourceClient);\n\t\t}\n\t\t\n\t\t// Flush pending packets\n\t\tclientChannels.flush();\n\t}", "@Override\n\tpublic void checkUpdateClient() {\n\t}", "private void updateReceivedData(byte[] data) {\n }", "EventChannel.Update update();", "@Override\n public void clientObjectUpdate(ClientObjectInterface client)\n throws SimpleException {\n }", "public void processPacket(IServerPlayNetHandler handler) {\n handler.handleRecipeBookUpdate(this);\n }", "@Override\n public void update() {\n updateBuffs();\n }", "public void update(DroitsMembre client) {\n\n\t}", "public void updateClientBadges()\n\t{\n\t\tString data = \"\";\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tdata += m_badges[i];\n\t\tServerMessage message = new ServerMessage(ClientPacket.BADGES_PACKET);\n\t\tmessage.addInt(0);\n\t\tmessage.addString(data);\n\t\tgetSession().Send(message);\n\t}", "@Override\n\tpublic void onUpdatePeersReceived(UpdateEvent arg0) {\n\t\t\n\t}", "public Object getUpdate(IObserver obj);", "public abstract void clientStatusChanged(ClientManager client, Object object);", "public void update(Packet p, Node node) {\n }", "private void processPacket(DatagramPacket packet) {\n String data = new String(packet.getData());\n if (data.startsWith(\"/c/\")) {\n int ID = UniqueIdentifier.getIdentifier();\n clients.add(new ServerClient(data.split(\"/c/|/e/\")[1], packet.getAddress(), packet.getPort(), ID));\n System.out.println(\"Client connected with the name: '\" + data.split(\"/c/|/e/\")[1] + \"' @ \" + packet.getAddress() + \":\" + packet.getPort() + \" and is now using the ID: \" + ID);\n send((\"/c/\" + ID + \"/e/\").getBytes(), packet.getAddress(), packet.getPort());\n } else if (data.startsWith(\"/d/\")) {\n disconnect(Integer.parseInt(data.split(\"/d/|/e/\")[1]), true);\n } else if (data.startsWith(\"/sa/\")) {\n sendToAll((\"/m/\" + data.split(\"/sa/|/e/\")[1] + \"/e/\").getBytes());\n } else if (data.startsWith(\"/s/\")) { //TODO - FIX INDIVIDUAL PACKET SENDING\n String decodedData = data.split(\"/s/|/e/\")[1];\n String targetID = decodedData;\n targetID = targetID.substring(targetID.indexOf(\"&\") + 1);\n targetID = targetID.substring(0, targetID.indexOf(\"&\"));\n int id = Integer.parseInt(targetID);\n decodedData = decodedData.replace(\"&\" + id + \"&\", \"\");\n ServerClient targetClient = null;\n for (ServerClient item : clients) {\n if (item.getID() == id) {\n targetClient = item;\n break;\n }\n }\n assert targetClient != null;\n send(decodedData.getBytes(), targetClient.getAddress(), targetClient.getPort());\n } else if (data.startsWith(\"/p/\")) {\n clientResponse.add(Integer.parseInt(data.split(\"/p/|/e/\")[1]));\n } else if (data.startsWith(\"/dp/\")) {\n sendToAll(data.substring(0, data.length() - 3).getBytes());\n } else {\n System.out.println(packet.getAddress() + \":\" + packet.getPort() + \" sent an unknown packet: \" + data);\n }\n }", "public void handleTopologyUpdateEvent() {\n\t\t\n\t\tif(!Constants.MY_ADDR.equals(Constants.CLIENT_ADDR))\n\t\t{\n\t\t\tif(RoutingInterface.instance().isConnected(session.getDestination()))\n\t\t\t{\n\t\t\t\t// Disable EOR\n\t\t\t\tsessionManager.setLive();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Enable EOR and put it into DT...\n\t\t\t\tsessionManager.setDT();\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void update(BaseGameHandler gameHandler)\r\n\t{\n\t}", "@Override\r\n\tpublic void onUpdateIO(int device, int type, int code, int value,\r\n\t\t\tint timestamp) {\n\t\t\r\n\t}", "public abstract void update(Message message);", "void update(T message);", "@Override\n\tpublic void updateAction(Client input) {\n\t\t\n\t}", "public void processPacket(IClientPlayNetHandler handler) {\n handler.handleEntityEffect(this);\n }", "void requestReceived( C conn ) ;", "void onClientsUpdated(String[] clients);", "boolean requestUpdate(ITemplateKey key, PacketDistributor.PacketTarget target);", "@Override\r\n\t\tpublic void run()\r\n\t\t{\r\n\r\n\t\t\t\r\n\t\t\twhile(clientsocket.isConnected())\r\n\t\t\t{\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\t// get type for update. 1 for object update, 2 for new attack object\r\n\t\t\t\t\tint type = rdata.readInt();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(type == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString playerupdatestr = rdata.readUTF();\r\n\t\t\t\t\t\tJsonObject jsonObject = server.gson.fromJson(playerupdatestr, JsonObject.class);\r\n\t\t\t\t\t\tint index = findlistindex(jsonObject.get(\"ID\").getAsInt());\r\n\t\t\t\t\t\tArrayList<CollideObject> templist = server.cdc.collideObjectManager[mode].collideObjectList;\r\n\t\t\t\t\t\tCollideObject obj = server.gson.fromJson(jsonObject, templist.get(index).getClass());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttemplist.set(index,obj);\r\n\t\t\t\t\t\tif(obj.getFlag())\r\n\t\t\t\t\t\t\tserver.cdc.calculatecollide(mode);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tserver.broacast_update(mode , obj);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString classname = rdata.readUTF();\r\n\t\t\t\t\t\tint id = rdata.readInt();\r\n\t\t\t\t\t\tint index = findlistindex(id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tserver.cdc.collideObjectManager[mode].addAttackObject(collideObjecctClass.valueOf(classname), server.idcount[mode], server.randposition(),(Character) server.cdc.collideObjectManager[mode].collideObjectList.get(index));\r\n\t\t\t\t\t\t++server.idcount[mode];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}", "void update(String message, Command command, String senderNickname);", "@Override\n\tpublic Client update(Client obj) {\n\t\treturn null;\n\t}", "public void update(Object updateMsg) {\n\t\tSystem.out.println(\"\\n-----------------------Update message from server---------------------\");\n\t\tSystem.out.println(updateMsg);\n\t}", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "public void processPacket(INetHandler handler)\r\n {\r\n this.processPacket((INetHandlerPlayClient)handler);\r\n }", "public void update(){\n \t//NOOP\n }", "@Override\n\tpublic void update(Game game) {\n\t\t\n\t\tObject packet = game.connectionManager.mostRecentPacket;\n\t\tif (packet instanceof StatePacket)\n\t\t{\n\t\t\tgame.manager.receiveUpdate(game, (StatePacket) packet);\n\t\t}\n\t}", "public void process(Player player) {\n if (playerPacketId != -1) {\n updatePlayer(player, createUpdate(true));\n }\n if (npcPacketId != -1) {\n updateMobs(player, createUpdate(false));\n }\n //grounditem update\n }", "@Override\n\tpublic void update() { }", "private static ResponseCode update(InternalRequestHeader header,\n CommandPacket commandPacket,\n String guid, JSONObject json, UpdateOperation operation,\n String writer, String signature, String message,\n Date timestamp, ClientRequestHandlerInterface handler) {\n try {\n return NSUpdateSupport.executeUpdateLocal(header, commandPacket, guid, null,\n writer, signature, message, timestamp, operation,\n null, null, -1, new ValuesMap(json), handler.getApp(), false);\n } catch (NoSuchAlgorithmException | InvalidKeySpecException | InvalidKeyException |\n SignatureException | JSONException | IOException | InternalRequestException |\n FailedDBOperationException | RecordNotFoundException | FieldNotFoundException e) {\n LOGGER.log(Level.FINE, \"Update threw error: {0}\", e);\n return ResponseCode.UPDATE_ERROR;\n }\n }", "@Override\n\tpublic void onDataChanged(long timestamp, int msg) {\n\t\tif(msg==AgentMessage.ERROR.getCode()) \n\t\t\tToolBox.showRemoteErrorMessage(connBean, error);\n\t\t\n\t\tsynchronized (mutex) {\n setEnabled(false);\n if (solid != null && timestamp > lastestTimeStamp+1500*1000000) {\n int result = JOptionPane.showConfirmDialog(StartUI.getFrame(), \"The config of this lift has changed. Reload it?\", \"Update\",\n JOptionPane.YES_NO_OPTION);\n if (result == JOptionPane.OK_OPTION) {\n solid = null;\n event = new Parser_Event( connBean.getIp(), connBean.getPort() );\n setHot();\n }\n } else {\n setHot();\n }\n setEnabled(true);\n }\n\t}", "public boolean onUpdate(Session s) throws CallbackException;", "public void updated(ServerList list);", "@Override\r\n\tpublic void update() {\n\t}", "@Override\r\n\tpublic void update() {\n\t}", "protected void onUpdate() {\r\n\r\n\t}", "public void handleMessage(Msg clientMsg) {\n switch (clientMsg.getMsgType()) {\n case ID_IS_SET:\n handle_id_is_set(clientMsg);\n break;\n\n case SHIPS_PLACED:\n handle_ships_placed(clientMsg);\n break;\n\n case WAITING:\n break;\n\n case SHOT_PERFORMED:\n handle_shot_performed(clientMsg);\n break;\n }\n }", "@Override\r\n\tpublic void update() {\r\n\r\n\t}", "public void sendUpdateToServer(EntityHandler eh) {\n if (!started)\n return;\n\n // Always send update if a shot is fired\n boolean shotFired = Input.mouseHeldTime > -1\n && ((Tank) game.entityHandler.getEntity(game.tankID)).checkIfCanFire();\n\n if (shotFired || cycleCount++ % TICK_COUNT == 0) {\n Integer[] keys = new Integer[Input.keysPressed.size()];\n Input.keysPressed.toArray(keys);\n\n Message message = new Message(\"update\");\n message.entityHandler = eh;\n message.keysPressed = keys;\n message.currentMouseHeldTime = Input.currentMouseHeldTime;\n System.out.println(\"Current held time according to client: \" + Input.currentMouseHeldTime);\n message.mouseHeldTime = Input.mouseHeldTime;\n\n sendMessage(message);\n }\n }", "@Override\r\n\tpublic void update() {\r\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t\t\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "@Override\n\tpublic void update() {\n\t}", "public synchronized void update(String updatedItem, ArrayList<Integer> update){\n if(updatedItem.equals(\"marketplace\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(4);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if(updatedItem.equals(\"developmentGrid\")){\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(5);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else if (updatedItem.equals(\"actionTile\")) {\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(6);\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n\n else {\n Player toUpdate = players.get(updatedItem);\n ArrayList<Integer> updateToSend = new ArrayList<>();\n updateToSend.add(toUpdate.getOrder());\n updateToSend.addAll(update);\n broadcast(updateToSend);\n }\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "public boolean update() {\n\t\ttry {\n\t\t\tbyte[] buffer = \"UPDATE\".getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (deviceId + \" \" + user).getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t\tbuffer = (byte[]) ois.readObject();\n\t\t\tString reply = (new String(buffer));\n\t\t\tif (reply.equals(\"NULL\"))\n\t\t\t\treturn true;\n\t\t\t// System.out.println(\"REPLY IS : \" + reply);\n\t\t\tString[] namespaces = reply.split(\"\\n\");\n\t\t\tLong[] rowids = dh.getRowIds(namespaces);\n\t\t\tint l = rowids.length;\n\t\t\tString ids;\n\t\t\tif (l == 1)\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\telse {\n\t\t\t\tids = Long.toString(rowids[0]);\n\t\t\t\tint i;\n\t\t\t\tfor (i = 1; i < l; i++) {\n\t\t\t\t\tids = ids + \"\\n\" + Long.toString(rowids[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"IDs : \" + ids);\n\t\t\tbuffer = ids.getBytes();\n\t\t\toos.writeObject(buffer);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "void handlePacket(String devReplyStr);", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n\tpublic void update() {\n\n\t}", "@Override\n public void onData(SocketIOClient client, Message data, AckRequest ackRequest) {\n data = new Message(\"hello i'm server\");\n //yuyuenamespace.getBroadcastOperations().sendEvent(\"message\", data);\n }", "void update(storage_server_connections connection);", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "private byte[] handleUpdate(byte[] message) {\n\t\tbyte[] newSecretBytes = Arrays.copyOfRange(message, \"update:\".getBytes().length, message.length);\n\n/*\n\t\tSystem.out.println(\"THIS IS A TEST:\");\n\t\tSystem.out.println(\"newSecretBytes:\");\n\t\tComMethods.charByChar(newSecretBytes, true);\n\t\tSystem.out.println(\"newSecretBytes, reversed:\");\n\t\tString toStr = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tbyte[] fromStr = DatatypeConverter.parseBase64Binary(toStr);\n\t\tComMethods.charByChar(fromStr, true);\n*/\n\t\tString newSecret = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tboolean success = replaceSecretWith(currentUser, newSecret);\n\t\t\n\t\tif (success) {\n\t\t\tComMethods.report(\"SecretServer has replaced \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"secretupdated\".getBytes());\n\t\t} else {\n\t\t\tComMethods.report(\"SecretServer has FAILED to replace \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"writingfailure\".getBytes());\n\t\t}\n\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "public void updateClientMoney()\n\t{\n\t\tServerMessage message = new ServerMessage(ClientPacket.MONEY_CHANGED);\n\t\tmessage.addInt(m_money);\n\t\tgetSession().Send(message);\n\t}", "@Override\n\t\tpublic void onDeviceEventReceived(DeviceEvent ev, String client) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "@Override\n public void onUpdateReceived(Update update) {\n if (update.hasMessage() && update.getMessage().hasText()) {\n SendMessage reply = new SendMessage(); // Create a SendMessage object with mandatory fields\n String chatId = update.getMessage().getChatId().toString();\n reply.setChatId(chatId);\n // message.setText(update.getMessage().getText());\n\n String userId = update.getMessage().getChat().getId().toString();\n String firstName = update.getMessage().getChat().getFirstName();\n String lastName = update.getMessage().getChat().getLastName();\n String channel = TELEGRAM_STRING;\n\n User user = getUser(userId, channel);\n if(user == null) {\n user = createUser(userId, firstName, lastName, channel, chatId);\n }\n\n String message = update.getMessage().getText();\n String[] splittedMessage = message.split(\" \");\n\n String command = getCommand(message);\n\n switch (command) {\n case START_COMMAND:\n createReplyMessage(reply, START_MESSAGE);\n break;\n\n case SUBSCRIBE_COMMAND:\n if (splittedMessage.length > 1) {\n if (splittedMessage[1].length() != 6) {\n createReplyMessage(reply, String.format(INVALID_PINCODE, splittedMessage[1]));\n break;\n }\n String pincode = getPincode(splittedMessage[1], userId);\n Integer age = getAge(splittedMessage[2]);\n if (pincode == null || age == null) {\n createReplyMessage(reply, String.format(INVALID_MESSAGE, splittedMessage[1]));\n break;\n }\n Boolean subscribed = subscribe(user, pincode, age);\n if (subscribed) {\n createReplyMessage(reply, String.format(SUBSCRIBED_MESSAGE, pincode, age));\n } else {\n createReplyMessage(reply, String.format(ALREADY_SUBSCRIBED_MESSAGE, pincode, age));\n }\n } else {\n createReplyMessage(reply, INVALID_MESSAGE);\n }\n break;\n\n case UNSUBSCRIBE_COMMAND:\n if (splittedMessage.length > 1) {\n if (splittedMessage[1].length() != 6) {\n createReplyMessage(reply, String.format(INVALID_PINCODE, splittedMessage[1]));\n break;\n }\n String pincode = getPincode(splittedMessage[1], userId);\n Integer age = getAge(splittedMessage[2]);\n if (pincode == null || age == null) {\n createReplyMessage(reply, String.format(INVALID_MESSAGE, String.format(\"%s %s\", splittedMessage[1], splittedMessage[2])));\n break;\n }\n Boolean unsubscribed = unsubscribe(user, pincode, age);\n if (unsubscribed) {\n createReplyMessage(reply, String.format(UNSUBSCRIBED_MESSAGE, pincode, age));\n } else {\n createReplyMessage(reply, String.format(NO_SUBSCRIPTION_FOUND, pincode, age));\n }\n } else {\n createReplyMessage(reply, INVALID_MESSAGE);\n }\n break;\n\n case LIST_SUBSCRIPTION_COMMAND:\n List<String> subscriptionList = getAllSubscription(user);\n String replyMessString = \"\";\n if (!(subscriptionList.size() > 0)) {\n replyMessString = NO_SUBSCRIPTION_MESSAGE;\n }\n int i = 1;\n for (String string : subscriptionList) {\n replyMessString += String.format(\"%s. %s\\n\", i, string);\n i++;\n }\n createReplyMessage(reply, replyMessString);\n break;\n\n case HELP_COMMAND:\n createReplyMessage(reply, HELP_MESSAGE);\n break;\n\n default:\n createReplyMessage(reply, UNRECOGNIZED_COMMAND);\n }\n sendMessage(reply);\n }\n }", "public void updateClient(){\n\n System.out.println(\"Update client with ID: \");\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n System.out.println(\"Enter new characteristics: \");\n System.out.println(\"Name: \");\n String newName = bufferRead.readLine();\n System.out.println(\"Age: \");\n int newAge = Integer.parseInt(bufferRead.readLine());\n System.out.println(\"Membership type: \");\n String newMembershipType = bufferRead.readLine();\n\n Client newClient = new Client(newName, newAge, newMembershipType);\n newClient.setId(id);\n this.ctrl.updateClient(newClient);\n\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "@Override\n public void update() {\n }", "public abstract void handleClientSide(T message, EntityPlayer player);" ]
[ "0.7425878", "0.68982375", "0.6572485", "0.65106475", "0.64580363", "0.64388573", "0.63993657", "0.63919866", "0.6365731", "0.6351667", "0.62941", "0.62046385", "0.6115909", "0.61006534", "0.6094722", "0.6087314", "0.60851276", "0.6076161", "0.6060747", "0.60448784", "0.6017327", "0.60012054", "0.59893256", "0.59817183", "0.59807706", "0.59800565", "0.5960882", "0.59589565", "0.5930347", "0.5921552", "0.59173626", "0.59127575", "0.5895088", "0.58822024", "0.5867049", "0.58608395", "0.5840774", "0.5833953", "0.5826338", "0.5824012", "0.5808096", "0.5808096", "0.579552", "0.57926095", "0.5789565", "0.5778881", "0.5760584", "0.57065976", "0.56998175", "0.569871", "0.5692946", "0.56900555", "0.56900555", "0.5688494", "0.568377", "0.5679415", "0.5679115", "0.56774753", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.5670637", "0.56655705", "0.56655705", "0.56655705", "0.56644726", "0.5663016", "0.56615275", "0.56609064", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.5658439", "0.56552774", "0.56506526", "0.56502306", "0.56502306", "0.56502306", "0.56502306", "0.56502306", "0.56451946", "0.56428766", "0.56428766", "0.56411177", "0.5629265", "0.5624163", "0.5624163", "0.5624163", "0.56237984", "0.56170213", "0.56138146", "0.5612164", "0.56120276" ]
0.0
-1
Add scooter park boolean.
public boolean addScooterPark(Park park){ try(CallableStatement callStmt = getConnection().prepareCall("{ call add_park(?,?,?,?) }")) { callStmt.setLong(1, park.getnCharginsSlot()); callStmt.setLong(2,park.getnParkingsSlot()); callStmt.setLong(3,SCOOTER_PARK_TYPE_ID); callStmt.setLong(4,park.getPharmacy().getId()); callStmt.execute(); closeAll(); return true; } catch (SQLException e) { return false; } finally { closeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setParking(java.lang.Boolean value);", "boolean isSetSpokes();", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isParking();", "boolean isSetParlay();", "public void setPrimHasRun(Boolean bool){\n primHasRun = bool;\n }", "public boolean isParked() {\r\n\t\tif (vehicleState == \"parked\") {\r\n\t\t\twasParked = true;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean addDronePark(Park park){\n try(CallableStatement callStmt = getConnection().prepareCall(\"{ call add_park(?,?,?,?) }\")) {\n\n callStmt.setLong(1, park.getnCharginsSlot());\n callStmt.setLong(2,park.getnParkingsSlot());\n callStmt.setLong(3,DRONE_PARK_TYPE_ID);\n callStmt.setLong(4,park.getPharmacy().getId());\n\n callStmt.execute();\n closeAll();\n return true;\n } catch (SQLException e) {\n return false;\n } finally {\n closeAll();\n }\n }", "@Override\n\tpublic Parking addParking(Parking parking) {\n\t\tparking.setParkingStatus(\"AVAILABLE\");\n\t\treturn parkingRepository.addParking(parking);\n\t}", "public void setBool(String parName, boolean parVal) throws HibException;", "protected boolean isPilot() {\n\t\tif (request.getSession().getAttribute(\"type\") == null)\n\t\t\treturn false;\n\t\treturn request.getSession().getAttribute(\"type\").equals(\"pilot\");\n\t}", "public void setP(boolean p) {\n\tthis.p = p;\n }", "public boolean wasParked() {\r\n\t\tif (wasParked == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void addParameter(final String name, final boolean booleanValue) {\r\n\t\tthis.addParameter(name, Boolean.toString(booleanValue));\r\n\t}", "boolean hasParking();", "public void setPerishable(boolean value) {\r\n this.perishable = value;\r\n }", "public void putBoolean(String key, boolean value, boolean commit) {\r\n\t\tputBoolean(Global.getContext(), key, value, commit);\r\n\t}", "boolean hasParkingId();", "boolean hasParkingId();", "boolean hasParkingId();", "public void setPiston(boolean x){\n armPiston.set(x);\n }", "public void putBoolean(ResourceLocation name, boolean value) {\n data.putBoolean(name.toString(), value);\n }", "protected GUIBooleanParameter(BooleanParameter parameter, SettingsPane sp) {\n\t\tsuper(parameter, sp);\n\t}", "public boolean parkVehicle(Vehicle ve){\r\n if (!fitVehicle(ve)){\r\n // return statement\r\n return false;\r\n }\r\n veh = ve;\r\n veh.parkSpots(this);\r\n // return statement\r\n return true;\r\n }", "boolean hasScoringParams();", "public void putBooleanValue(String key, boolean value){\n SharedPreferences sharedPreference = context.getSharedPreferences(LOGIN,Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreference.edit();\n editor.putBoolean(key,value);\n editor.apply();\n }", "@Override\n\tpublic boolean approvePartner(Partner partner) {\n\t\treturn false;\n\t}", "public void setPerPerson(boolean value) {\n this.perPerson = value;\n }", "public void setAchieved(Boolean newValue);", "public boolean add(boolean a, boolean b){\n\t\tSystem.out.println(\"i am from method where return type is boolean\");\n\t return true;\n\t}", "public void setHarvested(boolean harvested);", "public void set_boolean(boolean param) {\n this.local_boolean = param;\n }", "public void setPPV(Boolean ppv)\n\t{\n\t\tthis.ppv = ppv;\n\t}", "boolean hasPokers();", "boolean hasPokers();", "public void putBoolean(String key, boolean value){\n\n SharedPreferences.Editor editor = mSharedPreferences.edit();\n\n editor.putBoolean(key, value);\n\n editor.apply();\n }", "public void setPcr(boolean pcr) {\n this.pcr = pcr;\n }", "public boolean isGranted(){\n\n// if (BallotBoxState.Granted.equals(getBallotBoxState()) || this.quorum.get() <= 0) {\n// setBallotBoxState(BallotBoxState.Granted);\n// return true;\n// }\n// return false;\n\n return this.quorum.get() <= 0;\n }", "public void addRock() {\n\t\trock = true;\n\t}", "public void setIsApproved (boolean IsApproved);", "public void setIsApproved (boolean IsApproved);", "boolean hasAdvertisingPartner();", "public TupleDesc addBoolean(String name) {\n columns.add(new TupleDescItem(Type.BOOLEAN, name));\n return this;\n }", "public final boolean isUseSpineBoy() {\n return useSpineBoy;\n }", "public void setAbleToBuyHouses(boolean bool){\n\t\tableToBuyHouses=bool;\r\n\t}", "public void kinged(){this.king = true;}", "void setConsensus(boolean consensus) { this.consensus = consensus; }", "public void setIsPremium(final Boolean isPremiumValue) {\n this.isPremium = isPremiumValue;\n }", "public void onHasUserTurnOnGps(boolean b) {\n mHasTurnOnGps = b;\n }", "public void assignAddingLocation(final boolean val) {\n addingLocation = val;\n }", "void setProbables(boolean probables);", "public void setIsPremium(final Boolean isPremiumValue) {\n this.isPremium = isPremiumValue;\n }", "public boolean addPoint(Point p);", "private void saveBoolean(String paramString, boolean paramBoolean) {\n }", "@Override\n\tpublic boolean paie() {\n\n\t\treturn true;\n\t}", "void setInvoiced(boolean invoiced);", "public void setBool(String name, Boolean value) {\n parameters.get(name).setValue(value);\n }", "@Override\n\tpublic boolean enablePartner(Partner partner) {\n\t\treturn false;\n\t}", "public void setTallied(java.lang.Boolean value);", "public static void putBoolean(Context context, String key, boolean value) {\n getPreferenceEditor(getSharePreferences(context)).putBoolean(key, value).apply();\n }", "void setParlay(boolean parlay);", "public void checkForSpot(String option, String length, Vehicle v, ParkingLot p)\r\n {\r\n ArrayList<Point> freeSpots = new ArrayList<>();\r\n // this will happen in parkingLotControl\r\n // ask if they want regular or premium\r\n // ask for long or short term\r\n // NOT FINISHED\r\n int width = p.getTotalRow();\r\n int height = p.getTotalColumn();\r\n\r\n // if vehicle spots taken is 2, create TwoParkingSpots...\r\n if (v.getSpotsTaken() == 2) {\r\n // for loop stuff\r\n // if two are available but not next to each other\r\n // call moveCars\r\n Point[] spot = checkSpotsForTwo(p);\r\n if(spot == null){\r\n System.out.println(\"There are not enough spots in this lot to park this car.\");\r\n return;\r\n }else{\r\n TwoParkingSpots ps = new TwoParkingSpots(v.getOwner(),v,option,length,(int)spot[0].getX(), new int[]{(int)spot[0].getY(),(int)spot[1].getY()});\r\n p.setSpot(ps.getRow(),ps.getColumns(),ps);\r\n System.out.println(\"Vehicle has been parked. Taking back to main menu.\");\r\n if(option.equals(\"regular\")){\r\n if(length.equals(\"long\")){\r\n v.setCost(\"Long Term Regular Parking\",25.00);\r\n }else{\r\n v.setCost(\"Short Term Regular Parking\",15.00);\r\n }\r\n }else{\r\n if(length.equals(\"long\")){\r\n v.setCost(\"Long Term Premium Parking\",45.00);\r\n }else{\r\n v.setCost(\"Short Term Premium Parking\",35.00);\r\n }\r\n }\r\n return;\r\n }\r\n } else {\r\n for (int i = 0; i < width; i++) {\r\n for (int j = 0; j < height; j++) {\r\n if (p.getOccupany(i, j) == false) {\r\n freeSpots.add(new Point(i, j));\r\n }\r\n }\r\n }\r\n\r\n if(freeSpots.size() >= 1){\r\n Random spot = new Random();\r\n Point parkSpot = freeSpots.get(spot.nextInt(freeSpots.size()));\r\n\r\n ParkingSpot ps = new ParkingSpot(v.getOwner(), v, option, length);\r\n p.setSpot((int) parkSpot.getX(), (int) parkSpot.getY(), ps);\r\n System.out.println(\"Vehicle has been parked. Taking back to main menu.\");\r\n if(option.equals(\"regular\")){\r\n if(length.equals(\"long\")){\r\n v.setCost(\"Long Term Regular Parking\",25.00);\r\n }else{\r\n v.setCost(\"Short Term Regular Parking\",15.00);\r\n }\r\n }else{\r\n if(length.equals(\"long\")){\r\n v.setCost(\"Long Term Premium Parking\",45.00);\r\n }else{\r\n v.setCost(\"Short Term Premium Parking\",35.00);\r\n }\r\n }\r\n return;\r\n }else{\r\n System.out.println(\"There are not enough spots in this lot to park this car.\");\r\n return;\r\n }\r\n }\r\n }", "public void setIsSetPriceStd (boolean IsSetPriceStd);", "public void setIsSetPriceList (boolean IsSetPriceList);", "public void setK(boolean k) {\n\tthis.k = k;\n }", "public void append(boolean bool)\n\t{\n\t\t// determine the byte to append\n\t\tbyte b = (bool ? TRUE : FALSE);\n\t\t\n\t\t// append the byte\n\t\tappend(b);\n\t}", "boolean spawningEnabled();", "public void setIsShared(ParseTree node, Boolean bool) {\n\t\tthis.isShared.put(node, bool);\n\t}", "public void enableBuyEntrance(){\r\n\t\tbuyEntrance = true;\r\n\t\tbuildHotel = true;\r\n\t}", "boolean isPulsing();", "public void setIsSponsored(boolean sponsored) {\n this.isSponsored = sponsored;\n }", "synchronized public static void putBoolean(Context context, String key, boolean value, boolean commit) {\r\n\t\tensurePreferencesEditor(context);\r\n\t\tsPreferencesEditor.putBoolean(key, value);\r\n\t\tif (commit) {\r\n\t\t\tsPreferencesEditor.commit();\r\n\t\t}\r\n\t\tif (sInstance != null) {\r\n\t\t\tsInstance.mSettings.put(key, value);\r\n\t\t}\r\n\t}", "public boolean isKing(){return this.king;}", "public boolean addPrimitiveCockpit() {\n if (getEmptyCriticals(LOC_HEAD) < 5) {\n return false;\n }\n addCritical(LOC_HEAD, 0, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_LIFE_SUPPORT));\n addCritical(LOC_HEAD, 1, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_SENSORS));\n addCritical(LOC_HEAD, 2, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_COCKPIT));\n addCritical(LOC_HEAD, 4, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_SENSORS));\n addCritical(LOC_HEAD, 5, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, SYSTEM_LIFE_SUPPORT));\n setCockpitType(COCKPIT_PRIMITIVE);\n return true;\n }", "boolean getParlay();", "public final void setUseSpineBoy(boolean useSpineBoy) {\n this.useSpineBoy = useSpineBoy;\n }", "protected boolean isOnPayline() {\n return getY()==getHeight();\n }", "@Override\n\t\t\tpublic boolean onPreferenceClick(Preference arg0) {\n\n\t\t\t\tbuy(SKU_VITAMIN);\n\t\t\t\treturn true;\n\t\t\t}", "public void setBooked(boolean confirmed){\n booked = confirmed;\n }", "void xsetParlay(org.apache.xmlbeans.XmlBoolean parlay);", "public void changeIsParalysed()\r\n\t{\r\n\t\tisParalysed = !isParalysed;\r\n\t}", "public void setIsSpinning(boolean isSpining) {\n\t\tMainGUIInterface.isSpining = isSpining;\n\t}", "public void setisTripSaving(boolean value) {\n\t\tsharedPreferences = context.getSharedPreferences(\"TRIP\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\tSharedPreferences.Editor editor = sharedPreferences.edit();\n\t\teditor.putBoolean(\"isTripSaving\", value);\n\t\teditor.commit();\n\t}", "@Override\n public void payeeInputVisible(boolean yes) {\n\t\n }", "public boolean isSelectedPredefinedCourse(){\n if(predefinedCourseName == null) return false;\n else return true;\n }", "public void visit(ProgName progName) {\r\n \tprogName.obj = Tab.insert(Obj.Prog, progName.getProgName(), Tab.noType);\r\n \tTab.insert(Obj.Type, \"bool\", boolType);\r\n \tTab.openScope();\r\n \t\r\n \t\r\n }", "public static void SetPreferByBoolean(Context context, String key,\n\t\t\tboolean value) {\n\t\tSharedPreferences mPrefer = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tEditor editor = mPrefer.edit();\n\t\teditor.putBoolean(key, value);\n\t\teditor.commit();\n\t}", "public void setPaid() {\n isPaid = true;\n }", "public void assignAddingAdmingroup(final boolean val) {\n addingAdmingroup = val;\n }", "@Override\n\tpublic boolean isApproved() {\n\t\treturn _scienceApp.isApproved();\n\t}", "public abstract boolean canFit(ParkingSpot spot);", "@Override\n\tpublic boolean approveIt() {\n\t\treturn false;\n\t}", "public void setTurning(java.lang.Boolean value);", "protected void enableSecurityAdvisor() {\r\n\tif (osylSecurityService.getCurrentUserRole().equals(\r\n\t\tOsylSecurityService.SECURITY_ROLE_COURSE_INSTRUCTOR)\r\n\t\t|| osylSecurityService.getCurrentUserRole().equals(\r\n\t\t\tOsylSecurityService.SECURITY_ROLE_PROJECT_MAINTAIN)) {\r\n\t securityService.pushAdvisor(new SecurityAdvisor() {\r\n\t\tpublic SecurityAdvice isAllowed(String userId, String function,\r\n\t\t\tString reference) {\r\n\t\t return SecurityAdvice.ALLOWED;\r\n\t\t}\r\n\t });\r\n\t}\r\n }", "void addHasRecommendation(PM_Learning_Material newHasRecommendation);", "void setMortgaged(boolean mortgaged);", "void setProtection(boolean value);", "public boolean isSperret() {\n\t\treturn sperretKort;\n\t}", "public void setTripPaused(boolean value) {\n\t\tsharedPreferences = context.getSharedPreferences(\"TRIP\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\tSharedPreferences.Editor editor = sharedPreferences.edit();\n\t\teditor.putBoolean(\"isTripPaused\", value);\n\t\teditor.commit();\n\t}", "@Override\n public void saveBoolean(String key, boolean value) {\n SharedPreferences.Editor prefs = mSharedPreferences.edit();\n prefs.putBoolean(key, value);\n prefs.commit();\n }", "public void setShivering(boolean shivering);" ]
[ "0.6423056", "0.5850461", "0.5817602", "0.5641446", "0.5590449", "0.5581433", "0.5566363", "0.5506043", "0.5486574", "0.54064626", "0.5383909", "0.5374663", "0.53644943", "0.5269714", "0.52500004", "0.52321243", "0.5223646", "0.5223646", "0.5223646", "0.5180355", "0.51580995", "0.51518697", "0.514805", "0.5144449", "0.5124131", "0.5112663", "0.5103008", "0.5097756", "0.5092634", "0.5034776", "0.5034749", "0.5022996", "0.49910688", "0.49910688", "0.49866584", "0.4972782", "0.49726897", "0.4969964", "0.49581155", "0.49581155", "0.49574718", "0.49554855", "0.49554244", "0.49366155", "0.49357823", "0.49145737", "0.49048504", "0.4893712", "0.48920283", "0.48871702", "0.48865765", "0.4884084", "0.4880962", "0.4879933", "0.48740432", "0.48646224", "0.4864182", "0.48465633", "0.48447356", "0.4831443", "0.48298204", "0.48259485", "0.4808073", "0.47903606", "0.47845617", "0.47838598", "0.47832608", "0.478311", "0.4781248", "0.47747007", "0.47722557", "0.477001", "0.47678003", "0.4765692", "0.47647592", "0.4757399", "0.4754972", "0.47538042", "0.47447577", "0.47434783", "0.47423127", "0.47365302", "0.47355905", "0.4730194", "0.47294077", "0.47290605", "0.47233802", "0.4718609", "0.47145495", "0.47106305", "0.47085255", "0.4706317", "0.47038132", "0.47009084", "0.46987557", "0.46983558", "0.46942642", "0.46930268", "0.46831274", "0.46822673" ]
0.66713524
0
Add drone park boolean.
public boolean addDronePark(Park park){ try(CallableStatement callStmt = getConnection().prepareCall("{ call add_park(?,?,?,?) }")) { callStmt.setLong(1, park.getnCharginsSlot()); callStmt.setLong(2,park.getnParkingsSlot()); callStmt.setLong(3,DRONE_PARK_TYPE_ID); callStmt.setLong(4,park.getPharmacy().getId()); callStmt.execute(); closeAll(); return true; } catch (SQLException e) { return false; } finally { closeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setParking(java.lang.Boolean value);", "protected boolean drillVertex() {\n return drillVertex;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Boolean isParking();", "boolean isSetParlay();", "public boolean addScooterPark(Park park){\n try(CallableStatement callStmt = getConnection().prepareCall(\"{ call add_park(?,?,?,?) }\")) {\n\n callStmt.setLong(1, park.getnCharginsSlot());\n callStmt.setLong(2,park.getnParkingsSlot());\n callStmt.setLong(3,SCOOTER_PARK_TYPE_ID);\n callStmt.setLong(4,park.getPharmacy().getId());\n\n callStmt.execute();\n closeAll();\n return true;\n } catch (SQLException e) {\n return false;\n } finally {\n closeAll();\n }\n }", "public void setPiston(boolean x){\n armPiston.set(x);\n }", "public boolean isParked() {\r\n\t\tif (vehicleState == \"parked\") {\r\n\t\t\twasParked = true;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean add(boolean a, boolean b){\n\t\tSystem.out.println(\"i am from method where return type is boolean\");\n\t return true;\n\t}", "public void setAbleToBuyHouses(boolean bool){\n\t\tableToBuyHouses=bool;\r\n\t}", "public DrillBuilder drillVertex(boolean drillVertex) {\n this.drillVertex = drillVertex;\n return this;\n }", "public void setPrimHasRun(Boolean bool){\n primHasRun = bool;\n }", "public void addParameter(final String name, final boolean booleanValue) {\r\n\t\tthis.addParameter(name, Boolean.toString(booleanValue));\r\n\t}", "public void setRoad(Boolean bool) {\r\n\t \tthis.road = bool;\r\n\t }", "public TupleDesc addBoolean(String name) {\n columns.add(new TupleDescItem(Type.BOOLEAN, name));\n return this;\n }", "public VfeLkBooleanAdp(Byte booleanId) { this.booleanId = booleanId; }", "public boolean isDargly()\n\t{ return m_bBoolean ; }", "public void setBool(String parName, boolean parVal) throws HibException;", "public void setLivePlant(boolean value) {\r\n this.livePlant = value;\r\n }", "public static String wheelchairboolean(boolean access) \n {\n String option;\n if (access == true) {\n option = \" yes \";\n }\n else {\n option = \" no \";\n }\n return option;\n \n }", "public void setObradjeno(boolean value) {\n this.obradjeno = value;\n }", "boolean hasParking();", "public void setDRGPRICEY(java.lang.Boolean DRGPRICEY) {\n this.DRGPRICEY = DRGPRICEY;\n }", "public void setP(boolean p) {\n\tthis.p = p;\n }", "boolean CanBuyRoad();", "boolean getParlay();", "@Override\n\tpublic Parking addParking(Parking parking) {\n\t\tparking.setParkingStatus(\"AVAILABLE\");\n\t\treturn parkingRepository.addParking(parking);\n\t}", "public void set_boolean(boolean param) {\n this.local_boolean = param;\n }", "void hasBarracks(boolean hasBarracks);", "protected GUIBooleanParameter(BooleanParameter parameter, SettingsPane sp) {\n\t\tsuper(parameter, sp);\n\t}", "public boolean wasParked() {\r\n\t\tif (wasParked == true) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void setIsBranded(boolean branded) {\n this.isBranded = branded;\n }", "protected void addDeletionProtection_java_lang_Boolean_PropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(createItemPropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),\n\t\t\t\tgetString(\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_deletionProtection_java_lang_Boolean__feature\"),\n\t\t\t\tgetString(\"_UI_PropertyDescriptor_description\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_deletionProtection_java_lang_Boolean__feature\",\n\t\t\t\t\t\t\"_UI_ApplicationLoadBalancerBuilder_elasticloadbalancingv2_type\"),\n\t\t\t\tAwsworkbenchPackage.Literals.APPLICATION_LOAD_BALANCER_BUILDER_ELASTICLOADBALANCINGV2__DELETION_PROTECTION_JAVA_LANG_BOOLEAN_,\n\t\t\t\ttrue, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));\n\t}", "public void setTallied(java.lang.Boolean value);", "public void putBoolean(ResourceLocation name, boolean value) {\n data.putBoolean(name.toString(), value);\n }", "public void append(boolean bool)\n\t{\n\t\t// determine the byte to append\n\t\tbyte b = (bool ? TRUE : FALSE);\n\t\t\n\t\t// append the byte\n\t\tappend(b);\n\t}", "private native void Df1_Write_Boolean(String plcAddress,boolean value) throws Df1LibraryNativeException;", "public boolean isKing(){return this.king;}", "public void setVivant(boolean vivant)\r\n\t{\r\n\t\tthis.vivant = vivant;\r\n\t}", "public void setDiparkiran(boolean isDiparkiran) {\n if (isDiparkiran == false) {\n this.isDiparkiran = true;\n } else {\n System.out.println(\"kendaraan sudah di parkiran\");\n }\n }", "public void setD ( boolean d ) {\n\n\tthis.d = d;\n }", "boolean hasParkingId();", "boolean hasParkingId();", "boolean hasParkingId();", "public boolean isWoodenPlank() {\n return this.type == Type.WOODENPLANK;\n }", "public void setPerishable(boolean value) {\r\n this.perishable = value;\r\n }", "public void setPcr(boolean pcr) {\n this.pcr = pcr;\n }", "private void drink()\n { \n if(i.item3 == true && i.used == false)\n {\n p.energy += 70;\n i.item3 = false;\n i.used = true;\n System.out.println(\"Energy: \" + p.energy);\n }\n else if(i.used == true && i.item3 == false) \n {\n System.out.println(\"You already drank a redbull!\"); \n }\n else if(i.item3 == false && i.used == false)\n {\n System.out.println(\"no more drinks left!\");\n }\n }", "public void kinged(){this.king = true;}", "void setParlay(boolean parlay);", "private boolean canMakeRadar() {\n // TODO\n return false;\n }", "public boolean addNode(DAGNode node) {\r\n\t\treturn true;\r\n\t}", "protected boolean canBreed()\n {\n return age >= breeding_age;\n }", "boolean hasAddMountPoint();", "void addIsCentralNode(Boolean newIsCentralNode);", "public static boolean addTrue(BoolVar BOOLVAR) {\n Solver solver = BOOLVAR.getSolver();\n PropSat sat = solver.getMinisat().getPropSat();\n int lit = sat.Literal(BOOLVAR);\n sat.addClause(lit);\n return true;\n }", "public void addDrink(Drink drink) {\n drinks.put(drink, false);\n }", "private void saveBoolean(String paramString, boolean paramBoolean) {\n }", "public void setRnaPointIDs(boolean r)\n { this.rnaPointIDs = r; }", "boolean hasAdvertisingPartner();", "public void buyFarm(){\n bought = !bought;\n }", "public void setIsInDepot(boolean b) {\n\t\tisInDepot = b;\n\t}", "public void setSummable(Boolean summable);", "void setMortgaged(boolean mortgaged);", "public void putBoolean(String key, boolean value, boolean commit) {\r\n\t\tputBoolean(Global.getContext(), key, value, commit);\r\n\t}", "public void setPPV(Boolean ppv)\n\t{\n\t\tthis.ppv = ppv;\n\t}", "boolean isSetSpokes();", "public void setLivingStatus(boolean livingStatus){\n this.livingStatus = livingStatus;\n }", "public void setLivre(boolean livre) {\n this.livre = livre;\n }", "public boolean parkVehicle(Vehicle ve){\r\n if (!fitVehicle(ve)){\r\n // return statement\r\n return false;\r\n }\r\n veh = ve;\r\n veh.parkSpots(this);\r\n // return statement\r\n return true;\r\n }", "public void add(Boolean value) {\r\n\t\tif(size < capacity) {\r\n\t\t\tvalues.add(value);\r\n\t\t\tsize++;\r\n\t\t}\t\t\r\n\t}", "public void setRunnning(boolean bool) {\n\t\trunning = bool;\n\t}", "public void addMain(boolean b) {\n\t\tmain = b;\n\t}", "public void setCarry(final boolean value) {\n\t\tif (value) {\n\t\t\tsetCarry();\n\t\t}\n\t\telse {\n\t\t\tresetCarry();\n\t\t}\n\t}", "public boolean raceSelected(){\n\t\tif(btnDwarf.isEnabled() && btnElf.isEnabled() && btnHuman.isEnabled())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public void setNoGoZone(Boolean bool) {\r\n\t this.noGoZone = bool;\r\n\t }", "public void setBoolean(String plcAddress,boolean value) throws Df1LibraryNativeException\n\t{\n\t\tDf1_Write_Boolean(plcAddress,value);\n\t}", "public BooleanPhenotype() {\n dataValues = new ArrayList<Boolean>();\n }", "public boolean getBoolean(){\r\n try{return kd.getJSONObject(ug).getBoolean(udn);}\r\n catch(JSONException e){return false;}\r\n }", "boolean hasDecisionPointParams();", "public void setRDV(boolean rdv) {\n\t\tRDV = rdv;\n\t}", "public final void ruleBoolean() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:266:2: ( ( 'Boolean' ) )\n // InternalMyDsl.g:267:2: ( 'Boolean' )\n {\n // InternalMyDsl.g:267:2: ( 'Boolean' )\n // InternalMyDsl.g:268:3: 'Boolean'\n {\n before(grammarAccess.getBooleanAccess().getBooleanKeyword()); \n match(input,14,FOLLOW_2); \n after(grammarAccess.getBooleanAccess().getBooleanKeyword()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public void setK(boolean k) {\n\tthis.k = k;\n }", "public void setR(boolean r) {\n\tthis.r = r;\n }", "boolean isSetRoadTerrain();", "@Override\n public void onClick(View v) {\n boolean enable = true;\n if(nextPhysicianAvailableCheckbox.isChecked()) {\n enable = false;\n }\n for (int i = 0; i < nearbyPhysicianListLayout.getChildCount(); i++) {\n nearbyPhysicianListLayout.getChildAt(i).setEnabled(enable);\n }\n }", "public void setCanPierce(boolean canPierce) {\n\t\tthis.canPierce = canPierce;\n\t}", "public void plum() {\n plum = true;\n }", "public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "void addRide(String name, String park, Date ridden);", "public void enableBuyEntrance(){\r\n\t\tbuyEntrance = true;\r\n\t\tbuildHotel = true;\r\n\t}", "private boolean isPregnant() {\n return this.hasCapability(LifeStage.PREGNANT);\n }", "void setBoolean(String key, boolean val);", "public void setNewObject(boolean newObject)\r\n\t{\r\n\t\tthis.newObject = newObject;\r\n\t}", "public void setBool(String name, Boolean value) {\n parameters.get(name).setValue(value);\n }", "public DrillBuilder drillEdge(boolean drillEdge) {\n this.drillVertex = !drillEdge;\n return this;\n }", "public void addItemTrackBagging(Item item, boolean bool) {\n\t\tthis.purchaseList.setItemTrackBagging(item, bool);\n\t}", "public boolean pobjeda() {\r\n\t\treturn !igrajPoslijePobjede && pobjeda;\t\r\n\t}", "public void putBoolean(String key, boolean value) {\n String valueAsString = value ? TRUE_AS_STRING : FALSE_AS_STRING;\n\n put(key, valueAsString);\n }", "public void setCompetitive(boolean value) {\n this.competitive = value;\n }", "public void setTurning(java.lang.Boolean value);" ]
[ "0.6669776", "0.5983147", "0.5903885", "0.5731496", "0.5645356", "0.56286764", "0.5614938", "0.55613375", "0.54629284", "0.54564977", "0.5386385", "0.53648365", "0.5360686", "0.53402215", "0.53022885", "0.5283964", "0.52774805", "0.5272427", "0.52637166", "0.52569026", "0.5252896", "0.5227125", "0.5223669", "0.5207761", "0.52027756", "0.51738787", "0.51459694", "0.51384395", "0.5125188", "0.51137805", "0.5086574", "0.50650936", "0.5058798", "0.5047121", "0.50467575", "0.5045988", "0.5039356", "0.49952406", "0.4985396", "0.49767455", "0.49738386", "0.49738386", "0.49738386", "0.49707466", "0.49679834", "0.49471876", "0.49446094", "0.4944587", "0.49434948", "0.49378353", "0.49307862", "0.49184805", "0.4914873", "0.49089238", "0.49017844", "0.48993596", "0.48987383", "0.4886792", "0.48841608", "0.4881472", "0.48812768", "0.48786864", "0.4877836", "0.48718956", "0.4863784", "0.48601156", "0.48594853", "0.4854343", "0.48541087", "0.48526484", "0.48525053", "0.48517358", "0.4846849", "0.48460093", "0.48332396", "0.48321357", "0.48298612", "0.4829225", "0.4827608", "0.48221326", "0.48213145", "0.4821242", "0.4818594", "0.4817347", "0.4816461", "0.48017278", "0.47954604", "0.4776447", "0.4774591", "0.47743213", "0.47669134", "0.47426605", "0.47415218", "0.47412178", "0.47396755", "0.47388843", "0.4738717", "0.47381124", "0.47356674", "0.47249177" ]
0.6449367
1
Remove park by id boolean.
public boolean removeParkById(long idPark) { try(CallableStatement callStmt = getConnection().prepareCall("{ call remove_park_by_id(?) }")) { callStmt.setLong(1, idPark); callStmt.execute(); closeAll(); return true; } catch (SQLException e) { return false; } finally { closeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean removeObject(PointLatLng point, String id);", "boolean remove (I id);", "void remove(K id);", "boolean removeObject(String id);", "boolean excluir(long id);", "public void delete(K id);", "void delete(K id);", "void delete(K id);", "boolean removeObject(Circle circle, String id);", "Boolean removeOperation(Long id);", "public boolean removeSickPerson(int id) throws SQLException;", "int deleteByPrimaryKey(Integer parklotstatusid);", "void remove(PK id);", "void removeRide(String name, String park);", "boolean removeObject(Polygon polygon, String id);", "@Override\n\tpublic String deletePilot(String id) {\n\t\tint inew = 0;\n\t\tfor(int x = 0 ; x < archivePilot.size(); x++) {\n\t\t\tPilotModel pilots = archivePilot.get(x);\n\t\t\tif (pilots.getId().equals(id)) {\n\t\t\t\tinew = x;\n\t\t\t\tarchivePilot.remove(x);\n\t\t\t\treturn id;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "Boolean delete(Long id);", "@Override\n\tpublic boolean eliminar(Long id) {\n\t\treturn false;\n\t}", "public boolean delete(String id);", "public boolean delete(String id);", "boolean delete(ID id);", "void remove(int id);", "boolean removeObject(RectangleLatLng rectangle, String id);", "public boolean deleteById(Object id);", "public boolean deleteById(Object id);", "public abstract boolean delete(PK id);", "boolean remove(String elementId);", "@Override\n\tpublic boolean removeById(long id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean eliminaRisposta(Long id) {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\trisposte.remove(id);\n\t\tdb.commit();\n\t\t\n\t\tif(!risposte.containsKey(id))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean delete(int id) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean delete(int id) {\n\t\treturn false;\r\n\t}", "@Override\n public boolean delete(Integer id) {\n return false;\n }", "@Override\n\t\tpublic boolean delete(int id) {\n\t\t\t\treturn false;\n\t\t}", "@Override\n\tpublic boolean delete(int id) {\n\t\treturn false;\n\t}", "boolean hasParkingId();", "boolean hasParkingId();", "boolean hasParkingId();", "void deleteElective(Long id);", "boolean delete(final ID id);", "void remove(String id);", "void remove(String id);", "void remove(String id);", "@Override\r\n\tpublic boolean doRemove(String id) throws SQLException {\n\t\treturn false;\r\n\t}", "boolean deleteById(int id);", "@Override\n public Pacote remove(Object key) {\n Pacote pt = this.get(key);\n try {\n conn = Connect.connect();\n \n PreparedStatement stm = conn.prepareStatement(\"UPDATE Pacote SET visivel=FALSE WHERE nomePacote=?;\");\n \n stm.setString(1, (String)key); //parse da key para a querie\n stm.executeUpdate();\n \n } catch (SQLException | ClassNotFoundException e) {\n throw new NullPointerException(e.getMessage());\n } finally {\n Connect.close(conn);\n }\n return pt;\n }", "@Override\n\tpublic boolean eliminarPorId(Integer llave) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean delete(long id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean delete(long id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean delete(Long id) {\n\t\treturn false;\n\t}", "public boolean deletePalvelupisteet();", "public boolean deletePeople(Long id);", "void remove(Long id);", "void remove(Long id);", "public void removePainter(Integer id);", "public void delById(Serializable id) ;", "public void removeByid_(long id_);", "public boolean supprimerCompte(int id);", "public void removeByA_A(java.lang.String articleId, boolean approved);", "public void removeKing(){\n this.king = false;\n }", "public boolean deleteById(int id) {\n boolean result=true;\n String[] whereArgs={Integer.toString(id)};\n int tmpres=this.database.delete(PyramidTable.TABLE_PYRAMID, PyramidTable.COLUMN_ID+\"=?\", whereArgs);\n if(result && tmpres>=0){\n result=true;\n }else{\n result=false;\n }\n try {\n QSortHelper qSortHelper = (QSortHelper)this.dbc.getHelper(DatabaseConnector.TYPE_QSORT);\n QSort[] qsorts=qSortHelper.getAllByStudyId(id);\n if(qsorts!=null){\n for(int i=0;i<qsorts.length;i++){\n if(!(result && deletePyramidCells(qsorts[i].getId()))){\n result=false;\n }\n }\n }else{\n result = false;\n }\n } catch (HelperNotFoundException e) {\n result = false;\n }\n return result;\n }", "@Override\n\tpublic boolean delete(long id) {\n\t\treturn true;\n\t}", "public boolean removePoint(Point p);", "public boolean remove(String id) throws SQLException\n {\n String update = \"DELETE FROM Persons WHERE teamId = ?\";\n PreparedStatement stmt = db.getPreparedStatement(update);\n stmt.setString(1, id);\n db.executeUpdate(stmt);\n\n return false;\n }", "@Override\n\tpublic boolean deleteLeave(Integer id) {\n\t\treturn false;\n\t}", "public boolean removePoint(Point p){\n\t\t\treturn clusterPointsList.remove(p);\n\t\t}", "@Override\n\tpublic boolean removeCourse(String id) {\n\t\treturn false;\n\t}", "public boolean deleteStudent(String id) {\n\t\tfor (String key : list.keySet()) {\n\t\t\tif (id.equals(key)){\n\t\t\t\tlist.remove(key);\n\t\t\t\treturn true;\n\t\t\t}\t\t\t\t\n\t\t}\n\t\treturn false;\n\t}", "void deleteMataKuliah (int id);", "@Override\n\tpublic boolean deleteById(int id) {\n\t\treturn false;\n\t}", "public boolean delete(String id) {\n\t\t\treturn false;\n\t\t}", "@Override\n\t/**\n\t * Elimino un empleado.\n\t */\n\tpublic boolean delete(Object Id) {\n\t\treturn false;\n\t}", "void deleteParameter(long id);", "void deleteFeature(Integer id);", "boolean remove(K key);", "boolean remove(K key);", "public boolean remove(Key key) ;", "void removeAirport(Long id);", "void delete(String id, boolean force) throws PSDataServiceException, PSNotFoundException;", "public boolean remove(K key);", "@Override\n\tpublic boolean deleteCar(String id) {\n\t\tfor(int i=0; i<archiveCar.size(); i++) {\n\t\t\tCarModel car = archiveCar.get(i);\n\t\t\tif(car.getId().equals(id)) {\n\t\t\t\tarchiveCar.remove(i);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "E remove(Id id);", "public boolean deleteBemanningslid(int id) {\n boolean resultaat = true;\n try (\n Connection connection = DriverManager.getConnection(url, login, password);\n PreparedStatement statement = connection.prepareStatement(\"delete from bemanningslid \"\n + \" where bemanningslid.id = ?\");) {\n statement.setInt(1, id);\n statement.execute();\n } catch (Exception e) {\n resultaat = false;\n e.printStackTrace();\n }\n return resultaat;\n }", "public boolean delete(K key);", "public void remove(String id) {\n\t\t\n\t}", "public boolean supprimerMagasin(int id);", "boolean remove(String name);", "public static boolean removeSeg(double id) {\n\n String sql = \"DELETE FROM corpus1 WHERE id = ?\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n // set the corresponding param\n pstmt.setDouble(1, id);\n // execute the delete statement\n pstmt.executeUpdate();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"removeSeg: \" + e.getMessage());\n return false;\n }\n }", "@Override\r\n\tpublic boolean deletePerson(int id) {\n\t\treturn false;\r\n\t}", "void eliminar(PK id);", "Ad selectByPrimaryKeyWithLogicalDelete(@Param(\"id\") Integer id, @Param(\"andLogicalDeleted\") boolean andLogicalDeleted);", "public <K> boolean remove(K key);", "public boolean removeVehicle(){\r\n veh = null;\r\n return true;\r\n }", "@Override\r\n\tpublic boolean deletetdfy(Long id) throws Exception {\n\t\treturn false;\r\n\t}", "public boolean keep(String group, String name, boolean boo){\r\n return kpd(group, name, boo, 0, 0.0, \"\", ar, ob, 0);\r\n }", "@Override\r\n\tpublic int delById(int id) {\n\t\tint flag=0;\r\n\t\ttry {\r\n\t\t\tString sql=\"DELETE FROM payedproduct WHERE PayedProduct_id=?\";\r\n\t\t\tflag= qr.update(sql, id);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "public abstract boolean remove(String name);", "public void remove(Integer id) {\n\r\n\t}", "public void setRemove(Boolean newValue);", "public void discardLeader(int bool){\n this.leaderCardsPanel.discardLeaderCard(bool);\n }", "public boolean removeParticle(VParticle p) {\n\t\treturn particles.remove(p);\n\t}" ]
[ "0.6530396", "0.65092754", "0.64097095", "0.6398837", "0.6032703", "0.6025428", "0.5957416", "0.5957416", "0.59173864", "0.59164315", "0.58834904", "0.5825397", "0.57797354", "0.5768732", "0.57359225", "0.5720322", "0.5716916", "0.5712104", "0.570708", "0.570708", "0.56710345", "0.5666464", "0.5665263", "0.5660055", "0.5660055", "0.5632329", "0.56319356", "0.56270427", "0.56202126", "0.5610883", "0.5610883", "0.5594739", "0.5594268", "0.55916005", "0.5588378", "0.5588378", "0.5588378", "0.5565604", "0.5558179", "0.5548221", "0.5548221", "0.5548221", "0.5543578", "0.5543276", "0.55333436", "0.55169326", "0.5516763", "0.5516763", "0.5515941", "0.5470497", "0.5449653", "0.54436547", "0.54436547", "0.543395", "0.5418872", "0.5407918", "0.5404506", "0.54044497", "0.5383151", "0.53788996", "0.5367708", "0.5361072", "0.5351143", "0.5348505", "0.5342458", "0.5331914", "0.5326738", "0.5323745", "0.53048396", "0.5300518", "0.52957803", "0.5289514", "0.5286498", "0.5279139", "0.5279139", "0.52743155", "0.52722746", "0.527204", "0.52683926", "0.52644676", "0.52558154", "0.5255361", "0.52456087", "0.52394354", "0.5236223", "0.5232843", "0.5210359", "0.52006495", "0.51980776", "0.5196261", "0.51933825", "0.5191539", "0.5173287", "0.51665616", "0.516012", "0.5159954", "0.51570946", "0.5154411", "0.51508087", "0.5149719" ]
0.64701426
2
Is park exists by id boolean.
public boolean isParkExistsById(long idPark) { try(CallableStatement callStmt = getConnection().prepareCall("{ ? = call is_park_exists_by_id(?) }")) { callStmt.registerOutParameter(1, OracleTypes.CURSOR); callStmt.setLong(2, idPark); callStmt.execute(); ResultSet rSet = (ResultSet) callStmt.getObject(1); if (!rSet.isBeforeFirst()) { closeAll(); return false; }else { closeAll(); return true; } } catch (SQLException e) { return false; } finally { closeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasParkingId();", "boolean hasParkingId();", "boolean hasParkingId();", "public boolean exists(String id);", "boolean exists(PK id);", "boolean exists(Integer id);", "public boolean isExist(Serializable id);", "boolean existsByNameAndId(String name, int id);", "public boolean exists( Integer idConge ) ;", "@Override\n public boolean exists(Long id) {\n return false;\n }", "@Override\n public boolean exists(Long id) {\n return false;\n }", "boolean hasPokerId();", "public boolean exists(String id) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean exists(String id) {\n\t\treturn false;\r\n\t}", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "boolean hasId();", "public boolean existsById(Integer id) {\n\t\treturn false;\n\t}", "Boolean findExistsCampania(GestionPrecioID id) ;", "@Override\n\tpublic boolean existsById(Integer id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic Boolean exists(Integer id) {\n\t\treturn null;\n\t}", "public boolean existsKey(int id) {\r\n return cjtMap.containsKey(id);\r\n }", "public boolean exists(MDSKey id) {\n Row row = table.get(id.getKey());\n if (row.isEmpty()) {\n return false;\n }\n\n byte[] value = row.get(COLUMN);\n return value != null;\n }", "boolean exists();", "boolean exists();", "public abstract boolean isNatureExist(long id);", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean existePorId(Long id);", "boolean hasPrerequisiteId();", "boolean hasFromId();", "boolean hasBusinessCircleId();", "boolean getExists();", "@Override\npublic boolean existsById(String id) {\n\treturn false;\n}", "public boolean exists(int id, int x, int y, int height) {\n\t\treturn objects.stream().anyMatch(object -> object.objectId == id && object.objectX == x && object.objectY == y && object.height == height);\n\t}", "@Override\n\tpublic boolean existe(Long id) {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean existe(Long id) {\n\t\treturn false;\n\t}", "boolean existeId(Long id);", "public boolean exists(String id) {\r\n\t\tString sql = \"SELECT 1 from GAME_SET where \" + GameSet.DbField.ID + \"=?\";\r\n\r\n\t\tCursor cursor = getDatabase().rawQuery(sql, new String[] { id });\r\n\t\tif (cursor.moveToFirst()) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public boolean getExists();", "public static boolean isExist(long id) {\n\t\tboolean exist = false;\n\t\tCursor c = null;\n\t\ttry {\n\t\t\tString sql = FavoriteColumns.ID + \"=\" + id;\n\n\t\t\tc = db.query(DBConst.TABLE_COURSE_FAVORITE, null, sql, null, null, null, null);\n\t\t\tif (c.moveToNext()) {\n\t\t\t\texist = true;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (c != null) {\n\t\t\t\tc.close();\n\t\t\t}\n\t\t}\n\t\treturn exist;\n\t}", "public abstract boolean exists();", "@Override\n public boolean contains(final String id) {\n return sidecarFile(id).exists();\n }", "boolean hasExists();", "@Override\n\tpublic boolean existId(String id) {\n\t\treturn false;\n\t}", "boolean isSetParlay();", "boolean hasPlayerId();", "@Override\n\tpublic boolean existsById(UUID id) {\n\t\treturn false;\n\t}", "boolean hasBidid();", "boolean hasPlayerBagId();", "boolean hasPlayerBagId();", "boolean hasPlayerBagId();", "public boolean checkExistenceId(int id) {\n\t\tfor (int i=0; i<getDataLength(); i++) {\n\t\t\tif (this.dataList.get(i).getId()==id)\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean existsMember(final String id);", "boolean hasParking();", "boolean hasQuestId();", "boolean hasQuestId();", "boolean hasQuestId();", "boolean hasQuestId();", "public boolean isIdExist(int projectId) throws EmployeeManagementException;", "private boolean contains(List<Box> boxes, int id){\n for(Box box : boxes){\n if(box.getId()==id){\n return true;\n }\n }\n return false;\n }", "public boolean hasParkingId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasParkingId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasParkingId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean exists(String id) throws Exception {\n boolean exists = false;\n try {\n this.openConnection();\n PreparedStatement st = this.getConnection().prepareStatement(\"SELECT COUNT(entry_id) FROM VideogameEntries WHERE entry_id=?\");\n st.setString(1, id);\n ResultSet rs = st.executeQuery();\n rs.next();\n exists = rs.getBoolean(1);\n } catch (Exception e) {\n throw new Exception(\"Method Delete VideogameEntries \" + e.getMessage());\n } finally {\n try {\n this.closeConnection();\n } catch (Exception e) {\n throw new Exception(\"Method delete VideogameEntries \" + e.getMessage());\n }\n }\n return exists;\n\n }", "public boolean hasParkingId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasParkingId() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }" ]
[ "0.76394457", "0.76394457", "0.76394457", "0.706092", "0.70336384", "0.69242877", "0.6813224", "0.6752218", "0.66508514", "0.65562075", "0.65562075", "0.6554009", "0.6553192", "0.65219843", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.6448677", "0.64316994", "0.6342156", "0.6340423", "0.6318929", "0.630475", "0.6291863", "0.628773", "0.628773", "0.62672037", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.6265076", "0.62620944", "0.62296075", "0.62204236", "0.61746126", "0.6128622", "0.6123741", "0.61099285", "0.609992", "0.609992", "0.60958385", "0.6087763", "0.6082833", "0.6051174", "0.60475534", "0.604049", "0.6020269", "0.5982488", "0.59821165", "0.5981552", "0.5980743", "0.5978271", "0.59682965", "0.59682965", "0.59682965", "0.5957504", "0.59376615", "0.59359324", "0.59012616", "0.59012616", "0.59012616", "0.59012616", "0.5894139", "0.58749425", "0.5872366", "0.5872366", "0.5872366", "0.5869955", "0.5861287", "0.5861287" ]
0.7378449
3
Gets last park created.
public long getLastParkCreated() { try(CallableStatement callStmt = getConnection().prepareCall("{ ? = call get_last_park_created() }")) { callStmt.registerOutParameter(1, OracleTypes.CURSOR); callStmt.execute(); ResultSet rSet = (ResultSet) callStmt.getObject(1); if (rSet.next()) { long res = rSet.getLong(1); closeAll(); return res; }else{ closeAll(); return 0; } } catch (SQLException e) { return 0; } finally { closeAll(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Checkpoint lastCheckpoint(){\n if(!checkpointRecordFile.exists()){\n return null;\n }\n return lastCheckpoint(rootDir);\n }", "public GPoint getLastPoint() {\n\t\treturn (points.size() > 0) ? points.get(points.size() - 1) : null;\n\t}", "public Epoch getLastEpoch() {\n epochsLock.lock();\n if (epochs.isEmpty()) {\n epochsLock.unlock();\n return null;\n }\n //Epoch epoch = epochs.get(epochs.size() - 1);\n Epoch epoch = epochs.get(ets); // the last epoch corresponds to the current ETS\n epochsLock.unlock();\n return epoch;\n }", "public int getCreatedTime() {\n return instance.getCreatedTime();\n }", "public Timestamp getCreated() {\n return created;\n }", "public java.lang.Long getCreated() {\n return created;\n }", "public Timestamp getLastCompetition() {\r\n return lastCompetition;\r\n }", "public java.lang.Long getCreated() {\n return created;\n }", "public Date getLatestProkaryoteUpdate() {\n return getLatestUpdate(namespace + \".genome_prok\");\n }", "public int getParkingTime() {\r\n\t\treturn parkingTime;\r\n\t}", "public LocalDateTime getCreatedTime() {\n return (LocalDateTime) get(5);\n }", "@Override\n\tpublic java.util.Date getCheckpoint() {\n\t\treturn _userSync.getCheckpoint();\n\t}", "public OffsetDateTime getCreatedTime()\n\t{\n\t\treturn (OffsetDateTime) this.getKeyValue(\"Created_Time\");\n\n\t}", "public Date getJlastTime() {\n return jlastTime;\n }", "public DateTime creationTime() {\n return this.creationTime;\n }", "public String getLastP() {\n\t\treturn lastFieldP.getText();\n\t}", "public DateTime createdTime() {\n return this.createdTime;\n }", "long getCreatedTime();", "public OffsetDateTime timeCreated() {\n return this.timeCreated;\n }", "public long lastTime()\r\n/* 219: */ {\r\n/* 220:412 */ return this.lastTime.get();\r\n/* 221: */ }", "public Long getCreated() {\n if (created == null) {\n return Long.valueOf(0);\n } else {\n return created;\n }\n }", "public long getCreated() {\n\t\treturn m_created;\n\t}", "long getCreationTime();", "long getCreationTime();", "long getCreationTime();", "long getLastPersistenceTime();", "public String getName() {\n return \"last\";\n }", "Instant getCreated();", "public GPoint last() {\n\t\tif (points.isEmpty()) {\n\t\t\tthrow new IllegalStateException(\"line group is empty\");\n\t\t}\n\t\treturn points.get(points.size() - 1);\n\t}", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "public Timestamp getCreated();", "@Override\n\tpublic java.util.Date getLastSavePoint() {\n\t\treturn _keHoachKiemDemNuoc.getLastSavePoint();\n\t}", "public long getCreatedTime() {\n return createdTime;\n }", "public DateTime lastTrainedDateTime() {\n return this.lastTrainedDateTime;\n }", "public long getCreationTime() {\n return creationTime;\n }", "public synchronized Post getLastPost() {\n try {\n this.connect();\n // the line below is commented because it returns the null value for summary\n // return linkedInTemplate.groupOperations().getGroupDetails(groupId).getPosts().getPosts().get(0);\n return getGroupPostsWithMoreInfo(1,0).get(0);\n } catch (Exception e) {\n log.debug(\"An exception occured when reading the last inserted post from group: \" + groupId);\n }\n return null;\n }", "public java.sql.Timestamp getCreated() {\n\treturn created;\n}", "public T getLast(){\n\treturn _end.getCargo();\n }", "public String getParkedLocation() {\n return parkedLocation;\n }", "public Date getCreatTime() {\n return creatTime;\n }", "public Date getCreatTime() {\n return creatTime;\n }", "public Date getLastTime() {\n return lastTime;\n }", "public java.lang.String getCreatedByName() {\n return createdByName;\n }", "public long getCreationTime() {\n return this.creationTime;\n }", "public LiveData<PersonEntity> getLatestEntry() {\n return latestPersonEntry;\n }", "public DateTime getCreationTime() {\n return created;\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public Long getTimeCreated() {\r\n\t\treturn timeCreated;\r\n\t}", "public Date getCreationTime()\n {\n return created;\n }", "public int getCreatedTime() {\n return createdTime_;\n }", "public Date getCreatedTime() {\n return createdTime;\n }", "public Date getCreatedTime() {\n return createdTime;\n }", "public Date getCreatedTime() {\n return createdTime;\n }", "public Date getLastHeard()\r\n\t{\r\n\t\treturn lastHeard;\r\n\t}", "public DataPoint getLastAddedPoint() {\n return lastAddedPoint;\n }", "public Date getCreationTime()\n\t{\n\t\treturn creationTime;\n\t}", "private static HashMap<String, String> getLastCheckpoint() {\n return checkpoints.remove(Thread.currentThread());\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public Date getCreationTime() {\n return creationTime;\n }", "public Long getCreationTimestamp() {\n return creationTimestamp;\n }", "public long getCreationTime();", "public DateTime getCreatedTimestamp() {\n\t\treturn this.createdTimestamp;\n\t}", "public OffsetDateTime createdDateTime() {\n return this.innerProperties() == null ? null : this.innerProperties().createdDateTime();\n }", "public long getCreationTime() {\n return creationTime_;\n }", "public LocalDateTime getCreationTime() {\n\t\treturn creationTime;\n\t}", "public String getLastEditTime() {\n return editedTimeList.get(editedTimeList.size() - 1);\n }", "public Date getLastSaved()\r\n {\r\n return (m_lastSaved);\r\n }", "public Integer getCreated() {\r\n return created;\r\n }", "public DateTime getCreationTime() { return creationTime; }", "public long getStamp() {\n return stamp;\n }", "public int getCreated() {\n return created;\n }", "public List getLastParameters() {\n return lastParameters_;\n }", "private Date computeLastDate() {\n\t\tSyncHistory history = historyDao.loadLastOk();\n\t\tif (history != null) {\n\t\t\treturn history.getTime();\n\t\t}\n\t\treturn new Date(-1);\n\t}", "@SuppressWarnings(\"unused\")\n Date getLastUpdateTime();", "public java.util.Date getCreatedTime() {\n return this.createdTime;\n }", "public String getCreated() {\n return this.created;\n }", "public String getCreated() {\n return this.created;\n }", "public abstract long getCreated();", "public Date getCreationTime() {\n\n\t\treturn createdAtTime;\n\t}", "public long getLastUpdate() {\n return this.lastUpdate;\n }", "public Instant getCreationTime() {\n return creation;\n }", "public long getLastUpdateTime() {\n return this.lastUpdateTime;\n }", "public DateTime createdDateTime() {\n return this.createdDateTime;\n }", "public Date getPutintime() {\n return putintime;\n }", "public Integer getCreated() {\n return created;\n }", "public String getCreatedTime() {\n return this.CreatedTime;\n }", "public String getCreatedTime() {\n return this.CreatedTime;\n }", "public String getCreatedTime() {\n return createdTime;\n }", "public Date getCreated() {\r\n return created;\r\n }" ]
[ "0.5645027", "0.56005275", "0.5532153", "0.54711187", "0.54545903", "0.5434724", "0.5433039", "0.54313093", "0.5409472", "0.5402508", "0.5400554", "0.5366663", "0.5340793", "0.53395015", "0.53319216", "0.5331647", "0.53305876", "0.5320356", "0.530909", "0.5308872", "0.5301362", "0.52968544", "0.52894145", "0.52894145", "0.52894145", "0.52859825", "0.52775055", "0.5271044", "0.52653617", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52628326", "0.52576804", "0.5256602", "0.5249577", "0.52297086", "0.5222115", "0.5218286", "0.5216056", "0.5213721", "0.5213428", "0.5213428", "0.52114373", "0.52110183", "0.5205552", "0.5200346", "0.52003354", "0.5199554", "0.51903397", "0.5179621", "0.5173959", "0.5172774", "0.5172774", "0.5172774", "0.5170935", "0.5170821", "0.51672727", "0.516205", "0.51591116", "0.51591116", "0.51458246", "0.5143405", "0.51429945", "0.51396364", "0.5138456", "0.5133423", "0.51293117", "0.5124524", "0.51221657", "0.5117642", "0.51158804", "0.5115133", "0.5110765", "0.5104948", "0.5103682", "0.5103041", "0.51019883", "0.51019883", "0.50903696", "0.5088013", "0.5085395", "0.5078354", "0.50770485", "0.50757927", "0.5075718", "0.5074688", "0.5071751", "0.5071751", "0.5067773", "0.5064279" ]
0.6903149
0
Constructor de Traduccion con parametros
public Traduccion(Date fecha, String descripcion, Boolean completa, String texto, Parrafo parrafo, Idioma idioma) { super(fecha, descripcion, completa); this.idioma = idioma; this.parrafo = parrafo; this.texto = texto; // TODO Auto-generated constructor stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Trabajador() {\n\t\tsuper();\n\t}", "public AntrianPasien() {\r\n\r\n }", "public TTau() {}", "public TCubico(){}", "public MessageTran() {\n\t}", "public Pasien() {\r\n }", "public Transportista() {\n }", "public Trabajador(String nombre, String apellidos, String id, String email,\n\t\t\t\t\t String telefono, String direccion, Integer delegacionAsignada,\n\t\t\t\t\t Date antiguedad, ListadoProyectos proyectosAsignados,\n\t\t\t\t\t String horarioLaboral, String pass, Integer idTrabajador) {\n\t\tsuper(nombre, apellidos, id, email, telefono, direccion, delegacionAsignada, antiguedad, proyectosAsignados);\n\t\tthis.horarioLaboral = horarioLaboral;\n\t\tthis.pass = pass;\n\t\tthis.idTrabajador = idTrabajador;\n\t}", "public tn(String paramString, ho paramho)\r\n/* 12: */ {\r\n/* 13:11 */ super(paramString, paramho);\r\n/* 14: */ }", "public Troco() {\n }", "protected Asignatura()\r\n\t{}", "Constructor() {\r\n\t\t \r\n\t }", "public MorteSubita() {\n }", "public TebakNusantara()\n {\n }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public TParametrosVOImpl() {\r\n }", "public Caso_de_uso () {\n }", "public TranscribedNote()\r\n {\r\n\r\n }", "public Alojamiento() {\r\n\t}", "public Truck(){\n }", "public CustomEntitiesTaskParameters() {}", "private TIPO_REPORTE(String nombre)\r\n/* 55: */ {\r\n/* 56: 58 */ this.nombre = nombre;\r\n/* 57: */ }", "public DetArqueoRunt () {\r\n\r\n }", "public Trabajador(String nombre, String puesto) {\n\t\t\n\t\tthis.nombre = nombre;\n\t\tthis.puesto = puesto;\n\t}", "private ControleurAcceuil(){ }", "public TdRuspHijo() { }", "public Tiempo2( int h ) { \n this( h, 0, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "public TradeData() {\r\n\r\n\t}", "protected AddTranscriptNodeModel() {\r\n this(1,2);\r\n }", "public TRIP_Sensor () {\n super();\n }", "public CuentaDeposito() {\n super();\n }", "public TblActividadUbicacion() {\r\n }", "public Constructor(){\n\t\t\n\t}", "public EstadosSql() {\r\n }", "public prueba()\r\n {\r\n }", "public RequestDatosUsuario(){\r\n\t\tsuper();\r\n\t}", "public Final_parametre() {\r\n\t}", "public Trabajo(Trabajador t, Servicio s, Oficio o, Instant fi) {\n\t\tthis.trabajador = t;\n\t\tthis.servicio = s;\n\t\tthis.oficio = o;\n\t\tthis.fechaInicio = fi;\n\t\tthis.fechaFinal = null;\n\t}", "public Candidatura (){\n \n }", "public Respuesta() {\n }", "private BaseDatos() {\n }", "public Transportador()\n {\n super();\n this.transporte = true;\n this.transporte_medico = false;\n this.classificacao = new HashMap<>();\n this.encomendas = new HashMap<>();\n this.raio = 0.0;\n }", "public Carrera(){\n }", "public CarteCaisseCommunaute() {\n super();\n }", "public FiltroRaEncerramentoComando() {\r\n }", "public Corso() {\n\n }", "public VueTroncon(Troncon troncon) {\r\n\t\tsuper();\r\n\t\tthis.troncon = troncon;\r\n\t}", "public MiradorTransaction(FujabaTransaction fujaba_tx) {\n tx_name_ = fujaba_tx.getName();\n tx_id_ = fujaba_tx.getId();\n merge_side_ = fujaba_tx.getMergeSide();\n initialize(fujaba_tx);\n }", "public Transportadora() {\r\n super();\r\n this.nif = \"\";\r\n this.raio = 0;\r\n this.precoKm = 0;\r\n this.classificacao = new Classificacao();\r\n this.estaLivre = true;\r\n this.velocidadeMed = 0;\r\n this.kmsTotal = 0;\r\n this.capacidade = 0;\r\n }", "public DetalleTablaComplementario() {\r\n }", "public DarAyudaAcceso() {\r\n }", "public Trening() {\n }", "public CCuenta()\n {\n }", "public Tigre() {\r\n }", "public Cuenta(Usuario usuario) { // constructor que crea objetos tipo cuenta que recibe por parámetro\n //un objeto de tipo usuario\n\n this.usuario = usuario;\n saldo = 0;\n }", "public BaseParameters(){\r\n\t}", "public Vehiculo() {\r\n }", "public Tarifa() {\n ;\n }", "public Achterbahn() {\n }", "public Telefone() {\n\t}", "public Tra() {\n super();\n initComponents();\n loadData();\n }", "public Postoj() {}", "public Chauffeur() {\r\n\t}", "public NEATTranscriberBain() {\n\t}", "public Funcionario() {\r\n\t\t\r\n\t}", "public ConsultaMedica() {\n super();\n }", "public InventarioControlador() {\n }", "public Tiempo2( Tiempo2 tiempo ) {\n // invoca al constructor de Tiempo2 con tres argumentos\n this( tiempo.obtenerHora(), tiempo.obtenerMinuto(), tiempo.obtenerSegundo() );\n }", "public ContaBancaria() {\n }", "public Clade() {}", "public solicitudControlador() {\n }", "public Telefone() {\n\t\t\n\t}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "public JogadorTradutor() {\n this.nome= \"Sem Registro\";\n this.pontuacao = pontuacao;\n id = id;\n \n geradorDesafioItaliano = new GerarPalavra(); // primeira palavra ja é gerada para o cliente\n }", "public TcUnidadEdoDTO() {\n }", "public TarjetaDebito() {\n\t\tsuper();\n\t}", "public HTTPResponse( Transaction t, Content ct ){\n super();\n\n Pia.debug(this, \"Constructor-- [ transaction t, content ct ] on duty...\");\n\n contentObj = ct;\n headersObj = new Headers(); // blank header\n\n if( contentObj != null )\n contentObj.setHeaders( headersObj );\n \n requestTran = t;\n fromMachine( t.toMachine() );\n toMachine( t.fromMachine() );\n startThread();\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public LecturaPorEvento() \r\n {\r\n }", "public EtatInitialisation(Controleur controleur) {\n super(controleur);\n super.rendControleur().lancerEcranDemarrage();\n }", "public Propuestas() {}", "public Transaksi() {\n initComponents();\n }", "public Tiempo2( int h, int m ) { \n this( h, m, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }", "public ControladorPrueba() {\r\n }", "public Personaje(Juego juego,Celda c) {\r\n\t\tsuper(juego,c);\r\n\t}", "public TransformationBuff() {}", "public Curso() {\r\n }", "public Tura() {\n\t\tLicznikTur = 0;\n\t}", "public Valvula(){}", "public Transform() {\n }", "public FiltroMicrorregiao() {\r\n }", "public Ctacliente() {\n\t}", "public CorreoElectronico() {\n }", "public FicheConnaissance() {\r\n }", "private InstantiateTransformer(Class[] paramTypes, Object[] args) {\n super();\n if (((paramTypes == null) && (args != null))\n || ((paramTypes != null) && (args == null))\n || ((paramTypes != null) && (args != null) && (paramTypes.length != args.length))) {\n throw new IllegalArgumentException(\"InstantiateTransformer: The parameter types must match the arguments\");\n }\n if ((paramTypes == null) && (args == null)) {\n iParamTypes = null;\n iArgs = null;\n } else {\n iParamTypes = (Class[]) paramTypes.clone();\n iArgs = (Object[]) args.clone();\n }\n }", "public Entrada(String titulo, String descripcion, String enlace, String autor, String fecha, String categoria) {\n this.titulo = titulo;\n this.descripcion = descripcion;\n this.enlace = enlace;\n this.autor = autor;\n this.fecha = fecha;\n this.categoria = categoria;\n// this.imagen = imagen;\n }", "public TokenTransactions() {}", "public TdExpCurpDTO() {\n }", "public Busca(){\n }", "public Retangulo(double[] pLados) {\n super(pLados);\n /* invoca o construtor da classe Pai passando pLados como parametros. */\n }" ]
[ "0.7408739", "0.698846", "0.67313695", "0.6640271", "0.6625329", "0.66069883", "0.65869004", "0.6498683", "0.64779127", "0.6455248", "0.63805324", "0.6315534", "0.63090694", "0.62899977", "0.6280719", "0.6249772", "0.62266916", "0.6188898", "0.6167434", "0.6166706", "0.61323875", "0.61285913", "0.6124984", "0.6119332", "0.6113999", "0.60977304", "0.6090466", "0.60767555", "0.60745585", "0.60665834", "0.60632014", "0.60585177", "0.6054361", "0.60531133", "0.605136", "0.60479534", "0.6044152", "0.604192", "0.6035466", "0.6035269", "0.6029427", "0.602937", "0.60211843", "0.60185426", "0.60155743", "0.6013623", "0.6010331", "0.60083055", "0.60039586", "0.60027045", "0.5997282", "0.5994946", "0.5985873", "0.5983758", "0.5981905", "0.59789616", "0.5972552", "0.5971469", "0.5969601", "0.5965943", "0.59652877", "0.5962728", "0.5958067", "0.5957584", "0.5953233", "0.594887", "0.5939747", "0.59395957", "0.59380513", "0.5935587", "0.59348285", "0.59335685", "0.59260166", "0.5921854", "0.59194624", "0.5918617", "0.59094083", "0.5905234", "0.59030086", "0.5897819", "0.5897174", "0.58925366", "0.58922106", "0.58886945", "0.58875805", "0.588165", "0.5880398", "0.5876147", "0.5868893", "0.5867302", "0.58649975", "0.58626306", "0.58588886", "0.5857252", "0.5856705", "0.5855558", "0.5847898", "0.58402634", "0.5839202", "0.58382016" ]
0.5905452
77
Informa cual es el idioma original del documento que se esta traduciendo
public Idioma getIdiomaOriginal() { return this.getParrafo().getDocumento().getIdioma(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String prepareLegalDocuments();", "private void cargarCodDocente() {\n ClsNegocioDocente negoDoc = new ClsNegocioDocente(); \n txtCodDocente.setText(negoDoc.ObtenerCodigo());\n try {\n negoDoc.conexion.close();\n } catch (SQLException ex) {\n Logger.getLogger(FrmCRUDDocente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public String getInoDocname();", "public void crearIndiceInvertido() throws IOException {\n BufferedReader archivoVocabulario = new BufferedReader(new InputStreamReader(new FileInputStream(this.rutaVocabulario), \"utf-8\"));\n String lineaVocabularioActual = archivoVocabulario.readLine();\n\n while(lineaVocabularioActual != null){\n String[] entradaVocabulario = lineaVocabularioActual.split(\"\\\\s\");\n this.archivoIndice.escribirEnArchivo(entradaVocabulario[0] + \" \" + this.posicionActual + \" \" + entradaVocabulario[1], true);\n this.posicionActual += Integer.parseInt(entradaVocabulario[1]);\n\n System.out.println(\"Palabra: \" + entradaVocabulario[0] + \" agregada al índice\\n\");\n\n Integer archivosEncontrados = 0;\n Integer archivoFrecuenciaActual = 0;\n while(archivoFrecuenciaActual < this.cantidadDocumentos){\n System.out.println(\"Archivo \" + archivoFrecuenciaActual + \"\\n\");\n if(archivosEncontrados < Integer.parseInt(entradaVocabulario[1])){\n /** Carga el archivo de frecuencia */\n BufferedReader archivoFrecuencia = new BufferedReader(new InputStreamReader(new FileInputStream(this.rutaFrecuencias + \"/\" + archivoFrecuenciaActual + \".freq\"), \"utf-8\"));\n String lineaFrecuenciaActual = archivoFrecuencia.readLine();\n\n while(lineaFrecuenciaActual != null){\n String[] entradaFrecuencia = lineaFrecuenciaActual.split(\"\\\\s\");\n\n if(entradaFrecuencia[0].equals(entradaVocabulario[0])){\n Double tf = 1 + log(Double.parseDouble(entradaFrecuencia[1]));\n Double idf = log(1 + (cantidadDocumentos/Integer.parseInt(entradaVocabulario[1])));\n Double peso = tf*idf;\n\n this.archivoPostings.escribirEnArchivo(archivoFrecuenciaActual + \" \" + peso, true);\n archivosEncontrados++;\n System.out.println(\"posting agregado\\n\");\n break;\n }\n\n lineaFrecuenciaActual = archivoFrecuencia.readLine();\n }\n\n archivoFrecuencia.close();\n }\n else{\n System.out.println(\"no más postings\\n\");\n break;\n }\n archivoFrecuenciaActual++;\n }\n lineaVocabularioActual = archivoVocabulario.readLine();\n }\n\n archivoVocabulario.close();\n }", "public void processDocument() {\n\n\t\t// compact concepts\n\t\tprocessConcepts(concepts);\n\t}", "public String getDocumentNote();", "@Override\r\n\tpublic String getDocumentInfo() {\n\t\treturn null;\r\n\t}", "@Override\r\n protected void parseDocuments()\r\n {\n\r\n }", "public static LeanDocument readDocumentOld(String directory, int docID)\n throws IOException\n{\n // Open the document\n String corefFilename = directory + \"/\" + docID + \"/answer.key.corrected\";\n LeanDocument doc = new LeanDocument(docID);\n // This will keep track of the number of chains\n\n LineIterator fi = new LineIterator(new File(corefFilename));\n String line;\n while (fi.hasNext()) {\n line = fi.next();\n\n String[] parse = line.split(\",\");\n int currentID = Integer.parseInt(parse[0]);\n\n // int start = Integer.parseInt(parse[1]);\n // int end = Integer.parseInt(parse[2]);\n int corefID = Integer.parseInt(parse[3]);\n\n // The rest of the line belongs to the text of the NP\n StringBuilder npText1 = new StringBuilder(parse[4]);\n for (int i = 5; i < parse.length; i++) {\n npText1.append(\",\").append(parse[i]);\n }\n String npText = npText1.toString();\n // Make sure that we read the np until the end (across newlines)\n while (!npText.endsWith(\"<END>#\") && !npText.endsWith(\"<END>*\") && fi.hasNext()) {\n // add back the endl\n line = fi.next();\n npText1.append(\"\\n\").append(line);\n npText = npText1.toString();\n }\n if (npText.charAt(npText.length() - 1) == '#') {\n // we have a source\n npText = npText.substring(0, npText.length() - 6);\n\n // Now we have all the info, create a new np\n if (doc.NPchains.containsKey(currentID)) throw new RuntimeException(\"Id \" + currentID + \" read twice.\");\n doc.NPchains.put(currentID, corefID);\n TreeMap<Integer, Integer> cluster;\n if (corefID < 0 || !doc.clusters.containsKey(corefID)) {\n doc.numChains++;\n }\n if (doc.clusters.containsKey(corefID)) {\n cluster = doc.clusters.get(corefID);\n }\n else {\n cluster = new TreeMap<Integer, Integer>();\n doc.clusters.put(corefID, cluster);\n }\n cluster.put(currentID, currentID);\n\n }\n }\n // Take care of singleton clusters (marked -1)\n TreeMap<Integer, Integer> singl = doc.clusters.get(-1);\n if (singl != null) {\n int index = doc.numChains;\n for (Integer item : singl.keySet()) {\n TreeMap<Integer, Integer> cl = Maps.newTreeMap();\n cl.put(item, item);\n Integer itemInd = index--;\n doc.clusters.put(itemInd, cl);\n doc.NPchains.put(item, itemInd);\n }\n doc.clusters.remove(-1);\n }\n return doc;\n}", "protocol.VersionedTextDocumentIdentifier getTextDocument();", "public String getIddocument() {\r\n\t\treturn iddocument;\r\n\t}", "public Document readDocument();", "public String getDocumentNo();", "public String getDocumentNo();", "public String getDocumentNo();", "public boolean updateDocument(Document document, InputStream isDocument) {\n return false;\n }", "private DIdentificadorDoc obtenerIdentificadorDocMuisca(Long numeroDocumento,\n Integer ideFormato) throws\n DExcepcion {\n DCmdAccConsIdentificadorDoc cmdAccConsIdDoc = (DCmdAccConsIdentificadorDoc)\n getAccion(\"entradasalida.DCmdAccConsIdentificadorDoc\");\n //Documentos MUISCA solamente\n cmdAccConsIdDoc.inicializarConsPorId(numeroDocumento.longValue(), 1, true,\n ideFormato.intValue());\n cmdAccConsIdDoc.ejecutar();\n\n return cmdAccConsIdDoc.getIdentificadorDoc();\n }", "default String getOriginalText() {\n return meta(\"nlpcraft:nlp:origtext\");\n }", "@Override\n\t\t\tpublic String toString(int doc) throws IOException {\n\t\t\t\treturn null;\n\t\t\t}", "public void reParse() {\r\n \r\n \t\tSystem.out.println(\"Starting reparse\");\r\n \r\n \t\t// to reparse an entire document\r\n \r\n \t\t// A. remove all document positions & problem markers\r\n \t\tSystem.out.println(\"DUMPING POSITIONS\");\r\n \t\tdumpPositions();\r\n \t\ttry {\r\n \t\t\tgetFile().deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ZERO);\r\n \t\t\t_parseErrors.clear();\r\n \t\t} catch (CoreException e) {\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \r\n \t\t// if this is not set, the document is new and has never been parsed before.\r\n \t\tif (_doc == null) {\r\n \t\t\tgetProjectNature().addToModel(this);\r\n \t\t} else {\r\n \r\n \t\t\t// B. remove compilation unit from model tree\r\n \t\t\tif(Config.debug()) {\r\n \t\t\t System.out.println(\"removing compilation unit from tree\");\r\n \t\t\t}\r\n \t\t\t// C. remove Document from project\r\n \t\t\tif(Config.debug()) {\r\n \t\t\t\tSystem.out.println(\"Remove document from project\");\r\n \t\t\t}\r\n \t\t\tgetProjectNature().removeDocument(this);\r\n \r\n \t\t\t// D. Re-add Document to the project (wich will cause it to be parsed)\r\n \t\t\tif(Config.debug()) {\r\n \t\t\t System.out.println(\"Re-add document to project\");\r\n \t\t\t}\r\n \t\t\tNamespace root = getProjectNature().getModel();\r\n \t\t\tgetProjectNature().addModelElement(this, root);\r\n \t\t}\r\n \r\n \t\tSystem.out.println(\"Einde reparse\");\r\n \t}", "public String getDocument() throws Exception;", "Documento getDocumento();", "public boolean isSameDocument(ChameleonDocument cd){\r\n \t\treturn _path.toOSString().equals(cd._path.toOSString());\r\n \t}", "private boolean canChangeDocuments() {\n\n // If the text is modified, give the user a chance to\n // save it. Otherwise return true.\n\n if (fDocument.isModified()) {\n byte save = askSave(this, getTitle());\n if (save == YES) {\n return doSave();\n }\n else {\n return save == NO;\n }\n }\n else {\n return true;\n }\n }", "boolean hasProofDocument();", "boolean hasProofDocument();", "private static void verifyAnkiNotesIntegrity() throws ClassNotFoundException {\n List<AnkiNote> notesWithoutPron = new AnkiDatabase().getNotesWithoutPron();\n for (AnkiNote note : notesWithoutPron) {\n String deutsch = note.getDeutsch();\n String tags = note.getTags();\n String articleError = \"Note has flag %s, but does not start with %s: %s%n\";\n //Notes with tag Femininum must have german field starting with e or r/e\n if (tags.contains(\"Femininum\") && !(deutsch.startsWith(\"e \") || deutsch.startsWith(\"r/e \"))) {\n System.err.printf(articleError, \"Femininum\", \"e or r/e\", note);\n }\n\n //Notes with tag Maskulinum must start with r or r/e or r/s\n if (tags.contains(\"Maskulinum\")\n && !(deutsch.startsWith(\"r \") || deutsch.startsWith(\"r/e \")\n || deutsch.startsWith(\"r/s \"))) {\n System.err.printf(articleError, \"Maskulinum\", \"r or r/e\", note);\n }\n\n //Notes with tag Neutrum must start with s or (s)\n if (tags.contains(\"Neutrum\")\n && !(deutsch.startsWith(\"s \") || deutsch.startsWith(\"(s) \")\n || deutsch.startsWith(\"r/s \"))) {\n System.err.printf(articleError, \"Neutrum\", \"s or (s)\", note);\n }\n\n //No nbsp; in notes!\n if (note.getFlds().contains(\"nbsp;\")) {\n System.err.printf(\"Note contains nbsp; :%s%n\", note);\n }\n\n //No special characters in words!\n String word = note.getWord();\n if (word != null && (word.contains(\"<\") || word.contains(\" \") || word.contains(\">\") || word.contains(\"­\"))) {\n System.err.printf(\"Note contains one of characters <, ,>,-: %s%n\", note);\n }\n\n //When note has Maskulinum, Femininum or Neutrum, then it must have wort\n if ((tags.contains(\"Maskulinum\") || tags.contains(\"Femininum\") || tags.contains(\"Neutrum\"))\n && !tags.contains(\"wort\")) {\n System.err.printf(\"Note has Maskulinu, Femininum or Neutrum, but doesn't have wort: %s%n\", note);\n }\n }\n }", "@Test\n\tpublic void probandoConParser() {\n\t\tString dBoxUrl = \"/home/julio/Dropbox/julio_box/educacion/maestria_explotacion_datos_uba/materias/cuat_4_text_mining/material/tp3/\";\n\t\tString modelUrl = dBoxUrl + \"NER/models/es-ner-person.bin\";\n\t\tString filesUrl = dBoxUrl + \"NER/archivoPrueba\";\n\t\tString sampleFile = filesUrl + \"/viernes-23-05-14-alan-fitzpatrick-gala-cordoba.html\";\n\t\tList<String> docs = getMyDocsFromSomewhere(filesUrl);\n\n\t\ttry {\n\t\t\t// detecting the file type\n\t\t\tBodyContentHandler handler = new BodyContentHandler();\n\t\t\tMetadata metadata = new Metadata();\n\t\t\tFileInputStream inputstream = new FileInputStream(new File(sampleFile));\n\t\t\tParseContext pcontext = new ParseContext();\n\n\t\t\t// Html parser\n\t\t\tHtmlParser htmlparser = new HtmlParser();\n\t\t\thtmlparser.parse(inputstream, handler, metadata, pcontext);\n\t\t\tSystem.out.println(\"Contents of the document:\" + handler.toString());\n\t\t\tSystem.out.println(\"Metadata of the document:\");\n\t\t\tString[] metadataNames = metadata.names();\n\n\t\t\tfor (String name : metadataNames) {\n\t\t\t\tSystem.out.println(name + \": \" + metadata.get(name));\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tAssert.fail();\n\t\t}\n\n\t}", "private void avaliaTagObrigatoria() throws SQLException {\r\n\t\t/*\r\n\t\t * busca as tags obrigatorias do documento.\r\n\t\t */\r\n\t\t// TODO ESTE SELECT SOH TRAZ A TAG !DOCTYPE, OU SEJA, SE ELE TRAZ AS\r\n\t\t// TAGS OBRIGATORIAS,\r\n\t\t// ENTAO ELE SOH TAH CONSIDERANDO O !DOCTYPE COMO OBRIGATORIO. OU ENTAO\r\n\t\t// TEM ALGUMA\r\n\t\t// COISA ERRADA NO BANCO DE DADOS. OBS: NA BASE DE DADOS SOH TEM\r\n\t\t// CADASTRADA UMA LINHA\r\n\t\t// COM ID_ATITUDE = 4 (TABELA ESPERADO) : (9,4,9,0,0,'','',0)\r\n\t\t// TRECHO COMENTADO E HARDCODED PARA DIMINUIR AS CONSULTAS A BANCO DE\r\n\t\t// DADOS\r\n\t\t// final String sql = \"SELECT ta.nome_tag, v.pv3 \"\r\n\t\t// + \" FROM esperado e, validante v, tipoavaliacaoerro t, tag ta \"\r\n\t\t// + \" WHERE e.idesperado=v.idesperado \"\r\n\t\t// + \" AND v.pv3=t.pv3 AND idatitude = 4 \"\r\n\t\t// + \" AND v.idtag=ta.idtag AND t.idorgao = \" + orgao;\r\n\t\t//\r\n\t\t// ResultSet rs = con.getCon().createStatement().executeQuery(sql);\r\n\t\t//\r\n\t\t// String nome = null;\r\n\t\t// ArrayList<Validado> validados = null;\r\n\t\t//\r\n\t\t// /*\r\n\t\t// * Monta as tags especificas.\r\n\t\t// */\r\n\t\t// while (rs.next()) {\r\n\t\t// nome = rs.getString(1);\r\n\t\t// validados = new ArrayList<Validado>();\r\n\t\t// validados.add(new Validado(nome, rs.getInt(2)));\r\n\t\t// this.erradosMap.put(nome, validados);\r\n\t\t// }\r\n\t\t// gambiarra?????\r\n\t\t// TRECHO HARDCODED QUE SUBSTITUI A CONSULTA AO BD ACIMA\r\n\r\n\t\tArrayList<ArmazenaErroOuAvisoAntigo> validados = new ArrayList<ArmazenaErroOuAvisoAntigo>();\r\n\r\n\t\tvalidados.add(new ArmazenaErroOuAvisoAntigo(\"!DOCTYPE\", 33));\r\n\r\n\t\tthis.erradosMap.put(\"!DOCTYPE\", validados);\r\n\r\n\t\t// FIM DO TRECHO\r\n\t\tfor (String element : this.erradosMap.keySet()) {\r\n\r\n\t\t\t/*\r\n\t\t\t * Verifica se a existencia da tag dentro do documento. N�o\r\n\t\t\t * existindo a tag, adiciona a mesma a lista de erros.\r\n\t\t\t */\r\n\t\t\tif (!tag.contains(element)) {\r\n\r\n\t\t\t\tthis.errados.addAll(this.erradosMap.get(element));\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public accionDocumentos() {\n \n }", "@Override\n public boolean isDocumentState() {\n return true;\n }", "String getATDocCodeID();", "private void readDocument(Attributes attrs) {\n this.state = DOC_TEXT_STATE;\n }", "public void fileReverted(OpenDefinitionsDocument doc) { }", "public void fileReverted(OpenDefinitionsDocument doc) { }", "public int getFromDocType ()\n {\n return this.fromDocType;\n }", "public int getFromDocType ()\n {\n return this.fromDocType;\n }", "public void getRawField(String path){\n\t\tString info; // content of each node\n\t\tArrayList<String> fileContent = new ArrayList<>();\n\t\tNodeList documentList = getDocumentsTagsPubmed(path);\n\t\tfor (int s = 0; s < documentList.getLength(); s++) { //transform document nodes in elements\n\t\t\tNode fstNode = documentList.item(s);\n\t\t\tElement element = (Element) fstNode;\n\t\t\tNodeList nodeList2 = element.getElementsByTagName(\"str\");\n\t\t\tfor (int j = 0; j < nodeList2.getLength(); j++) {\n\t\t\t\tNode text = nodeList2.item(j);\n\t\t\t\treadPubmedElements(fileContent,text);\n\t\t\t\tif(fileContent.get(0)!=null){\n\t\t\t\t\t//\tgetWindowSentences(List<String> tokenizedText, T, int window, fileContent.get(0));\n\t\t\t\t\tsaveContenttoFile(fileContent, \"Files\\\\result.txt\");\n\t\t\t\t\tfileContent.removeAll(fileContent);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public String getDocument() {\n\t\treturn null;\r\n\t}", "public String actualizarDocumento()\r\n/* 328: */ {\r\n/* 329: */ try\r\n/* 330: */ {\r\n/* 331:323 */ if ((!this.corrigeDatosRetencion) && (this.facturaProveedorSRI.getDocumento() != null) && \r\n/* 332:324 */ (this.facturaProveedorSRI.getDocumento().isIndicadorDocumentoElectronico()) && \r\n/* 333:325 */ (FuncionesUtiles.getAnio(this.facturaProveedorSRI.getFechaRegistro()) != 9999)) {\r\n/* 334:326 */ this.facturaProveedorSRI.setFechaEmisionRetencion(this.facturaProveedorSRI.getFechaRegistro());\r\n/* 335: */ }\r\n/* 336:329 */ cargarSecuencia(this.facturaProveedorSRI, AppUtil.getPuntoDeVenta());\r\n/* 337: */ }\r\n/* 338: */ catch (ExcepcionAS2 e)\r\n/* 339: */ {\r\n/* 340:331 */ addErrorMessage(getLanguageController().getMensaje(e.getCodigoExcepcion()) + e.getMessage());\r\n/* 341: */ }\r\n/* 342:333 */ return \"\";\r\n/* 343: */ }", "public void listarDocDaDisciplina(){\r\n for(int i=0;i<docentes.size();i++){\r\n System.out.println(docentes.get(i).toString());\r\n }\r\n }", "public void showOriginal()\n {\n try\n {\n String strLine,fileName;\n fileName = getFileName();\n File myFile = new File(MutationSystem.ORIGINAL_PATH,fileName);\n String blank_str;\n LineNumberReader lReader = new LineNumberReader(new FileReader(myFile));\n\n Document ddoc = originalTP.getDocument();\n\n while ((strLine=lReader.readLine()) != null)\n {\n \t blank_str = \"\";\n \t int del = (new Integer(lReader.getLineNumber())).toString().length();\n \t for (int k=0; k<5-del; k++)\n \t {\n \t blank_str=blank_str+\" \";\n }\n \t ddoc.insertString (ddoc.getLength(), lReader.getLineNumber()+blank_str, blue_attr);\n \t ddoc.insertString (ddoc.getLength(), strLine+\"\\n\", black_attr);\n }\n lReader.close();\n\n } catch (Exception e)\n {\n e.printStackTrace();\n System.err.println(\" [error] \" + e);\n }\n }", "public ArrayList<String> ModifBaseDescriptif(String nameWord){\n \n String uriWord = rootImportFiles + nameWord;\n String idActuel = null;\n Boolean erreur = false;\n int countUnderscore = 0;\n int countRows = 0;\n ArrayList<ArrayList<String>> docListe = new ArrayList<ArrayList<String>> (); //Création d'un format indicé\n ArrayList<String> returnListe = new ArrayList<String> ();\n returnListe.add(\"\");\n \n try {\n //Importer le word\n FileInputStream fis = new FileInputStream(uriWord);\n XWPFDocument doc = new XWPFDocument(OPCPackage.open(fis));\n List<XWPFTable> table = doc.getTables(); //on extrait tous les tableaux \n \n //Extraction des informations dans un format rigoureux et indicé\n for (XWPFTable xwpfTable : table) { \n //On se trouve dans un tableau particulier. On en extrait les lignes\n countRows = 0;\n String chaineDescription = \"\";\n String chaineParagraph = \"\";\n String runStyle = \"\";\n String testingRunStyle = \"\";\n Boolean first = true;\n ArrayList<String> tableau = new ArrayList<String>();\n List<XWPFTableRow> row = xwpfTable.getRows(); \n for (XWPFTableRow xwpfTableRow : row) { \n List<XWPFTableCell> cell = xwpfTableRow.getTableCells();\n //on extrait les cellules (même si on en a qu'une par ligne)\n for (XWPFTableCell xwpfTableCell : cell) { \n if(xwpfTableCell!=null) { \n if(countRows != 4){ //on est pas dans une description, pas besoin de traiter les styles\n tableau.add(xwpfTableCell.getText());\n }\n else{\n //on est dans une description. On extrait les styles\n for (XWPFParagraph paragraph : xwpfTableCell.getParagraphs()) {\n \n chaineParagraph = \"\";\n runStyle = \"\";\n \n first = true;\n for (XWPFRun run : paragraph.getRuns()) { //on extrait les runs\n \n testingRunStyle = \"normal\";\n \n //on test les textures\n if(!run.isBold() && run.getUnderline().toString().equals(\"SINGLE\") && !run.isItalic())\n testingRunStyle = \"u\";\n if(!run.isBold() && run.getUnderline().toString().equals(\"DASH\") && !run.isItalic())\n testingRunStyle = \"underlinedash\";\n if(!run.isBold() && run.getUnderline().toString().equals(\"NONE\") && run.isItalic())\n testingRunStyle = \"i\";\n if(!run.isBold() && run.getUnderline().toString().equals(\"SINGLE\") && run.isItalic())\n testingRunStyle = \"italic_underline\";\n if(run.isBold() && run.getUnderline().toString().equals(\"NONE\") && !run.isItalic())\n testingRunStyle = \"b\";\n if(run.isBold() && run.getUnderline().toString().equals(\"SINGLE\") && !run.isItalic())\n testingRunStyle = \"bold_underline\";\n if(run.isBold() && run.getUnderline().toString().equals(\"NONE\") && run.isItalic())\n testingRunStyle = \"bold_italic\";\n if(run.isBold() && run.getUnderline().toString().equals(\"SINGLE\") && run.isItalic())\n testingRunStyle = \"bold_underline_italic\";\n \n //on test les couleurs\n if(\"FF0000\".equals(run.getColor()))\n testingRunStyle = \"colorred\";\n if(\"E36C0A\".equals(run.getColor()))\n testingRunStyle = \"colororange\";\n if(\"00B050\".equals(run.getColor()))\n testingRunStyle = \"colorgreen\";\n if(\"0070C0\".equals(run.getColor()))\n testingRunStyle = \"colorblue\";\n \n //on test les surlignages\n if(\"yellow\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightyellow\";\n if(\"cyan\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightcyan\";\n if(\"red\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightred\";\n if(\"green\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightgreen\";\n if(\"magenta\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightmagenta\";\n if(\"lightGray\".equals(run.getTextHightlightColor().toString()))\n testingRunStyle = \"highlightgrey\";\n\n \n //si le style est différent de celui d'avant, on ferme le style d'avant et on ouvre le suivant\n if(!runStyle.equals(testingRunStyle)){\n //s'il y avait un style avant, on le ferme\n if(!first)\n chaineParagraph += \"</\"+runStyle+\">\";\n \n chaineParagraph += \"<\"+testingRunStyle+\">\"; //on ouvre la nouvelle balise de style\n chaineParagraph += run.text();\n runStyle = testingRunStyle;\n }\n else{\n chaineParagraph+= run.text();\n }\n first = false;\n } \n if(!\"\".equals(runStyle))\n chaineParagraph += \"</\"+runStyle+\">\"; //on ferme la dernière balise\n \n if(\"bullet\".equals(paragraph.getNumFmt())){\n chaineDescription += \"<li>\"+chaineParagraph+\"</li>\"; //verif si fermante\n }\n else{ \n chaineDescription += \"<p>\"+chaineParagraph+\"</p>\";\n }\n //chaineDescription += chaineParagraph;\n }\n \n tableau.add(chaineDescription); \n }\n }\n }\n countRows++;\n }\n docListe.add(tableau);\n \n } \n } catch(IOException | InvalidFormatException ex) {\n erreur = true;\n returnListe.set(0, \"Erreur système: l'API POI ne parvient pas à extraire les données\");\n }\n \n //si on a réussi à extraire les données du word, on peut démarrer l'exploitation des données\n if(!erreur){\n //on parcourt la liste des objets\n for(int i = 0; i < docListe.size(); i++){\n //on extrait l'identifiant et on déduit le type d'objet\n idActuel = docListe.get(i).get(0);\n //on compte le nombre de \"_\" dans l'ID\n countUnderscore = 0;\n for (int j = 0; j < idActuel.length(); j++) {\n if (idActuel.charAt(j) == '_') \n countUnderscore++;\n }\n\n JpaUtil.creerContextePersistance();\n try {\n if(countUnderscore < 4){\n if(docListe.get(i).get(1).equals(\"SUPPR\")){ //on traite les suppressions\n //on ajoute à la liste de sortie les idnetifiant à supprimer\n returnListe.add(idActuel);\n }\n else{ //on procède à l'insertion d'un \"titre\" dans la BD\n switch(countUnderscore){\n case 0: //on importe un chapitre en BD\n Chapitre chapitre = null;\n chapitre = chapitreDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(chapitre == null){ //on crée le chapitre\n chapitre = new Chapitre(idActuel, docListe.get(i).get(1));\n chapitreDao.Creer(chapitre);\n }\n else{ //on modifie l'intitule du chapitre\n chapitre.setIntituleChapitre(docListe.get(i).get(1));\n chapitreDao.Update(chapitre);\n } \n JpaUtil.validerTransaction();\n break;\n case 1: //on importe une categorie en BD\n Categorie categorie = null;\n categorie = categorieDao.ChercherParId(idActuel); //idActuel est l'identifiant de l'objet que l'on traite\n JpaUtil.ouvrirTransaction();\n if(categorie == null){ //on crée la categorie\n categorie = new Categorie(idActuel, docListe.get(i).get(1));\n categorieDao.Creer(categorie); \n //on va chercher le chapitre parent pour update listeCategorie\n Chapitre chapitreParent = chapitreDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<Categorie> listeCategorie = chapitreParent.getListCategorie();\n listeCategorie.add(categorie);\n chapitreParent.setListCategorie(listeCategorie);\n chapitreDao.Update(chapitreParent);\n } else { //on modifie l'initule de la categorie\n categorie.setIntituleCategorie(docListe.get(i).get(1));\n categorieDao.Update(categorie);\n } \n JpaUtil.validerTransaction();\n break; \n\n case 2: //on importe une categorie en BD\n Famille famille = null;\n famille = familleDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(famille == null){ //on crée la famille\n famille = new Famille(idActuel, docListe.get(i).get(1));\n familleDao.Creer(famille);\n //on va chercher la categorie parent pour update listeFamille\n Categorie categorieParent = categorieDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<Famille> listeFamille = categorieParent.getListeFamille();\n listeFamille.add(famille);\n categorieParent.setListeFamille(listeFamille);\n categorieDao.Update(categorieParent);\n }\n else{ //on modifie l'intitule de la famille\n famille.setIntituleFamille(docListe.get(i).get(1));\n familleDao.Update(famille);\n } \n JpaUtil.validerTransaction();\n break; \n case 3: //on importe une sousFamille en BD\n SousFamille sousFamille = null;\n sousFamille = sousFamilleDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(sousFamille == null){ //on crée la sousFamille\n sousFamille = new SousFamille(idActuel, docListe.get(i).get(1));\n sousFamilleDao.Creer(sousFamille);\n //on va chercher la famille parent pour update listeSousFamille\n Famille familleParent = familleDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<SousFamille> listeSousFamille = familleParent.getListSousFamille();\n listeSousFamille.add(sousFamille);\n familleParent.setListSousFamille(listeSousFamille);\n familleDao.Update(familleParent);\n }\n else{ //on modifie l'intitule de la sousFamille\n sousFamille.setIntituleSousFamille(docListe.get(i).get(1));\n sousFamilleDao.Update(sousFamille);\n } \n JpaUtil.validerTransaction();\n break;\n }\n }\n }\n //on procède au traitement d'un descriptif\n else{\n //on traite les ajouts\n if(docListe.get(i).get(1).equals(\"AJOUT\")){\n switch(docListe.get(i).get(2)){\n case \"OUVRAGE\":\n Ouvrage ouvrage = null;\n ouvrage = (Ouvrage) descriptifDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(ouvrage == null){ //on crée le chapitre\n ouvrage = new Ouvrage(idActuel, docListe.get(i).get(3), docListe.get(i).get(4), docListe.get(i).get(5), docListe.get(i).get(6));\n descriptifDao.Creer(ouvrage);\n //on va chercher la sousFamille parent pour update listeDescriptif\n SousFamille sousFamilleParent = sousFamilleDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<Descriptif> listeDescriptif = sousFamilleParent.getListDescriptif();\n listeDescriptif.add(ouvrage);\n sousFamilleParent.setListDescriptif(listeDescriptif);\n sousFamilleDao.Update(sousFamilleParent);\n }\n else{ //on modifie le titre du chapitre\n ouvrage.setNomDescriptif(docListe.get(i).get(3));\n ouvrage.setDescription(docListe.get(i).get(4));\n ouvrage.setCourteDescription(docListe.get(i).get(5));\n descriptifDao.Update(ouvrage);\n } \n JpaUtil.validerTransaction();\n break;\n case \"GENERIQUE\":\n Generique generique = null;\n generique = (Generique) descriptifDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(generique == null){ //on crée le chapitre\n generique = new Generique(idActuel, docListe.get(i).get(3), docListe.get(i).get(4), docListe.get(i).get(5));\n descriptifDao.Creer(generique);\n //on va chercher la sousFamille parent pour update listeDescriptif\n SousFamille sousFamilleParent2 = sousFamilleDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<Descriptif> listeDescriptif2 = sousFamilleParent2.getListDescriptif();\n listeDescriptif2.add(generique);\n sousFamilleParent2.setListDescriptif(listeDescriptif2);\n sousFamilleDao.Update(sousFamilleParent2);\n }\n else{ //on modifie le titre du chapitre\n generique.setNomDescriptif(docListe.get(i).get(3));\n generique.setDescription(docListe.get(i).get(4));\n generique.setCourteDescription(docListe.get(i).get(5));\n descriptifDao.Update(generique);\n } \n JpaUtil.validerTransaction();\n break; \n case \"PRESTATION\": \n Prestation prestation = null;\n prestation = prestationDao.ChercherParId(idActuel);\n JpaUtil.ouvrirTransaction();\n if(prestation == null){ //on crée la prestation\n prestation = new Prestation(idActuel, docListe.get(i).get(3), docListe.get(i).get(4), docListe.get(i).get(5), docListe.get(i).get(6));\n prestationDao.Creer(prestation);\n //on va chercher l'ouvrage parent pour update listeprestation\n Ouvrage ouvrageParent = (Ouvrage) descriptifDao.ChercherParId(idActuel.substring(0, idActuel.lastIndexOf('_'))); //on prend idActuel et on retire le dernier _ et ce qu'il y a derrière\n List<Prestation> listePrestation = ouvrageParent.getListePrestation();\n listePrestation.add(prestation);\n ouvrageParent.setListePrestation(listePrestation);\n descriptifDao.Update(ouvrageParent);\n }\n else{ //on modifie le titre de la prestation\n prestation.setNomDescriptif(docListe.get(i).get(3));\n prestation.setDescription(docListe.get(i).get(4));\n prestation.setCourteDescription(docListe.get(i).get(5));\n prestationDao.Update(prestation);\n } \n JpaUtil.validerTransaction();\n break;\n }\n }\n //on traite les suppressions\n else{\n //on ajoute à la liste de sortie les idnetifiant à supprimer\n returnListe.add(idActuel);\n }\n } \n } catch(Exception ex){\n returnListe.set(0, \"Problème d'insertion dans la base de donnée (problème de format?). ID: \"+idActuel);\n erreur = true;\n } finally {\n JpaUtil.fermerContextePersistance(); \n }\n }\n }\n \n if(!erreur){\n returnListe.set(0, \"Succes\");\n }\n \n return returnListe;\n }", "public int rtf() {\n/* 219 */ return this.m_dtmRoot;\n/* */ }", "public interface CoOriginalContent \n{\n\t/**\n\t * Returns the original filename of the content.\n\t * Should return null if original input was from a stream.\n\t */\n\tpublic String getOriginalFileName();\n\t\n\t/**\n\t * Loads binary data from the InputStream until there is nothing left to\n\t * read.\n\t * Creation date: (2001-10-05 09:44:46)\n\t * @param: InputStream is The InputStream to read from. \n\t */\n\tpublic void load(InputStream is) throws IOException;\n\t\n\t/**\n\t * Reads all data from the file at location fileName.\n\t * Creation date: (2001-10-05 09:48:39)\n\t * @param: String fileName The path to the file to read from.\n\t */\t\n\tpublic void\tload(String fileName) throws IOException;\n\t\n\t/**\n\t * Stores the binary data in this CoOriginalContent on the\n\t * OutputStream.\n\t * Creation date: (2001-10-05 09:50:18)\n\t * @param: OutputStream os The stream to write to.\n\t */\n\tpublic void save(OutputStream os) throws IOException;\n\t\n\t/**\n\t * Stores the binary data in this CoOriginalContent to the\n\t * file at the location specified.\n\t * @param: String fileName The Path to the file to write to.\n\t */\n\t public void save(String fileName) throws IOException;\n}", "public String getDocinfo() {\n return docinfo;\n }", "public long getDocumentName();", "public int getDocpositioncode() {\n\treturn docpositioncode;\n}", "public void RealizarDiagnostico() {\n\t\tSystem.out.println(\"realizar dicho diagnostico con los sintomas presentados por el paciente\");\r\n\t}", "public Obj decodeDocument()\n throws Exception\n { \n return decodeDocument(true);\n }", "public String getLBR_DocLine_ICMS_UU();", "@Override\r\n public String toString() {\n return tipodocumento;\r\n }", "public abstract String getOntologyEditorVersion();", "static void citajSveRedoveAlt(String imeFajla) {\n\n /* Koriste se pogodnosti biblioteke za citanje svih redova odjednom */\n Svetovid.out.println(Svetovid.in(imeFajla).readAll());\n\n }", "boolean hasDocument();", "boolean hasDocument();", "boolean hasDocument();", "public void startInfo(Document src);", "private int indexOfClef(Object c) {\n for (int i = 0; i < nbAssoc; i++)\n if (associations[i].premier().equals(c))\n return i;\n return -1;\n }", "public void reset() {\n\t\tfor (int i = 0; i < markedElements.size(); i++) {\n\t\t\tif (markedElements.get(i) instanceof Word) {\n\t\t\t\tWord word = (Word) markedElements.get(i);\n\t\t\t\teditor.setCaretPosition(word.getEndPosition() + 1);\n\t\t\t\tint start = word.getStartPosition();\n\t\t\t\tint end = word.getEndPosition();\n\t\t\t\tdoc.setCharacterAttributes(start, end - start + 1, PLAIN, true);\n\t\t\t} else if (markedElements.get(i) instanceof FunctionWord) {\n\t\t\t\tFunctionWord fword = (FunctionWord) markedElements.get(i);\n\t\t\t//\tif(fword.getWord().getEndPosition()!= fword.getEndPosition()) {\n\t\t\t\t\t// fword ist teil eines gr��eren Wortes-> Endposition als caretposition verwenden\n\t\t\t//\t\teditor.setCaretPosition(fword.getEndPosition() + 1);\n\t\t\t//\t}\n\t\t\t//\telse {\n\t\t\t\t\teditor.setCaretPosition(fword.getEndPosition() + 1);\n\t\t\t//\t}\n\t\t\t\tint start = fword.getStartPosition();\n\t\t\t\tint end = fword.getEndPosition();\n\t\t\t\tdoc.setCharacterAttributes(start, end - start + 1, PLAIN, true);\n\t\t\t} else if (markedElements.get(i) instanceof ConstitutiveWord) {\n\t\t\t\tConstitutiveWord cword = (ConstitutiveWord) markedElements\n\t\t\t\t\t\t.get(i);\n\t\t\t\teditor.setCaretPosition(cword.getEndPosition() + 1);\n\t\t\t\tint start = cword.getStartPosition();\n\t\t\t\tint end = cword.getEndPosition();\n\t\t\t\tdoc.setCharacterAttributes(start, end - start + 1, PLAIN, true);\n\t\t\t} else if (markedElements.get(i) instanceof IllocutionUnit) {\n\t\t\t\tIllocutionUnit iu = (IllocutionUnit) markedElements.get(i);\n\t\t\t\tfor (int j = 0; j < iu.getTokens().size(); j++) {\n\t\t\t\t\tToken token = (Token) iu.getTokens().get(j);\n\t\t\t\t\tint start = token.getStartPosition();\n\t\t\t\t\tint end = token.getEndPosition();\n\t\t\t\t\tdoc.setCharacterAttributes(start, end - start + 1, PLAIN,\n\t\t\t\t\t\t\ttrue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmarkedElements.clear();\n\t\tdesignText(Model.getIllocutionUnitRoots());\n\t}", "boolean hasTextDocument();", "private List<PreDocumentoEntrata> getPreDocumentiEntrata() {\t\n\t\tif(req.getRicercaSinteticaPreDocumentoEntrata()!=null){\n\t\t\treturn ricercaSinteticaPreDocumentoEntrata();\n\t\t}\n\t\t\n\t\treturn req.getPreDocumentiEntrata();\n\t\t\n\t\t\n\t}", "protected String loadDocumentDetails()\r\n\t{\r\n\t\tsetC_Currency_ID (NO_CURRENCY);\r\n\t\tX_M_Production prod = (X_M_Production)getPO();\r\n\t\tsetDateDoc (prod.getMovementDate());\r\n\t\tsetDateAcct(prod.getMovementDate());\r\n\t\t//\tContained Objects\r\n\t\tp_lines = loadLines(prod);\r\n\t\tif (log.isLoggable(Level.FINE)) log.fine(\"Lines=\" + p_lines.length);\r\n\t\treturn null;\r\n\t}", "private static String createOriginalDocumentBody(DocumentNode document) {\n\t\tStringBuilder text = new StringBuilder();\n\t\tNode childNode;\n\t\tint size;\n\t\t\n\t\ttry {\n\t\t\tsize = document.numberOfChildren();\n\t\t} catch (NullPointerException e) {\n\t\t\tsize = 0;\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tchildNode = document.getChild(i);\n\n\t\t\tif ((childNode instanceof ForLoopNode)) {\n\t\t\t\ttext.append(getText(childNode));\n\t\t\t} else {\n\t\t\t\ttext.append(childNode.getText());\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn text.toString();\n\t}", "private static void collectVariables(Document document){\n //collecting all the nodes inside a list\n nodeList = document.selectNodes(NOTES);\n\n //initialising the lists\n entriesList = new ArrayList<>();\n locationsList = new ArrayList<>();\n attachmentList = new ArrayList<>();\n tagsForEntryList = new ArrayList<>();\n\n //hashSet for handling the duplicate fileNames\n fileNameSet = new LinkedHashSet<>();\n\n //linkedHashMap for storing the uid for each tag\n uidForEachTag = new LinkedHashMap<>();\n uidForEachLocation = new LinkedHashMap<>();\n\n //id set for storing unique location id\n locationsIdSet = new LinkedHashSet<>();\n\n Tags tags;\n Location location;\n Entry entry;\n Attachment attachment;\n\n byte[] decoded = null;\n\n //looping through the list\n for(Node node : nodeList){\n\n String title = \"\";\n String parsedHtml = \"\";\n String formattedDate = \"\";\n String location_uid = \"\";\n String mime = \"\";\n String fileName = \"\";\n String attachment_uid = null;\n String entry_uid = \"\";\n String type = \"photo\";\n String baseEncoding;\n String tag_uid = \"\";\n\n //get all tags including duplicates\n if( node.selectSingleNode(TAG) !=null) {\n List<Node> evernote_tags = node.selectNodes(TAG);\n for (Node evenote_tag : evernote_tags) {\n //generate unique id for the tag and map it.\n //if the name id pair does not exist\n if(!uidForEachTag.containsKey(evenote_tag.getText())) {\n uidForEachTag.put(evenote_tag.getText(), Entry.generateRandomUid());\n }\n //create new diaro.Tags Object\n tags = new Tags(uidForEachTag.get(evenote_tag.getText()),evenote_tag.getText());\n tagsForEntryList.add(tags);\n }\n }\n\n //get all Locations\n // using diaro.Entry.concatLatLng to add title as {<Latitude></Latitude>,<Longitude></Longitude>}\n if( node.selectSingleNode(LATITUDE) != null && node.selectSingleNode(LONGITUDE) != null) {\n String latitude = String.format(\"%.5f\",Double.parseDouble(node.selectSingleNode(LATITUDE).getText()));\n String longitude = String.format(\"%.5f\",Double.parseDouble(node.selectSingleNode(LONGITUDE).getText()));\n String location_title = (ImportUtils.concatLatLng(latitude, longitude));\n\n //mapping every uid to the address\n if(!uidForEachLocation.containsKey(location_title)) {\n uidForEachLocation.put(location_title, Entry.generateRandomUid());\n }\n location_uid = uidForEachLocation.get(location_title);\n location = new Location(location_uid,latitude,longitude,location_title, location_title, DEFAULT_ZOOM);\n if (!locationsIdSet.contains(location.location_uid)) {\n locationsList.add(location);\n locationsIdSet.add(location.location_uid);\n }\n }\n\n //get all Entries\n if(node.selectSingleNode(TITLE) != null ){\n title = node.selectSingleNode(TITLE).getText();\n }\n if(node.selectSingleNode(CONTENT) != null ){\n String text = node.selectSingleNode(CONTENT).getText();\n // using Jsoup to parseXml HTML inside Content\n parsedHtml = Jsoup.parse(text).text();\n }\n if(node.selectSingleNode(CREATED) != null){\n String date = node.selectSingleNode(CREATED).getText().substring(0, 8);\n String month = date.substring(4, 6);\n String day = date.substring(6, 8);\n String year = date.substring(2, 4);\n formattedDate = String.format(\"%s/%s/%s\", month, day, year);\n }\n\n //get all the tags\n //append all the string stringBuilder\n if(tagsForEntryList.size() != 0){\n for(Tags tag : tagsForEntryList) {\n tag_uid = tag_uid + (\",\") + (String.join(\",\", tag.tagsId));\n }\n tag_uid = tag_uid + (\",\");\n System.out.println(tag_uid);\n\n }\n entry = new Entry();\n entry.setUid(Entry.generateRandomUid());\n entry.setTz_offset(OFFSET);\n entry.setDate(formattedDate);\n entry.setText(parsedHtml);\n entry.setTitle(title);\n entry.setFolder_uid(FOLDER_UID);\n entry.setLocation_uid(location_uid);\n entry.setTags(tag_uid);\n //clear the list\n //clear the tag_uid variable for next loop\n tagsForEntryList.clear();\n tag_uid = \"\";\n //add entry in the list\n entriesList.add(entry);\n\n //get all the attachments\n if (node.selectSingleNode(RESOURCE) != null) {\n List<Node> attachmentsForEachEntry = node.selectNodes(RESOURCE);\n //loop through all the attachments for a single note/entry\n for (Node attachmentForeach : attachmentsForEachEntry) {\n try {\n mime = attachmentForeach.selectSingleNode(MIME).getText();\n\n }catch( NullPointerException e){\n e.printStackTrace();\n }\n // check for a valid attachment\n if(checkForImageMime(mime)) {\n try {\n fileName = attachmentForeach.selectSingleNode(RESOURCE_ATTRIBUTE_FILENAME).getText();\n attachment_uid = Entry.generateRandomUid();\n entry_uid = entry.uid;\n baseEncoding = attachmentForeach.selectSingleNode(DATA).getText();\n //----- please do a check for valid Base64--\n decoded = Base64.getMimeDecoder().decode(baseEncoding);\n // assign primary_photo uid to entry\n entry.primary_photo_uid = attachment_uid;\n }catch(IllegalArgumentException | NullPointerException e){\n e.printStackTrace();\n }\n // check if the fileName already exists\n // if true generate a new fileName to prevent duplicates\n if(fileNameSet.add(fileName)){\n fileNameSet.add(fileName);\n attachment = new Attachment(attachment_uid, entry_uid, type,fileName,decoded);\n }else{\n String newFileName = ImportUtils.generateNewFileName(fileName);\n fileNameSet.add(newFileName);\n attachment = new Attachment(attachment_uid, entry_uid, type,newFileName,decoded);\n }\n attachmentList.add(attachment);\n }\n }\n }\n }\n\n }", "boolean isContentGenerated();", "public void ach_doc_type_txt_test () {\n\t\t\n\t}", "private void handleDocument(String name,InputStream ins)\n{\n Map<String,Integer> words = new HashMap<>();\n Map<String,Integer> kgrams = new HashMap<>();\n \n try {\n String cnts = IvyFile.loadFile(ins);\n CompilationUnit cu = JcompAst.parseSourceFile(cnts);\n words = handleDocumentText(cnts);\n kgrams = buildKgramCounts(cnts,cu);\n }\n catch (IOException e) {\n IvyLog.logI(\"Problem reading document file \" + name + \": \" + e);\n }\n \n if (words.size() > 0) {\n ++total_documents;\n for (String s : words.keySet()) {\n Integer v = document_counts.get(s);\n if (v == null) document_counts.put(s,1);\n else document_counts.put(s,v+1);\n }\n }\n if (kgrams.size() > 0) {\n ++total_kdocuments;\n for (String s : kgrams.keySet()) {\n Integer v = kgram_counts.get(s);\n if (v == null) kgram_counts.put(s,1);\n else kgram_counts.put(s,v+1);\n }\n }\n}", "@RequestMapping(path = \"documentos\", method = RequestMethod.PUT)\n\tpublic @ResponseBody boolean actualizarDocumento(@RequestBody String docJSON) {\n\t\ttry {\n\t\t\tDocumento doc = null;\n\t\t\tboolean editar;\n\t\t\tlog.info(\"docJSON: \"+docJSON);\n\t\t\tlog.info(\"A: \"+docJSON.contains(\"accion\"));\n\t\t\tif (docJSON.contains(\"accion\")){\n\t\t\t\t//Si tiene accion es porque solo se esta editando el estado...\n\t\t\t\tdocJSON = docJSON.substring(0, docJSON.length()-19)+\"}\";\n\t\t\t\tdoc = mapper.readValue(docJSON, Documento.class);\n\t\t\t\teditar = true;\n\t\t\t}else{\n\t\t\t\tdoc = mapper.readValue(docJSON, Documento.class);\n\t\t\t\teditar = false;\n\t\t\t}\n\t\t\treturn documentoServicio.actualizar(doc, editar);\n\t\t} catch (Exception ex) {\n\t\t\tlog.error(\"=====\\nError Ctrl:(actualizarDocumento):\\n\" + ex.getMessage()+\"\\n\");\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public void process(IeDocument document) {\n\n }", "SingleDocumentModel getCurrentDocument();", "public int getC_DocTypeTarget_ID();", "private DefaultNucleotideSequence convertDocument(AnnotatedPluginDocument document) throws DocumentOperationException {\n if(document.getDocument() instanceof DefaultNucleotideSequence) {\n return (DefaultNucleotideSequence)document.getDocument();\n } else if (document.getDocument() instanceof NucleotideSequenceDocument) {\n NucleotideSequenceDocument seqDoc = (NucleotideSequenceDocument)document.getDocument();\n String seqString = seqDoc.getSequenceString();\n List<SequenceAnnotation> annotations = seqDoc.getSequenceAnnotations();\n\n DefaultNucleotideSequence nucSeq = new DefaultNucleotideSequence(document.getName(), seqString);\n nucSeq.setAnnotations(annotations);\n nucSeq.setCircular(seqDoc.isCircular());\n return nucSeq;\n } else {\n return null; //This is only returned if the sequence is not a nucleotide sequence. This on the other hand should be tested way before this step.\n }\n }", "public String getDocumentType();", "public String getOriginalText() {\n return originalText;\n }", "public interface IDocument {\n /**\n * Returns the content of the document, in a byte array.\n */\n byte[] getByteContent() throws IOException;\n /**\n * Returns the content of the document, in a char array.\n */\n char[] getCharContent() throws IOException;\n /**\n * returns the name of the document (e.g. its path for a <code>File</code>, or its relative path\n * in the workbench for an <code>IFile</code>).\n */\n String getName();\n /**\n * returns the value of the given property, or null if this document does not have\n * such a property.\n */\n String getProperty(String property);\n /**\n * Returns an enumeration of the names of the properties the document has.\n */\n java.util.Enumeration getPropertyNames();\n /**\n * Returns the content of the document, as a String.\n */\n public String getStringContent() throws IOException;\n /**\n * Returns the type of the document.\n */\n String getType();\n /**\n * Sets the given property of the document to the given value.\n */\n void setProperty(String attribute, String value); }", "private static Document copyDocument(Document origDoc) {\n DocumentImpl doc = new DocumentImpl();\n doc.setFeatures(origDoc.getFeatures());\n doc.setContent(new DocumentContentImpl(origDoc.getContent().toString()));\n doc.setPreserveOriginalContent(origDoc.getPreserveOriginalContent());\n doc.setMarkupAware(origDoc.getMarkupAware());\n\n for(String an : origDoc.getAnnotationSetNames()) {\n if(!an.equals(GateConstants.ORIGINAL_MARKUPS_ANNOT_SET_NAME)) {\n AnnotationSet as = origDoc.getAnnotations(an);\n doc.getAnnotations(an).addAll(as);\n }\n }\n\n doc.getAnnotations().addAll(origDoc.getAnnotations());\n\n return doc;\n }", "@DISPID(4) //= 0x4. The runtime will prefer the VTID if present\r\n @VTID(11)\r\n visiotool.IVDocument document();", "public interface DocumentDefinition extends NodeDefinition {\n\n String getContentPath();\n\n String getMimeType();\n\n String getEncoding();\n}", "public void convert() throws Exception\r\n\t{\n\t\tString query = \"SELECT r_object_id FROM m_mrcs_efs_central_document WHERE r_current_state = 4 OR r_current_state = 6\"; \r\n\t\t\r\n\t\tIDfSession session = null;\r\n\t\tIDfSessionManager sMgr = null;\r\n\t\ttry {\r\n\t IDfClientX clientx = new DfClientX();\r\n\r\n\t \tIDfClient client = clientx.getLocalClient();\r\n\r\n\t \tsMgr = client.newSessionManager();\r\n\r\n\t \tIDfLoginInfo loginInfoObj = clientx.getLoginInfo();\r\n\t loginInfoObj.setUser(\"mradmin\");\r\n\t loginInfoObj.setPassword(\"mr2006\");\r\n\t loginInfoObj.setDomain(null);\r\n\r\n\t sMgr.setIdentity(\"MRCS_Dev\", loginInfoObj);\r\n }\r\n catch (DfException dfe){\r\n \tdfe.printStackTrace();\r\n }\t\t\r\n /*-DEBUG-*/if (DfLogger.isDebugEnabled(this))DfLogger.debug(this, \" \", null, null);\r\n\t\t\r\n\t\t// get list of objects that are pdfs...\r\n\t\t\r\n IDfQuery qry = new DfQuery();\r\n qry.setDQL(query);\r\n\r\n IDfCollection myObj1 = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n \r\n IDfTypedObject serverConfig = session.getServerConfig();\r\n String aclDomain = serverConfig.getString(\"operator_name\");\r\n\t\tIDfACL obsoleteacl = session.getACL(aclDomain,\"mrcs_central_archived\");\r\n\t\tIDfACL retiredacl = session.getACL(aclDomain,\"mrcs_central_retired_doc\");\r\n\r\n\r\n while (myObj1.next()) \r\n {\r\n \tString curid = myObj1.getString(\"r_object_id\");\r\n \t\t// look up object\r\n \t\tIDfDocument doc = (IDfDocument)session.getObject(new DfId(curid));\r\n \t\t\r\n \t\t// check that it's not a popped off copy (i_folder_id[0] != 'Approved') seems to be the only indicator of this...\r\n \t\tIDfFolder folder = (IDfFolder)session.getObject(doc.getFolderId(0));\r\n \t\tString foldername = folder.getObjectName();\r\n \t\t\r\n \t\t// don't do this for approved copies...\r\n \t\tif (!\"Approved\".equals(foldername))\r\n \t\t{\r\n\t \t\t\r\n\t \t\t// check it's state\r\n\t \t\tString statename = doc.getCurrentStateName();\r\n\t \t\tString chronicleid = doc.getChronicleId().getId();\r\n\t \t\t// if In-Progress: simply switch the content type\r\n\t \t\tif (\"Obsolete\".equals(statename))\r\n\t \t\t{\r\n\t \t\t\tString previousquery = \"SELECT r_object_id FROM dm_document(all) where i_chronicle_id = '\"+chronicleid+\"'\";\r\n\t \t IDfQuery prevqry = new DfQuery();\r\n\t \t prevqry.setDQL(query);\r\n\t \t IDfCollection previousversions = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n\t \t while (previousversions.next()) \r\n\t \t {\r\n\t \t \t\r\n\t \t \tString previd = previousversions.getString(\"r_object_id\");\r\n\t \t \t\t// look up object\r\n\t \t \t\tIDfDocument prevdoc = (IDfDocument)session.getObject(new DfId(previd));\r\n\t \t \t\t//unlock \r\n\t \t \t\tsMgr.beginTransaction();\r\n\t \t \t\ttry { \r\n\t\t \t prevdoc.setString(\"r_immutable_flag\", \"FALSE\");\r\n\t\t \t prevdoc.save();\r\n\t\t \t \r\n\t\t \t prevdoc.fetch(prevdoc.getTypeName()); // necessary?\t \t \t\t\r\n\t\t\t \t\t\t// set flags obsolete = true,retired = false\r\n\t\t \t \t\tprevdoc.setBoolean(\"retired\",false);\r\n\t\t \t \t\tprevdoc.setBoolean(\"obsolete\",true);\r\n\t\t\t \t\t\t// set acl\r\n\t\t \t \t\tprevdoc.setACL(obsoleteacl);\r\n\t\t \t prevdoc.setString(\"r_immutable_flag\", \"TRUE\");\r\n\t\t \t \t\tprevdoc.save();\r\n\t \t \t\t} catch (Exception e) {\r\n\t \t \t\t\tsMgr.abortTransaction();\r\n\t \t \t\t\tthrow e;\r\n\t \t \t\t}\r\n\t \t \t\tsMgr.commitTransaction();\r\n\t \t }\r\n\t \t previousversions.close();\r\n\t \t\t}\r\n\t \t\t\r\n\t \t\tif (\"Effective\".equals(statename))\r\n\t \t\t{\r\n\t \t\t\tString previousquery = \"SELECT r_object_id FROM dm_document(all) where i_chronicle_id = '\"+chronicleid+\"'\";\r\n\t \t IDfQuery prevqry = new DfQuery();\r\n\t \t prevqry.setDQL(query);\r\n\t \t IDfCollection previousversions = (IDfCollection) qry.execute(session, IDfQuery.DF_READ_QUERY);\r\n\t \t while (previousversions.next()) \r\n\t \t {\r\n\t \t \t\r\n\t \t \tString previd = previousversions.getString(\"r_object_id\");\r\n\t \t \t\t// look up object\r\n\t \t \t\tIDfDocument prevdoc = (IDfDocument)session.getObject(new DfId(previd));\r\n\t \t \t\t//unlock \r\n\t \t \t\tString currentstate = prevdoc.getCurrentStateName();\r\n\t \t \t\tif (\"Retired\".equals(currentstate))\r\n\t \t \t\t{\r\n\t\t \t \t\tsMgr.beginTransaction();\r\n\t\t \t \t\ttry { \t \t \t\t\t\r\n\t\t\t \t prevdoc.setString(\"r_immutable_flag\", \"FALSE\");\r\n\t\t\t \t prevdoc.save();\r\n\t\t\t \t prevdoc.fetch(prevdoc.getTypeName()); // necessary?\t \t \t\t\r\n\t\t\t\t \t\t\t// set flags obsolete = true,retired = false\r\n\t\t\t \t \t\tprevdoc.setBoolean(\"retired\",true);\r\n\t\t\t \t \t\tprevdoc.setBoolean(\"obsolete\",false);\r\n\t\t\t\t \t\t\t// set acl\r\n\t\t\t \t \t\tprevdoc.setACL(retiredacl);\r\n\t\t\t \t prevdoc.setString(\"r_immutable_flag\", \"TRUE\");\r\n\t\t\t \t \t\tprevdoc.save();\r\n\t\t \t \t\t} catch (Exception e) {\r\n\t\t \t \t\t\tsMgr.abortTransaction();\r\n\t\t \t \t\t\tthrow e;\r\n\t\t \t \t\t}\r\n\t\t \t \t\tsMgr.commitTransaction();\r\n\t \t \t\t}\r\n\t \t }\r\n\t \t previousversions.close();\r\n\t \t\t}\r\n\t \t\t\r\n \t\t}\r\n }\r\n myObj1.close();\r\n \r\n sMgr.release(session);\r\n\t}", "public L getDocumentLocation();", "public int getId_docente() {\n return id_docente;\n }", "public Mediatheque() {\n\n Document libro1 = new Document(new Id(1), new Titre(\"El senor de los anillos\"), new Livre(new Auteur(\"Tolkin\")));\n Document libro2 = new Document(new Id(2), new Titre(\"Dracula\"), new Livre(new Auteur(\"Copola\")));\n Document libro3 = new Document(new Id(3), new Titre(\"The Tower\"), new Livre(new Auteur(\"Charles\")));\n Document libro4 = new Document(new Id(4), new Titre(\"Game Of Thrones\"), new Livre(new Auteur(\"George Martin\")));\n Document libro5 = new Document(new Id(5), new Titre(\"Spiderman\"), new Livre(new Auteur(\"Raimi\")));\n\n Document cd1 = new Document(new Id(6), new Titre(\"Briam Adams\"), new Livre(new Auteur(\"John\")));\n Document cd2 = new Document(new Id(7), new Titre(\"Green Day\"), new Livre(new Auteur(\"They\")));\n Document cd3 = new Document(new Id(8), new Titre(\"Poker Face\"), new Livre(new Auteur(\"Lady Gaga\")));\n Document cd4 = new Document(new Id(9), new Titre(\"Hans Zimmer\"), new Livre(new Auteur(\"Him\")));\n Document cd5 = new Document(new Id(10), new Titre(\"Briam Adams\"), new Livre(new Auteur(\"John\")));\n\n //se agregan estos documentos\n ajoutDoc(libro1, libro2, libro3, libro4, libro5, cd1, cd2, cd3, cd4, cd5);\n\n Adherant adherant1 = new Adherant(\"jorgelu5\");\n Adherant adherant2 = new Adherant(\"jorgel_fant\");\n Adherant adherant3 = new Adherant(\"200311402\");\n Adherant adherant4 = new Adherant(\"Mario\");\n Adherant adherant5 = new Adherant(\"Luis\");\n\n //se agregan estos documentos\n ajoutAd(adherant1, adherant2, adherant3, adherant4, adherant5);\n }", "private static int df(TLongLongMap docs, Map<Long, Document> docsMap) {\n\t\tint compteur = 0;\n\t\tlong[] keys = docs.keys();\n\t\t\n\t\tfor (int i = 0; i < keys.length; i ++) {\n\t\t\tif (docsMap.get(keys[i]).getType() == Document.Type_Element.ARTICLE \n\t\t\t\t\t&& docsMap.get(keys[i]).getCheminDocument().equals(\"article[1]/\")) {\n\t\t\t\tcompteur += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn compteur;\n\t}", "public int getLBR_DocLine_ICMS_ID();", "public void setOriginalidade(String originalidade) {\r\n this.originalidade = originalidade;\r\n }", "private static String getCorrespondingNEPosSegment(String textConcept, CustomXMLRepresentation nePosText, boolean isConcept) {\n\n\t\tString output = \"\";\n\n\t\t//textConcept = textConcept.replaceAll(\"\\\\p{Punct} \",\" $0 \");\n\t\t/*textConcept = textConcept.replaceAll(\"[.]\",\". \").replaceAll(\"[,]\",\", \").replaceAll(\"[']\",\"' \")\n\t\t\t\t.replaceAll(\"[\\\\[]\",\" [ \" ).replaceAll(\"[\\\\]]\",\" ] \").replaceAll(\"[(]\", \" ( \").replaceAll(\"[)]\",\" ) \")\n\t\t\t\t.replaceAll(\"[<]\", \" < \").replaceAll(\"[>]\", \" > \");*/\n\t\t//textConcept = textConcept.replaceAll(\"[\\\\.,']\",\"$0 \").replaceAll(\"[\\\\[\\\\](){}!@#$%^&*+=]\",\" $0 \");\n\t\ttextConcept = textConcept.replaceAll(\"[']\",\"$0 \").replaceAll(\"[\\\\[\\\\](){}!@#$%^&*+=]\",\" $0 \");\n\t\tString[] lemmas = textConcept.split(\" \");\n\t\tArrayList<String> wordList = new ArrayList(Arrays.asList(lemmas));\n\n\t\tnePosText.escapeXMLCharacters();\n\n\t\tboolean goOn = true;\n\t\t//while wordList is not empty, repeat\n\t\twhile(wordList.size()>0 && goOn){\n\n\t\t\tDocument docNePos = null;\n\t\t\ttry {\n\t\t\t\tDocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\n\t\t\t\tDocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();\n\t\t\t\tInputStream streamNePos = new ByteArrayInputStream(nePosText.getXml().getBytes(StandardCharsets.UTF_8));\n\t\t\t\tdocNePos = docBuilder.parse(streamNePos);\n\t\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\t\tSystem.err.print(\"KIndex :: Pipeline.getCorrespondingNEPosSegment() Could not create a document text.\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tNodeList npSegments = docNePos.getElementsByTagName(\"content\").item(0).getChildNodes(); // concept or text segments (children of content)\n\n\t\t\tfor (int i = 0; i < npSegments.getLength(); i++) {\n\t\t\t\tNode n = npSegments.item(i);\n\t\t\t\tif (n.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\tElement segment = (Element) n;\n\t\t\t\t\tString tag = segment.getNodeName();\n\t\t\t\t\tString stLemma = (segment.hasAttribute(\"lemma\")) ? segment.getAttribute(\"lemma\") : \"\";\n\t\t\t\t\tString lemma = segment.getTextContent();\n\n\t\t\t\t\t//Debug\n\t\t\t\t\t//if (wordList.get(0).equals(\"take\")){\n\t\t\t\t\t//\tSystem.out.println(\"take!\");\n\t\t\t\t\t//}\n\n\t\t\t\t\tif ((wordList.size() == 0) && (tag.equals(\"Punctuation\"))){\n\t\t\t\t\t\toutput += lemma + \" \" ;\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tint initSize = wordList.size();\n\t\t\t\t\tint initXMLSize = nePosText.getXml().length();\n\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").equals(\"\")){\n\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (tag.equals(\"ne\")){\n\t\t\t\t\t\tString NEtype = segment.getAttribute(\"type\");\n\t\t\t\t\t\tNodeList NEchildren = segment.getChildNodes();\n\t\t\t\t\t\t//if this text segment is concept, do not add the NamedEntity tag.\n\t\t\t\t\t\tString NEstring = (isConcept) ? \"\" : \"<ne type=\\\"\" + NEtype + \"\\\">\";\n\t\t\t\t\t\tfor (int c = 0; c < NEchildren.getLength(); c++) {\n\t\t\t\t\t\t\tNode child = NEchildren.item(c);\n\t\t\t\t\t\t\tif (child.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\t\t\t\t\tElement Echild = (Element) child;\n\t\t\t\t\t\t\t\tString Ctag = Echild.getNodeName();\n\t\t\t\t\t\t\t\tString OrigLemma = Echild.getAttribute(\"lemma\");\n\t\t\t\t\t\t\t\tString Clemma = Echild.getTextContent();\n\t\t\t\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase())) {\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (!Clemma.equals(\"\")){\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\tif (wordList.get(0).contains(Clemma)){\n\t\t\t\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replace(Clemma,\"\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\tString ClemmaRemaining = Clemma.replaceAll(\"[^\\\\x00-\\\\x7F]\", \"\"); //replace all non-ascii characters\n\t\t\t\t\t\t\t\t\t\twhile (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\t\tClemmaRemaining = ClemmaRemaining.replace(wordList.get(0),\" \");\n\t\t\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t\t\t\tif (Clemma.endsWith(wordList.get(0))){\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tClemmaRemaining = (ClemmaRemaining.startsWith(\" \")) ? ClemmaRemaining.replace(\" \",\"\") : ClemmaRemaining;\n\t\t\t\t\t\t\t\t\t\tif ((!ClemmaRemaining.equals(\"\")) && wordList.get(0).startsWith(ClemmaRemaining)){\n\t\t\t\t\t\t\t\t\t\t\twordList.set(0, wordList.get(0).replace(ClemmaRemaining,\"\"));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*else if (Clemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\t\tif (Clemma.endsWith(wordList.get(0))) {\n\t\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\" + OrigLemma + \"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t\t/*else if ((!Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase().equals(\"\")) &&\n\t\t\t\t\t\t\t\t\t\twordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().contains(Clemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").replaceAll(\" \",\"\").toLowerCase())){\n\t\t\t\t\t\t\t\t\tNEstring += \"<\" + Ctag + \" lemma=\\\"\"+OrigLemma+\"\\\">\" + Clemma + \"</\" + Ctag + \"> \";\n\t\t\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replace(OrigLemma,\"\"));\n\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tNEstring += (isConcept) ? \"\" : \"</ne>\";\n\t\t\t\t\t\toutput += NEstring;\n\t\t\t\t\t\tNEstring = (isConcept) ? \"<ne type=\\\"\" + NEtype + \"\\\">\" + NEstring + \"</ne>\" : NEstring;\n\t\t\t\t\t\tnePosText.removeElement(NEstring);\n\n\t\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\t\tif (wordList.size() == initSize && NEstring.length() == initXMLSize){\n\t\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1200 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if(tag.equals(\"NoPOS\") || tag.equals(\"Punctuation\")){\n\t\t\t\t\t\t//output += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\toutput += lemma + \" \" ;\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(lemma.toLowerCase())){\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\t\telse if (nePosText.getXml().length() == initXMLSize){\n\t\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1201 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma +\"\\r\\n nePosText: \"+ nePosText.getXml();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().equals(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())) {\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//we have the example of \"Cannot\" -> <MD>Can</MD><RB>not</RB>\n\t\t\t\t\t//in that case, in the first loop the first lemma will be added\n\t\t\t\t\t//in second loop the lemma will be added and wordList.get(0) will be removed\n\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().contains(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\tif (wordList.get(0).startsWith(lemma)){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replaceFirst(Pattern.quote(lemma),\"\"));\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().startsWith(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.set(0,wordList.get(0).replaceFirst(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\"),\"\"));\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).endsWith(lemma)){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase().endsWith(lemma.replaceAll(\"[^a-zA-Z0-9 ]\", \"\").toLowerCase())){\n\t\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (lemma.contains(wordList.get(0))){\n\t\t\t\t\t\twhile(lemma.contains(wordList.get(0))){\n\t\t\t\t\t\t\tif (lemma.endsWith(wordList.get(0))) {\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.size() == 0){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (lemma.contains(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))){\n\t\t\t\t\t\twhile(lemma.contains(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))){\n\t\t\t\t\t\t\tif (lemma.endsWith(wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\"))) {\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\twordList.remove(0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\toutput += \"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \"> \";\n\t\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+stLemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t\t\tif (wordList.size() == 0){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//avoid infinite loop\n\t\t\t\t\tif (wordList.size() == initSize){\n\t\t\t\t\t\treturn \"--ERROR-- \\r\\n Error: 1202 \\r\\n In word:\" + wordList.get(0) + \", lemma:\"+lemma;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{ //if n.getNodeType() != Node.ELEMENT_NODE\n\t\t\t\t\tif (npSegments.getLength() == 1){\n\t\t\t\t\t\tgoOn = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (wordList.size()>0 && wordList.get(0).replaceAll(\"[^a-zA-Z0-9 ]\", \"\").equals(\"\")){\n\t\t\t\twordList.remove(0);\n\t\t\t}\n\n\t\t\tif(npSegments.getLength() == 0 && wordList.size() == 1){\n\t\t\t\twordList.remove(0);\n\t\t\t}\n\t\t}\n\n\t\t//in case wordList is empty but the next element in nePosText is punctuation, this element has to be added in output\n\t\tDocument docNePos = null;\n\t\ttry {\n\t\t\tDocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();\n\t\t\tDocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();\n\t\t\tInputStream streamNePos = new ByteArrayInputStream(nePosText.getXml().getBytes(StandardCharsets.UTF_8));\n\t\t\tdocNePos = docBuilder.parse(streamNePos);\n\t\t} catch (ParserConfigurationException | SAXException | IOException e) {\n\t\t\tSystem.err.print(\"KIndex :: Pipeline.getCorrespondingNEPosSegment() Could not create a document text.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tNodeList npSegments = docNePos.getElementsByTagName(\"content\").item(0).getChildNodes(); // concept or text segments (children of content)\n\t\tfor (int i = 0; i < npSegments.getLength(); i++) {\n\t\t\tNode n = npSegments.item(i);\n\t\t\tif (n.getNodeType() == Node.ELEMENT_NODE) {\n\t\t\t\tElement segment = (Element) n;\n\t\t\t\tString tag = segment.getNodeName();\n\t\t\t\tString lemma = segment.getTextContent();\n\t\t\t\tif (tag.equals(\"Punctuation\")){\n\t\t\t\t\toutput += lemma + \" \";\n\t\t\t\t\tnePosText.removeElement(\"<\" + tag + \" lemma=\\\"\"+lemma+\"\\\">\" + lemma + \"</\" + tag + \">\");\n\t\t\t\t}\n\t\t\t\tbreak; // it will break after the first time an element will be checked\n\t\t\t}\n\t\t}\n\n\n\n\t\treturn output;\n\t}", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "java.lang.String getContent();", "VersionCorrection getVersionCorrection();", "protected String loadDocumentDetails ()\n\t{\n\t\tMPayment pay = (MPayment)getPO();\n\t\tsetDateDoc(pay.getDateTrx());\n\t\tm_TenderType = pay.getTenderType();\n\t\tm_Prepayment = pay.isPrepayment();\n\t\tm_C_BankAccount_ID = pay.getC_BankAccount_ID();\n\t\t//\tAmount\n\t\tsetAmount(Doc.AMTTYPE_Gross, pay.getPayAmt());\n\t\treturn null;\n\t}", "@Override\n public void changedUpdate(DocumentEvent e) {\n verifierSaisie();\n }", "String getDocumentNumber();", "public boolean isDocument(Document document) {\n return false;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tStringBuilder docAsStringtoSend = new StringBuilder();\r\n\t\tfor (String c : docModel) {\r\n\t\t\tif (!c.equals(\"a\")) {\r\n\t\t\t\tdocAsStringtoSend.append(c + \"a\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tString newFile = docAsStringtoSend.toString();\r\n\t\tupdateFile(newFile);\r\n\t\treturn newFile;\r\n\t}", "public java.lang.String getNrDoc() {\n return nrDoc;\n }" ]
[ "0.58213246", "0.5740964", "0.56391305", "0.5594356", "0.55802673", "0.5578257", "0.5525768", "0.5524442", "0.5503575", "0.5479145", "0.5411552", "0.5396907", "0.53891015", "0.53891015", "0.53891015", "0.5351877", "0.5327395", "0.5325618", "0.5264705", "0.5235051", "0.5222795", "0.5202477", "0.51945186", "0.51895493", "0.5161968", "0.5161968", "0.5159018", "0.5147773", "0.51362497", "0.513415", "0.51239514", "0.5099026", "0.5098992", "0.5087832", "0.5087832", "0.5082725", "0.5082725", "0.50805825", "0.5077662", "0.5068113", "0.50666296", "0.5061495", "0.50563335", "0.5046669", "0.5044921", "0.5042523", "0.5042238", "0.5034204", "0.5032177", "0.5026071", "0.50028676", "0.5002017", "0.4981446", "0.49692172", "0.49685463", "0.49685463", "0.49685463", "0.49594527", "0.49565142", "0.4953091", "0.49526805", "0.49313968", "0.49308604", "0.49250558", "0.49146062", "0.49073663", "0.4901973", "0.48950478", "0.4891298", "0.4884576", "0.48841015", "0.48837996", "0.4879529", "0.48786288", "0.48785782", "0.4871384", "0.487016", "0.4868143", "0.48657572", "0.4859536", "0.48574236", "0.48514342", "0.4843653", "0.48413152", "0.48322165", "0.4829579", "0.4828717", "0.48274472", "0.48274472", "0.48274472", "0.48274472", "0.48274472", "0.48274472", "0.48251343", "0.4823015", "0.48151255", "0.48033795", "0.48005015", "0.47990358", "0.47982672" ]
0.67067796
0
String url = getString(R.string.image_url)+contents.get(ExoPlayerVideoHandler.getInstance().getIndex()).getPath360(); ExoPlayerVideoHandler exoPlayerVideoHandler = ExoPlayerVideoHandler.getInstance(); /player = ExoPlayerVideoHandler.getInstance() .prepareExoPlayerForUri(this, Uri.parse(url), (SimpleExoPlayerView) exoPlayerView); player.addListener(componentListener); ExoPlayerVideoHandler.getInstance().goToForeground(); ExoPlayerVideoHandler.getInstance().setIndex(index);
private void initiatePlayer() { ExoPlayerVideoHandler.getInstance().initiateLoaderController( this, loadingImage, exoPlayerView, ExoPlayerVideoHandler.getInstance().getVideoResolution()!=null?ExoPlayerVideoHandler.getInstance().getVideoResolution():getString(R.string.default_resolution), this ); ExoPlayerVideoHandler.getInstance().playVideo(); content = ExoPlayerVideoHandler.getInstance().getCurrentVideoInfo(); //ExoPlayerVideoHandler.getInstance().goToForeground(); setSpinnerValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializePlayer() {\n // Create a default TrackSelector\n mainHandler = new Handler();\n BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();\n\n TrackSelection.Factory videoTrackSelectionFactory =\n new AdaptiveTrackSelection.Factory(bandwidthMeter);\n TrackSelector trackSelector =\n new DefaultTrackSelector(videoTrackSelectionFactory);\n //Initialize the player\n //Initialize simpleExoPlayerView\n simpleExoPlayerView = findViewById(R.id.exoplayer);\n // This is the MediaSource representing the media to be played.\n Uri videoUri = Uri.parse(video.getSources());\n // This is the MediaSource representing the media to be played.\n player = ExoPlayerFactory.newSimpleInstance(this, trackSelector);\n\n /*To track download status*/\n downloadTracker.toggleDownload(this, video.getTitle(), videoUri, null);\n\n /* HlsDownloadHelper downloadHelper =\n new HlsDownloadHelper(videoUri, dataSourceFactory);\n downloadHelper.prepare(\n new HlsDownloadHelper.Callback() {\n\n private boolean shouldDownload(Format track) {\n System.out.println(\"track>>>>>>>>>>>>>>>>>>>\" + track);\n if (track != null) {\n return true;\n }\n return false;\n }\n\n @Override\n public void onPrepared(DownloadHelper helper) {\n // Preparation completes. Now other DownloadHelper methods can be called.\n List<TrackKey> trackKeys = new ArrayList<>();\n for (int i = 0; i < downloadHelper.getPeriodCount(); i++) {\n TrackGroupArray trackGroups = downloadHelper.getTrackGroups(i);\n for (int j = 0; j < trackGroups.length; j++) {\n TrackGroup trackGroup = trackGroups.get(j);\n for (int k = 0; k < trackGroup.length; k++) {\n Format track = trackGroup.getFormat(k);\n if (shouldDownload(track)) {\n trackKeys.add(new TrackKey(i, j, k));\n }\n }\n }\n }\n DownloadAction downloadAction = downloadHelper.getDownloadAction(null, trackKeys);\n System.out.println(\"download Action>>>>>>>>>>>>\" + downloadAction);\n DownloadService\n .startWithAction(getApplicationContext(), MyDownloadService.class, downloadAction, true);\n }\n\n @Override\n public void onPrepareError(DownloadHelper helper, IOException e) {\n System.out.println(\"helper>>>>>>>>\" + helper);\n }\n });*/\n // Produces Extractor instances for parsing the media data.\n /* concatenatingMediaSource = new ConcatenatingMediaSource();\n MediaSource[] mediaSources = new HlsMediaSource[stringArrayList.size()];\n for (int i = 0; i < stringArrayList.size(); i++) {\n mediaSources[i] = buildMediaSource(Uri.parse(stringArrayList.get(i)));\n concatenatingMediaSource.addMediaSource(mediaSources[i]);\n }*/\n\n /*HlsMediaSource hlsMediaSource = new HlsMediaSource.Factory(\n new DefaultDashChunkSource.Factory(dataSourceFactory),\n buildDataSourceFactory(false))\n .setManifestParser(\n new FilteringManifestParser<>(new DashManifestParser(), downloadAction.getKeys()))\n .createMediaSource(uri);*/\n simpleExoPlayerView.setPlayer(player);\n mediaSourceWithAds = buildMediaSource(videoUri);\n /*MediaSource hlsMediaSource = new HlsMediaSource(videoUri, dataSourceFactory, mainHandler, new AdaptiveMediaSourceEventListener() {\n\n @Override\n public void onMediaPeriodCreated(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) {\n }\n\n @Override\n public void onMediaPeriodReleased(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) {\n }\n\n @Override\n public void onLoadStarted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {\n }\n\n @Override\n public void onLoadCompleted(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {\n }\n\n @Override\n public void onLoadCanceled(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) {\n }\n\n @Override\n public void onLoadError(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) {\n }\n\n @Override\n public void onReadingStarted(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) {\n }\n\n @Override\n public void onUpstreamDiscarded(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) {\n }\n\n @Override\n public void onDownstreamFormatChanged(int windowIndex, @Nullable MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) {\n }\n });\n*/\n // Compose the content media source into a new AdsMediaSource with both ads and content.\n // Prepare the player with the source.\n player.prepare(mediaSourceWithAds);\n player.setPlayWhenReady(playWhenReady);\n player.setAudioAttributes(audioAttributes, true);\n player.addListener(new Player.EventListener() {\n\n @Override\n public void onTimelineChanged(Timeline timeline, Object manifest, int reason) {\n }\n\n @Override\n public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) {\n }\n\n @Override\n public void onLoadingChanged(boolean isLoading) {\n }\n\n @Override\n public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {\n switch (playbackState) {\n case Player.STATE_BUFFERING:\n //You can use progress dialog to show user that video is preparing or buffering so please wait\n progressBar.setVisibility(View.VISIBLE);\n break;\n case Player.STATE_IDLE:\n //idle state\n break;\n case Player.STATE_READY:\n // dismiss your dialog here because our video is ready to play now\n progressBar.setVisibility(View.GONE);\n break;\n case Player.STATE_ENDED:\n // do your processing after ending of video\n break;\n }\n }\n\n @Override\n public void onRepeatModeChanged(int repeatMode) {\n }\n\n @Override\n public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {\n }\n\n @Override\n public void onPlayerError(ExoPlaybackException error) {\n }\n\n @Override\n public void onPositionDiscontinuity(int reason) {\n }\n\n @Override\n public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {\n }\n\n @Override\n public void onSeekProcessed() {\n }\n });\n player.seekTo(currentWindow, playbackPosition);\n player.prepare(mediaSourceWithAds, true, false);\n progressBar = (ProgressBar) findViewById(R.id.progressBar);\n simpleExoPlayerView.setControllerShowTimeoutMs(10000);\n }", "private void createAndLaunchExoPlayer() {\n player = ExoPlayerFactory.newSimpleInstance(this);\n // Bind player to player view\n playerView.setPlayer(player);\n\n // DataSource to load media data\n DataSource.Factory dataSource = new DefaultDataSourceFactory(this,\n Util.getUserAgent(this, getString(R.string.app_name)));\n // Media Source containing tokenized Url\n MediaSource mediaSource = new HlsMediaSource.Factory(dataSource).createMediaSource(tokenizedUri);\n\n // Automatically play video when launched\n player.setPlayWhenReady(true);\n // Listener to load spinner when buffering\n player.addListener(playerListener);\n // Set mediaSource to player\n player.prepare(mediaSource);\n\n }", "public void setUpVideo() {\n\n videosViewPager.setVisibility(VISIBLE);\n StorageReference filePath = storageReference.child(\"images\").child(new ArrayList<>(videos.keySet()).get(position));\n filePath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n videosViewPager.setVideoURI(uri);\n videosViewPager.setMediaController(mediaController);\n mediaController.setAnchorView(videosViewPager);\n videosViewPager.requestFocus();\n }\n });\n //String videoPath = \"android.resource://\"+activity.getPackageName()+\"/\";\n //Uri uri = Uri.parse(videoPath);\n\n// DisplayMetrics displayMetrics = new DisplayMetrics();\n// activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n// int height = displayMetrics.heightPixels;\n// int width = displayMetrics.widthPixels;\n//\n//\n// videosViewPager.setMinimumHeight(height);\n// videosViewPager.setMinimumWidth(width);\n// videosViewPager.setVideoURI(uri);\n// videosViewPager.setMediaController(mediaController);\n// mediaController.setAnchorView(videosViewPager);\n// videosViewPager.requestFocus();\n //videosViewPager.start();\n\n\n\n }", "@Nullable\n @Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n if(getArguments() != null) {\n mRecipeDetail = getArguments().getString(RECIPE_STEPS);\n // Log.v(TAG, \"step detail passed from detail activity \" + stepDetail);\n }\n\n // Initialize Media Sessions\n mediaSessionInitializer();\n\n // Inflate the the layout of the fragment to rootview\n View rootView = inflater.inflate(R.layout.fragment_simple_exo_player,container,false);\n // Reference the ExoPlayerView\n mExoPlayerView = rootView.findViewById(R.id.simple_exo_player);\n\n // Get videoURL and thumbnailURL from argument\n // Convert the String into a JSONObject\n try {\n\n JSONObject recipeDetails = new JSONObject(mRecipeDetail);\n String videoUrl, thumbnailUrl;\n videoUrl = recipeDetails.getString(VIDEO_URL);\n thumbnailUrl = recipeDetails.getString(THUMBNAIL_URL);\n // Log.v(TAG, \"TEST\" + videoUrl + \" \" + thumbnailUrl);\n // Set default artwork to below\n mExoPlayerView.setDefaultArtwork(BitmapFactory.decodeResource(\n getResources(),R.drawable.ic_no_video));\n\n // If there's video URL\n if(videoUrl.length() != 0 || videoUrl.equals(\"\")) {\n // If there's no thumbnail present\n if(thumbnailUrl.length() != 0\n && thumbnailUrl\n .subSequence(thumbnailUrl.length() - 3, thumbnailUrl.length())\n .equals(\"mp4\")) {\n // Bad DATA - video URL in thumbnail\n videoUrl = thumbnailUrl;\n // Create thumbnail from the video\n Bitmap thumbnailVideo = ThumbnailUtils.createVideoThumbnail(thumbnailUrl,\n MediaStore.Images.Thumbnails.MINI_KIND);\n mExoPlayerView.setDefaultArtwork(thumbnailVideo);\n }\n }\n // Initialize the player here\n initializePlayer(videoUrl, rootView, savedInstanceState);\n\n } catch (JSONException e) {\n Log.v(TAG,\"Please check for BAD DATA\");\n }\n return rootView;\n }", "@Override\n public void onServerStart(String videoStreamUrl)\n {\n\n\n\n Log.d(\"Activity\",\"URL: \"+ videoStreamUrl);\n\n\n video = (VideoView)findViewById(R.id.video);\n\n Uri uri = Uri.parse(videoStreamUrl);\n video.setVideoURI(uri);\n video.start();\n\n\n\n }", "@Override\r\n public void onClick(View v) {\n String path = \"http://techslides.com/demos/sample-videos/small.mp4\";\r\n// Uri uri=Uri.parse(path);\r\n// videoView.setVideoURI(uri);\r\n //MediaController mc = new MediaController(TransformDetailActivity.this);\r\n\r\n //videoView.start();\r\n// videoView.setOnTouchListener(new View.OnTouchListener() {\r\n// @Override\r\n// public boolean onTouch(View v, MotionEvent event) {\r\n// System.out.print(videoView.isPlaying());\r\n// if(videoView.isPlaying()) {\r\n// stopPosition[0] = videoView.getCurrentPosition();\r\n// videoView.pause();\r\n// } else {\r\n// videoView.seekTo(stopPosition[0]);\r\n// videoView.start();\r\n// }\r\n// return false;\r\n// }\r\n// });\r\n// String path = \"android.resource://\" + getPackageName() + \"/\" + R.raw.welcome;\r\n// Uri videoUri = Uri.parse(path);\r\n// Intent intent = new Intent(Intent.ACTION_VIEW, videoUri);\r\n// intent.setDataAndType(videoUri, \"video/*\");\r\n// startActivity(intent);\r\n\r\n Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(path));\r\n intent.setDataAndType(Uri.parse(path), \"video/mp4\");\r\n startActivity(intent);\r\n }", "private void setupPlayer() {\n\n\n\n Video video = createVideoFromUrl(\"https://sonyhdslive-lh.akamaihd.net/i/LIVELINEARCHANNELWAHSD_2@324771/index_100_av-p.m3u8?sd=10&rebase=on&id=AgC2SfL6YBG2JpMHMVl8BkTC0SpVbBy%2frYkaeUHMRu8inYQ3DHLx4I+pRLNhOPyxeLBTSrs2hL4lZw%3d%3d&hdntl=exp=1496471827~acl=%2fi%2f*~data=hdntl~hmac=808df26a60cb28eff4d28a242510d2dba361d9d8658f1e3bbe3090f85e633632\");\n brightcoveVideoView.add(video);\n brightcoveVideoView.start();\n// ImaManager.setupIma(brightcoveVideoView, googleAds);\n\n }", "private void initializeExoPlayer(Uri videoUrlString) {\n if (videoUrlString == null) return;\n TrackSelector trackSelector = new DefaultTrackSelector();\n LoadControl loadControl = new DefaultLoadControl();\n mExoPlayer = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector, loadControl);\n mVideoView.setPlayer(mExoPlayer);\n mExoPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);\n\n DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();\n DataSource.Factory dataSourceFactory =\n new DefaultDataSourceFactory(getContext(),\n Util.getUserAgent(getContext(),\n \"BakingApp\"), bandwidthMeter);\n ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();\n MediaSource videoSource = new ExtractorMediaSource(videoUrlString,\n dataSourceFactory,\n extractorsFactory,\n null,\n null);\n mExoPlayer.prepare(videoSource);\n if (videoPosition > 0) {\n mExoPlayer.seekTo(videoPosition);\n mExoPlayer.setPlayWhenReady(playWhenReady);\n }\n\n //if device is not a tablet, then make full screen\n if (!DetailsActivity.IS_TABLET) {\n initializeExoPlayerView(getResources().getConfiguration().orientation);\n }\n }", "@Override\n public void onCompletion(EasyVideoPlayer player) {\n }", "public void playVideo() {\n \t\t try {\n \t\t\t videoView.setOnPreparedListener(new OnPreparedListener() {\n \n \t\t\t\t @Override\n \t\t\t\t public void onPrepared(MediaPlayer mp) {\n \t\t\t\t\t mp.setLooping(true); \n \t\t\t\t }\n \t\t\t });\n \t\t\t videoView.setVideoPath(SAVE_PATH);\n \t\t\t videoView.start();\n \t\t } catch (Exception e) {\n \t\t\t Log.e(\"Video\", \"error: \" + e.getMessage(), e);\n \t\t }\n \t }", "public void startYoutubePlayer(Context context, String url) {\n if (url.contains(\"http:\") || url.contains(\"https:\")) {\n\n String pattern = \"(?<=watch\\\\?v=|/videos/|embed\\\\/|youtu.be\\\\/|\\\\/v\\\\/|\\\\/e\\\\/|watch\\\\?v%3D|watch\\\\?feature=player_embedded&v=|%2Fvideos%2F|embed%\\u200C\\u200B2F|youtu.be%2F|%2Fv%2F)[^#\\\\&\\\\?\\\\n]*\";\n\n Pattern compiledPattern = Pattern.compile(pattern);\n Matcher matcher = compiledPattern.matcher(url); //url is youtube url for which you want to extract the id.\n if (matcher.find()) {\n String videoId = matcher.group();\n FavouriteResource favouriteResource = new FavouriteResource();\n favouriteResource.setName(videoId);\n favouriteResource.setUrlThumbnail(ConstantUtil.BLANK);\n context.startActivity(PlayYouTubeFullScreenActivity.getStartIntent(context, ConstantUtil.BLANK, ConstantUtil.BLANK, favouriteResource));\n }\n\n } else {\n FavouriteResource favouriteResource = new FavouriteResource();\n favouriteResource.setName(url);\n favouriteResource.setUrlThumbnail(ConstantUtil.BLANK);\n context.startActivity(PlayYouTubeFullScreenActivity.getStartIntent(context, ConstantUtil.BLANK, ConstantUtil.BLANK, favouriteResource));\n }\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tx.view().inject(this);\n\t\tcontext= this;\n\t\tlayoutInflater = LayoutInflater.from(this);\n\t\tIntent intent = getIntent();\n\t\tString title = intent.getStringExtra(\"title\");\n\t\tString url = intent.getStringExtra(\"url\");\n\t\t vid = intent.getStringExtra(\"vid\");\n\t\tif(intent.hasExtra(\"pic\"))\n\t\tpic = intent.getStringExtra(\"pic\");\n\t\t//is_vip = intent.getStringExtra(\"v_is_vip\");\n\t\timageLoader = ImageLoader.getInstance();\n\t\toptions = UsedUtil.getDisplayImageOptions();\n\t\thandler.sendMessage(handler.obtainMessage(10));\n\t\timageWidth = (DeviceInfo.screenWidth - DeviceInfo.dip2px(31))/2;\n\t\timageHeight = (int)(imageWidth*0.618);\n\t\tif(title != null)\n\t\t\ttv_title.setText(title);\n\t\turl = getURL(url);\n\t\tcf = this.getResources().getConfiguration();\n\t\tUri uri = Uri.parse(url);\n\t\tvideo.setVideoURI(uri);\n\t\tvideo.setOnPreparedListener(this);\n\t\tmMediaController = new MediaController(this);\n\n\t\tvideo.setMediaController(mMediaController);\n\t\tvideo.setFocusableInTouchMode(false);\n\t\tvideo.setFocusable(false);\n\t\tvideo.setEnabled(false);\n\t\t//videoView.setVideoURI(Uri.parse(\"android.resource://\" + getPackageName() + \"/\" + R.raw.shouyekaichang));\n\t\t//videoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_LOW);//高画质\n\n\n\t\tvideo.setPlayPauseListener(new CustomVideoView.PlayPauseListener() {\n\n\t\t\tpublic void onPlay() {\n\t\t\t\tLogUtil.e(\"video is playing\");\n\t\t\t\tiv_paly.setVisibility(View.GONE);\n\t\t\t\tiv_pic.setVisibility(View.GONE);\n\t\t\t\tvideoPause();\n\t\t\t}\n\n\t\t\tpublic void onPause() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t//LogUtil.e(\"video is paused\");\n\t\t\t\tiv_paly.setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t});\n\t\tvideo.start();\n\t\tvideo.pause();\n\t\t//video.requestFocus();\n\n\n\t\tIMSI = UsedUtil.getIMSI(this);\n\t\tLogUtil.e(\"vid==\" + vid+\",imsi=\"+IMSI);\n\t\tRequestParams params = new RequestParams(HttpUtil.Details_URL);\n\t\tparams.addBodyParameter(\"vid\",vid);\n\t\tparams.addBodyParameter(\"u_imsi\",IMSI);\n\n\t\thttpPost(params, 101);\n\n\t\tadapter = new ArrayAdapter<HolderInfo>(layoutInflater.getContext(),\n\t\t\t\tR.layout.item_gridview_home) {\n\n\t\t\tpublic android.view.View getView(int position,\n\t\t\t\t\t\t\t\t\t\t\t android.view.View convertView, android.view.ViewGroup parent) {\n\t\t\t\tViewHolder holder = null;\n\t\t\t\tif (convertView == null) {\n\t\t\t\t\tconvertView = layoutInflater.inflate(R.layout.item_gridview_home, null);\n\t\t\t\t\tholder = new ViewHolder();\n\t\t\t\t\tx.view().inject(holder, convertView);\n\t\t\t\t\tconvertView.setTag(holder);\n\t\t\t\t} else {\n\t\t\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t\t\t}\n\t\t\t\tHolderInfo itm = getItem(position);\n\t\t\t\tholder.initview(itm);\n\n\t\t\t\treturn convertView;\n\t\t\t}\n\t\t};\n\t}", "public void startVideoPlayer(Context context, String url) {\n Resource item = new Resource();\n item.setType(context.getString(R.string.typeVideo));\n item.setUrlMain(url);\n context.startActivity(PlayVideoFullScreenActivity.getStartActivityIntent(context, ConstantUtil.BLANK, ConstantUtil.BLANK, PlayVideoFullScreenActivity.NETWORK_TYPE_ONLINE, (Resource) item));\n }", "@Override\n public void onSubmit(EasyVideoPlayer player, Uri source) {\n }", "@Override\n public void onClick(View v) {\n View viewVideo = LayoutInflater.from(mContext).inflate(R.layout.dialog_video,null);\n AlertDialog.Builder layoutDialogVideo = new AlertDialog.Builder(mContext);\n\n VideoView vvVideoView = viewVideo.findViewById(R.id.vv_dialogVideo_video);\n vvVideoView.setVideoPath(item.getVideo());\n vvVideoView.seekTo(0);\n vvVideoView.start();\n MediaController mediaController = new MediaController(mContext);\n vvVideoView.setMediaController(mediaController);\n mediaController.setMediaPlayer(vvVideoView);\n\n layoutDialogVideo.setView(viewVideo);\n Dialog dialogVideo = layoutDialogVideo.create();\n\n dialogVideo.show();\n }", "@Override\n public void onPlayerError(ExoPlaybackException error) {\n AlertDialog.Builder adb = new AlertDialog.Builder(this);\n adb.setTitle(\"Could not able to stream video\");\n adb.setMessage(\"It seems that something is going wrong.\\nPlease try again.\");\n adb.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n finish(); // take out user from this activity. you can skip this\n }\n });\n AlertDialog ad = adb.create();\n ad.show();\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_video_play);\n\n videoView = findViewById(R.id.video_view);\n// String path = Environment.getExternalStorageDirectory().getAbsolutePath()+\" Path name \";\n// videoView.setVideoPath();\n videoView.setVideoURI(Uri.parse(\"android.resource://\" + getPackageName() + \"/raw/video_transparent\"));\n\n\n MediaController mediaController = new MediaController(this);\n videoView.setMediaController(mediaController);\n mediaController.setMediaPlayer(videoView);\n\n }", "@Override\n public void onVideoEnd() {\n super.onVideoEnd();\n }", "private void showOST(int position) {\n\t\tString youtubeUrl = \"\";\n\t\tString youtubeId = \"\";\n\t\tString rtsp_link = \"\";\n\t\t\n\t\t//urlYoutube = ost_links[position];\n\t\t//youtubeUrl = \"http://www.youtube.com/watch?v=MV5qvrxmegY\";\n\t\t//rtsp_link = getUrlVideoRTSP(youtubeUrl);\n\t\t//rtsp_link = \"rtsp://r1---sn-a5m7zu7e.c.youtube.com/CiILENy73wIaGQkGema8vmpeMRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\";\n\t\t//rtsp_link = \"https://archive.org/download/Pbtestfilemp4videotestmp4/video_test_512kb.mp4\";\n\t\t//rtsp_link = \"rtsp://r3---sn-a5m7zu7d.c.youtube.com/CiILENy73wIaGQn061BlwOVsxRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\";\n\t\trtsp_link = ost_links[position];\t\t\n\t\tVideoView videoView = (VideoView) this.findViewById(R.id.videoView1);\n\t\tLog.v(\"Video\", \"***Video to Play:: \" + rtsp_link);\n\t\t\n\t\t// add controls to a MediaPlayer like play, pause.\n\t\tMediaController mc = new MediaController(this);\n\t\tvideoView.setMediaController(mc);\n\t\n\t\t// Set the path of Video or URI\n\t\tmc.setAnchorView(videoView);\n\t\tUri videoPath = null;\n\t\tvideoPath = Uri.parse(rtsp_link);\n\t\t\n\t\tvideoView.setVideoURI(videoPath);\n\t\tvideoView.requestFocus();\n\t\tvideoView.start();\t\n\t\tmc.show();\n\t}", "@Override\n public void onClick(View view, int position, boolean isLongClick) {\n Intent videoIntent = new Intent(activity.getBaseContext(), FullVideoActivity.class);\n videoIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n videoIntent.putExtra(\"videoUri\", videoUri);\n activity.startActivity(videoIntent);\n\n }", "private void initializePlayer(String videoUrl, View rootView, Bundle savedInstanceState) {\n\n // Make sure that the Player is not initiated before\n if(mSimplePlayer == null) {\n // Parse the url string to Uri\n Uri mediaUri = Uri.parse(videoUrl);\n\n // Create an instance TrackSelector and LoadControl\n TrackSelector trackSelector = new DefaultTrackSelector();\n LoadControl loadControl = new DefaultLoadControl();\n // Create an instance of the simple player\n mSimplePlayer = ExoPlayerFactory.newSimpleInstance(rootView.getContext(),\n trackSelector,loadControl);\n // Set the player to the player view\n mExoPlayerView.setPlayer(mSimplePlayer);\n // Prepare the MediaSource.\n String userAgent = Util.getUserAgent(rootView.getContext(),\"bakingapp\");\n MediaSource mediaSource = new ExtractorMediaSource(mediaUri, new DefaultDataSourceFactory(\n rootView.getContext(), userAgent), new DefaultExtractorsFactory(),\n null, null);\n // Prepare the simple player and set play when ready\n mSimplePlayer.prepare(mediaSource);\n\n // If it's only a rotation\n if(savedInstanceState != null) {\n long position = savedInstanceState.getLong(PLAYBACK_POSITION);\n // Prepare the simple player and set play when ready\n mSimplePlayer.seekTo(position);\n mSimplePlayer.setPlayWhenReady(true);\n } else {\n if(videoPosition != 0) {\n mSimplePlayer.seekTo(videoPosition);\n mSimplePlayer.setPlayWhenReady(true);\n }\n }\n\n // If orientation is Landscape Play\n if(getResources().getConfiguration().orientation\n == Configuration.ORIENTATION_LANDSCAPE) {\n mSimplePlayer.setPlayWhenReady(true);\n }\n }\n }", "public void playVideo() {\n }", "@Override\n public void onStarted(EasyVideoPlayer player) {\n }", "@SuppressLint(\"NewApi\") @Override\n\t\tpublic void onPrepared(MediaPlayer mp) {\n\t\t\tplayer = mp;\n\t\t\tpb.setVisibility(View.GONE);\n\t\t\t//img_volumvideo.setVisibility(View.VISIBLE);\n\t\t\t mp.setVideoScalingMode(MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING);\n\t\t\t\tStringBuffer sbf = new StringBuffer();\n\t\t\t\tsbf.append(Constant.AppVideoApi);\n\t\t\t\tsbf.append(\"offer_id=\"\n\t\t\t\t\t\t+AppofferUtil.getIntsance().getList().get(0).getOffer_id());\n\t\t\t\tsbf.append(\"&dev_id=\" + AppofferUtil.getIntsance().getList().get(0).getDev_id());\n\t\t\t\tsbf.append(\"&app_id=\" + AppofferUtil.getIntsance().getList().get(0).getApp_id());\n\t\t\t\tsbf.append(\"&is_integral=\" + AppofferUtil.getIntsance().getList().get(0).getIs_integral());\n\t\t\t\tsbf.append(\"&ad_type=\" + AppofferUtil.getIntsance().getList().get(0).getApp_type());\n\t\t\t\tsbf.append(\"&android_id=\" + Constant.getAndroidID(AlertVideoActivity.this));\n\t\t\t\tTapfunsCommandExecute.getInstance().executeGet(AlertVideoActivity.this, sbf.toString(),\n\t\t\t\t\t\tnew RequestCallBack() {\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void getRequestResult(String command) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tTapfunsLogUtil.logI(command);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t mp.setOnInfoListener(new MediaPlayer.OnInfoListener() {\n\t\t\t\t\t @Override\n\t\t\t\t\t public boolean onInfo(MediaPlayer mp, int what, int extra) {\n\n\t\t\t\t\t if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {\n\t\t\t\t\t // video started\n\t\t\t\t\t videoView.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t\t return true;\n\t\t\t\t\t }\n\t\t\t\t\t return false;\n\t\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t mp.setOnVideoSizeChangedListener(new MediaPlayer.OnVideoSizeChangedListener() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onVideoSizeChanged(MediaPlayer mp, int width, int height) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t // video started\n\t\t\t\t\t videoView.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_video);\n\t\tex = getIntent().getExtras();\n\t\t \n\n\t HashMap<String, String> mp = new HashMap<String, String>();\n\t\t mp.put(\"tag\", \"realVid\");\n\t\t if(ex.getString(\"cat\").equals(new String(\"ppv\")))\n\t\t {\n\t\t\t String vidttl =\"\";\n String vidtitle = ex.getString(\"title\");\n\t\t \t int pos = vidtitle.indexOf(\"Pay Per View\");\n\t\t\t\tif(pos!= -1)\n\t\t\t\t\tvidttl = vidtitle.substring(0,pos-1);\n\t\t\t\tmp.put(\"title\",vidttl);\n\t\t }\n\t\t else\n\t\t\t mp.put(\"title\", ex.getString(\"title\"));\n\t\t GetRealVidData gvd = new GetRealVidData(mp,this);\n\t\t gvd.execute(serverUrl);\n\t\t youTubeView1 = (YouTubePlayerView)findViewById(R.id.youtube_view1);\n\t\t \n\t\t \n\t\t/*\n\t\t if(ex!=null)\n\t\t \tvid = ex.getString(\"url\");\n\t\t//TextView tv = (TextView)findViewById(R.id.textView1);\n\t\t//VideoView videoView = (VideoView)findViewById(R.id.videoV);\n\t\tint pos = vid.indexOf(\"?rel\");\n\t\tif(pos!= -1)\n\t\t\tvidid = vid.substring(0, pos);\n\t\telse \n\t\t\tvidid = vid;\n\t\t\n\t\tVIDEO = vidid;\n YouTubePlayerView youTubeView = (YouTubePlayerView)findViewById(R.id.youtube_view);\n */\n // youTubeView.initialize(DEVELOPER_KEY, this);\n\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onLoadVideo(String result) {\n\n\t\t\t\t\t\t\t\t}", "public void onPrepared(MediaPlayer mediaPlayer) {\n progressDialog.dismiss();\n //if we have a position on savedInstanceState, the video playback should start from here\n videoView.seekTo(position);\n if (position == 0) {\n } else {\n //if we come from a resumed activity, video playback will be paused\n videoView.pause();\n }\n// mediaController.setAnchorView(videoView);\n\n // TODO Auto-generated method stub\n int duration = mediaPlayer.getDuration() / 1000;\n int hours = duration / 3600;\n int minutes = (duration / 60) - (hours * 60);\n int seconds = duration - (hours * 3600) - (minutes * 60);\n String formatted = String.format(\"%02d:%02d\", minutes, seconds);\n //Toast.makeText(getApplicationContext(), \"duration is \" + formatted , Toast.LENGTH_LONG).show();\n textViewDuration.setText(formatted);\n initComponentVideo(videoView, floatingActionButton, appCompatSeekBarProgressBar, (int) java.util.concurrent.TimeUnit.MINUTES.toSeconds(minutes) + seconds, mediaPlayer, textViewDuration, smallPlayButton, soundButton, fullScreenButton);\n\n // appCompatSeekBarProgressBar.setProgress(videoView.getDuration());\n\n }", "public void onVideoStarted () {}", "@Override\n public void onRetry(EasyVideoPlayer player, Uri source) {\n }", "public void fetchVideo(View view) {\n Log.i(\"progress\", \"fetchVideo\");\n\n startActivityForResult(requestVideoFileIntent,0);\n }", "@Override\n\t\tpublic void onClick(View v) {\n\n\t\t\tif (memreas_event_details_video_view.isPlaying()) {\n\t\t\t\tmemreas_event_details_video_view.pause();\n\t\t\t\tmemreas_event_details_video_view.setVisibility(View.GONE);\n\t\t\t\tmemreas_event_details_pager_image_view\n\t\t\t\t\t\t.setVisibility(View.VISIBLE);\n\t\t\t\tmemreas_event_details_pager_play_video_icon\n\t\t\t\t\t\t.setVisibility(View.VISIBLE);\n\t\t\t} else {\n\t\t\t\tmemreas_event_details_pager_framelayout.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\tmemreas_event_details_pager_image_view.setVisibility(View.GONE);\n\t\t\t\tmemreas_event_details_pager_play_video_icon\n\t\t\t\t\t\t.setVisibility(View.GONE);\n\t\t\t\t// mProgressDialog.setAndShow(\"preparing media...\");\n\t\t\t\tmemreas_event_details_video_view\n\t\t\t\t\t\t.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);\n\t\t\t\tmemreas_event_details_video_view.setVisibility(View.VISIBLE);\n\t\t\t\tmemreas_event_details_video_view.requestFocus();\n\t\t\t\tif (mediaController == null) {\n\t\t\t\t\tmediaController = new MediaController(context);\n\t\t\t\t}\n\t\t\t\tmemreas_event_details_video_view.setVideoURI(Uri\n\t\t\t\t\t\t.parse(media_url));\n\t\t\t\tmediaController.setAnchorView(memreas_event_details_video_view);\n\t\t\t\tmediaController\n\t\t\t\t\t\t.setMediaPlayer(memreas_event_details_video_view);\n\t\t\t\tmemreas_event_details_video_view\n\t\t\t\t\t\t.setMediaController(mediaController);\n\t\t\t\tmediaController.setEnabled(true);\n\t\t\t\tsetListeners();\n\t\t\t\tmemreas_event_details_video_view.requestLayout();\n\t\t\t\t// mProgressDialog.dismiss();\n\t\t\t}\n\t\t}", "@Override\n public void onVideoStarted() {\n }", "public interface VideoContract {\n interface P extends VideoControl{\n void onCreate(Context context);\n void setBuilder(VideoBuilder builder);\n void onPause();\n void onResume();\n void onDestroy();\n void playOrPause();\n void onViewDownTouch();\n void stopHideControlRunnable();\n void startHideControlRunnable();\n }\n interface V extends VideoControl{\n void showNotFoundVideo();\n //是否显示播放的按钮,则是在暂停的时候显示\n void setIsShowPlayIcon(boolean isShow);\n void setTimeTotal(int seconds);\n void setBufferingUpdatePosition(int seconds);\n void setTimeCurrent(int seconds);\n void playCompleteCleanFlags();\n void setTitle(String title);\n void showControlView();\n void hideControlView();\n }\n interface VideoControl {\n void seekToSecond(int seconds);\n void pauseVideo();\n void resumeVideo();\n void stopVideo();\n void playVideo(String url);\n }\n}", "public void onFinishInflate() {\n super.onFinishInflate();\n this.o = getResources().getDimensionPixelSize(R.dimen.view_dimen_1000);\n this.p = getResources().getDimensionPixelSize(R.dimen.view_dimen_561);\n this.f5336c = (TextView) findViewById(R.id.title);\n this.f5337d = (TextView) findViewById(R.id.video_repeat);\n this.e = (RelativeLayout) findViewById(R.id.video_container);\n this.f = (ImageView) findViewById(R.id.banner);\n this.i = (ShowTextCountTextView) findViewById(R.id.content);\n this.m = (ImageView) findViewById(R.id.sounds_btn);\n this.i.setTexColor(getResources().getColor(R.color.color_black_trans_40));\n this.j = (DataNetVideoPlayBtn) findViewById(R.id.video_play_btn);\n this.n = (RelativeLayout) findViewById(R.id.jump_view);\n this.r = (PlayerView) findViewById(R.id.player_view);\n this.r.setControllerVisibilityListener(this);\n this.r.requestFocus();\n if (Build.VERSION.SDK_INT < 26) {\n ((SurfaceView) this.r.getVideoSurfaceView()).getHolder().setFormat(-3);\n }\n this.j.setOnClickListener(this);\n this.m.setOnClickListener(this);\n this.i.setOnClickListener(this);\n this.n.setOnClickListener(this);\n this.f5337d.setOnClickListener(this);\n this.s = a(true);\n this.v = new DefaultTrackSelector.ParametersBuilder().build();\n this.l = (ImageView) findViewById(R.id.loading);\n this.k = ObjectAnimator.ofFloat(this.l, AnimatedProperty.PROPERTY_NAME_ROTATION, new float[]{0.0f, 719.0f});\n this.k.setDuration(3000);\n this.k.setRepeatCount(-1);\n this.k.setInterpolator(new LinearInterpolator());\n }", "private void setUpMediaPlayer(){\n //Inicializar Media PLayer\n mGlue = new LiveMediaPlayerGlue(getActivity(),this) {\n @Override\n protected void onRowChanged(PlaybackControlsRow row) {\n\n }\n };\n\n //Fragment de Video\n Fragment videoSurfaceFragment = getFragmentManager()\n .findFragmentByTag(VideoSurfaceFragment.TAG);\n\n SurfaceView surface = (SurfaceView) videoSurfaceFragment.getView();\n surface.getHolder().addCallback(new SurfaceHolder.Callback() {\n @Override\n public void surfaceCreated(SurfaceHolder holder) {\n mGlue.setDisplay(holder);\n }\n\n @Override\n public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n }\n\n @Override\n public void surfaceDestroyed(SurfaceHolder holder) {\n mGlue.resetPlayer();\n mGlue.releaseMediaSession();\n mGlue.setDisplay(null);\n mGlue.enableProgressUpdating(false);\n ;\n }\n });\n }", "@Override\n public void onClick(View v) {\n Intent it = new Intent(Intent.ACTION_VIEW);\n Uri uri = Uri.parse(\"http://\"+ PostUrl.Media+\":8080/upload/\"+item.getMediaPath().get(0).split(\"\\\\.\")[0]+\".mp4\");\n it.setDataAndType(uri, \"video/mp4\");\n context.startActivity(it);\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(\"http://www.youtube.com/watch?v=\"+tmp.get(position).key)));\n\n\n\n }", "public void verVideo(View v) {\n ViewVideo.setVideoURI(Uri.parse(getExternalFilesDir(null) + \"/\" + txtNombreArchivo.getText().toString()));\n /*Ejecutamos el video*/\n ViewVideo.start();\n }", "@Override\n public void onClick(View v) {\n playVideo();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n \tsuper.onCreate(savedInstanceState);\n \tsetContentView(R.layout.video_info);\n \t\n \tBundle extras = getIntent().getExtras();\n \tfinal Integer pos = extras.getInt(\"video_pos\", 0);\n \t\n \t\n \tswitch (pos) {\n \t\tcase 0: \n \t\t\ttitle = \"Title\";//(String) getResources().getText(R.string.v1_title);\n \t\t\tdescription = \"Description\";// (String) getResources().getText(R.string.v1_description);\n \t\t\turl = \"URL\";//(String) getResources().getText(R.string.v1_url);\n \t\t\thash = \"\";//(String) getResources().getText(R.string.v1_hash);\n \t\t\ttracker = \"\";//(String) getResources().getText(R.string.v1_tracker);\n \t\t\tdestination = \"\";// (String) getResources().getText(R.string.v1_destination);\n\n \t}\n \t\n \tTextView t = (TextView) findViewById(R.id.title);\n \tt.setText(title);\n \tt = (TextView) findViewById(R.id.description);\n \tt.setText(description);\n\n \tButton b_play = (Button) findViewById(R.id.b_play);\n \t \n \tb_play.setOnClickListener(new OnClickListener() {\n \t public void onClick(View view) {\n \t \tIntent intent = new Intent(getBaseContext(), VideoPlayerActivity.class);\n \t \tintent.putExtra(\"hash\", hash);\n \t \tintent.putExtra(\"tracker\", tracker);\n \t \tintent.putExtra(\"destination\", destination);\n \t \tstartActivity(intent);\n \t }\n \t});\n \t\n \tButton b_web_info = (Button) findViewById(R.id.b_web_info);\n \t \t \n \tb_web_info.setOnClickListener(new OnClickListener() {\n \t public void onClick(View view) {\n \t \t//Start video\n \t \tIntent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\n \t \tstartActivity(intent);\n \t }\n \t});\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tMap<String,String>map=new HashMap<String,String>();\n\t\t\t\tmap.put(\"videoID\", object.videoID);\n\t\t\t\tmap.put(\"videoname\", object.videoname);\n\t\t\t\tString albumVideoImgUrl=CommonUrl.baseUrl + object.videoImgUrl +\".small\"+ object.suffix;\n\t\t\t\tmap.put(\"videoImgUrl\", albumVideoImgUrl);\n\t\t\t\tCommonUtil.jumpToPlayerActivity(context, map);\n\t\t\t}", "@Override\n public void onClick(View view) {\n getOps().downloadVideo();\n }", "private void initVideo(String videoPath) {\n JCVideoPlayerStandard.startFullscreen(this, JCVideoPlayerStandard.class,\n videoPath,\"\");\n\n\n\n\n\n }", "public interface LiveVideoAllCallBack extends VideoAllCallBack{\n //暂时保留standardVideo方法\n //点击了空白区域开始播放\n void onClickStartThumb(String url, Object... objects);\n\n //点击了播放中的空白区域\n void onClickBlank(String url, Object... objects);\n\n //点击了全屏播放中的空白区域\n void onClickBlankFullscreen(String url, Object... objects);\n}", "public interface ExoPlayerMainContract {\n\n interface View extends BaseView<ExoPlayerMainContract.Presenter> {\n\n \tvoid openPlayerActivity();\n }\n\n interface Presenter extends BasePresenter {\n\n \tvoid playTestVideo();\n }\n}", "public void onClick(View v) {\n\t\t\tswitch(v.getId())\n\t\t\t{\n\t\t\tcase R.id.imageLatest: \t//上一首, 若已是第一部就移到最後一部\n \t\tvideoindex --;\n \t\tif (videoindex < 0) videoindex = videofile.length-1; \n\t\t\t\tplayVideo();\n\t\t\t\tbreak;\n\t\t\tcase R.id.imageStop: \t\t//停止\n\t\t\t\tmediaplayer.stop(); \n\t\t\t\tbreak;\n\t\t\tcase R.id.imagePlay: \t\t//播放\n\t\t\t\tif(flagPause) { \t\t//如果是暫停狀態就繼續播放\n\t\t\t\t\tmediaplayer.start(); \n \t\tflagPause=false;\n\t\t\t\t}\n\t\t\t\telse playVideo();\n\t\t\t\tbreak;\n\t\t\tcase R.id.imagePause: \t//暫停\n\t\t\t\tif (mediaplayer.isPlaying()) {\n \t\tmediaplayer.pause();\n \t\tflagPause=true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase R.id.imageNext: \t\t//下一部, 若已是最後一部就移到第一部\n\t\t\t\tvideoindex ++;\n\t\t\t\tif (videoindex >= videofile.length) videoindex = 0;\n\t\t\t\tplayVideo();\n\t\t\t\tbreak;\n\t\t\tcase R.id.imageTurnoff: \t//結束撥放程式\n\t\t\t\tfinish();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "@Override\n public void onPaused(EasyVideoPlayer player) {\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n playerView = (PlayerView) findViewById(R.id.ExoPlayerVIew);\n initPlayer();\n }", "@Override\n public void onResponse(String response) {\n response = response.substring(response.indexOf(\"og:video:url\\\" content=\\\"\") + 23);\n response = response.substring(0, response.indexOf(\".mp4\") + 4);\n UrlFilm = response;\n Log.i(\"HTML\", \" \" + response);\n }", "@Override\n public void onResponse(String response) {\n response = response.substring(response.indexOf(\"og:video:url\\\" content=\\\"\") + 23);\n response = response.substring(0, response.indexOf(\".mp4\") + 4);\n UrlFilm = response;\n Log.i(\"HTML\", \" \" + response);\n }", "public void playVideo(View view) {\n ImageView video = (ImageView) view;\n String tag = video.getTag().toString();\n listener.playVideo(tag);\n }", "@SuppressLint(\"WrongConstant\")\n public void onPrepared(MediaPlayer mediaPlayer) {\n progressDialog.dismiss();\n// placeHolderImage.getLayoutParams().width=3000;\n// placeHolderImage.getLayoutParams().height=840;\n //if we have a position on savedInstanceState, the video playback should start from here\n placeHolderImage.seekTo(position);\n if (position == 0) {\n } else {\n //if we come from a resumed activity, video playback will be paused\n placeHolderImage.pause();\n }\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tfinal ImageView imgvw = (ImageView) v;\n\t\t\t\t\t\tif (imgvw.getTag(R.string.PlayPauseKey).equals(\n\t\t\t\t\t\t\t\t\"Stopped\")) {\n\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey, \"Playing\");\n\t\t\t\t\t\t\timgvw.setImageResource(View.INVISIBLE);\n\t\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t\t.start();\n\t\t\t\t\t\t} else if (imgvw.getTag(R.string.PlayPauseKey).equals(\n\t\t\t\t\t\t\t\t\"Playing\")) {\n\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey, \"Stopped\");\n\t\t\t\t\t\t\timgvw.setImageResource(R.drawable.ic_menu_play_clip);\n\t\t\t\t\t\t\t// seekRun.player.pause();\n\t\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t\t.pause();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t((VideoView) imgvw.getTag(R.string.PlayPauseVideo))\n\t\t\t\t\t\t\t\t.setOnCompletionListener(new OnCompletionListener() {\n\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\t\t\t\timgvw.setImageResource(R.drawable.ic_menu_play_clip);\n\t\t\t\t\t\t\t\t\t\timgvw.setTag(R.string.PlayPauseKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\"Stopped\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t}", "private void onPlayVideoClick() {\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setDataAndType(Uri.parse(\"file://\" + mediaPath), \"video/mp4\");\n startActivity(intent);\n }", "public void downloadVideo(Context context, VideoView videoView){\n \t\t this.videoView = videoView;\n \t\t download = new DownloadVideo(context, SAVE_PATH);\n \t\t download.execute();\n \t }", "@Override\n public void onReceive(Context context, Intent intent) {\n Toast.makeText(VideoDetailsActivity.this,\"Reciever fot the result. Do some processing bro\",Toast.LENGTH_LONG).show();\n mVideoView.setVideoURI();\n }", "@SuppressLint(\"JavascriptInterface\")\n@SuppressWarnings(\"unchecked\")\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n\tsuper.onCreate(savedInstanceState);\n\tsetContentView(R.layout.vedio_web_view_layout);\n\tgetSupportActionBar().hide();\n\tcancel_btn = (ImageButton) findViewById(R.id.cancel_btn);\n\tvedioView = (WebView) findViewById(R.id.vedio_view_id);\n\t//Uri uri=Uri.parse(getIntent().getStringExtra(\"vedio_url\"));\n\tpd = new ProgressDialog(VedioWebView.this);\n\t//pd.setCancelable(false);\n\tpd.setMessage(\"Loading\");\n\tLog.e(\"Url \", getIntent().getStringExtra(\"vedio_url\"));//01-04 03:07:49.042: E/Url(4158): \n\tWebSettings webSettings = vedioView.getSettings();\n\n\tvedioView.addJavascriptInterface(new WebAppInterface(getApplicationContext()), \"Android\");\n\t webSettings.setJavaScriptEnabled(true);\n\t vedioView.requestFocusFromTouch();\n\tvedioView.setWebViewClient(new WebViewClient()\n\t\t\t{\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tsuper.onPageFinished(view, url);\n\t\t\t\t\tpd.show();\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onPageStarted(WebView view, String url, Bitmap favicon) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tsuper.onPageStarted(view, url, favicon);\n\t\t\t\t\tpd.dismiss();\n\t\t\t\t}\n\t\t\n\t\t\t});\n\n\t//01-04 03:02:29.441: E/Url(3431): https://m.youtube.com/watch?v=UI72Wu6o_EE\n\n\t\n\t//10-30 18:18:33.408: E/Base URL(1779): https://m.youtube.com/embed/UI72Wu6o_EE\n//https://www.youtube.com/embed/xfLhdkkGUKo\n\t\n\t//10-30 16:59:33.510: E/Base URL(6790): https://www.youtube.com/watch/?v=q5-rZRKFQJA\n\n\t\n\t\n\t\n\t//Toast.makeText(mContext, \"URL \"+ newsList.get(position).getNews_feed_attach_url(), 1).show();\n\t\n\tLog.e(\"Base URL\", getIntent().getStringExtra(\"vedio_url\").replace(\"watch?v=\", \"embed/\").replace(\"//m.\", \"//www.\"));\n\n\tvedioView.loadUrl(getIntent().getStringExtra(\"vedio_url\").replace(\"watch?v=\", \"embed/\").replace(\"//m.\", \"//www.\"));\n\t\n\t\n\t\n\tbottom_layout = (LinearLayout) findViewById(R.id.bottom_layout);\n\t\n\tnewsList = AppConstants.newsList;\n\ttry\n\t{\n\t\tposition =Integer.parseInt(getIntent().getStringExtra(\"pos\"));\t\n\t}\n\tcatch(Exception e)\n\t{\n\t\t\n\t}\n\t\n\tcomment_relative_layout = (RelativeLayout) findViewById(R.id.comment_relative_layout);\n\t\n\t\n\t\n\tcomment_send_btn = (ImageButton) findViewById(R.id.comment_send_btn);\n\t\n\t\n\t\n\tlike_unlike_change_btn = (TextView) bottom_layout.findViewById(R.id.like_unlike_change_btn);\n\t\n\t\n\tcomment_edittxt = (EditText) bottom_layout.findViewById(R.id.comment_edittxt);\n\t\n\t\n\t\n\t\n\tcomment_btn = (TextView) bottom_layout.findViewById(R.id.comment_btn);\n\t\n\t\n\t\n\tlike_unlike_change_btn.setOnClickListener(onclick);\n\tcomment_btn.setOnClickListener(onclick);\n\t\n\t\n\tcomment_send_btn.setOnClickListener(onclick);\n\t\n\t path_list = (ArrayList<String>) getIntent().getSerializableExtra(\"path_list\");\n\t //Toast.makeText(getApplicationContext(), position+\" vedio url \"+newsList.get(position).getVedioUrl(), 1).show();\n\tif(isLoadAdapter == false)\n\t{\n\t\t\n\t\t\n\t\t\n\t\tisLoadAdapter = true;\n\t}\n\t\t\n\ttry\n\t{\n\t\tif(getIntent().getStringExtra(\"show_bottom\").equalsIgnoreCase(\"1\"))\n\t\t{\n\t\t\tbottom_layout.setVisibility(View.VISIBLE);\t\n\t\t\t//Toast.makeText(getApplicationContext(), \"status \"+newsList.get(position).getMyLikeStatus(), 1).show();\n\t\t\t\n\t\t\tif(newsList.get(position).getMyLikeStatus().equals(\"1\"))\n\t\t\t{\n\t\t\t\tlike_unlike_change_btn.setTextColor(Color.parseColor(\"#536CB5\"));\n\t\t\t\tlike_unlike_change_btn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.active_like_icon, 0, 0, 0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tString filename=path_list.get(image_pos) .substring(path_list.get(image_pos).lastIndexOf(\"/\")+1);\n\t\t\n\t\t\n\t\t\n\n\t\t \n\t\t \n\t\t \n\t\t\t\n\t}\n\tcatch(Exception e)\n\t{\n\t\t\n\t}\n try\n\t{\n\tif(Integer.parseInt(newsList.get(position).getCommentCount())!=0)\t\n\t{\n\t\tcomment_btn.setTextColor(Color.parseColor(\"#536CB5\"));\n\t\tcomment_btn.setCompoundDrawablesWithIntrinsicBounds(R.drawable.active_comment_icon, 0, 0, 0);\n\t\n\t}\n\t}\n\tcatch(Exception e)\n\t{\n\t\n\t}\n\tcancel_btn.setOnClickListener(new OnClickListener() {\n\t\t\n\t\t@Override\n\t\tpublic void onClick(View v) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tfinish();\n\t\t}\n\t});\n\t\n}", "@Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n mVideoView.seekTo(0);\n mVideoView.start();\n }", "@Override\n\t\t\t\t\tpublic void onLoadVideo(String result) {\n\n\t\t\t\t\t}", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_details);\n\n Intent intent = getIntent();\n Uri data = intent.getData();\n String key = intent.getStringExtra(SearchManager.EXTRA_DATA_KEY);\n if (data != null && key != null) {\n\n if (data.toString().equals(\"homeview://plex/playback\")) {\n\n Intent next = new Intent(this, PlaybackActivity.class);\n next.setAction(PlaybackActivity.ACTION_VIEW);\n next.putExtra(PlaybackActivity.KEY, key);\n PlexVideoItem vid = intent.getParcelableExtra(PlaybackActivity.VIDEO);\n if (vid != null)\n next.putExtra(PlaybackActivity.VIDEO, vid);\n startActivity(next);\n }\n }\n }", "public Single<Uri> video(@NonNull FragmentActivity activity) {\n return requestImage(\n activity,\n false,\n MimeType.VIDEO)\n .map(uris -> uris.get(0)\n );\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n final Channel channel;\n channel = channels.get(position);\n\n this.setupStalkerClient();\n\n String url = UrlSettings.getResUrl() + this.user_id + \"/tv-channels/\"+channel.channel_id + \"/link\";\n\n getAPILoader().loader(url, new StalkerLoader.OnJSONResponseCallback() {\n @Override\n public void onJSONResponse(boolean success, JSONObject response) {\n\n try {\n if (response.has(\"status\")) {\n\n String channelLink = response.getString(\"results\");\n Log.d(TAG, \"Channel LINK is: \" + channelLink);\n\n Intent player = new Intent();\n player.setAction(Intent.ACTION_VIEW);\n\n player.setDataAndType(Uri.parse(channelLink), \"video/*\");\n player.putExtra(\"title\", channel.name);\n player.putExtra(\"secure_uri\", true);\n startActivity(player);\n }\n\n if (response.has(\"error\")) {\n\n Toast.makeText(getActivity().getApplicationContext(), response.getString(\"error\"), Toast.LENGTH_LONG).show();\n }\n\n } catch (JSONException e) {\n\n Toast.makeText(getActivity().getApplicationContext(), \"Error in code..((\", Toast.LENGTH_LONG).show();\n e.printStackTrace();\n\n }\n\n Log.d(TAG, \"GET CHANNELS REQUEST COMPLETE: \" + response.toString());\n }\n });\n\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n playVideo(mActivity, itemDrm);\n }", "@Override\r\n public void onItemClick(AdapterView<?> arg0, View arg1, int nSelectIndex, long arg3) {\n\r\n LocalDefines.B_INTENT_ACTIVITY = true; // add by mai 2015-5-15\r\n if (arg0.getId() == R.id.lvPlayer_back) {\r\n\r\n if (nSelectIndex >= 0 && nSelectIndex < LocalDefines._severInfoListData.size()) {\r\n\r\n LocalDefines._PlaybackListviewSelectedPosition = nSelectIndex;\r\n DeviceInfo info = LocalDefines._severInfoListData.get(LocalDefines._PlaybackListviewSelectedPosition);\r\n if (info != null && textViewDevice != null) {\r\n boolean isZh = LocalDefines.isZh(getActivity());\r\n if (isZh) {\r\n// if (HomePageActivity.AppMode == 1) {\r\n//\r\n// if (info.getnProductId() > 0) {\r\n// } else if (info.getnProductId() == 0) {\r\n// isSearchCloudRec = false;\r\n// tvTFVideo.setTextColor(getResources().getColor(R.color.font_color_sky_blue2));\r\n// tvCloudVideo.setTextColor(getResources().getColor(R.color.font_color_gray));\r\n// } else {\r\n// isSearchCloudRec = false;\r\n// tvTFVideo.setTextColor(getResources().getColor(R.color.font_color_sky_blue2));\r\n// tvCloudVideo.setTextColor(getResources().getColor(R.color.font_color_gray));\r\n// }\r\n//\r\n// } else {\r\n// }\r\n }\r\n if (Functions.isNVRDevice(\"\" + info.getnDevID())) {\r\n llChannel.setVisibility(View.VISIBLE);\r\n } else {\r\n llChannel.setVisibility(View.GONE);\r\n }\r\n deviceInfo = info;\r\n if (info.getStrName() != null && info.getStrName().length() > 0) {\r\n textViewDevice.setText(info.getStrName());\r\n } else {\r\n textViewDevice.setText(\"\" + info.getnDevID());\r\n }\r\n bSearchType = true;\r\n ivPlayerBackType.setImageResource(R.drawable.play_back_video_back_2);\r\n\r\n btnListVisible.setVisibility(View.VISIBLE);\r\n\r\n popupListView.dismiss();\r\n }\r\n\r\n }\r\n\r\n } else if (arg0.getId() == R.id.recfile_list) {\r\n if (nSelectIndex >= 0 && nSelectIndex < fileList.size()) {\r\n\r\n if (mRecFileDownloader != null && mRecFileDownloader.isDownloading()) {\r\n // 锟斤拷锟斤拷锟斤拷锟斤拷锟截碉拷录锟斤拷锟侥硷拷\r\n Toast.makeText(getActivity(), getString(R.string.str_rec_file_cancle2), Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n\r\n if (!isCloudFileList) {\r\n // Log.i(\"TAG\", \"本地录像\");\r\n if (fileList != null && fileList.size() > 0) {\r\n SaveRecFileListToDatabase();\r\n }\r\n LocalDefines.listMapPlayerBackFile = fileList;\r\n StartPlayFile(nSelectIndex);\r\n\r\n } else {\r\n // Log.i(\"TAG\", \"云录像\");\r\n if (fileList != null && fileList.size() > 0) {\r\n SaveRecFileListToDatabase();\r\n }\r\n LocalDefines.cloudRecordFileList = fileList;\r\n if (mRecFileDownloader != null && mRecFileDownloader.isDownloading()) {\r\n // 锟斤拷锟斤拷锟斤拷锟斤拷锟截碉拷录锟斤拷锟侥硷拷\r\n Toast.makeText(getActivity(), getString(R.string.str_rec_file_cancle2), Toast.LENGTH_SHORT).show();\r\n return;\r\n }\r\n startPlayCloudRecordFile(nSelectIndex);\r\n }\r\n\r\n }\r\n }\r\n\r\n }", "private void setVideo(){\n /* if(detailsBean==null){\n showToast(\"没有获取到信息\");\n return;\n }\n UserManager.getInstance().setDetailsBean(detailsBean);\n upCallShowSetVideoData = new UpCallShowSetVideoData();\n upCallShowSetVideoData.smobile = Preferences.getString(Preferences.UserMobile,null);\n upCallShowSetVideoData.iringid = detailsBean.iringid;\n if (callShowSetVideoProtocol == null) {\n callShowSetVideoProtocol = new CallShowSetVideoProtocol(null, upCallShowSetVideoData, handler);\n callShowSetVideoProtocol.showWaitDialog();\n }\n callShowSetVideoProtocol.stratDownloadThread(null, ServiceUri.Spcl, upCallShowSetVideoData, handler,true);*/\n }", "private void getVideo() {\n // create the url\n String temp = movie.getId().toString();\n String url = API_BASE_URL+\"/movie/\"+temp+\"/videos\";\n // set the request parameters\n RequestParams params = new RequestParams();\n params.put(API_KEY_PARAM, getString(R.string.api_key)); // Always needs API key\n // request a GET response expecting a JSON object response\n\n client.get(url,params, new JsonHttpResponseHandler() {\n\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n // load the results into movies list\n\n try {\n JSONArray results = response.getJSONArray(\"results\");\n JSONObject curMovie = results.getJSONObject(0);\n key = curMovie.getString(\"key\");\n\n } catch (JSONException e) {\n logError(\"Failed to parse play_video endpoint\", e, true);\n }\n\n\n }\n\n @Override\n public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {\n logError(\"Failed to get data from Now_playing endpoint\", throwable, true);\n }\n });\n\n }", "@Override\n public void onClick(View view) {\n youTubePlayerFragment.initialize(YoutubeAPI_KEY, new YouTubePlayer.OnInitializedListener() {\n\n @Override\n public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) {\n if (!wasRestored) {\n player.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);\n player.loadVideo(\"MOJRWYzevLg\");\n player.play();\n }\n }\n\n @Override\n public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult error) {\n // YouTube error\n // String errorMessage = error.toString();\n }\n });\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(context, MainVideo.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n View mvView = inflater.inflate(R.layout.fragment_mv, container, false);\r\n\r\n mvRecycleView = (RecyclerView) mvView.findViewById(R.id.recyclerView_mv);\r\n\r\n maps = new HashMap<>();\r\n maps.put(\"method\",\"baidu.ting.mv.searchMV\");\r\n maps.put(\"page_num\",\"1\");\r\n maps.put(\"page_size\",\"20\");\r\n initData(maps);\r\n\r\n\r\n\r\n mvRecycleView.setLayoutManager(new GridLayoutManager(getActivity(), 2));\r\n adapterVideoList = new MVAdapter(getActivity());\r\n\r\n mvRecycleView.setAdapter(adapterVideoList);\r\n//用okgo实现\r\n adapterVideoList.setOnItemClickListener(new MVAdapter.OnItemClickListener() {\r\n @Override\r\n public void onItemClick(View view, int position, String mvID) {\r\n /* //加载mv\r\n Map<String ,String > map1 = new HashMap<String, String>();\r\n map1.put(\"method\",\"baidu.ting.mv.playMV\");\r\n map1.put(\"mv_id\",mvID);\r\n loadmvData(map1);*/\r\n Log.d(TAG,position+\"\"+mvID);\r\n OkGo.<String>get(ApiStore.MVINFO_URL + mvID)\r\n .execute(new StringCallback() {\r\n @Override\r\n public void onSuccess(Response<String> response) {\r\n Gson gson = new Gson();\r\n MVInfo mvInfo = gson.fromJson(response.body(), MVInfo.class);\r\n MVInfo.ResultBean result = mvInfo.getResult();\r\n String file_link = result.getFiles().getValue31().getFile_link();\r\n Toast.makeText(getActivity(), file_link, Toast.LENGTH_SHORT).show();\r\n JZVideoPlayerStandard.startFullscreen(getActivity(),JZVideoPlayerStandard.class,\r\n file_link,result.getMv_info().getTitle());\r\n }\r\n });\r\n\r\n }\r\n });\r\n return mvView;\r\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);\n getWindow().setFormat(PixelFormat.UNKNOWN);\n setContentView(R.layout.activity_game_video_feed);\n\n mp4 = MediaPlayer.create(this,R.raw.videomusic);\n mp4.setLooping(true);\n mp4.start();\n\n\n VideoView videoView = (VideoView) findViewById(R.id.videoView003);\n\n Random rank = new Random();\n int num = rank.nextInt(4) + 1;\n\n videoView.setVideoPath(\"storage/emulated/0/Movies/cat1/eat/eat\" + num + \".mp4\");\n videoView.requestFocus();\n videoView.start();\n videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mp) {\n mp.setVolume(0, 0);\n }\n });\n\n videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n /*Intent intent = new Intent();\n intent.setClass(Game_video_play.this, MainActivity.class);\n startActivity(intent);*/\n mp4.stop();\n Game_video_feed.this.finish();\n }\n });\n\n /* button.setOnClickListener(new Button.OnClickListener() {\n @Override\n public void onClick(View v) {\n VideoView videoView = (VideoView) findViewById(R.id.videoView);\n String uriPath = \"android.resource://example.prgguru.com.myapplication/\"+R.raw.ykzzldx;\n Uri uri = Uri.parse(uriPath);\n videoView.setVideoURI(uri);\n videoView.requestFocus();\n videoView.start();\n\n }\n });*/\n\n\n }", "@Override\n public void onMediaClicked(int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tArrayList<VideoInfo> videoinfo = new ArrayList<VideoInfo>();\n\t\t\t\tfor(int i = 0;i<now_source.size();i++){\n\t\t\t\t\tVideoInfo vinfo = new VideoInfo();\n\t\t\t\t\tvinfo.title = now_source.get(i).getTitle();\n\t\t\t\t\tvinfo.url = now_source.get(i).getUrl();\n\t\t\t\t\tvideoinfo.add(vinfo);\n\t\t\t\t}\n\t\t\t\tif(null!=videoinfo&&videoinfo.size()>0){\n\t\t\t\t\tIntent intent = null;\n\t\t\t\t\tintent = new Intent(VodDetailsActivity.this,WebVideoPlayerActivity.class);\n//\t\t\t\t\tif(null!=domain && domain.contains(\"pps\")||domain.contains(\"qiyi\")){\n//\t\t\t\t\t\tintent = new Intent(VodDetailsActivity.this,MeidaActivity.class);\n//\t\t\t\t\t}else{\n//\t\t\t\t\t\tintent = new Intent(VodDetailsActivity.this,VideoPlayerActivity.class);\n//\t\t\t\t\t}\n\t\t\t\t\tintent.putParcelableArrayListExtra(\"videoinfo\",videoinfo);//数据集合\n\t\t\t\t\tintent.putExtra(\"albumPic\",albumPic);//图片路径\n\t\t\t\t\tintent.putExtra(\"vodtype\", vodtype);//影片类型\n\t\t\t\t\tintent.putExtra(\"vodstate\", vodstate);//影片情势\n\t\t\t\t\tintent.putExtra(\"nextlink\", nextlink);\n\t\t\t\t\tintent.putExtra(\"videoId\", videoId);//影片ID\n\t\t\t\t\tintent.putExtra(\"vodname\", vodname);//电影的名字\n\t\t\t\t\tintent.putExtra(\"sourceId\", sourceId);//源id\n\t\t\t\t\tintent.putExtra(\"domain\", domain);//domain\n\t\t\t\t\tintent.putExtra(\"playIndex\",gv_postion*10+position);//剧集标\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\toverridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);\n\t\t\t\t}else{\n\t\t\t\t\tUtils.showToast(context,\n\t\t\t\t\t\t\t\"对不起!没有找到数据源,请切换其它源。\",\n\t\t\t\t\t\t\tR.drawable.toast_err);\n\t\t\t\t}\n\t\t\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tif (!LibsChecker.checkVitamioLibs(this))\n\t\t\treturn;\n\t\t// Vitamio.initialize(this); //先初始化\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);// 不要标题栏,必须在setContentview之前\n\t\t// 设置全屏\n\t\tthis.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\n\t\tsetContentView(R.layout.videoview);\n\t\tmVideoView = (VideoView) findViewById(R.id.surface_view);\n\t\tthis.mAudioManager = (AudioManager) this\n\t\t\t\t.getSystemService(AUDIO_SERVICE);\n\t\tthis.getWindow().setFlags(\n\t\t\t\tWindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,\n\t\t\t\tWindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);// 屏幕常亮\n\t\tIntent intent = this.getIntent();\n\t\tthis.name = intent.getStringExtra(\"name\");\n\t\tthis.url = intent.getStringExtra(\"url\");\n\t\tthis.username = intent.getStringExtra(\"username\");\n\t\tthis.courseid = intent.getStringExtra(\"courseid\");\n\t\tthis.httpUrl = intent.getStringExtra(\"httpUrl\");\n\t\tSystem.out.println(\"试听地址:\"+url);\n\t\tSystem.out.println(\"http地址:\"+httpUrl);\n\t\tthis.playType = intent.getStringExtra(\"playType\");\n\t\t/* 2014.06.19修改\n\t\tif (!\"free\".equals(playType)) {\n\t\t\tif (isLocalUrl()) {\n\t\t\t\t// 表示从文件里读取,看文件是否存在\n\t\t\t\tFile file = new File(url);\n\t\t\t\tif (!file.exists()) {\n\t\t\t\t\tToast.makeText(this, \"本地文件已经被删除\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t.show();\n\t\t\t\t\t// 修改courseTab中的记录,结束\n\t\t\t\t\tnew CourseDao(this).updateState(httpUrl, 0, username);\n\t\t\t\t\tif (\"local\".equals(intent.getStringExtra(\"loginType\"))) {\n\t\t\t\t\t\tthis.finish();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(!FileUtil.checkSDCard(file.length())){\n\t\t\t\t\t\t//磁盘空间不足\n\t\t\t\t\t\tToast.makeText(this, \"磁盘空间不足,b\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\tLayoutInflater inflater = LayoutInflater.from(this);\n\t\tView t = inflater.inflate(R.layout.title, null);\n\t\tt.getBackground().setAlpha(0);\n\t\tView bar = inflater.inflate(R.layout.videocontrol, null);\n\n\t\tthis.videoloadingLayout = (RelativeLayout) this\n\t\t\t\t.findViewById(R.id.videoloadingLayout);\n\t\tWindowManager wm = (WindowManager) this\n\t\t\t\t.getSystemService(Context.WINDOW_SERVICE);\n\t\twidth = wm.getDefaultDisplay().getWidth();// 屏幕宽度\n\t\theight = wm.getDefaultDisplay().getHeight();// 屏幕高度\n\t\tthis.title = new PopupWindow(t, 400, 50);\n\t\tthis.title.setAnimationStyle(R.style.AnimationFade);\n\t\tthis.toolbar = new PopupWindow(bar);\n\t\tthis.toolbar.setAnimationStyle(R.style.AnimationFade);\n\t\tvideoloadingLayout.setVisibility(View.VISIBLE);\n\t\tLooper.myQueue().addIdleHandler(new IdleHandler() {\n\t\t\t@Override\n\t\t\tpublic boolean queueIdle() {\n\t\t\t\t// 显示两个popupwindow\n\t\t\t\tif (title != null && mVideoView.isShown()) {\n\t\t\t\t\ttitle.showAtLocation(mVideoView, Gravity.TOP, 0, 0);\n\t\t\t\t\ttitle.update(height - 50, 0, width, 50);\n\t\t\t\t}\n\t\t\t\tif (toolbar != null && mVideoView.isShown()) {\n\t\t\t\t\ttoolbar.showAtLocation(mVideoView, Gravity.BOTTOM, 0, 0);\n\t\t\t\t\ttoolbar.update(0, 0, width, 220);\n\t\t\t\t}\n\t\t\t\t// 显示正在加载\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturnBtn = (ImageButton) t.findViewById(R.id.imageBack);\n\t\ttitleTxt = (TextView) t.findViewById(R.id.videoName);\n\t\ttitleTxt.setText(name);\n\t\tseekbar = (SeekBar) bar.findViewById(R.id.seekBar);// 视频进度条\n\t\tvolumnBar = (SeekBar) t.findViewById(R.id.seekBar1);// 音量拖拽条\n\t\tvolumnSize = (TextView) t.findViewById(R.id.volumnSize);// 音量百分数\n\t\tvolumnMax = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);\n\t\tint current = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);\n\t\tseekbar.setMax(1000);\n\t\tvolumnBar.setMax(volumnMax);\n\t\tvolumnBar.setProgress(current);\n\t\tvolumnSize.setText(current * 100 / volumnMax + \"%\");\n\t\tplaybtn = (ImageButton) bar.findViewById(R.id.imagePlay);\n\t\tprev = (ImageButton) bar.findViewById(R.id.imagePrevious);\n\t\tnext = (ImageButton) bar.findViewById(R.id.imageNext);\n\t\ttotalTime = (TextView) bar.findViewById(R.id.totalTime);\n\t\tcurrentTime = (TextView) bar.findViewById(R.id.playTime);\n\t\tClickEvent c = new ClickEvent();\n\t\treturnBtn.setOnClickListener(c);\n\t\tplaybtn.setOnClickListener(c);\n\t\tprev.setOnClickListener(c);\n\t\tnext.setOnClickListener(c);\n\t\tsetVolumeControlStream(AudioManager.STREAM_MUSIC);\n\t\tvolumnBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {\n\t\t\t@Override\n\t\t\tpublic void onStopTrackingTouch(SeekBar seekBar) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tmAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC,\n\t\t\t\t\t\tseekBar.getProgress(), 8);\n\t\t\t\tvolumnSize.setText(seekBar.getProgress() * 100\n\t\t\t\t\t\t/ seekBar.getMax() + \"%\");\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onStartTrackingTouch(SeekBar seekBar) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t}\n\t\t});\n\t\thandler = new MyHandler(this);\n\t\tinitUrl();\n\t\tif (!\"free\".equals(playType)) {\n\t\t\tinitRecord();\n\t\t\tif (isLocalUrl()) {\n\t\t\t\t// 表示从文件里读取,看文件是否存在\n\t\t\t\tfinal File file = new File(url);\n\t\t\t\tif (!file.exists()) {\n\t\t\t\t\tToast.makeText(this, \"本地文件已经被删除\", Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t.show();\n\t\t\t\t\t// 修改courseTab中的记录,结束\n\t\t\t\t\tnew CourseDao(this).updateState(httpUrl, 0, username);\n\t\t\t\t\tif (\"local\".equals(intent.getStringExtra(\"loginType\"))) {\n\t\t\t\t\t\tthis.finish();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(!FileUtil.checkSDCard(file.length())){\n\t\t\t\t\t\t//磁盘空间不足\n\t\t\t\t\t\tToast.makeText(VideoActivity3.this, \"磁盘空间不足,改由网络播放\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\turl = httpUrl;\t//切换到web模式\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnew Thread(){\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\tFile dir = Environment.getExternalStorageDirectory();\n\t\t\t\t\t\t\t\t\tString filePath = dir.getPath()+File.separator+\"eschool\"+\"temp_\";\n\t\t\t\t\t\t\t\t\tif(!new File(filePath).exists()){\n\t\t\t\t\t\t\t\t\t\tnew File(filePath).mkdirs();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\tFileUtil.encode(new File(url), Constant.OFFSET.getBytes().length, filePath+File.separator+\"current.flv\");\n\t\t\t\t\t\t\t\t\t\turl = filePath+File.separator+\"current.flv\";\n\t\t\t\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\t\t\t\tToast.makeText(VideoActivity3.this, \"文件解析出错,改由网络播放\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\t\t\t\turl = httpUrl;\t//切换到web模式\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thandler.sendEmptyMessage(1);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}.start();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n\t\t\t\t\t\tcurrentTime, totalTime, record.getCurrentTime(), videoloadingLayout, url);\n\t\t\t}\n\t\t} else {\n\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n\t\t\t\tcurrentTime, totalTime, 0, videoloadingLayout, url);\n\t\t}\n//\t\tif(isLocalUrl()) //是本地文件不用检查网络\n//\t\t{\n//\t\t\tif (!\"free\".equals(playType)) {\n//\t\t\t\tinitRecord();\n//\t\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n//\t\t\t\t\tcurrentTime, totalTime, record.getCurrentTime(),\n//\t\t\t\t\tvideoloadingLayout, url);\n//\t\t\t} else {\n//\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n//\t\t\t\t\tcurrentTime, totalTime, 0, videoloadingLayout, url);\n//\t\t\t}\n//\t\t}else\n//\t\t{\n//\t\t\tif(checkNetWork())\n//\t\t\t{\n//\t\t\t\tif (!\"free\".equals(playType)) {\n//\t\t\t\t\tinitRecord();\n//\t\t\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n//\t\t\t\t\t\tcurrentTime, totalTime, record.getCurrentTime(),\n//\t\t\t\t\t\tvideoloadingLayout, url);\n//\t\t\t\t} else {\n//\t\t\t\tplayer = new VitamioVideoPlayer(this, mVideoView, seekbar,\n//\t\t\t\t\t\tcurrentTime, totalTime, 0, videoloadingLayout, url);\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\n\t\t// 监听播完事件\n\t\t// 开一个线程等准备好就开始播放\n\t\t// new Thread() {\n\t\t// public void run() {\n\t\t// while (true) {\n\t\t// if (player.isCreated()) {\n\t\t// String url = \"http://www.youeclass.com:8090/2013yjssssjj2-1.flv\";\n\t\t// String url2 =\n\t\t// \"http://www.youeclass.com:8090/test_video.mp4\";//2013yjssssjj2-1.flv\";\n\t\t// // 网络视频地址\n\t\t// try {\n\t\t// player.playUrl(url);\n\t\t// handler.sendEmptyMessage(1);\n\t\t// break;\n\t\t// } catch (Exception e) {\n\t\t// handler.sendEmptyMessage(-1);\n\t\t// break;\n\t\t// }\n\t\t// }\n\t\t// }\n\t\t// };\n\t\t// }.start();\n\t\tthis.mGestureDetector = new GestureDetector(this, this);\n\t\tthis.mVideoView.setOnTouchListener(this);\n\t\tthis.mVideoView.setLongClickable(true);\n\t\tthis.mVideoView.setFocusable(true);\n\t\tthis.mVideoView.setClickable(true);\n//\t\tthis.mVideoView.setOnErrorListener(new OnErrorListener() {\n//\t\t\t@Override\n//\t\t\tpublic boolean onError(MediaPlayer mp, int what, int extra) {\n//\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\tToast.makeText(VideoActivity3.this, \"未知媒体错误\", Toast.LENGTH_LONG).show();\n//\t\t\t\ttry{\n//\t\t\t\t\tplayer.stop();\n//\t\t\t\t}catch(Exception e)\n//\t\t\t\t{\n//\t\t\t\t\te.printStackTrace();\n//\t\t\t\t}\n//\t\t\t\tVideoActivity3.this.finish();\n//\t\t\t\treturn false;\n//\t\t\t}\n//\t\t});\n\t\tmGestureDetector.setIsLongpressEnabled(true);\n\t}", "default void onVideoRepeat() {\n }", "@Override\n public void onItemClick(AdapterView parent, View view, int position, long id) {\n String nombre = listadoArchivos.get(position).getTitulo();\n\n //extraigo del nombre la parte de la extension (3gp o mp4)\n int inicio = nombre.indexOf(\".\");\n int fin = nombre.indexOf(\"\", inicio);\n String extension = (nombre.substring(inicio + 1));\n\n if (extension.equals(\"3gp\")) {\n Intent intent = new Intent(getContext(), AudioPlayerActivity.class);\n intent.putExtra(\"titulo\", nombre);\n startActivity(intent);\n } else {\n Intent intent = new Intent(getContext(), VideoPlayerActivity.class);\n intent.putExtra(\"titulo\", nombre);\n startActivity(intent);\n }\n\n\n }", "@Override\n\t\tpublic void onClick(View arg0) {\n\t\t\tSystem.out.println(\"播放网络上的音频\");\n\t\t\ttry {\n\n\t\t\t\tString path = catalogName + File.separator + videoName;\n\t\t\t\t// String path =\n\t\t\t\t// \"http://192.168.253.1:8080/httpGetVideo/5a3bbe53835ffd43/LoveStory.mp4\";\n\t\t\t\tConnectionDetector cd = new ConnectionDetector(\n\t\t\t\t\t\tHistoryVideoBroadcastActivity.this);\n\t\t\t\tLog.e(TAG, \"11111111111\");\n\t\t\t\tif (cd.isConnectingToInternet()) {\n\t\t\t\t\tMediaController mediaController = new MediaController(\n\t\t\t\t\t\t\tHistoryVideoBroadcastActivity.this); // 通过videoView提供的uri函数借口播放服务器视频\n\t\t\t\t\tmediaController.setAnchorView(videoView);\n\t\t\t\t\tUri video = Uri.parse(path);\n\t\t\t\t\tvideoView.setMediaController(mediaController);\n\t\t\t\t\tvideoView.setVideoURI(video);\n\t\t\t\t\tvideoView.start();\n\t\t\t\t} else {\n\t\t\t\t\tToast.makeText(HistoryVideoBroadcastActivity.this,\n\t\t\t\t\t\t\t\"网络连接没有开启,请设置网络连接\", 2000).show();\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO: handle exception\n\t\t\t\tToast.makeText(HistoryVideoBroadcastActivity.this,\n\t\t\t\t\t\t\"Error connecting\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t}", "public static void openVideoDetail(Activity activity, View sharedView, VideoModel videoModel) {\n sharedView = sharedView.findViewById(R.id.itemThumbnailView);\n Intent intent = new Intent(activity, DetailActivity.class);\n intent.putExtra(DetailActivity.ARG_DATA, videoModel);\n View navigationBar = activity.findViewById(android.R.id.navigationBarBackground);\n View statusBar = activity.findViewById(android.R.id.statusBarBackground);\n List<Pair<View, String>> pairs = new ArrayList<>();\n if (statusBar != null) {\n pairs.add(Pair.create(statusBar, Window.STATUS_BAR_BACKGROUND_TRANSITION_NAME));\n }\n if (navigationBar != null) {\n pairs.add(Pair.create(navigationBar, Window.NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME));\n }\n pairs.add(Pair.create(sharedView, DetailFragment.SHARED_IMAGE_KEY));\n\n Bundle bundle = ActivityOptions.makeSceneTransitionAnimation(activity, pairs.toArray(new Pair[pairs.size()])).toBundle();\n activity.startActivity(intent, bundle);\n }", "@Override\n public void onSeekComplete(MediaPlayer player) {\n \n }", "@Override\n\t\t\tpublic void onLoadVideo(String result) {\n\t\t\t}", "@Override\n public boolean onTouch(View v, MotionEvent event)\n {\n Uri rawUri = Uri.parse(\"android.resource://\" + getPackageName() + \"/\" + R.raw.a_0);\n videoView.setVideoURI(rawUri);\n videoView.start();\n return false;\n }", "@Override\n\tpublic void videoComplete() {\n\t\t\n\t}", "@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tthis.requestWindowFeature(Window.FEATURE_NO_TITLE);// 去掉标题栏\n\t\tAlertVideoView alertVideoView = new AlertVideoView(this);\n\t\t//this.requestWindowFeature(Window.FEATURE_NO_TITLE);// 去掉标题栏\n\t\t\tthis.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n\t\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\n\t\tsetContentView(alertVideoView);\n\t\tte_title = alertVideoView.getTe_title();\n\t\tte_desc = alertVideoView.getTe_desc();\n\t\tbtn_down = alertVideoView.getBtn_desc();\n\t\tvideoView = alertVideoView.getVideoView();\n\t\timg_close=alertVideoView.getImg_close();\n\t\timg_icon=alertVideoView.getImg_icon();\n\t\timg_volumvideo=alertVideoView.getImg_volumvideo();\n\t\tpb=alertVideoView.getPb();\n\t\tinitImageLoader(this);\n\t\tString androidId = \"\"\n\t\t\t\t+ android.provider.Settings.Secure.getString(\n\t\t\t\t\t\tgetContentResolver(),\n\t\t\t\t\t\tandroid.provider.Settings.Secure.ANDROID_ID);\n\t\tStringBuffer sb = new StringBuffer();\n\t\tsb.append(Constant.appofferUrl);\n\t\tsb.append(\"auth=\"\n\t\t\t\t+ Utils.getMD5(Constant.tapfunsKeys + Constant.getCurrentTime()));\n\t\tsb.append(\"&time=\" + Constant.getCurrentTime());\n\t\tsb.append(\"&appid=\" + Constant.appid);\n\t\tsb.append(\"&ingetral=No\");\n\t\tsb.append(\"&type=3\");\n\t\tTapfunsCommandExecute.getInstance().executeGet(this, sb.toString(),\n\t\t\t\tnew RequestCallBack() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void getRequestResult(String command) {\n\t\t\t\t\t\tAppofferUtil.getIntsance().StrToAppofferParams(command);\n\t\t\t\t\t\tAppofferUtil.getIntsance().getList().get(0)\n\t\t\t\t\t\t\t\t.getAd_desc();\n\t\t\t\t\t\tte_desc.setText(AppofferUtil.getIntsance().getList().get(0).getAd_desc());\n\t\t\t\t\t\tte_title.setText(AppofferUtil.getIntsance().getList().get(0).getAd_slogan());\n\t\t\t\t\t\t// 设置视频路径\n\t\t\t\t\t\tString url = AppofferUtil.getIntsance().getList()\n\t\t\t\t\t\t\t\t.get(0).getVedio_url();\n\t\t\t\t\t\tUri uri = Uri.parse(url);\n\t\t\t\t\t\tvideoView.setVideoURI(uri);\n\t\t\t\t\t\tImageLoader.getInstance().displayImage(\n\t\t\t\t\t\t\t\tAppofferUtil.getIntsance().getList().get(0).getLogo(), img_icon);\n\t\t\t\t\t\t// 开始播放视频\n\t\t\t\t\t\tvideoView.start();\n\t\t\t\t\t\t//videoView.setBackgroundColor(Color.TRANSPARENT);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t// 播放完成回调\n\t\tvideoView.setOnCompletionListener(new MyPlayerOnCompletionListener());\n\t\tvideoView.setOnPreparedListener(new MyPreparedListenerionListener());\n\t\tbtn_down.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\tIntent intent=new Intent(AlertVideoActivity.this, TapfunsWebActivity.class);\n//\t\t\t\tBundle bundle=new Bundle();\n//\t\t\t\tbundle.putString(\"gameurl\", AppofferUtil.getIntsance().getList().get(0).getTracking_link());\n//\t\t\t\tintent.putExtras(bundle);\n//\t\t\t\tstartActivity(intent);\n\t\t\t\tif (TextUtils.isEmpty(AppofferUtil.getIntsance().getList().get(0).getPackageName())) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tUri uri = Uri.parse(\"market://details?id=\"\n\t\t\t\t\t\t+ AppofferUtil.getIntsance().getList().get(0).getPackageName());\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW, uri);\n\t\t\t\tif (isPkgInstalled(AlertVideoActivity.this, \"com.android.vending\")) {\n\t\t\t\t\tintent.setPackage(\"com.android.vending\");\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\tAlertVideoActivity.this.startActivity(intent);\n\t\t\t}\n\t\t});\n\t\timg_volumvideo.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t\tif(player!=null){\n\t\t\t\t\tif(!isVoiceFlags){\n\t\t\t\t\t\tplayer.setVolume(0f, 0f);\n\t\t\t\t\t\tvideoView.start();\n\t\t\t\t\t\tisVoiceFlags=true;\n\t\t\t\t\t\timg_volumvideo.setBackgroundResource(TapfunsResourceUtil.findDrawableIdByName(AlertVideoActivity.this, \"volumvideo\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tplayer.setVolume(1f, 1f);\n\t\t\t\t\t\tvideoView.start();\n\t\t\t\t\t\tisVoiceFlags=false;\n\t\t\t\t\t\timg_volumvideo.setBackgroundResource(TapfunsResourceUtil.findDrawableIdByName(AlertVideoActivity.this, \"volumclosevideo\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\timg_close.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\n\t\t\t\t\t\tmyVideoView.setVideoPath(videopath);\n\t\t\t\t\t\tmyVideoView.start();\n\n\t\t\t\t\t}", "public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n try {\n JSONObject temp_items = items.getJSONObject(position);\n String ida = temp_items.getJSONObject(\"snippet\").getJSONObject(\"resourceId\").getString(\"videoId\");\n// MainActivity.setYoutubeVideo(ida);\n// getActivity().getActionBar().hide();\n Intent intent = new Intent(MainActivity.getAppContext(), YoutubeActivity.class);\n Bundle extras = new Bundle();\n extras.putString(\"vidid\", ida);\n Log.d(\"A\", position + \"\");\n intent.putExtras(extras);\n startActivity(intent);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n Log.d(\"url-clicked\",fileu.get(position));\n // mediaPlayer.setDataSource(fileu.get(position));\n Intent i= new Intent(homepage.this,Playeractivity.class);//create an isntent for the player activity class\n i.putExtra(\"FILE_URL\",user.Lecture);//pass the lecture url to the next activity\n startActivity(i);//start the new activity\n //Intent i = new Intent(getActivity(), DiscussAddValu.class);\n // startActivity(i);\n }", "@Override\n public void onListItemClick(Video clickedVideo) {\n }", "public void onPrepared(MediaPlayer mp) {\n\n videoViewFull.start();\n }", "@Override\n public void onClick(View view) {\n String url = \"https://khoapham.vn/download/vietnamoi.mp3\";\n MediaPlayer mediaPlayer = new MediaPlayer();\n mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n\n try {\n mediaPlayer.setDataSource(url);\n mediaPlayer.prepareAsync();\n mProgressBar.setVisibility(View.VISIBLE);\n mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mediaPlayer) {\n mProgressBar.setVisibility(View.GONE);\n mediaPlayer.start();\n }\n });\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onBindViewHolder(ViewHolder holder, final int position) {\n // - get element from your dataset at this position\n // - replace the contents of the view with that element\n final String name = filenames.get(position);\n // Bitmap bMap = ThumbnailUtils.createVideoThumbnail(filepaths.get(position), MediaStore.Video.Thumbnails.MINI_KIND);\n\n // Bitmap bMap = ThumbnailUtils.createVideoThumbnail(filepaths.get(position), MediaStore.Video.Thumbnails.FULL_SCREEN_KIND);\n\n //holder.rl.setBackgroundColor(context.getResources().getColor(android.R.color.darker_gray));\n holder.ll.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n Log.d(\"bis\", \"onBindViewHolder= \" + position);\n //remove(name);\n\n Intent i = new Intent(context, MainActivity.class);\n i.putExtra(\"fpath\", filepaths.get(position));\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(i);\n\n }\n });\n holder.iv.setImageBitmap(bitmaps.get(position));\n holder.video_infotv.setSelected(true);\n holder.video_infotv.setEllipsize(TextUtils.TruncateAt.MARQUEE);\n holder.video_infotv.setText(filenames.get(position));\n\n }", "@Override\n public void onVideoSizeChanged(MediaPlayer player, int width, int height) {\n \n }", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tUtils.printLog(TAG, \"onCreate start 20160621\");\r\n\t\tresolver = getContentResolver();\r\n\t\tsetContentView(R.layout.video_player);\r\n\t\t\r\n\t\tmAmanager = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);\r\n\t\tsoundManager = TTvSoundManager.getInstance(this);\r\n\t\tmPicmanager = TTvPictureManager.getInstance(this);\r\n\t\tmTvmanager = TvManager.getInstance(this);\r\n\t\tmTTvmanager = TTvManager.getInstance(this);\r\n\t\tapplication = (MediaPlayerApplication) getApplication();\r\n\t\t\r\n\t\t\r\n\t\tmTTvmanager.addHandler(setSourceHandler, TTvUtils.TV_HANDLER_INDEX_TV_SET_SOURCE);\r\n\t\t\r\n\t\t// 切信源\r\n\t\tEnTCLInputSource curSource = TTvCommonManager.getInstance(this).getCurrentInputSource();\r\n\r\n\t\tUtils.printLog(TAG, \"onCreate curSource==\" + curSource);\r\n\t\tif (curSource != EnTCLInputSource.EN_TCL_STORAGE) {\r\n//\t\t\tTTvCommonManager.getInstance(this).setInputSource(EnTCLInputSource.EN_TCL_STORAGE);\r\n\t\t\tTTvCommonManager.getInstance(this).setInputSource(EnTCLInputSource.EN_TCL_STORAGE,true);\r\n\t\t\tUtils.printLog(TAG, \"setInputSource EN_TCL_STORAGE 1\");\r\n\t\t}else{\r\n\t\t\tisSourceChanged = true;\r\n\t\t\tUtils.printLog(TAG, \"InputSource EN_TCL_STORAGE 2\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\r\n\t\tTDeviceInfo devinfo = TDeviceInfo.getInstance();\r\n\t\tclienttype = devinfo.getClientType(devinfo.getProjectID());\r\n\t\tUtils.printLog(TAG, \"clienttype is \" + clienttype);\r\n\t\tif (clienttype != null) {\r\n\t\t\tsplitArrayStrings = clienttype.split(\"-\");\r\n\t\t}\r\n\r\n\t\tif (!getPlayList(getIntent())) {\r\n\t\t\texitPlayforNoPlayList();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t/***先获取参数,确认是否启动极简播放器后,再show loading**/\r\n//\t\tshowWatingDialog(isSimple);\r\n\t\tif (mCurrIndex < 0) {\r\n\t\t\tmCurrIndex = 0;\r\n\t\t}\r\n\t\tUtils.printPlayList(mList);\r\n\t\tseekBarPopWindow = new SeekBarPopWindow(this, mMediaHanler);\r\n\t\tpopWindow = new NotePopupWindow(this, mMediaHanler);\r\n\t\tfindView();\r\n\t\tmVideoContrl = new IVideoPlayControlHandler(this);\r\n\t\tmVideoContrl.registerCallback(mCallback);\r\n\t\tapplication.setVideoContrl(mVideoContrl);\r\n\t\tmBookMark = new BookMarkDB(this);\r\n\t\tmSurfaceView = (SurfaceView) this.findViewById(R.id.surfaceView);\r\n\t\tholder = mSurfaceView.getHolder();\r\n\t\tholder.addCallback(mVideoContrl);\r\n\t\tholder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\r\n\t\tmTime = new Timer();\r\n\t\tmTime.schedule(mTimerTask, 0, 1000);\r\n\t\t//startPlayEventTimer();\r\n\t\tIntentFilter intentFilter2 = new IntentFilter();\r\n\t\tintentFilter2.addAction(ConnectivityManager.CONNECTIVITY_ACTION);\r\n\t\tthis.registerReceiver(mConnectionChangeReceiver, intentFilter2);\r\n\r\n\t\tIntentFilter intentFilter3 = new IntentFilter();\r\n//\t\tintentFilter3.addAction(VideoPlayerUIConst.COLLECTION_OPERATE_DONE);\r\n\t\tintentFilter3.addAction(VideoPlayerUIConst.ATV_OSD_OPEN);\r\n\t\tintentFilter3.addAction(CommonConst.CLOSE_VIDEO_PLAY);\r\n\t\tintentFilter3.addAction(CommonConst.HOME_PRESSED);\r\n\t\tintentFilter3.addAction(CommonConst.STR_PORWER_CHANGE);\r\n\t\tintentFilter3.addAction(CommonConst.TV_PRESSED);\r\n\t\tintentFilter3.addAction(CommonConst.CHANGE_SOURCE_PRESSED);\r\n\t\tintentFilter3.addAction(Intent.ACTION_SHUTDOWN); \r\n\t\tintentFilter3.addAction(CommonConst.EXIT_3D);\r\n\t\tintentFilter3.addAction(CommonConst.HISTORYRECORD);\r\n\t\tintentFilter3.addAction(CommonConst.SOURCE_CHANGEandVOICEASS);\r\n\t\tintentFilter3.addAction(CommonConst.LanuageChange);\r\n\t\tintentFilter3.addAction(CommonConst.VIDEO_HDR_HLG_BROADCAST);\r\n\t\tthis.registerReceiver(myCollectionBroadcastReceiver, intentFilter3);\r\n\r\n\t\tIntentFilter intentFilter4 = new IntentFilter();\r\n\t\tintentFilter4.addAction(CommonConst.VOICE_CONTROL);\r\n\t\tthis.registerReceiver(mVoiceReceiver, intentFilter4);\r\n\t\tsendStopWidgetMusicBroadcast();\r\n\r\n\t\tif (isDMR) {\r\n\t\t\tmVideoContrl.setPlayType(VideoPlayerContrlConsts.MEDIA_SEQUENCE_PLAY);\r\n\t\t} else {\r\n\t\t\tmVideoContrl.setPlayType(getSavedPlayerType());\r\n\t\t}\r\n\r\n\t\tlistDialog = new VideoFileListDialog(this, mList, application);\r\n\t\tlistDialog.setCallback(this);\r\n\r\n\t\tmenuDialog = new VideoMenuSettingDialog(this, application);\r\n\t\tmenuDialog.setCallback(this);\r\n\t\t//设置屏幕保持唤醒\r\n\t\tPowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);\r\n\t\twakeLock = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, \"VideoPlayer\");\r\n\t\t//退出屏保 \r\n\t\tint sysVersion = VERSION.SDK_INT; \r\n\t\tLog.v(TAG, \"onCreate sysVersion= \"+sysVersion);\r\n\t\tif (sysVersion>=17) {\r\n\t\t\t//退出屏保 minSdkVersion=\"17\"\r\n\t\t\tpowerManager.wakeUp(SystemClock.uptimeMillis());\r\n\t\t\tUtils.printLog(TAG, \"powerManager.wakeUp\");\r\n\t\t}\r\n\t\t\r\n\t\tint versionCode = Utils.getVersionCodeFromAPP(this);\r\n\t\tUtils.printLog(TAG, \"onCreate end ,versionCode=\"+versionCode);\r\n\t}", "public void onCompletion(MediaPlayer mp) {\n\t\t\t\tvideoindex ++;\n\t\t\t\tif (videoindex >= videofile.length) videoindex = 0;\n\t\t\t\tplayVideo();\n\t\t\t}", "private void InitVideoPlayer(String videoPlayPath) {\n if (mVideoPlayView != null) {\n if (!Tools.isVideoStreamlessModeOn()) {\n mVideoPlayView.stopPlayback();\n }\n\n mVideoPlayView.setPlayerCallbackListener(myPlayerCallback);\n }\n\n Log.i(TAG, \"*******videoPlayPath*****\" + videoPlayPath + \"SDK_INT: \" + Build.VERSION.SDK_INT);\n videoPlayPath = Tools.fixPath(videoPlayPath);\n\n \n if (videoPlayPath != null) {\n mVideoPlayView.setVideoPath(videoPlayPath);\n }\n mVideoPlayView.setHandler(videoHandler);\n\n }", "private void displayVideo(){\n ButtonBack displayVideo = new ButtonBack(\"/view/VideoWindow.fxml\");\n displayVideo.displayVideo(\"winner\",\"Congratulation\");\n }", "public void createPlayer() {\n mainHandler = new Handler();\n videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);\n trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);\n player = ExoPlayerFactory.newSimpleInstance(this, trackSelector);\n }", "@Override\n public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n this.requestWindowFeature(Window.FEATURE_NO_TITLE);\n setContentView(R.layout.splashscreen);\n\n\n videoview = (VideoView) findViewById(R.id.videoview);\n button = (Button) findViewById(R.id.skip);\n\n Uri uri = Uri.parse(\"android.resource://\"+getPackageName()+\"/\"+R.raw.spalsh);\n\n videoview.setVideoURI(uri);\n videoview.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n @Override\n public void onPrepared(MediaPlayer mp) {\n mp.setLooping(true);\n }\n });\n videoview.start();\n button.setPaintFlags(button.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent mainIntent = new Intent(SplashScreen.this,MainActivity.class);\n SplashScreen.this.startActivity(mainIntent);\n SplashScreen.this.finish();\n }\n });\n\n /* New Handler to start the Menu-Activity\n * and close this Splash-Screen after some seconds.*/\n /*new Handler().postDelayed(new Runnable(){\n @Override\n public void run() {\n Intent mainIntent = new Intent(SplashScreen.this,MainActivity.class);\n SplashScreen.this.startActivity(mainIntent);\n SplashScreen.this.finish();\n }\n }, SPLASH_DISPLAY_LENGTH);*/\n\n\n\n\n }", "private void initVideoPath() {\n File file = new File(Environment.getExternalStorageDirectory(),\n \"/Pictures/QQ/pandavideo_cut.mp4\");\n String videoPath = file.getAbsolutePath();\n\n// Toast.makeText(this,\"文件是否存在\"+file.exists(),Toast.LENGTH_LONG).show();\n Toast.makeText(this,\"文件路径\"+videoPath,Toast.LENGTH_LONG).show();\n mVideoView.setVideoPath(videoPath);\n mVideoView.start();\n\n }", "public View getView(int position, View convertView, ViewGroup parent) {\n ViewHolder holder;\n\n holder = new ViewHolder();\n holder.image = (ImageView) mInflater.inflate(R.layout.image_make_maopao, parent, false);\n holder.image.setTag(holder);\n\n if (position == getCount()-1) {\n\n holder.image.setImageResource(R.mipmap.ic_add_video);\n holder.uri = \"\";\n\n } else {\n\n VideoPickActivity.VideoInfo data = videoData.get(position);\n\n holder.image.setImageResource(R.mipmap.ic_default_image);\n new AsyncTask<Object,Void,Bitmap>(){\n ImageView icon;\n\n @Override\n protected Bitmap doInBackground(Object... params) {\n Long id = (Long) params[0];\n\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inDither = false;\n options.inPreferredConfig = Bitmap.Config.ARGB_8888;\n options.inSampleSize = 1;\n\n Bitmap bitmap = MediaStore.Video.Thumbnails.getThumbnail(getContentResolver(), id, MediaStore.Images.Thumbnails.MINI_KIND, options);\n ImageView icon = (ImageView) params[1];\n\n this.icon = icon;\n return bitmap;\n }\n\n @Override\n protected void onPostExecute(Bitmap bitmap) {\n icon.setImageBitmap(bitmap);\n }\n }.execute(data.photoId,holder.image,position);\n }\n\n return holder.image;\n }", "@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tfinal ViewHolder holder;\n\t\tif (convertView == null) {\n\t\t\tholder = new ViewHolder();\n\t\t\tconvertView = inflater.inflate(R.layout.video_gridview_item2, null);\n\t\t\tholder.video_img = (ImageView) convertView\n\t\t\t\t\t.findViewById(R.id.video_img);\n\t\t\tholder.video_play_num = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.video_play_num);\n\t\t\tholder.video_desc = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.video_desc);\n\t\t\tholder.video_category = (TextView) convertView\n\t\t\t\t\t.findViewById(R.id.video_category);\n\t\t\tconvertView.setTag(holder);\n\t\t} else {\n\t\t\tholder = (ViewHolder) convertView.getTag();\n\t\t}\n\t\tfinal OtherVideoObject object = list.get(position);\n//\t\tLog.d(\"gaolei\", \"url--------------\" + CommonUrl.baseUrl\n//\t\t\t\t+ object.videoImgUrl + object.suffix);\n\t\tCommonUtil.getUtilInstance().displayLowQualityInImage(\n\t\t\t\tCommonUrl.baseUrl + object.videoImgUrl + object.suffix,\n\t\t\t\tholder.video_img);\n\t\tholder.video_play_num.setText(object.videopnumber + \"\");\n\t\tholder.video_desc.setText(object.videoname);\n\t\tholder.video_category.setText(object.videodetails);\n\t\tconvertView.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tMap<String,String>map=new HashMap<String,String>();\n\t\t\t\tmap.put(\"videoID\", object.videoID);\n\t\t\t\tmap.put(\"videoname\", object.videoname);\n\t\t\t\tString albumVideoImgUrl=CommonUrl.baseUrl + object.videoImgUrl +\".small\"+ object.suffix;\n\t\t\t\tmap.put(\"videoImgUrl\", albumVideoImgUrl);\n\t\t\t\tCommonUtil.jumpToPlayerActivity(context, map);\n\t\t\t}\n\t\t});\n\t\treturn convertView;\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }" ]
[ "0.67979974", "0.66707283", "0.65247923", "0.64813656", "0.63907915", "0.6365307", "0.6349919", "0.6311973", "0.6298991", "0.6262729", "0.61925423", "0.61713994", "0.6162165", "0.6152529", "0.6079044", "0.60471994", "0.60464567", "0.60306233", "0.59929353", "0.5975626", "0.5970819", "0.59698284", "0.59667873", "0.595166", "0.59509164", "0.5939329", "0.5924132", "0.5907233", "0.58762884", "0.58701557", "0.5864731", "0.58550566", "0.58495724", "0.5845891", "0.58417463", "0.58235055", "0.58224374", "0.5810764", "0.5783884", "0.5757755", "0.5745084", "0.57444865", "0.5738143", "0.5730104", "0.57222015", "0.5714115", "0.5706541", "0.5702912", "0.57016", "0.57016", "0.5700048", "0.5693983", "0.5691441", "0.5687007", "0.5682073", "0.5681913", "0.5669461", "0.5663387", "0.56617165", "0.56605166", "0.56598246", "0.56549764", "0.5615855", "0.5611817", "0.56087863", "0.55904883", "0.55821306", "0.558098", "0.5574696", "0.5571658", "0.55712396", "0.55671114", "0.55621046", "0.5540862", "0.55397606", "0.5534807", "0.55328465", "0.5532205", "0.55312014", "0.5523452", "0.55037105", "0.54962677", "0.54936963", "0.5490197", "0.5475525", "0.54711896", "0.54657555", "0.5465226", "0.54565924", "0.54521924", "0.5447372", "0.54433686", "0.542866", "0.5415062", "0.54089147", "0.540656", "0.54046273", "0.5404159", "0.5397301", "0.5391472" ]
0.6690628
1
////////////////// Initialization // //////////////////
@Override @Before public void before() { super.before(); usersSearchByLastNameUrl = rootUrl + "/users/search/findByLastName"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\n\n\t}", "public void init() {\n \n }", "private void initialize() {\n\t\t\n\t}", "public void init() {\r\n\r\n\t}", "private void init() {\n }", "private void init() {\n\n\n\n }", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "public void init() {\n\n\t}", "private void initialize() {\n\t}", "public void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "private void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void init(){\n \n }", "public void init() {\n\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void initialize() {\n }", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n protected void init() {\n }", "public void init() {\n\t\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected void initialize() {}", "protected void initialize() {}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void init() {\n }", "@Override\n public void initialize() {\n \n }", "protected void initialize() {\n \t\n }", "@Override\n void init() {\n }", "public void init() {\n\r\n\t}", "public void init() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "public void init() {\n\t}", "protected void initialize() {\n\t\t\n\t}", "protected void initialize() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "protected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void initialize() {\n\t\t\n\t}", "@Override\n public void initialize() {\n\n }", "@Override\n public void initialize() {\n\n }", "public void initialize()\n {\n }", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "protected void init() {\n\t}", "protected void init() {\n\t}", "protected void initialize() {\n\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "protected void initialize()\r\n {\n }", "@Override\n public void init() {\n\n super.init();\n\n }", "public void init() {}", "public void init() {}", "public static void init() {\n\t\t\n\t}", "public void initialize () {\n\n }" ]
[ "0.83307284", "0.8175234", "0.81164145", "0.81097454", "0.81038177", "0.80858636", "0.8059301", "0.8059301", "0.8059301", "0.8046115", "0.8027132", "0.8021678", "0.8012151", "0.8012151", "0.8012151", "0.8012151", "0.80039454", "0.80039454", "0.79942095", "0.79818213", "0.7980129", "0.79792833", "0.79792833", "0.79792833", "0.7977548", "0.7977548", "0.7977548", "0.7977548", "0.7977548", "0.79755723", "0.79739934", "0.79739934", "0.79739934", "0.79739934", "0.79739934", "0.79739934", "0.79617095", "0.7946887", "0.7946459", "0.7945918", "0.79441935", "0.7943759", "0.7938036", "0.79358256", "0.79358256", "0.7931937", "0.7924824", "0.79138446", "0.79138446", "0.79138446", "0.79114914", "0.7906745", "0.7906745", "0.7899036", "0.78935486", "0.7891704", "0.7891211", "0.7891053", "0.7885733", "0.7885733", "0.7880768", "0.7880768", "0.7862747", "0.7862747", "0.7862747", "0.78604347", "0.78604347", "0.78503764", "0.7850246", "0.78320736", "0.78320736", "0.78320736", "0.7827558", "0.782363", "0.7822037", "0.78139186", "0.78139186", "0.7813113", "0.78097516", "0.7804532", "0.7804532", "0.7804532", "0.7799143", "0.7799143", "0.77964324", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.7780252", "0.77675104", "0.77641165", "0.77628064", "0.77628064", "0.77604264", "0.77602816" ]
0.0
-1
/////////////////////////////////////// Users Search By Last Name URL Tests // ///////////////////////////////////////
@Test public void usersSearchByLastName_DELETE() { lastResponse = given().delete(usersSearchByLastNameUrl); assertMethodNotAllowedResponse(HttpMethod.DELETE, usersSearchByLastNamePath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User search_userinfo(String user_name);", "public String searchLastNameUI() {\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForPrintPrompt(\" + PLEASE ENTER LAST NAME TO SEARCH BY +\");\n console.promptForPrintPrompt(\" +++++++++++++++++++++++++++++++++++++++\");\n console.promptForString(\"\");\n String lastName = console.promptForString(\" LAST NAME: \");\n return lastName;\n }", "java.lang.String getLastName();", "java.lang.String getLastName();", "boolean validateLastName(String Last_name) {\n\t\treturn true;\n\n\t}", "protected void validateLastName(){\n Boolean lastName = Pattern.matches(\"[A-Z][a-z]{2,}\",getLastName());\n System.out.println(nameResult(lastName));\n }", "@Test\n public void testSearchUsersByName() {\n token.setGroupId(findMemberGroup(token).getGroupId());\n\n // Setting a partial name to search for. The search will look at both\n // first and last names which contain this as part of their name. In\n // this case, we're searching for \"man\", which will yield the following:\n // - Germany\n // - Oman\n // - Romania\n final SearchUserRequest request = new SearchUserRequest();\n request.setName(\"man\");\n\n // Now, invoke the search for users with a partial name given\n final SearchUserResponse response = administration.searchUsers(token, request);\n\n // And verify the result\n assertThat(response.isOk(), is(true));\n assertThat(response.getUsers().size(), is(3));\n }", "public int search_userid(String user_name);", "private boolean searchName(String username, ArrayList<String> existingList) {\n int low = 0;\n int high = existingList.size() - 1;\n int mid;\n\n while (low <= high) {\n mid = (low + high) / 2;\n String name = existingList.get(mid);\n String substr = name.substring(0, name.indexOf(\" \"));\n\n if (substr.compareToIgnoreCase(username) < 0) {\n low = mid + 1;\n } else if (substr.compareToIgnoreCase(username) > 0) {\n high = mid - 1;\n } else {\n return true;\n }\n\n }\n\n return false;\n }", "@Test(priority=62)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_last_name() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_last_name\", \"To validate whether user is able to get campaign and its users through campaign/user api with filter for non existing last_name\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_last_name\");\n\t\tString last_name = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"last_name%3d\"+last_name));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for non existing last_name\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t String result_data = json.get(\"result\").toString();\n\t\t Assert.assertEquals(result_data, \"error\", \"API is returning success when non existing last_name is entered for filter\");\n\t\t test.log(LogStatus.PASS, \"API is returning error when non existing last_name is entered for filter\");\n\t\t Assert.assertEquals(json.get(\"err\").toString(), \"no records found\", \"Proper validation is not displayed when non existing last_name is passed.\");\n\t\t test.log(LogStatus.PASS, \"Proper validation is displayed when non existing last_name is passed.\");\n\t\t}\n\t}", "String getLastName();", "String getLastName();", "public List<User> findUsersByFirstNameContainsOrLastNameContains(String firstName, String lastName);", "public void getName(ArrayList<String> document) {\r\n name = \"\";\r\n int atIndex = address.indexOf('@');\r\n String username = address.substring(0, atIndex);\r\n for(int i = 0; i < document.size(); i++)\r\n {\r\n String[] words = document.get(i).split(\" \");\r\n for(int j = 0; j < words.length; j++)\r\n {\r\n if(username.contains(words[j].toLowerCase()))\r\n {\r\n name = document.get(i);\r\n break;\r\n }\r\n }\r\n if(!name.equals(\"\"))\r\n {\r\n break;\r\n }\r\n } \r\n }", "@Override\n @Before\n public void before() {\n super.before();\n usersSearchByLastNameUrl = rootUrl + \"/users/search/findByLastName\";\n }", "public void testRetrieveUsersByNames() throws RetrievalException {\r\n System.out.println(\"Demo 3: Retrieves the users by names.\");\r\n\r\n // Should retrieve all users whose first name starts with 'First' and last name starts with 'Last'.\r\n ExternalUser[] users = defaultDBUserRetrieval.retrieveUsersByName(\"First A\", \"Last A\");\r\n // There should be 1 user got.\r\n System.out.println(users.length);\r\n\r\n ExternalUser user = users[0];\r\n // There is only one alternative email.\r\n System.out.println(user.getAlternativeEmails().length);\r\n // The email address should be the same to [email protected].\r\n System.out.println(user.getAlternativeEmails()[0]);\r\n // The design number ratings should be the same as 10.\r\n System.out.println(user.getDesignNumRatings());\r\n // The design rating should be the same as 1563.\r\n System.out.println(user.getDesignRating());\r\n // The design reliability should be the same 1.00 %.\r\n System.out.println(user.getDesignReliability());\r\n // The design volatility should be the same as 431.\r\n System.out.println(user.getDesignVolatility());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevNumRatings());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevRating());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevReliability());\r\n // There is no dev rating of the user.\r\n System.out.println(user.getDevVolatility());\r\n // The email address should be the same as [email protected].\r\n System.out.println(user.getEmail());\r\n // The first name should be the same as First A.\r\n System.out.println(user.getFirstName());\r\n // The last name should be the same as Last A.\r\n System.out.println(user.getLastName());\r\n // The handle should be the same as Handle A.\r\n System.out.println(user.getHandle());\r\n // The user id should be the same as 1001.\r\n System.out.println(user.getId());\r\n\r\n // Should retrieve all users whose last name starts with Last (ignores first name)\r\n ExternalUser[] tcsUsers = defaultDBUserRetrieval.retrieveUsersByName(\" \", \"Last\");\r\n // There should be 3 users got.\r\n System.out.println(tcsUsers.length);\r\n\r\n // must have at least first or last name be not empty.\r\n try {\r\n defaultDBUserRetrieval.retrieveUsersByName(\"\", \"\");\r\n } catch (IllegalArgumentException e) {\r\n // Ignore.\r\n }\r\n\r\n System.out.println();\r\n }", "@Test\n public void testUserSearch() {\n try {\n //Navigate to users search page (faster this way)\n driver.get(\"http://stackoverflow.com/users\");\n \n wait(3);\n \n //Get user-search box; auto-polling by javascript; no submit() needed\n driver.findElement(By.id(\"userfilter\")).sendKeys(\"fojallupigi-4562\");\n \n wait(4);\n \n //determine if my username is the only result\n String username = driver.findElement(By.cssSelector(\".user-details > a:nth-child(1)\")).getText();\n assertEquals(\"fojallupigi-4562\", username);\n }\n catch(NoSuchElementException nsee) {\n fail();\n }\n }", "public void testUserDirectory()\n {\n open(\"/xwiki/bin/view/XWS/Directory\");\n getSelenium().typeKeys(\"firstname\", \"Jean\");\n getSelenium().waitForCondition(\"selenium.page().bodyText().indexOf('Valjean') != -1;\", \"3000\");\n assertElementPresent(\"//td[@class='firstname']/a[text()='Jean']\");\n assertElementNotPresent(\"//td[@class='firstname']/a[text()='Adam']\");\n }", "public java.lang.String getLastName();", "public List<User> searchUser(String searchValue);", "public static String fixAuthor_lastnameFirst(String in){\n \n // Check if we have cached this particular name string before:\n Object old = Globals.nameCache_lastFirst.get(in);\n if (old != null)\n return (String)old;\n \n //Util.pr(\"lastnamefirst: in\");\n StringBuffer sb=new StringBuffer();\n \n String[] authors = in.split(\" and \");\n for(int i=0; i<authors.length; i++){\n \t authors[i]=authors[i].trim();\n \t int comma = authors[i].indexOf(',');\n \t test:if (comma >= 0) {\n \t // There is a comma, so we assume it's ok.\n \t sb.append(authors[i]);\n }\n else {\n // The name is without a comma, so it must be rearranged.\n int pos = authors[i].lastIndexOf(' ');\n if (pos == -1) {\n // No spaces. Give up and just add the name.\n sb.append(authors[i]);\n break test;\n }\n String surname = authors[i].substring(pos+1);\n if (surname.equalsIgnoreCase(\"jr.\")) {\n pos = authors[i].lastIndexOf(' ', pos - 1);\n if (pos == -1) {\n // Only last name and jr?\n sb.append(authors[i]);\n break test;\n }\n else\n surname = authors[i].substring(pos+1);\n }\n // Ok, we've isolated the last name. Put together the rearranged name:\n sb.append(surname + \", \");\n sb.append(authors[i].substring(0, pos));\n \n }\n if (i != authors.length - 1)\n sb.append(\" and \");\n }\n /*String[] t = authors[i].split(\",\");\n if(t.length < 2) {\n // The name is without a comma, so it must be rearranged.\n t = authors[i].split(\" \");\n if (t.length > 1) {\n sb.append(t[t.length - 1]+ \",\"); // Last name\n for (int j=0; j<t.length-1; j++)\n sb.append(\" \"+t[j]);\n } else if (t.length > 0)\n sb.append(t[0]);\n }\n else {\n // The name is written with last name first, so it's ok.\n sb.append(authors[i]);\n }\n \n if(i !=authors.length-1)\n sb.append(\" and \");\n \n }*/\n //Util.pr(in+\" -> \"+sb.toString());\n String fixed = sb.toString();\n \n // Add the fixed name string to the cache.\n Globals.nameCache_lastFirst.put(in, fixed);\n \n return fixed;\n }", "private String findDisplayName(String emailText) {\n for (User user : userList) {\n //Log.i(TAG, \"findDisplayName() : for loop\");\n if (user.getEmail().equals(emailText)) {\n //Log.i(TAG, \"emailText: \" + emailText);\n //Log.i(TAG, \"user.getEmail(): \" + user.getEmail());\n //Log.i(TAG, \"user.getUserName(): \" + user.getUserName());\n if (user.getUserName() == null) {\n break;\n }\n return user.getUserName();\n }\n }\n return \"No UserName\";\n }", "public void search(String LastName)\n {\n //delare variables to hold file types\n BufferedReader fIn = null;\n \n //try to open the file for reading\n try\n {\n fIn = new BufferedReader(new FileReader(filename)); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception opening the file\");\n }\n \n //try to read each record\n //if the value of the Last_name field equals the value\n /*\n create a counter to count the number of\n matching records\n */\n int counter = 0;\n \n try\n {\n //read the first record\n String line = fIn.readLine();\n \n //while the record is not null\n //split the record into fields\n //test if the field equals the LastName parameter\n //display the record and increment the counter\n //read the next record\n while(line != null)\n {\n String[] info = line.split(\",\");\n String last = info[0];\n if(last.equals(LastName))\n {\n System.out.print(line);\n counter += 1;\n }\n else\n {\n line = fIn.readLine();\n System.out.print(line);\n counter += 1;\n }\n line = fIn.readLine();\n }\n System.out.println(\"\\nTotal matching records found: \" + counter + \"\\n\");\n \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception reading the file\");\n }\n\n // try to close the file\n try\n {\n fIn.close(); \n \n }\n catch(IOException ioe)\n {\n System.out.println(\"search: Exception closing the file\");\n }\n \n //dislay a count of the records found\n \n \n }", "public void setLast_name(String last_name) {\r\n this.last_name = last_name;\r\n }", "List<AddressbookEntry> findByLastNameLike(String pattern);", "public void setLast_name(java.lang.String last_name) {\n this.last_name = last_name;\n }", "public void setLast_name(java.lang.String last_name) {\n this.last_name = last_name;\n }", "@View(designDocument = \"user\", viewName = \"byName\")\n List<User> findByLastname(String lastName);", "public void setLast_name(String last_name) {\n this.last_name = last_name;\n }", "public String getLastName();", "private List<User> simulateSearchResult(String firstName)\n\t{\n\n\t\tArrayList<User> user=(ArrayList<User>) userService.getAllUsers();\n\t\tArrayList<User> result = new ArrayList<User>();\n\t\tfor (User u : user) {\n\t\t\tif (u.getFirstName().contains(firstName)) {\n\t\t\t\tresult.add(u);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public List<User> listSearch(String search);", "public static boolean checkLastName(String lastName) throws UserRegistrationException {\n check = Pattern.compile(\"[A-Z]{1}[a-z]{2,}\").matcher(lastName).matches();\n if (check) {\n return true;\n } else {\n throw new UserRegistrationException(\"Enter Valid Lastname\");\n }\n }", "public List<com.ims.dataAccess.tables.pojos.User> fetchRangeOfLastname(String lowerInclusive, String upperInclusive) {\n return fetchRange(User.USER.LASTNAME, lowerInclusive, upperInclusive);\n }", "private String searchForUser() {\n String userId = \"\";\n String response = given().\n get(\"/users\").then().extract().asString();\n List usernameId = from(response).getList(\"findAll { it.username.equals(\\\"Samantha\\\") }.id\");\n if (!usernameId.isEmpty()) {\n userId = usernameId.get(0).toString();\n }\n return userId;\n }", "public static void findEmployeeByLastName(String lastName) {\n List<Employee> employees = null;\n try {\n employees = EmployeeRepository.findByLastName(dataSource, lastName);\n } catch (SQLException e) {\n LOGGER.error(e.getMessage());\n }\n if (employees.isEmpty()) {\n LOGGER.warn(\"The employee with the last name of \" + lastName + \" was not found in the list\");\n System.out.println(resourceBundle.getString(\"emp\") + \" \" + resourceBundle.getString(\"not.found\") + \" \" + lastName + \" \"\n + resourceBundle.getString(\"not.in.list\"));\n return;\n }\n employees.forEach(System.out::println);\n }", "@Test\n public void userExist() {\n String username = argument.substring(0, 15);\n boolean found = false;\n\n for(int i = 0; i<users.size(); i++){\n if(users.get(i).substring(0, 15).trim().toLowerCase().contains(username.trim().toLowerCase())){\n found = true;\n }\n }\n assertTrue(\"User Not Found\", found);\n }", "public boolean validateLastName() {\n\t\treturn this.getLastName().length() > 0 && this.getLastName().length() <= 20;\n\t}", "public List<com.ims.dataAccess.tables.pojos.User> fetchByLastname(String... values) {\n return fetch(User.USER.LASTNAME, values);\n }", "@Test\n\t\tvoid givenLasrName_CheckForValidationForLName_ReturnTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateLastName(\"More\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "@Query(\"MATCH (p:Person) \" + \"WHERE LOWER(p.firstName) CONTAINS LOWER({0}) \"\n + \"AND LOWER(p.lastName) CONTAINS LOWER({1}) \" + \"RETURN p\")\n Iterable<Person> locateByFirstLast(String firstName, String lastName);", "@Test\n\t void testLastName() {\n\t\tString expected=\"Faizan\";\n\t\tString actual=user.getLastName();\n\t\tassertEquals(expected, actual);\n\t}", "private static void RecommendedUserNames(String first, String last) {\n\t\tString [][] usernames = new String [2][2];\n\t\tint [] RandomNumbers = new int [4];\n\t\tfor (int i=0; i < 4; i++) {\n\t\t\tRandomNumbers[i]=(int)(Math.random()*100);\n\t\t}\n\t\tint k = 0;\n\t\tSystem.out.println(\"Choose a unique username, some of the recommended ones for you are below\");\n\t\tfor (int i = 0; i < 2; i++)\n\t\t\tfor (int j = 0; j < 2; j++) {\n\t\t\t\tif (k%2==0) usernames[i][j] = first+last+RandomNumbers[k];\n\t\t\t\telse usernames[i][j] = last+first+RandomNumbers[k];\n\t\t\t\tk++;\n\t\t\t\tSystem.out.println(usernames[i][j]+ \" \");\n\t\t\t}\n\t\tSystem.out.println();\n\t}", "List<User> searchUsersByUsername(String username);", "public void searchUserAccount( )\r\n throws TwitterException, URISyntaxException, IOException{\r\n\r\n // looks at all tweets since this page\r\n // the count is the limit\r\n\r\n int count = 0;\r\n String text = \"\";\r\n Paging paging = new Paging(pageInt, 10);\r\n List<Status> statuses = twitter.getUserTimeline(user, paging);\r\n\r\n for (Status s : statuses) {\r\n String url = \"https://twitter.com/\" + s.getUser().getScreenName() + \"/status/\" + s.getId();\r\n if (s.getRetweetedStatus() == null) {\r\n content = url;\r\n //send the links to text\r\n HandleFile(override, active);\r\n\r\n //regular expressions\r\n String regex = \"https://t.co/.*\";\r\n text = s.getText().replaceAll(regex,\"\");\r\n\r\n System.out.println(s.getUser().getName() + \": \" + text);\r\n System.out.println(url); //prints the url of the tweet\r\n System.out.println(s.getCreatedAt()+\"\\n\");\r\n\r\n //sets the tweets to variables to be exported\r\n tweets = tweets + \" \" +text + \"\\n\"+ url + \"\\n\" + s.getCreatedAt() + \"\\n\\n\";\r\n\r\n\r\n active = false;\r\n\r\n //search for nudes\r\n getTwitterImage(s);\r\n }\r\n count++;\r\n\r\n if(count == 5 && limitInt > 0){\r\n limitInt--;\r\n pageInt++;\r\n searchUserAccount();\r\n }\r\n }\r\n }", "public boolean verifyLastName(String LastName)\r\n {\r\n LastName = LastName.trim();\r\n\r\n if(LastName == null || LastName.isEmpty() || !LastName.matches(\"[a-zA-Z]*\"))\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "public static boolean lastName(String lastName) throws UserRegistrationException {\n\t\tboolean resultLastName = validateLastName.validator(lastName);\n\t\tif(resultLastName) {\n\t\t\treturn true;\n\t\t}else\n\t\t\tthrow new UserRegistrationException(\"Enter correct Last Name\");\n\t}", "List<User> findByfnameContaining(String search);", "static String getLastName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter last name: \");\n\t\tString ln = s.nextLine();\n\t\treturn ln;\n\t}", "public void setLastName( String last )\r\n {\r\n lastName = last;\r\n }", "@Override\n\tpublic List<User> searchByUser(String userName) {\n\t\tlog.info(\"Search by username!\");\n\t\treturn userRepository.findByFirstNameRegex(userName+\".*\");\n\t}", "@Repository(\"userRepository\")\npublic interface UserRepository extends JpaRepository<User, UUID> {\n\n User findByEmail(String email);\n\n List<User> findByFirstNameIgnoreCaseContaining(String firstName);\n\n List<User> findByLastNameIgnoreCaseContaining(String lastName);\n\n List<User> findByEmailIgnoreCaseContaining(String email);\n\n @Query(\"SELECT t FROM User t WHERE \" +\n \"LOWER(t.lastName) LIKE LOWER(CONCAT('%',:searchTerm, '%')) OR \" +\n \"LOWER(t.firstName) LIKE LOWER(CONCAT('%',:searchTerm, '%'))\")\n Page<User> searchByTerm(@Param(\"searchTerm\") String searchTerm, Pageable pageable);\n}", "List<UserRepresentation> searchUserAccount(final String username);", "public void setLastName(StringFilter lastName) {\n\t\tthis.lastName = lastName;\n\t}", "public void research() throws Exception\r\n\t{\r\n\t\tresult = ((CLibraryManager)AUser.getInstance()).searchUser(jTextField_UserName.getText(),jTextField_UserID.getText(),jTextField_FirstName.getText(),jTextField_LastName.getText());\r\n\t}", "public void setLastname(String lastname) {\r\n\t\tthis.lastname = lastname;\r\n\t}", "List<Student> findAllByLastNameLike(String lastName);", "@Test(priority=60)\t\n\tpublic void campaign_user_with_valid_filter_for_last_name() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_valid_filter_for_last_name\", \"To validate whether user is able to get campaign and its users through campaign/user api with valid filter for last_name\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_valid_filter_for_last_name\");\n\t\tString last_name = this.last_name;\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"last_name%3d\"+last_name));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for last_name\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t JSONArray array = (JSONArray)json.get(\"data\");\n\t\t // Check whether campaign list returns at least 1 record when valid last_name is passed for filter\n\t\t Assert.assertTrue(array.size()>=1, \"campaign/user does not return records when valid last_name is passed for filter.\");\n\t\t System.out.println(\"Array Size: \"+array.size());\n\t\t for(int i=0; i<array.size(); i++){\n\t\t\t // Get the campaign from the campaign list\n\t\t\t JSONObject campaign = (JSONObject)array.get(i);\n\t\t\t JSONArray users_data = (JSONArray) campaign.get(\"users\");\n\t\t\t Boolean user_exist = false;\n\t\t\t for(int j=0; j<users_data.size(); j++){\n\t\t\t\t JSONObject user = (JSONObject)users_data.get(j);\n\t\t\t\t String l_name = user.get(\"last_name\").toString();\n\t\t\t\t if(l_name.equals(last_name)){\n\t\t\t\t\t user_exist = true;\n\t\t\t\t }\n\t\t\t }\n\t\t\t Assert.assertTrue(user_exist, \"Passed last_name in filter does not exist in campaign/user response.\");\n\t\t }\n\t\t}\t\n\t}", "List<Person> findByLastName(String lastName);", "public StringFilter getLastName() {\n\t\treturn lastName;\n\t}", "public void setLastname(String lastname);", "@SuppressWarnings(\"unused\")\n\tpublic String verifyPartialFirstLastName(String object, String data) {\n\t\tlogger.debug(\"verifying row count\");\n\t\ttry {\n\t\t\tboolean flag = false;\n\t\t\tList<WebElement> l1 = explictWaitForElementList(object);\n\t\t\tString temp[] = data.split(Constants.Name_SPLIT);\n\t\t\tfor (int i = 0; i < l1.size(); i++) {\n\t\t\t\tString input = l1.get(i).getText();\n\t\t\t\tif (input.toLowerCase().contains(temp[0].toLowerCase()) && input.toLowerCase().contains(temp[1].toLowerCase())) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (flag)\n\t\t\t\treturn Constants.KEYWORD_PASS + \"--elements in auto search contains the input value\";\n\t\t\telse\n\t\t\t\treturn Constants.KEYWORD_FAIL + \"--elements in auto search do not contains the input\";\n\n\t\t} \ncatch(TimeoutException ex)\n\t\t\n\t\t{\n\t\t\treturn Constants.KEYWORD_FAIL +\"Cause: \"+ ex.getCause();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\n\t\t\treturn Constants.KEYWORD_FAIL + e.getLocalizedMessage();\n\t\t}\n\t}", "java.lang.String getSurname();", "String getSurname();", "public void searchLeadForm(String firstName, String lastName) {\n\t\tactionbot.type(By.id(\"search_name_basic\"), firstName + \" \" + lastName);\n\t\tactionbot.click(By.id(\"search_form_submit\"));\n\t}", "public void addUserFromSearchResults2(String userName) {\r\n\t\t// may need a wait or method for waiting for list to load\r\n\t\telement(resultsListContainer).waitUntilVisible();\r\n\t\t\r\n\t\tList<WebElement> resultsList = resultsListContainer\r\n\t\t\t\t.findElements(By\r\n\t\t\t\t\t\t.cssSelector(\"tr[class*='yui-dt-even'] td[headers*='fullName'] div h3 a\"));\r\n\r\n\t\tSystem.out.println(\"TTT : \");\r\n\t\tfor (WebElement resultNow : resultsList) {\r\n\t\t\tif (resultNow.getText().contains(userName)) {\r\n\t\t\t\telementFocus(\"\" + resultNow.getCssValue(\"class\")\r\n\t\t\t\t\t\t+ \"span#alf-id2 button\");\r\n\t\t\t\twaitABit(Constants.WAIT_TIME_SHORT);\r\n\t\t\t\telementjQueryClick(\"\" + resultNow.getCssValue(\"class\")\r\n\t\t\t\t\t\t+ \"span#alf-id2 button\");\r\n\t\t\t\twaitABit(Constants.WAIT_TIME_SHORT);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "Optional<String> getLastname();", "public void setLastName(String ln)\n\t{\n\t\tlastName = ln;\n\t}", "public List<SickPerson> getSickPersonList(String lastNameSubString) throws SQLException;", "String getLastName( String key ) {\n return developer.lastName;\n }", "public String getLastname() throws Exception\r\n\t{\r\n\t\tString SQL_USER = \"SELECT lastname FROM user WHERE id=?;\";\t\t\r\n\t\tString returnValue=\"\";\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tPreparedStatement statement = this.getConn().prepareStatement(SQL_USER);\r\n\t\t\tstatement.setInt(1, userId);\r\n\t\t\tResultSet result = statement.executeQuery();\r\n\r\n\t\t\t// If this returns true, then the user already exists.\r\n\t\t\tif (!result.next())\r\n\t\t\t{\r\n\t\t\t\tthrow new Exception(\"No student found! (getLastname)\");\r\n\t\t\t}\r\n\r\n\t\t\t// Return the successfully user.\r\n\t\t\treturnValue = result.getString(\"lastname\");\r\n\t\t} catch (Exception e)\r\n\t\t{\r\n\t\t\tGWT.log(\"Error in getLastname()\", e);\r\n\t\t\tthis.getConn().rollback();\r\n\t\t\tthrow e;\r\n\t\t}\r\n\t\treturn returnValue;\r\n\t}", "public boolean lastName(String lastName) {\n return firstName(lastName);\n }", "private String checkName(String name){\n\n if(name.isBlank()){\n name = \"guest\";\n }\n int i = 1;\n if(users.contains(name)) {\n while (users.contains(name + i)) {\n i++;\n }\n name+=i;\n }\n return name;\n }", "public static void checkLastNames(List<Token> tokenList) {\t\r\n\t\tfor (Token t : tokenList) {\r\n\t\t\tif (t.getName().matches(\"\\\\w\")) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tIterator<String> it = WordLists.commonLastNames().iterator();\r\n\t\t\t\r\n\t\t\twhile(it.hasNext()) {\r\n\t\t\t\tString name = it.next();\r\n\t\t\t\t\r\n\t\t\t\tif (name.toLowerCase().contains(t.getName().toLowerCase())) {\r\n\t\t\t\t\t//Do not mark as first name if it's an article or conjunction\r\n\t\t\t\t\tif(t.getFeatures().getPartOfSpeech() == null\r\n\t\t\t\t\t\t\t|| t.getFeatures().getPartOfSpeech().equals(String.valueOf(PartOfSpeech.ARTICLE)) \r\n\t\t\t\t\t\t\t|| t.getFeatures().getPartOfSpeech().equals(String.valueOf(PartOfSpeech.CONJUNCTION))) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tt.getFeatures().setCommonLastName(true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tit = WordLists.lastNames().iterator();\r\n\t\t\t\r\n\t\t\twhile(it.hasNext()) {\r\n\t\t\t\tString name = it.next();\r\n\t\t\t\t\r\n\t\t\t\tif(name.toLowerCase().contains(t.getName().toLowerCase())) {\r\n\t\t\t\t\t//Do not mark as first name if it's an article or conjunction\r\n\t\t\t\t\tif(t.getFeatures().getPartOfSpeech() == null\r\n\t\t\t\t\t\t\t|| t.getFeatures().getPartOfSpeech().equals(String.valueOf(PartOfSpeech.ARTICLE)) \r\n\t\t\t\t\t\t\t|| t.getFeatures().getPartOfSpeech().equals(String.valueOf(PartOfSpeech.CONJUNCTION))) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tt.getFeatures().setLastName(true);\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public String extractLastName(String fullName) throws IllegalArgumentException {\n // check to make sure there is a space in the name, if there is no space in the name\n // we don't know if there is a first and a last name\n \n if (fullName == null || fullName.isEmpty() || fullName.indexOf(\" \") < LAST_NAME_IDX) {\n throw new IllegalArgumentException(\"Name cannot be null, empty, and must contain a space.\");\n }\n //String lastName = null;\n \n int spaceIndex = fullName.lastIndexOf(\" \");\n String lastName = fullName.substring(spaceIndex, fullName.length());\n \n // alternative\n // String[] parts = fullName.split(\" \");\n \n // Your code goes here. Assign your value to lastName\n return lastName;\n }", "protected void setLastName(String last)\n {\n lastName = last;\n }", "public void setLastName(java.lang.CharSequence value) {\n this.last_name = value;\n }", "@AutoEscape\n\tpublic String getLast_name();", "public static String retrieveFirstNameLastNameModifiedInMemberProfile(WebDriver driver, String memEmail, String FirstName,String LastName) throws ClassNotFoundException, SQLException\n\t{\n\t\tString port = Directory.Oracle_Port;\n\t\tString database_name= Directory.Oracle_Databasename;\n\t\tString user = Directory.Oracle_User;\n\t\tString pass = Directory.Oracle_Pass;\n\t\tString hostname =Directory.Oracle_Hostname;\n\t\tString url =\"jdbc:oracle:thin:@\"+hostname+\":\"+port+\":\"+database_name+\"\";\n\t\tClass.forName(\"oracle.jdbc.driver.OracleDriver\");\n\t\tConnection conn = DriverManager.getConnection(url,user,pass);\n\t\tSystem.out.println(\"connection success\");\n\t\tStatement stat=conn.createStatement();\n\t\tResultSet rs = stat.executeQuery(\"select FIRST_NAME, LAST_NAME, EMAIL from account where Email like '\"+memEmail+\"'\");\n\t\tSystem.out.println(\"query executed\");\n\t\tString email=\"\";\n\t\tString FName=\"\";\n\t\tString LName=\"\";\n\t\tif(rs.next())\n\t\t{\n\t\t\temail= rs.getString(\"EMAIL\");\n\t\t\tFName= rs.getString(\"FIRST_NAME\");\n\t\t\tLName= rs.getString(\"LAST_NAME\");\n\t\t\tif(memEmail.equalsIgnoreCase(email)&&FirstName.equalsIgnoreCase(FName)&&LastName.equalsIgnoreCase(LName))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"FirstName, LastName and Email match eachother\");\n\t\t\t}\n\t\t\telse if(!memEmail.equalsIgnoreCase(email)&&!FirstName.equalsIgnoreCase(FName)&&!LastName.equalsIgnoreCase(LName))\n\t\t\t{\n\t\t\t\tAssert.fail();\n\t\t\t}\n\t\t}\n\t\treturn email;\n\t}", "public void setLast_name(String last_name);", "public void inputToLastnameTextbox(String lastName) {\n\t\twaitToElementVisible(driver,RegisterPageUI.LASTNAME_TEXTBOX);\n\t\tsendkeyToElement(driver, RegisterPageUI.LASTNAME_TEXTBOX, lastName);\n\t}", "String getSearchDomainName();", "@Test(priority=59)\t\n\tpublic void campaign_user_with_filter_for_nonexisting_first_name() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_filter_for_nonexisting_first_name\", \"To validate whether user is able to get campaign and its users through campaign/user api with filter for non existing first_name\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\ttest_data = HelperClass.readTestData(class_name, \"campaign_user_with_filter_for_nonexisting_first_name\");\n\t\tString first_name = test_data.get(4);\n\t\tList<NameValuePair> list = new ArrayList<NameValuePair>();\n\t\tlist.add(new BasicNameValuePair(\"filter\", \"first_name%3d\"+first_name));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, list);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid filter for non existing first_name\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject json = (JSONObject) parser.parse(line);\n\t\t String result_data = json.get(\"result\").toString();\n\t\t Assert.assertEquals(result_data, \"error\", \"API is returning success when non existing first_name is entered for filter\");\n\t\t test.log(LogStatus.PASS, \"API is returning error when non existing first_name is entered for filter\");\n\t\t Assert.assertEquals(json.get(\"err\").toString(), \"no records found\", \"Proper validation is not displayed when non existing first_name is passed.\");\n\t\t test.log(LogStatus.PASS, \"Proper validation is displayed when non existing first_name is passed.\");\n\t\t}\n\t}", "public void setUserLastName(java.lang.String userLastName) {\r\n this.userLastName = userLastName;\r\n }", "@Override\n public void search(String firstName,String lastName,String fileName){\n int Pointer;\n ArrayList<String> lineKeeper = saveText();\n /* Search into the list to find the firstname, if it founds\n * old information and then rewrite new inforamtion\n * Search and remove*/\n if(lineKeeper.contains(firstName)){\n Pointer=lineKeeper.indexOf(firstName);\n if(lineKeeper.get(Pointer+1).equals(lastName)){\n this.load(lineKeeper.get(Pointer-3),fileName);\n }\n }\n }", "private void validateLast() {\n mNameValidator.processResult(\n mNameValidator.apply(binding.personLastName.getText().toString().trim()),\n this::validateEmail,\n result -> binding.personLastName.setError(\"Please enter a last name.\"));\n }", "protected void validateFirstName(){\n Boolean firstName = Pattern.matches(\"[A-Z][a-z]{2,}\",getFirstName());\n System.out.println(nameResult(firstName));\n }", "public String searchName(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username, name from \"+ TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n String uname, name;\n name = \"not found\";\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if (uname.equals(username)) {\n name = cursor.getString(1);\n break;\n }\n } while (cursor.moveToNext());\n }\n\n return name;\n }", "@SuppressWarnings(\"unused\")\n\t@Override\n\tpublic ArrayList<Object> searchUserByName(String search) {\n\t\t\n\t\tSystem.out.println(\"i am in service search looking for users\" + search.length());\n\t\t\n\t\tif(search == null){\n\t\t\t\n\t\t\tSystem.out.println(\"nothing can be find\");\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"its not 0000000000\");\n\t\t\n\t\tArrayList<Object> list = userRepository.findUserByName(search);\n\t\t\n\t\t//System.out.println(Arrays.toString(list));\n\t\treturn list;\n\t}", "public String getLastName() {\n return userItem.getLastName();\n }", "boolean hasSurname();", "public boolean isThereSuchAUser(String username, String email) ;", "public List<User> findAutoCompleteUser(String key) {\n\t\tTypedQuery<User> query = em.createQuery(\"select distinct a from User a\" + \" where UPPER(a.name) like :name\",\n\t\t\t\tUser.class);\n\t\tquery.setParameter(\"name\", \"%\" + key.toUpperCase() + \"%\");\n\t\tList<User> userLst = query.setFirstResult(0).setMaxResults(10).getResultList();\n\n\t\treturn userLst;\n\t}", "Customer search(String login);", "abstract void lastNameValidity();", "public boolean validateLastName() {\n if (lastName.length() == 0 ){\n return false;\n }\n return true;\n }", "public static String getShortName(String longName) {\n StringTokenizer strtok = new StringTokenizer(longName,\",\");\n String shortUserName = null;\n if (strtok.countTokens() > 1) {\n while ((null!=strtok) && (strtok.hasMoreTokens())) {\n\n String mytok1 = strtok.nextToken();\n if (null!=mytok1) {\n //filter for the shortened name\n StringTokenizer innerToken = new StringTokenizer(mytok1,\"=\");\n if ((null!=innerToken)&&(innerToken.countTokens()==2)) {\n String key = innerToken.nextToken();\n if (null!=key) {\n if ((key.equalsIgnoreCase(\"cn\"))||(key.equalsIgnoreCase(\"uid\"))) {\n shortUserName = innerToken.nextToken();\n break;\n }\n }\n }\n } //end:if (null!=mytok1) {\n } //end: while\n } else if (longName.contains(\"@\")) {\n shortUserName = longName.substring(0, longName.indexOf(\"@\"));\n }\n return shortUserName;\n }", "@PreAuthorize(\"hasAnyAuthority(T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADMIN, T(rs.acs.uns.sw.sct.util.AuthorityRoles).ADVERTISER, T(rs.acs.uns.sw.sct.util.AuthorityRoles).VERIFIER)\")\n @GetMapping(\"/users/search/type-ahead\")\n public ResponseEntity<List<UserDTO>> searchTypeAhead(@RequestParam(value = \"firstName\", required = false) String firstName,\n @RequestParam(value = \"lastName\", required = false) String lastName) {\n List<UserDTO> list = userService.findBySearchTermOR(firstName, lastName)\n .stream().map(user -> user.convertToDTO())\n .collect(Collectors.toList());\n return new ResponseEntity<>(list, HttpStatus.OK);\n }", "@AutoEscape\n\tpublic String getLastname();", "List<User> findByFirstname(String firstName);" ]
[ "0.62433684", "0.61311466", "0.60526097", "0.60526097", "0.60408497", "0.59779674", "0.5961255", "0.59378767", "0.5928636", "0.5920084", "0.58994156", "0.58994156", "0.58609426", "0.58313227", "0.578152", "0.5762342", "0.5751063", "0.5717793", "0.5695794", "0.5659525", "0.5657762", "0.56459016", "0.56438863", "0.56375295", "0.56374115", "0.56369126", "0.56369126", "0.56339794", "0.5632976", "0.5608207", "0.55991864", "0.55804485", "0.5549592", "0.5540078", "0.55135936", "0.55094475", "0.5497999", "0.54950637", "0.5488448", "0.5484261", "0.54801136", "0.5467393", "0.5466919", "0.54328334", "0.54327744", "0.5416865", "0.5400702", "0.5390127", "0.53900445", "0.5384028", "0.5377258", "0.5366667", "0.5344914", "0.5337716", "0.5333705", "0.5332432", "0.53308433", "0.5325267", "0.5324741", "0.532305", "0.5310756", "0.5304866", "0.52951556", "0.52842367", "0.5265161", "0.52600074", "0.5250139", "0.5246512", "0.52408206", "0.52338874", "0.52316177", "0.52117014", "0.52097136", "0.52095026", "0.5202248", "0.51992375", "0.51959974", "0.51924115", "0.5192384", "0.5189877", "0.5189733", "0.51815337", "0.5180869", "0.5179781", "0.5174646", "0.516957", "0.5158703", "0.51549566", "0.51543367", "0.51509196", "0.51499724", "0.5142786", "0.5138162", "0.5136218", "0.5135994", "0.51356995", "0.5130213", "0.51265746", "0.5125791", "0.5116104" ]
0.54166585
46
1 = blessed = 1 entry 2 = 99poblems = 2 entries
@Test public void testGetAllByTags() { int size = dao.getSitesByHashTag(1).size(); assertEquals(1, size); size = dao.getSitesByHashTag(2).size(); assertEquals(2, size); size = dao.getSitesByHashTag(-1).size(); assertEquals(0, size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getRetainedEntries(final boolean valid) {\n if (otherCheckForSingleItem(mem_)) { return 1; }\n final int preLongs = extractPreLongs(mem_);\n final int curCount = (preLongs == 1) ? 0 : extractCurCount(mem_);\n return curCount;\n }", "private void createBitStremMap(){\n itemListMap = new HashMap<>();\n \n for (ArrayList<Integer> transactions_set1 : transactions_set) {\n ArrayList curr_tr = (ArrayList) transactions_set1;\n if(curr_tr.size() >= min_itemset_size_K) \n for (Object curr_tr1 : curr_tr) {\n int item = (int) curr_tr1;\n itemListMap.put(item, itemListMap.getOrDefault(item, 0)+1);\n }\n }\n \n // 3. Remove items without minimum support\n itemListMap.values().removeIf(val -> val<min_sup);\n \n // 4. Sort the map to a set of entries\n Set<Map.Entry<Integer, Integer>> set = itemListMap.entrySet();\n frequentItemListSetLenOne = new ArrayList<>(set);\n Collections.sort( frequentItemListSetLenOne, new Comparator<Map.Entry<Integer, Integer>>(){\n @Override\n public int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2 )\n {\n return (o2.getValue()).compareTo( o1.getValue() );\n }\n });\n\n // 5.\n itemIndex = new HashMap<>();\n for(Map.Entry<Integer, Integer> entry : frequentItemListSetLenOne){\n itemIndex.put(entry.getKey(), itemIndex.size());\n }\n\n // 6.\n bitsetLen = frequentItemListSetLenOne.size();\n }", "public int numberOfEntries();", "public int length() { return 1+maxidx; }", "@Test\n public void testCountingBloomFilter2() {\n final int countingSize = 20;\n final int items = 100;\n final int error = 8;\n int[] counting = new int[countingSize];\n CountingBloomFilter<String> cbs = new CountingBloomFilter<String>(bfSizeLarge, counting);\n\n System.out.println(cbs.expectedFalsePositiveProbability());\n\n for (int i = 0; i < items; i++) {\n cbs.add(\"abc\");\n }\n for (int i = 0; i < items; i++) {\n cbs.add(\"abc\" + i);\n }\n\n // here we show the false negatives. Actually, we should get 100, but\n // since we inserted also other stuff, we get\n // more.\n Assert.assertEquals(items + error, cbs.approximateCount(\"abc\"));\n\n }", "public int getNumberOfEntries() ;", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "public static int numElements_entries_id() {\n return 11;\n }", "static int noValueSize() {\r\n return itemSize(false) * 2;\r\n }", "private void expand() {\n int capacity = newCapacity();\n IntIntMap h = new IntIntMap(capacity);\n for (int i = 0; i < entries.length; i += 2) {\n if (entries[i] != EMPTY) {\n h.put(entries[i], entries[i + 1]);\n }\n }\n this.entries = h.entries;\n this.threshold = h.threshold;\n this.modulo = h.modulo;\n this.modulo2 = h.modulo2;\n }", "public abstract int numOfEmptyToReproduce();", "public int getNumberOfEntries();", "public static void main(String[] args) throws NoSuchAlgorithmException {\n\t\t\n\t\t\n\t\tBloomFilter bf= new BloomFilter(3000000, 0.0001);\n\t\t\n\t\tSystem.out.println(\"n=\"+bf.n);\n\t\tSystem.out.println(\"p= \"+bf.falseprobability);\n\t\tSystem.out.println(\" m=\"+bf.m);\n\t\tSystem.out.println(\" k=\"+ bf.k);\n\t\t\n\t\t\n\t\n\t\t\n\t\tfor(int i=0;i<3000000;i++){\n\t\t\t//if(i%2==0)\n\t\t\t\tbf.add(\"INCREASES LENGTH OF String TO TEST MAX LIMIT\"+i);\n\t\t}\n\t\t\n\t\tint counter=0;\n\t\tfinal long starttime=System.nanoTime();\n\t\tfor(int j=0;j<3000000;j++)\n\t\t\tif(!bf.contains(\"INCREASES LENGTH OF String TO TEST MAX LIMIT\"+j))\n\t\t\t\tcounter++;\n\t\t\n\t\tfinal long duration=System.nanoTime()-starttime;\n\t\t\n\t\tSystem.out.println(\"duration of checking 3000000 elementis=\"+duration/3000000+\"counter value=\"+counter);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t}", "public int getSize() \n { \n return numberOfEntries;\n }", "public static int elementSizeBits_entries_id() {\n return 8;\n }", "public long problem2b(){\r\n LinkedList<String> linkList = new LinkedList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n linkList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start; \r\n }", "private static int \n extraCount (final Map.Entry <String, VersionedValue> entry)\n {\n return entry.getKey ().length () + 1 + 4 + entry.getValue ().getValue ().length () + 1;\n }", "private void assertEqual(long count, long size) {\n\t\t\n\t}", "@Test(timeout = 4000)\n public void test22() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n XSQLVAR[] xSQLVARArray0 = new XSQLVAR[0];\n FBResultSet fBResultSet0 = new FBResultSet(xSQLVARArray0, linkedList0);\n byte[][] byteArray0 = new byte[7][0];\n byte[] byteArray1 = new byte[7];\n byteArray1[0] = (byte) (-111);\n FileSystemHandling.appendLineToFile((EvoSuiteFile) null, \"!3eO>|kx{3s''g6%=\");\n byteArray1[1] = (byte) (-109);\n byteArray1[2] = (byte)31;\n linkedList0.add((byte[][]) null);\n linkedList0.add(byteArray0);\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, fBResultSet0);\n fBCachedFetcher0.next();\n fBCachedFetcher0.deleteRow();\n assertTrue(fBCachedFetcher0.isLast());\n }", "BigInteger getCount();", "@Override\r\n public long problem1(int size) {\r\n StringBuilder sb = new StringBuilder();\r\n long start = System.currentTimeMillis();\r\n for (int i=0; i<size; i++) {\r\n sb.append(i);\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start;\r\n }", "protected int bytesPerAtom() {\n return (2);\n }", "protected int bytesPerAtom() {\n return (2);\n }", "@Test\n public void persistenceTest3()\n {\n // Initiate a blacklist and add some numbers to it\n Blacklist testBlacklist = new Blacklist();\n testBlacklist.addBlacklistedNumber(5555550123L);\n testBlacklist.addBlacklistedNumber(1234567890L);\n testBlacklist.addBlacklistedNumber(9876543210L);\n\n // Save and load the blacklist numbers\n m_fileSystem.saveBlacklistNumbers(testBlacklist);\n ArrayList<Long> loadedNumbers = m_fileSystem.loadBlacklistNumbers();\n\n // Set seen flags\n int firstMatch = 0;\n int secondMatch = 0;\n int thirdMatch = 0;\n\n // Go over all numbers, marking each number seen\n for(Long number : loadedNumbers)\n {\n if(number == 5555550123L)\n {\n firstMatch++;\n }\n else if(number == 1234567890L)\n {\n secondMatch++;\n }\n else if(number == 9876543210L)\n {\n thirdMatch++;\n }\n }\n\n // Make sure every number was seen exactly once\n assertEquals(firstMatch, 1);\n assertEquals(secondMatch, 1);\n assertEquals(thirdMatch, 1);\n }", "private Pair<PostingList, Integer> gapDecode(int size, ByteBuffer list, int termId) {\n\t\tList<Integer> docList = vBDecode(list, size);\n\t\tIterator<Integer> p = docList.iterator();\n\t\tInteger docId = popNextOrNull(p);\n List<Integer> docIds = new ArrayList<Integer>();\n\t\tif (docId != null) {\n\t\t\tdocIds.add(docId);\n\t\t\tInteger gap = null;\n\t\t\twhile ( (gap = popNextOrNull(p)) != null) {\n\t\t\t\tdocId = docId + gap;\n\t\t\t\tdocIds.add(docId);\n\t\t\t}\n\t\t}\n PostingList result = new PostingList(termId, docIds);\n\t\tPair<PostingList, Integer> results = new Pair(result, list.position());\n /*System.out.println(\"......inside......\");\n\t\tfor (int n : docIds) {\n\t\t System.out.println(n);\n }*/\n\n\t\t//System.out.println(\"gap : \" + list.position());\n // test bytebuffer position of gapDecode equals vbdecode? wish true. yes\n\t\treturn results;\n\t}", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public void m17237a(java.util.List<java.lang.Integer> r6) {\n /*\n r5 = this;\n r0 = 0;\n if (r6 == 0) goto L_0x0009;\n L_0x0003:\n r1 = r6.size();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n return;\n L_0x000a:\n r1 = r5.f20994d;\n r1.lock();\n r2 = r5.m17234d();\n r1 = \"\";\n L_0x0016:\n r3 = r6.size();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 >= r3) goto L_0x003b;\n L_0x001c:\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r3.append(r1);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r6.get(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \",\";\n r1 = r1.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = r1.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0 + 1;\n goto L_0x0016;\n L_0x003b:\n r0 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n if (r0 <= 0) goto L_0x006e;\n L_0x0041:\n r0 = 0;\n r3 = r1.length();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = r3 + -1;\n r0 = r1.substring(r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r1 = \"result\";\n r3 = new java.lang.StringBuilder;\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r4 = \"_id in (\";\n r3 = r3.append(r4);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r3.append(r0);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = \")\";\n r0 = r0.append(r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r0 = r0.toString();\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n r3 = 0;\n r2.delete(r1, r0, r3);\t Catch:{ SQLiteException -> 0x0077, IllegalStateException -> 0x00a0, Exception -> 0x00c9 }\n L_0x006e:\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x0077:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00a0:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00c9:\n r0 = move-exception;\n r1 = \"SynthesizeResultDb\";\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<init>();\t Catch:{ all -> 0x00f2 }\n r4 = \"exception:\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n r0 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r0 = r0.toString();\t Catch:{ all -> 0x00f2 }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r1, r0);\t Catch:{ all -> 0x00f2 }\n r2.close();\n r0 = r5.f20994d;\n r0.unlock();\n goto L_0x0009;\n L_0x00f2:\n r0 = move-exception;\n r2.close();\n r1 = r5.f20994d;\n r1.unlock();\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.a(java.util.List):void\");\n }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public static void createCreationEntries() {\n/* 60 */ long start = System.nanoTime();\n/* */ \n/* 62 */ createSimpleEntry(1005, 24, 9, 22, false, true, 100.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 64 */ createSimpleEntry(1005, 7, 9, 860, false, true, 15.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 66 */ createSimpleEntry(1005, 8, 9, 23, false, true, 100.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 68 */ createSimpleEntry(1005, 685, 688, 691, false, true, 100.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 70 */ createSimpleEntry(1005, 8, 688, 691, false, true, 100.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 72 */ createSimpleEntry(1005, 8, 9, 711, false, true, 100.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* */ \n/* 75 */ createSimpleEntry(1031, 8, 9, 459, false, true, 100.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* 77 */ createSimpleEntry(1031, 8, 9, 461, false, true, 100.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* 79 */ createSimpleEntry(1031, 8, 9, 460, false, true, 100.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* */ \n/* 82 */ createSimpleEntry(1031, 685, 9, 459, false, true, 200.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* 84 */ createSimpleEntry(1031, 685, 9, 461, false, true, 200.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* 86 */ createSimpleEntry(1031, 685, 9, 460, false, true, 200.0F, false, false, CreationCategories.BOWS);\n/* */ \n/* 88 */ createSimpleEntry(1007, 8, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 90 */ createSimpleEntry(1007, 685, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 92 */ createSimpleEntry(1007, 24, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 94 */ createSimpleEntry(1007, 87, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 96 */ createSimpleEntry(1007, 3, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 98 */ createSimpleEntry(1007, 90, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 100 */ createSimpleEntry(1007, 8, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 102 */ createSimpleEntry(1007, 8, 22, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 104 */ createSimpleEntry(1007, 685, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 106 */ createSimpleEntry(1007, 24, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 108 */ createSimpleEntry(1007, 87, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 110 */ createSimpleEntry(1007, 3, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 112 */ createSimpleEntry(1007, 90, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 114 */ createSimpleEntry(1007, 7, 9, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 116 */ createSimpleEntry(1007, 7, 169, 36, false, true, 0.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* */ \n/* 119 */ createSimpleEntry(1007, 24, 22, 790, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 122 */ createSimpleEntry(1010, 143, 36, 37, false, true, 0.0F, false, true, CreationCategories.FIRE);\n/* */ \n/* */ \n/* 125 */ createSimpleEntry(1010, 169, 36, 37, true, true, 0.0F, false, true, CreationCategories.FIRE);\n/* */ \n/* 127 */ createSimpleEntry(1011, 14, 130, 181, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 129 */ createSimpleEntry(1011, 14, 130, 182, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 131 */ createSimpleEntry(1011, 14, 130, 183, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 133 */ createSimpleEntry(1011, 14, 130, 769, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 135 */ createSimpleEntry(1011, 14, 130, 777, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 137 */ createSimpleEntry(1011, 14, 130, 789, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 139 */ if (Features.Feature.AMPHORA.isEnabled()) {\n/* */ \n/* 141 */ createSimpleEntry(1011, 14, 130, 1019, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 143 */ createSimpleEntry(1011, 14, 130, 1021, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ } \n/* */ \n/* */ \n/* 147 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 149 */ createMetallicEntries(10015, 63, 46, 64, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 151 */ createMetallicEntries(10015, 62, 46, 64, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 154 */ createMetallicEntries(10010, 185, 46, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 156 */ createMetallicEntries(10010, 64, 46, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 158 */ createMetallicEntries(10010, 185, 46, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 160 */ createMetallicEntries(10010, 185, 46, 269, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 162 */ createMetallicEntries(10010, 185, 46, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 165 */ createMetallicEntries(10011, 64, 46, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 167 */ createMetallicEntries(10011, 64, 46, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 169 */ createMetallicEntries(10011, 185, 46, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 171 */ createMetallicEntries(10011, 185, 46, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 173 */ createMetallicEntries(10011, 185, 46, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 175 */ createMetallicEntries(10011, 185, 46, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 177 */ createMetallicEntries(10011, 185, 46, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 179 */ createMetallicEntries(10011, 185, 46, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 184 */ createSimpleEntry(10015, 63, 46, 64, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 186 */ createSimpleEntry(10015, 62, 46, 64, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 189 */ createSimpleEntry(10010, 185, 46, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 191 */ createSimpleEntry(10010, 64, 46, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 193 */ createSimpleEntry(10010, 185, 694, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 195 */ createSimpleEntry(10010, 64, 694, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 197 */ createSimpleEntry(10010, 185, 837, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 199 */ createSimpleEntry(10010, 64, 837, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 201 */ createSimpleEntry(10010, 185, 698, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 203 */ createSimpleEntry(10010, 64, 698, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 205 */ createSimpleEntry(10010, 185, 205, 148, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 207 */ createSimpleEntry(10010, 64, 205, 147, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 209 */ createSimpleEntry(10010, 185, 694, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 211 */ createSimpleEntry(10010, 185, 837, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 213 */ createSimpleEntry(10010, 185, 698, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 215 */ createSimpleEntry(10010, 185, 46, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 217 */ createSimpleEntry(10010, 185, 205, 149, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 219 */ createSimpleEntry(10010, 185, 46, 269, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 221 */ createSimpleEntry(10010, 185, 46, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 223 */ createSimpleEntry(10010, 185, 698, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 225 */ createSimpleEntry(10010, 185, 205, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 227 */ createSimpleEntry(10010, 185, 694, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 229 */ createSimpleEntry(10010, 185, 837, 270, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 232 */ createSimpleEntry(10011, 64, 46, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 234 */ createSimpleEntry(10011, 64, 46, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 236 */ createSimpleEntry(10011, 185, 46, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 238 */ createSimpleEntry(10011, 185, 46, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 240 */ createSimpleEntry(10011, 185, 46, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 242 */ createSimpleEntry(10011, 185, 46, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 244 */ createSimpleEntry(10011, 185, 46, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 246 */ createSimpleEntry(10011, 185, 46, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 248 */ createSimpleEntry(10011, 64, 694, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 250 */ createSimpleEntry(10011, 64, 694, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 252 */ createSimpleEntry(10011, 185, 694, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 254 */ createSimpleEntry(10011, 185, 694, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 256 */ createSimpleEntry(10011, 185, 694, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 258 */ createSimpleEntry(10011, 185, 694, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 260 */ createSimpleEntry(10011, 185, 694, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 262 */ createSimpleEntry(10011, 185, 694, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 264 */ createSimpleEntry(10011, 64, 837, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 266 */ createSimpleEntry(10011, 64, 837, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 268 */ createSimpleEntry(10011, 185, 837, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 270 */ createSimpleEntry(10011, 185, 837, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 272 */ createSimpleEntry(10011, 185, 837, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 274 */ createSimpleEntry(10011, 185, 837, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 276 */ createSimpleEntry(10011, 185, 837, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 278 */ createSimpleEntry(10011, 185, 837, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 280 */ createSimpleEntry(10011, 64, 205, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 282 */ createSimpleEntry(10011, 64, 205, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 284 */ createSimpleEntry(10011, 185, 205, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 286 */ createSimpleEntry(10011, 185, 205, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 288 */ createSimpleEntry(10011, 185, 205, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 290 */ createSimpleEntry(10011, 185, 205, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 292 */ createSimpleEntry(10011, 185, 205, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 294 */ createSimpleEntry(10011, 185, 205, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 296 */ createSimpleEntry(10011, 64, 698, 89, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 298 */ createSimpleEntry(10011, 64, 698, 523, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 300 */ createSimpleEntry(10011, 185, 698, 91, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 302 */ createSimpleEntry(10011, 185, 698, 88, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 304 */ createSimpleEntry(10011, 185, 698, 293, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 306 */ createSimpleEntry(10011, 185, 698, 295, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 308 */ createSimpleEntry(10011, 185, 698, 294, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 310 */ createSimpleEntry(10011, 185, 698, 708, false, true, 0.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ } \n/* */ \n/* */ \n/* 314 */ createSimpleEntry(1005, 8, 23, 99, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 316 */ createSimpleEntry(1005, 8, 23, 862, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 318 */ createSimpleEntry(1005, 8, 23, 561, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 320 */ createSimpleEntry(1005, 8, 23, 397, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 322 */ createSimpleEntry(1005, 8, 23, 396, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 324 */ createSimpleEntry(1005, 685, 23, 99, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 326 */ createSimpleEntry(1005, 685, 23, 561, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 328 */ createSimpleEntry(1005, 685, 23, 397, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 330 */ createSimpleEntry(1005, 685, 23, 396, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 333 */ createSimpleEntry(1032, 685, 23, 454, false, true, 0.0F, false, false, CreationCategories.FLETCHING);\n/* */ \n/* 335 */ createSimpleEntry(1032, 8, 23, 454, false, true, 0.0F, false, false, CreationCategories.FLETCHING);\n/* */ \n/* 337 */ createSimpleEntry(1032, 451, 454, 455, true, true, 0.0F, false, false, CreationCategories.FLETCHING);\n/* */ \n/* 339 */ createSimpleEntry(1032, 452, 454, 456, true, true, 0.0F, false, false, CreationCategories.FLETCHING);\n/* */ \n/* */ \n/* 342 */ createSimpleEntry(1016, 99, 148, 21, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 344 */ createSimpleEntry(1016, 99, 147, 80, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 346 */ createSimpleEntry(1016, 99, 149, 81, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 348 */ createSimpleEntry(1016, 99, 269, 267, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 350 */ createSimpleEntry(1016, 709, 711, 705, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 352 */ createSimpleEntry(1016, 710, 709, 707, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 354 */ createSimpleEntry(1016, 711, 708, 706, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 356 */ createSimpleEntry(1016, 23, 89, 3, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 358 */ createSimpleEntry(1016, 23, 91, 90, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 360 */ createSimpleEntry(1016, 23, 88, 87, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 362 */ createSimpleEntry(1016, 23, 270, 268, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 365 */ createSimpleEntry(1016, 23, 293, 290, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 367 */ createSimpleEntry(1016, 23, 295, 292, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 369 */ createSimpleEntry(1016, 23, 294, 291, true, true, 0.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 371 */ createSimpleEntry(1005, 8, 9, 139, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 373 */ createSimpleEntry(1005, 685, 9, 139, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 376 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 378 */ createMetallicEntries(1016, 185, 205, 710, false, true, 10.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 380 */ createMetallicEntries(10015, 64, 46, 215, false, true, 400.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 382 */ createMetallicEntries(10015, 64, 46, 259, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 384 */ createMetallicEntries(10015, 64, 46, 257, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 386 */ createMetallicEntries(10015, 64, 46, 258, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 391 */ createSimpleEntry(1016, 185, 205, 710, false, true, 10.0F, false, false, CreationCategories.WEAPONS);\n/* */ \n/* 393 */ createSimpleEntry(10015, 64, 46, 215, false, true, 400.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 395 */ createSimpleEntry(10015, 64, 46, 259, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 397 */ createSimpleEntry(10015, 64, 46, 257, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 399 */ createSimpleEntry(10015, 64, 46, 258, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 401 */ createSimpleEntry(10015, 64, 45, 259, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 403 */ createSimpleEntry(10015, 64, 45, 257, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 405 */ createSimpleEntry(10015, 64, 45, 258, false, true, 10.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 407 */ createSimpleEntry(10015, 64, 47, 216, false, true, 400.0F, false, false, CreationCategories.TOOLS);\n/* */ } \n/* */ \n/* 410 */ createSimpleEntry(10015, 185, 46, 681, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 412 */ createSimpleEntry(10015, 446, 205, 143, true, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 414 */ createSimpleEntry(10015, 64, 47, 772, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 417 */ createSimpleEntry(10015, 64, 46, 773, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 420 */ createSimpleEntry(10015, 64, 220, 1298, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 422 */ createSimpleEntry(10015, 64, 49, 1299, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 425 */ createSimpleEntry(10015, 64, 205, 597, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 428 */ createSimpleEntry(10015, 64, 44, 599, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 430 */ createSimpleEntry(10015, 64, 45, 598, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 432 */ createSimpleEntry(10015, 185, 47, 838, false, true, 0.0F, false, false, 20, 30.0D, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* */ \n/* 436 */ createSimpleEntry(10091, 128, 169, 1270, false, true, 0.0F, true, false, CreationCategories.WRITING);\n/* */ \n/* 438 */ createSimpleEntry(10091, 747, 745, 748, false, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* 440 */ createSimpleEntry(10091, 747, 1270, 1272, false, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* 442 */ createSimpleEntry(10092, 774, 743, 756, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 444 */ createSimpleEntry(10092, 774, 620, 756, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 447 */ createSimpleEntry(10007, 8, 743, 749, false, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* */ \n/* 450 */ createSimpleEntry(10016, 216, 213, 113, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 452 */ createSimpleEntry(10016, 215, 213, 113, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 454 */ createSimpleEntry(10016, 216, 213, 109, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 456 */ createSimpleEntry(10016, 215, 213, 109, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 458 */ createSimpleEntry(10016, 216, 213, 1427, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 460 */ createSimpleEntry(10016, 215, 213, 1427, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 462 */ createSimpleEntry(10016, 215, 213, 704, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 464 */ createSimpleEntry(10016, 216, 213, 704, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 466 */ createSimpleEntry(10016, 215, 213, 1425, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 468 */ createSimpleEntry(10016, 216, 213, 1425, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 471 */ createSimpleEntry(10016, 216, 213, 486, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 473 */ createSimpleEntry(10016, 215, 213, 486, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* 476 */ createSimpleEntry(10016, 216, 213, 110, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 478 */ createSimpleEntry(10016, 215, 213, 110, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 480 */ createSimpleEntry(10016, 216, 213, 114, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 482 */ createSimpleEntry(10016, 215, 213, 114, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 484 */ createSimpleEntry(10016, 216, 213, 1426, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 486 */ createSimpleEntry(10016, 215, 213, 1426, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 488 */ createSimpleEntry(10016, 215, 213, 2, false, true, 0.0F, false, false, CreationCategories.BAGS);\n/* */ \n/* */ \n/* 491 */ createSimpleEntry(10016, 215, 213, 555, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* 493 */ createSimpleEntry(10016, 215, 213, 591, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* 495 */ createSimpleEntry(10016, 215, 213, 554, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* */ \n/* 498 */ createSimpleEntry(10016, 216, 213, 555, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* 500 */ createSimpleEntry(10016, 216, 213, 591, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* 502 */ createSimpleEntry(10016, 216, 213, 554, false, true, 0.0F, false, false, CreationCategories.SAILS);\n/* */ \n/* 504 */ createSimpleEntry(10016, 215, 213, 831, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 506 */ createSimpleEntry(10016, 216, 213, 831, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 509 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 511 */ createMetallicEntries(10015, 185, 46, 627, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 513 */ createMetallicEntries(10015, 185, 46, 623, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* */ \n/* 516 */ createMetallicEntries(10015, 64, 46, 127, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 518 */ createMetallicEntries(10010, 64, 46, 154, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 520 */ createMetallicEntries(10010, 64, 46, 389, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 522 */ createMetallicEntries(10010, 64, 46, 494, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 524 */ createMetallicEntries(10010, 64, 46, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 526 */ createMetallicEntries(10010, 64, 46, 391, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 528 */ createMetallicEntries(10010, 64, 46, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 530 */ createMetallicEntries(10010, 64, 46, 395, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 532 */ createMetallicEntries(10010, 64, 46, 125, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 534 */ createMetallicEntries(10010, 64, 46, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 537 */ createMetallicEntries(10015, 185, 46, 75, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 539 */ createMetallicEntries(10015, 185, 46, 351, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 541 */ createMetallicEntries(10015, 64, 46, 734, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 543 */ createMetallicEntries(10015, 64, 46, 720, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 545 */ createMetallicEntries(10015, 185, 46, 721, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 547 */ createMetallicEntries(10015, 64, 46, 735, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 549 */ createMetallicEntries(10015, 185, 46, 350, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 554 */ createSimpleEntry(10015, 185, 46, 627, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 556 */ createSimpleEntry(10015, 185, 46, 623, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 558 */ createSimpleEntry(10015, 185, 205, 627, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 560 */ createSimpleEntry(10015, 185, 205, 623, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 562 */ createSimpleEntry(10043, 185, 44, 623, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 564 */ createSimpleEntry(10043, 185, 45, 623, false, true, 0.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* */ \n/* 567 */ createSimpleEntry(10015, 64, 46, 127, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 569 */ createSimpleEntry(10010, 64, 46, 154, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 571 */ createSimpleEntry(10010, 64, 46, 389, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 573 */ createSimpleEntry(10010, 64, 46, 494, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 575 */ createSimpleEntry(10010, 64, 46, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 577 */ createSimpleEntry(10010, 64, 205, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 579 */ createSimpleEntry(10010, 64, 698, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 581 */ createSimpleEntry(10010, 64, 694, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 583 */ createSimpleEntry(10010, 64, 837, 709, false, true, 0.0F, false, false, CreationCategories.BLADES);\n/* */ \n/* 585 */ createSimpleEntry(10010, 64, 46, 391, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 587 */ createSimpleEntry(10010, 64, 46, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 589 */ createSimpleEntry(10010, 64, 205, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 591 */ createSimpleEntry(10010, 64, 694, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 593 */ createSimpleEntry(10010, 64, 837, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 595 */ createSimpleEntry(10010, 64, 698, 393, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 597 */ createSimpleEntry(10010, 64, 46, 395, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 599 */ createSimpleEntry(10015, 185, 46, 75, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 601 */ createSimpleEntry(10015, 185, 46, 351, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* 603 */ createSimpleEntry(10015, 64, 46, 734, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 605 */ createSimpleEntry(10015, 64, 221, 720, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 607 */ createSimpleEntry(10015, 185, 223, 721, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 609 */ createSimpleEntry(10015, 64, 46, 735, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 611 */ createSimpleEntry(10015, 185, 46, 350, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ \n/* 614 */ createSimpleEntry(10010, 64, 46, 125, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 616 */ createSimpleEntry(10010, 64, 46, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 618 */ createSimpleEntry(10010, 64, 205, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 620 */ createSimpleEntry(10010, 64, 698, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 622 */ createSimpleEntry(10010, 64, 694, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 624 */ createSimpleEntry(10010, 64, 837, 126, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ } \n/* */ \n/* */ \n/* 628 */ createSimpleEntry(10015, 99, 393, 392, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 630 */ createSimpleEntry(10015, 395, 395, 394, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 632 */ createSimpleEntry(10015, 185, 205, 582, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 634 */ createSimpleEntry(10015, 99, 154, 97, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 636 */ createSimpleEntry(10015, 99, 389, 388, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 638 */ createSimpleEntry(10015, 99, 494, 493, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 640 */ createSimpleEntry(10015, 99, 391, 390, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 642 */ createSimpleEntry(10015, 23, 127, 62, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 644 */ createSimpleEntry(10010, 64, 45, 793, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 647 */ createSimpleEntry(10042, 128, 141, 73, true, true, 0.0F, false, false, CreationCategories.ALCHEMY);\n/* */ \n/* 649 */ createSimpleEntry(10042, 128, 436, 437, true, true, 0.0F, false, false, CreationCategories.ALCHEMY);\n/* */ \n/* 651 */ createSimpleEntry(10042, 437, 46, 431, true, true, 0.0F, false, false, CreationCategories.DYES);\n/* */ \n/* 653 */ createSimpleEntry(10042, 128, 48, 432, true, true, 0.0F, false, false, CreationCategories.DYES);\n/* */ \n/* 655 */ createSimpleEntry(10042, 128, 47, 435, true, true, 0.0F, false, false, CreationCategories.DYES);\n/* */ \n/* 657 */ createSimpleEntry(10042, 128, 439, 433, true, true, 0.0F, false, false, CreationCategories.DYES);\n/* */ \n/* 659 */ createSimpleEntry(10042, 128, 440, 434, true, true, 0.0F, false, false, CreationCategories.DYES);\n/* */ \n/* 661 */ createSimpleEntry(10042, 140, 214, 133, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 663 */ createSimpleEntry(10042, 356, 140, 650, true, true, 0.0F, false, false, CreationCategories.HEALING);\n/* */ \n/* 665 */ createSimpleEntry(10042, 1254, 214, 133, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 668 */ createSimpleEntry(1013, 130, 298, 492, true, true, 0.0F, true, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* */ \n/* 672 */ createSimpleEntry(1016, 99, 125, 93, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 674 */ createSimpleEntry(1016, 99, 126, 8, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 705 */ createSimpleEntry(1005, 24, 9, 632, false, true, 0.0F, false, false, CreationCategories.CART_PARTS);\n/* */ \n/* 707 */ createSimpleEntry(10016, 139, 144, 214, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 709 */ createSimpleEntry(10016, 139, 171, 214, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 711 */ createSimpleEntry(10016, 226, 214, 213, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 713 */ createSimpleEntry(10016, 226, 214, 646, false, true, 0.0F, false, false, CreationCategories.RUGS);\n/* */ \n/* 715 */ createSimpleEntry(10016, 226, 214, 645, false, true, 0.0F, false, false, CreationCategories.RUGS);\n/* */ \n/* 717 */ createSimpleEntry(10016, 226, 214, 644, false, true, 0.0F, false, false, CreationCategories.RUGS);\n/* */ \n/* 719 */ createSimpleEntry(10016, 226, 214, 639, false, true, 0.0F, false, false, CreationCategories.RUGS);\n/* */ \n/* 721 */ createSimpleEntry(10016, 213, 23, 487, true, true, 0.0F, false, false, CreationCategories.FLAGS);\n/* */ \n/* 723 */ createSimpleEntry(10016, 213, 23, 577, true, true, 0.0F, false, false, CreationCategories.FLAGS);\n/* */ \n/* 725 */ createSimpleEntry(10016, 213, 23, 579, true, true, 0.0F, false, false, CreationCategories.FLAGS);\n/* */ \n/* 727 */ createSimpleEntry(10016, 213, 23, 578, true, true, 0.0F, false, false, CreationCategories.FLAGS);\n/* */ \n/* 729 */ createSimpleEntry(10016, 213, 23, 999, true, true, 0.0F, false, false, 10, 35.0D, CreationCategories.FLAGS);\n/* */ \n/* */ \n/* 732 */ createSimpleEntry(1005, 685, 23, 862, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 735 */ createSimpleEntry(1020, 169, 385, 652, true, true, 0.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 738 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 740 */ createMetallicEntries(10013, 185, 46, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 742 */ createMetallicEntries(10013, 185, 46, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 744 */ createMetallicEntries(10013, 185, 46, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 746 */ createMetallicEntries(10013, 185, 46, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 748 */ createMetallicEntries(10013, 185, 46, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 750 */ createMetallicEntries(10013, 185, 46, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 752 */ createMetallicEntries(10013, 185, 46, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 754 */ createMetallicEntries(10013, 185, 46, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 757 */ createMetallicEntries(10012, 185, 46, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* 760 */ createMetallicEntries(10043, 185, 46, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 765 */ createSimpleEntry(10013, 185, 205, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 767 */ createSimpleEntry(10013, 185, 205, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 769 */ createSimpleEntry(10013, 185, 205, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 771 */ createSimpleEntry(10013, 185, 205, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 773 */ createSimpleEntry(10013, 185, 205, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 775 */ createSimpleEntry(10013, 185, 205, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 777 */ createSimpleEntry(10013, 185, 205, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 779 */ createSimpleEntry(10013, 185, 205, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 782 */ createSimpleEntry(10013, 185, 698, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 784 */ createSimpleEntry(10013, 185, 698, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 786 */ createSimpleEntry(10013, 185, 698, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 788 */ createSimpleEntry(10013, 185, 698, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 790 */ createSimpleEntry(10013, 185, 698, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 792 */ createSimpleEntry(10013, 185, 698, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 794 */ createSimpleEntry(10013, 185, 698, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 796 */ createSimpleEntry(10013, 185, 698, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 799 */ createSimpleEntry(10013, 185, 694, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 801 */ createSimpleEntry(10013, 185, 694, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 803 */ createSimpleEntry(10013, 185, 694, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 805 */ createSimpleEntry(10013, 185, 694, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 807 */ createSimpleEntry(10013, 185, 694, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 809 */ createSimpleEntry(10013, 185, 694, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 811 */ createSimpleEntry(10013, 185, 694, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 813 */ createSimpleEntry(10013, 185, 694, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 816 */ createSimpleEntry(10013, 185, 837, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 818 */ createSimpleEntry(10013, 185, 837, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 820 */ createSimpleEntry(10013, 185, 837, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 822 */ createSimpleEntry(10013, 185, 837, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 824 */ createSimpleEntry(10013, 185, 837, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 826 */ createSimpleEntry(10013, 185, 837, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 828 */ createSimpleEntry(10013, 185, 837, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 830 */ createSimpleEntry(10013, 185, 837, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 833 */ createSimpleEntry(10013, 185, 46, 284, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 835 */ createSimpleEntry(10013, 185, 46, 280, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 837 */ createSimpleEntry(10013, 185, 46, 281, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 839 */ createSimpleEntry(10013, 185, 46, 282, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 841 */ createSimpleEntry(10013, 185, 46, 283, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 843 */ createSimpleEntry(10013, 185, 46, 285, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 845 */ createSimpleEntry(10013, 185, 46, 286, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 847 */ createSimpleEntry(10013, 185, 46, 287, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 850 */ createSimpleEntry(10012, 185, 205, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 852 */ createSimpleEntry(10012, 185, 46, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 854 */ createSimpleEntry(10012, 185, 694, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 856 */ createSimpleEntry(10012, 185, 837, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 858 */ createSimpleEntry(10012, 185, 698, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 860 */ createSimpleEntry(10012, 185, 47, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 862 */ createSimpleEntry(10012, 185, 223, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 864 */ createSimpleEntry(10012, 185, 45, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 866 */ createSimpleEntry(10012, 185, 44, 288, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* 869 */ createSimpleEntry(10043, 185, 205, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 871 */ createSimpleEntry(10043, 185, 46, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 873 */ createSimpleEntry(10043, 185, 47, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 875 */ createSimpleEntry(10043, 185, 223, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 877 */ createSimpleEntry(10043, 185, 45, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 879 */ createSimpleEntry(10043, 185, 44, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 881 */ createSimpleEntry(10043, 185, 694, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 883 */ createSimpleEntry(10043, 185, 837, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 885 */ createSimpleEntry(10043, 185, 698, 326, false, true, 10.0F, false, false, CreationCategories.DECORATION);\n/* */ } \n/* */ \n/* */ \n/* 889 */ createSimpleEntry(10013, 185, 372, 478, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 891 */ createSimpleEntry(10013, 185, 372, 474, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 893 */ createSimpleEntry(10013, 185, 372, 475, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 895 */ createSimpleEntry(10013, 185, 372, 476, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 897 */ createSimpleEntry(10013, 185, 372, 477, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 900 */ createSimpleEntry(10012, 185, 288, 274, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 902 */ createSimpleEntry(10012, 185, 288, 279, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 904 */ createSimpleEntry(10012, 185, 288, 278, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 906 */ createSimpleEntry(10012, 185, 288, 275, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 908 */ createSimpleEntry(10012, 185, 288, 276, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 910 */ createSimpleEntry(10012, 185, 288, 277, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 912 */ createSimpleEntry(10012, 185, 288, 703, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* */ \n/* 915 */ createSimpleEntry(10017, 73, 71, 72, true, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 917 */ createSimpleEntry(10017, 215, 172, 72, false, true, 50.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 923 */ createSimpleEntry(10017, 215, 72, 105, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 925 */ createSimpleEntry(10017, 215, 72, 107, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 927 */ createSimpleEntry(10017, 215, 72, 103, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 929 */ createSimpleEntry(10017, 215, 72, 108, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 931 */ createSimpleEntry(10017, 215, 72, 104, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 933 */ createSimpleEntry(10017, 215, 72, 106, false, true, 10.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 935 */ createSimpleEntry(10017, 215, 72, 102, false, true, 10.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 937 */ createSimpleEntry(10017, 394, 72, 100, false, true, 10.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 939 */ createSimpleEntry(10017, 215, 371, 469, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 941 */ createSimpleEntry(10017, 215, 371, 470, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 943 */ createSimpleEntry(10017, 215, 371, 472, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 945 */ createSimpleEntry(10017, 215, 371, 471, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 947 */ createSimpleEntry(10017, 215, 371, 473, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 949 */ createSimpleEntry(10017, 215, 371, 468, false, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 952 */ createSimpleEntry(10017, 215, 72, 79, false, true, 10.0F, false, false, CreationCategories.BAGS);\n/* */ \n/* 954 */ createSimpleEntry(10017, 215, 72, 1, false, true, 10.0F, false, false, CreationCategories.BAGS);\n/* */ \n/* 956 */ createSimpleEntry(10017, 215, 72, 462, false, true, 10.0F, false, false, CreationCategories.BAGS);\n/* */ \n/* */ \n/* 959 */ createSimpleEntry(10017, 215, 72, 629, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 961 */ createSimpleEntry(10017, 215, 72, 630, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 963 */ createSimpleEntry(10017, 215, 72, 628, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 965 */ createSimpleEntry(10017, 215, 72, 631, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 967 */ createSimpleEntry(10017, 215, 72, 625, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* 969 */ createSimpleEntry(10017, 215, 72, 626, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* */ \n/* 972 */ createSimpleEntry(10017, 215, 72, 1332, false, true, 10.0F, false, false, CreationCategories.ANIMAL_EQUIPMENT_PART);\n/* */ \n/* */ \n/* 975 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 977 */ createMetallicEntries(10015, 64, 46, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 979 */ createMetallicEntries(10015, 64, 46, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 981 */ createMetallicEntries(10015, 64, 46, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 984 */ createMetallicEntries(10011, 64, 46, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 986 */ createMetallicEntries(10011, 64, 46, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* */ \n/* 989 */ createMetallicEntries(10015, 185, 46, 135, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 991 */ createMetallicEntries(10015, 185, 46, 497, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 993 */ createMetallicEntries(10015, 185, 46, 675, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 995 */ createMetallicEntries(10015, 185, 46, 660, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 997 */ createMetallicEntries(10015, 185, 46, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 1000 */ createMetallicEntries(10011, 64, 46, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 1003 */ createMetallicEntries(10015, 64, 46, 219, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1005 */ createMetallicEntries(10015, 64, 46, 701, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1007 */ createMetallicEntries(10015, 64, 46, 124, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1009 */ createMetallicEntries(10015, 64, 46, 24, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 1014 */ createSimpleEntry(10015, 64, 46, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1016 */ createSimpleEntry(10015, 64, 205, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1018 */ createSimpleEntry(10015, 64, 47, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1020 */ createSimpleEntry(10015, 64, 45, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1022 */ createSimpleEntry(10015, 64, 44, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1024 */ createSimpleEntry(10015, 64, 223, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1026 */ createSimpleEntry(10015, 64, 694, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1028 */ createSimpleEntry(10015, 64, 837, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1030 */ createSimpleEntry(10015, 64, 698, 131, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1033 */ createSimpleEntry(10015, 64, 46, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1035 */ createSimpleEntry(10015, 64, 205, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1037 */ createSimpleEntry(10015, 64, 47, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1039 */ createSimpleEntry(10015, 64, 45, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1041 */ createSimpleEntry(10015, 64, 44, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1043 */ createSimpleEntry(10015, 64, 223, 517, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1046 */ createSimpleEntry(10015, 64, 46, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1048 */ createSimpleEntry(10015, 64, 205, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1050 */ createSimpleEntry(10015, 64, 47, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1052 */ createSimpleEntry(10015, 64, 45, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1054 */ createSimpleEntry(10015, 64, 44, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1056 */ createSimpleEntry(10015, 64, 223, 444, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1059 */ createSimpleEntry(10011, 64, 46, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1061 */ createSimpleEntry(10011, 64, 698, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1063 */ createSimpleEntry(10011, 64, 694, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1065 */ createSimpleEntry(10011, 64, 837, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1067 */ createSimpleEntry(10011, 64, 205, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1069 */ createSimpleEntry(10011, 64, 47, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1071 */ createSimpleEntry(10011, 64, 45, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1073 */ createSimpleEntry(10011, 64, 44, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1075 */ createSimpleEntry(10011, 64, 223, 451, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1077 */ createSimpleEntry(10011, 64, 46, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1079 */ createSimpleEntry(10011, 64, 698, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1081 */ createSimpleEntry(10011, 64, 694, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1083 */ createSimpleEntry(10011, 64, 837, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1085 */ createSimpleEntry(10011, 64, 205, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1087 */ createSimpleEntry(10011, 64, 47, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1089 */ createSimpleEntry(10011, 64, 45, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1091 */ createSimpleEntry(10011, 64, 44, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 1093 */ createSimpleEntry(10011, 64, 223, 452, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* */ \n/* 1096 */ createSimpleEntry(10015, 185, 46, 135, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1098 */ createSimpleEntry(10015, 185, 46, 497, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1100 */ createSimpleEntry(10015, 185, 221, 497, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1102 */ createSimpleEntry(10015, 185, 46, 675, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1104 */ createSimpleEntry(10015, 185, 46, 660, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 1107 */ createSimpleEntry(10015, 185, 47, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1109 */ createSimpleEntry(10015, 185, 223, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1111 */ createSimpleEntry(10015, 185, 221, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1113 */ createSimpleEntry(10015, 185, 44, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1115 */ createSimpleEntry(10015, 185, 45, 674, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 1118 */ createSimpleEntry(10011, 64, 46, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1120 */ createSimpleEntry(10011, 64, 205, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1122 */ createSimpleEntry(10011, 64, 694, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1124 */ createSimpleEntry(10011, 64, 837, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1126 */ createSimpleEntry(10011, 64, 698, 123, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 1129 */ createSimpleEntry(10015, 64, 46, 219, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1131 */ createSimpleEntry(10015, 64, 46, 701, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1133 */ createSimpleEntry(10015, 64, 46, 124, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1135 */ createSimpleEntry(10015, 64, 46, 24, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ } \n/* */ \n/* */ \n/* 1139 */ createSimpleEntry(10015, 64, 46, 217, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1141 */ createSimpleEntry(10015, 64, 46, 218, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1143 */ createSimpleEntry(10015, 23, 444, 441, true, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1145 */ createSimpleEntry(1005, 318, 23, 647, true, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1148 */ createSimpleEntry(10017, 131, 105, 116, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 1150 */ createSimpleEntry(10017, 131, 107, 117, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 1152 */ createSimpleEntry(10017, 131, 103, 119, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 1154 */ createSimpleEntry(10017, 131, 108, 118, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 1156 */ createSimpleEntry(10017, 131, 104, 120, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* 1158 */ createSimpleEntry(10017, 131, 106, 115, true, true, 0.0F, false, false, CreationCategories.ARMOUR);\n/* */ \n/* */ \n/* 1161 */ createSimpleEntry(1005, 23, 156, 63, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1163 */ createSimpleEntry(1005, 8, 23, 156, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1165 */ createSimpleEntry(1005, 685, 23, 156, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1167 */ createSimpleEntry(10015, 185, 205, 609, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1169 */ createSimpleEntry(10015, 23, 523, 7, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1172 */ createSimpleEntry(10017, 100, 99, 101, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 1175 */ createSimpleEntry(10015, 9, 497, 496, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1177 */ createSimpleEntry(10015, 9, 660, 657, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1179 */ createSimpleEntry(10015, 9, 674, 658, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1181 */ createSimpleEntry(10015, 185, 221, 136, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1183 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 1185 */ for (int sourceTemplateId : ItemFactory.metalLumpList)\n/* */ {\n/* */ \n/* */ try {\n/* 1189 */ ItemTemplate lump = ItemTemplateFactory.getInstance().getTemplate(sourceTemplateId);\n/* 1190 */ CreationEntry temp = createSimpleEntry(10015, sourceTemplateId, 675, 659, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1192 */ temp.objectTargetMaterial = lump.getMaterial();\n/* */ }\n/* 1194 */ catch (NoSuchTemplateException noSuchTemplateException) {}\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 1202 */ createSimpleEntry(10015, 46, 675, 659, true, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ } \n/* */ \n/* */ \n/* 1206 */ createSimpleEntry(10015, 23, 123, 20, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1208 */ createSimpleEntry(10015, 735, 721, 718, true, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1210 */ createSimpleEntry(10015, 23, 686, 687, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1212 */ createSimpleEntry(10015, 691, 686, 687, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1215 */ createSimpleEntry(10015, 23, 1010, 1011, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1217 */ createSimpleEntry(10015, 691, 1010, 1011, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1219 */ createSimpleEntry(10015, 23, 124, 27, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1222 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 1224 */ createMetallicEntries(10014, 185, 46, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1226 */ createMetallicEntries(10014, 185, 46, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1228 */ createMetallicEntries(10014, 185, 46, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* */ \n/* 1231 */ createMetallicEntries(10015, 185, 46, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 1234 */ createMetallicEntries(10043, 64, 46, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1236 */ createMetallicEntries(10043, 64, 46, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1238 */ createMetallicEntries(10043, 64, 46, 229, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 1243 */ createSimpleEntry(10014, 185, 46, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1245 */ createSimpleEntry(10014, 185, 46, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1247 */ createSimpleEntry(10014, 185, 46, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1249 */ createSimpleEntry(10014, 185, 698, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1251 */ createSimpleEntry(10014, 185, 698, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1253 */ createSimpleEntry(10014, 185, 698, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1255 */ createSimpleEntry(10014, 185, 205, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1257 */ createSimpleEntry(10014, 185, 205, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1259 */ createSimpleEntry(10014, 185, 205, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1261 */ createSimpleEntry(10014, 185, 694, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1263 */ createSimpleEntry(10014, 185, 694, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1265 */ createSimpleEntry(10014, 185, 694, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1267 */ createSimpleEntry(10014, 185, 837, 86, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1269 */ createSimpleEntry(10014, 185, 837, 4, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* 1271 */ createSimpleEntry(10014, 185, 837, 83, false, true, 0.0F, false, false, CreationCategories.SHIELDS);\n/* */ \n/* */ \n/* 1274 */ createSimpleEntry(10015, 185, 46, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1276 */ createSimpleEntry(10015, 185, 205, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1278 */ createSimpleEntry(10015, 185, 698, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1280 */ createSimpleEntry(10015, 185, 694, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1282 */ createSimpleEntry(10015, 185, 837, 121, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 1285 */ createSimpleEntry(10043, 64, 44, 229, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1287 */ createSimpleEntry(10043, 64, 45, 229, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* */ \n/* 1290 */ createSimpleEntry(10043, 64, 44, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1292 */ createSimpleEntry(10043, 64, 45, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1294 */ createSimpleEntry(10043, 64, 46, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1296 */ createSimpleEntry(10043, 64, 698, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1298 */ createSimpleEntry(10043, 64, 694, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1300 */ createSimpleEntry(10043, 64, 837, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1302 */ createSimpleEntry(10043, 64, 47, 228, false, true, 0.0F, false, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1304 */ createSimpleEntry(10043, 64, 44, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1306 */ createSimpleEntry(10043, 64, 45, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1308 */ createSimpleEntry(10043, 64, 46, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1310 */ createSimpleEntry(10043, 64, 47, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1312 */ createSimpleEntry(10043, 64, 223, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1314 */ createSimpleEntry(10043, 64, 221, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1316 */ createSimpleEntry(10043, 64, 49, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1318 */ createSimpleEntry(10043, 64, 205, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1320 */ createSimpleEntry(10043, 64, 694, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1322 */ createSimpleEntry(10043, 64, 837, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1324 */ createSimpleEntry(10043, 64, 698, 232, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ } \n/* */ \n/* */ \n/* 1328 */ createSimpleEntry(10015, 185, 46, 188, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1330 */ createSimpleEntry(10015, 23, 121, 25, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1332 */ createSimpleEntry(1005, 23, 689, 690, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1334 */ createSimpleEntry(1005, 691, 689, 690, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1336 */ createSimpleEntry(10041, 204, 46, 205, true, true, 0.0F, true, false, CreationCategories.RESOURCES);\n/* */ \n/* 1338 */ createSimpleEntry(10041, 220, 47, 223, true, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 1340 */ createSimpleEntry(10041, 48, 47, 221, true, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 1342 */ createSimpleEntry(10043, 64, 44, 227, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1344 */ createSimpleEntry(10043, 64, 45, 227, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1346 */ createSimpleEntry(10043, 64, 1411, 227, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1348 */ createSimpleEntry(10043, 64, 44, 505, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1350 */ createSimpleEntry(10043, 64, 45, 505, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1352 */ createSimpleEntry(10043, 64, 1411, 505, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1354 */ createSimpleEntry(10043, 64, 44, 506, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1356 */ createSimpleEntry(10043, 64, 45, 506, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1358 */ createSimpleEntry(10043, 64, 1411, 506, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1360 */ createSimpleEntry(10043, 64, 44, 507, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1362 */ createSimpleEntry(10043, 64, 45, 507, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1364 */ createSimpleEntry(10043, 64, 1411, 507, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1366 */ createSimpleEntry(10043, 64, 44, 508, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1368 */ createSimpleEntry(10043, 64, 45, 508, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1370 */ createSimpleEntry(10043, 64, 1411, 508, false, true, 0.0F, false, false, CreationCategories.STATUETTES);\n/* */ \n/* 1372 */ createSimpleEntry(10043, 64, 44, 230, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1374 */ createSimpleEntry(10043, 64, 45, 230, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1376 */ createSimpleEntry(10043, 64, 1411, 230, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1378 */ createSimpleEntry(10043, 64, 44, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1380 */ createSimpleEntry(10043, 64, 45, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1382 */ createSimpleEntry(10043, 64, 1411, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1384 */ createSimpleEntry(10043, 64, 694, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1386 */ createSimpleEntry(10043, 64, 837, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1388 */ createSimpleEntry(10043, 64, 698, 231, false, true, 0.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1390 */ createSimpleEntry(10043, 64, 44, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1392 */ createSimpleEntry(10043, 64, 45, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1394 */ createSimpleEntry(10043, 64, 1411, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1396 */ createSimpleEntry(10043, 64, 698, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1398 */ createSimpleEntry(10043, 64, 694, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1400 */ createSimpleEntry(10043, 64, 837, 297, false, true, 100.0F, false, false, CreationCategories.JEWELRY);\n/* */ \n/* 1402 */ createSimpleEntry(10043, 229, 232, 233, true, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1404 */ createSimpleEntry(10043, 185, 47, 839, false, true, 0.0F, false, false, 20, 30.0D, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1406 */ createSimpleEntry(10043, 185, 44, 840, false, true, 0.0F, false, false, 20, 30.0D, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1409 */ createSimpleEntry(10051, 214, 23, 271, true, true, 100.0F, false, false, CreationCategories.TOYS);\n/* */ \n/* 1411 */ createSimpleEntry(10074, 97, 146, 132, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1413 */ createSimpleEntry(10074, 97, 146, 1122, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1415 */ createSimpleEntry(10074, 97, 785, 786, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1417 */ createSimpleEntry(10074, 97, 770, 784, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1419 */ createSimpleEntry(10074, 97, 146, 519, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1421 */ createSimpleEntry(10074, 97, 1116, 1121, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1423 */ createSimpleEntry(10074, 97, 770, 1123, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1426 */ createSimpleEntry(10074, 97, 146, 202, false, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1428 */ createSimpleEntry(10074, 97, 146, 296, false, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1430 */ createSimpleEntry(10074, 97, 146, 402, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1432 */ createSimpleEntry(10074, 97, 146, 399, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1434 */ createSimpleEntry(10074, 97, 146, 400, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1436 */ createSimpleEntry(10074, 97, 146, 403, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1438 */ createSimpleEntry(10074, 97, 146, 398, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1440 */ createSimpleEntry(10074, 97, 146, 401, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1442 */ createSimpleEntry(10074, 97, 146, 406, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1444 */ createSimpleEntry(10074, 97, 785, 787, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1446 */ createSimpleEntry(10074, 97, 1116, 1124, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1448 */ createSimpleEntry(10074, 97, 770, 771, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1450 */ createSimpleEntry(10074, 97, 146, 905, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1452 */ createSimpleEntry(10074, 97, 785, 906, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1454 */ createSimpleEntry(10074, 97, 770, 1302, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1456 */ createSimpleEntry(10074, 97, 1116, 1305, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1458 */ createSimpleEntry(1011, 14, 130, 1303, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1460 */ createSimpleEntry(10074, 97, 146, 408, false, true, 10.0F, false, true, CreationCategories.FOUNTAINS_AND_WELLS);\n/* */ \n/* 1462 */ createSimpleEntry(10074, 97, 146, 635, false, true, 10.0F, false, true, CreationCategories.FOUNTAINS_AND_WELLS);\n/* */ \n/* 1464 */ createSimpleEntry(10074, 97, 146, 405, false, true, 10.0F, false, true, CreationCategories.FOUNTAINS_AND_WELLS);\n/* */ \n/* 1466 */ createSimpleEntry(10074, 97, 146, 593, false, true, 10.0F, false, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 1468 */ createSimpleEntry(10074, 684, 146, 685, true, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1470 */ createSimpleEntry(10074, 685, 146, 686, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1472 */ createSimpleEntry(10074, 685, 146, 689, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1474 */ createSimpleEntry(10074, 685, 146, 1010, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1476 */ createSimpleEntry(10074, 97, 146, 686, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1478 */ createSimpleEntry(10074, 97, 146, 689, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1480 */ createSimpleEntry(10074, 97, 146, 1010, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1482 */ createSimpleEntry(1005, 685, 688, 36, false, true, 10.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 1484 */ createSimpleEntry(1005, 8, 688, 36, false, true, 10.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 1486 */ createSimpleEntry(1005, 93, 688, 36, false, true, 10.0F, false, false, CreationCategories.KINDLINGS);\n/* */ \n/* 1488 */ createSimpleEntry(1005, 685, 688, 23, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1490 */ createSimpleEntry(1005, 8, 688, 23, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1492 */ createSimpleEntry(1005, 93, 688, 23, false, true, 10.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1495 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 1497 */ createMetallicEntries(10034, 64, 46, 167, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1499 */ createMetallicEntries(10034, 64, 46, 194, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1501 */ createMetallicEntries(10034, 64, 46, 193, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1503 */ createMetallicEntries(10034, 64, 46, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1505 */ createMetallicEntries(10034, 185, 46, 252, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1507 */ createMetallicEntries(10034, 185, 46, 568, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* */ \n/* 1510 */ createMetallicEntries(10015, 64, 46, 185, false, true, 0.0F, false, true, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1513 */ createMetallicEntries(10015, 185, 46, 547, false, true, 0.0F, false, true, CreationCategories.SHIPBUILDING);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 1518 */ createSimpleEntry(10034, 64, 46, 167, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1520 */ createSimpleEntry(10034, 64, 46, 194, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1522 */ createSimpleEntry(10034, 64, 46, 193, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1524 */ createSimpleEntry(10034, 64, 694, 167, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1526 */ createSimpleEntry(10034, 64, 694, 194, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1528 */ createSimpleEntry(10034, 64, 694, 193, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1530 */ createSimpleEntry(10034, 64, 837, 167, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1532 */ createSimpleEntry(10034, 64, 837, 194, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1534 */ createSimpleEntry(10034, 64, 837, 193, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1536 */ createSimpleEntry(10034, 64, 698, 167, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1538 */ createSimpleEntry(10034, 64, 698, 194, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1540 */ createSimpleEntry(10034, 64, 698, 193, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1542 */ createSimpleEntry(10034, 64, 46, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1544 */ createSimpleEntry(10034, 64, 205, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1546 */ createSimpleEntry(10034, 64, 694, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1548 */ createSimpleEntry(10034, 64, 837, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1550 */ createSimpleEntry(10034, 64, 698, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1552 */ createSimpleEntry(10034, 64, 47, 463, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* 1554 */ createSimpleEntry(10034, 185, 46, 252, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1556 */ createSimpleEntry(10034, 185, 46, 568, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* */ \n/* 1559 */ createSimpleEntry(10015, 64, 46, 185, false, true, 0.0F, false, true, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1562 */ createSimpleEntry(10015, 185, 49, 547, false, true, 0.0F, false, true, CreationCategories.SHIPBUILDING);\n/* */ } \n/* */ \n/* */ \n/* 1566 */ createSimpleEntry(10034, 168, 130, 342, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1568 */ createSimpleEntry(10034, 343, 47, 341, false, true, 0.0F, false, false, CreationCategories.LOCKS);\n/* */ \n/* 1570 */ createSimpleEntry(10034, 341, 130, 342, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 1573 */ createSimpleEntry(1014, 320, 318, 319, false, true, 30.0F, false, false, CreationCategories.ROPES);\n/* */ \n/* 1575 */ createSimpleEntry(1014, 320, 318, 557, false, true, 30.0F, false, false, CreationCategories.ROPES);\n/* */ \n/* 1577 */ createSimpleEntry(1014, 320, 318, 559, false, true, 30.0F, false, false, CreationCategories.ROPES);\n/* */ \n/* 1579 */ createSimpleEntry(1014, 320, 318, 558, false, true, 30.0F, false, false, CreationCategories.ROPES);\n/* */ \n/* 1581 */ createSimpleEntry(1014, 320, 318, 457, false, true, 30.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1583 */ createSimpleEntry(10039, 428, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1585 */ createSimpleEntry(10039, 66, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1587 */ createSimpleEntry(10039, 68, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1589 */ createSimpleEntry(10039, 69, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1591 */ createSimpleEntry(10039, 67, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1593 */ createSimpleEntry(10039, 415, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1595 */ createSimpleEntry(10039, 70, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* 1597 */ createSimpleEntry(10039, 464, 203, 488, true, true, 0.0F, false, false, CreationCategories.FOOD);\n/* */ \n/* */ \n/* 1600 */ createSimpleEntry(10042, 413, 752, 753, false, true, 50.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* */ \n/* 1603 */ createSimpleEntry(1018, 8, 33, 522, false, true, 0.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 1605 */ createSimpleEntry(1018, 685, 33, 522, false, true, 0.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 1608 */ createSimpleEntry(10043, 185, 45, 325, false, true, 0.0F, false, true, CreationCategories.ALTAR);\n/* */ \n/* 1610 */ createSimpleEntry(10043, 185, 44, 324, false, true, 0.0F, false, true, CreationCategories.ALTAR);\n/* */ \n/* */ \n/* 1613 */ createSimpleEntry(10082, 24, 9, 556, false, true, 60.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1615 */ createSimpleEntry(10082, 24, 9, 545, false, true, 20.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1617 */ createSimpleEntry(10082, 8, 9, 550, false, true, 30.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1619 */ createSimpleEntry(10082, 8, 9, 549, false, true, 30.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1621 */ createSimpleEntry(10082, 8, 23, 567, false, true, 30.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* */ \n/* 1624 */ createSimpleEntry(10082, 8, 9, 551, false, true, 40.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1626 */ createSimpleEntry(10082, 24, 9, 546, false, true, 0.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1628 */ createSimpleEntry(10082, 24, 9, 566, false, true, 40.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1630 */ createSimpleEntry(10082, 7, 385, 552, false, true, 20.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1632 */ createSimpleEntry(10082, 7, 385, 588, false, true, 20.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1634 */ createSimpleEntry(10082, 7, 385, 590, false, true, 20.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1636 */ createSimpleEntry(10082, 7, 385, 589, false, true, 20.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* */ \n/* 1639 */ createSimpleEntry(10082, 7, 385, 560, false, true, 50.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1641 */ createSimpleEntry(1020, 558, 547, 565, true, true, 0.0F, false, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* */ \n/* 1644 */ createSimpleEntry(10042, 73, 492, 782, true, true, 0.0F, true, false, CreationCategories.RESOURCES);\n/* */ \n/* 1646 */ createSimpleEntry(10074, 97, 146, 811, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 1649 */ createSimpleEntry(10015, 185, 46, 859, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 1652 */ createSimpleEntry(10042, 383, 711, 825, true, true, 0.0F, false, false, CreationCategories.MAGIC);\n/* */ \n/* 1654 */ createSimpleEntry(10042, 377, 711, 826, true, true, 0.0F, false, false, CreationCategories.MAGIC);\n/* */ \n/* 1656 */ createSimpleEntry(10042, 381, 711, 827, true, true, 0.0F, false, false, CreationCategories.MAGIC);\n/* */ \n/* 1658 */ createSimpleEntry(10042, 379, 711, 828, true, true, 0.0F, false, false, CreationCategories.MAGIC);\n/* */ \n/* 1660 */ createSimpleEntry(10042, 375, 711, 829, true, true, 0.0F, false, false, CreationCategories.MAGIC);\n/* */ \n/* 1662 */ createSimpleEntry(1011, 14, 130, 812, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1664 */ createSimpleEntry(10074, 97, 146, 821, false, true, 0.0F, false, false, CreationCategories.DECORATION);\n/* */ \n/* 1666 */ createSimpleEntry(10015, 64, 221, 902, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1668 */ createSimpleEntry(10015, 64, 223, 904, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* 1670 */ createSimpleEntry(10016, 922, 921, 925, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* 1672 */ createSimpleEntry(10016, 226, 925, 926, false, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* 1675 */ createSimpleEntry(10016, 215, 926, 943, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 1678 */ createSimpleEntry(10016, 216, 926, 943, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* */ \n/* 1682 */ createSimpleEntry(10016, 215, 926, 954, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 1685 */ createSimpleEntry(10016, 216, 926, 954, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* */ \n/* 1689 */ createSimpleEntry(10017, 926, 847, 959, true, true, 0.0F, false, false, CreationCategories.ARMOUR)\n/* 1690 */ .setFinalMaterial((byte)16);\n/* 1691 */ createSimpleEntry(10017, 215, 72, 960, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* */ \n/* 1695 */ createSimpleEntry(10016, 215, 926, 961, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 1698 */ createSimpleEntry(10016, 216, 926, 961, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* */ \n/* 1702 */ createSimpleEntry(10016, 226, 214, 908, false, true, 0.0F, false, false, 0, 20.0D, CreationCategories.RUGS)\n/* */ \n/* 1704 */ .setDepleteFromTarget(3000);\n/* */ \n/* 1706 */ createSimpleEntry(10016, 226, 214, 909, false, true, 0.0F, false, false, 0, 30.0D, CreationCategories.RUGS)\n/* */ \n/* 1708 */ .setDepleteFromTarget(4000);\n/* */ \n/* 1710 */ createSimpleEntry(10016, 226, 214, 910, false, true, 0.0F, false, false, 0, 40.0D, CreationCategories.RUGS)\n/* */ \n/* 1712 */ .setDepleteFromTarget(5000);\n/* */ \n/* */ \n/* 1715 */ createSimpleEntry(10074, 97, 785, 402, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1717 */ createSimpleEntry(10074, 97, 785, 403, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1719 */ createSimpleEntry(10074, 97, 785, 398, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1721 */ createSimpleEntry(10074, 97, 785, 401, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* 1723 */ createSimpleEntry(10074, 97, 785, 811, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 1726 */ createSimpleEntry(1011, 14, 130, 1160, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1728 */ createSimpleEntry(1011, 14, 130, 1164, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1730 */ createSimpleEntry(1011, 14, 130, 1168, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1732 */ createSimpleEntry(1011, 14, 130, 1171, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1734 */ createSimpleEntry(1011, 14, 130, 1251, false, true, 0.0F, false, false, CreationCategories.POTTERY);\n/* */ \n/* 1736 */ createSimpleEntry(10015, 64, 220, 1166, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1738 */ createSimpleEntry(10074, 97, 785, 1167, false, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1740 */ createSimpleEntry(10074, 97, 785, 1237, false, true, 10.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* 1742 */ createSimpleEntry(1005, 8, 9, 1173, false, true, 0.0F, false, false, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ \n/* */ \n/* 1746 */ int[] metalTypes = { 221, 223, 220, 694, 698, 44, 45, 205, 47, 46, 49, 48, 837 };\n/* */ \n/* */ \n/* 1749 */ int[] runeTypes = { 1290, 1293, 1292, 1289, 1291 };\n/* 1750 */ for (int metal : metalTypes) {\n/* */ \n/* 1752 */ for (int rune : runeTypes) {\n/* */ \n/* 1754 */ createSimpleEntry(10074, 1102, metal, rune, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1756 */ .setDepleteFromTarget(200);\n/* 1757 */ createSimpleEntry(10043, 1103, metal, rune, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1759 */ .setDepleteFromTarget(200);\n/* 1760 */ createSimpleEntry(10044, 1104, metal, rune, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1762 */ .setDepleteFromTarget(200);\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1768 */ createSimpleEntry(10074, 1102, 1411, 1290, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1770 */ .setDepleteFromTarget(200);\n/* 1771 */ createSimpleEntry(10043, 1103, 1411, 1290, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1773 */ .setDepleteFromTarget(200);\n/* 1774 */ createSimpleEntry(10044, 1104, 1411, 1290, true, true, 0.0F, false, false, CreationCategories.MAGIC)\n/* */ \n/* 1776 */ .setDepleteFromTarget(200);\n/* */ \n/* */ \n/* 1779 */ createSimpleEntry(10041, 44, 45, 1411, true, true, 0.0F, false, false, CreationCategories.RESOURCES);\n/* */ \n/* */ \n/* 1782 */ createSimpleEntry(10074, 97, 785, 1430, false, true, 10.0F, false, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* */ \n/* 1786 */ CreationEntry brownBearRug = createSimpleEntry(10017, 302, 349, 847, true, true, 0.0F, false, false, 0, 30.0D, CreationCategories.RUGS);\n/* */ \n/* 1788 */ brownBearRug.setDepleteFromSource(3000);\n/* 1789 */ brownBearRug.setDepleteFromTarget(1);\n/* */ \n/* 1791 */ CreationEntry blackBearRug = createSimpleEntry(10017, 302, 349, 846, true, true, 0.0F, false, false, 0, 30.0D, CreationCategories.RUGS);\n/* */ \n/* 1793 */ blackBearRug.setDepleteFromSource(3000);\n/* 1794 */ blackBearRug.setDepleteFromTarget(1);\n/* */ \n/* 1796 */ CreationEntry mountainLionRug = createSimpleEntry(10017, 313, 349, 848, true, true, 0.0F, false, false, 0, 30.0D, CreationCategories.RUGS);\n/* */ \n/* 1798 */ mountainLionRug.setDepleteFromSource(300);\n/* 1799 */ mountainLionRug.setDepleteFromTarget(1);\n/* */ \n/* 1801 */ CreationEntry blackWolfRug = createSimpleEntry(10017, 302, 349, 849, true, true, 0.0F, false, false, 0, 30.0D, CreationCategories.RUGS);\n/* */ \n/* 1803 */ blackWolfRug.setDepleteFromSource(3000);\n/* 1804 */ blackWolfRug.setDepleteFromTarget(1);\n/* */ \n/* 1806 */ AdvancedCreationEntry lRudder = createAdvancedEntry(10082, 23, 22, 544, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1808 */ lRudder.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* */ \n/* 1810 */ AdvancedCreationEntry bellCot = createAdvancedEntry(1005, 217, 22, 723, false, false, 0.0F, true, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 1812 */ bellCot.addRequirement(new CreationRequirement(1, 22, 25, true));\n/* 1813 */ bellCot.addRequirement(new CreationRequirement(2, 9, 4, true));\n/* */ \n/* 1815 */ AdvancedCreationEntry bellTower = createAdvancedEntry(1005, 718, 723, 722, false, false, 0.0F, true, false, CreationCategories.DECORATION);\n/* */ \n/* 1817 */ bellTower.addRequirement(new CreationRequirement(1, 319, 1, true));\n/* */ \n/* 1819 */ AdvancedCreationEntry bellSmall = createAdvancedEntry(10015, 734, 720, 719, false, false, 0.0F, true, false, CreationCategories.TOYS);\n/* */ \n/* 1821 */ bellSmall.addRequirement(new CreationRequirement(1, 99, 1, true));\n/* */ \n/* 1823 */ AdvancedCreationEntry lHelm = createAdvancedEntry(10082, 23, 22, 548, false, false, 0.0F, true, true, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1825 */ lHelm.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 1826 */ lHelm.addRequirement(new CreationRequirement(2, 22, 4, true));\n/* 1827 */ lHelm.addRequirement(new CreationRequirement(3, 561, 8, true));\n/* */ \n/* 1829 */ AdvancedCreationEntry well = createAdvancedEntry(1013, 132, 130, 608, false, false, 0.0F, true, true, CreationCategories.FOUNTAINS_AND_WELLS);\n/* */ \n/* 1831 */ well.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 1832 */ well.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* 1833 */ well.addRequirement(new CreationRequirement(3, 319, 1, true));\n/* 1834 */ well.addRequirement(new CreationRequirement(4, 421, 1, true));\n/* */ \n/* 1836 */ AdvancedCreationEntry lStern = createAdvancedEntry(10082, 551, 546, 553, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1838 */ lStern.addRequirement(new CreationRequirement(1, 546, 10, true));\n/* 1839 */ lStern.addRequirement(new CreationRequirement(2, 551, 9, true));\n/* 1840 */ lStern.addRequirement(new CreationRequirement(3, 561, 20, true));\n/* */ \n/* 1842 */ AdvancedCreationEntry lRigS = createAdvancedEntry(10082, 589, 555, 564, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1844 */ lRigS.addRequirement(new CreationRequirement(1, 559, 4, true));\n/* 1845 */ lRigS.addRequirement(new CreationRequirement(2, 549, 2, true));\n/* 1846 */ lRigS.addRequirement(new CreationRequirement(3, 550, 2, true));\n/* */ \n/* 1848 */ AdvancedCreationEntry lRigT = createAdvancedEntry(10082, 588, 554, 563, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1850 */ lRigT.addRequirement(new CreationRequirement(1, 559, 2, true));\n/* 1851 */ lRigT.addRequirement(new CreationRequirement(2, 549, 2, true));\n/* */ \n/* 1853 */ AdvancedCreationEntry spinRigT = createAdvancedEntry(10082, 588, 591, 584, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1855 */ spinRigT.addRequirement(new CreationRequirement(1, 559, 2, true));\n/* 1856 */ spinRigT.addRequirement(new CreationRequirement(2, 549, 2, true));\n/* */ \n/* 1858 */ AdvancedCreationEntry lRigCrows = createAdvancedEntry(10082, 590, 555, 585, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1860 */ lRigCrows.addRequirement(new CreationRequirement(1, 559, 8, true));\n/* 1861 */ lRigCrows.addRequirement(new CreationRequirement(2, 583, 1, true));\n/* 1862 */ lRigCrows.addRequirement(new CreationRequirement(3, 550, 4, true));\n/* 1863 */ lRigCrows.addRequirement(new CreationRequirement(4, 549, 2, true));\n/* */ \n/* 1865 */ AdvancedCreationEntry tRigCrows = createAdvancedEntry(10082, 552, 555, 587, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1867 */ tRigCrows.addRequirement(new CreationRequirement(1, 559, 16, true));\n/* 1868 */ tRigCrows.addRequirement(new CreationRequirement(2, 583, 1, true));\n/* 1869 */ tRigCrows.addRequirement(new CreationRequirement(3, 555, 5, true));\n/* 1870 */ tRigCrows.addRequirement(new CreationRequirement(4, 550, 8, true));\n/* 1871 */ tRigCrows.addRequirement(new CreationRequirement(5, 549, 4, true));\n/* */ \n/* 1873 */ AdvancedCreationEntry lRigSqY = createAdvancedEntry(10082, 552, 555, 586, false, false, 0.0F, true, false, CreationCategories.SHIPBUILDING);\n/* */ \n/* 1875 */ lRigSqY.addRequirement(new CreationRequirement(1, 559, 12, true));\n/* 1876 */ lRigSqY.addRequirement(new CreationRequirement(2, 555, 3, true));\n/* 1877 */ lRigSqY.addRequirement(new CreationRequirement(3, 550, 6, true));\n/* */ \n/* 1879 */ AdvancedCreationEntry bardingLeather = createAdvancedEntry(10017, 131, 72, 702, false, false, 0.0F, true, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 1881 */ bardingLeather.addRequirement(new CreationRequirement(1, 72, 4, true));\n/* 1882 */ bardingLeather.addRequirement(new CreationRequirement(2, 131, 50, true));\n/* */ \n/* 1884 */ AdvancedCreationEntry bridle = createAdvancedEntry(10017, 627, 631, 624, false, false, 0.0F, true, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 1886 */ bridle.addRequirement(new CreationRequirement(1, 628, 1, true));\n/* */ \n/* 1888 */ AdvancedCreationEntry saddle = createAdvancedEntry(10017, 625, 629, 621, false, false, 0.0F, true, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 1890 */ saddle.addRequirement(new CreationRequirement(1, 626, 1, true));\n/* */ \n/* 1892 */ AdvancedCreationEntry saddleL = createAdvancedEntry(10017, 625, 630, 622, false, false, 0.0F, true, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* */ \n/* 1895 */ saddleL.addRequirement(new CreationRequirement(1, 626, 1, true));\n/* */ \n/* 1897 */ AdvancedCreationEntry saddleBag = createAdvancedEntry(10017, 1332, 102, 1333, false, false, 0.0F, true, false, CreationCategories.ANIMAL_EQUIPMENT);\n/* */ \n/* 1899 */ saddleBag.addRequirement(new CreationRequirement(1, 102, 1, true));\n/* 1900 */ saddleBag.addRequirement(new CreationRequirement(2, 1332, 1, true));\n/* */ \n/* 1902 */ AdvancedCreationEntry birdcage = createAdvancedEntry(10043, 897, 444, 1025, false, false, 0.0F, true, false, CreationCategories.DECORATION);\n/* */ \n/* 1904 */ birdcage.addRequirement(new CreationRequirement(1, 897, 1, true));\n/* 1905 */ birdcage.addRequirement(new CreationRequirement(2, 131, 10, true));\n/* 1906 */ birdcage.addRequirement(new CreationRequirement(3, 444, 4, true));\n/* 1907 */ birdcage.addRequirement(new CreationRequirement(4, 326, 1, true));\n/* 1908 */ birdcage.addRequirement(new CreationRequirement(5, 221, 10, true));\n/* 1909 */ birdcage.addRequirement(new CreationRequirement(6, 464, 1, true));\n/* 1910 */ birdcage.setIsEpicBuildMissionTarget(false);\n/* */ \n/* */ \n/* */ \n/* 1914 */ createBoatEntries();\n/* */ \n/* */ \n/* 1917 */ AdvancedCreationEntry sacknife = createAdvancedEntry(1016, 101, 793, 792, false, false, 0.0F, true, false, CreationCategories.WEAPONS);\n/* */ \n/* */ \n/* 1920 */ sacknife.addRequirement(new CreationRequirement(1, 376, 3, true));\n/* 1921 */ sacknife.addRequirement(new CreationRequirement(2, 382, 3, true));\n/* 1922 */ sacknife.addRequirement(new CreationRequirement(3, 380, 1, true));\n/* */ \n/* 1924 */ AdvancedCreationEntry torch = createAdvancedEntry(1010, 153, 23, 138, false, false, 0.0F, true, false, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* 1926 */ torch.addRequirement(new CreationRequirement(1, 479, 1, true));\n/* */ \n/* 1928 */ AdvancedCreationEntry oven = createAdvancedEntry(1013, 132, 130, 178, false, false, 0.0F, true, true, CreationCategories.FIRE);\n/* */ \n/* 1930 */ oven.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 1931 */ oven.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* */ \n/* 1933 */ AdvancedCreationEntry forge = createAdvancedEntry(1013, 132, 130, 180, false, false, 0.0F, true, true, CreationCategories.FIRE);\n/* */ \n/* 1935 */ forge.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 1936 */ forge.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* */ \n/* 1938 */ AdvancedCreationEntry colossus = createAdvancedEntry(1013, 519, 130, 518, false, false, 0.0F, true, true, CreationCategories.STATUES);\n/* */ \n/* 1940 */ colossus.addRequirement(new CreationRequirement(1, 519, 1999, true));\n/* 1941 */ colossus.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 1942 */ colossus.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 1944 */ AdvancedCreationEntry pylon = createAdvancedEntry(1013, 406, 130, 713, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1946 */ pylon.addRequirement(new CreationRequirement(1, 406, 100, true));\n/* 1947 */ pylon.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 1948 */ pylon.addRequirement(new CreationRequirement(3, 132, 1000, true));\n/* 1949 */ pylon.addRequirement(new CreationRequirement(4, 221, 1000, true));\n/* 1950 */ pylon.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1952 */ AdvancedCreationEntry shrine = createAdvancedEntry(1005, 406, 130, 712, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1954 */ shrine.addRequirement(new CreationRequirement(1, 406, 10, true));\n/* 1955 */ shrine.addRequirement(new CreationRequirement(2, 22, 100, true));\n/* 1956 */ shrine.addRequirement(new CreationRequirement(3, 218, 10, true));\n/* 1957 */ shrine.addRequirement(new CreationRequirement(4, 221, 100, true));\n/* 1958 */ shrine.addRequirement(new CreationRequirement(5, 502, 10, true));\n/* 1959 */ shrine.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1961 */ AdvancedCreationEntry temple = createAdvancedEntry(1013, 406, 130, 715, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1963 */ temple.addRequirement(new CreationRequirement(1, 406, 10, true));\n/* 1964 */ temple.addRequirement(new CreationRequirement(2, 130, 100, true));\n/* 1965 */ temple.addRequirement(new CreationRequirement(3, 132, 1000, true));\n/* 1966 */ temple.addRequirement(new CreationRequirement(4, 223, 100, true));\n/* 1967 */ temple.addRequirement(new CreationRequirement(5, 504, 10, true));\n/* 1968 */ temple.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1970 */ AdvancedCreationEntry obelisk = createAdvancedEntry(1013, 132, 130, 714, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1972 */ obelisk.addRequirement(new CreationRequirement(1, 132, 1000, true));\n/* 1973 */ obelisk.addRequirement(new CreationRequirement(2, 130, 1000, true));\n/* 1974 */ obelisk.addRequirement(new CreationRequirement(3, 223, 100, true));\n/* 1975 */ obelisk.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1977 */ AdvancedCreationEntry pillarDecoration = createAdvancedEntry(1013, 132, 130, 736, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 1979 */ pillarDecoration.addRequirement(new CreationRequirement(1, 132, 50, true));\n/* 1980 */ pillarDecoration.addRequirement(new CreationRequirement(2, 130, 50, true));\n/* */ \n/* 1982 */ AdvancedCreationEntry pillar = createAdvancedEntry(1013, 132, 130, 717, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1984 */ pillar.addRequirement(new CreationRequirement(1, 132, 100, true));\n/* 1985 */ pillar.addRequirement(new CreationRequirement(2, 130, 100, true));\n/* 1986 */ pillar.addRequirement(new CreationRequirement(3, 439, 10, true));\n/* 1987 */ pillar.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1989 */ AdvancedCreationEntry spiritgate = createAdvancedEntry(1013, 132, 130, 716, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 1991 */ spiritgate.addRequirement(new CreationRequirement(1, 132, 1000, true));\n/* 1992 */ spiritgate.addRequirement(new CreationRequirement(2, 130, 1000, true));\n/* 1993 */ spiritgate.addRequirement(new CreationRequirement(3, 44, 1000, true));\n/* 1994 */ spiritgate.isOnlyCreateEpicTargetMission = true;\n/* */ \n/* 1996 */ AdvancedCreationEntry sbench = createAdvancedEntry(1013, 132, 406, 404, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 1998 */ sbench.addRequirement(new CreationRequirement(1, 132, 1, true));\n/* 1999 */ sbench.addRequirement(new CreationRequirement(2, 130, 2, true));\n/* */ \n/* 2001 */ AdvancedCreationEntry coff = createAdvancedEntry(1013, 132, 406, 407, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2003 */ coff.addRequirement(new CreationRequirement(1, 132, 4, true));\n/* 2004 */ coff.addRequirement(new CreationRequirement(2, 130, 4, true));\n/* 2005 */ coff.addRequirement(new CreationRequirement(3, 406, 3, true));\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 2012 */ AdvancedCreationEntry ropetool = createAdvancedEntry(10044, 22, 23, 320, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2014 */ ropetool.addRequirement(new CreationRequirement(1, 217, 3, true));\n/* */ \n/* 2016 */ AdvancedCreationEntry wheelSmall = createAdvancedEntry(10044, 22, 23, 187, false, false, 0.0F, true, false, CreationCategories.CART_PARTS);\n/* */ \n/* 2018 */ wheelSmall.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2019 */ wheelSmall.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* */ \n/* 2021 */ AdvancedCreationEntry wheelAxlSmall = createAdvancedEntry(10044, 23, 187, 191, false, true, 0.0F, true, false, CreationCategories.CART_PARTS);\n/* */ \n/* 2023 */ wheelAxlSmall.addRequirement(new CreationRequirement(1, 187, 1, true));\n/* */ \n/* 2025 */ AdvancedCreationEntry cartSmall = createAdvancedEntry(10044, 22, 191, 186, false, false, 0.0F, true, true, CreationCategories.CARTS);\n/* */ \n/* 2027 */ cartSmall.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 2028 */ cartSmall.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2029 */ cartSmall.addRequirement(new CreationRequirement(3, 218, 2, true));\n/* */ \n/* 2031 */ AdvancedCreationEntry cartLarge = createAdvancedEntry(10044, 22, 191, 539, false, false, 0.0F, true, true, CreationCategories.CARTS);\n/* */ \n/* 2033 */ cartLarge.addRequirement(new CreationRequirement(1, 22, 15, true));\n/* 2034 */ cartLarge.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2035 */ cartLarge.addRequirement(new CreationRequirement(3, 218, 4, true));\n/* 2036 */ cartLarge.addRequirement(new CreationRequirement(4, 632, 1, true));\n/* */ \n/* 2038 */ AdvancedCreationEntry catapultSmall = createAdvancedEntry(10044, 23, 9, 445, false, false, 0.0F, true, true, CreationCategories.WARMACHINES);\n/* */ \n/* 2040 */ catapultSmall.addRequirement(new CreationRequirement(1, 319, 5, true));\n/* 2041 */ catapultSmall.addRequirement(new CreationRequirement(2, 191, 2, true));\n/* 2042 */ catapultSmall.addRequirement(new CreationRequirement(3, 9, 6, true));\n/* */ \n/* 2044 */ createSimpleEntry(10011, 64, 46, 1126, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* */ \n/* 2047 */ AdvancedCreationEntry batteringRam = createAdvancedEntry(10044, 860, 217, 1125, false, false, 0.0F, true, true, CreationCategories.WARMACHINES);\n/* */ \n/* 2049 */ batteringRam.addRequirement(new CreationRequirement(1, 860, 9, true));\n/* 2050 */ batteringRam.addRequirement(new CreationRequirement(2, 217, 4, true));\n/* 2051 */ batteringRam.addRequirement(new CreationRequirement(3, 319, 2, true));\n/* 2052 */ batteringRam.addRequirement(new CreationRequirement(4, 191, 2, true));\n/* 2053 */ batteringRam.addRequirement(new CreationRequirement(5, 9, 3, true));\n/* 2054 */ batteringRam.addRequirement(new CreationRequirement(6, 1126, 1, true));\n/* */ \n/* 2056 */ AdvancedCreationEntry joist = createAdvancedEntry(1005, 23, 9, 429, false, false, 0.0F, true, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 2058 */ joist.addRequirement(new CreationRequirement(1, 188, 2, true));\n/* 2059 */ joist.addRequirement(new CreationRequirement(2, 9, 1, true));\n/* 2060 */ joist.addRequirement(new CreationRequirement(3, 23, 3, true));\n/* */ \n/* 2062 */ AdvancedCreationEntry floor = createAdvancedEntry(1005, 217, 22, 495, false, false, 0.0F, true, true, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 2064 */ floor.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 2066 */ AdvancedCreationEntry minedoor = createAdvancedEntry(1005, 217, 22, 592, false, false, 0.0F, true, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 2068 */ minedoor.addRequirement(new CreationRequirement(1, 22, 20, true));\n/* 2069 */ minedoor.addRequirement(new CreationRequirement(2, 217, 1, true));\n/* 2070 */ minedoor.addRequirement(new CreationRequirement(3, 167, 1, true));\n/* */ \n/* 2072 */ AdvancedCreationEntry minedoorst = createAdvancedEntry(10015, 167, 597, 596, false, false, 0.0F, true, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 2074 */ minedoorst.addRequirement(new CreationRequirement(1, 597, 9, true));\n/* 2075 */ minedoorst.addRequirement(new CreationRequirement(2, 131, 50, true));\n/* */ \n/* 2077 */ AdvancedCreationEntry minedoors = createAdvancedEntry(10015, 167, 598, 595, false, false, 0.0F, true, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 2079 */ minedoors.addRequirement(new CreationRequirement(1, 598, 11, true));\n/* 2080 */ minedoors.addRequirement(new CreationRequirement(2, 131, 50, true));\n/* */ \n/* 2082 */ AdvancedCreationEntry minedoorg = createAdvancedEntry(10015, 167, 599, 594, false, false, 0.0F, true, true, CreationCategories.MINE_DOORS);\n/* */ \n/* 2084 */ minedoorg.addRequirement(new CreationRequirement(1, 599, 11, true));\n/* 2085 */ minedoorg.addRequirement(new CreationRequirement(2, 131, 50, true));\n/* */ \n/* 2087 */ AdvancedCreationEntry cheeseDrill = createAdvancedEntry(10044, 309, 23, 65, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2089 */ cheeseDrill.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 2090 */ cheeseDrill.addRequirement(new CreationRequirement(2, 266, 2, true));\n/* 2091 */ cheeseDrill.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2093 */ AdvancedCreationEntry fruitPress = createAdvancedEntry(10044, 23, 22, 413, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2095 */ fruitPress.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2096 */ fruitPress.addRequirement(new CreationRequirement(2, 266, 2, true));\n/* 2097 */ fruitPress.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2099 */ AdvancedCreationEntry papyrusPress = createAdvancedEntry(10044, 23, 22, 747, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2101 */ papyrusPress.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2102 */ papyrusPress.addRequirement(new CreationRequirement(2, 188, 2, true));\n/* 2103 */ papyrusPress.addRequirement(new CreationRequirement(3, 218, 2, true));\n/* */ \n/* 2105 */ AdvancedCreationEntry raftSmall = createAdvancedEntry(10082, 217, 22, 289, false, false, 0.0F, true, true, CreationCategories.SHIPBUILDING);\n/* */ \n/* 2107 */ raftSmall.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2108 */ raftSmall.addRequirement(new CreationRequirement(2, 9, 4, true));\n/* 2109 */ raftSmall.addRequirement(new CreationRequirement(3, 217, 7, true));\n/* */ \n/* 2111 */ AdvancedCreationEntry archeryTarg = createAdvancedEntry(1005, 23, 23, 458, false, false, 0.0F, true, true, CreationCategories.COMBAT_TRAINING);\n/* */ \n/* 2113 */ archeryTarg.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2114 */ archeryTarg.addRequirement(new CreationRequirement(2, 620, 4, true));\n/* 2115 */ archeryTarg.addRequirement(new CreationRequirement(3, 217, 7, true));\n/* 2116 */ archeryTarg.addRequirement(new CreationRequirement(4, 319, 1, true));\n/* */ \n/* 2118 */ AdvancedCreationEntry buildmarker = createAdvancedEntry(1005, 23, 23, 679, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 2120 */ buildmarker.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2121 */ buildmarker.addRequirement(new CreationRequirement(2, 217, 1, true));\n/* */ \n/* 2123 */ AdvancedCreationEntry doll = createAdvancedEntry(1005, 217, 23, 321, false, false, 0.0F, true, false, CreationCategories.COMBAT_TRAINING);\n/* */ \n/* 2125 */ doll.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2126 */ doll.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* 2127 */ doll.addRequirement(new CreationRequirement(3, 33, 1, true));\n/* */ \n/* 2129 */ AdvancedCreationEntry barrell = createAdvancedEntry(10044, 188, 22, 190, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2131 */ barrell.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2132 */ barrell.addRequirement(new CreationRequirement(2, 188, 1, true));\n/* */ \n/* 2134 */ AdvancedCreationEntry hbarrell = createAdvancedEntry(10044, 188, 22, 576, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2136 */ hbarrell.addRequirement(new CreationRequirement(1, 22, 24, true));\n/* 2137 */ hbarrell.addRequirement(new CreationRequirement(2, 188, 3, true));\n/* */ \n/* 2139 */ AdvancedCreationEntry oilbarrell = createAdvancedEntry(10044, 188, 22, 757, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2141 */ oilbarrell.addRequirement(new CreationRequirement(1, 22, 24, true));\n/* 2142 */ oilbarrell.addRequirement(new CreationRequirement(2, 188, 3, true));\n/* */ \n/* 2144 */ AdvancedCreationEntry grains = createAdvancedEntry(1005, 188, 22, 661, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2146 */ grains.addRequirement(new CreationRequirement(1, 22, 24, true));\n/* 2147 */ grains.addRequirement(new CreationRequirement(2, 217, 4, true));\n/* */ \n/* 2149 */ AdvancedCreationEntry bulks = createAdvancedEntry(1005, 188, 22, 662, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2151 */ bulks.addRequirement(new CreationRequirement(1, 22, 24, true));\n/* 2152 */ bulks.addRequirement(new CreationRequirement(2, 217, 4, true));\n/* */ \n/* 2154 */ AdvancedCreationEntry trash = createAdvancedEntry(1005, 188, 22, 670, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2156 */ trash.addRequirement(new CreationRequirement(1, 22, 10, true));\n/* 2157 */ trash.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* */ \n/* 2159 */ AdvancedCreationEntry barrels = createAdvancedEntry(10044, 218, 22, 189, false, false, 0.0F, true, false, CreationCategories.STORAGE);\n/* */ \n/* 2161 */ barrels.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 2163 */ AdvancedCreationEntry wineBarrel = createAdvancedEntry(10044, 218, 22, 768, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2165 */ wineBarrel.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2166 */ wineBarrel.addRequirement(new CreationRequirement(2, 188, 1, true));\n/* */ \n/* 2168 */ AdvancedCreationEntry buckets = createAdvancedEntry(10044, 218, 22, 421, false, false, 0.0F, true, false, CreationCategories.STORAGE);\n/* */ \n/* 2170 */ buckets.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 2172 */ AdvancedCreationEntry dredge = createAdvancedEntry(10015, 213, 319, 581, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2174 */ dredge.addRequirement(new CreationRequirement(1, 582, 4, true));\n/* */ \n/* 2176 */ AdvancedCreationEntry crows = createAdvancedEntry(10044, 188, 22, 583, false, false, 0.0F, true, true, CreationCategories.SHIPBUILDING);\n/* */ \n/* 2178 */ crows.addRequirement(new CreationRequirement(1, 22, 12, true));\n/* 2179 */ crows.addRequirement(new CreationRequirement(2, 188, 3, true));\n/* */ \n/* 2181 */ AdvancedCreationEntry chests = createAdvancedEntry(10044, 218, 22, 192, false, false, 0.0F, true, false, CreationCategories.STORAGE);\n/* */ \n/* 2183 */ chests.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* */ \n/* 2185 */ AdvancedCreationEntry signp = createAdvancedEntry(10044, 218, 22, 208, false, false, 0.0F, true, false, CreationCategories.SIGNS);\n/* */ \n/* 2187 */ signp.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* */ \n/* 2189 */ AdvancedCreationEntry signl = createAdvancedEntry(10044, 218, 22, 209, false, false, 0.0F, true, false, CreationCategories.SIGNS);\n/* */ \n/* 2191 */ signl.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 2192 */ signl.addRequirement(new CreationRequirement(2, 22, 1, true));\n/* */ \n/* 2194 */ AdvancedCreationEntry signshop = createAdvancedEntry(10044, 218, 22, 656, false, false, 0.0F, true, false, CreationCategories.SIGNS);\n/* */ \n/* 2196 */ signshop.addRequirement(new CreationRequirement(1, 23, 2, true));\n/* 2197 */ signshop.addRequirement(new CreationRequirement(2, 22, 2, true));\n/* */ \n/* 2199 */ AdvancedCreationEntry signs = createAdvancedEntry(10044, 218, 22, 210, false, false, 0.0F, true, false, CreationCategories.SIGNS);\n/* */ \n/* 2201 */ signs.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* */ \n/* 2203 */ AdvancedCreationEntry dale = createAdvancedEntry(10036, 36, 9, 74, false, false, 0.0F, true, true, CreationCategories.PRODUCTION);\n/* */ \n/* 2205 */ dale.addRequirement(new CreationRequirement(1, 9, 20, true));\n/* 2206 */ dale.addRequirement(new CreationRequirement(2, 26, 2, true));\n/* */ \n/* 2208 */ AdvancedCreationEntry loom = createAdvancedEntry(10044, 218, 22, 226, false, false, 0.0F, true, true, CreationCategories.TOOLS);\n/* */ \n/* 2210 */ loom.addRequirement(new CreationRequirement(1, 23, 10, true));\n/* 2211 */ loom.addRequirement(new CreationRequirement(2, 214, 10, true));\n/* 2212 */ loom.addRequirement(new CreationRequirement(3, 22, 2, true));\n/* */ \n/* 2214 */ AdvancedCreationEntry marketstall = createAdvancedEntry(10044, 217, 22, 580, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 2216 */ marketstall.addRequirement(new CreationRequirement(1, 22, 20, true));\n/* 2217 */ marketstall.addRequirement(new CreationRequirement(2, 213, 4, true));\n/* 2218 */ marketstall.addRequirement(new CreationRequirement(3, 23, 4, true));\n/* */ \n/* 2220 */ AdvancedCreationEntry squareTable = createAdvancedEntry(10044, 23, 22, 262, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2222 */ squareTable.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2223 */ squareTable.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* */ \n/* 2225 */ AdvancedCreationEntry roundTable = createAdvancedEntry(10044, 23, 22, 260, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2227 */ roundTable.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2228 */ roundTable.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* */ \n/* 2230 */ AdvancedCreationEntry diningTable = createAdvancedEntry(10044, 23, 22, 264, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2232 */ diningTable.addRequirement(new CreationRequirement(1, 22, 6, true));\n/* 2233 */ diningTable.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* */ \n/* 2235 */ AdvancedCreationEntry stoolRound = createAdvancedEntry(10044, 23, 22, 261, false, false, 0.0F, true, false, CreationCategories.FURNITURE);\n/* */ \n/* 2237 */ stoolRound.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2238 */ stoolRound.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* */ \n/* 2240 */ AdvancedCreationEntry chair = createAdvancedEntry(10044, 22, 23, 263, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2242 */ chair.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2243 */ chair.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* */ \n/* 2245 */ AdvancedCreationEntry armchair = createAdvancedEntry(10044, 23, 22, 265, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2247 */ armchair.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2248 */ armchair.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2249 */ armchair.addRequirement(new CreationRequirement(3, 213, 1, true));\n/* */ \n/* 2251 */ AdvancedCreationEntry bed = createAdvancedEntry(10044, 482, 483, 484, false, false, 0.0F, true, true, CreationCategories.FURNITURE);\n/* */ \n/* 2253 */ bed.addRequirement(new CreationRequirement(1, 485, 1, true));\n/* 2254 */ bed.addRequirement(new CreationRequirement(2, 486, 2, true));\n/* 2255 */ bed.addRequirement(new CreationRequirement(3, 302, 3, true));\n/* 2256 */ AdvancedCreationEntry tentExplorer = createAdvancedEntry(10044, 23, 213, 863, false, false, 0.0F, true, true, CreationCategories.TENTS);\n/* */ \n/* 2258 */ tentExplorer.addRequirement(new CreationRequirement(1, 23, 8, true));\n/* 2259 */ tentExplorer.addRequirement(new CreationRequirement(2, 213, 8, true));\n/* 2260 */ tentExplorer.addRequirement(new CreationRequirement(3, 559, 6, true));\n/* 2261 */ tentExplorer.addRequirement(new CreationRequirement(4, 561, 6, true));\n/* */ \n/* 2263 */ AdvancedCreationEntry tentMilitary = createAdvancedEntry(10044, 23, 213, 864, false, false, 0.0F, true, true, CreationCategories.TENTS);\n/* */ \n/* 2265 */ tentMilitary.addRequirement(new CreationRequirement(1, 23, 10, true));\n/* 2266 */ tentMilitary.addRequirement(new CreationRequirement(2, 213, 12, true));\n/* 2267 */ tentMilitary.addRequirement(new CreationRequirement(3, 559, 10, true));\n/* 2268 */ tentMilitary.addRequirement(new CreationRequirement(4, 561, 10, true));\n/* */ \n/* 2270 */ AdvancedCreationEntry pavilion = createAdvancedEntry(10044, 23, 213, 865, false, false, 0.0F, true, true, CreationCategories.TENTS);\n/* */ \n/* 2272 */ pavilion.addRequirement(new CreationRequirement(1, 23, 10, true));\n/* 2273 */ pavilion.addRequirement(new CreationRequirement(2, 213, 6, true));\n/* 2274 */ pavilion.addRequirement(new CreationRequirement(3, 559, 10, true));\n/* 2275 */ pavilion.addRequirement(new CreationRequirement(4, 561, 10, true));\n/* */ \n/* 2277 */ AdvancedCreationEntry bedframe = createAdvancedEntry(10044, 217, 22, 483, false, false, 0.0F, true, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 2279 */ bedframe.addRequirement(new CreationRequirement(1, 22, 9, true));\n/* */ \n/* 2281 */ AdvancedCreationEntry bedheadboard = createAdvancedEntry(10044, 218, 22, 482, false, false, 0.0F, true, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 2283 */ bedheadboard.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2284 */ bedheadboard.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* */ \n/* 2286 */ AdvancedCreationEntry bedfootboard = createAdvancedEntry(10044, 218, 22, 485, false, false, 0.0F, true, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* 2288 */ bedfootboard.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2289 */ bedfootboard.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* */ \n/* 2291 */ AdvancedCreationEntry altarwood = createAdvancedEntry(10044, 218, 22, 322, false, false, 0.0F, true, true, CreationCategories.ALTAR);\n/* */ \n/* 2293 */ altarwood.addRequirement(new CreationRequirement(1, 22, 8, true));\n/* 2294 */ altarwood.addRequirement(new CreationRequirement(2, 213, 2, true));\n/* 2295 */ altarwood.addRequirement(new CreationRequirement(3, 326, 1, true));\n/* */ \n/* 2297 */ AdvancedCreationEntry altarStone = createAdvancedEntry(1013, 130, 132, 323, false, false, 0.0F, true, true, CreationCategories.ALTAR);\n/* */ \n/* 2299 */ altarStone.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 2300 */ altarStone.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* 2301 */ altarStone.addRequirement(new CreationRequirement(3, 326, 1, true));\n/* */ \n/* 2303 */ AdvancedCreationEntry chestl = createAdvancedEntry(10044, 188, 22, 184, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 2305 */ chestl.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2306 */ chestl.addRequirement(new CreationRequirement(2, 188, 2, true));\n/* 2307 */ chestl.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2309 */ AdvancedCreationEntry shieldsm = createAdvancedEntry(10014, 218, 22, 82, false, false, 0.0F, true, false, CreationCategories.SHIELDS);\n/* */ \n/* 2311 */ shieldsm.addRequirement(new CreationRequirement(1, 188, 1, true));\n/* */ \n/* 2313 */ AdvancedCreationEntry shieldTurtle = createAdvancedEntry(10014, 218, 898, 899, false, false, 0.0F, true, false, CreationCategories.SHIELDS);\n/* */ \n/* 2315 */ shieldTurtle.addRequirement(new CreationRequirement(1, 100, 2, true));\n/* */ \n/* 2317 */ AdvancedCreationEntry shieldmed = createAdvancedEntry(10014, 218, 22, 84, false, false, 0.0F, true, false, CreationCategories.SHIELDS);\n/* */ \n/* 2319 */ shieldmed.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2320 */ shieldmed.addRequirement(new CreationRequirement(2, 188, 1, true));\n/* */ \n/* 2322 */ AdvancedCreationEntry shieldla = createAdvancedEntry(10014, 218, 22, 85, false, false, 0.0F, true, false, CreationCategories.SHIELDS);\n/* */ \n/* 2324 */ shieldla.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2325 */ shieldla.addRequirement(new CreationRequirement(2, 188, 1, true));\n/* */ \n/* 2327 */ AdvancedCreationEntry towerStone = createAdvancedEntry(1013, 132, 130, 384, false, false, 0.0F, true, true, CreationCategories.TOWERS);\n/* */ \n/* 2329 */ towerStone.addRequirement(new CreationRequirement(1, 132, 500, true));\n/* 2330 */ towerStone.addRequirement(new CreationRequirement(2, 130, 500, true));\n/* 2331 */ towerStone.addRequirement(new CreationRequirement(3, 22, 100, true));\n/* */ \n/* 2333 */ AdvancedCreationEntry compass = createAdvancedEntry(1020, 418, 76, 480, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2335 */ compass.addRequirement(new CreationRequirement(1, 215, 1, true));\n/* */ \n/* 2337 */ AdvancedCreationEntry puppetFo = createAdvancedEntry(10051, 215, 214, 640, false, true, 0.0F, false, false, CreationCategories.TOYS);\n/* */ \n/* 2339 */ puppetFo.addRequirement(new CreationRequirement(1, 213, 1, true));\n/* 2340 */ puppetFo.addRequirement(new CreationRequirement(2, 436, 1, true));\n/* 2341 */ puppetFo.addRequirement(new CreationRequirement(3, 23, 1, true));\n/* */ \n/* 2343 */ AdvancedCreationEntry puppetVynora = createAdvancedEntry(10051, 215, 214, 642, false, true, 0.0F, false, false, CreationCategories.TOYS);\n/* */ \n/* 2345 */ puppetVynora.addRequirement(new CreationRequirement(1, 213, 1, true));\n/* 2346 */ puppetVynora.addRequirement(new CreationRequirement(2, 364, 1, true));\n/* 2347 */ puppetVynora.addRequirement(new CreationRequirement(3, 23, 1, true));\n/* */ \n/* 2349 */ AdvancedCreationEntry puppetLibila = createAdvancedEntry(10051, 215, 214, 643, false, true, 0.0F, false, false, CreationCategories.TOYS);\n/* */ \n/* 2351 */ puppetLibila.addRequirement(new CreationRequirement(1, 213, 1, true));\n/* 2352 */ puppetLibila.addRequirement(new CreationRequirement(2, 204, 1, true));\n/* 2353 */ puppetLibila.addRequirement(new CreationRequirement(3, 23, 1, true));\n/* */ \n/* 2355 */ AdvancedCreationEntry puppetMagranon = createAdvancedEntry(10051, 215, 214, 641, false, true, 0.0F, false, false, CreationCategories.TOYS);\n/* */ \n/* 2357 */ puppetMagranon.addRequirement(new CreationRequirement(1, 213, 1, true));\n/* 2358 */ puppetMagranon.addRequirement(new CreationRequirement(2, 439, 1, true));\n/* 2359 */ puppetMagranon.addRequirement(new CreationRequirement(3, 23, 1, true));\n/* */ \n/* 2361 */ AdvancedCreationEntry epicPortal = createAdvancedEntry(1013, 9, 132, 732, false, false, 0.0F, true, true, CreationCategories.EPIC);\n/* */ \n/* 2363 */ epicPortal.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 2364 */ epicPortal.addRequirement(new CreationRequirement(2, 9, 3, true));\n/* */ \n/* 2366 */ AdvancedCreationEntry mailboxStone = createAdvancedEntry(1013, 132, 130, 511, false, false, 0.0F, true, true, CreationCategories.MAILBOXES);\n/* */ \n/* 2368 */ mailboxStone.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 2369 */ mailboxStone.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* */ \n/* 2371 */ AdvancedCreationEntry mailboxStone2 = createAdvancedEntry(1013, 132, 130, 513, false, false, 0.0F, true, true, CreationCategories.MAILBOXES);\n/* */ \n/* 2373 */ mailboxStone2.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 2374 */ mailboxStone2.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* 2375 */ mailboxStone2.addRequirement(new CreationRequirement(3, 213, 2, true));\n/* */ \n/* 2377 */ AdvancedCreationEntry mailboxWood = createAdvancedEntry(10044, 218, 22, 510, false, false, 0.0F, true, true, CreationCategories.MAILBOXES);\n/* */ \n/* 2379 */ mailboxWood.addRequirement(new CreationRequirement(1, 22, 8, true));\n/* 2380 */ mailboxWood.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* */ \n/* 2382 */ AdvancedCreationEntry mailboxWood2 = createAdvancedEntry(10044, 218, 22, 512, false, false, 0.0F, true, true, CreationCategories.MAILBOXES);\n/* */ \n/* 2384 */ mailboxWood2.addRequirement(new CreationRequirement(1, 22, 8, true));\n/* 2385 */ mailboxWood2.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* 2386 */ mailboxWood2.addRequirement(new CreationRequirement(3, 213, 2, true));\n/* */ \n/* 2388 */ AdvancedCreationEntry toolbelt = createAdvancedEntry(10017, 517, 102, 516, false, false, 0.0F, true, false, CreationCategories.CLOTHES);\n/* */ \n/* 2390 */ toolbelt.addRequirement(new CreationRequirement(1, 72, 1, true));\n/* 2391 */ toolbelt.addRequirement(new CreationRequirement(2, 213, 1, true));\n/* */ \n/* 2393 */ AdvancedCreationEntry trapSticks = createAdvancedEntry(1005, 217, 22, 610, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2395 */ trapSticks.addRequirement(new CreationRequirement(1, 99, 10, true));\n/* 2396 */ trapSticks.addRequirement(new CreationRequirement(2, 22, 4, true));\n/* */ \n/* 2398 */ AdvancedCreationEntry trapPole = createAdvancedEntry(1005, 217, 22, 611, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2400 */ trapPole.addRequirement(new CreationRequirement(1, 9, 1, true));\n/* 2401 */ trapPole.addRequirement(new CreationRequirement(2, 22, 4, true));\n/* 2402 */ trapPole.addRequirement(new CreationRequirement(3, 319, 1, true));\n/* */ \n/* 2404 */ AdvancedCreationEntry trapCorrosion = createAdvancedEntry(1011, 217, 22, 612, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2406 */ trapCorrosion.addRequirement(new CreationRequirement(1, 78, 10, true));\n/* 2407 */ trapCorrosion.addRequirement(new CreationRequirement(2, 73, 4, true));\n/* 2408 */ trapCorrosion.addRequirement(new CreationRequirement(3, 457, 1, true));\n/* */ \n/* 2410 */ AdvancedCreationEntry trapAxe = createAdvancedEntry(1005, 217, 22, 613, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2412 */ trapAxe.addRequirement(new CreationRequirement(1, 90, 1, true));\n/* 2413 */ trapAxe.addRequirement(new CreationRequirement(2, 22, 4, true));\n/* 2414 */ trapAxe.addRequirement(new CreationRequirement(3, 457, 1, true));\n/* 2415 */ trapAxe.addRequirement(new CreationRequirement(4, 609, 1, true));\n/* */ \n/* 2417 */ AdvancedCreationEntry trapDagger = createAdvancedEntry(1005, 217, 22, 614, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2419 */ trapDagger.addRequirement(new CreationRequirement(1, 126, 10, true));\n/* 2420 */ trapDagger.addRequirement(new CreationRequirement(2, 22, 4, true));\n/* */ \n/* 2422 */ AdvancedCreationEntry trapNet = createAdvancedEntry(1014, 319, 319, 615, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2424 */ trapNet.addRequirement(new CreationRequirement(1, 559, 5, true));\n/* 2425 */ trapNet.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* */ \n/* 2427 */ AdvancedCreationEntry trapScythe = createAdvancedEntry(1013, 132, 130, 616, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2429 */ trapScythe.addRequirement(new CreationRequirement(1, 132, 10, true));\n/* 2430 */ trapScythe.addRequirement(new CreationRequirement(2, 130, 10, true));\n/* 2431 */ trapScythe.addRequirement(new CreationRequirement(3, 270, 1, true));\n/* 2432 */ trapScythe.addRequirement(new CreationRequirement(4, 609, 1, true));\n/* */ \n/* 2434 */ AdvancedCreationEntry trapMan = createAdvancedEntry(10015, 582, 582, 617, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2436 */ trapMan.addRequirement(new CreationRequirement(1, 609, 1, true));\n/* */ \n/* 2438 */ AdvancedCreationEntry trapBow = createAdvancedEntry(1005, 217, 22, 618, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2440 */ trapBow.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2441 */ trapBow.addRequirement(new CreationRequirement(2, 447, 1, true));\n/* 2442 */ trapBow.addRequirement(new CreationRequirement(3, 457, 1, true));\n/* 2443 */ trapBow.addRequirement(new CreationRequirement(4, 456, 1, true));\n/* */ \n/* 2445 */ AdvancedCreationEntry trapRope = createAdvancedEntry(1014, 319, 559, 619, false, false, 0.0F, true, false, CreationCategories.TRAPS);\n/* */ \n/* 2447 */ trapRope.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 2448 */ trapRope.addRequirement(new CreationRequirement(2, 457, 1, true));\n/* */ \n/* 2450 */ AdvancedCreationEntry villageBoard = createAdvancedEntry(1005, 23, 22, 835, false, false, 0.0F, true, true, CreationCategories.SIGNS);\n/* */ \n/* 2452 */ villageBoard.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2453 */ villageBoard.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 2454 */ villageBoard.addRequirement(new CreationRequirement(3, 218, 3, true));\n/* */ \n/* 2456 */ AdvancedCreationEntry copperBrazier = createAdvancedEntry(10015, 838, 839, 841, false, false, 0.0F, true, true, 20, 30.0D, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 2459 */ copperBrazier.addRequirement(new CreationRequirement(1, 838, 2, true));\n/* */ \n/* 2461 */ AdvancedCreationEntry marbleBrazierPillar = createAdvancedEntry(1013, 786, 492, 842, false, false, 0.0F, true, true, 20, 30.0D, CreationCategories.LIGHTS_AND_LAMPS);\n/* */ \n/* */ \n/* 2464 */ marbleBrazierPillar.addRequirement(new CreationRequirement(1, 786, 49, true));\n/* 2465 */ marbleBrazierPillar.addRequirement(new CreationRequirement(2, 492, 49, true));\n/* 2466 */ marbleBrazierPillar.addRequirement(new CreationRequirement(3, 840, 1, true));\n/* */ \n/* 2468 */ AdvancedCreationEntry wagon = createAdvancedEntry(10044, 22, 191, 850, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.CARTS);\n/* */ \n/* 2470 */ wagon.addRequirement(new CreationRequirement(1, 191, 1, true));\n/* 2471 */ wagon.addRequirement(new CreationRequirement(2, 22, 20, true));\n/* 2472 */ wagon.addRequirement(new CreationRequirement(3, 23, 4, true));\n/* 2473 */ wagon.addRequirement(new CreationRequirement(4, 218, 10, true));\n/* 2474 */ wagon.addRequirement(new CreationRequirement(5, 632, 2, true));\n/* 2475 */ wagon.addRequirement(new CreationRequirement(6, 486, 2, true));\n/* 2476 */ wagon.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 2478 */ AdvancedCreationEntry smallCrate = createAdvancedEntry(1005, 22, 217, 851, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.STORAGE);\n/* */ \n/* 2480 */ smallCrate.addRequirement(new CreationRequirement(1, 22, 10, true));\n/* */ \n/* 2482 */ AdvancedCreationEntry largeCrate = createAdvancedEntry(1005, 22, 217, 852, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.STORAGE);\n/* */ \n/* 2484 */ largeCrate.addRequirement(new CreationRequirement(1, 22, 15, true));\n/* */ \n/* 2486 */ AdvancedCreationEntry shipCarrier = createAdvancedEntry(10044, 22, 191, 853, false, false, 0.0F, true, true, 0, 15.0D, CreationCategories.CARTS);\n/* */ \n/* 2488 */ shipCarrier.addRequirement(new CreationRequirement(1, 191, 1, true));\n/* 2489 */ shipCarrier.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* 2490 */ shipCarrier.addRequirement(new CreationRequirement(3, 23, 4, true));\n/* 2491 */ shipCarrier.addRequirement(new CreationRequirement(4, 218, 4, true));\n/* 2492 */ shipCarrier.addRequirement(new CreationRequirement(5, 632, 1, true));\n/* 2493 */ shipCarrier.addRequirement(new CreationRequirement(6, 9, 2, true));\n/* */ \n/* 2495 */ AdvancedCreationEntry creatureCarrier = createAdvancedEntry(10044, 22, 191, 1410, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.CARTS);\n/* */ \n/* 2497 */ creatureCarrier.addRequirement(new CreationRequirement(1, 191, 1, true));\n/* 2498 */ creatureCarrier.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* 2499 */ creatureCarrier.addRequirement(new CreationRequirement(3, 23, 4, true));\n/* 2500 */ creatureCarrier.addRequirement(new CreationRequirement(4, 218, 4, true));\n/* 2501 */ creatureCarrier.addRequirement(new CreationRequirement(5, 632, 1, true));\n/* 2502 */ creatureCarrier.addRequirement(new CreationRequirement(6, 9, 2, true));\n/* */ \n/* 2504 */ AdvancedCreationEntry colossusOfVynora = createAdvancedEntry(1013, 519, 130, 869, false, false, 0.0F, true, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 2507 */ colossusOfVynora.setDeityRestriction(3);\n/* 2508 */ colossusOfVynora.addRequirement(new CreationRequirement(1, 519, 1999, true));\n/* 2509 */ colossusOfVynora.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 2510 */ colossusOfVynora.addRequirement(new CreationRequirement(3, 599, 10, true));\n/* 2511 */ colossusOfVynora.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 2513 */ AdvancedCreationEntry colossusOfMagranon = createAdvancedEntry(1013, 519, 130, 870, false, false, 0.0F, true, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 2516 */ colossusOfMagranon.setDeityRestriction(2);\n/* 2517 */ colossusOfMagranon.addRequirement(new CreationRequirement(1, 519, 1999, true));\n/* 2518 */ colossusOfMagranon.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 2519 */ colossusOfMagranon.addRequirement(new CreationRequirement(3, 598, 10, true));\n/* 2520 */ colossusOfMagranon.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 2522 */ AdvancedCreationEntry bedsideTable = createAdvancedEntry(10044, 23, 22, 885, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2525 */ bedsideTable.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2526 */ bedsideTable.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* 2527 */ bedsideTable.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2529 */ AdvancedCreationEntry colossusOfFo = createAdvancedEntry(1013, 519, 130, 907, false, false, 0.0F, true, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 2532 */ colossusOfFo.setDeityRestriction(1);\n/* 2533 */ colossusOfFo.addRequirement(new CreationRequirement(1, 519, 1999, true));\n/* 2534 */ colossusOfFo.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 2535 */ colossusOfFo.addRequirement(new CreationRequirement(3, 598, 10, true));\n/* 2536 */ colossusOfFo.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 2538 */ AdvancedCreationEntry colossusOfLibila = createAdvancedEntry(1013, 519, 130, 916, false, false, 0.0F, true, true, CreationCategories.STATUES);\n/* */ \n/* */ \n/* 2541 */ colossusOfLibila.setDeityRestriction(4);\n/* 2542 */ colossusOfLibila.addRequirement(new CreationRequirement(1, 519, 1999, true));\n/* 2543 */ colossusOfLibila.addRequirement(new CreationRequirement(2, 130, 1999, true));\n/* 2544 */ colossusOfLibila.addRequirement(new CreationRequirement(3, 772, 10, true));\n/* 2545 */ colossusOfLibila.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 2547 */ createSimpleEntry(10015, 185, 221, 897, false, true, 0.0F, false, false, CreationCategories.CONSTRUCTION_MATERIAL);\n/* */ \n/* */ \n/* 2550 */ AdvancedCreationEntry openFireplace = createAdvancedEntry(1013, 492, 132, 889, false, false, 0.0F, true, true, 0, 35.0D, CreationCategories.FIRE);\n/* */ \n/* */ \n/* 2553 */ openFireplace.addRequirement(new CreationRequirement(1, 132, 9, true));\n/* 2554 */ openFireplace.addRequirement(new CreationRequirement(2, 492, 9, true));\n/* 2555 */ openFireplace.addRequirement(new CreationRequirement(3, 22, 2, true));\n/* */ \n/* 2557 */ AdvancedCreationEntry canopyBed = createAdvancedEntry(10044, 482, 483, 890, false, false, 0.0F, true, true, 0, 65.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2560 */ canopyBed.addRequirement(new CreationRequirement(1, 485, 1, true));\n/* 2561 */ canopyBed.addRequirement(new CreationRequirement(2, 22, 10, true));\n/* 2562 */ canopyBed.addRequirement(new CreationRequirement(3, 486, 8, true));\n/* 2563 */ canopyBed.addRequirement(new CreationRequirement(4, 302, 8, true));\n/* 2564 */ canopyBed.addRequirement(new CreationRequirement(5, 217, 2, true));\n/* 2565 */ canopyBed.addRequirement(new CreationRequirement(6, 218, 2, true));\n/* */ \n/* 2567 */ AdvancedCreationEntry woodenBench = createAdvancedEntry(10044, 218, 22, 891, false, false, 0.0F, true, true, 0, 35.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2570 */ woodenBench.addRequirement(new CreationRequirement(1, 22, 7, true));\n/* 2571 */ woodenBench.addRequirement(new CreationRequirement(2, 218, 3, true));\n/* 2572 */ woodenBench.addRequirement(new CreationRequirement(3, 23, 4, true));\n/* 2573 */ woodenBench.addRequirement(new CreationRequirement(4, 188, 2, true));\n/* */ \n/* 2575 */ AdvancedCreationEntry wardrobe = createAdvancedEntry(10044, 217, 22, 892, false, false, 0.0F, true, true, 0, 55.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2578 */ wardrobe.addRequirement(new CreationRequirement(1, 22, 11, true));\n/* 2579 */ wardrobe.addRequirement(new CreationRequirement(2, 23, 4, true));\n/* 2580 */ wardrobe.addRequirement(new CreationRequirement(3, 217, 3, true));\n/* 2581 */ wardrobe.addRequirement(new CreationRequirement(4, 218, 2, true));\n/* */ \n/* 2583 */ AdvancedCreationEntry woodenCoffer = createAdvancedEntry(10044, 218, 22, 893, false, false, 0.0F, true, true, 0, 24.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2586 */ woodenCoffer.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 2587 */ woodenCoffer.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* */ \n/* 2589 */ AdvancedCreationEntry royalThrone = createAdvancedEntry(10044, 217, 22, 894, false, false, 0.0F, true, true, 0, 70.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2592 */ royalThrone.addRequirement(new CreationRequirement(1, 22, 7, true));\n/* 2593 */ royalThrone.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2594 */ royalThrone.addRequirement(new CreationRequirement(3, 217, 3, true));\n/* 2595 */ royalThrone.addRequirement(new CreationRequirement(4, 218, 6, true));\n/* */ \n/* 2597 */ AdvancedCreationEntry washingBowl = createAdvancedEntry(10015, 64, 221, 895, false, true, 0.0F, false, true, 0, 30.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2600 */ washingBowl.setDepleteFromTarget(1500);\n/* 2601 */ washingBowl.addRequirement(new CreationRequirement(1, 897, 3, true));\n/* 2602 */ washingBowl.addRequirement(new CreationRequirement(2, 77, 1, true));\n/* */ \n/* 2604 */ AdvancedCreationEntry tripodTableSmall = createAdvancedEntry(10044, 22, 23, 896, false, false, 0.0F, true, true, 0, 30.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2607 */ tripodTableSmall.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2608 */ tripodTableSmall.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 2609 */ tripodTableSmall.addRequirement(new CreationRequirement(3, 218, 2, true));\n/* */ \n/* 2611 */ AdvancedCreationEntry highBookshelf = createAdvancedEntry(10044, 217, 22, 911, false, false, 0.0F, true, true, 0, 35.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2614 */ highBookshelf.addRequirement(new CreationRequirement(1, 22, 7, true));\n/* 2615 */ highBookshelf.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2616 */ highBookshelf.addRequirement(new CreationRequirement(3, 217, 3, true));\n/* */ \n/* 2618 */ AdvancedCreationEntry lowBookshelf = createAdvancedEntry(10044, 217, 22, 912, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2621 */ lowBookshelf.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2622 */ lowBookshelf.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 2623 */ lowBookshelf.addRequirement(new CreationRequirement(3, 217, 1, true));\n/* */ \n/* 2625 */ AdvancedCreationEntry emptyHighBookshelf = createAdvancedEntry(10044, 217, 22, 1401, false, false, 0.0F, true, true, 0, 35.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2628 */ emptyHighBookshelf.addRequirement(new CreationRequirement(1, 22, 7, true));\n/* 2629 */ emptyHighBookshelf.addRequirement(new CreationRequirement(2, 23, 2, true));\n/* 2630 */ emptyHighBookshelf.addRequirement(new CreationRequirement(3, 217, 3, true));\n/* */ \n/* 2632 */ AdvancedCreationEntry emptyLowBookshelf = createAdvancedEntry(10044, 217, 22, 1400, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2635 */ emptyLowBookshelf.addRequirement(new CreationRequirement(1, 22, 3, true));\n/* 2636 */ emptyLowBookshelf.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 2637 */ emptyLowBookshelf.addRequirement(new CreationRequirement(3, 217, 1, true));\n/* */ \n/* 2639 */ AdvancedCreationEntry barTable = createAdvancedEntry(10044, 218, 22, 1402, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2642 */ barTable.addRequirement(new CreationRequirement(1, 22, 14, true));\n/* 2643 */ barTable.addRequirement(new CreationRequirement(2, 188, 2, true));\n/* 2644 */ barTable.addRequirement(new CreationRequirement(3, 218, 4, true));\n/* */ \n/* 2646 */ AdvancedCreationEntry fineHighChair = createAdvancedEntry(10044, 218, 22, 913, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2649 */ fineHighChair.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2650 */ fineHighChair.addRequirement(new CreationRequirement(2, 213, 2, true));\n/* 2651 */ fineHighChair.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2653 */ AdvancedCreationEntry highChair = createAdvancedEntry(10044, 218, 22, 914, false, false, 0.0F, true, true, 0, 50.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2656 */ highChair.addRequirement(new CreationRequirement(1, 22, 2, true));\n/* 2657 */ highChair.addRequirement(new CreationRequirement(2, 188, 2, true));\n/* 2658 */ highChair.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2660 */ AdvancedCreationEntry pauperHighChair = createAdvancedEntry(10044, 218, 22, 915, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2663 */ pauperHighChair.addRequirement(new CreationRequirement(1, 22, 1, true));\n/* 2664 */ pauperHighChair.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* 2665 */ pauperHighChair.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 2667 */ if (Features.Feature.AMPHORA.isEnabled()) {\n/* */ \n/* 2669 */ AdvancedCreationEntry kiln = createAdvancedEntry(1013, 132, 132, 1023, false, false, 0.0F, true, true, CreationCategories.FIRE);\n/* */ \n/* 2671 */ kiln.addRequirement(new CreationRequirement(1, 132, 18, true));\n/* 2672 */ kiln.addRequirement(new CreationRequirement(2, 130, 20, true));\n/* 2673 */ kiln.addRequirement(new CreationRequirement(3, 26, 2, true));\n/* */ } \n/* */ \n/* 2676 */ AdvancedCreationEntry smelter = createAdvancedEntry(1013, 132, 132, 1028, false, false, 0.0F, true, true, 0, 50.0D, CreationCategories.FIRE);\n/* */ \n/* 2678 */ smelter.addRequirement(new CreationRequirement(1, 132, 48, true));\n/* 2679 */ smelter.addRequirement(new CreationRequirement(2, 130, 50, true));\n/* 2680 */ smelter.addRequirement(new CreationRequirement(3, 298, 5, true));\n/* */ \n/* 2682 */ AdvancedCreationEntry simpleDioptra = createAdvancedEntry(10015, 902, 904, 903, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2684 */ simpleDioptra.addRequirement(new CreationRequirement(1, 480, 1, true));\n/* 2685 */ simpleDioptra.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* */ \n/* 2687 */ AdvancedCreationEntry rangePole = createAdvancedEntry(1005, 711, 213, 901, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 2689 */ rangePole.addRequirement(new CreationRequirement(1, 213, 3, true));\n/* 2690 */ rangePole.addRequirement(new CreationRequirement(2, 439, 8, true));\n/* */ \n/* 2692 */ AdvancedCreationEntry pewpewdie = createAdvancedEntry(10044, 217, 22, 934, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.WARMACHINES);\n/* */ \n/* */ \n/* 2695 */ pewpewdie.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2696 */ pewpewdie.addRequirement(new CreationRequirement(2, 9, 1, true));\n/* 2697 */ pewpewdie.addRequirement(new CreationRequirement(3, 859, 3, true));\n/* 2698 */ pewpewdie.addRequirement(new CreationRequirement(4, 188, 2, true));\n/* */ \n/* 2700 */ AdvancedCreationEntry siegeShield = createAdvancedEntry(1005, 217, 22, 931, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.WARMACHINES);\n/* */ \n/* */ \n/* 2703 */ siegeShield.addRequirement(new CreationRequirement(1, 22, 20, true));\n/* 2704 */ siegeShield.addRequirement(new CreationRequirement(2, 9, 2, true));\n/* */ \n/* 2706 */ AdvancedCreationEntry ballistaMount = createAdvancedEntry(10044, 217, 9, 933, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.WARMACHINES);\n/* */ \n/* */ \n/* 2709 */ ballistaMount.addRequirement(new CreationRequirement(1, 22, 8, true));\n/* */ \n/* 2711 */ AdvancedCreationEntry barrier = createAdvancedEntry(1005, 217, 9, 938, false, false, 0.0F, true, true, 0, 5.0D, CreationCategories.WARMACHINES);\n/* */ \n/* */ \n/* 2714 */ barrier.addRequirement(new CreationRequirement(1, 23, 21, true));\n/* */ \n/* 2716 */ createSimpleEntry(1032, 935, 23, 932, true, true, 0.0F, false, false, CreationCategories.FLETCHING);\n/* */ \n/* 2718 */ if (Features.Feature.METALLIC_ITEMS.isEnabled()) {\n/* */ \n/* 2720 */ createMetallicEntries(10011, 64, 698, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2722 */ createMetallicEntries(10015, 185, 205, 1115, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 2727 */ createSimpleEntry(10011, 64, 698, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2729 */ createSimpleEntry(10011, 64, 694, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2731 */ createSimpleEntry(10011, 64, 837, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2733 */ createSimpleEntry(10011, 64, 205, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2735 */ createSimpleEntry(10011, 64, 47, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2737 */ createSimpleEntry(10011, 64, 45, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2739 */ createSimpleEntry(10011, 64, 44, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2741 */ createSimpleEntry(10011, 64, 223, 935, false, true, 10.0F, false, false, CreationCategories.WEAPON_HEADS);\n/* */ \n/* 2743 */ createSimpleEntry(10015, 185, 205, 1115, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ } \n/* */ \n/* */ \n/* 2747 */ AdvancedCreationEntry ballista = createAdvancedEntry(10044, 933, 22, 936, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.WARMACHINES);\n/* */ \n/* 2749 */ ballista.addRequirement(new CreationRequirement(1, 559, 4, true));\n/* 2750 */ ballista.addRequirement(new CreationRequirement(2, 897, 2, true));\n/* 2751 */ ballista.addRequirement(new CreationRequirement(3, 22, 4, true));\n/* 2752 */ ballista.addRequirement(new CreationRequirement(4, 218, 1, true));\n/* 2753 */ ballista.addRequirement(new CreationRequirement(5, 23, 1, true));\n/* */ \n/* 2755 */ AdvancedCreationEntry trebuchet = createAdvancedEntry(10044, 9, 9, 937, false, false, 0.0F, true, true, 0, 80.0D, CreationCategories.WARMACHINES);\n/* */ \n/* 2757 */ trebuchet.addRequirement(new CreationRequirement(1, 9, 20, true));\n/* 2758 */ trebuchet.addRequirement(new CreationRequirement(2, 319, 5, true));\n/* 2759 */ trebuchet.addRequirement(new CreationRequirement(3, 191, 2, true));\n/* 2760 */ trebuchet.addRequirement(new CreationRequirement(4, 22, 40, true));\n/* */ \n/* 2762 */ AdvancedCreationEntry archeryTower = createAdvancedEntry(10044, 217, 22, 939, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.WARMACHINES);\n/* */ \n/* */ \n/* 2765 */ archeryTower.addRequirement(new CreationRequirement(1, 22, 200, true));\n/* 2766 */ archeryTower.addRequirement(new CreationRequirement(2, 9, 20, true));\n/* 2767 */ archeryTower.addRequirement(new CreationRequirement(3, 860, 20, true));\n/* 2768 */ archeryTower.addRequirement(new CreationRequirement(4, 217, 6, true));\n/* */ \n/* 2770 */ AdvancedCreationEntry spinningWheel = createAdvancedEntry(10044, 187, 23, 922, false, false, 0.0F, true, true, 0, 30.0D, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 2773 */ spinningWheel.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 2774 */ spinningWheel.addRequirement(new CreationRequirement(2, 22, 3, true));\n/* 2775 */ spinningWheel.addRequirement(new CreationRequirement(3, 218, 2, true));\n/* 2776 */ spinningWheel.addRequirement(new CreationRequirement(4, 153, 2, true));\n/* */ \n/* 2778 */ AdvancedCreationEntry loungeChair = createAdvancedEntry(10044, 22, 23, 923, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2781 */ loungeChair.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 2782 */ loungeChair.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* 2783 */ loungeChair.addRequirement(new CreationRequirement(3, 218, 2, true));\n/* 2784 */ loungeChair.addRequirement(new CreationRequirement(4, 153, 4, true));\n/* */ \n/* 2786 */ AdvancedCreationEntry royalLoungeChaise = createAdvancedEntry(10044, 22, 23, 924, false, false, 0.0F, true, true, 0, 70.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2789 */ royalLoungeChaise.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2790 */ royalLoungeChaise.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 2791 */ royalLoungeChaise.addRequirement(new CreationRequirement(3, 218, 6, true));\n/* 2792 */ royalLoungeChaise.addRequirement(new CreationRequirement(4, 926, 10, true));\n/* 2793 */ royalLoungeChaise.addRequirement(new CreationRequirement(5, 925, 4, true));\n/* */ \n/* 2795 */ AdvancedCreationEntry woodCupboard = createAdvancedEntry(10044, 218, 22, 927, false, false, 0.0F, true, true, 0, 40.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2798 */ woodCupboard.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* 2799 */ woodCupboard.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* 2800 */ woodCupboard.addRequirement(new CreationRequirement(3, 23, 2, true));\n/* 2801 */ woodCupboard.addRequirement(new CreationRequirement(4, 153, 2, true));\n/* */ \n/* 2803 */ AdvancedCreationEntry alchemyCupboard = createAdvancedEntry(10044, 218, 22, 1117, false, false, 0.0F, true, true, 0, 20.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2806 */ alchemyCupboard.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 2807 */ alchemyCupboard.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* 2808 */ alchemyCupboard.addRequirement(new CreationRequirement(3, 23, 2, true));\n/* 2809 */ alchemyCupboard.addRequirement(new CreationRequirement(4, 1254, 5, true));\n/* 2810 */ alchemyCupboard.addRequirement(new CreationRequirement(5, 76, 10, true));\n/* */ \n/* 2812 */ AdvancedCreationEntry storageUnit = createAdvancedEntry(1005, 217, 22, 1119, false, false, 0.0F, true, true, 0, 30.0D, CreationCategories.STORAGE);\n/* */ \n/* */ \n/* 2815 */ storageUnit.addRequirement(new CreationRequirement(1, 22, 14, true));\n/* 2816 */ storageUnit.addRequirement(new CreationRequirement(2, 217, 3, true));\n/* 2817 */ storageUnit.addRequirement(new CreationRequirement(3, 188, 4, true));\n/* 2818 */ storageUnit.addRequirement(new CreationRequirement(4, 561, 10, true));\n/* 2819 */ storageUnit.addRequirement(new CreationRequirement(5, 289, 3, true));\n/* */ \n/* 2821 */ AdvancedCreationEntry roundMarbleTable = createAdvancedEntry(10074, 787, 130, 928, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2824 */ roundMarbleTable.addRequirement(new CreationRequirement(1, 787, 1, true));\n/* 2825 */ roundMarbleTable.addRequirement(new CreationRequirement(2, 130, 3, true));\n/* */ \n/* 2827 */ AdvancedCreationEntry rectagularMarbleTable = createAdvancedEntry(10074, 787, 130, 929, false, false, 0.0F, true, true, 0, 50.0D, CreationCategories.FURNITURE);\n/* */ \n/* */ \n/* 2830 */ rectagularMarbleTable.addRequirement(new CreationRequirement(1, 787, 1, true));\n/* 2831 */ rectagularMarbleTable.addRequirement(new CreationRequirement(2, 130, 4, true));\n/* */ \n/* 2833 */ AdvancedCreationEntry yellowWoolCap = createAdvancedEntry(10016, 128, 943, 944, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2836 */ yellowWoolCap.setUseTemplateWeight(true);\n/* 2837 */ yellowWoolCap.setColouringCreation(true);\n/* 2838 */ yellowWoolCap.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* 2839 */ yellowWoolCap.addRequirement(new CreationRequirement(2, 128, 1, true));\n/* 2840 */ yellowWoolCap.addRequirement(new CreationRequirement(3, 439, 3, true));\n/* */ \n/* 2842 */ AdvancedCreationEntry greenWoolCap = createAdvancedEntry(10016, 128, 943, 945, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2845 */ greenWoolCap.setUseTemplateWeight(true);\n/* 2846 */ greenWoolCap.setColouringCreation(true);\n/* 2847 */ greenWoolCap.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* */ \n/* 2849 */ AdvancedCreationEntry redWoolCap = createAdvancedEntry(10016, 128, 943, 946, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2852 */ redWoolCap.setUseTemplateWeight(true);\n/* 2853 */ redWoolCap.setColouringCreation(true);\n/* 2854 */ redWoolCap.addRequirement(new CreationRequirement(1, 439, 2, true));\n/* */ \n/* 2856 */ AdvancedCreationEntry blueWoolCap = createAdvancedEntry(10016, 128, 943, 947, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2859 */ blueWoolCap.setUseTemplateWeight(true);\n/* 2860 */ blueWoolCap.setColouringCreation(true);\n/* 2861 */ blueWoolCap.addRequirement(new CreationRequirement(1, 440, 2, true));\n/* */ \n/* 2863 */ AdvancedCreationEntry NIcoomonWoolHat = createAdvancedEntry(10016, 215, 926, 948, true, false, 5.0F, false, false, 0, 5.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2866 */ NIcoomonWoolHat.depleteSource = false;\n/* 2867 */ NIcoomonWoolHat.setDepleteFromTarget(200);\n/* 2868 */ NIcoomonWoolHat.addRequirement(new CreationRequirement(1, 925, 1, true));\n/* */ \n/* 2870 */ AdvancedCreationEntry CIcoomonWoolHat = createAdvancedEntry(10016, 216, 926, 948, true, false, 5.0F, false, false, 0, 5.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2873 */ CIcoomonWoolHat.depleteSource = false;\n/* 2874 */ CIcoomonWoolHat.setDepleteFromTarget(200);\n/* 2875 */ CIcoomonWoolHat.addRequirement(new CreationRequirement(1, 925, 1, true));\n/* */ \n/* 2877 */ AdvancedCreationEntry coomonWoolHatDark = createAdvancedEntry(10016, 128, 948, 949, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2880 */ coomonWoolHatDark.setUseTemplateWeight(true);\n/* 2881 */ coomonWoolHatDark.setColouringCreation(true);\n/* 2882 */ coomonWoolHatDark.addRequirement(new CreationRequirement(1, 46, 1, true));\n/* 2883 */ coomonWoolHatDark.addRequirement(new CreationRequirement(2, 437, 1, true));\n/* */ \n/* 2885 */ AdvancedCreationEntry coomonWoolHatBrown = createAdvancedEntry(10016, 128, 948, 950, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2888 */ coomonWoolHatBrown.setUseTemplateWeight(true);\n/* 2889 */ coomonWoolHatBrown.setColouringCreation(true);\n/* 2890 */ coomonWoolHatBrown.addRequirement(new CreationRequirement(1, 439, 3, true));\n/* 2891 */ coomonWoolHatBrown.addRequirement(new CreationRequirement(2, 47, 2, true));\n/* 2892 */ coomonWoolHatBrown.addRequirement(new CreationRequirement(3, 440, 1, true));\n/* 2893 */ coomonWoolHatBrown.addRequirement(new CreationRequirement(4, 128, 2, true));\n/* */ \n/* 2895 */ AdvancedCreationEntry coomonWoolHatGreen = createAdvancedEntry(10016, 128, 948, 951, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2898 */ coomonWoolHatGreen.setUseTemplateWeight(true);\n/* 2899 */ coomonWoolHatGreen.setColouringCreation(true);\n/* 2900 */ coomonWoolHatGreen.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* 2901 */ coomonWoolHatGreen.addRequirement(new CreationRequirement(2, 128, 1, true));\n/* */ \n/* 2903 */ AdvancedCreationEntry coomonWoolHatRed = createAdvancedEntry(10016, 128, 948, 952, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2906 */ coomonWoolHatRed.setUseTemplateWeight(true);\n/* 2907 */ coomonWoolHatRed.setColouringCreation(true);\n/* 2908 */ coomonWoolHatRed.addRequirement(new CreationRequirement(1, 439, 2, true));\n/* 2909 */ coomonWoolHatRed.addRequirement(new CreationRequirement(2, 128, 2, true));\n/* */ \n/* 2911 */ AdvancedCreationEntry coomonWoolHatBlue = createAdvancedEntry(10016, 128, 948, 953, true, false, 0.0F, true, false, 0, 20.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2914 */ coomonWoolHatBlue.setUseTemplateWeight(true);\n/* 2915 */ coomonWoolHatBlue.setColouringCreation(true);\n/* 2916 */ coomonWoolHatBlue.addRequirement(new CreationRequirement(1, 440, 2, true));\n/* 2917 */ coomonWoolHatBlue.addRequirement(new CreationRequirement(2, 128, 2, true));\n/* */ \n/* 2919 */ AdvancedCreationEntry foresterWoolHatGreen = createAdvancedEntry(10016, 128, 954, 955, true, false, 0.0F, true, false, 0, 10.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2922 */ foresterWoolHatGreen.setUseTemplateWeight(true);\n/* 2923 */ foresterWoolHatGreen.setColouringCreation(true);\n/* 2924 */ foresterWoolHatGreen.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* */ \n/* 2926 */ AdvancedCreationEntry foresterWoolHatDark = createAdvancedEntry(10016, 128, 954, 956, true, false, 0.0F, true, false, 0, 10.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2929 */ foresterWoolHatDark.setUseTemplateWeight(true);\n/* 2930 */ foresterWoolHatDark.setColouringCreation(true);\n/* 2931 */ foresterWoolHatDark.addRequirement(new CreationRequirement(1, 46, 1, true));\n/* 2932 */ foresterWoolHatDark.addRequirement(new CreationRequirement(2, 437, 1, true));\n/* */ \n/* 2934 */ AdvancedCreationEntry foresterWoolHatBlue = createAdvancedEntry(10016, 128, 954, 957, true, false, 0.0F, true, false, 0, 10.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2937 */ foresterWoolHatBlue.setUseTemplateWeight(true);\n/* 2938 */ foresterWoolHatBlue.setColouringCreation(true);\n/* 2939 */ foresterWoolHatBlue.addRequirement(new CreationRequirement(1, 440, 2, true));\n/* */ \n/* 2941 */ AdvancedCreationEntry foresterWoolHatRed = createAdvancedEntry(10016, 128, 954, 958, true, false, 0.0F, true, false, 0, 10.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2944 */ foresterWoolHatRed.setUseTemplateWeight(true);\n/* 2945 */ foresterWoolHatRed.setColouringCreation(true);\n/* 2946 */ foresterWoolHatRed.addRequirement(new CreationRequirement(1, 439, 2, true));\n/* */ \n/* 2948 */ AdvancedCreationEntry squireWoolCapGreen = createAdvancedEntry(10016, 128, 961, 962, true, false, 0.0F, true, false, 0, 25.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2951 */ squireWoolCapGreen.setUseTemplateWeight(true);\n/* 2952 */ squireWoolCapGreen.setColouringCreation(true);\n/* 2953 */ squireWoolCapGreen.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* */ \n/* 2955 */ AdvancedCreationEntry squireWoolCapBlue = createAdvancedEntry(10016, 128, 961, 963, true, false, 0.0F, true, false, 0, 25.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2958 */ squireWoolCapBlue.setUseTemplateWeight(true);\n/* 2959 */ squireWoolCapBlue.setColouringCreation(true);\n/* 2960 */ squireWoolCapBlue.addRequirement(new CreationRequirement(1, 440, 2, true));\n/* */ \n/* 2962 */ AdvancedCreationEntry squireWoolCapBlack = createAdvancedEntry(10016, 128, 961, 964, true, false, 0.0F, true, false, 0, 25.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2965 */ squireWoolCapBlack.setUseTemplateWeight(true);\n/* 2966 */ squireWoolCapBlack.setColouringCreation(true);\n/* 2967 */ squireWoolCapBlack.addRequirement(new CreationRequirement(1, 46, 1, true));\n/* 2968 */ squireWoolCapBlack.addRequirement(new CreationRequirement(2, 437, 1, true));\n/* */ \n/* 2970 */ AdvancedCreationEntry squireWoolCapRed = createAdvancedEntry(10016, 128, 961, 965, true, false, 0.0F, true, false, 0, 25.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2973 */ squireWoolCapRed.setUseTemplateWeight(true);\n/* 2974 */ squireWoolCapRed.setColouringCreation(true);\n/* 2975 */ squireWoolCapRed.addRequirement(new CreationRequirement(1, 439, 2, true));\n/* */ \n/* 2977 */ AdvancedCreationEntry squireWoolCapYellow = createAdvancedEntry(10016, 128, 961, 966, true, false, 0.0F, true, false, 0, 25.0D, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 2980 */ squireWoolCapYellow.setUseTemplateWeight(true);\n/* 2981 */ squireWoolCapYellow.setColouringCreation(true);\n/* 2982 */ squireWoolCapYellow.addRequirement(new CreationRequirement(1, 47, 1, true));\n/* 2983 */ squireWoolCapYellow.addRequirement(new CreationRequirement(2, 128, 1, true));\n/* 2984 */ squireWoolCapYellow.addRequirement(new CreationRequirement(3, 439, 2, true));\n/* */ \n/* 2986 */ AdvancedCreationEntry grapeTrellis = createAdvancedEntry(10045, 918, 23, 920, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 2989 */ grapeTrellis.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 2990 */ grapeTrellis.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 2992 */ AdvancedCreationEntry grapeTrellis1 = createAdvancedEntry(10045, 266, 23, 920, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 2995 */ grapeTrellis1.setObjectSourceMaterial((byte)49);\n/* 2996 */ grapeTrellis1.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 2997 */ grapeTrellis1.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 2999 */ AdvancedCreationEntry ivyTrellis = createAdvancedEntry(10045, 917, 23, 919, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3002 */ ivyTrellis.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 3003 */ ivyTrellis.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 3005 */ AdvancedCreationEntry roseTrellis = createAdvancedEntry(10045, 1017, 23, 1018, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3008 */ roseTrellis.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 3009 */ roseTrellis.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 3011 */ AdvancedCreationEntry roseTrellis1 = createAdvancedEntry(10045, 266, 23, 1018, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3014 */ roseTrellis1.setObjectSourceMaterial((byte)47);\n/* 3015 */ roseTrellis1.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 3016 */ roseTrellis1.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 3018 */ AdvancedCreationEntry hopsTrellis = createAdvancedEntry(10045, 1275, 23, 1274, false, false, 0.0F, true, true, 0, 10.0D, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3021 */ hopsTrellis.addRequirement(new CreationRequirement(1, 23, 5, true));\n/* 3022 */ hopsTrellis.addRequirement(new CreationRequirement(2, 218, 1, true));\n/* */ \n/* 3024 */ AdvancedCreationEntry tapestryStand = createAdvancedEntry(10044, 22, 23, 987, false, false, 0.0F, true, true, CreationCategories.RESOURCES);\n/* */ \n/* 3026 */ tapestryStand.addRequirement(new CreationRequirement(1, 23, 3, true));\n/* 3027 */ tapestryStand.addRequirement(new CreationRequirement(2, 218, 2, true));\n/* */ \n/* 3029 */ AdvancedCreationEntry tapestryP1 = createAdvancedEntry(10016, 926, 987, 988, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 3031 */ tapestryP1.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3032 */ tapestryP1.addRequirement(new CreationRequirement(2, 925, 2, true));\n/* */ \n/* 3034 */ AdvancedCreationEntry tapestryP2 = createAdvancedEntry(10016, 926, 987, 989, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 3036 */ tapestryP2.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3037 */ tapestryP2.addRequirement(new CreationRequirement(2, 925, 2, true));\n/* */ \n/* 3039 */ AdvancedCreationEntry tapestryP3 = createAdvancedEntry(10016, 926, 987, 990, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 3041 */ tapestryP3.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3042 */ tapestryP3.addRequirement(new CreationRequirement(2, 925, 2, true));\n/* */ \n/* 3044 */ AdvancedCreationEntry tapestryM1 = createAdvancedEntry(10016, 926, 987, 991, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 3046 */ tapestryM1.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3047 */ tapestryM1.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* 3049 */ AdvancedCreationEntry tapestryM2 = createAdvancedEntry(10016, 926, 987, 992, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3052 */ tapestryM2.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3053 */ tapestryM2.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* 3055 */ AdvancedCreationEntry tapestryM3 = createAdvancedEntry(10016, 926, 987, 993, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3058 */ tapestryM3.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3059 */ tapestryM3.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* 3061 */ AdvancedCreationEntry tapestryFaeldray = createAdvancedEntry(10016, 926, 987, 994, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3064 */ tapestryFaeldray.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3065 */ tapestryFaeldray.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* */ \n/* 3068 */ AdvancedCreationEntry swordDisplay = createAdvancedEntry(10044, 987, 21, 1030, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3071 */ swordDisplay.addRequirement(new CreationRequirement(1, 21, 1, true));\n/* 3072 */ swordDisplay.addRequirement(new CreationRequirement(2, 86, 1, true));\n/* */ \n/* 3074 */ AdvancedCreationEntry axeDisplay = createAdvancedEntry(10044, 987, 90, 1031, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3077 */ axeDisplay.addRequirement(new CreationRequirement(1, 90, 1, true));\n/* 3078 */ axeDisplay.addRequirement(new CreationRequirement(2, 86, 1, true));\n/* */ \n/* 3080 */ AdvancedCreationEntry marblePlanter = createAdvancedEntry(10074, 786, 786, 1001, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3083 */ marblePlanter.addRequirement(new CreationRequirement(1, 786, 4, true));\n/* */ \n/* 3085 */ AdvancedCreationEntry bunchOfRopes = createAdvancedEntry(1014, 319, 319, 1029, false, false, 0.0F, true, false, CreationCategories.ROPES);\n/* */ \n/* 3087 */ bunchOfRopes.addRequirement(new CreationRequirement(1, 319, 2, true));\n/* */ \n/* 3089 */ createSimpleEntry(10016, 216, 926, 1071, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 3091 */ createSimpleEntry(10016, 215, 926, 1071, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 3093 */ createSimpleEntry(10016, 216, 213, 1107, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 3095 */ createSimpleEntry(10016, 215, 213, 1107, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 3097 */ createSimpleEntry(10016, 216, 213, 1106, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* 3099 */ createSimpleEntry(10016, 215, 213, 1106, false, true, 0.0F, false, false, CreationCategories.CLOTHES);\n/* */ \n/* */ \n/* 3102 */ createNewClothing(1067, 110, 128, new int[] { 47, 439, 102 });\n/* 3103 */ createNewClothing(1068, 110, 128, new int[] { 46, 437, 102 });\n/* 3104 */ createNewClothing(1069, 110, 128, new int[] { 439, 100, 102 });\n/* 3105 */ createNewClothing(1070, 1107, 128, new int[] { 439, 47, 440 });\n/* 3106 */ createNewClothing(1072, 1107, 128, new int[] { 46, 437 });\n/* 3107 */ createNewClothing(1073, 1107, 128, new int[] { 47 });\n/* 3108 */ createNewClothing(1074, 1106, 128, new int[] { 47, 439, 100 });\n/* 3109 */ createNewClothing(1105, 1106, 128, new int[] { 46, 437, 100 });\n/* 3110 */ createNewClothing(1075, 1106, 128, new int[] { 439, 100 });\n/* 3111 */ createNewClothing(779, 1425, 128, new int[] { 440 });\n/* 3112 */ createNewClothing(111, 1426, 128, new int[] { 439 });\n/* 3113 */ createNewClothing(112, 1427, 128, new int[] { 439 });\n/* */ \n/* */ \n/* 3116 */ AdvancedCreationEntry beeSmoker = createAdvancedEntry(10015, 188, 46, 1243, false, false, 0.0F, true, false, 0, 30.0D, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* */ \n/* 3120 */ beeSmoker.addRequirement(new CreationRequirement(1, 188, 1, true));\n/* 3121 */ beeSmoker.addRequirement(new CreationRequirement(2, 72, 1, true));\n/* */ \n/* 3123 */ AdvancedCreationEntry hive = createAdvancedEntry(10044, 23, 22, 1175, false, false, 0.0F, true, true, 0, 25.0D, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3126 */ hive.addRequirement(new CreationRequirement(1, 22, 10, true));\n/* 3127 */ hive.addRequirement(new CreationRequirement(2, 23, 3, true));\n/* 3128 */ hive.addRequirement(new CreationRequirement(3, 218, 1, true));\n/* */ \n/* 3130 */ AdvancedCreationEntry waxkit = createAdvancedEntry(10091, 213, 1254, 1255, false, false, 0.0F, true, false, 0, 21.0D, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ \n/* 3133 */ waxkit.addRequirement(new CreationRequirement(1, 1269, 1, true));\n/* 3134 */ waxkit.addRequirement(new CreationRequirement(2, 214, 1, true));\n/* */ \n/* 3136 */ AdvancedCreationEntry skullMug = createAdvancedEntry(1012, 390, 1250, 1253, false, true, 0.0F, false, false, 0, 25.0D, CreationCategories.COOKING_UTENSILS);\n/* */ \n/* */ \n/* 3139 */ skullMug.addRequirement(new CreationRequirement(1, 444, 2, true));\n/* 3140 */ skullMug.addRequirement(new CreationRequirement(2, 1254, 2, true));\n/* 3141 */ skullMug.setIsEpicBuildMissionTarget(false);\n/* */ \n/* 3143 */ AdvancedCreationEntry messageBoard = createAdvancedEntry(1005, 23, 22, 1271, false, false, 0.0F, true, true, CreationCategories.SIGNS);\n/* */ \n/* 3145 */ messageBoard.addRequirement(new CreationRequirement(1, 22, 5, true));\n/* 3146 */ messageBoard.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* 3147 */ messageBoard.addRequirement(new CreationRequirement(3, 218, 3, true));\n/* */ \n/* 3149 */ AdvancedCreationEntry still = createAdvancedEntry(10015, 772, 772, 1178, false, false, 0.0F, true, true, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3152 */ still.addRequirement(new CreationRequirement(1, 772, 5, true));\n/* 3153 */ still.addRequirement(new CreationRequirement(2, 131, 25, true));\n/* 3154 */ still.addRequirement(new CreationRequirement(3, 22, 1, true));\n/* 3155 */ still.addRequirement(new CreationRequirement(4, 188, 2, true));\n/* */ \n/* 3157 */ AdvancedCreationEntry larder = createAdvancedEntry(10044, 22, 23, 1277, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* 3159 */ larder.addRequirement(new CreationRequirement(1, 22, 19, true));\n/* 3160 */ larder.addRequirement(new CreationRequirement(2, 218, 3, true));\n/* 3161 */ larder.addRequirement(new CreationRequirement(3, 49, 5, true));\n/* 3162 */ larder.addRequirement(new CreationRequirement(4, 188, 2, true));\n/* 3163 */ larder.addRequirement(new CreationRequirement(5, 23, 3, true));\n/* */ \n/* 3165 */ createAdvancedEntry(10015, 1298, 1299, 1296, false, false, 0.0F, true, false, CreationCategories.CONTAINER)\n/* */ \n/* 3167 */ .addRequirement(new CreationRequirement(1, 76, 1, true))\n/* 3168 */ .addRequirement(new CreationRequirement(2, 131, 6, true))\n/* 3169 */ .addRequirement(new CreationRequirement(3, 444, 1, true))\n/* 3170 */ .addRequirement(new CreationRequirement(4, 100, 2, true))\n/* 3171 */ .addRequirement(new CreationRequirement(5, 1298, 2, true));\n/* */ \n/* 3173 */ AdvancedCreationEntry weaponsRackS = createAdvancedEntry(10044, 218, 22, 724, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 3175 */ weaponsRackS.addRequirement(new CreationRequirement(1, 561, 7, true));\n/* 3176 */ weaponsRackS.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* */ \n/* 3178 */ AdvancedCreationEntry weaponsRackP = createAdvancedEntry(10044, 218, 22, 725, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 3180 */ weaponsRackP.addRequirement(new CreationRequirement(1, 561, 7, true));\n/* 3181 */ weaponsRackP.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* */ \n/* 3183 */ AdvancedCreationEntry armourStand = createAdvancedEntry(10044, 218, 22, 759, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 3185 */ armourStand.addRequirement(new CreationRequirement(1, 561, 7, true));\n/* 3186 */ armourStand.addRequirement(new CreationRequirement(2, 22, 12, true));\n/* 3187 */ armourStand.addRequirement(new CreationRequirement(3, 23, 6, true));\n/* */ \n/* 3189 */ AdvancedCreationEntry weaponsRackB = createAdvancedEntry(10044, 218, 22, 758, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 3191 */ weaponsRackB.addRequirement(new CreationRequirement(1, 561, 7, true));\n/* 3192 */ weaponsRackB.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* */ \n/* 3194 */ AdvancedCreationEntry thatchingTool = createAdvancedEntry(10044, 217, 22, 774, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 3196 */ thatchingTool.addRequirement(new CreationRequirement(1, 217, 6, true));\n/* 3197 */ thatchingTool.addRequirement(new CreationRequirement(2, 23, 1, true));\n/* */ \n/* 3199 */ AdvancedCreationEntry wineBarrelRack = createAdvancedEntry(1005, 217, 860, 1108, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* */ \n/* 3202 */ wineBarrelRack.addRequirement(new CreationRequirement(1, 860, 1, true));\n/* */ \n/* 3204 */ AdvancedCreationEntry smallBarrelRack = createAdvancedEntry(1005, 217, 860, 1109, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* */ \n/* 3207 */ smallBarrelRack.addRequirement(new CreationRequirement(1, 860, 1, true));\n/* */ \n/* 3209 */ AdvancedCreationEntry planterRack = createAdvancedEntry(1005, 217, 860, 1110, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* */ \n/* 3212 */ planterRack.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 3214 */ AdvancedCreationEntry amphoraRack = createAdvancedEntry(1005, 217, 860, 1111, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* */ \n/* 3217 */ amphoraRack.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 3219 */ AdvancedCreationEntry emptyShelf = createAdvancedEntry(1005, 217, 860, 1412, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3222 */ emptyShelf.addRequirement(new CreationRequirement(1, 22, 4, true));\n/* */ \n/* 3224 */ createSimpleEntry(10091, 394, 748, 1269, false, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* */ \n/* 3227 */ createSimpleEntry(10091, 394, 1272, 1269, false, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* */ \n/* */ \n/* 3231 */ if (Features.Feature.HIGHWAYS.isEnabled()) {\n/* */ \n/* 3233 */ createSimpleEntry(10031, 97, 146, 1113, false, true, 10.0F, false, false, CreationCategories.HIGHWAY);\n/* */ \n/* 3235 */ createSimpleEntry(10031, 308, 1113, 1114, true, true, 0.0F, false, false, CreationCategories.HIGHWAY);\n/* */ \n/* */ \n/* 3238 */ AdvancedCreationEntry waystone = createAdvancedEntry(10031, 97, 146, 1112, false, false, 10.0F, false, false, 0, 21.0D, CreationCategories.HIGHWAY);\n/* */ \n/* 3240 */ waystone.setDepleteFromTarget(5000);\n/* 3241 */ waystone.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 3242 */ waystone.addRequirement(new CreationRequirement(2, 480, 1, true));\n/* */ } \n/* */ \n/* 3245 */ createSimpleEntry(10091, 748, 214, 1409, true, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* 3247 */ createSimpleEntry(10091, 1272, 214, 1409, true, true, 0.0F, false, false, CreationCategories.WRITING);\n/* */ \n/* */ \n/* 3250 */ AdvancedCreationEntry archJournal = createAdvancedEntry(10017, 1409, 100, 1404, false, false, 0.0F, true, false, CreationCategories.WRITING);\n/* */ \n/* 3252 */ archJournal.addRequirement(new CreationRequirement(1, 100, 2, true));\n/* 3253 */ AdvancedCreationEntry almanac = createAdvancedEntry(10017, 1409, 100, 1127, false, false, 0.0F, true, false, CreationCategories.WRITING);\n/* */ \n/* 3255 */ almanac.addRequirement(new CreationRequirement(1, 100, 2, true));\n/* */ \n/* 3257 */ if (Features.Feature.WAGONER.isEnabled()) {\n/* */ \n/* 3259 */ AdvancedCreationEntry wagonerContainer = createAdvancedEntry(1005, 217, 860, 1309, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* 3261 */ wagonerContainer.addRequirement(new CreationRequirement(1, 860, 1, true));\n/* */ } \n/* */ \n/* 3264 */ AdvancedCreationEntry crateRack = createAdvancedEntry(1005, 217, 860, 1312, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* 3266 */ crateRack.addRequirement(new CreationRequirement(1, 860, 1, true));\n/* 3267 */ crateRack.addRequirement(new CreationRequirement(2, 22, 6, true));\n/* */ \n/* 3269 */ AdvancedCreationEntry bsbRack = createAdvancedEntry(1005, 217, 860, 1315, false, false, 0.0F, true, true, CreationCategories.CONTAINER);\n/* */ \n/* 3271 */ bsbRack.addRequirement(new CreationRequirement(1, 860, 1, true));\n/* 3272 */ bsbRack.addRequirement(new CreationRequirement(2, 22, 6, true));\n/* */ \n/* 3274 */ AdvancedCreationEntry bcu = createAdvancedEntry(10044, 217, 860, 1316, false, false, 0.0F, true, true, 35, 50.0D, CreationCategories.CONTAINER);\n/* */ \n/* 3276 */ bcu.addRequirement(new CreationRequirement(1, 860, 2, true));\n/* 3277 */ bcu.addRequirement(new CreationRequirement(2, 22, 6, true));\n/* 3278 */ bcu.addRequirement(new CreationRequirement(3, 662, 4, true));\n/* */ \n/* */ \n/* 3281 */ if (Features.Feature.TRANSPORTABLE_CREATURES.isEnabled()) {\n/* */ \n/* 3283 */ AdvancedCreationEntry creatureCrate = createAdvancedEntry(1005, 22, 217, 1311, false, false, 0.0F, true, true, 0, 60.0D, CreationCategories.STORAGE);\n/* */ \n/* 3285 */ creatureCrate.addRequirement(new CreationRequirement(1, 22, 24, true));\n/* 3286 */ creatureCrate.addRequirement(new CreationRequirement(2, 681, 6, true));\n/* 3287 */ creatureCrate.addRequirement(new CreationRequirement(3, 217, 16, true));\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 3292 */ AdvancedCreationEntry tapestryEvening = createAdvancedEntry(10016, 926, 987, 1318, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3295 */ tapestryEvening.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3296 */ tapestryEvening.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* 3298 */ AdvancedCreationEntry tapestryMclavin = createAdvancedEntry(10016, 926, 987, 1319, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3301 */ tapestryMclavin.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3302 */ tapestryMclavin.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* 3304 */ AdvancedCreationEntry tapestryEhizellbob = createAdvancedEntry(10016, 926, 987, 1320, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* */ \n/* 3307 */ tapestryEhizellbob.addRequirement(new CreationRequirement(1, 926, 7, true));\n/* 3308 */ tapestryEhizellbob.addRequirement(new CreationRequirement(2, 925, 6, true));\n/* */ \n/* */ \n/* 3311 */ createAdvancedMetalicEntry(10015, 64, 220, 1341, false, true, 0.0F, false, false, CreationCategories.TOOLS, new CreationRequirement[] { new CreationRequirement(1, 790, 3, true), new CreationRequirement(2, 100, 1, true) });\n/* */ \n/* */ \n/* */ \n/* */ \n/* 3316 */ AdvancedCreationEntry keepNet = createAdvancedEntry(1014, 188, 319, 1342, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* 3318 */ keepNet.addRequirement(new CreationRequirement(1, 188, 1, true));\n/* 3319 */ keepNet.addRequirement(new CreationRequirement(2, 214, 2, true));\n/* 3320 */ keepNet.addRequirement(new CreationRequirement(3, 23, 2, true));\n/* */ \n/* 3322 */ AdvancedCreationEntry fishingNet = createAdvancedEntry(10016, 214, 214, 1343, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3325 */ fishingNet.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 3326 */ fishingNet.addRequirement(new CreationRequirement(2, 319, 1, true));\n/* */ \n/* 3328 */ createSimpleEntry(1005, 8, 23, 1344, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3331 */ createSimpleEntry(1005, 685, 23, 1344, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3334 */ createMetallicEntries(10043, 64, 46, 1345, false, true, 0.0F, false, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3337 */ AdvancedCreationEntry fishingRod = createAdvancedEntry(10044, 1344, 23, 1346, false, false, 0.0F, true, false, CreationCategories.TOOLS);\n/* */ \n/* */ \n/* 3340 */ fishingRod.addRequirement(new CreationRequirement(1, 1345, 3, true));\n/* */ \n/* 3342 */ createSimpleEntry(10016, 14, 214, 1347, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3345 */ createSimpleEntry(10016, 922, 1347, 1348, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3348 */ createSimpleEntry(1014, 320, 1348, 1349, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3351 */ createSimpleEntry(10016, 922, 1349, 1350, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3354 */ createSimpleEntry(1014, 320, 1350, 1351, false, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3357 */ createSimpleEntry(1005, 8, 9, 1356, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3360 */ createSimpleEntry(1005, 685, 9, 1356, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3363 */ createMetallicEntries(10015, 64, 46, 1357, false, true, 1000.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3366 */ createSimpleEntry(1020, 8, 1250, 1358, false, true, 900.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3369 */ createSimpleEntry(10044, 8, 23, 1367, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3372 */ createMetallicEntries(10043, 64, 46, 1368, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3375 */ createSimpleEntry(10043, 64, 205, 1369, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3378 */ createSimpleEntry(10043, 64, 837, 1369, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3381 */ createSimpleEntry(10043, 64, 694, 1369, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3384 */ createSimpleEntry(10043, 64, 698, 1369, false, true, 10.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3387 */ createSimpleEntry(10015, 101, 444, 1370, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3390 */ createSimpleEntry(10016, 1370, 213, 1371, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3393 */ createSimpleEntry(10016, 1370, 926, 1371, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3396 */ createSimpleEntry(1005, 99, 1367, 1372, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3399 */ createSimpleEntry(10044, 101, 1367, 1373, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3402 */ createSimpleEntry(10015, 1370, 1368, 1374, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3405 */ createSimpleEntry(10043, 1371, 1369, 1375, true, true, 0.0F, false, false, CreationCategories.TOOL_PARTS);\n/* */ \n/* */ \n/* 3408 */ AdvancedCreationEntry rackRods = createAdvancedEntry(1005, 218, 22, 1393, false, false, 0.0F, true, true, CreationCategories.STORAGE);\n/* */ \n/* 3410 */ rackRods.addRequirement(new CreationRequirement(1, 561, 7, true));\n/* 3411 */ rackRods.addRequirement(new CreationRequirement(2, 22, 9, true));\n/* */ \n/* */ \n/* */ \n/* */ \n/* 3416 */ AdvancedCreationEntry bouy = createAdvancedEntry(1005, 189, 565, 1396, false, false, 0.0F, true, true, CreationCategories.DECORATION);\n/* */ \n/* 3418 */ bouy.addRequirement(new CreationRequirement(1, 23, 1, true));\n/* 3419 */ bouy.addRequirement(new CreationRequirement(2, 497, 1, true));\n/* */ \n/* 3421 */ AdvancedCreationEntry pearlNecklace = createAdvancedEntry(10043, 214, 1397, 1399, false, false, 0.0F, true, false, CreationCategories.DECORATION);\n/* */ \n/* 3423 */ pearlNecklace.addRequirement(new CreationRequirement(1, 1397, 9, true));\n/* 3424 */ pearlNecklace.addRequirement(new CreationRequirement(2, 1398, 1, true));\n/* */ \n/* 3426 */ if (Features.Feature.CHICKEN_COOPS.isEnabled()) {\n/* */ \n/* 3428 */ AdvancedCreationEntry chickenCoop = createAdvancedEntry(10044, 22, 217, 1432, false, false, 0.0F, true, true, 0, 50.0D, CreationCategories.STORAGE);\n/* */ \n/* */ \n/* */ \n/* 3432 */ chickenCoop.addRequirement(new CreationRequirement(1, 217, 4, true));\n/* 3433 */ chickenCoop.addRequirement(new CreationRequirement(2, 22, 24, true));\n/* 3434 */ chickenCoop.addRequirement(new CreationRequirement(3, 23, 8, true));\n/* */ \n/* 3436 */ chickenCoop.addRequirement(new CreationRequirement(4, 189, 1, true));\n/* */ } \n/* */ \n/* 3439 */ logger.info(\"Initialising the CreationEntries took \" + ((float)(System.nanoTime() - start) / 1000000.0F) + \" millis.\");\n/* */ }", "public static int totalSizeBits_entries_id() {\n return 176;\n }", "public void testTwoWayDistribution() {\n for(int p = 0; p < 20; p++) {\n int[] landings = new int[2];\n for(long in = 0; in < 100000; in++) {\n long longHash = FPGenerator.std64.fp(p+\"a\"+in);\n// long longHash = rand.nextLong();\n// long longHash = ArchiveUtils.doubleMurmur((p+\":\"+in).getBytes());\n landings[conhash.bucketFor(longHash, 2)]++;\n }\n// System.out.println(landings[0]+\",\"+landings[1]);\n assertTrue(\"excessive changes\",Math.abs(landings[0]-landings[1]) < 2000); \n }\n }", "short getCopies();", "@SuppressWarnings(\"serial\")\r\n\t@Test\r\n\tpublic void permutationsTestSize3NotAllEquals() throws BoundedQueueException {\r\n\t\tbq.enqueue(1);\r\n\t\tbq.enqueue(2);\r\n\t\tbq.enqueue(3);\r\n\t\tBoundedQueueCorrected<BoundedQueueCorrected<Integer>> output= bq.permutations();\r\n\t\t\r\n\t\t//size of the perm's output\r\n\t\tint expectedPermSize = 6; //fact\r\n\t\tint actualPermSize = output.size();\t\t\r\n\t\tassertEquals(\"Tamanho do resultado final\",expectedPermSize, actualPermSize);\r\n\t\t\r\n\t\t\r\n\t\t//number of elems for each elem of perms\r\n\t\tint expectedPermNumElems = 3; \r\n\t\tint actualPermNumElems = bq.size();\r\n\t\tassertEquals(\"Numero de elementos no elems\",expectedPermNumElems, actualPermNumElems);\r\n\t\t\r\n\t\t//check if there are any duplicated\r\n\t\tArrayList<BoundedQueueCorrected<Integer>> permOutput = output.elems;\r\n\t\tList<Integer> countEquals = new ArrayList<Integer>(6){{\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t}};\r\n\t\t\r\n\t\t\r\n\t\tfor(int i = 0; i < actualPermSize; i++ ){ \r\n\t\t\tfor(int j = 0; j < actualPermSize; j++ ){\r\n\t\t\t\tif(i != j){\r\n\t\t\t\t\tif(permOutput.get(i).toString().equals(permOutput.get(j).toString())){\t\t\r\n\t\t\t\t\t\tcountEquals.set(i, countEquals.get(i)+1); // counts the number of occurrences of an elem from output\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint expectedEqualPerms = 0;\r\n\t\tint actualEqualPerms = 0;\r\n\t\t\r\n\t\tfor(Integer i : countEquals){\r\n\t\t\tif(i > 0)\r\n\t\t\t\tactualEqualPerms++;\r\n\t\t\t//if(i == expectedPermSize -1)\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\tassertEquals(\"Numero de permutacoes iguais\",expectedEqualPerms, actualEqualPerms);\r\n\t}", "long getMaxItemFindings();", "int cardinality();", "public Integer size() { return this.entries.length(); }", "public int size(){return n;}", "@SuppressWarnings(\"serial\")\r\n\t@Test\r\n\tpublic void permutationsTestSize3AllEquals() throws BoundedQueueException {\r\n\t\tbq.enqueue(3);\r\n\t\tbq.enqueue(3);\r\n\t\tbq.enqueue(3);\r\n\t\tBoundedQueueCorrected<BoundedQueueCorrected<Integer>> output= bq.permutations();\r\n\t\t\r\n\t\t//size of the perm's output\r\n\t\tint expectedPermSize = 6; //fact\r\n\t\tint actualPermSize = output.size();\t\t\r\n\t\tassertEquals(\"Tamanho do resultado final\",expectedPermSize, actualPermSize);\r\n\t\t\r\n\t\t\r\n\t\t//number of elems for each elem of perms\r\n\t\tint expectedPermNumElems = 3; \r\n\t\tint actualPermNumElems = bq.size();\r\n\t\tassertEquals(\"Numero de elementos no elems\",expectedPermNumElems, actualPermNumElems);\r\n\t\t\r\n\t\t//check if there are any duplicated\r\n\t\tArrayList<BoundedQueueCorrected<Integer>> permOutput = output.elems;\r\n\t\tList<Integer> countEquals = new ArrayList<Integer>(6){{\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t\tadd(0);\r\n\t\t}};\r\n\t\t\r\n\t\t\r\n\t\tfor(int i = 0; i < actualPermSize; i++ ){ \r\n\t\t\tfor(int j = 0; j < actualPermSize; j++ ){\r\n\t\t\t\tif(i != j){\r\n\t\t\t\t\tif(permOutput.get(i).toString().equals(permOutput.get(j).toString())){\t\t\r\n\t\t\t\t\t\tcountEquals.set(i, countEquals.get(i)+1); // counts the number of occurrences of an elem from output\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint expectedEqualPerms = 0;\r\n\t\tint actualEqualPerms = 0;\r\n\t\t\r\n\t\tfor(Integer i : countEquals){\r\n\t\t\tif(i > 0)\r\n\t\t\t\tactualEqualPerms++;\r\n\t\t\t//if(i == expectedPermSize -1)\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\tassertEquals(\"Numero de permutacoes iguais\",expectedEqualPerms, actualEqualPerms);\r\n\t}", "@Override\n\tpublic int cardinality() {\n\t\treturn 2;\n\t}", "@Override\n\tpublic int size() {\n\t\tint nr = 0;\n\t\tfor (int i = 0; i < nrb; i++) {\n\t\t\t// pentru fiecare bucket numar in lista asociata acestuia numarul de\n\t\t\t// elemente pe care le detine si le insumez\n\t\t\tfor (int j = 0; j < b.get(i).getEntries().size(); j++) {\n\t\t\t\tnr++;\n\t\t\t}\n\t\t}\n\t\treturn nr;// numaru total de elemente\n\t}", "@Override\n protected int getMaxEntries(final PropertyContext context) {\n return 2;\n }", "public static void main(String[] args) {\n Util_BinTreeNode<Integer> root = new Util_BinTreeNode<>();\n root.add(8);\n root.add(4); root.add(16);\n root.add(2); root.add(6); root.add(11); root.add(20);\n /*\n Caution. Adding the bellow nodes, causes the java.lang.OutOfMemoryError: GC overhead limit exceeded\n root.add(1); root.add(3); root.add(5); root.add(7);\n root.add(10); root.add(12); root.add(19); root.add(21);\n */\n System.out.println(java.time.LocalTime.now());\n ArrayList<LinkedList<Integer>> aofl = allSequences(root);\n System.out.println(java.time.LocalTime.now());\n\n for (LinkedList<Integer> list : aofl) {\n for (Integer i : list) {\n System.out.print(i + \",\");\n }\n System.out.println(\" \");\n }\n }", "public HashTableChained() {\r\n num_buckets = 101; //prime number close to 100\r\n hash_table = new DList[num_buckets]; \r\n }", "private int goalEntry1d(int ind) {\n if (ind == L - 1) return 0;\n else return ind + 1;\n }", "RegularImmutableBiMap(int n, ImmutableMapEntry.TerminalEntry<?, ?>[] entriesToAdd) {\n/* 56 */ int tableSize = Hashing.closedTableSize(n, 1.2D);\n/* 57 */ this.mask = tableSize - 1;\n/* 58 */ ImmutableMapEntry[] arrayOfImmutableMapEntry1 = (ImmutableMapEntry[])createEntryArray(tableSize);\n/* 59 */ ImmutableMapEntry[] arrayOfImmutableMapEntry2 = (ImmutableMapEntry[])createEntryArray(tableSize);\n/* 60 */ ImmutableMapEntry[] arrayOfImmutableMapEntry3 = (ImmutableMapEntry[])createEntryArray(n);\n/* 61 */ int hashCode = 0;\n/* */ \n/* 63 */ for (int i = 0; i < n; i++) {\n/* */ \n/* 65 */ ImmutableMapEntry.TerminalEntry<?, ?> terminalEntry = entriesToAdd[i];\n/* 66 */ K key = (K)terminalEntry.getKey();\n/* 67 */ V value = (V)terminalEntry.getValue();\n/* */ \n/* 69 */ int keyHash = key.hashCode();\n/* 70 */ int valueHash = value.hashCode();\n/* 71 */ int keyBucket = Hashing.smear(keyHash) & this.mask;\n/* 72 */ int valueBucket = Hashing.smear(valueHash) & this.mask;\n/* */ \n/* 74 */ ImmutableMapEntry<K, V> nextInKeyBucket = arrayOfImmutableMapEntry1[keyBucket];\n/* 75 */ for (ImmutableMapEntry<K, V> keyEntry = nextInKeyBucket; keyEntry != null; \n/* 76 */ keyEntry = keyEntry.getNextInKeyBucket()) {\n/* 77 */ checkNoConflict(!key.equals(keyEntry.getKey()), \"key\", terminalEntry, keyEntry);\n/* */ }\n/* 79 */ ImmutableMapEntry<K, V> nextInValueBucket = arrayOfImmutableMapEntry2[valueBucket];\n/* 80 */ for (ImmutableMapEntry<K, V> valueEntry = nextInValueBucket; valueEntry != null; \n/* 81 */ valueEntry = valueEntry.getNextInValueBucket()) {\n/* 82 */ checkNoConflict(!value.equals(valueEntry.getValue()), \"value\", terminalEntry, valueEntry);\n/* */ }\n/* 84 */ ImmutableMapEntry<K, V> newEntry = (nextInKeyBucket == null && nextInValueBucket == null) ? (ImmutableMapEntry)terminalEntry : new NonTerminalBiMapEntry<K, V>((ImmutableMapEntry)terminalEntry, nextInKeyBucket, nextInValueBucket);\n/* */ \n/* */ \n/* */ \n/* 88 */ arrayOfImmutableMapEntry1[keyBucket] = newEntry;\n/* 89 */ arrayOfImmutableMapEntry2[valueBucket] = newEntry;\n/* 90 */ arrayOfImmutableMapEntry3[i] = newEntry;\n/* 91 */ hashCode += keyHash ^ valueHash;\n/* */ } \n/* */ \n/* 94 */ this.keyTable = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry1;\n/* 95 */ this.valueTable = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry2;\n/* 96 */ this.entries = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry3;\n/* 97 */ this.hashCode = hashCode;\n/* */ }", "private Map<Integer,List<Integer>> sudokuFindBlank(char[][] board){\n\t\tMap<Integer,List<Integer>> Blank=new HashMap<Integer,List<Integer>>();\n\t\tfor(int i=1;i<10;i++){\n\t\t\tList<Integer> temp=new ArrayList<Integer>();\n\t\t\tBlank.put(i, temp);\n\t\t}\n\t\tfor(int i=0;i<9;i++)\n\t\t\tfor(int j=0;j<9;j++){\n\t\t\t\tif(board[i][j]=='.'){ // if it's blank\n\t\t\t\t\tint temp=0x01ff; // use binary to represent, 1 means it's possible for value at that position\n\t\t\t\t\tint count=0; // count for how many number's can use in blank space\n\t\t\t\t //00000001,11111111 \n\t\t\t\t // 9 87654321 \n\t\t\t\t\tfor(int k=0;k<9;k++){ // for rows and column\n\t\t\t\t\t\tif(board[i][k]!='.')\n\t\t\t\t\t\t\ttemp=temp&~(0x01<<(board[i][k]-'1')); // get rid of used number\n\t\t\t\t\t\tif(board[k][j]!='.')\n\t\t\t\t\t\t\ttemp=temp&~(0x01<<(board[k][j]-'1')); // get rid of used number\n\t\t\t\t\t}\n\t\t\t\t\tfor(int k=0;k<3;k++) // for 3*3 cube\n\t\t\t\t\t\tfor(int l=0;l<3;l++)\n\t\t\t\t\t\t\tif(board[(i/3)*3+k][(j/3)*3+l]!='.')\n\t\t\t\t\t\t\t\ttemp=temp&~(0x01<<(board[(i/3)*3+k][(j/3)*3+l]-'1')); // get rid of used number\t\t\t\t\t\n\t\t\t\t\twhile(temp>0){ // this is for get how many 1s in temp, binary\n\t\t\t\t\t\ttemp=temp&(temp-1);\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t\tList<Integer> t=Blank.get(count);\n\t\t\t\t\tt.add(i*9+j); // store the position\n\t\t\t\t\tBlank.put(count, t); // save blank with information of blank position and how many numbers can be choose in that blank\n\t\t\t\t}\n\t\t\t} // finish checking blank, all blank should be represent as 001100001111... like this\n\t\treturn Blank;\n\t}", "private Entry entry(int index) {\r\n if (index < 0 || index >= size)\r\n//STUB BEGIN\r\n//JBSE cannot handle concatenation of strings and symbolic integers\r\n /*throw new IndexOutOfBoundsException(\"Index: \" + index + \", Size: \"\r\n + size);*/\r\n \tthrow new IndexOutOfBoundsException();\r\n//STUB END\r\n Entry e = header;\r\n // if (index < (size >> 1)) { // Kiasan can not handle bit shifting\r\n // currently.\r\n//\t\tif (index < (size / 2)) {\r\n\t\t\tfor (int i = 0; i <= index; i++)\r\n\t\t\t\te = e.next;\r\n//\t\t} else {\r\n//\t\t\tfor (int i = size; i > index; i--)\r\n//\t\t\t\te = e.previous;\r\n//\t\t}\r\n \r\n return e;\r\n }", "public abstract int numOfSameTypeNeighbourToReproduce();", "private static long mapType1QuantValues(long entries, long dimension) {\n return (long) Math.floor(Math.pow(entries, 1.d / dimension));\n }", "@Test(timeout = 4000)\n public void test21() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n XSQLVAR[] xSQLVARArray0 = new XSQLVAR[0];\n FBResultSet fBResultSet0 = new FBResultSet(xSQLVARArray0, linkedList0);\n byte[][] byteArray0 = new byte[7][0];\n byte[] byteArray1 = new byte[7];\n byteArray1[0] = (byte) (-111);\n linkedList0.add(byteArray0);\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, fBResultSet0);\n FileSystemHandling.shouldAllThrowIOExceptions();\n fBCachedFetcher0.insertRow(byteArray0);\n fBCachedFetcher0.insertRow(fBResultSet0.row);\n assertFalse(fBCachedFetcher0.isBeforeFirst());\n }", "public int size ()\n {\n return this.entryMap.size ();\n }", "public static void func(){\n\t\tHashMap<Integer,Integer> map = new HashMap<Integer,Integer>();\n\t\tint limit = 1000;\n\t\tboolean psb[] = generatePrime(limit);\n\t\t\n\t\tint ps[] = MathTool.generatePrime(100000);\n\t\tfor (int i = 1; ps[i]<1000; i++) {\n\t\t\t//System.out.println(ps[i]);\n\t\t}\n\t\tint max=0;\n\t\tfor (int i = 0; ps[i] < limit; i++) {\n\t\t\tint n = ps[i];\n\t\t\tint j=i;\n\t\t\twhile(n<limit){\n\t\t\t\tif(!psb[n]){\n\t\t\t\t\tint num =j-i+1;\n\t\t\t\t\tif(map.containsKey(n)){\n\t\t\t\t\t\tif(map.get(new Integer(n)) < num){\n\t\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t}\n\t\t\t\t\tif(num > max){\n\t\t\t\t\t\tmax=num;\n\t\t\t\t\t\tSystem.out.println(num+\" \"+n+\" \"+i+\" \"+j);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t\tn+=ps[j];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static long[] estimateSizeOnHeap(int numberOfEntries, int\n maxNumberOfBits) {\n \n long ww = maxNumberOfBits;\n \n long maxNumber = (1L << ww) - 1;\n \n long binSz = maxNumberOfBits;\n \n int nBins = (int)Math.ceil((double)maxNumber/(double)binSz);\n \n long total = 0;\n \n ObjectSpaceEstimator est = new ObjectSpaceEstimator();\n est.setNIntFields(2);\n est.setNLongFields(3);\n est.setNBooleanFields(1);\n //objects: xft, xftReps, rbs\n est.setNObjRefsFields(3);\n \n total += est.estimateSizeOnHeap();\n \n // --------- include contents of the objects --------------\n \n /*\n the minimum of each bin range, if it is populated, is the representative\n node, and that is held in 2 data structures:\n xft holds the number, allowing fast repr prev and next lookups.\n xftReps holds the repr as the value, found by key = binNumber.\n * the max number of trie entries will be nBins\n but there will be prefix trie nodes too\n private final XFastTrieLong<XFastTrieNodeLong<Long>, Long> xft;\n \n // key = bin index (which is node/binSz), value = repr value.\n // each repr value is the minimum stored in the bin.\n // * the max number of map entries will be nBins.\n private final TLongLongMap xftReps = new TLongLongHashMap();\n \n // all inserts of this class are held in \n // * at most nBins number of trees which each \n // hold at most binSz number of entries.\n // each list item is a sorted binary search tree of numbers in that bin.\n // the value in the tree holds multiplicity of the number.\n // each list index can be found by node/binSz\n // each sorted tree has \n // key = node (inserted number), w/ value=\n // the number of times that number is present (multiplicity).\n TLongObjectMap<RedBlackBSTLongInt2> rbs;\n */\n \n // returning 2 estimates\n // (1) estimate using all bins w/ factor 5 for tries\n // (2) estimate from using nBinsSparse of the nBins w/ factor 3 for tries\n \n int nBinsSparse = nBins/10;\n if (nBinsSparse < 1) {\n nBinsSparse = 1;\n }\n \n // using factor of 5 for total w/ prefix nodes\n long total2_1 = numberOfEntries * 5 *\n XFastTrieNode.estimateSizeOnHeap();\n \n // all nBins are filled w/ a repr\n total2_1 += XFastTrie.estimateSizeOnHeap(numberOfEntries);\n \n long total2_2 = numberOfEntries * 3 *\n XFastTrieNode.estimateSizeOnHeap();\n \n // nBinsSparse of nBins are filled w/ a repr\n total2_2 += XFastTrie.estimateSizeOnHeap(numberOfEntries);\n \n \n //TLongLongMap\n total2_1 += ObjectSpaceEstimator.estimateTLongLongHashMap();\n \n //nBins number of repr entries in map\n total2_1 += (2 * nBins * ObjectSpaceEstimator.estimateLongSize());\n \n \n //TLongLongMap\n total2_2 += ObjectSpaceEstimator.estimateTLongLongHashMap();\n \n //nBins/4 number of repr entries in map\n total2_2 += (2 * nBinsSparse * ObjectSpaceEstimator.estimateLongSize());\n \n \n // 1 TLongObjectMap<RedBlackBSTLongInt> rbs;\n total2_1 += ObjectSpaceEstimator.estimateTLongObjectHashMap();\n \n total2_2 += ObjectSpaceEstimator.estimateTLongObjectHashMap();\n \n // nBins number of TreeMap<Integer, Integer> \n ObjectSpaceEstimator est2 = new ObjectSpaceEstimator();\n est2.setNBooleanFields(1);\n est2.setNObjRefsFields(2);\n long totalEntry = est2.estimateSizeOnHeap();\n totalEntry += 3. * totalEntry;\n est2 = new ObjectSpaceEstimator();\n est2.setNIntFields(2);\n long rbtree = est2.estimateSizeOnHeap() + totalEntry;\n long rbtreeNodes = numberOfEntries * totalEntry;\n \n total2_1 += (nBins * rbtree);\n \n total2_2 += (nBinsSparse * rbtree);\n \n \n // nEntries number of long, int nodes\n \n total2_1 += rbtreeNodes;\n \n total2_2 += rbtreeNodes;\n \n return new long[]{total2_1 + total, total2_2 + total};\n }", "@Test\n public void randomInt() {\n HashMap<Integer, Integer> hist = new HashMap<Integer, Integer>();\n for(int i = 0; i < 300; i++){\n // we can think of random int as a coin toss\n Integer coin = test.randInt();\n Integer coinTotal = hist.get(coin);\n if (coinTotal == null){\n hist.put(coin, 1);\n } else {\n hist.put(coin, coinTotal+1);\n }\n }\n assertTrue(\"Should be more than 100 of each\",\n hist.get(0) > 100 && hist.get(1) > 100);\n System.out.println(hist);\n }", "private int[] _make_words(int[] l,int n,int sparsecount){\n int count=0;\n int[] marker = new int[33];\n int[] r = new int[(sparsecount > 0?sparsecount:n)];\n\n for(int i=0;i<n;i++){\n int length=l[i];\n if(length>0){\n int entry=marker[length];\n \n /* when we claim a node for an entry, we also claim the nodes\n\t below it (pruning off the imagined tree that may have dangled\n\t from it) as well as blocking the use of any nodes directly\n\t above for leaves */\n \n /* update ourself */\n if(length<32 && (entry>>length) != 0){\n\t/* error condition; the lengths must specify an overpopulated tree */\n\treturn null;\n }\n r[count++]=entry;\n\n /* Look to see if the next shorter marker points to the node\n\t above. if so, update it and repeat. */\n {\n\tfor(int j=length;j>0;j--){\n\t \n\t if((marker[j]&1) != 0){\n\t /* have to jump branches */\n\t if(j==1)\n\t marker[1]++;\n\t else\n\t marker[j]=marker[j-1]<<1;\n\t break; /* invariant says next upper marker would already\n\t\t have been moved if it was on the same path */\n\t }\n\t marker[j]++;\n\t}\n }\n \n /* prune the tree; the implicit invariant says all the longer\n\t markers were dangling from our just-taken node. Dangle them\n\t from our *new* node. */\n for(int j=length+1;j<33;j++)\n\tif((marker[j]>>1) == entry){\n\t entry=marker[j];\n\t marker[j]=marker[j-1]<<1;\n\t}else\n\t break;\n }else\n if(sparsecount==0)count++;\n }\n \n /* bitreverse the words because our bitwise packer/unpacker is LSb\n endian */\n int i = 0;\n for(i=0,count=0;i<n;i++){\n int temp=0;\n for(int j=0;j<l[i];j++){\n temp<<=1;\n temp|=(r[count]>>j)&1;\n }\n\n// System.out.println( \"mkwrd \" + temp);\n if(sparsecount != 0){\n if(l[i] != 0)\n\tr[count++]=temp;\n }else\n r[count++]=temp;\n }\n\n return(r);\n}", "@Override\n\tpublic int getSize() {\n\t\treturn numberOfEntries;\n\t}", "@Test\n public void testWithDeadlyParams() {\n HashSet<ComplexOomage> oomages = new HashSet<ComplexOomage>();\n int N = 10000;\n ArrayList<Integer> params;\n\n for (int oom = 0; oom < N; oom += 1) {\n params = new ArrayList<Integer>(N);\n for (int i = 0; i < 10; i += 1) {\n params.add(255);\n }\n oomages.add(new ComplexOomage(params));\n }\n assertTrue(haveNiceHashCodeSpread(oomages));\n }", "@Test\n public void test4 ()\n {\n MyMap m = new MyMap();\n int SIZE = 10000;\n \n // Add SIZE mappings\n for (int i = 0; i < SIZE; i++)\n {\n m.put(i+\"\", (i*17)+\"\");\n }\n \n // Add some of the keys again with new values.\n for (int i = 0; i < SIZE; i+=2)\n {\n m.put(i+\"\", (i*18)+\"\");\n }\n \n // Remove every third element.\n for (int i = 0; i < SIZE; i += 3)\n {\n m.remove(i+\"\");\n }\n \n // Remove some of them again. This should make no difference.\n for (int i = 0; i < SIZE; i += 6)\n {\n m.remove(i+\"\");\n }\n \n // Assert that the size is as expected\n assertEquals(SIZE - (int) Math.ceil(SIZE / 3.0), m.size());\n \n // Assert that membership is as expected\n for (int i = 0; i < SIZE; i++)\n {\n if (i%3 == 0)\n {\n assertNull(m.get(i+\"\"));\n }\n else if (i%2 == 0)\n {\n assertEquals((i*18)+\"\", m.get(i+\"\"));\n }\n else\n {\n \tassertEquals((i*17)+\"\", m.get(i+\"\"));\n }\n }\n }", "public static int elementSize_entries_id() {\n return (8 / 8);\n }", "public static int numElements_entries_receiveEst() {\n return 11;\n }", "public static String[] rechercheBigrammePlusFrequent(String text) {\n\t\tint n = text.length();\n\t\tArrayList<String> bigrammes = new ArrayList<String>();\n\t\tString[] bigrammesPlusFrequentsCorrespond = new String[5]; // resultat\n\t\tArrayList<String> bigrammesChiffréPlusFrequents = new ArrayList<String>();\n\t\tArrayList<Integer> nbrBigrammesPlusFrequents = new ArrayList<Integer>();\n\n\t\tfor (int i = 1; i < n - 1; i++) {\n\t\t\tString bigramme = text.substring(i, i + 2);\n\t\t\tbigrammes.add(bigramme);\n\t\t}\n\t\tfor (int j = 0; j < bigrammes.size(); j++) {\n\t\t\tint inter = 1;\n\t\t\tString bi = bigrammes.get(j);\n\t\t\tif ((!bigrammesChiffréPlusFrequents.contains(bi))) {\n\t\t\t\tfor (int k = j + 1; k < bigrammes.size(); k++) {\n\t\t\t\t\tif (bi.equals(bigrammes.get(k))) {\n\t\t\t\t\t\tinter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbigrammesChiffréPlusFrequents.add(bi);\n\t\t\t\tnbrBigrammesPlusFrequents.add(inter);\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tint max = 1, id = 0;\n\t\t\tfor (int j = 0; j < bigrammesChiffréPlusFrequents.size(); j++) {\n\t\t\t\tif (nbrBigrammesPlusFrequents.get(j) >= max) {\n\t\t\t\t\tmax = nbrBigrammesPlusFrequents.get(j);\n\t\t\t\t\tid = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbigrammesPlusFrequentsCorrespond[i] = bigrammesChiffréPlusFrequents\n\t\t\t\t\t.get(id);\n\t\t\tnbrBigrammesPlusFrequents.set(id, 0);\n\t\t}\n\t\t// System.out.println(\"liste des bigrammes les plus fréquents\");\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\t// System.out.println(bigrammesPlusFrequentsCorrespond[i]);\n\t\t}\n\t\treturn bigrammesPlusFrequentsCorrespond;\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}", "@Test\n public void cantAddMoreThanCapacity(){\n for (int i = 0; i<12; i++){\n library.addBook(book);\n }\n assertEquals(10, library.bookCount());\n }", "public void countCollisions() {\n int col2 = 0;\n int col3 = 0;\n int col4 = 0;\n int col5OrMore = 0;\n \n for (int x = 0; x < buckets.length; x++) {\n SList chain = (SList) buckets[x];\n if (chain.length() == 2) {\n col2++;\n }\n if (chain.length() == 3) {\n col3++;\n }\n if (chain.length() == 4) {\n col4++;\n }\n if (chain.length() >= 5) {\n col5OrMore++;\n }\n }\n System.out.println(\"=========HASHTABLE================\");\n System.out.println(\"# of entries: \" + size);\n System.out.println(\"Number of single collisions: \"+col2);\n System.out.println(\"Number of double collisions: \"+col3);\n System.out.println(\"Number of triple collisions: \"+col4);\n System.out.println(\"Number of 5 or more collisions: \"+col5OrMore);\n }", "@Test(timeout = 4000)\n public void test23() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n XSQLVAR[] xSQLVARArray0 = new XSQLVAR[0];\n FBResultSet fBResultSet0 = new FBResultSet(xSQLVARArray0, linkedList0);\n linkedList0.add((byte[][]) null);\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, fBResultSet0);\n fBCachedFetcher0.next();\n fBCachedFetcher0.next();\n boolean boolean0 = fBCachedFetcher0.previous();\n assertTrue(fBCachedFetcher0.isLast());\n assertTrue(boolean0);\n }", "public static void main(String[] args) {\n\t\tinitValues();\n\t\tHashTable sizeSeven = new HashTable(7,2); //Create a hash table with a size of 7, relative prime given is 2\n\t\tHashTable sizeFiftyOne = new HashTable(51,5); //Create a hash table with a size of 51, relative prime given is 5\n\t\tHashTable sizeOneFiftyOne = new HashTable(151,25); //Create a hash table with a size of 151, relative prime given is 25\n\t\t\n\t\t//Populate the Hash Tables\n\t\tfor (int i = 0; i < values.length ; i++){\n\t\t\tsizeSeven.add(new HashableInt(values[i]));\n\t\t\tsizeFiftyOne.add(new HashableInt(values[i]));\n\t\t\tsizeOneFiftyOne.add(new HashableInt(values[i]));\n\t\t}\n\t\t\n\t\t//Print the stored values of the Hash Tables\n\t\tSystem.out.println(sizeSeven);\n\t\tSystem.out.println(sizeFiftyOne);\n\t\tSystem.out.println(sizeOneFiftyOne);\n\t\t\n\t\t//Search for 10 random numbers in each hash table, show weather the table contains the number and how many comparisons it took to find it or not\n\t\tSystem.out.println(\"Table Size:\\tSearch Value:\\tTable Contains?:\\t# Comparisons:\\t\");\n\t\tfor (int i = 0; i < values2.length; i++){\n\t\t\tSystem.out.println(sizeSeven.getSize()+\"\\t\\t\"+values2[i]+\"\\t\\t\"+sizeSeven.contains(new HashableInt(values2[i]))+\"\\t\\t\\t\"+sizeSeven.getNumberCompares());\n\t\t\tSystem.out.println(sizeFiftyOne.getSize()+\"\\t\\t\"+values2[i]+\"\\t\\t\"+sizeFiftyOne.contains(new HashableInt(values2[i]))+\"\\t\\t\\t\"+sizeFiftyOne.getNumberCompares());\n\t\t\tSystem.out.println(sizeOneFiftyOne.getSize()+\"\\t\\t\"+values2[i]+\"\\t\\t\"+sizeOneFiftyOne.contains(new HashableInt(values2[i]))+\"\\t\\t\\t\"+sizeOneFiftyOne.getNumberCompares());\n\t\t}\n\t}", "public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}", "public static void main(String[] args) {\n Map<Integer, String> ht = new Hashtable<>();\n \n // hash = 7, so, (7 & 0x7FFFFFFF) % 11 => 7 % 11 => 7. So, it stores the element in 7th index bucket location\n ht.put(7, \"aa\"); \n ht.put(11, \"ba\");\n ht.put(1, \"ad\");\n ht.put(15, \"sa\");\n ht.put(20, \"rea\");\n \n // hash = 18, so, (18 & 0x7FFFFFFF) % 11 => 18 % 11 => 7. So, it stores the element in 7th index bucket location.\n // But we already have one element then this new element will have next pointer variable. It will point to the element whcih already exists.\n // Then this new element will be placed in the 7th index.\n ht.put(18, \"ewa\");\n\n // When we iterate the elements it will iterate from top to bottom and right to left only.\n // Same index we have a possibility of multiple elements. So, it will read it from right to left.\n System.out.println(ht);\n }", "static int size_of_ori(String passed){\n\t\treturn 2;\n\t}", "@Test(timeout = 4000)\n public void test20() throws Throwable {\n LinkedList<byte[][]> linkedList0 = new LinkedList<byte[][]>();\n XSQLVAR[] xSQLVARArray0 = new XSQLVAR[0];\n FBResultSet fBResultSet0 = new FBResultSet(xSQLVARArray0, linkedList0);\n linkedList0.add((byte[][]) null);\n FBCachedFetcher fBCachedFetcher0 = new FBCachedFetcher(linkedList0, fBResultSet0);\n fBCachedFetcher0.next();\n boolean boolean0 = fBCachedFetcher0.isFirst();\n assertTrue(boolean0);\n }", "private Map<Key, Integer> mergeDuplicatedItemsAndDelte0(simpleRingBuffer<byte[]> buff2) {\n\t\t// TODO Auto-generated method stub\n\t\t//Iterator<byte[]> ier0 = buff2.iterator();\t \t\n \n//\t\tMap<Key, Integer> deduplicatedMap = Maps.newLinkedHashMap();\n// \t \t\n//\t\twhile(!buff2.isEmpty()){\n//\t\t\t//delete\n//\t\t\tbyte[] out = buff2.pop();\n//\t\t\t//push to the hash table\n//\t\t\tif(!deduplicatedMap.containsKey( out.key)){\n//\t\t\t\tdeduplicatedMap.put( out.key, out.counter);\t \n//\t\t\t}else{\n//\t\t\t\tdeduplicatedMap.replace(out.key, out.counter+deduplicatedMap.get(out.key));\n//\t\t\t}\n//\t\t}\n//\t\treturn deduplicatedMap;\n\t\treturn null;\n\t}", "int getBlockNumbersCount();", "public int getStartingBombs() {\n \t\treturn 1;\n \t}", "@Test\n\tpublic void testLargeRingSystem2() throws Exception {\n\t\tString smiles = \"Oc1ccc(cc1)c1coc2c(c1=O)c(O)cc(c2)O\";\n IAtomContainer mol = sp.parseSmiles(smiles);\n atasc.decideBondOrder(mol, true);\n \n int doubleBondCount = 0;\n for (IBond bond : mol.bonds()) {\n if (bond.getOrder().equals(Order.DOUBLE)) doubleBondCount++;\n }\n Assert.assertEquals(8, doubleBondCount);\n\t}", "public static void main(String[] args) {\n\tArrayList<Integer[]> chunks = new ArrayList<Integer[]>();\n\t\t\n\t\tfor(int x = -128; x<=128; x++){\n\t\t\t\n\t\t\tfor (int z = -128; z<=128; z++){\n\t\t\t\t\n\t\t\t\tif(x*x + z*z < 128*128){\n\t\t\t\t\t/*\n\t\t\t\t\t * Makes sure that there is no duplicate.\n\t\t\t\t\t */\n\t\t\t\t\tif(!HasChunks(new Integer[] {(int) x/ 16, (int) z/16}, chunks)){\n\t\t\t\t\t\t\n\t\t\t\t\t\tchunks.add(new Integer[] {(int) x/ 16, (int) z/16});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * The programm testd many chunks with many seeds in order to try to find the good location.\n\t\t */\n\t\tfor(long seed = 32000; seed<1000000L; seed++){\n\t\t \n\t\t\t//from chunk(-100;-100) to chunk(100;100) which is 4.10^4 chunks^2.seed^-1\n\t\t\tfor(int cx = -100; cx<=100; cx++){\n\t\t\t\tfor (int cz = -100; cz<=100; cz++){\n\t\t\t\n\t\t\t\t\tboolean flag = true;\n\t\t\t\t\t\t//browse the chunks which are in the 8chunk circle radius.\n\t\t\t\t\t\tfor(Integer[] ch: chunks){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isSlimeChunk(seed, cx+ch[0], cz+ch[1])){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//no chunks contains slimechunks --> good location, we need to output the result.\n\t\t\t\t\t\tif(flag){\n\t\t\t\t\t\tSystem.out.println(\"Seed=\"+String.valueOf(seed)+\" ,ChunkX=\"+cx+\" ,ChunkZ\"+cz);\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public int getNumEntries ()\n\t{\n\t\treturn entries.size ();\n\t}", "public int getNbrExtraLargeBed() {\n\t\treturn getNbrOfBeds()[2];\n\t}", "@Test\n\tpublic void testLargeRingSystem3() throws Exception {\n\t\tString smiles = \"O=C5C=C(O)C(N=Nc1ccc(cc1)Nc2ccccc2)=CC5(=NNc3ccc(cc3)Nc4ccccc4)\";\n IAtomContainer mol = sp.parseSmiles(smiles);\n atasc.decideBondOrder(mol, true);\n \n int doubleBondCount = 0;\n for (IBond bond : mol.bonds()) {\n if (bond.getOrder().equals(Order.DOUBLE)) doubleBondCount++;\n }\n Assert.assertEquals(17, doubleBondCount);\n\t}", "public long numPostingEntries();", "private static void findBigramCountsTuring() {\n\n\t\tbigramCountTI= new HashMap<Integer,Double>();\n\t\tdouble value;\n\t\tfor(int i:bucketCountT.keySet()){\n\t\t\tif(i==0)\n\t\t\t\tcontinue;\n\t\t\tvalue= ((i+1)*bucketCountT.getOrDefault(i+1, 0.0))/bucketCountT.get(i);\n\t\t\tbigramCountTI.put(i,value);\n\t\t}\n\t}", "public boolean isFull() {\n return size == k;\n}", "int getBombsPlaced () {\n return bombsPlaced;\n }", "public int size()\r\n { return N; }", "private static void getPrime() {\n\t\tfor(int i=2;i<MAXN;i++){\n\t\t\tif(prime[i]==0){\n\t\t\t\tprime[++prime[0]]=i;\n\t\t\t}\n\t\t}\n\t}", "public InsertDeleteGetRandom_380() {\n nums = new int[1000000];\n size = 0;\n lookup = new HashMap<>();\n }", "@Test\n public void testLargeRingSystem1() throws Exception {\n\t\t// Should have 6 double bonds\n\t\tString smiles = \"c1ccc2c(c1)CC4NCCc3cccc2c34\";\n IAtomContainer mol = sp.parseSmiles(smiles); \n atasc.decideBondOrder(mol, true);\n \n int doubleBondCount = 0; \n for (IBond bond : mol.bonds()) {\n if (bond.getOrder().equals(Order.DOUBLE)) doubleBondCount++;\n }\n Assert.assertEquals(6, doubleBondCount);\n\t}", "public static void main(String[] args) {\n DGIM[] dgim = new DGIM[5];\n //从0到4分别代表2^4到2^0的位\n for (int i = 0; i < 5; i++) {\n dgim[i] = new DGIM(1000);\n }\n try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(\"cmsc5741_stream_data2.txt\")));) {\n while (true) {\n boolean isEnd = false;\n StringBuilder builder = new StringBuilder();\n int c1 = reader.read();\n builder.append((char) c1);\n while (true) {\n int c2 = reader.read();\n if ((char) c2 == ' ') {\n break;\n }\n if (c2 == -1) {\n isEnd = true;\n break;\n }\n builder.append((char) c2);\n }\n if (isEnd) {\n break;\n }\n char[] binary = Integer.toBinaryString(Integer.parseInt(builder.toString())).toCharArray();\n //寻找开始的位\n int start = 5 - binary.length;\n DGIM.number++;\n for (int i = 0; i < binary.length; i++) {\n if (binary[i] == '1') {\n dgim[start].add();\n }\n start++;\n }\n }\n Iterator<Bucket> iterator_16 = dgim[0].getQueue().iterator();\n Iterator<Bucket> iterator_8 = dgim[1].getQueue().iterator();\n Iterator<Bucket> iterator_4 = dgim[2].getQueue().iterator();\n Iterator<Bucket> iterator_2 = dgim[3].getQueue().iterator();\n Iterator<Bucket> iterator_1 = dgim[4].getQueue().iterator();\n\n\n while(iterator_16.hasNext()){\n System.out.println(\"Buckets for 16 :\"+iterator_16.next());\n }\n System.out.println(\"There are \"+dgim[0].getContent()+\" count of 16\");\n while(iterator_8.hasNext()){\n System.out.println(\"Buckets for 8 :\"+iterator_8.next());\n }\n System.out.println(\"There are \"+dgim[1].getContent()+\" count of 8\");\n while(iterator_4.hasNext()){\n System.out.println(\"Buckets for 4 :\"+iterator_4.next());\n }\n System.out.println(\"There are \"+dgim[2].getContent()+\" count of 4\");\n while(iterator_2.hasNext()){\n System.out.println(\"Buckets for 2 :\"+iterator_2.next());\n }\n System.out.println(\"There are \"+dgim[3].getContent()+\" count 2\");\n\n while(iterator_1.hasNext()){\n System.out.println(\"Buckets for 1 :\"+iterator_1.next());\n }\n System.out.println(\"There are \"+dgim[4].getContent()+\" times 1\");\n\n int result = (dgim[0].getContent()*16 + dgim[1].getContent()*8\n + dgim[2].getContent()*4 + dgim[3].getContent()*2 + dgim[4].getContent())/1000;\n System.out.println(\"The average price: \"+result);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "int entries() {\r\n return journal_entries;\r\n }", "int getEntryCount();", "public static void main(String[] args)\n {\n\tScanner sc = new Scanner(System.in);\n\tSystem.out.println(\"enter cache size in KB among (1, 2, 4, 8, 16, 32)\");\n\tint cacheSize = sc.nextInt();\n\tSystem.out.println(\"enter way associative value among(1,2,4,8)\");\n\tint wayAssociative = sc.nextInt();\n\tSystem.out.println(\"enter cache line size in bytes among(2,4,8,16,32,64)\");\n\tint cacheLineSize = sc.nextInt();\n\tsc.close();\n\n\tlong count_hit = 0, count_miss = 0;\n\tlong count_hit_2 = 0, count_miss_2 = 0, clockCycle_2 = 0;\n\tlong count_hit_4 = 0, count_miss_4 = 0, clockCycle_4 = 0;\n\tlong count_hit_8 = 0, count_miss_8 = 0, clockCycle_8 = 0;\n\n\tint numberOfCacheLines = (int) ((cacheSize * 1024) / cacheLineSize);\n\n\tArrayList<String> cacheKeys = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheValues = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheKeys_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\n\tlong clockCycle = 0;\n\n\tStringBuilder y = new StringBuilder(\"\");\n\n\t// creating main memory array to store all addresses in a 2d\n\t// array..mapping one\n\t// letter into one width length only..1 to 1 mapping.\n\t// so 2 width is one byte..to get value do block offset*2\n\tString[][] mainMemory = new String[1743][32];\n\tfor (int i = 0; i < 1743; i++)\n\t{\n\t for (int j = 0; j < 32; j++)\n\t {\n\t\tmainMemory[i][j] = \"\";\n\t }\n\t}\n\ttry\n\t{\n\t // read all input files\n\t\tString instructionAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_addr_trace_hex_project_1.txt\")));\n\t\tString dataSizes = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_data_size_project_1.txt\")));\n\t\tString memoryAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_mem_hex_16byte_wide.txt\")));\n\t\t// copy all memory addresses into the 2d mainMemory array\n\t\t// split into each line of address\n\n\t String[] memoryAddress = memoryAddresses.split(\"\\\\s+\");\n\t for (int i = 0; i < 1743; i++)\n\t {\n\t\t// split address into each letter\n\t\tString[] oneBit = memoryAddress[i].split(\"\");\n\n\t\tint z = -1;\n\n\t\tfor (int q = oneBit.length - 1; q >= 0; q--)\n\t\t{\n\t\t z++;\n\t\t // store each letter into the array as hex\n\t\t mainMemory[i][q] = oneBit[z];\n\t\t}\n\t }\n\n\t // splitting the instruction addresses into lines\n\t String[] instructionAddress = instructionAddresses.split(\"\\\\s+\");\n\n\t // splitting dataSizes to get length of each data\n\t String[] dataSize = dataSizes.split(\"\\\\s+\");\n\t for (int i = 0; i < instructionAddress.length; i++)\n\t {\n\t\ttry\n\t\t{\n\t\t String binaryIs = \"\";\n\t\t String binaryOffset = \"\";\n\t\t String blockNumber = \"\";\n\t\t if (Integer.parseInt(instructionAddress[i], 16) > 15)\n\t\t {\n\t\t\tbinaryIs = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t\tbinaryOffset = binaryIs.substring(binaryIs.length() - 4);\n\t\t\tblockNumber = binaryIs.substring(0, binaryIs.length() - 4);\n\t\t } else\n\t\t {\n\n\t\t\tblockNumber = \"0\";\n\t\t\tbinaryOffset = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t }\n\n\t\t // check if hit or miss for 1 way\n\t\t if (wayAssociative == 1)\n\t\t {\n\n\t\t\tif (cacheKeys.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t{\n\t\t\t // cache hit situation\n\t\t\t count_hit++;\n\t\t\t clockCycle++;\n\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t // cache miss\n\t\t\t count_miss++;\n\t\t\t clockCycle += 15;\n\n\t\t\t // replacement for direct mapping.\n\n\t\t\t int newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t int newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t int length = Integer.parseInt(dataSize[i]);\n\n\t\t\t y.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t int p = -1, beta = 0;\n\t\t\t for (int alpha = 1; alpha < length; alpha++)\n\t\t\t {\n\n\t\t\t\tif ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t{\n\n\t\t\t\t newBlockNumber_Value++;\n\t\t\t\t newOffset_StartingPosition = 0;\n\t\t\t\t beta = length - alpha;\n\n\t\t\t\t if (p < beta)\n\t\t\t\t {\n\t\t\t\t\tp++;\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t }\n\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t y.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t}\n\t\t\t }\n\n\t\t\t y = y.reverse();\n\n\t\t\t // if y is more than one byte then put it in next cache line\n\t\t\t if (y.length() > 4)\n\t\t\t {\n\n\t\t\t\tfor (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t{\n\t\t\t\t String yy = y.substring(o, o + 4);\n\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(yy);\n\n\t\t\t\t}\n\t\t\t } else\n\t\t\t {\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(y.toString());\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t}\n\n\t\t\ty.delete(0, y.length());\n\n\t\t }\n\n\t\t else if (wayAssociative > 1)\n\t\t {\n\n\t\t\tif (wayAssociative == 2)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_2++;\n\t\t\t\tclockCycle_2++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_2++;\n\t\t\t\tclockCycle_2 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (i % wayAssociative == 0)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tif (cacheKeys.size() <= numberOfCacheLines)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\t cacheValues_0.add(yy);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse if (i % wayAssociative == 1)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\t// way =4\n\t\t\tif (wayAssociative == 4)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_2.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_4++;\n\t\t\t\tclockCycle_4++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_4++;\n\t\t\t\tclockCycle_4 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\telse if (wayAssociative == 8)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || cacheKeys_4.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_5.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_7.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_6.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_8++;\n\t\t\t\tclockCycle_8++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_8++;\n\t\t\t\tclockCycle_8 += 15;\n\n\t\t\t\t// replacement\n\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 4\n\t\t\t\t else if (i % wayAssociative == 4)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 5\n\t\t\t\t else if (i % wayAssociative == 5)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 6\n\t\t\t\t else if (i % wayAssociative == 6)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 7\n\n\t\t\t\t else if (i % wayAssociative == 7)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t //\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t }\n\n\t\t // 3\n\n\t\t} catch (Exception e)\n\t\t{\n\t\t e.printStackTrace();\n\t\t}\n\n\t }\n\n\t // to print outputs\n\n\t if (wayAssociative == 1)\n\t {\n\t\tlong cache_access = count_hit + count_miss;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit);\n\n\t\tdouble hit_ratio = ((double) count_hit) / (count_hit + count_miss) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 2)\n\t {\n\t\tlong cache_access = count_hit_2 + count_miss_2;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_2);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_2);\n\n\t\tdouble hit_ratio = ((double) count_hit_2) / (count_hit_2 + count_miss_2) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_2;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 4)\n\t {\n\t\tlong cache_access = count_hit_4 + count_miss_4;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_4);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_4);\n\n\t\tdouble hit_ratio = ((double) count_hit_4) / (count_hit_4 + count_miss_4) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_4;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\n\t } else if (wayAssociative == 8)\n\t {\n\t\tlong cache_access = count_hit_8 + count_miss_8;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_8);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_8);\n\n\t\tdouble hit_ratio = ((double) count_hit_8) / (count_hit_8 + count_miss_8) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_8;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t} catch (Exception e)\n\t{\n\t e.printStackTrace();\n\t}\n\n }", "int getNumOfChunks();", "int fixedSize();", "RegularImmutableBiMap(Map.Entry<?, ?>[] entriesToAdd) {\n/* 104 */ int n = entriesToAdd.length;\n/* 105 */ int tableSize = Hashing.closedTableSize(n, 1.2D);\n/* 106 */ this.mask = tableSize - 1;\n/* 107 */ ImmutableMapEntry[] arrayOfImmutableMapEntry1 = (ImmutableMapEntry[])createEntryArray(tableSize);\n/* 108 */ ImmutableMapEntry[] arrayOfImmutableMapEntry2 = (ImmutableMapEntry[])createEntryArray(tableSize);\n/* 109 */ ImmutableMapEntry[] arrayOfImmutableMapEntry3 = (ImmutableMapEntry[])createEntryArray(n);\n/* 110 */ int hashCode = 0;\n/* */ \n/* 112 */ for (int i = 0; i < n; i++) {\n/* */ \n/* 114 */ Map.Entry<?, ?> entry = entriesToAdd[i];\n/* 115 */ K key = (K)entry.getKey();\n/* 116 */ V value = (V)entry.getValue();\n/* 117 */ CollectPreconditions.checkEntryNotNull(key, value);\n/* 118 */ int keyHash = key.hashCode();\n/* 119 */ int valueHash = value.hashCode();\n/* 120 */ int keyBucket = Hashing.smear(keyHash) & this.mask;\n/* 121 */ int valueBucket = Hashing.smear(valueHash) & this.mask;\n/* */ \n/* 123 */ ImmutableMapEntry<K, V> nextInKeyBucket = arrayOfImmutableMapEntry1[keyBucket];\n/* 124 */ for (ImmutableMapEntry<K, V> keyEntry = nextInKeyBucket; keyEntry != null; \n/* 125 */ keyEntry = keyEntry.getNextInKeyBucket()) {\n/* 126 */ checkNoConflict(!key.equals(keyEntry.getKey()), \"key\", entry, keyEntry);\n/* */ }\n/* 128 */ ImmutableMapEntry<K, V> nextInValueBucket = arrayOfImmutableMapEntry2[valueBucket];\n/* 129 */ for (ImmutableMapEntry<K, V> valueEntry = nextInValueBucket; valueEntry != null; \n/* 130 */ valueEntry = valueEntry.getNextInValueBucket()) {\n/* 131 */ checkNoConflict(!value.equals(valueEntry.getValue()), \"value\", entry, valueEntry);\n/* */ }\n/* 133 */ ImmutableMapEntry<K, V> newEntry = (nextInKeyBucket == null && nextInValueBucket == null) ? new ImmutableMapEntry.TerminalEntry<K, V>(key, value) : new NonTerminalBiMapEntry<K, V>(key, value, nextInKeyBucket, nextInValueBucket);\n/* */ \n/* */ \n/* */ \n/* 137 */ arrayOfImmutableMapEntry1[keyBucket] = newEntry;\n/* 138 */ arrayOfImmutableMapEntry2[valueBucket] = newEntry;\n/* 139 */ arrayOfImmutableMapEntry3[i] = newEntry;\n/* 140 */ hashCode += keyHash ^ valueHash;\n/* */ } \n/* */ \n/* 143 */ this.keyTable = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry1;\n/* 144 */ this.valueTable = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry2;\n/* 145 */ this.entries = (ImmutableMapEntry<K, V>[])arrayOfImmutableMapEntry3;\n/* 146 */ this.hashCode = hashCode;\n/* */ }", "public void testIterator01() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(4);\r\n\t\tList<String> words = TestUtils.randomWords(256, 3);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tCollections.sort(words);\r\n\t\tStringBuilder expected = new StringBuilder();\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\texpected.append(words.get(i)).append(',');\r\n\t\t}\r\n\r\n\t\tStringBuilder actual = new StringBuilder();\r\n\t\tfor (Entry<String, Integer> e : bt) {\r\n\t\t\tactual.append(e.getKey()).append(',');\r\n\t\t}\r\n\r\n\t\tassertEquals(actual.toString(), expected.toString());\r\n\t}", "@Test\n public void testChunkType() {\n final int[] count = new int[255];\n final SctpChunk.Type[] types = SctpChunk.Type.values();\n for (int i = 0; i < types.length; ++i) {\n count[types[i].getType()] = count[types[i].getType()] + 1;\n }\n\n for (int i = 0; i < count.length; ++i) {\n assertThat(\"Found multiple type definitions for Chunk Type \" + i, count[i] < 2, is(true));\n }\n\n }", "int sizeOfAddressHistoryArray();", "public int size() {\n/* 426 */ return -1;\n/* */ }", "@org.junit.Test\n public void put() throws Exception {\n for (int i = 0; i < 2_000_000; i++) {\n hashTable.put(Integer.toString(i), Integer.toString(i));\n }\n\n for (int i = 0; i < 2_000_000; i++) {\n assertEquals(true, hashTable.contains(Integer.toString(i)));\n }\n}", "private void init() {\n _capacity = 1 << 9;\n int holderSize = _capacity << 1;\n _keyValueHolder = new int[holderSize];\n _mask = holderSize - 1;\n _maxNumEntries = (int) (_capacity * LOAD_FACTOR);\n }", "GetNSet(byte[] array) {\n\t\tcopyToNewArray(array);\n\t\tmaxval = 127;\n\t}", "public ArraySetLong(int n) {\n\t\tnumElements = 0;\n\t\ttheElements = new long[n];\n\t}" ]
[ "0.5995832", "0.56113225", "0.55932456", "0.5589662", "0.55360305", "0.5533854", "0.5502017", "0.547834", "0.5464608", "0.5425887", "0.5420328", "0.5400365", "0.53912294", "0.53848535", "0.53702354", "0.5333937", "0.53311485", "0.52287805", "0.52228135", "0.52191556", "0.5204174", "0.52015495", "0.52015495", "0.52010286", "0.51928115", "0.5178284", "0.51678777", "0.51665336", "0.51659346", "0.51543736", "0.5150745", "0.5144131", "0.5138268", "0.51200545", "0.51155865", "0.5115476", "0.51114005", "0.5110267", "0.5101063", "0.5100608", "0.5093511", "0.5086415", "0.5084435", "0.5083932", "0.5083365", "0.50807875", "0.5074327", "0.5067924", "0.506534", "0.506468", "0.5062853", "0.5050732", "0.50483096", "0.50393015", "0.5022511", "0.5020911", "0.50102717", "0.500466", "0.50045323", "0.5000892", "0.49990818", "0.4997305", "0.49930227", "0.4992192", "0.49889302", "0.49878863", "0.49858367", "0.49835095", "0.49782723", "0.49780703", "0.49704072", "0.49637404", "0.49617547", "0.49552912", "0.49533808", "0.49476242", "0.49425018", "0.49408683", "0.49401182", "0.4938956", "0.4936159", "0.49348697", "0.49339575", "0.49328873", "0.49244472", "0.49239743", "0.49239266", "0.49163106", "0.49126583", "0.4912333", "0.49076644", "0.4906126", "0.48995042", "0.4898244", "0.48964268", "0.4885703", "0.48846862", "0.48840058", "0.4883965", "0.48811406", "0.48753798" ]
0.0
-1
Client to retrieve exoplanet catalogue
public interface CatalogueClient { List<Exoplanet> getCatalogue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getCatalog(String myURl) throws IOException{\r\n InputStream inputStreamFromServer = null;\r\n String responseAsString = null;\r\n try {\r\n //Creates and configures the HttpURLConnection\r\n URL url = new URL(myURl);\r\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\r\n httpURLConnection.setRequestMethod(\"GET\");\r\n httpURLConnection.setConnectTimeout(15000);\r\n httpURLConnection.setDoInput(true);\r\n\r\n //Starts the query\r\n httpURLConnection.connect();\r\n\r\n //gets response code\r\n int responseCode = httpURLConnection.getResponseCode();\r\n QuantityDictionay.debugLog(\"The response code is: \"+responseCode);\r\n\r\n //gets the connection Input Stream\r\n inputStreamFromServer = httpURLConnection.getInputStream();\r\n\r\n //Convert the input stream to String\r\n responseAsString= inputStreamToString(inputStreamFromServer);\r\n\r\n }catch (IOException e){\r\n\r\n e.printStackTrace();\r\n QuantityDictionay.debugLog(\"Exception thrown on GetProductCatalogTask.getCatalog\");\r\n\r\n }\r\n return responseAsString;\r\n }", "Catalog getCatalog();", "Catalog getCatalog();", "public IFuture<ItemInfo[]> getCatalog()\n\t{\n\t\tfinal Future<ItemInfo[]> ret = new Future<ItemInfo[]>();\n\t\tShopCapa shop = (ShopCapa)capa.getPojoCapability();\n\t\tret.setResult(shop.getCatalog().toArray(new ItemInfo[shop.getCatalog().size()]));\n\t\treturn ret;\n\t}", "protected void fetch() {\n HttpClient client = new HttpClient();\n client.getHostConfiguration().setHost(HOST, PORT, SCHEME);\n\n List<String> prefectures = getCodes(client, PATH_PREF, \"pref\");\n List<String> categories = getCodes(client, PATH_CTG, \"category_s\");\n\n // This is a workaround for the gnavi API.\n // Gnavi API only allows max 1000 records for output.\n // Therefore, we divide records into smaller pieces\n // by prefectures and categories.\n for (String prefecture: prefectures) {\n for (String category: categories) {\n logger.debug(\"Prefecture: {}\", prefecture);\n logger.debug(\"Category: {}\", category);\n getVenues(client, prefecture, category, 1);\n }\n }\n }", "public static void main(String[] args) {\nLibraryServis servise = new CityLibraryService();\r\nCatalog bookCatalog = servise.getMainCatalog();\r\nviewCatalogInfo(bookCatalog);\r\n\r\n\t}", "private void showCourseCatalogue()\r\n {\r\n \tCourseCatalogue courseCat = this.getDBManager().getCourseCat();\r\n \tthis.getClientOut().printf(\"SUCCESS\\n%s\\n\", courseCat.toString());\r\n \tthis.getClientOut().flush();\r\n }", "public List BestClient();", "private void getEcoleList(){\r\n\t\tEcoleRequestFactory rf = GWT.create(EcoleRequestFactory.class);\r\n\t\trf.initialize(this.getEventBus(), new EventSourceRequestTransport(this.getEventBus()));\r\n\t\tEcoleRequestContext rc = rf.ecoleRequest();\r\n\t\trc.listAllActive().fire(new Receiver<List<EcoleProxy>>(){\r\n\t\t\t@Override\r\n\t\t\tpublic void onSuccess(List<EcoleProxy> response){\r\n\t\t\t\tgetView().setEcoleAddList(response);\r\n\t\t\t}\r\n\t\t\t@Override\r\n\t\t\tpublic void onFailure(ServerFailure error){\r\n\t\t\t\tWindow.alert(error.getMessage());\r\n\t\t\t}\r\n\t\t});\r\n\t}", "public Catalog getCatalog();", "List<CatalogItem> getAllCatalogItems();", "@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();", "private void requestServerToGetInformation() {\n Net net = Net.getInstance();\n Log.i(TAG, \"requestServerToGetInformation: Start connect server\");\n net.get(AppConstant.SERVER_COMBO_URL, new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Log.i(TAG, \"onFailure: connect error; \" + e.getMessage());\n }\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n // get the JSON from responses.\n String jsonStr = response.body().string();\n Log.i(TAG, \"onResponse: --------------------------------\" + jsonStr);\n parseJsonAndUpdateView(jsonStr.trim());\n }\n });\n }", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate();", "public List<CatalogDescription> getAllCatalogDescriptionsForCertificate(boolean showInactives);", "@RequestMapping(method = RequestMethod.GET)\n\tpublic ResponseEntity<?> getCatalogItems() {\n\t\tBraveSpanContext openTracingContext = getTracingContext();\n\t\tio.opentracing.Span span = tracer.buildSpan(\"GetCatalogFromService\").asChildOf(openTracingContext)\n\t\t\t\t.withTag(\"Description\", \"Get All Catalogs\")\n\t\t\t\t.withTag(\"http_request_url\", request.getRequestURI()).start();\n\t\tbrave.Span braveSpan = ((BraveSpan) span).unwrap();\n\t\tbraveSpan.kind(Kind.SERVER);\n\n\t\tSummary.Timer requestTimer = Prometheus.requestLatency.startTimer();\n\t\ttry {\n\t\t\tlog.debug(\"Calling getCatalogItems() method of catalog controller is called\");\n\t\t\tPrometheus.getCounters.inc();\n\t\t\tPrometheus.inProgressRequests.inc();\n\t\t\tio.opentracing.Span mongospan = tracer.buildSpan(\"MongoService\").asChildOf(span)\n\t\t\t\t\t.withTag(\"Description\", \"MongoDB Service Call\").start();\n\t\t\tbrave.Span braveMongoSpan = ((BraveSpan) mongospan).unwrap();\n\t\t\tlog.debug(\"Calling getCatalogItems() method of catalog service\");\n\t\t\tList<Catalog> catalog = service.getCatalogItems(mongospan);\n\t\t\tbraveMongoSpan.finish();\n\t\t\tif (catalog == null) {\n\t\t\t\tlog.debug(\"No records found. Returning NOT_FOUND status.\");\n\t\t\t\treturn new ResponseEntity<>(HttpStatus.NOT_FOUND);\n\t\t\t} else {\n\t\t\t\tlog.debug(\"Returning list of items.\");\n\t\t\t\treturn new ResponseEntity<>(catalog, HttpStatus.OK);\n\t\t\t}\n\t\t} catch (Exception exc) {\n\t\t\tPrometheus.requestFailures.inc();\n\t\t\tlog.error(\"Error in getCatalogItems\", exc);\n\t\t\tspan.setTag(\"error\", exc.getMessage());\n\t\t\treturn new ResponseEntity<>(exc.toString(), HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t} finally {\n\t\t\trequestTimer.observeDuration();\n\t\t\tPrometheus.inProgressRequests.dec();\n\t\t\tspan.finish();\n\t\t}\n\t}", "public List<Cliente> consultarClientes();", "public CategoryInfo browse() {\n return client.getURI(CategoryInfo.class, catalogPath(null));\n }", "@GET(\"montaje/proyectos/ver/\")\n Call<List<clsProyecto>> getProyectos();", "@Test\r\n\tpublic void getAllIncidents() {\n\t\tRestAssured.baseURI = \"https://dev49243.service-now.com/api/now/table/incident\";\r\n\t\t\r\n\t\t// Step 2: Authentication (basic)\r\n\t\tRestAssured.authentication = RestAssured.basic(\"admin\", \"Tuna@123\");\r\n\t\t\r\n\t\t// Step 3: Request type - Get -> Response\r\n\t\tResponse response = RestAssured.get();\r\n\t\t\r\n\t\t// Step 4: Validate (Response -> Status Code : 200)\r\n\t\tSystem.out.println(response.getStatusCode());\r\n\t\t\r\n\t\t// Print the response time as well \r\n\t\t\r\n\t\t// Check what is the response format\r\n\t\tSystem.out.println(response.getContentType());\r\n\t\t\r\n\t\t// print the response\r\n\t\tresponse.prettyPrint();\r\n\t\t\r\n\t}", "public ArrayList<CompanyProtheus> requestCompanysProtheus() {\n\n // Local variables.\n CompanyProtheus[] companysProtheus;\n ArrayList<CompanyProtheus> listCompanysProtheus = new ArrayList<>();\n\n // Define url for request.\n urlPath = \"http://{ipServer}:{portServer}/REST/GET/JWSRUSERS/emp/{userCode}\";\n urlPath = urlPath.replace(\"{ipServer}\", ipServer);\n urlPath = urlPath.replace(\"{portServer}\", portServer);\n urlPath = urlPath.replace(\"{userCode}\", userProtheus.getCode());\n\n try {\n\n // Set URL for request.\n url = new URL(urlPath);\n\n // Set key for authorization basic\n authorizationBasic = \"Basic \" + Base64.encodeToString((userProtheus.getCode()+ \":\" + userProtheus.getPassword()).getBytes() , Base64.DEFAULT);\n\n // Open connection HTTP.\n httpConnection = (HttpURLConnection) url.openConnection();\n\n // set header for request.\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.setRequestProperty(\"Content-type\", \"application/json\");\n httpConnection.setRequestProperty(\"Accept\", \"application/json\");\n httpConnection.setRequestProperty(\"Authorization\", authorizationBasic);\n httpConnection.setDoOutput(true);\n httpConnection.setDoInput(true);\n httpConnection.setConnectTimeout(5000);\n httpConnection.connect();\n\n // Get response.\n bufferedLine = \"\";\n bufferedReader = new BufferedReader(new InputStreamReader(url.openStream()));\n while ((bufferedLine = bufferedReader.readLine()) != null) {\n httpReturn.append(bufferedLine);\n }\n\n // Set userProtheus with json reponse.\n companysProtheus = (CompanyProtheus[]) new Gson().fromJson(httpReturn.toString(), CompanyProtheus[].class);\n listCompanysProtheus = new ArrayList<CompanyProtheus>(Arrays.asList(companysProtheus));\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return listCompanysProtheus;\n\n }", "private void fetchData() {\r\n RequesterBean requesterBean = new RequesterBean();\r\n requesterBean.setDataObject(hierarchyTitle);\r\n requesterBean.setFunctionType(GET_HIERARCHY_DATA);\r\n AppletServletCommunicator conn = new AppletServletCommunicator(connect,requesterBean);\r\n conn.send();\r\n ResponderBean responderBean = conn.getResponse();\r\n if(responderBean != null) {\r\n if(responderBean.isSuccessfulResponse()) {\r\n queryKey = hierarchyTitle;\r\n Hashtable htData = (Hashtable)responderBean.getDataObject();\r\n extractToQueryEngine(htData);\r\n }\r\n }else {\r\n //Server Error\r\n// throw new CoeusUIException(responderBean.getMessage(),CoeusUIException.ERROR_MESSAGE);\r\n }\r\n }", "void getPackageCatalogue(PackageCatalogueRetrieved callback);", "public void consulterCatalog() {\n\t\t\n\t}", "public static int doGetList(Result r) {\n // Make an HTTP GET passing the name on the URL line\n r.setValue(\"\");\n String response = \"\";\n HttpURLConnection conn;\n int status = 0;\n try {\n \n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n // tell the server what format we want back\n conn.setRequestProperty(\"Accept\", \"text/plain\");\n // wait for response\n status = conn.getResponseCode();\n // If things went poorly, don't try to read any response, just return.\n if (status != 200) {\n // not using msg\n String msg = conn.getResponseMessage();\n return conn.getResponseCode();\n }\n String output = \"\";\n // things went well so let's read the response\n BufferedReader br = new BufferedReader(new InputStreamReader(\n (conn.getInputStream()))); \n while ((output = br.readLine()) != null) {\n response += output; \n } \n conn.disconnect();\n \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n // return value from server\n // set the response object\n r.setValue(response);\n // return HTTP status to caller\n return status;\n }", "DataProviders retrieveProviders() throws RepoxException;", "DataProviders retrieveProviders() throws RepoxException;", "@Test\n public void getCatalogItemTest() throws ApiException {\n String asin = null;\n List<String> marketplaceIds = null;\n List<String> includedData = null;\n String locale = null;\n Item response = api.getCatalogItem(asin, marketplaceIds, includedData, locale);\n // TODO: test validations\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException\n {\n ServletPrinter sp = null;\n String region;\n String username=null, password=null;\n Context initialContext = null;\n\n sp = new ServletPrinter(response, \"BrowseCategories\", getServletContext());\n sp.printHTMLheader(\"RUBiS available categories\");\n sp.printHTML(\"<h2>Currently available categories</h2><br>\");\n try\n {\n initialContext = new InitialContext();\n } \n catch (Exception e) \n {\n printError(\"Cannot get initial context for JNDI: \" +e+\"<br>\", sp);\n return ;\n }\n\n region = request.getParameter(\"region\");\n username = request.getParameter(\"nickname\");\n password = request.getParameter(\"password\");\n \n\n SB_BrowseCategories sb_browseCategories = null;\n try \n {\n sb_browseCategories = (SB_BrowseCategories)PortableRemoteObject.narrow(initialContext.lookup(\"SB_BrowseCategoriesBean\"), SB_BrowseCategories.class);\n } \n catch (Exception e)\n {\n printError(\"Cannot lookup SB_BrowseCategories: \" +e+\"<br>\", sp);\n return ;\n }\n String list;\n try \n {\n list = sb_browseCategories.getCategories(region, username, password);\n } \n catch (Exception e)\n {\n printError(\"Cannot get the list of categories: \" +e+\"<br>\", sp);\n return ;\n }\n\n sp.printHTML(list);\n sp.printHTMLfooter();\n }", "public void doOslcGet(HttpServletRequest request, HttpServletResponse response,\n\t\t\tList<String> oslcCommand, ISmService smService) throws Exception {\n\n\t\tDatabase db = getDatabase();\n\t\tString query = smService.getParam(request, \"query\");\n\t\tif (oslcCommand.size() == 1 && Strings.isNullOrEmpty(query)) { // This is a repository/<accessName> case (but not query) - it is an OSLC repository, and we respond with\n\t\t\t// a description of this service provider.\n\t\t\tnew OSLCHelper(getDatabase()).respondForServiceProvider(oslcCommand.get(0), request, response, smService);\n\t\t\treturn;\n\t\t}\n\t\tString id = \"\";\n\t\tString version = null;\n\t\tString versionInfo = \"\";\n\t\tif (null != smService) {\n\t\t\tid = smService.getParam(request, \"id\");\n\t\t\tversion = smService.getParam(request, \"version\");\n\t\t\tif (false == Strings.isNullOrEmpty(version) && false == \"current\".equals(version))\n\t\t\t\tversionInfo = \"&nbsp;&nbsp;[ For version \" + Repository.dateOfVersion(version).toString() + \"]\";\n\t\t}\n if (oslcCommand.size() < 1)\n {\n response.setStatus(HttpStatus.SC_NOT_ACCEPTABLE);\n Utils.respondWithText(response, \"No API found for unspecific repository\");\n return;\n }\n\n String contentType = smService.getParam(request, Database.Vars.contentType.toString());\n if (Strings.isNullOrEmpty(contentType)) {\n \tcontentType = db.getVar(Database.Vars.contentType.toString());\n } else\n \tdb.setVar(Database.Vars.contentType.toString(), contentType);\n\n if ((false == Utils.willAccept(IConstants.HTML, request) && false == Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) || \n \t\tStrings.isNullOrEmpty(contentType)) {\n \tcontentType = Utils.formatFromAcceptType4Jena(request);\n }\n\n\t\tADatabaseRow row = db.getItem(id);\n String domain = oslcCommand.get(0);\n if (null == row && null != domain)\n \trow = db.getPort4Domain(domain);\n try\n {\n Repository repository = (Repository) row.getModelRepository(); // This is a model repository.// Repository.create(row);\n Model model = repository.getModelForVersion(version, null);\n if (null == model)\n \tmodel = repository.getModel();\n\n \tString select = smService.getParam(request, \"select\");\n \tString where = smService.getParam(request, \"where\");\n \tString orderBy = smService.getParam(request, \"orderBy\");\n \tString restore = smService.getParam(request, \"restore\");\n \tString name = smService.getParam(request, \"name\");\n \tString save = smService.getParam(request, \"save\");\n \tString deleteSaved = smService.getParam(request, \"deleteSaved\");\n\n\n if (false == Strings.isNullOrEmpty(query)) {\n \tJSONObject contents = makeInitialJsonForSparql(query, repository, id, version);\n \tJSONObject jo = getQueryParams(smService, request);\n \tIterator<?> keys = jo.keys();\n \twhile (keys.hasNext()) {\n \t\tString key = (String)keys.next(); // JSONObject.getNames(jo)) {\n \t\tcontents.put(key, Utils.safeGet(jo, key));\n// \t\tcontents.putAll(getQueryParams(smService, request));\n \t}\n Utils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n } else if (oslcCommand.size() == 2 && \"sparql\".equals(oslcCommand.get(1))) {\n \t \n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = where.trim();\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents.toString() + \"]\");\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \treturn;\n }\n\n String base = repository.getBase(); //getModel().getNsPrefixURI(\"base\");\n List<Resource> R = new ArrayList<Resource>();\n \tboolean isSingleResource = false;\n \n String title = \"\";\n if (oslcCommand.size() == 2 && null != smService.getParam(request, \"sparql\")) {\n \t// do sparql instead of standard oslc query\n \tif (Strings.isNullOrEmpty(select) || Strings.isNullOrEmpty(where)) {\n \t\tUtils.respondWithText(response, \"Illegal query, no SELECT or WHERE\");\n \t\treturn;\n \t}\n \tselect = select.trim();\n \twhere = \"{ \" + where.trim() + \" } \";\n \tif (Strings.isNullOrEmpty(orderBy))\n \t\torderBy = \"\";\n \torderBy = orderBy.trim();\n \tJSONObject contents = getSparqlContents(request, repository, select, where, orderBy, id, smService,\n \t\t\tname, false == Strings.isNullOrEmpty(restore),\n \t\t\tfalse == Strings.isNullOrEmpty(save),\n \t\t\tfalse == Strings.isNullOrEmpty(deleteSaved));\n \tif (Utils.willAccept(IConstants.PLAIN_TEXT_TYPE, request)) { // This is an AJAX query to get list of resources,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t// yet the list needs to be formatted according to the contentType\n \t\tString resOpen = \"\\\"\", resClose = \"\\\"\";\n \t\tif (contentType.equals(IConstants.N_TRIPLE) || \n// \t\t\tcontentType.equals(IConstants.NTRIPLE) ||\n \t\t\tcontentType.equals(IConstants.TURTLE) ||\n \t\t\tcontentType.equals(IConstants.N3)\n \t\t\t) {\n \t\t\t\tresOpen = \"<\";\n \t\t\t\tresClose = \">\";\n \t\t}\n\n \t\tStringBuffer sb = new StringBuffer();\n \t\tJSONArray rows = (JSONArray) Utils.safeGet(contents, \"rows\");\n \t\tif (rows.length() < 1)\n \t\t\tsb.append(\"No resources reference url for \" + where.split(\" \")[3].trim());\n \t\telse { \n \t\t\tsb.append(\"Following resources reference \" + where.split(\" \")[3].trim());\n \t\t\tfor (int i=0; i < rows.length(); i++) {\n \t\t\t\tJSONObject theRow = (JSONObject) rows.get(i); \n \t\t\t\tJSONArray values = (JSONArray) Utils.safeGet(theRow, \"values\");\n \t\t\t\tfor (int j=0; j < values.length(); j++) {\n \t\t\t\t\tJSONObject val = (JSONObject) values.get(j);\n \t\t\t\t\tsb.append(\"\\n\").append(resOpen).append(base).append(Utils.safeGet(val, \"td\").toString().split(\":\")[1]).append(resClose);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tUtils.respondWithText(response, sb.toString());\n \t} else {\n// \t\tSystem.out.println(\"Contents for the SPARQL query page:\\n[\" + contents + \"]\");\n \tcontents.put(\"moreOrLess\", smService.getParam(request, \"moreOrLess\"));\n \tUtils.respondGetWithTemplateAndJson(contents, \"/templates/sparql.html\", response);\n \t}\n \treturn;\n } else if (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1))) { // single resource\n// boolean isSingleResource = (oslcCommand.size() > 2 && \"resource\".equals(oslcCommand.get(1)));\n// if (isSingleResource) {\n \tResource r = model.getResource(base + oslcCommand.get(2));\n \ttitle = \"Resource [\" + r.getURI() + \"] in Domain [\" + domain + \"]\";\n \tR.add(r);\n \tisSingleResource = true;\n \t//getOslcresourcdeNew(base, repository, oslcCommand.get(2));\n } else {\n \n \ttitle = \"Resources in \" + ((\"\".equals(id))?\"\":\"[\" + id + \"], \") + \"Domain [\" + domain + \"]\";\n \tif (oslcCommand.size() <= 2) {\n \t\tString oslcWhere = smService.getParam(request, \"oslc.where\");\n \t\tString oslcPrefix = smService.getParam(request, \"oslc.prefix\");\n// \t\tString oslcProperties = smService.getParam(request, \"oslc.properties\");\n// \t\tString oslcOrderBy = smService.getParam(request, \"oslc.orderBy\");\n\n \t\t// Handle the oslc prefixes:\n \t\tMap<String, String> prefixMap = new HashMap<String, String>();\n\n \t\tif (false == Strings.isNullOrEmpty(oslcPrefix))\n \t\t\ttry {\n \t\t\t\tprefixMap = QueryUtils.parsePrefixes(oslcPrefix);\n \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n \t\t\t\tthrow new IOException(e.getMessage());\n \t\t\t}\n\n\n \t\t\t// Handle the oslc properties part:\n// \t\t\tProperties properties = null;\n//\n// \t\t\ttry {\n// \t\t\t\tif (Strings.isNullOrEmpty(oslcProperties)) {\n// \t\t\t\t\tproperties = QueryUtils.WILDCARD_PROPERTY_LIST;\n// \t\t\t\t} else\n// \t\t\t\t\tproperties = QueryUtils.parseSelect(oslcProperties, prefixMap);\n// \t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t} catch (RuntimeException e) {\n// \t\t\t\te.printStackTrace();\n// \t\t\t}\n\n// \t\t\t// Handle the oslc where clause:\n// \t\t\tWhereClause whereClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcWhere)) {\n// \t\t\t\ttry {\n// \t\t\t\t\twhereClause = QueryUtils.parseWhere(oslcWhere, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\t// Handle the oslc order by clause:\n// \t\t\tOrderByClause orderByClause = null;\n//\n// \t\t\tif (false == Strings.isNullOrEmpty(oslcOrderBy)) {\n// \t\t\t\ttry {\n// \t\t\t\t\torderByClause = QueryUtils.parseOrderBy(oslcOrderBy, prefixMap);\n// \t\t\t\t} catch (org.eclipse.lyo.core.query.ParseException e) {\n// \t\t\t\t\tthrow new IOException(e.getMessage());\n// \t\t\t\t}\n// \t\t\t}\n\n// \t\t\tModel model = repository.getModel();\n \t\t\tif (Strings.isNullOrEmpty(oslcWhere)) {\n \t\t\t\tResIterator it = model.listSubjects();\n \t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\tResource res = it.next();\n \t\t\t\t\tif (res.getURI().startsWith(base))\n \t\t\t\t\t\tR.add(res);\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tprefixMap.putAll(model.getNsPrefixMap());\n \t\t\t\tprefixMap = Utils.fixNsPrefixes(prefixMap);\n \t\t\t\tString prefix = Utils.makePrefix4Query(prefixMap);\n \t\t\t\tString sparql = \"SELECT ?r WHERE + { ?r ?p ?v }\";\n \t\t\t\tString t[] = oslcWhere.split(\"=\");\n \t\t\t\tif (t.length > 1) {\n \t\t\t\t\tString pred = t[0].trim();\n \t\t\t\t\tString value = t[1].trim();\n \t\t\t\t\tsparql = prefix + \"SELECT ?r WHERE { ?r \" + pred + \" \" + value + \". }\";\n \t\t\t\t\tQueryExecution qexec = QueryExecutionFactory.create(sparql, model);\n \t\t\t\t\tResultSet rslt = qexec.execSelect();\n \t\t\t\t\twhile (rslt.hasNext()) {\n \t\t\t\t\t\tQuerySolution soltn = rslt.next();\n \t\t\t\t\t\tRDFNode r = (RDFNode) soltn.get(\"r\");\n \t\t\t\t\t\tif (r.toString().startsWith(base))\n \t\t\t\t\t\t\tR.add((Resource)r);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tnew OSLCHelper(getDatabase()).repsondForOslcQuery(R, request, response, smService, id);\n \t\t\treturn;\n \t} else {\n \t\tString resource = oslcCommand.get(1), N = \"\";\n \t\tif (resource.startsWith(\"resource#\"))\n \t\t\tN = resource.substring(\"resource#\".length());\n \t\telse if (resource.startsWith(\"resource/\"))\n \t\t\tN = resource.substring(\"resource/\".length());\n \t\tR.add(model.getResource(base + N));\n \t}\n }\n Model tmpModel = ModelFactory.createDefaultModel();\n // \tmodel.setNsPrefixes(Utils.fixNsPrefixes(repository.getModel().getNsPrefixMap()));\n for (Resource res : R) {\n \tStmtIterator it = res.listProperties();\n \twhile (it.hasNext()) {\n \t\tStatement stmt = it.next();\n \t\ttmpModel.add(stmt);\n \t}\n }\n\n// \tString type = Utils.formatFromAcceptType4Jena(request);\n// \tif (Utils.willAccept(ContentTypes.HTML, request)) {\n// \t\ttype = db.getVar(Database.Vars.contentType.toString());\n// \t}\n \tString output = Utils.modelToText(tmpModel, contentType);\n\n response.setHeader(HttpHeaders.ETAG, repository.getEtag());\n\n JSONObject contents = new JSONObject();\n contents.put(\"rdf\", output);\n contents.put(\"id\", id);\n String url = request.getRequestURL().toString(); //.getUri();\n if (url.indexOf('?') >=0)\n \turl = url.substring(0, url.indexOf('?'));\n contents.put(\"url\", url);\n contents.put(Database.Vars.contentType.toString(), db.getVar(Database.Vars.contentType.toString()));\n contents.put(\"header\", title);\n \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"host\", db.getHost(true, true));// db.getBaseURL()); //Utils.getHost(null, true));\n \t\tcontents.put(\"canmodify\", \"true\");\n \t\tcontents.put(\"version\", Strings.isNullOrEmpty(version)?\"\":version);\n contents.put(\"versionInfo\", versionInfo);\n //.processModelForJson(domain, \"ShowRDF\", repository, title, id, R);\n\n// \t\tString acceptType = Utils.formatFromAcceptType4Jena(request);\n\n \tif (Utils.willAccept(IConstants.HTML, request)) {\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tcontents.put(\"hideGraphics\", \"\");\n \t\tUtils.respondGetWithTemplateAndJson(contents, \"/templates/rdf4oslc.html\", response);\n \t} else if (Utils.willAccept(IConstants.JSON, request)){\n// \t\tJSONObject contents = SmManager.processModelForJson(domain, \"ShowRDF\", model, title, id, true);\n// \t\tcontents.put(\"canDownload\", isSingleResource?\"false\":\"true\");\n \t\tUtils.respondWithJson(response, contents);\n \t} else {\n \t\tUtils.respondWithText(response, output, contentType);\n \t}\n }\n catch (Exception e)\n {\n e.printStackTrace();\n throw new Exception(\"OSLC failed [\" + e.getMessage() + \"].\");\n }\n\t}", "private Collection<ConnectionEntry> getMyInvites(Map<String, String> parameters)throws ProfileServiceException{\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.entering(sourceClass, \"getMyInvites\", parameters);\n \t\t}\n \n \t\tDocument data = null;\n \t\tCollection<ConnectionEntry> invites = null;\n \t\tString url = resolveProfileUrl(ProfileEntity.NONADMIN.getProfileEntityType(),\n \t\t\t\tProfileType.CONNECTIONS.getProfileType());\n \t\tdata = executeGet(url, parameters, ClientService.FORMAT_XML);\n \t\tif(parameters.containsKey(\"outputType\")){\n \t\t\tif(parameters.get(\"outputType\").equalsIgnoreCase(\"profile\")){\n \t\t\t\tinvites = Converter.returnConnectionEntries(data, \"profile\");\n \t\t\t}\n \t\t\telse \n \t\t\t\tinvites = Converter.returnConnectionEntries(data, \"connection\");\n \t\t}\n \t\telse{\n \t\t\tinvites = Converter.returnConnectionEntries(data, \"connection\");\n \t\t}\n \t\tif (logger.isLoggable(Level.FINEST)) {\n \t\t\tlogger.exiting(sourceClass, \"getMyInvites\");\n \t\t}\n \t\treturn invites;\n \t}", "@GET\n public List<TrayectoDetail> darTrayectos() {\n \n List<TrayectoDetail> listaTrayecto = listEntity2DetailDTO(trayectoLogic.getTrayectos());\n LOGGER.log(Level.INFO, \"BookResource getBooks: output: {0}\", listaTrayecto);\n return listaTrayecto;\n }", "@POST\r\n @GET\r\n @Path(\"/v1.0/produtos\")\r\n @Consumes({ WILDCARD })\r\n @Produces({ APPLICATION_ATOM_XML, APPLICATION_JSON + \"; charset=UTF-8\" })\r\n public Response listarProdutos() {\r\n\r\n log.debug(\"listarProdutos: {}\");\r\n\r\n try {\r\n\r\n List<Produto> produtos = produtoSC.listar();\r\n\r\n return respostaHTTP.construirResposta(produtos);\r\n\r\n } catch (Exception e) {\r\n\r\n return respostaHTTP.construirRespostaErro(e);\r\n }\r\n }", "public List<Client> getAllClient();", "@GET(Url.END_POINT)\n Call<ArrayList<Recipe>> getRecipes();", "ProductCatelogueResponse getProductCatelogues();", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String obtener() {\n logger.debug(\"Obteniendo todos los equipos\");\n Set<Sala> salas= salaService.buscarTodasLasSalasSimples();\n logger.debug(\"Obtenidas.\");\n Genson genson = new Genson();\n String retorno = genson.serialize(salas);\n logger.debug(retorno);\n return retorno;\n }", "public List<Compte> getComptesClient(int numeroClient);", "public void showCatalogue() {\n for (Record r : cataloue) {\n System.out.println(r);\n }\n }", "private static OSS getClient(){\n ClientConfiguration conf = new ClientConfiguration();\n conf.setConnectionTimeout(15 * 1000); // connction time out default 15s\n conf.setSocketTimeout(15 * 1000); // socket timeout,default 15s\n conf.setMaxConcurrentRequest(5); // synchronous request number,default 5\n conf.setMaxErrorRetry(2); // retry,default 2\n OSSLog.enableLog(); //write local log file ,path is SDCard_path\\OSSLog\\logs.csv\n\n // using STS, safer method\n// OSSCredentialProvider credentialProvider = new\n//// OSSStsTokenCredentialProvider(\"LTAI4FcJvJqKBATQSHtdBWLQ\",\n//// \"Q6ocdnZ211qGhyrSJq2c5jMEMugoor\",\n//// \"<StsToken.SecurityToken>\");\n // deprecated method\n OSSCredentialProvider credentialProvider = new\n OSSPlainTextAKSKCredentialProvider(ACS_KEY_ID, ACS_KEY_SCT);\n\n OSS oss = new OSSClient(Factory.app(), END_POINT, credentialProvider, conf);\n return oss;\n }", "void getMarketOrders();", "@GET \n @Produces(\"text/plain\")\n public String getIt() {\n \tGraphDAO dao = GraphDAO.getInstance();\n \tdao.init(\"graphdbs/ComboBreaker\");\n \tString retVal = dao.outputGraphNodes();\n \treturn retVal;\n }", "private void _loadCatalog() {\n if (discoveryEndpoint != null) {\n try {\n ResponseEntity<String> response = restTemplate.getForEntity(discoveryEndpoint, String.class);\n\n if (response.getStatusCode() == HttpStatus.OK) {\n String body = response.getBody();\n this.catalog = CdsHooksUtil.GSON.fromJson(body, CdsHooksCatalog.class);\n startPendingRequests();\n return;\n }\n } catch (Exception e) {\n log.warn(\"Failed to load CDS catalog for \" + discoveryEndpoint\n + \".\\nRetries remaining: \" + retries + \".\");\n }\n\n retry();\n }\n }", "public List<T> showAllClients();", "@GET\n @Path(\"location/Arovince\")\n @Produces(\"application/json\")\n public String getJson() throws IOException {\n FileWriter file = new FileWriter(\"/home/component/NetBeansProjects/ArovinceAndSchool/web/api/Arovince.json\");\n JSONObject jsonArray = null;\n\n try {\n URL url = new URL(\"https://opend.data.go.th/get-ckan/datastore_search?resource_id=df922923-e009-4dee-92fc-d963a86ce4b8\"); \n HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"api-key\", \"XOe9aVTolOhCbyTU103IqAKTNNNPX8b5\");\n String line = \"\";\n InputStreamReader inputStreamReader = new InputStreamReader(httpURLConnection.getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n StringBuilder response = new StringBuilder();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n file.write(line);\n response.append(line);\n }\n } catch (IOException var10) {\n }\n\n file.close();\n bufferedReader.close();\n jsonArray = new JSONObject(response.toString());\n return jsonArray.toString(4);\n } catch (Exception var11) {\n return \"\" + var11;\n }\n }", "@Test\n public void getCatalogSalesTest() {\n Integer size = null;\n Integer page = null;\n String order = null;\n // PageResourceCatalogSale response = api.getCatalogSales(size, page, order);\n\n // TODO: test validations\n }", "List<CustomizeProfileModel> getJetspeedInformationByAgencyCode(String servProvCode, String connType) throws AAException;", "@Override\n\tpublic String listarClientes() throws MalformedURLException, RemoteException, NotBoundException {\n\t\tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tString lista = datos.listaClientes();\n \treturn lista;\n \t\n\t}", "public void recuperarFacturasCliente(){\n String NIF = datosFactura.recuperarFacturaClienteNIF();\n ArrayList<Factura> facturas = almacen.getFacturas(NIF);\n if(facturas != null){\n for(Factura factura : facturas) {\n System.out.println(\"\\n\");\n System.out.print(factura.toString());\n }\n }\n System.out.println(\"\\n\");\n }", "private void getVoices() throws Exception{\r\n\r\n\t\tFestival f = new Festival(\"\",\"1\");\r\n\t\t_voices = f.listOfVoices();\r\n\r\n\t}", "public ProductCatalog getCatalog() throws RemoteException;", "public List<BarrioCovid> readAll(String email);", "public Catalogue getCatalogue() {\n return catalogue;\n }", "private static void consultaCategoria() throws Exception {\r\n boolean erro;\r\n int idCategoria;\r\n String nomeCategoria;\r\n ArrayList<Produto> lista;\r\n System.out.println(\"\\t** Listar produtos de uma categoria **\\n\");\r\n do {\r\n erro = false;\r\n System.out.print(\"ID da categoria a ser consultada: \");\r\n idCategoria = read.nextInt();\r\n if (idCategoria <= 0) {\r\n erro = true;\r\n System.out.println(\"ID Inválida! \");\r\n }\r\n System.out.println();\r\n } while (erro);\r\n lista = listProdutosPorCategoria(idCategoria);\r\n if (lista != null && !lista.isEmpty()) {\r\n nomeCategoria = getNomeCategoria(idCategoria - 1);\r\n System.out.println(\"Produtos pertencentes a '\" + nomeCategoria + \"'\");\r\n for (Produto p : lista) {\r\n System.out.println(\r\n \"Id: \" + p.getID()\r\n + \"\\nNome: \" + p.nomeProduto\r\n + \"\\nDescricao: \" + p.descricao\r\n + \"\\nPreco: \" + tf.format(p.preco)\r\n + \"\\nMarca: \" + p.marca\r\n + \"\\nOrigem: \" + p.origem\r\n + \"\\nCategoria: \" + nomeCategoria\r\n );\r\n }\r\n } else {\r\n System.out.println(\"Não ha produtos nessa categoria, ou ela não existe!\");\r\n }\r\n }", "@Test\n public void test010() {\n List<String> storeServices = response.extract().path(\"data.services[9].storeservices\");\n\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"get storeservices of the store where service name = Sony Experience:\" + storeServices);\n System.out.println(\"------------------End of Test---------------------------\");\n }", "@GET\n @Path(\"/ostenants\")\n @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })\n @CheckPermission(roles = { Role.SECURITY_ADMIN })\n public OSTenantListRestRep listCoprhdOsTenants() {\n\n _log.debug(\"Keystone Service - listCoprhdOsTenants\");\n\n List<OSTenant> tenants = getOsTenantsFromCoprhdDb();\n\n return map(tenants);\n }", "public void MockForRetrieveCollectionList(){\n try {\n Mockito.when(clsProperties.getPropertyByPlatform(CLSInterfaceProperties.COMMON_TIMEOUT)).thenReturn(\"30000\");\n HashMap credentialsMap = new HashMap();\n credentialsMap.put(\"sAppID\", \"paperlessNAR\");\n credentialsMap.put(\"sPassword\", \"95fs6521fa\");\n \n PowerMockito.doReturn(credentialsMap).when(clsFacade, \"getCredentials\", CLSInterfaceProperties.APP_PAPERLESS_COLLECTION_RETRIEVAL);\n URL url = new URL(\"http://ixservice.ete.cathaypacific.com:80/ixClsNARPortal/PaperlessCollectionRetrievalServlet\");\n PowerMockito.doReturn(url).when(clsFacade, \"getURLForApp\", CLSInterfaceProperties.APP_PAPERLESS_COLLECTION_RETRIEVAL);\n \n } catch (CLSException e) {\n System.out.println(\"Retrieve Collection List take CLSException: \" + e);\n } catch (MalformedURLException e) {\n System.out.println(\"Retrieve Collection List take MalformedURLException: \" + e);\n } catch (Exception e) {\n System.out.println(\"Retrieve Collection List take Exception: \" + e);\n }\n }", "public List<CatCurso> consultarCatCurso()throws NSJPNegocioException;", "@O2Client\n @GET\n @Path(\"/client\")\n public Response clientAuthorizedGET(@Context final SecurityContext c) {\n return Response.ok().build();\n }", "public ACommunity getCisInformation(String client, String cisId);", "private void getExchangeDetails(RoutingContext routingContext) {\n LOGGER.debug(\"Info: getExchange method started;\");\n JsonObject requestJson = new JsonObject();\n HttpServerRequest request = routingContext.request();\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/management/exchange\");\n LOGGER.debug(\"Info: request :: ;\" + request);\n LOGGER.debug(\"Info: request json :: ;\" + requestJson);\n String exchangeId = request.getParam(EXCHANGE_ID);\n String instanceID = request.getHeader(HEADER_HOST);\n requestJson.put(JSON_INSTANCEID, instanceID);\n HttpServerResponse response = routingContext.response();\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson, authenticationInfo, authHandler -> {\n if (authHandler.succeeded()) {\n Future<JsonObject> brokerResult =\n managementApi.getExchangeDetails(exchangeId, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.info(\"Success: Getting exchange details\");\n handleSuccessResponse(response, ResponseType.Ok.getCode(),\n brokerResultHandler.result().toString());\n } else if (brokerResultHandler.failed()) {\n LOGGER.error(\"Fail: Bad request\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else if (authHandler.failed()) {\n LOGGER.error(\"Fail: Unauthorized\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.error(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n }", "public static void main(String[] args) {\n EosApi api = EosApiFactory.create(\"https://api.jungle.alohaeos.com\");\n //EosApi api = EosApiFactory.create(\"https://jungle.cryptolions.io\");\n //EosApi api = EosApiFactory.create(\"https://eos.newdex.one\");\n //System.out.println(api.getChainInfo());\n //buyRam(api, \"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\", \"bihuexwallet\", \"bihuexwallet\",15000);\n //delegate(api, \"5KD2hyi84H46ND8citJr6L84mYegnX1UKw9osLnF3qpcjoeRAAn\", \"carilking111\", \"carilking444\",\"1.5000 EOS\",\"1.5000 EOS\");\n //updateAuth(api,\"5JhoFQMN9xWGMFfUDJHHPVsuSytSDot8Q5TNv3rN6VVGPbjTrGN\",\"carilking444\",\"EOS82Psyaqk86jbSdSmGzonNCUHsBp1Xj42q37g6UkiA1UhzLe57j\",\"active\");\n //updateAuth(api,\"5JrTcSsUmzoLDxsNFcpGBRt2Wd488qTmHp5yfBPy71MbxaqSJ4g\",\"carilking555\",\"EOS5X6Sbmbc2zaJ8EHNZmdSnA26DsuTim59pdUNiNd34HugzvTp5m\",\"active\");\n //transfer(api,\"5JhoFQMN9xWGMFfUDJHHPVsuSytSDot8Q5TNv3rN6VVGPbjTrGN\", \"carilking444\",\"carilking111\",BigDecimal.valueOf(0.01),\"喵喵喵~\");\n //Object obj=api.getTransaction(new TransactionRequest(\"e5aeee319e8c767cdda35a3b6d460328f958833e58723bc18581765494018700\"));\n //System.out.println(obj);\n List<String> accounts = new ArrayList<>();\n accounts.add(\"carilking111\");\n accounts.add(\"carilking444\");\n //updateMultipleAuth(api, \"5JPNqMSZ8M567hgDGW9CmD9vr2RaDm1eWpJqHaHa2S5xKTMmFKm\", \"heydoojqgege\", 2, accounts, \"active\");\n //proposeTransfer(api, \"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\", \"bihuexwallet\", \"firstmsig152\", \"heydoojqgege\", \"carilking222\", BigDecimal.valueOf(0.2), \"test1\", accounts);\n //approveTransfer(api,\"5KD2hyi84H46ND8citJr6L84mYegnX1UKw9osLnF3qpcjoeRAAn\",\"carilking111\",\"bihuexwallet\",\"firstmsig151\");\n //execPropose(api,\"5K3iYbkjpvZxxAJyHQVAtJmCi4CXetBKq3CfcboMz21Y5Pjvovo\",\"bihuexwallet\",\"bihuexwallet\",\"firstmsig151\");\n }", "public static List<Object[]> getServerDetails(){\n\t\t\n\t\tString filePath = Holders.getFlatConfig().get(\"statusFile.use\").toString();\n\n\t\treturn getServerDetailsFromCSV(filePath, \"hostname\", \"user\",\"password\");\n\t}", "@GET\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response getTipos() {\n\t\tRotondAndesTM tm = new RotondAndesTM(getPath());\n\t\tList<Tipo> Tipos;\n\t\ttry {\n\t\t\tTipos = tm.darTipos();\n\t\t} catch (Exception e) {\n\t\n\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\n\t\t}\n\t\treturn Response.status(200).entity(Tipos).build();\n\t}", "private void getAnimalCategory() {\n mProgressBar.setVisibility(View.VISIBLE);\n VolleyInvokeWebService volleyClient = new VolleyInvokeWebService(this, VolleyInvokeWebService.JSON_TYPE_REQUEST, this, Request.Method.GET);\n volleyClient.hitWithOutTokenService(Constants.GET_ANIMAL_CATEGORY, null, GET_ANIMAL_CATEGORY_TAG);\n }", "@Path(\"/productos\")\n @GET\n @Produces(MediaType.APPLICATION_JSON) //Por que una track si la aceptaba (ejemplo) pero un producto no?\n public String productos(){\n return test.getProductos().get(\"Leche\").toString();\n\n }", "List<CatalogoAprobadorDTO> buscarAprobador(int cveADM, String numEmpleado, Integer claveNivel, Integer centroCostoOP) throws SIATException;", "@GET(\"/books/{isbn}/commercialOffers\")\n Call<Offers> getBestOffers(@Path(\"isbn\") String param);", "public static void main(String[] args) {\n\t\tRestTemplate restTemplate = new RestTemplate(); \r\n\t\t String url = \"http://www.omdbapi.com/?t=titanic&y=&plot=short&r=json\";\r\n\t\t //restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());\r\n\t\t \r\n\t\t Pelicula peli = restTemplate.getForObject(url, Pelicula.class); \r\n\t\t \r\n\t\t \r\n\t\t System.out.println(peli.getDirector());\r\n\t}", "private void getCities(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tCitiesServiceImpl cities = new CitiesServiceImpl();\n\t\t\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Cities> select = cities.selectAllId(\"2\");\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\n\t}", "@GET\n\t@Path(\"/carrocerias\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic ArrayList<CarroceriaDTO> listarCarrocerias(){\n\t\tSystem.out.println(\"ini: listarCarrocerias()\");\n\t\t\n\t\tCarroceriaService tipotService = new CarroceriaService();\n\t\tArrayList<CarroceriaDTO> lista = tipotService.ListadoCarroceria();\n\t\t\n\t\tif (lista == null) {\n\t\t\tSystem.out.println(\"Listado Vacío\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Consulta Exitosa\");\n\t\t}\n\n\t\tSystem.out.println(\"fin: listarCarrocerias()\");\n\t\t\n\t\treturn lista;\n\t}", "public static void main(String[] args) {\n\t\tList<Customer> customerList=new ArrayList<Customer>();\n\t\tCluster cluster = null;\n\t\tSession session = null;\n\t\ttry {\n\n\t\t\tcluster = Cluster\n\t\t\t\t\t.builder()\n\t\t\t\t\t.addContactPoints(LOCAL_HOST_IP)\n\t\t\t\t\t.withProtocolVersion(ProtocolVersion.NEWEST_SUPPORTED)\n\t\t\t\t\t.build();\n\t\t\t\n\t\t\tsession = cluster.connect(CAS_KEYSPACE);\n\t\t\tSystem.out.println(\"Connection Successful\");\n\n\t\t\t\n\t\t\tResultSet execute = session.execute(\"select * from orders\");\n\n\t\t\tfor (Row row : execute) {\n\t\t\t\tUDTValue customerUDT = row.get(\"customer\",UDTValue.class);\n\t\t\t\tCustomer customer=new Customer();\n\t\t\t\tcustomer.setId(customerUDT.get(0, String.class));\n\t\t\t\tcustomer.setName(customerUDT.get(1, String.class));\n\t\t\t\tcustomer.setCouponCode(customerUDT.get(2, String.class));\n\t\t\t\tcustomer.setAddress(customerUDT.get(3, String.class));\n\t\t\t\tcustomerList.add(customer);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Customer List :: \"+customerList);\n\t\t\t\n\n\t\t} catch (Exception exp) {\n\t\t\texp.printStackTrace();\n\t\t} finally {\n\t\t\tcluster.close();\n\t\t}\n\t}", "Client getPrefDentist();", "@GET\r\n @Produces(MediaType.APPLICATION_JSON)\r\n @Path(\"ServicioMonto/list\")\r\n public ArrayList<ServicioMonto> getXmlc() throws Exception {\n ArrayList<ServicioMonto> lista=new ArrayList<ServicioMonto>();\r\n lista=ServicioMonto.servicio_monto();\r\n return lista;\r\n }", "@Test\n public void getCatalogSaleTest() {\n Integer id = null;\n // CatalogSale response = api.getCatalogSale(id);\n\n // TODO: test validations\n }", "public String getAPI()\n {\n ResponseEntity<String> person;\n\n /*\n\t\t * Headers for the response type if we want to return JSON response then we\n\t\t * require to add.\n */\n HttpHeaders headers = new HttpHeaders();\n\n /*\n\t\t * Adding of the response header with application/json type\n */\n headers.add(\"Accept\", \"application/json\");\n\n /*\n\t\t * Creation of the Entity object for the adding the headers into request.\n */\n entity = new HttpEntity<>(headers);\n\n /*\n\t\t * Creation of REST TEMPLET object for the executing of the REST calls.\n */\n restTemplate = new RestTemplate();\n\n /*\n\t\t * Adding the basic type of authentication on the REST TEMPLETE.\n */\n restTemplate.getInterceptors()\n .add(new BasicAuthorizationInterceptor(\"Administrator\", \"Oneeight@admin18\"));\n\n /*\n\t\t * Execution of the REST call with basic authentication and JSON response type\n */\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/login?username=Administrator&password=Oneeight@admin18\", HttpMethod.POST, entity, String.class);\n System.out.println(\"\"+person.toString());\n //headers.add(\"Cookie\", \"JSESSIONID=0FC37952D64B545C46969EFEC0E4FD12\");\n headers.add(\"Cookie\", person.getHeaders().getFirst(HttpHeaders.SET_COOKIE));\n entity = new HttpEntity<>(headers);\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/analytics/v1.0.0/data/provider/tenants/OneEight/features/SDWAN/?qt=summary&start-date=1daysAgo&end-date=today&q=linkusage(site)&metrics=volume-rx&metrics=volume-tx&metrics=volume-rx&metrics=volume-tx&metrics=bandwidth&ds=aggregate&count=10\", HttpMethod.GET, entity, String.class);\n\n /*\n\t\t * Returning the response body with string format that easily readable.\n */\n return person.getBody();\n }", "EcnonetsPackage getEcnonetsPackage();", "public List<VPlexClusterInfo> getClusterInfoDetails() throws VPlexApiException {\n s_logger.info(\"Request for complete detailed cluster info for VPlex at {}\", _baseURI);\n return _discoveryMgr.getClusterInfo(false, true);\n }", "public void retrieveCardInventoryList() {\n try {\n systemResultViewUtil.setCardInventoryDataBeansList(cardInventoryTransformerBean.retrieveAllCardInventory());\n System.out.println(\"Retrive CardInventory Successfully\");\n } catch (Exception e) {\n System.out.println(e);\n System.out.println(\"Error in Retrive CardInventory\");\n }\n }", "@GET\r\n @Produces(MediaType.APPLICATION_JSON)\r\n @Path(\"StockProducto/list\")\r\n public ArrayList<StockProducto> getXmls() throws Exception {\n ArrayList<StockProducto> lista=new ArrayList<StockProducto>();\r\n lista=StockProducto.stockproducto();\r\n return lista;\r\n }", "public List<CatalogDescription> getCatalogDescriptions(Map<String, String> eqCriteria, Map<String, String> searchCriteria);", "private void cclient() throws Exception {\n\n\t\tws.xml c = this.ls.cclient();\n\t\tfor (String[] row : c.t) {\n\t\t\tString pat1 = row[0];\n\t\t\tcomboBox.addItem(pat1);\n\t\t}\n\t}", "void retrieveBrokerList() {\n java.util.logging.Logger.getLogger(TAG).log(Level.INFO, \"Start: retrieveBrokerList()\");\n // request the list to the cloud\n // parse the response and add brokers to \"brokers\"\n NetworkThread thread = new NetworkThread();\n thread.start();\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n java.util.logging.Logger.getLogger(TAG).log(Level.INFO, \"Finish: retrieveBrokerList()\");\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getProductos() {\n //TODO return proper representation object\n return controller.mostrarProductos();\n }", "public List<CatalogDescription> getCatalogDescriptionsByDepartment(String department, boolean showInactives);", "@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getCpus() {\n\t\tList<CPU> itemList = ItemList.getInstance().getItemList();\n\t\treturn Response.ok(itemList).build();\n\t}", "private void doGetExercises() {\n if (getMobileClientService() == null) {\n Log.w(TAG, \"Service is still not bound\");\n gettingAllExercisesOperationResult(false, \"Not bound to the service\", null);\n return;\n }\n\n try {\n boolean isGetting = getMobileClientService().getAllExercises();\n if (!isGetting) {\n gettingAllExercisesOperationResult(false, \"No Network Connection\", null);\n }\n } catch (RemoteException e) {\n e.printStackTrace();\n gettingAllExercisesOperationResult(false, \"Error sending message\", null);\n }\n }", "public interface HostipalRequest {\n @GET(\"centrosatencion\")\n Call<ArrayList<HospitalEntity>> getHospital();\n}", "void fetchForSaleHousesData();", "public T doGet(String uri) throws AbstractRequestException, AbstractClientRuntimeException {\n OmcpClient omcpClient = this.osirisConnectionFactory.getConnection();\n Response omcpResponse = omcpClient.doGet(uri);\n this.osirisConnectionFactory.closeConnection(omcpClient);\n OmcpUtil.handleOmcpResponse(omcpResponse);\n T content = (T) omcpResponse.getContent();\n if(content == null) {\n throw new NotFoundException();\n }\n return content;\n }", "private void get_products_search()\r\n\r\n {\n MakeWebRequest.MakeWebRequest(\"get\", AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n AppConfig.SALES_RETURN_PRODUCT_LIST + \"[\" + Chemist_ID + \",\"+client_id +\"]\", this, true);\r\n\r\n// MakeWebRequest.MakeWebRequest(\"out_array\", AppConfig.SALES_RETURN_PRODUCT_LIST, AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n// null, this, false, j_arr.toString());\r\n //JSONArray jsonArray=new JSONArray();\r\n }", "String getCatalogName();", "private static void getTheData()\n {\n try\n {\n ITEMS = getSalesOrderSets();\n }\n catch (OnlineODataStoreException e)\n {\n Log.e(TAG, \"caught OnlineODataStoreException\");\n }\n }", "private java.util.List<pkg.Courses> getData(java.lang.String arg0) {\n pkg.CalWebService port = service.getCalWebServicePort();\r\n return port.getData(arg0);\r\n }", "public void getEasyCoopRoleparameters() {\r\n String name = \"\";\r\n String password = \"\";\r\n GendataService dbobj = new GendataService();\r\n dbobj.inimkcon();\r\n String mySQLString;\r\n mySQLString = \"select * FROM tblwebserv a where a.app = 'easycoop'\";\r\n ResultSet agRecSet;\r\n\r\n try {\r\n agRecSet = dbobj.retrieveRecset(mySQLString);\r\n\r\n while (agRecSet.next()) {\r\n name = agRecSet.getString(\"user\");\r\n password = agRecSet.getString(\"pwd\");\r\n }\r\n\r\n dname = name;\r\n dpwd = password;\r\n } catch (SQLException ex) {\r\n System.out.println(ex.getMessage());\r\n } finally {\r\n if (dbobj != null) {\r\n dbobj.closecon();\r\n }\r\n }\r\n }", "@GET\n \tpublic Response listCourses() throws JsonProcessingException {\n \t\tList<Course> courses = ofy().load().type(Course.class).list();\n \t\t\n \t\t// convert to json\n \t\tString json = new ObjectMapper().writeValueAsString(courses);\n \t\treturn Response.ok(Utils.JsonPad + json).build();\n \t}", "public static void example2(ApiEndpoint apiEndpoint, String email, String password) {\n System.out.println(\"--- EXAMPLE 2 ---\");\n try {\n HashMap<String, String> params = new HashMap<>();\n\n System.out.print(\"Retrieving authToken...\");\n AuthToken authToken = AuthService.getAuthToken(apiEndpoint, email, password);\n System.out.println(\"Done!\");\n\n System.out.print(\"Retrieving Vehicle List...\");\n // Uncomment following line, if you want to include the vehicles the user has been granted read rights to.\n //params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse vResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle\", ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+vResp.httpCode+\": \"+vResp.jsonArray.toJSONString());\n\n System.out.print(\"Retrieving first vehicle(including all vehicle states) from previous response...\");\n JSONObject firstV = (JSONObject)(vResp.jsonArray.get(0));\n params.clear();\n // we are settings all 'with*' to true here in order to retrieve all vehicle information and not just basic meta data\n params.put(\"withBase\", \"true\");\n params.put(\"withRemoteFunctionsState\", \"true\");\n params.put(\"withLockState\", \"true\");\n params.put(\"withClimaState\", \"true\");\n params.put(\"withDrivingState\", \"true\");\n params.put(\"withGeoState\", \"true\");\n params.put(\"withBatteryState\", \"true\");\n params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse singlevResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle/\"+firstV.get(\"id\"), ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+singlevResp.httpCode+\": \"+singlevResp.jsonObject.toJSONString());\n\n // Print out SoC\n JSONObject baseState = (JSONObject)(singlevResp.jsonObject.get(\"base\"));\n if(baseState != null) {\n System.out.println(\"Vehicle SoC: \" + baseState.get(\"soc\"));\n }\n\n } catch (RcmsClientException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(\"--- END OF EXAMPLE 2 ---\");\n }", "public String getClan();", "private List<Organization> getOrgs(String url, String filter) {\n // create response object\n NodeServiceListResponse<Organization> response = \n new NodeServiceListResponse<Organization>(Organization.class);\n List<Organization> orgList;\n\n try {\n // create http entity class with common headers\n HttpEntity entity = new HttpEntity(headers);\n\n // retrieve the response from the node service call\n response = NodeServicesUtil.getNodeListResponse(url, entity, \n HttpMethod.GET, response, filter);\n \n // retrieve data from the response object\n orgList = response.getConvertedData();\n\n // catch and log all errors from the service\n } catch (Exception e) {\n // error getting data\n orgList = new ArrayList<Organization>();\n LOG.error(\"There was an error getting organizations \" + e);\n }\n\n return orgList;\n }", "public Collection<Proyecto> leerProyectosCollection() {\n\t\t\tRestTemplate plantilla = new RestTemplate();\n\t\t\tProyecto[] proyecto = plantilla.getForObject(\"http://localhost:5000/proyectos\", Proyecto[].class);\n\t\t\tList<Proyecto> listaProyectos = Arrays.asList(proyecto);\n\t\t\treturn listaProyectos;\n\t\t}" ]
[ "0.5871291", "0.5689298", "0.5689298", "0.56828517", "0.56492746", "0.55824375", "0.5571718", "0.5571152", "0.5407667", "0.5366001", "0.52356297", "0.52261627", "0.5196408", "0.5184646", "0.51809925", "0.5180153", "0.51593035", "0.5152966", "0.5138634", "0.51328653", "0.5116706", "0.5107149", "0.51038724", "0.50978285", "0.5096868", "0.5081633", "0.5081633", "0.5076286", "0.50739", "0.5073506", "0.5059865", "0.5056742", "0.5047828", "0.50380796", "0.5021009", "0.5018679", "0.50168765", "0.5015851", "0.501452", "0.50145066", "0.5012697", "0.5002678", "0.50009686", "0.49928787", "0.49918035", "0.49903345", "0.49843955", "0.49835387", "0.49820837", "0.4973954", "0.49736643", "0.49706966", "0.4963395", "0.4959587", "0.49594972", "0.49564242", "0.4951333", "0.49375844", "0.4931696", "0.4929047", "0.49254498", "0.49231645", "0.49206617", "0.4918553", "0.49183762", "0.49181217", "0.4917068", "0.49168602", "0.4910965", "0.4908054", "0.48879054", "0.48842943", "0.48813146", "0.48794657", "0.4878299", "0.48756158", "0.48745292", "0.48714188", "0.48708716", "0.4867132", "0.48579663", "0.48461503", "0.48442456", "0.48427466", "0.48381826", "0.48335573", "0.48295158", "0.48282132", "0.48278284", "0.48230046", "0.4816261", "0.48162293", "0.48161668", "0.48145732", "0.48139364", "0.48131245", "0.48100665", "0.4808365", "0.4808084", "0.48008612" ]
0.678983
0
we will handle the attachment
@Override public boolean neverAttach() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Object getAttachment() {\n\treturn attachment;\n }", "@Override\n public void completed(Integer result, String attachment)\n {\n log.info(\"Successful read!\");\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tList<ATTACH> mAttachs = SQLiteUtils.getInstance(mContext)\r\n\t\t\t\t\t\t.getEmailAttachsFromDb(emailUsername, emailUid);\r\n\t\t\t\t// feed = readFile(path + \"/\" + AppfileName);\r\n\t\t\t\tmDetails = SQLiteUtils.getInstance(mContext)\r\n\t\t\t\t\t\t.getEmailDetailFromDb(emailUsername, emailUid);\r\n\t\t\t\tandroid.os.Message msg = mHandler.obtainMessage();\r\n\t\t\t\tmsg.what = 1;\r\n\t\t\t\tmsg.obj = mAttachs;\r\n\t\t\t\tmHandler.sendMessage(msg);\r\n\t\t\t}", "@Override\n public void onSaveAttachment(AttachmentViewInfo attachment) {\n\n getAttachmentController(attachment).saveAttachment();\n }", "void onAddAttachments();", "public handleFileUpload() {\r\n\t\tsuper();\r\n\t}", "public Object getAttachment() {\n\t\treturn attachment;\n\t}", "@Override\n public void completed(Integer result, String attachment)\n {\n }", "private void dotheattachmentpart(int value, String urlNewString) {\n\n\t\tfor (int i = 0; i < value; i++) {\n\t\t\tSystem.out.println(\"attachment\" + i);\n\t\t\tJSONObject object = new JSONObject();\n\t\t\ttry {\n\t\t\t\tobject.put(\"filename\", \"Attachment\");\n\t\t\t\tobject.put(\"displayname\", \"Attachment\");\n\t\t\t\tobject.put(\"showAsImage\", true);\n\t\t\t\tobject.put(\"isUnrestricted\", false);\n\t\t\t\t// content value contains base64 value of bitmap\n\t\t\t\tSystem.out.println(\"encoded value is:\" + encode.get(i).path);\n\t\t\t\tobject.put(\"content\", encode.get(i).path);\n\t\t\t\t// doin background thread for request\n\t\t\t\tint j = DBAdpter.sendRequestforAttachment(object, urlNewString,\n\t\t\t\t\t\tMyApplication.getToken());\n\t\t\t\tif (j == 5) {\n\t\t\t\t\tLog.v(\"Results\", \"Successfully Uploaded\");\n\t\t\t\t} else if (j == 1) {\n\t\t\t\t\tLog.v(\"Results\", \"Error\");\n\t\t\t\t\tmakediallog(\"Error\", \"CannotUpload the file\");\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tencode.clear();\n\t\tqueueItemforApproval.clear();\n\t}", "public void onClick() {\n getRequestCycle().setRequestTarget(new IRequestTarget() {\n \n public void detach(RequestCycle requestCycle) {\n }\n \n public void respond(RequestCycle requestCycle) {\n WebResponse r = (WebResponse) requestCycle.getResponse();\n r.setAttachmentHeader(fileName);\n try {\n File file = AttachmentUtils.getFile(attachment, getJtrac().getJtracHome());\n InputStream is = new FileInputStream(file);\n try {\n Streams.copy(is, r.getOutputStream());\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n try {\n is.close();\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n } catch (FileNotFoundException e) {\n throw new RuntimeException(e);\n }\n }\n });\n }", "public void setAttachment(Object attachment) {\n\tthis.attachment = attachment;\n }", "@Override\n public void onFinished()\n {\n if (_requestPayload == null)\n {\n _streamResponseCallback.onError(Messages.toStreamException(RestException.forError(400,\n \"Did not receive any parts in the multipart mime request!\")));\n return;\n }\n\n //At this point, this means that the multipart mime envelope didn't have any attachments (apart from the\n //json/pson payload). Technically the rest.li client would not create a payload like this, but to keep the protocol\n //somewhat flexible we will allow it.\n //If there had been more attachments, then onNewPart() above would be invoked and we would have passed the\n //attachment reader onto the framework.\n\n //It is also important to note that this callback (TopLevelReaderCallback) will no longer be used. We provide\n //null to the application developer since there are no attachments present. Therefore it is not possible for this\n //callback to ever be used again. This is a bit different then the onNewPart() case above because in that case\n //there is a valid non-null attachment reader provided to the resource method. In that case application developers\n //could call drainAllAttachments() without registering a callback which would then lead to onDrainComplete() being\n //invoked.\n\n _restRequestBuilder.setEntity(_requestPayload);\n RestRequest restRequest = _restRequestBuilder.build();\n //We have no attachments so we pass null for the reader.\n // Debug request should have already handled by one of the request handlers.\n _fallback.handleResourceRequest(restRequest,\n _routingResult, toRestResponseCallback(_streamResponseCallback, _routingResult.getContext()));\n }", "private void uploadFile(Uri data) {\n\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.setCancelable(false);\n progressDialog.show();\n\n StorageReference sRef = mStorageReference.child(cloud_base_path + new_notice_key + \"/\" + attchmentFIleName.replace(\" \",\"_\") + \".pdf\");\n sRef.putFile(data)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @SuppressWarnings(\"VisibleForTests\")\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n\n Upload upload = new Upload(attchmentFIleName, taskSnapshot.getDownloadUrl().toString());\n\n String newKey = mDatabase.child(\"Global\").child(StartUpActivity.userDetails.getState()).child(\"Notice_Board\").child(new_notice_key).child(\"Attachments\").push().getKey();\n mDatabase.child(\"Global\").child(StartUpActivity.userDetails.getState()).child(\"Notice_Board\").child(new_notice_key).child(\"Attachments\").child(newKey).setValue(upload);\n\n // Update Attachment field\n String atthline = textView_new_notice_vlu.getText().toString() + \"\\n\" + attchmentFIleName +\".pdf\";\n textView_new_notice_vlu.setText(atthline);\n\n // Update Attachments Name\n updateAttachmentsNames();\n\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n\n //hiding the progress dialog\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @SuppressWarnings(\"VisibleForTests\")\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n\n }", "private void addAttachment(MimeMultipart multipart, String filePath) throws MessagingException, IOException {\n\n MimeBodyPart part = new MimeBodyPart();\n File file = new File(filePath);\n try (InputStream fin = new FileInputStream(file)) {\n part.setDisposition(ATTACHMENT);\n part.setFileName(file.getName());\n Tika tika = new Tika();\n String fileContentType = tika.detect(file);\n DataHandler dataHandler = new DataHandler(new EmailAttachmentDataSource(file.getName(), fin,\n fileContentType));\n part.setDataHandler(dataHandler);\n part.setHeader(CONTENT_TYPE_HEADER, dataHandler.getContentType());\n part.setHeader(CONTENT_TRANSFER_ENCODING_HEADER, this.contentTransferEncoding);\n multipart.addBodyPart(part);\n }\n }", "public abstract void addAttachmentPart(AttachmentPart attachmentpart);", "public String getAttachment() {\n return attachment;\n }", "private static void addAttachment(Multipart multipart, String filepath) throws MessagingException {\r\n\t\tDataSource source = new FileDataSource(filepath);\r\n\t\tBodyPart messageBodyPart = new MimeBodyPart();\r\n\t\tmessageBodyPart.setDataHandler(new DataHandler(source));\r\n\t\tString fileName = \"\";\r\n\t\t\tfileName = filepath.substring(filepath.lastIndexOf(new Character(File.separatorChar).toString())+1,filepath.length());\r\n\t\t\tSystem.out.println(fileName);\r\n\t\tmessageBodyPart.setFileName(fileName);\r\n\t\tmultipart.addBodyPart(messageBodyPart);\r\n\t}", "void handleOutOfBandAttachment(final Document doc, final iFormViewer fv, final DocumentItem item) {\n final WindowViewer w = Platform.getWindowViewer();\n String href = item.getHREF();\n\n try {\n String id = href;\n int n = href.lastIndexOf('/');\n\n if (n != -1) {\n id = href.substring(n + 1);\n }\n\n n = id.lastIndexOf('.');\n\n if (n == -1) {\n href += \".html\";\n } else {\n id = id.substring(0, n);\n }\n\n ActionLink link = new ActionLink(fv.getURL(href));\n final Document ndoc = new Document(fv, link, id);\n\n ndoc.load(new iFunctionCallback() {\n @Override\n public void finished(boolean canceled, Object returnValue) {\n w.hideWaitCursor();\n\n if (returnValue instanceof Throwable) {\n Utils.handleError((Throwable) returnValue);\n return;\n } else if (canceled || fv.isDisposed()) {\n return;\n }\n\n ndoc.mainDocument.rowData = item.rowData;\n\n if (ndoc.getAttachmentCount() == 0) {\n doc.populateViewer(fv, ndoc.mainDocument);\n } else {\n StackPaneViewer sp = Utils.getStackPaneViewer(fv);\n GridPaneViewer gp = createDocumentViewer(sp, true);\n iWidget field = gp.getWidget(\"backButton\");\n\n if (field != null) {\n field.setVisible(true);\n }\n\n int pos = sp.addViewer(null, gp);\n\n ndoc.populateViewer(gp);\n sp.switchTo(pos);\n }\n }\n });\n w.showWaitCursor();\n } catch(MalformedURLException e) {\n Utils.handleError(e);\n }\n }", "@Override\n public AttachmentType addAttachment() {\n \treturn this;\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (resultCode == RESULT_OK) {\n switch (requestCode) {\n case (REQUEST_IMAGE_FROM_CAMERA):\n addAttach(mFile, ChatMessageAttachment.ChatMessageAttachmentType_image);\n break;\n case (REQUEST_IMAGE_FROM_GALLERY):\n addAttach(new File(getRealPathFromURI(data.getData())), ChatMessageAttachment.ChatMessageAttachmentType_image);\n break;\n case (REQUEST_VIDEO_FROM_CAMERA):\n addAttach(mFile, ChatMessageAttachment.ChatMessageAttachmentType_video);\n break;\n case (REQUEST_VIDEO_FROM_GALLERY):\n addAttach(new File(getRealPathFromURI(data.getData())), ChatMessageAttachment.ChatMessageAttachmentType_video);\n break;\n default:\n return;\n }\n }\n }", "@Override\n public void onViewAttachment(AttachmentViewInfo attachment) {\n\n getAttachmentController(attachment).viewAttachment();\n }", "public abstract AttachmentPart createAttachmentPart();", "@Override\n\tvoid postarFoto() {\n\n\t}", "protected MimeMultipart addAttachment(Multipart multipart, String filename, MimeBodyPart messageBodyPart )\r\n\t{\r\n\t\r\n\t\tDataSource source = new FileDataSource(filename);\r\n\t\tMimeMultipart multipart1 = (MimeMultipart) multipart;\r\n\t\ttry {\r\n\t\t\tmessageBodyPart.setDataHandler(new DataHandler(source));\r\n\t\t\tmessageBodyPart.setFileName(filename);\r\n\t\t\tmultipart1.addBodyPart(messageBodyPart);\r\n\t\t} catch (MessagingException e) {\r\n\t\t\tlog.error(\"Problemas con archivo adjunto \"+filename +\" \"+ e);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn multipart1;\r\n\t}", "void sendMessageWithAttachment (EmailObject object, String pathToAttachment) throws Exception;", "void sendFile() {\r\n\t\t// 특정 클라이언트에게 파일을 보냄\r\n\t}", "private void addAttachment(MimeMultipart multipart, String filePath, String contentType) throws MessagingException,\n IOException {\n\n MimeBodyPart part = new MimeBodyPart();\n File file = new File(filePath);\n try (InputStream fin = new FileInputStream(file)) {\n part.setDisposition(ATTACHMENT);\n part.setFileName(file.getName());\n DataHandler dataHandler = new DataHandler(new EmailAttachmentDataSource(file.getName(), fin, contentType));\n part.setDataHandler(dataHandler);\n part.setHeader(CONTENT_TYPE_HEADER, dataHandler.getContentType());\n part.setHeader(CONTENT_TRANSFER_ENCODING_HEADER, this.contentTransferEncoding);\n multipart.addBodyPart(part);\n }\n }", "@Override\n public void run() {\n try {\n Drawable drawable = Drawable.createFromStream(new URL(image_path).openStream(), \"\");\n\n Message message = Message.obtain();\n message.obj = drawable;\n handler.sendMessage(message);\n } catch (MalformedURLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\n public void onSaveAttachmentToUserProvidedDirectory(final AttachmentViewInfo attachment) {\n MessageViewFragment fragment = messageViewFragmentWeakReference.get();\n if (fragment == null) {\n return;\n }\n\n Intent intent = new Intent();\n intent.putExtra(\"attachmentInfo\", attachment);\n FileBrowserHelper.getInstance().showFileBrowserActivity(fragment, null,\n MessageViewFragment.ACTIVITY_CHOOSE_DIRECTORY, new FileBrowserHelper.FileBrowserFailOverCallback() {\n @Override\n public void onPathEntered(String path) {\n getAttachmentController(attachment).saveAttachmentTo(path);\n }\n\n @Override\n public void onCancel() {\n // Do nothing\n }\n }, intent);\n\n }", "private void addAttachment() {\n Intent intentFromGallery = new Intent();\n if (Build.VERSION.SDK_INT < 19) {\n intentFromGallery = new Intent(Intent.ACTION_GET_CONTENT);\n intentFromGallery.setType(\"image/*\");\n } else {\n intentFromGallery = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n }\n\n try {\n startActivityForResult(Intent.createChooser(intentFromGallery, \"请选择要上传的图片\"), ADD_ATTACHMENT);\n// 这个是进行裁剪\n// startActivityForResult(intentFromGallery, IMAGE_REQUEST_CODE);\n } catch (android.content.ActivityNotFoundException ex) {\n Toast.makeText(this, \"无法选择文件,请先安装文件管理器\", Toast.LENGTH_SHORT).show();\n }\n }", "org.hl7.fhir.Attachment addNewValueAttachment();", "private void getArticleAttachments(){\n\t\ttry{\n\t\t\tIN_ARTICLE_DETAILS = dataProvider.getArticleAttachemnts(IN_CATEGORYID, IN_ARTICLEID);\n\t\t\tIN_FILELIST = iCaching.parseData(new JSONArray(IN_ARTICLE_DETAILS.get(0).get(MEDIAATTACHMENT)));\n\t\t}catch(Exception e){\n\t\t\tIN_FILELIST = null;\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif (IN_FILELIST !=null && IN_FILELIST.size()>0) {\n\t\t\t//prepare attachment list\n\t\t\tprepareFileList(IN_FILELIST,false);\n\t\t\tfileListAdapter = getFileListAdapter();\n\t\t\tlstAttachments.setAdapter(fileListAdapter);\n\t\t}\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n\n // ListView Clicked item value\n String itemValue = (String) attach_list.getItemAtPosition(position);\n\n // Show Alert\n // Toast.makeText(getActivity(),\"Position :\"+itemPosition+\"Attach Id: \"+patientAttachmentArraylist.get(position).getAttachId()+\"File : \" +itemValue , Toast.LENGTH_SHORT).show();\n Log.d(Utils.TAG, \"Attach id:\" + patientAttachmentArraylist.get(position).getAttachId());\n attach_id = patientAttachmentArraylist.get(position).getAttachId();\n DOWNLOAD_URL = APIClass.DRS_PATIENT_ATTACHMENT_URL + attach_id + \"/\" + itemValue;\n Log.d(Utils.TAG, \"Downloading URL: \" + DOWNLOAD_URL);\n\n String filepath = DOWNLOAD_URL.substring(DOWNLOAD_URL.lastIndexOf(\".\"));\n Log.d(Utils.TAG, \"filepath: \" + filepath);\n\n if (NetworkUtil.getConnectivityStatusString(getActivity()).equalsIgnoreCase(\"enabled\")) {\n\n if ((filepath.equalsIgnoreCase(\".jpg\")) || (filepath.equalsIgnoreCase(\".jpeg\")) || (filepath.equalsIgnoreCase(\".png\"))) {\n\n Bundle bundle = new Bundle();\n bundle.putInt(\"PATIENT_ID\", Patient_ID);\n bundle.putInt(\"DOCREF_ID\", DOCREF_ID);\n bundle.putInt(\"ATTTACH_ID\", patientAttachmentArraylist.get(position).getAttachId());\n bundle.putString(\"DOWNLOAD_URL\", DOWNLOAD_URL);\n bundle.putString(\"PATIENT_VIEW\", patientAttachmentArraylist.get(position).getAttachViewType());\n PatientsAttchmentFragment attachFragment = new PatientsAttchmentFragment();\n fragManager = getFragmentManager();\n fragTransaction = fragManager.beginTransaction();\n attachFragment.setArguments(bundle);\n fragTransaction.replace(R.id.viewpager, attachFragment, \"ATTACH\");\n fragTransaction.commit();\n\n }\n else if ((filepath.equals(\".pdf\"))) {\n downloadPDFfiles(DOWNLOAD_URL);\n }\n else {\n AppUtils.showCustomAlertMessage(getContext(), \"Attachment\", \"Unsupported File Format\", \"OK\", null, null);\n }\n } else {\n AppUtils.showCustomAlertMessage(getContext(), HCConstants.INTERNET, HCConstants.INTERNET_CHECK, \"OK\", null, null);\n }\n\n }", "private C_ReceiveAttachment(Builder builder) {\n super(builder);\n }", "@Override\n public void onRequestHandlePathOz(@NotNull PathOz pathOz, @Nullable Throwable throwable) {\n readPdfFile(pathOz.getPath());\n mButtonReadText.setVisibility(View.VISIBLE);\n mHighlightedTextView.setVisibility(View.VISIBLE);\n mFragmentWallpaperTextView.setVisibility(View.INVISIBLE);\n mHighlightedTextView.setText(fileTextContent);\n Toast.makeText(getActivity(), \"File Uploaded Successfully !\", Toast.LENGTH_SHORT).show();\n Log.e(\"URI\", \"The URI path: \"+pathOz.getPath());\n }", "public void setAttachment(Object attachment) {\n\t\tthis.attachment = attachment;\n\t}", "public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n CropImage.ActivityResult result = CropImage.getActivityResult(data);\n if (resultCode == -1) {\n if (requestCode != 11) {\n String valueOf = String.valueOf(result.getUri());\n this.imageUri = valueOf;\n if (valueOf != null) {\n if (this.isattach.booleanValue()) {\n this.tv_attachfile.setText(this.imageUri);\n fileType = \"png\";\n Log.i(\"datafile\",result.toString() + \"\\n\" + result.getOriginalUri() + \"\\n\" + result.getUri());\n this.isattach = false;\n this.attach_file = this.imageUri;\n } else {\n this.eventphoto.setImageURI(Uri.parse(this.imageUri));\n this.upload_photo = this.imageUri;\n this.ismageEdited = true;\n }\n }\n } else if (requestCode == 11){\n this.tv_attachfilepdf.setText(data.getDataString());\n fileType = \"pdf\";\n\n String filePath = data.getData().getPath();\n String fileName = data.getData().getLastPathSegment();\n this.attach_file = data.getData().getPath();\n Log.i(\"file\", filePath + \"\\n\" + fileName + \"\\n\" + attach_file);\n\n /*uri = data.getData();\n this.attach_file = data.getData().toString();\n Log.i(\"uriii\", uri.toString());\n File file2 = new File(this.attach_file);\n Log.i(\"uriiName\", file2.getName());\n Log.i(\"uriiPath\", file2.getPath());\n Log.i(\"uriiParent\", file2.getParent());*/\n }\n }\n }", "private void setAttachmentPart(final String[] attachmentPaths, final MimeMultipart related, final MimeMultipart attachment,\n final String body, final boolean htmlText)\n throws MessagingException {\n for (int i = 0; i < attachmentPaths.length; ++i) {\n // Creation du fichier e inclure\n final MimeBodyPart messageFilePart = new MimeBodyPart();\n final DataSource source = new FileDataSource(attachmentPaths[i]);\n final String fileName = source.getName();\n messageFilePart.setDataHandler(new DataHandler(source));\n messageFilePart.setFileName(fileName);\n // Image e inclure dans un texte au format HTML ou piece jointe\n if (htmlText && null != body && body.matches(\n \".*<img[^>]*src=[\\\"|']?cid:([\\\"|']?\" + fileName + \"[\\\"|']?)[^>]*>.*\")) {\n // \" <-- pour eviter une coloration syntaxique desastreuse...\n messageFilePart.setDisposition(\"inline\");\n messageFilePart.setHeader(\"Content-ID\", '<' + fileName + '>');\n related.addBodyPart(messageFilePart);\n } else {\n messageFilePart.setDisposition(\"attachment\");\n attachment.addBodyPart(messageFilePart);\n }\n }\n }", "@Override\r\n public void handleMessage(Message msg) {\n ImgBeanHolder holder= (ImgBeanHolder) msg.obj;\r\n Bitmap bitmap = holder.bitmap;\r\n ImageView imageview= holder.imageView;\r\n String path = holder.path;\r\n if (imageview.getTag().toString().equals( path)){\r\n imageview.setImageBitmap(bitmap);\r\n }\r\n }", "@Override\n public String persistAttachmentBinary(HttpServletRequest request, Attachment attachment)\n throws PersistenceException {\n if (request == null) {\n return null;\n }\n\n String path = getAttachmentAbsolutePath(attachment, request);\n try {\n FileUtil.write(path, attachment.getData());\n } catch (IOException e) {\n throw new PersistenceException(\"Unable to persist file \" + attachment.getFilename()\n + \"to path \" + path, e);\n }\n\n final String context = request.getContextPath();\n final String urlPath = context + PATH_FORMAT.format(new Object[]{ attachment.getGuid(),attachment.getFilename()});\n return urlPath;\n }", "public void onReceive(Object message) throws Throwable {\n if(message instanceof InitPublish) {\n //String fileDirectory = getAbsolutePath(directory,fileName);\n\n //send ce-bay message to publish the given file\n cebay.tell(new Publish(filePath, hashedFileName(), seederAddress()), getSelf());\n //receiving this message if someone wants to download our file\n } else if(message instanceof GetFile) {\n GetFile requestedFile = (GetFile) message;\n if(requestedFile.name().equals(this.fileName)) {\n byte[] data = new byte[(int)file.length()];\n FileInputStream fis = new FileInputStream(file);\n if(fis.read(data) != -1) {\n //send the sender a message with the requested file as byte[]\n getSender().tell(new FileRetrieved(data), getSelf());\n }\n fis.close();\n\n } else {\n //if a file is requested which we don't provide send the sender a fileNotFount-message\n getSender().tell(new FileNotFound(requestedFile.name()), getSelf());\n }\n //receiving this message from ce-bay\n } else if (message instanceof GetStatus) {\n //sending the message statusRetrieved back to ce-bay\n getSender().tell(new StatusRetrieved(), getSelf());\n } else {\n //if unknown message\n getSender().tell(\"Diese Nachricht konnte nicht verarbeitet werden!\", getSelf());\n }\n }", "@Override\n protected void onBinaryData(InputStream is) throws IOException {\n }", "private ExcelAttachment(T attachment){\n\t\tthis.attachment=attachment;\n\t}", "int setAttachment(Attachment attachment) throws NotAuthorizedException;", "@Override\n public Attachment loadAttachment(PeerResponse response) throws IdentifierException, NumberFormatException, NxtException {\n return new ArbitraryMessage(response);\n }", "public void handleFileUpload(FileUploadEvent event) {\n\n\t\tFacesMessage msg = new FacesMessage();\n\n\t\ttry {\n\t\t\t// recharger les parametres de la photo\n\t\t\ttry {\n\t\t\t\tloadParamPhoto();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t// this.setUrl( (String) event.getComponent().getAttributes()\n\t\t\t// .get(\"url\") );\n\t\t\t//\n\t\t\t// this.setDossierEtudiantId ( (String)\n\t\t\t// event.getComponent().getAttributes()\n\t\t\t// .get(\"dossierEtudiantId\") );\n\n\t\t\t// FacesContext facesContext = FacesContext.getCurrentInstance();\n\t\t\t// ServletContext scontext = (ServletContext)\n\t\t\t// facesContext.getExternalContext().getContext();\n\t\t\t// String arquivo = scontext.getRealPath(\"/upload/\");\n\t\t\t// System.err.println(\"---------->\" + arquivo + \" ----\" +\n\t\t\t// folder_temp);\n\n\t\t\tFile targetFolder = new File(folder_temp);\n\t\t\t// File targetFolder = new File(arquivo + \"\\\\\");\n\n\t\t\tInputStream inputStream = event.getFile().getInputstream();\n\n\t\t\t// generer un nom de fichier unique\n\t\t\tString fileUrl = FileUtility.getUidFileName(event.getFile().getFileName());\n\n\t\t\tOutputStream out = new FileOutputStream(new File(targetFolder, fileUrl));\n\n\t\t\tint read = 0;\n\t\t\tbyte[] bytes = new byte[4096];\n\n\t\t\twhile ((read = inputStream.read(bytes)) != -1) {\n\t\t\t\tout.write(bytes, 0, read);\n\t\t\t}\n\n\t\t\tinputStream.close();\n\t\t\tout.flush();\n\t\t\tout.close();\n\n\t\t\tsetUrl(fileUrl);\n\n\t\t\tdossierEtudiantDto.setPhoto(fileUrl);\n\t\t\tthis.photo_attache_capture = true;\n\n\t\t\tmsg.setSeverity(FacesMessage.SEVERITY_INFO);\n\t\t\tmsg.setSummary(bundleDocument.getString(\"document_success_upload_file\"));\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\n\n\t\t} catch (IOException e) {\n\t\t\tmsg.setSeverity(FacesMessage.SEVERITY_ERROR);\n\t\t\tmsg.setSummary(bundleDocument.getString(\"document_error_upload_file\"));\n\t\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private S_ReceiveAttachment(Builder builder) {\n super(builder);\n }", "public void actionPerformed(ActionEvent actionEvent) {\r\n Object source = actionEvent.getSource();\r\n /*if Upload , then set 'fileSelected' as true, get the filename from file chooser and set it to the txtFilename,\r\n set the BLOB data and enable the view button*/\r\n if(source.equals(awardAddDocumentForm.btnUpload)){\r\n CoeusFileChooser fileChooser = new CoeusFileChooser(dlgAwardUploadDoc);\r\n fileChooser.setAcceptAllFileFilterUsed(true);\r\n fileChooser.showFileChooser();\r\n if(fileChooser.isFileSelected()){\r\n String fileName = fileChooser.getSelectedFile();\r\n if(fileName != null && !fileName.trim().equals(EMPTY_STRING)){\r\n int index = fileName.lastIndexOf('.');\r\n if(index != -1 && index != fileName.length()){\r\n setFileSelected(true);\r\n awardAddDocumentForm.txtFileName.setText(fileChooser.getFileName().getName());\r\n setBlobData(fileChooser.getFile());\r\n //Added with case 4007: Icon based on mime type\r\n CoeusDocumentUtils docTypeUtils = CoeusDocumentUtils.getInstance();\r\n CoeusAttachmentBean attachmentBean = new CoeusAttachmentBean(fileName,getBlobData());\r\n setMimeType(docTypeUtils.getDocumentMimeType(attachmentBean));\r\n //4007 End\r\n awardAddDocumentForm.btnView.setEnabled(true);\r\n }else{\r\n CoeusOptionPane.showErrorDialog(coeusMessageResources.parseMessageKey(\r\n \"correspType_exceptionCode.1012\"));\r\n setFileSelected(false);\r\n setBlobData(null);\r\n setMimeType(null);//4007\r\n return;\r\n }\r\n }\r\n }\r\n } else if(source.equals(awardAddDocumentForm.btnOk)){\r\n try{\r\n /*Check the function type and awardDocumentBean is null or not*/\r\n if(awardDocumentBean != null){\r\n if(functionType == MODIFY_DOCUMENT){\r\n awardDocumentBean.setAcType(TypeConstants.UPDATE_RECORD);\r\n newVersion = false;\r\n newDocumentId = false;\r\n ComboBoxBean cmbTypeCode =(ComboBoxBean)awardAddDocumentForm.cmbDocumentType.getSelectedItem();\r\n if(!cmbTypeCode.getCode().equals(\"\") && !cmbTypeCode.getDescription().equals(\"\")){\r\n if(awardAddDocumentForm.cmbDocumentType.getSelectedItem() != null\r\n && !awardAddDocumentForm.cmbDocumentType.getSelectedItem().equals(EMPTY_STRING)){\r\n cmbTypeCode =(ComboBoxBean)awardAddDocumentForm.cmbDocumentType.getSelectedItem();\r\n awardDocumentBean.setDocumentTypeCode(Integer.parseInt(cmbTypeCode.getCode()));\r\n awardDocumentBean.setDocumentTypeDescription((awardAddDocumentForm.cmbDocumentType.getSelectedItem().toString()));\r\n docTypeEmpty = false;\r\n }\r\n }\r\n \r\n if(awardAddDocumentForm.txtDescription.getText() != null &&\r\n !awardAddDocumentForm.txtDescription.getText().equals(EMPTY_STRING)){\r\n if(awardAddDocumentForm.txtDescription.getText().length() > 200){\r\n String description = awardAddDocumentForm.txtDescription.getText().substring(0,201);\r\n awardDocumentBean.setDescription(description);\r\n docTypeEmpty = false;\r\n }else{\r\n awardDocumentBean.setDescription(awardAddDocumentForm.txtDescription.getText());\r\n }\r\n }else {\r\n CoeusOptionPane.showInfoDialog(coeusMessageResources.parseMessageKey(\"awardDocuments_DescDoc_exceptionCode.1115\"));\r\n docTypeEmpty = true;\r\n awardAddDocumentForm.txtDescription.requestFocusInWindow();\r\n return;\r\n }\r\n if(awardAddDocumentForm.txtFileName.getText() != null\r\n && !awardAddDocumentForm.txtFileName.getText().equals(EMPTY_STRING)){\r\n awardDocumentBean.setFileName(awardAddDocumentForm.txtFileName.getText());\r\n docTypeEmpty = false;\r\n }else{\r\n CoeusOptionPane.showInfoDialog(coeusMessageResources.parseMessageKey(\"awardDocuments_AttachDoc_exceptionCode.1113\"));\r\n docTypeEmpty = true;\r\n awardAddDocumentForm.btnUpload.requestFocusInWindow();\r\n return;\r\n }\r\n if(fileSelected && getBlobData() != null){\r\n awardDocumentBean.setDocument(getBlobData());\r\n awardDocumentBean.setMimeType(getMimeType());\r\n }\r\n modifyFormData(awardDocumentBean);\r\n }\r\n } else {\r\n saveFormData();\r\n }\r\n// if(okClicked){\r\n if(isOkClicked() || !docTypeEmpty){\r\n dlgAwardUploadDoc.dispose();\r\n }\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n }\r\n /* if View, check value for fileSelected,\r\n if true the display the blob data else throw an error msg*/\r\n else if(source.equals(awardAddDocumentForm.btnView)){\r\n if(fileSelected){\r\n try{\r\n viewDocument();\r\n }catch (Exception exception){\r\n exception.printStackTrace();\r\n if(!( exception.getMessage().equals(\r\n coeusMessageResources.parseMessageKey(\r\n \"protoDetFrm_exceptionCode.1130\")) )){\r\n CoeusOptionPane.showInfoDialog(exception.getMessage());\r\n return;\r\n }\r\n }\r\n }\r\n } else if(source.equals(awardAddDocumentForm.btnCancel)){\r\n dataValuesChanged();\r\n if(dataChanged){\r\n int option = CoeusOptionPane.showQuestionDialog(\r\n coeusMessageResources.parseMessageKey(\"saveConfirmCode.1002\"),\r\n CoeusOptionPane.OPTION_YES_NO_CANCEL,\r\n JOptionPane.YES_OPTION);\r\n switch(option){\r\n case JOptionPane.YES_OPTION:\r\n try{\r\n if(this.functionType != 'M'){\r\n saveFormData();\r\n } else{\r\n dlgAwardUploadDoc.dispose();\r\n }\r\n if(isOkClicked()){\r\n dlgAwardUploadDoc.dispose();\r\n }\r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n break;\r\n case JOptionPane.NO_OPTION :\r\n dlgAwardUploadDoc.dispose();\r\n break;\r\n default:\r\n \r\n try {\r\n requestDefaultFocusToComp();\r\n } catch (CoeusException ex) {\r\n ex.printStackTrace();\r\n }\r\n break;\r\n }\r\n }else{\r\n dlgAwardUploadDoc.dispose();\r\n }\r\n }\r\n }", "public boolean isAttachment() {\n return isAttachment;\n }", "@Override\n protected Map<String, DataPart> getByteData()\n {\n Map<String, DataPart> params = new HashMap<>();\n long imagename = System.currentTimeMillis();\n params.put(Keys.message, new DataPart(imagename + \".png\", getFileDataFromDrawable(bitmap)));\n return params;\n }", "@Test\n public void attachment() throws Exception {\n SynapseHelper synapseHelper = spy(new SynapseHelper());\n doReturn(\"dummy-filehandle-id\").when(synapseHelper).uploadFromS3ToSynapseFileHandle(MOCK_TEMP_DIR,\n TEST_PROJECT_ID, TEST_FIELD_NAME, UploadFieldTypes.ATTACHMENT_BLOB, \"dummy-attachment-id\");\n\n String retVal = synapseHelper.serializeToSynapseType(MOCK_TEMP_DIR, TEST_PROJECT_ID, TEST_RECORD_ID,\n TEST_FIELD_NAME, UploadFieldTypes.ATTACHMENT_BLOB, new TextNode(\"dummy-attachment-id\"));\n assertEquals(retVal, \"dummy-filehandle-id\");\n }", "@Override\n public Attachment loadAttachment(PeerResponse response) throws IdentifierException, NumberFormatException, NxtException {\n return new BalanceLeasing(response);\n }", "abstract Function<Multipart.FileInfo, play.libs.streams.Accumulator<ByteString, Http.MultipartFormData.FilePart<A>>> createFilePartHandler();", "public void uploadFile() {\n \n InputStream input = null;\n try {\n input = file.getInputStream();\n System.out.println(\"chay qua inpustream\");\n String itemName = file.getSubmittedFileName();\n String filename = itemName.substring(\n itemName.lastIndexOf(\"\\\\\") + 1);\n String dirPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/upload/images\");\n fileNamed = \"/upload/images/\"+filename;\n File f = new File(dirPath + \"\\\\\" + filename);\n if (!f.exists()) {\n f.createNewFile();\n }\n FileOutputStream output = new FileOutputStream(f);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = input.read(buffer)) > 0) {\n output.write(buffer, 0, length);\n }\n // resize(dirPath + \"\\\\\" + filename, dirPath + \"\\\\\" + filename, 200, 200);\n input.close();\n output.close();\n } catch (IOException ex) {\n System.out.println(\"loi io\");\n Logger.getLogger(ArtistsManagedBean.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "void fileReceived(IMSession session, String requestId, String fileId, String filePath);", "@Override\n public boolean hasAttachment() {\n return this.getAdvanceTravelPayment().isAttachmentCode();\n }", "public void importMedia(){\r\n \r\n }", "public abstract Iterator getAttachments();", "private static void sendAttachmentEmail(Session session, String toEmail, String subject, String body) {\n try {\n MimeMessage msg = new MimeMessage(session);\n msg.addHeader(\"Content-type\", \"text/HTML; charset=UTF-8\");\n msg.addHeader(\"format\", \"flowed\");\n msg.addHeader(\"Content-Transfer-Encoding\", \"8bit\");\n msg.setFrom(new InternetAddress(\"[email protected]\", \"NoReply-JD\"));\n msg.setReplyTo(InternetAddress.parse(\"[email protected]\", false));\n msg.setSubject(subject, \"UTF-8\");\n msg.setSentDate(new Date());\n msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toEmail, false));\n // Create the message body part\n BodyPart messageBodyPart = new MimeBodyPart();\n // Fill the message\n messageBodyPart.setText(body);\n // Create a multipart message for attachment\n Multipart multipart = new MimeMultipart();\n // Set text message part\n multipart.addBodyPart(messageBodyPart);\n // Second part is attachment\n messageBodyPart = new MimeBodyPart();\n String filename = \"abc.txt\";\n DataSource source = new FileDataSource(filename);\n messageBodyPart.setDataHandler(new DataHandler(source));\n messageBodyPart.setFileName(filename);\n multipart.addBodyPart(messageBodyPart);\n // Send the complete message parts\n msg.setContent(multipart);\n // Send message\n Transport.send(msg);\n System.out.println(\"EMail Sent Successfully with attachment!!\");\n } catch (MessagingException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "public Object attachment(Object key);", "public void openFileChooser(ValueCallback<Uri> uploadMsg) {\n Main3Activity.this.showAttachmentDialog(uploadMsg);\n }", "@Override\n\t\t\t\tpublic void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, byte[] buffer, int size) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tll.setDrawingCacheEnabled(true);\n\t\t\t\t\t\t\t\tBitmap b = ll.getDrawingCache();\n\t\t\t\t\t\t\t\tb.compress(\n\t\t\t\t\t\t\t\t\t\tCompressFormat.JPEG,\n\t\t\t\t\t\t\t\t\t\t95,\n\t\t\t\t\t\t\t\t\t\tnew FileOutputStream(\n\t\t\t\t\t\t\t\t\t\t\t\tEnvironment\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getExternalStoragePublicDirectory(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tEnvironment.DIRECTORY_PICTURES)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPath()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ File.separator\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"image.jpg\"));\n\t\t\t\t\t\t\t\tfile=new File(Environment\n\t\t\t\t\t\t\t\t\t\t.getExternalStoragePublicDirectory(\n\t\t\t\t\t\t\t\t\t\t\t\tEnvironment.DIRECTORY_PICTURES)\n\t\t\t\t\t\t\t\t\t\t.getPath()\n\t\t\t\t\t\t\t\t\t\t+ File.separator\n\t\t\t\t\t\t\t\t\t\t+ \"image.jpg\");\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t pd = ProgressDialog.show(getActivity(), \"Working..\", \"Uploading Item\", true,\n\t\t\t\t false);\n\t\t\t\t\t\t\t\t try\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t entity=new MultipartEntity();\n\t\t\t\t\t\t\t\t\tentity.addPart(\"days\",new StringBody( days.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"id\", new StringBody( idItems.get(spinner2.getSelectedItemPosition())));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"title\", new StringBody(title.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"desc\", new StringBody(desc.getText().toString()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"advertype\", new StringBody(B2BUtils.getUser().getUsertype()));\n\t\t\t\t\t\t\t\t\tentity.addPart(\"catid\", new StringBody(B2BUtils.categoryId.get(B2BUtils.categoryNames.indexOf(spinner1.getSelectedItem().toString().toUpperCase(Locale.getDefault())))));\n\t\t\t\t\t\t\t\t\tSystem.out.println((B2BUtils.categoryId.get(B2BUtils.categoryNames.indexOf(spinner1.getSelectedItem().toString().toUpperCase(Locale.getDefault())))));\n\t\t\t\t\t\t\t\t\tThread t=new Uploader(file, url, handler, entity);\n\t\t\t\t\t\t\t\t\tt.start();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tLog.d(\"Error\", e.toString());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tcallintentforattachment();\n\t\t\t\t}", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "public PurchaseRequestAttachmentContent() {\r\n }", "public interface ArtMasterAttachmentManager {\n Map saveArtMasterAttachment(HttpServletRequest request, LogBean logBean) throws Exception;\n\n Map deleteArtMasterAttachment(HttpServletRequest request, LogBean logBean) throws Exception;\n}", "public void run() {\n\t\t\t\t\tMessage msg;\n\t\t\t\t\tVector<File> files = new Vector<File>();\n\t\t\t\t\tfiles.add(new File(fileName));\n\t\t\t\t\tString result = upload(url, formParameters, files);\n\t\t\t\t\tif (StringUtils.isEmpty(result)) {\n\t\t\t\t\t\tmsg = handler.obtainMessage(Constant.UPLOAD_FAIL_CODE, Constant.UPLOAD_EXCEPTION);\n\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tLog.i(TAG, result);\n\t\t\t\t\t\tmsg = handler.obtainMessage(messageWhat, result);\n\t\t\t\t\t\thandler.sendMessage(msg);\n\t\t\t\t\t}\n\n\t\t\t\t}", "@Override\r\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n super.onActivityResult(requestCode, resultCode, data);\r\n if (requestCode == PICK_PDF_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {\r\n filePath = data.getData();\r\n uploadFile();\r\n }\r\n }", "@Override\n\tpublic Attachment getAttachment(RepositoryModel repository, long ticketId, String filename) {\n\t\treturn null;\n\t}", "public interface AttachmentService {\n\n /**\n * Save a attachment.\n *\n * @param attachmentDTO the entity to save\n * @return the persisted entity\n */\n AttachmentDTO save(AttachmentDTO attachmentDTO);\n\n /**\n * Get all the attachments.\n *\n * @param pageable the pagination information\n * @return the list of entities\n */\n Page<AttachmentDTO> findAll(Pageable pageable);\n\n /**\n * Get the \"id\" attachment.\n *\n * @param id the id of the entity\n * @return the entity\n */\n AttachmentDTO findOne(Long id);\n\n /**\n * Delete the \"id\" attachment.\n *\n * @param id the id of the entity\n */\n void delete(Long id);\n\n /**\n *根据转运编码获取转运上传的图片\n * @param code\n * @param request\n * @return\n */\n List<AttachmentDTO> findFilesByTranshipCode(String code, HttpServletRequest request);\n\n /**\n * 修改附件的基本信息\n * @param attachmentDTO\n * @return\n */\n AttachmentDTO updateAttachment(AttachmentDTO attachmentDTO);\n}", "boolean hasAttachment();", "@Override\r\n\tpublic void completed(HttpResponse message) {\n\t\tsuper.completed(message);\r\n\t\tif (message.getEntity().getContentType().getValue().equals(\"image/jpeg\")) {\r\n\t\t\ttry {\r\n\t\t\t\tByteArrayOutputStream output = new ByteArrayOutputStream();\r\n\t\t\t\tImageIO.write(ImageIO.read(message.getEntity().getContent()), \"jpeg\", output);\r\n\t\t\t\tTreeMap<String, byte[]> map = new TreeMap<String, byte[]>();\r\n\t\t\t\tmap.put(bundle.getHeaders().get(\"Video-Stream\").toString(), output.toByteArray());\r\n\t\t\t\tpublisher.addToReadQueue(ProtocolHelper.unmarshel(map));\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tlogger.error(e.getMessage());\r\n\t\t\t}\r\n\t\t} \r\n\t}", "private SimpleAttachment() {\n }", "@Override\n public void doReleaseFile(String filePath, MiddleObject midObj) throws ChannelReleaseException {\n }", "protected void deleteAttachmentFile()\n {\n try\n {\n if (deleteAttachmentAfterSend && fullAttachmentFilename != null)\n {\n File attFile = new File(fullAttachmentFilename);\n if (log.isDebugEnabled())\n {\n log.debug(\"Delete attachment file: \" + attFile.getCanonicalPath());\n }\n attFile.delete();\n }\n } catch (Exception e)\n {\n log.warn(\"Unable to delete \" + fullAttachmentFilename + \" : \" + e.getMessage());\n }\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n\n taskSnapshot.getMetadata().getReference().getDownloadUrl().addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if(task.isSuccessful()){\n FirebaseStorage.getInstance().getReference().child(\"faculty_images\").child(imageIdentifier).getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n @Override\n public void onSuccess(Uri uri) {\n Useremail.photouri = uri;\n FirebaseFirestore.getInstance().collection(\"Faculty_Bag\").document(Useremail.email).update(\"photo_uri\",Useremail.photouri.toString()).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Showfancytoasr.show(MainActivity.this,\"Uploading process was successful\");\n progressDialog.dismiss();\n finish();\n startActivity(getIntent());\n }\n });\n }\n });\n }\n }\n });\n }", "@Override\n protected Object doInBackground() throws Exception {\n InputStream is = null;\n\n MESSAGE responseConn = MessageManger.createCommand(Command.CONNECT, null);\n MessageManger.addParameter(responseConn, \"response\", Command.OK);\n MessageManger.directWriteMessage(responseConn, ccv.getOutputStream());\n\n// ccv.getHelper().sendRequest(\"~OK\\n\");\n is = so.getInputStream();\n\n BufferedReader in = new BufferedReader(new InputStreamReader(is, Util.DEFAULTENCODING));\n String line = \"\";\n\n while ((line = in.readLine()) != null) {\n\n try {\n if (line.startsWith(\"<\")) {\n\n MESSAGE message = MessageManger.parseXML(line);\n\n //non loggo gli xml di dati perchè so troppo lunghi\n if (!message.getName().equals(Request.FILETRANSFER)) {\n log.debug(ccv.getNick() + \" \" + type + \" reder receive MESSAGE : \" + MessageManger.messageToStringFormatted(message));\n } else {\n log.debug(ccv.getNick() + \" \" + type + \" FILETRANSFER RECEIVED\");\n }\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" MESSAGE \">\n if (message.getType().equals(MESSAGE)) {\n\n String messageSt = message.getParameters().getParameter().get(0).getValue();\n Font font = Font.decode(message.getParameters().getParameter().get(1).getValue());\n Color color = Color.decode(message.getParameters().getParameter().get(2).getValue());\n\n //prendo le emoticons dai contents \n List<Emoticon> emoticons = new LinkedList<Emoticon>();\n\n try {\n if (message.getContents() != null) {\n List<MESSAGE.Contents.Content> contents = message.getContents().getContent();\n\n for (MESSAGE.Contents.Content content : contents) {\n\n log.debug(\"received emoticon : \" + content.getName());\n byte[] bs = content.getValue();\n //decomprimo l'immagine\n byte[] imageBytes = chatclient.commons.Util.decompress(bs);\n log.trace(\"data[] : \" + bs);\n// ByteArrayInputStream bais = new ByteArrayInputStream(bs);\n\n// BufferedImage bufferedImage = ImageIO.read(bais);\n// log.trace(\"BufferedImage : \" + bufferedImage);\n Emoticon emotion = new Emoticon();\n emotion.setShortcut(content.getName());\n emotion.setName(content.getName());\n emotion.setImageIcon(new ImageIcon(imageBytes, \"\"));\n emotion.setData(imageBytes);\n log.trace(\"emoticon ImageIcon : \" + emotion.getImageIcon());\n emoticons.add(emotion);\n\n }\n }\n } catch (Exception e) {\n log.warn(e);\n\n }\n\n\n\n if (message.getName().equals(Message.SINGLE)) {\n String sender = message.getSender();\n\n ChatWindow cv = ccv.getHelper().getChatWith(sender);\n cv.getReceivedEmoticons().addAll(emoticons);\n cv.writeMessage(sender, messageSt, font, color, emoticons);\n\n } else if (message.getName().equals(Message.CONFERENCE)) {\n String sender = message.getSender();\n\n //dalla lista di partecipanti alla conferenza\n //rcavo l'arrey di quelli che servono in questo client\n List<String> componentsOfConferenz = new LinkedList<String>();\n for (String string : message.getReceivers().getReceiver()) {\n if (!string.equals(ccv.getNick())) {\n componentsOfConferenz.add(string);\n }\n }\n componentsOfConferenz.add(sender);\n log.debug(componentsOfConferenz);\n\n ChatWindow cv = ccv.getHelper().getConferenceWith(componentsOfConferenz.toArray(new String[componentsOfConferenz.size()]));\n cv.getReceivedEmoticons().addAll(emoticons);\n cv.writeMessage(sender, messageSt, font, color, emoticons);\n\n }\n\n// </editor-fold>\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" REQUEST \">\n } else if (message.getType().equals(REQUEST)) {\n\n if (message.getName().equals(Request.FILETRANSFER)) {\n\n try {\n String fileName = message.getParameters().getParameter().get(0).getValue();\n String fileurl = Util.readProperties().getProperty(\"downloadFolder\") + \"/\" + fileName;\n int packNum = Integer.parseInt(message.getParameters().getParameter().get(3).getValue());\n\n File outputFile = new File(fileurl);\n\n FileOutputStream fos = new FileOutputStream(outputFile, true);\n byte[] bArr = message.getData();\n\n int readed = Integer.parseInt(message.getParameters().getParameter().get(1).getValue());\n log.debug(ccv.getNick() + \"reader readed bytes : \" + readed);\n log.debug(\"write bytes to file : \" + fileurl);\n fos.write(bArr, 0, readed);\n\n fos.close();\n\n ReceiveFileDialog receiveFileDialog = ccv.getHelper().getReceiveFileDialog(fileName, message.getSender());\n receiveFileDialog.setPackReceived(packNum);\n\n } catch (Exception e) {\n log.error(e);\n }\n\n } else if (message.getName().equals(Request.FILEACCEPTREQUEST)) {\n\n try {\n //richiesta di ricezione file\n String sender = message.getSender();\n String fileName = message.getParameters().getParameter().get(0).getValue();\n long fileSize = Long.parseLong(message.getParameters().getParameter().get(1).getValue());\n\n ReceiveFileDialog receiveFileDialog = new ReceiveFileDialog(ccv);\n receiveFileDialog.setSender(sender);\n receiveFileDialog.setFile(fileName);\n receiveFileDialog.setFileSize(fileSize);\n\n //grafica\n String infoText = \"<html>File : \" + fileName + \" <br>\" + \"Da : &nbsp&nbsp&nbsp&nbsp<b>\" + sender + \"</b>\" + \" &nbsp&nbsp&nbsp&nbsp Dimensione : \" + (fileSize / 1024) + \"k </html>\";\n receiveFileDialog.getInfoLabel().setText(infoText);\n receiveFileDialog.setTitle(\"Ricezione - \" + fileName);\n receiveFileDialog.getStatusLabel().setText(\"\");\n\n receiveFileDialog.setLocationRelativeTo(ccv.getFrame());\n receiveFileDialog.setVisible(true);\n receiveFileDialog.toFront();\n\n } catch (Exception e) {\n log.error(e);\n }\n\n } else if (message.getName().equals(Request.FILEACCEPTRESPONSE)) {\n\n try {\n //richiesta di ricezione file\n String sender = message.getSender();\n log.debug(\"sender : \" + sender);\n String fileName = message.getParameters().getParameter().get(0).getValue();\n log.debug(\"fileName : \" + fileName);\n long fileSize = Long.parseLong(message.getParameters().getParameter().get(1).getValue());\n log.debug(\"fileSize : \" + fileSize);\n String response = message.getParameters().getParameter().get(2).getValue();\n log.debug(\"response : \" + response);\n SendFileDialog sendFileDialog = ccv.getHelper().getSendFileDialog(fileName, sender);\n\n if (response.equals(Command.OK)) {\n sendFileDialog.getFileSender().setAccepted(true);\n } else {\n if (sendFileDialog.getFileSender().isAccepted() && sendFileDialog.getFileSender().isActive()) {\n sendFileDialog.transferStoppedFromReceiver();\n } else if (!sendFileDialog.getFileSender().isAccepted()) {\n sendFileDialog.transferRefusedFromReceiver();\n }\n }\n\n } catch (Exception e) {\n log.error(e);\n }\n\n } else if (message.getName().equals(Request.ADDTOCONFERENCE)) {\n\n try {\n //il priomo elemento è il nick da aggiungere gli alri i membri della conferenza\n String nickToAdd = message.getParameters().getParameter().get(0).getValue();\n\n //dalla lista di partecipanti alla conferenza\n //rcavo l'arrey di quelli che servono in questo client\n List<String> componentsOfConferenz = new LinkedList<String>();\n for (String string : message.getReceivers().getReceiver()) {\n\n if (!string.equals(ccv.getNick())) {\n componentsOfConferenz.add(string);\n }\n }\n componentsOfConferenz.add(message.getSender());\n\n ChatWindow cw = ccv.getHelper().getConferenceWith(componentsOfConferenz.toArray(new String[componentsOfConferenz.size()]));\n cw.addClientToChat(nickToAdd);\n\n } catch (Exception e) {\n log.error(e);\n }\n\n } else if (message.getName().equals(Request.STARTGAME)) {\n log.debug(\"start dama game\");\n try {\n\n GameHome home = new GameHome(ccv);\n home.setLocationRelativeTo(ccv.getFrame());\n home.setVisible(true);\n home.startDamaClient(message.getSender());\n\n } catch (Exception e) {\n log.error(e);\n }\n\n } else if (message.getName().equals(Request.DAMAPOSITION)) {\n try {\n log.debug(\"position for dama\");\n\n int posX = (int) Double.parseDouble(message.getParameters().getParameter().get(0).getValue());\n log.debug(\"posX = \" + posX);\n int posY = (int) Double.parseDouble(message.getParameters().getParameter().get(1).getValue());\n log.debug(\"posY = \" + posY);\n\n DamaCanvas canvas = (DamaCanvas) ccv.getHelper().getGameWith(message.getSender(), DamaCanvas.class);\n log.debug(canvas);\n canvas.setClick(new Point(posX, posY));\n canvas.setMyClick(false);\n canvas.repaint();\n\n } catch (Exception e) {\n //potrebbe da nullpointer\n log.error(e);\n }\n }\n\n// </editor-fold>\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" COMMAND \">\n } else if (message.getType().equals(COMMAND)) {\n\n if (message.getName().equals(Command.REMOVEUSER)) {\n\n String clientToRemove = message.getParameters().getParameter().get(0).getValue();\n\n ArrayList<Client> clients = ccv.getClients();\n ListIterator<Client> li = clients.listIterator();\n boolean continua = true;\n while (li.hasNext() && continua) {\n Client elem = li.next();\n if (elem.getNick().equals(clientToRemove)) {\n log.info(\"remove element : \" + elem);\n clients.remove(elem);\n DefaultListModel listModel = (DefaultListModel) ccv.getClientsList().getModel();\n synchronized (listModel) {\n listModel.removeElement(elem.getNick());\n ccv.getClientsList().validate();\n ccv.getFrame().pack();\n continua = false;\n }\n }\n }\n\n /*aggiungo un nuovo utente che si è connesso*/\n } else if (message.getName().equals(Command.ADDUSER)) {\n String clientToAdd = message.getParameters().getParameter().get(0).getValue();\n\n ccv.getClients().add(new Client(null, clientToAdd));\n// JList list = ccv.getClientsList();\n int position = ccv.getClientsList().getModel().getSize() - 1;\n DefaultListModel listModel = (DefaultListModel) ccv.getClientsList().getModel();\n synchronized (listModel) {\n// listModel.add(position, clientToAdd);\n\n// listModel.remove(listModel.size() - 1);\n listModel.addElement(clientToAdd);\n// listModel.addElement(null);\n\n ccv.getClientsList().validate();\n ccv.getFrame().validate();\n\n log.debug(\"utenti connessi : \");\n for (Object elem : listModel.toArray()) {\n\n try {\n log.debug(\"utente : \" + elem.toString());\n } catch (Exception e) {\n log.debug(\"elemento NULLO\");\n }\n }\n }\n }\n\n }\n // </editor-fold>\n\n\n }\n } catch (Exception e) {\n log.error(e);\n }\n }\n\n\n try {\n is.close();\n } catch (IOException ex) {\n log.error(ex);\n }\n return null;\n\n\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n Uri uri = intent.getData();\n String parentId = intent.getStringExtra(EXTRA_PARENT_ID);\n File file;\n String type;\n String extension;\n String eventId;\n\n // this should not happen but seems to happen in some cases ...\n // possible due to the way a third party app might be return the photo\n if (uri == null) return;\n\n switch (intent.getAction()) {\n case ACTION_CASE_ATTACHMENT_UPLOAD:\n file = saveFile(uri, Attachment.attachmentDirectoryForCases(parentId));\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_CASE);\n // only start upload if we have an actual id for this parent\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_CASE);\n }\n }\n break;\n case ACTION_ACCOUNT_ATTACHMENT_UPLOAD:\n file = saveFile(uri, Attachment.attachmentDirectoryForAccount(parentId));\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_ACCOUNT);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_ACCOUNT);\n }\n }\n break;\n case ACTION_ASSET_PHOTO_UPLOAD:\n type = getContentResolver().getType(uri);\n extension = type != null ? type.substring(type.lastIndexOf(\"/\") + 1, type.length()) : \"jpg\";\n file = saveFile(uri, Attachment.attachmentDirectoryForAssets(parentId), Attachment.getAssetPhotoFileName() + \".\" + extension);\n\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_ASSET);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_ASSET);\n }\n }\n break;\n case ACTION_ACCOUNT_PHOTO_UPLOAD:\n extension = Attachment.getAccountPhotoFileType();\n file = saveFile(uri, Attachment.attachmentDirectoryForAccount(parentId), Attachment.getAccountPhotoFileName() + extension);\n\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_ACCOUNT);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_ACCOUNT);\n }\n }\n break;\n case ACTION_ACCOUNT_LICENSE_PHOTO_UPLOAD:\n extension = Attachment.getAccountPhotoFileType();\n file = saveFile(uri, Attachment.attachmentDirectoryForAccount(parentId), Attachment.getAccountLicensePhotoFileName() + extension);\n\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_ACCOUNT);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_ACCOUNT);\n }\n }\n break;\n case ACTION_CHECK_IN_PHOTO_UPLOAD:\n type = getContentResolver().getType(uri);\n extension = type != null ? type.substring(type.lastIndexOf(\"/\") + 1, type.length()) : \"jpg\";\n file = saveFile(uri, Attachment.attachmentDirectoryForEvents(parentId), Attachment.getCheckInPhotoFileName() + \".\" + extension);\n\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_EVENT);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_EVENT);\n }\n }\n break;\n case ACTION_CHECK_OUT_PHOTO_UPLOAD:\n type = getContentResolver().getType(uri);\n extension = type != null ? type.substring(type.lastIndexOf(\"/\") + 1, type.length()) : \"jpg\";\n file = saveFile(uri, Attachment.attachmentDirectoryForEvents(parentId), Attachment.getCheckOutPhotoFileName() + \".\" + extension);\n\n if (file != null) {\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_EVENT);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_EVENT);\n }\n }\n break;\n case ACTION_SURVEY_PHOTO_UPLOAD:\n String fileName = uri.getLastPathSegment();\n Log.e(TAG, \"fileName in surveyPhotoUpload: \" + fileName);\n file = saveFile(uri, Attachment.attachmentDirectoryForSurveyQR(parentId), fileName);\n\n if (file != null) {\n Log.e(TAG, \"deleting file: \" + uri.getPath());\n ContentUtils.deleteContent(this, uri);\n\n Uri thumbnailUri = getThumbnailUri(uri);\n Log.e(TAG, \"deleting thumbnail: \" + thumbnailUri.getPath());\n ContentUtils.deleteContent(this, thumbnailUri);\n\n eventId = getCurrentEventId();\n createPictureAuditStatus(file, parentId, eventId, Attachment.ParentType.PARENT_SURVEY_QR);\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(file, parentId, Attachment.ParentType.PARENT_SURVEY_QR);\n }\n }\n break;\n case ACTION_ACCOUNT_FLUSH:\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(new File(uri.getPath()), parentId, Attachment.ParentType.PARENT_ACCOUNT);\n }\n break;\n case ACTION_ASSET_FLUSH:\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(new File(uri.getPath()), parentId, Attachment.ParentType.PARENT_ASSET);\n }\n break;\n case ACTION_CASE_FLUSH:\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(new File(uri.getPath()), parentId, Attachment.ParentType.PARENT_CASE);\n }\n break;\n case ACTION_EVENT_FLUSH:\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(new File(uri.getPath()), parentId, Attachment.ParentType.PARENT_EVENT);\n }\n break;\n case ACTION_SURVEY_FLUSH:\n if (!mDataManager.isClientId(parentId)) {\n uploadFile(new File(uri.getPath()), parentId, Attachment.ParentType.PARENT_SURVEY_QR);\n }\n break;\n }\n }", "public IAttachment attachFile()\n throws OculusException;", "public byte[] getByteAttachment() {\n\t\treturn byteAttachment;\n\t}", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "public void recibir( )\r\n {\n \t try\r\n\t {\r\n \t\t recibirArchivo();\r\n\t \r\n \t\t cerrarRecibir();\r\n\t \r\n\t }catch( Exception e )\r\n \t {\r\n \t\t System.out.println( \"Recibir: \"+e.toString() ); \r\n \t }\r\n \r\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data)\n {\n //\"/storage/emulated/0/IRON-HID/captures\" <== can open~!!\n //\"file:///mnt/sdcard/Download/20141025_170314.jpg\"\n if (requestCode == CHOOSE_FILE_TO_UPLOAD)\n {\n if (resultCode == RESULT_OK)\n {\n Uri uri = data.getData();\n if (uri != null)\n {\n // Send file\n String filePath = uri.getPath();\n filePath = filePath.replace(\"file://\", \"\");\n mPutCommand += \" \" + filePath;\n mCommandManager.SendCommand(mPutCommand);\n }\n }\n }\n\n super.onActivityResult(requestCode, resultCode, data);\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tUri uri = dataContract.SOURCE_CONTENT_URI;\n\t\t\t\tif (catergory.equals(\"thumbnail\"))\n\t\t\t\t{\n\t\t\t\t\turi = dataContract.THUMBNAIL_CONTENT_URI;\n\t\t\t\t}\n\t\t\t\tUri dataUri = uri.buildUpon()\n\t\t\t\t\t\t\t.appendPath(giftId).build();\n\t\t\t\t\n\t\t\t\tbyte data[] = null;\n\t\t\t\tint dataRead = 0;\n\t\t\t\tint tdatalen = 0;\n\t\t\t\tint buffer_size = 2048;\n\t\t\t\ttry {\n\t\t\t\t\tInputStream in = resolver.openInputStream(dataUri);\n\t\t\t\t\tdata = new byte[buffer_size];\n\t\t\t\t\tdo {\n\t\t\t\t\t\tdataRead = in.read(data, tdatalen, buffer_size);\n\t\t\t\t\t\tif (dataRead != -1) {\n\t\t\t\t\t\t\tbyte tmp[] = new byte[data.length + buffer_size];\n\t\t\t\t\t\t\tSystem.arraycopy(data, 0, tmp, 0, data.length);\n\t\t\t\t\t\t\ttdatalen += dataRead;\n\t\t\t\t\t\t\tdata = tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (dataRead != -1);\n\t\t\t\t\tin.close();\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tcatch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMessage msg = Message.obtain(handler, PotlatchMsg.GET_DATA.getVal());\n\t\t\t\tBundle b = new Bundle();\n\t\t\t\tb.putByteArray(PotlatchConst.get_data, data);\n\t\t\t\tmsg.setData(b);\n\t\t\t\thandler.sendMessage(msg);\n\t\n\t\t\t}", "@Override\n public void handle(ChannelHandlerContext ctx, String requestId, FileDownloadMessage message) {\n // if this message have searched before, ignore it\n String messageId = message.getMessageId();\n String filename = message.getFilename();\n String requestIp = message.getRequestIp();\n if (messageSearched.containsKey(messageId)) {\n ctx.writeAndFlush(new MessageOutput(requestId, \"save_res\", false));\n return;\n }\n messageSearched.put(messageId, 1);\n\n // download\n LOG.info(\"start send file : \" + filename);\n download(filename, requestIp);\n LOG.info(\"file send complete: \" + filename);\n ctx.writeAndFlush(new MessageOutput(requestId, \"save_res\", true));\n }", "@Override\n public void parseEmbedded(InputStream stream, ContentHandler handler, Metadata metadata, boolean outputHtml)\n throws SAXException, IOException {\n String name = metadata.get(Metadata.RESOURCE_NAME_KEY);\n\n if (name == null) {\n name = \"file_\" + fileCount++;\n } else {\n //make sure to select only the file name (not any directory paths\n //that might be included in the name) and make sure\n //to normalize the name\n name = FilenameUtils.normalize(FilenameUtils.getName(name));\n }\n\n //now try to figure out the right extension for the embedded file\n MediaType contentType = detector.detect(stream, metadata);\n\n if (name.indexOf('.') == -1 && contentType != null) {\n try {\n name += config.getMimeRepository().forName(\n contentType.toString()).getExtension();\n } catch (MimeTypeException e) {\n e.printStackTrace();\n }\n }\n //should add check to make sure that you aren't overwriting a file\n Path outputFile = outputDir.resolve(name);\n //do a better job than this of checking\n java.nio.file.Files.createDirectories(outputFile.getParent());\n java.nio.file.Files.copy(stream, outputFile, StandardCopyOption.REPLACE_EXISTING);\n\n //上传图片,返回Url,并建立一个映射表\n Calendar calendar = Calendar.getInstance();\n SimpleDateFormat DateFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n String dateStr = DateFormat.format(calendar.getTime());\n\n String key = dateStr+\"_\"+UUID.randomUUID().toString()+\"_\"+name;\n String qiniuurl = \"\";\n try {\n File file = new File(outputFile.toString());\n InputStream in = new FileInputStream(file);\n byte b[]=new byte[(int)file.length()];\n in.read(b);\n in.close();\n qiniuurl = fu.fileUpload(uploadManager, b, key, null, contentType.toString());\n imgPathMap.put(name,qiniuurl);\n logger.info(\"=====图片url:\"+qiniuurl);\n }catch (Exception e){\n e.printStackTrace();\n }\n }", "private Attachment createAttachment(String assetId, String name, Attachment originalAttachmentMetadata, String contentType,\n InputStream attachmentContentStream, UriInfo uriInfo) throws InvalidJsonAssetException, AssetPersistenceException, NonExistentArtefactException {\n try {\n persistenceBean.retrieveAsset(assetId);\n } catch (NonExistentArtefactException e) {\n // The message from the PersistenceLayer is unhelpful in this context, so send back a better one\n throw new NonExistentArtefactException(\"The parent asset for this attachment (id=\"\n + assetId + \") does not exist in the repository.\");\n }\n\n Attachment attachmentMetadata = new Attachment(originalAttachmentMetadata);\n\n // Add necessary fields to the attachment (JSON) metadata\n if (attachmentMetadata.get_id() == null) {\n attachmentMetadata.set_id(persistenceBean.allocateNewId());\n }\n attachmentMetadata.setAssetId(assetId);\n if (contentType != null) {\n attachmentMetadata.setContentType(contentType);\n }\n attachmentMetadata.setName(name);\n attachmentMetadata.setUploadOn(IsoDate.format(new Date()));\n\n // Create the attachment content\n if (attachmentContentStream != null) {\n AttachmentContentMetadata contentMetadata = persistenceBean.createAttachmentContent(name, contentType, attachmentContentStream);\n\n // TODO perhaps we should try to clean up after ourselves and delete the attachmentMetadata\n // TODO seriously, this is one of the places where we reaslise that using a DB that doesn't\n // support transactions means we don't get some of the guarantees that we might be used to.\n\n attachmentMetadata.setGridFSId(contentMetadata.filename);\n attachmentMetadata.setSize(contentMetadata.length);\n }\n\n Attachment returnedAttachment = persistenceBean.createAttachmentMetadata(attachmentMetadata);\n\n computeAttachmentURL(returnedAttachment, uriInfo);\n\n return returnedAttachment;\n }", "private void addAttachments(Multipart multipart) throws MessagingException {\n\t\tEnumeration<?> properties = props.keys();\n\n\t\twhile (properties.hasMoreElements()) {\n\t\t\tString key = (String) properties.nextElement();\n\n\t\t\tif ((props.getPropertyMime(key) == null) || (key.equals(Email.MAIL_CONTENT)) || (key.equals(Email.MAIL_SUBJECT))|| (props.getPropertyPrivacy(key) == true)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbyte[] emailAttachment = props.getPropertyAttachment(key);\n\t\t\tString emailAttachmentName = null;\n\n\t\t\tif (emailAttachment == null) {\n\t\t\t\ttry {\n\t\t\t\t\temailAttachment = props.getProperty(key).getBytes(\"UTF-8\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((emailAttachment == null) || (emailAttachment.length == 0)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif (props.getPropertyAlternateName(key) != null) {\n\t\t\t\temailAttachmentName = props.getPropertyAlternateName(key);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\temailAttachmentName = key;\n\t\t\t}\n\n\t\t\tif (logger.isLoggable(Level.FINE)) {\n\t\t\t\tlogger.fine(Emit.messages.getString(\"AddAttachment\") + \" \" + emailAttachmentName + \",property:\" + key + \",MIME:\" + props.getPropertyMime(key) + \",length:\" + emailAttachment.length);\n\t\t\t}\n\n\t\t\tBodyPart messageBodyPart = new MimeBodyPart();\n\t\t\tByteArrayDataSource bads = new ByteArrayDataSource(emailAttachment, props.getPropertyMime(key));\n\t\t\tmessageBodyPart.setDataHandler(new DataHandler(bads));\n\t\t\tmessageBodyPart.setFileName(emailAttachmentName);\n\t\t\tmultipart.addBodyPart(messageBodyPart);\n\t\t}\n\t}", "public void sendMessage(String str, final String str2) {\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setMessage(\"Sending...\");\n progressDialog.setCancelable(false);\n progressDialog.show();\n final DatabaseReference reference2 = FirebaseDatabase.getInstance().getReference(this.dbname);\n this.uploadId = reference2.push().getKey();\n if (this.filePath != null) {\n StorageReference reference3 = FirebaseStorage.getInstance().getReference(this.dbname);\n final StorageReference child = reference3.child(this.uploadId + \".pdf\");\n final String str3 = str;\n final String str4 = str2;\n final ProgressDialog progressDialog2 = progressDialog;\n child.putFile(this.filePath).addOnSuccessListener((OnSuccessListener) new OnSuccessListener<UploadTask.TaskSnapshot>() {\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n child.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {\n public void onSuccess(Uri uri) {\n HashMap hashMap = new HashMap();\n hashMap.put(\"sender\", str3);\n hashMap.put(\"message\", str4);\n hashMap.put(\"time\", DateFormat.format(\"dd-MM-yyyy (HH:mm:ss)\", System.currentTimeMillis()).toString());\n hashMap.put(ImagesContract.URL, uri.toString());\n hashMap.put(JamXmlElements.TYPE, DiscussionActivity.this.type);\n hashMap.put(Scopes.PROFILE, DiscussionActivity.this.profile_url);\n hashMap.put(\"receiver\", DiscussionActivity.this.name);\n reference2.child(DiscussionActivity.this.uploadId).setValue(hashMap);\n DiscussionActivity.this.filePath = null;\n progressDialog2.dismiss();\n }\n });\n }\n }).addOnFailureListener((OnFailureListener) new OnFailureListener() {\n public void onFailure(Exception exc) {\n progressDialog.dismiss();\n Toast.makeText(DiscussionActivity.this, exc.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n } else {\n HashMap hashMap = new HashMap();\n hashMap.put(\"sender\", str);\n hashMap.put(\"message\", str2);\n hashMap.put(\"time\", DateFormat.format(\"dd-MM-yyyy (HH:mm:ss)\", System.currentTimeMillis()).toString());\n hashMap.put(ImagesContract.URL, (Object) null);\n hashMap.put(JamXmlElements.TYPE, (Object) null);\n hashMap.put(Scopes.PROFILE, this.profile_url);\n hashMap.put(\"receiver\", this.name);\n reference2.child(this.uploadId).setValue(hashMap);\n progressDialog.dismiss();\n }\n if (this.department.isEmpty()) {\n FirebaseDatabase.getInstance().getReference(\"Staff\").addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot children : dataSnapshot.getChildren()) {\n for (DataSnapshot next : children.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Staff staff = (Staff) next.getValue(Staff.class);\n if (!staff.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(staff.getToken(), staff.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n }\n });\n FirebaseDatabase.getInstance().getReference(\"HODs\").addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot children : dataSnapshot.getChildren()) {\n for (DataSnapshot next : children.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Hod hod = (Hod) next.getValue(Hod.class);\n if (!hod.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(hod.getToken(), hod.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n }\n });\n FirebaseDatabase.getInstance().getReference(\"Principal\").addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot next : dataSnapshot.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Principal principal = (Principal) next.getValue(Principal.class);\n if (!principal.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(principal.getToken(), principal.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n });\n return;\n }\n FirebaseDatabase.getInstance().getReference(\"Staff\").child(this.department).addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot next : dataSnapshot.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Staff staff = (Staff) next.getValue(Staff.class);\n if (staff.getId() != null && !staff.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(staff.getToken(), staff.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n });\n FirebaseDatabase.getInstance().getReference(\"HODs\").child(this.department).addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot next : dataSnapshot.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Hod hod = (Hod) next.getValue(Hod.class);\n if (!hod.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(hod.getToken(), hod.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n });\n FirebaseDatabase.getInstance().getReference(\"Students\").child(this.department).child(this.semester).addListenerForSingleValueEvent(new ValueEventListener() {\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot next : dataSnapshot.getChildren()) {\n if (next.getChildrenCount() != 0) {\n Student student = (Student) next.getValue(Student.class);\n if (!student.getId().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {\n DiscussionActivity.this.sendNotification(student.getToken(), student.getId(), DiscussionActivity.this.name, str2);\n }\n }\n }\n }\n });\n }", "public void processBack(Attachment attach,Message m) throws IOException, InterruptedException, ExecutionException{\n\t BackMessage bm = (BackMessage) m;\n\t attach.server.close(attach.client);\n }", "@POST\n\t\t\t@Path(\"/post\")\n\t\t\t@Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n\t\t\t@Produces({MediaType.APPLICATION_XML})\n\t\t\tpublic Rows postAttachment(@Context UriInfo uriInfo,@Context HttpHeaders header,@FormParam(\"body\") String xml) {\n\t\t\t\tRows rows = null;\n\t\t\t\tAttachmentDao post;\n\t\t\t\ttry {\n\t\t\t\t\tpost=new AttachmentDao(uriInfo,header);\n\t\t\t\t\tpost.setPostXml(xml.trim());\n\t\t\t\t\tpost.postAttachmentContainer();\n\t\t\t\t\trows=post.getAttachmentRowModified();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (DaoException d) {\n\t\t\t\t\t d.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@Override\r\n\tpublic String getContentType() {\r\n\t\treturn attachmentType;\r\n\t}", "boolean hasHaveAttachment();", "public void PDFAttachGenericFile(PDDocument doc, String filename, String relationship, String description,\n\t\t\t\t\t\t\t\t\t String subType, byte[] data) throws IOException {\n\t\tfileAttached = true;\n\n\t\tPDComplexFileSpecification fs = new PDComplexFileSpecification();\n\t\tfs.setFile(filename);\n\n\t\tCOSDictionary dict = fs.getCOSObject();\n\t\tdict.setName(\"AFRelationship\", relationship);\n\t\tdict.setString(\"UF\", filename);\n\t\tdict.setString(\"Desc\", description);\n\n\t\tByteArrayInputStream fakeFile = new ByteArrayInputStream(data);\n\t\tPDEmbeddedFile ef = new PDEmbeddedFile(doc, fakeFile);\n//\t\tef.addCompression();\n\t\tef.setSubtype(subType);\n\t\tef.setSize(data.length);\n\t\tef.setCreationDate(new GregorianCalendar());\n\n\t\tef.setModDate(GregorianCalendar.getInstance());\n\n\t\tfs.setEmbeddedFile(ef);\n\n\t\t// In addition make sure the embedded file is set under /UF\n\t\tdict = fs.getCOSObject();\n\t\tCOSDictionary efDict = (COSDictionary) dict.getDictionaryObject(COSName.EF);\n\t\tCOSBase lowerLevelFile = efDict.getItem(COSName.F);\n\t\tefDict.setItem(COSName.UF, lowerLevelFile);\n\n\t\t// now add the entry to the embedded file tree and set in the document.\n\t\tPDDocumentNameDictionary names = new PDDocumentNameDictionary(doc.getDocumentCatalog());\n\t\tPDEmbeddedFilesNameTreeNode efTree = names.getEmbeddedFiles();\n\t\tif (efTree == null) {\n\t\t\tefTree = new PDEmbeddedFilesNameTreeNode();\n\t\t}\n\n\t\tMap<String, PDComplexFileSpecification> namesMap = new HashMap<>();\n\n\t\tMap<String, PDComplexFileSpecification> oldNamesMap = efTree.getNames();\n\t\tif (oldNamesMap != null) {\n\t\t\tfor (String key : oldNamesMap.keySet()) {\n\t\t\t\tnamesMap.put(key, oldNamesMap.get(key));\n\t\t\t}\n\t\t}\n\t\tnamesMap.put(filename, fs);\n\t\tefTree.setNames(namesMap);\n\n\t\tnames.setEmbeddedFiles(efTree);\n\t\tdoc.getDocumentCatalog().setNames(names);\n\n\t\t// AF entry (Array) in catalog with the FileSpec\n\t\tCOSBase AFEntry = (COSBase) doc.getDocumentCatalog().getCOSObject().getItem(\"AF\");\n\t\tif ((AFEntry == null)) {\n\t\t\tCOSArray cosArray = new COSArray();\n\t\t\tcosArray.add(fs);\n\t\t\tdoc.getDocumentCatalog().getCOSObject().setItem(\"AF\", cosArray);\n\t\t} else if (AFEntry instanceof COSArray) {\n\t\t\tCOSArray cosArray = (COSArray) AFEntry;\n\t\t\tcosArray.add(fs);\n\t\t\tdoc.getDocumentCatalog().getCOSObject().setItem(\"AF\", cosArray);\n\t\t} else if ((AFEntry instanceof COSObject) &&\n\t\t\t\t((COSObject) AFEntry).getObject() instanceof COSArray) {\n\t\t\tCOSArray cosArray = (COSArray) ((COSObject) AFEntry).getObject();\n\t\t\tcosArray.add(fs);\n\t\t} else {\n\t\t\tthrow new IOException(\"Unexpected object type for PDFDocument/Catalog/COSDictionary/Item(AF)\");\n\t\t}\n\t}", "public Attachment loadAttachment(PeerResponse response) throws IdentifierException, NumberFormatException, NxtException {\n return null;\n }", "private void saveFile(String filename, InputStream in) throws Exception {\r\n\r\n String dir = mReceiverInfo.getAttachmentDir();\r\n String separator = \"\";\r\n\r\n File storefile = new File(MimeUtility.decodeText(dir) +\r\n MimeUtility.decodeText(separator) +\r\n MimeUtility.decodeText(filename));\r\n BufferedOutputStream bos = null;\r\n BufferedInputStream bis = null;\r\n\r\n try {\r\n\r\n bos = new BufferedOutputStream(new FileOutputStream(storefile));\r\n bis = new BufferedInputStream(in);\r\n\r\n int c;\r\n\r\n while ((c = bis.read()) != -1) {\r\n bos.write(c);\r\n bos.flush();\r\n }\r\n }\r\n catch (Exception e) {\r\n e.printStackTrace();\r\n throw new Exception(\"Failed saving file!\");\r\n }\r\n finally {\r\n bos.close();\r\n bis.close();\r\n }\r\n }", "public void prepareData() throws Exception {\n for (int i = 0; i < this.f4804b.length; i++) {\n try {\n byte[] readFile = FileUtil.readFile(this.f4804b[i]);\n addPart(new String[]{String.format(\"Content-Disposition: form-data; name=\\\"%s_%d\\\"; filename=\\\"%s_%d.jpg\\\"\", new Object[]{this.f4803a, Integer.valueOf(i), this.f4803a, Integer.valueOf(i)}), \"Content-Type: image/webp\", String.format(\"Content-Length: %d\", new Object[]{Integer.valueOf(readFile.length)})}, readFile);\n } catch (IOException e) {\n }\n }\n }", "public abstract void photoMessage(Message m);", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n if (mHandler != null) {\n Message message = mHandler.obtainMessage();\n Bundle bundle = new Bundle();\n message.what = Constants.FROM_CANERA;\n bundle.putString(\"img_path\", sublist.get(position).getImagePath());\n message.setData(bundle);\n mHandler.sendMessage(message);\n }\n }", "@Override\n public Attachment loadAttachment(PeerResponse response) throws IdentifierException, NumberFormatException, NxtException {\n return new AliasBuy(response);\n }" ]
[ "0.65622234", "0.6333947", "0.627988", "0.6234155", "0.6228958", "0.62228715", "0.61808735", "0.617283", "0.6164297", "0.6133342", "0.61039764", "0.6091694", "0.6082682", "0.6078785", "0.60652274", "0.60346377", "0.6011026", "0.5996583", "0.59906554", "0.59517306", "0.59431094", "0.59280264", "0.5917269", "0.590785", "0.5893925", "0.589359", "0.5871177", "0.58706075", "0.5862457", "0.58574134", "0.5851425", "0.5835596", "0.58327746", "0.5832735", "0.58280724", "0.5826551", "0.58213246", "0.5794624", "0.57933605", "0.5792819", "0.57565457", "0.57541543", "0.5742083", "0.5734315", "0.57236475", "0.57181567", "0.5712501", "0.57075346", "0.5693983", "0.568917", "0.5687873", "0.5685738", "0.5679874", "0.5669347", "0.56621736", "0.5624197", "0.5616837", "0.5598777", "0.5595074", "0.55935055", "0.5589681", "0.55730116", "0.5552867", "0.5544611", "0.55444795", "0.5541218", "0.5526149", "0.55217844", "0.55210155", "0.5513512", "0.5512165", "0.5511308", "0.5492426", "0.5491502", "0.54904944", "0.54889286", "0.54883265", "0.54777175", "0.5477519", "0.54633504", "0.54590654", "0.5450715", "0.5441508", "0.54380774", "0.54321563", "0.5419939", "0.5419727", "0.5419642", "0.5418699", "0.5415989", "0.5410603", "0.5409547", "0.5409386", "0.54050803", "0.5404638", "0.5403568", "0.54023457", "0.54019004", "0.5401883", "0.5395745", "0.5386365" ]
0.0
-1
Called by generated sub class
protected void register(String widgetClass, Invoker creator) { creators.put(widgetClass, creator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public AbstractGenerateurAbstractSeule() {\r\n\t\tsuper();\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private ProcessedDynamicData( ) {\r\n super();\r\n }", "@Override\n public void perish() {\n \n }", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void billGenerate() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void exportThis()\r\n\t{\n\t\tsuper.exportThis();\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n protected void prot() {\n }", "protected abstract void generate();", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n void init() {\n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void generateClass(ClassVisitor classVisitor) throws Exception {\n ClassEmitter ce = new ClassEmitter(classVisitor);\n\n Map<Function, String> converterFieldMap = initClassStructure(ce);\n\n initDefaultConstruct(ce, converterFieldMap);\n\n buildMethod_getTargetInstanceFrom(ce);\n\n buildMethod_mergeProperties(ce, converterFieldMap);\n\n ce.end_class();\n }", "public GenerateurImpl() {\n\t\tsuper();\n\t\tthis.value = 0;\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public BPELGeneratorImpl() {\r\n \t\tsuper(GENERATOR_NAME);\r\n \t}", "public void generate() {\n\t\tthis.initializePathBindingClass();\n\t\t// managed at abstract level ; name provided at binding generation time\n\t\t// this.addGetName();\n\t\t// this.addGetType();\n\n\t\t// add all properties methods\n\t\tthis.addProperties();\n\t\t// add getter that provides property list\n\t\tthis.addGetChildBindings();\n\n\t\t// initialize class declaration (*Binding)\n\t\tthis.initializeRootBindingClass();\n\t\t// add constructors\n\t\tthis.addConstructors();\n\t\t// add getWithRoot method\n\t\tthis.addGetWithRoot();\n\t\t// add getSafelyWithRoot method\n\t\tthis.addGetSafelyWithRoot();\n\n\t\tthis.addGeneratedTimestamp();\n\t\tthis.addSerialVersionUID();\n\t\tthis.saveCode(this.pathBindingClass);\n\t\tthis.saveCode(this.rootBindingClass);\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n super.init();\n\n }", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void intializeSpecific() {\n\r\n\t}", "public void init() {\r\n\t\t// to override\r\n\t}", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void init() {}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override // opcional\n public void init(){\n\n }", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "protected ChildType() {/* intentionally empty block */}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n public void startMethodGeneration() {\n byteArrayOut.addMethodStatus();\n }", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "protected void childInit()\n {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "public void generate() {\n\t}", "protected void init() {\n // to override and use this method\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void postInit() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\t\tpublic void init() {\n\t\t}", "public abstract void generate();", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "protected void preRender()\n {\n // subclass\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}" ]
[ "0.65762925", "0.6568232", "0.65438753", "0.64578533", "0.645766", "0.6425571", "0.6348814", "0.62868077", "0.6267674", "0.6257034", "0.62552893", "0.6230297", "0.62194824", "0.62194824", "0.620607", "0.6191075", "0.61882555", "0.61882555", "0.617091", "0.61631", "0.61592597", "0.61506367", "0.6146668", "0.6136499", "0.6136085", "0.613536", "0.613317", "0.6131878", "0.6131878", "0.612561", "0.6122214", "0.6111843", "0.6072846", "0.6070157", "0.60558814", "0.6055467", "0.6049933", "0.6014391", "0.6014391", "0.59985656", "0.59985656", "0.59985656", "0.59985656", "0.59985656", "0.59985656", "0.5997368", "0.59969115", "0.59965235", "0.59945613", "0.59829754", "0.59801316", "0.597815", "0.59752387", "0.59752387", "0.5972278", "0.59706616", "0.59697527", "0.59585786", "0.59520596", "0.59515196", "0.5950571", "0.5942595", "0.5939681", "0.5939681", "0.5939681", "0.5939681", "0.5939681", "0.5939681", "0.5939533", "0.5937699", "0.593421", "0.5933748", "0.5933748", "0.5933748", "0.5932922", "0.59244347", "0.590717", "0.5905378", "0.5900784", "0.5897301", "0.5897301", "0.5894623", "0.5893783", "0.5893783", "0.5888136", "0.58877224", "0.58876246", "0.5883969", "0.58814406", "0.5874569", "0.5863751", "0.5858257", "0.584609", "0.584609", "0.584609", "0.584609", "0.584609", "0.5844208", "0.58425444", "0.58425444", "0.58425444" ]
0.0
-1
/======================================== Constructors ======================================== Construct a customized recommender model with the given data.
public CustomRecommender(int uc, int ic, double max, double min) { /* ===================== * COMMENT FOR AUTHORS * ===================== * Please make sure that all your custom member variables * are correctly initialized in this stage. * If you added new variables in "Common Variables" section above, * you should initialize them properly here. * You may add parameters as well. */ userCount = uc; itemCount = ic; maxValue = max; minValue = min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Recommender buildRecommender(DataModel dataModel) \n\t throws TasteException {\n\t \tUserSimilarity userSim=new PearsonCorrelationSimilarity(dataModel);\n\t \tUserNeighborhood nbh = new NearestNUserNeighborhood(10, userSim, dataModel);\n\t \t\t\treturn new GenericUserBasedRecommender(dataModel, nbh, userSim);\n\t }", "public Recommender() {\n this(2);\n }", "@Override\n\t\t\tpublic Recommender buildRecommender(DataModel model)\n\t\t\t\t\tthrows TasteException {\n\t\t\t\tUserSimilarity similarity = new EuclideanDistanceSimilarity(model);\n\t\t\t\tUserNeighborhood neighbor = new NearestNUserNeighborhood(80, similarity, model);\n\t\t\t\treturn \n\t\t\t\tnew GenericUserBasedRecommender(model, neighbor, similarity);\n//\t\t\t\tnew SlopeOneRecommender(model);\n\t\t\t\t}", "public SimilarityBasedRecommender()\n\t{\n\t\taWordIndex = generateWordIndex(); // when a new SimilarityBasedRecommender is created, we refresh the wordIndex.\n\t}", "public Recommender(int k) {\n K = k;\n }", "private Recommendation() {\r\n }", "public Recommender(Context context, Listener listener, boolean includeRecommendedOnly) {\n mListener = listener;\n mIncludeRecommendedOnly = includeRecommendedOnly;\n mDataManager = RecommendationDataManager.acquireManager(context, this);\n }", "public DatasetReader()\n\t{\n\t\treviews = new ArrayList<Review>();\n\t\tratings = new HashMap<Double,List<Double>>();\n\t\tproducts = new HashMap<String, Map<String,Double>>();\n\t\tproductRatings = new HashMap<String, List<Double>>();\n\t\treInstanceList = new ArrayList<ReviewInstance>();\n\t\treInstanceMap = new HashMap<String, ReviewInstance>();\n\t}", "public Recommendation(Movie movie) {\n this.movie = movie;\n }", "public RecommenderPersonalised(final CaseSimilarity caseSimilarity, final DatasetReader reader) {\n this.caseSimilarity = caseSimilarity;\n this.reader = reader;\n }", "public CareerModel() {\n this(\"Career\",\n Riasec.Artistic,\n \"field\",\n \"category\",\n \"description from .csv\",\n CareerModelLoader.DEFAULT_IMAGE_PATH);\n }", "public Reviews() { }", "public Evaluator(RANKER_TYPE rType, METRIC trainMetric, int trainK, METRIC testMetric, int testK) {\n/* 612 */ this.type = rType;\n/* 613 */ this.trainScorer = this.mFact.createScorer(trainMetric, trainK);\n/* 614 */ this.testScorer = this.mFact.createScorer(testMetric, testK);\n/* 615 */ if (qrelFile.compareTo(\"\") != 0) {\n/* */ \n/* 617 */ this.trainScorer.loadExternalRelevanceJudgment(qrelFile);\n/* 618 */ this.testScorer.loadExternalRelevanceJudgment(qrelFile);\n/* */ } \n/* */ }", "public Evaluator(RANKER_TYPE rType, METRIC trainMetric, METRIC testMetric, int k) {\n/* 625 */ this.type = rType;\n/* 626 */ this.trainScorer = this.mFact.createScorer(trainMetric, k);\n/* 627 */ this.testScorer = this.mFact.createScorer(testMetric, k);\n/* 628 */ if (qrelFile.compareTo(\"\") != 0) {\n/* */ \n/* 630 */ this.trainScorer.loadExternalRelevanceJudgment(qrelFile);\n/* 631 */ this.testScorer.loadExternalRelevanceJudgment(qrelFile);\n/* */ } \n/* */ }", "public Model() {\n\t\t\n\t\t\n\t\t\n\t\t\n\tquestionMap = new HashMap<String, Question>();\n\t\n\tQuestion q1 = new Question(\"Climate\");\n\tq1.setContent(\"Do you prefer hot Climate to Cold Climate?\");\n\tquestionMap.put(q1.getAbbrev(), q1);\n\t\n\tQuestion q2 = new Question(\"Cost of Living\");\n\tq2.setContent(\"Do you prefer high cost of living areas?\");\n\tquestionMap.put(q2.getAbbrev(), q2);\n\t\n\tQuestion q3 = new Question(\"Population Density\");\n\tq3.setContent(\"Do you prefer high population to low population density areas?\");\n\tquestionMap.put(q3.getAbbrev(), q3);\n\t\n\tQuestion q4 = new Question(\"Job Opportunity\");\n\tq4.setContent(\"Do you prefer higher Job Opportunity areas?\");\n\tquestionMap.put(q4.getAbbrev(), q4);\n\t\n\tQuestion q5 = new Question(\"Crime Rates\");\n\tq5.setContent(\"Do you prefer high crime rate areas?\");\n\tquestionMap.put(q5.getAbbrev(), q5);\n\n\t\n\t}", "public Evaluator(RANKER_TYPE rType, String trainMetric, String testMetric) {\n/* 648 */ this.type = rType;\n/* 649 */ this.trainScorer = this.mFact.createScorer(trainMetric);\n/* 650 */ this.testScorer = this.mFact.createScorer(testMetric);\n/* 651 */ if (qrelFile.compareTo(\"\") != 0) {\n/* */ \n/* 653 */ this.trainScorer.loadExternalRelevanceJudgment(qrelFile);\n/* 654 */ this.testScorer.loadExternalRelevanceJudgment(qrelFile);\n/* */ } \n/* */ }", "public Evaluator(RANKER_TYPE rType, METRIC trainMetric, METRIC testMetric) {\n/* 599 */ this.type = rType;\n/* 600 */ this.trainScorer = this.mFact.createScorer(trainMetric);\n/* 601 */ this.testScorer = this.mFact.createScorer(testMetric);\n/* 602 */ if (qrelFile.compareTo(\"\") != 0) {\n/* */ \n/* 604 */ this.trainScorer.loadExternalRelevanceJudgment(qrelFile);\n/* 605 */ this.testScorer.loadExternalRelevanceJudgment(qrelFile);\n/* */ } \n/* */ }", "public Evaluator(RANKER_TYPE rType, METRIC metric, int k) {\n/* 638 */ this.type = rType;\n/* 639 */ this.trainScorer = this.mFact.createScorer(metric, k);\n/* 640 */ if (qrelFile.compareTo(\"\") != 0)\n/* 641 */ this.trainScorer.loadExternalRelevanceJudgment(qrelFile); \n/* 642 */ this.testScorer = this.trainScorer;\n/* */ }", "public RecommendAdapter(List<RecommendFood> data) {\n super(data);\n addItemType(RecommendFood.TYPE_BIG, R.layout.recommend_item_middle);\n addItemType(RecommendFood.TYPE_DETAIL, R.layout.recommend_item_detail);\n addItemType(RecommendFood.TYPE_MIDDLE, R.layout.recommend_item_middle);\n }", "void onRecommenderReady();", "public void bindRecommendation(@NonNull SmartspaceMediaData data) {\n if (mRecommendationViewHolder == null) {\n return;\n }\n\n if (!data.isValid()) {\n Log.e(TAG, \"Received an invalid recommendation list; returning\");\n return;\n }\n\n Trace.beginSection(\n \"MediaControlPanel#bindRecommendation<\" + data.getPackageName() + \">\");\n\n mRecommendationData = data;\n mSmartspaceId = SmallHash.hash(data.getTargetId());\n mPackageName = data.getPackageName();\n mInstanceId = data.getInstanceId();\n\n // Set up recommendation card's header.\n ApplicationInfo applicationInfo;\n try {\n applicationInfo = mContext.getPackageManager()\n .getApplicationInfo(data.getPackageName(), 0 /* flags */);\n mUid = applicationInfo.uid;\n } catch (PackageManager.NameNotFoundException e) {\n Log.w(TAG, \"Fail to get media recommendation's app info\", e);\n Trace.endSection();\n return;\n }\n\n CharSequence appName = data.getAppName(mContext);\n if (appName == null) {\n Log.w(TAG, \"Fail to get media recommendation's app name\");\n Trace.endSection();\n return;\n }\n\n PackageManager packageManager = mContext.getPackageManager();\n // Set up media source app's logo.\n Drawable icon = packageManager.getApplicationIcon(applicationInfo);\n ImageView headerLogoImageView = mRecommendationViewHolder.getCardIcon();\n headerLogoImageView.setImageDrawable(icon);\n fetchAndUpdateRecommendationColors(icon);\n\n // Set up media rec card's tap action if applicable.\n TransitionLayout recommendationCard = mRecommendationViewHolder.getRecommendations();\n setSmartspaceRecItemOnClickListener(recommendationCard, data.getCardAction(),\n /* interactedSubcardRank */ -1);\n bindRecommendationContentDescription(data);\n\n List<ImageView> mediaCoverItems = mRecommendationViewHolder.getMediaCoverItems();\n List<ViewGroup> mediaCoverContainers = mRecommendationViewHolder.getMediaCoverContainers();\n List<SmartspaceAction> recommendations = data.getValidRecommendations();\n\n boolean hasTitle = false;\n boolean hasSubtitle = false;\n for (int itemIndex = 0; itemIndex < NUM_REQUIRED_RECOMMENDATIONS; itemIndex++) {\n SmartspaceAction recommendation = recommendations.get(itemIndex);\n\n // Set up media item cover.\n ImageView mediaCoverImageView = mediaCoverItems.get(itemIndex);\n mediaCoverImageView.setImageIcon(recommendation.getIcon());\n\n // Set up the media item's click listener if applicable.\n ViewGroup mediaCoverContainer = mediaCoverContainers.get(itemIndex);\n setSmartspaceRecItemOnClickListener(mediaCoverContainer, recommendation, itemIndex);\n // Bubble up the long-click event to the card.\n mediaCoverContainer.setOnLongClickListener(v -> {\n View parent = (View) v.getParent();\n if (parent != null) {\n parent.performLongClick();\n }\n return true;\n });\n\n // Set up the accessibility label for the media item.\n String artistName = recommendation.getExtras()\n .getString(KEY_SMARTSPACE_ARTIST_NAME, \"\");\n if (artistName.isEmpty()) {\n mediaCoverImageView.setContentDescription(\n mContext.getString(\n R.string.controls_media_smartspace_rec_item_no_artist_description,\n recommendation.getTitle(), appName));\n } else {\n mediaCoverImageView.setContentDescription(\n mContext.getString(\n R.string.controls_media_smartspace_rec_item_description,\n recommendation.getTitle(), artistName, appName));\n }\n\n\n // Set up title\n CharSequence title = recommendation.getTitle();\n hasTitle |= !TextUtils.isEmpty(title);\n TextView titleView = mRecommendationViewHolder.getMediaTitles().get(itemIndex);\n titleView.setText(title);\n\n // Set up subtitle\n // It would look awkward to show a subtitle if we don't have a title.\n boolean shouldShowSubtitleText = !TextUtils.isEmpty(title);\n CharSequence subtitle = shouldShowSubtitleText ? recommendation.getSubtitle() : \"\";\n hasSubtitle |= !TextUtils.isEmpty(subtitle);\n TextView subtitleView = mRecommendationViewHolder.getMediaSubtitles().get(itemIndex);\n subtitleView.setText(subtitle);\n }\n mSmartspaceMediaItemsCount = NUM_REQUIRED_RECOMMENDATIONS;\n\n // If there's no subtitles and/or titles for any of the albums, hide those views.\n ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();\n final boolean titlesVisible = hasTitle;\n final boolean subtitlesVisible = hasSubtitle;\n mRecommendationViewHolder.getMediaTitles().forEach((titleView) ->\n setVisibleAndAlpha(expandedSet, titleView.getId(), titlesVisible));\n mRecommendationViewHolder.getMediaSubtitles().forEach((subtitleView) ->\n setVisibleAndAlpha(expandedSet, subtitleView.getId(), subtitlesVisible));\n\n // Guts\n Runnable onDismissClickedRunnable = () -> {\n closeGuts();\n mMediaDataManagerLazy.get().dismissSmartspaceRecommendation(\n data.getTargetId(), MediaViewController.GUTS_ANIMATION_DURATION + 100L);\n\n Intent dismissIntent = data.getDismissIntent();\n if (dismissIntent == null) {\n Log.w(TAG, \"Cannot create dismiss action click action: \"\n + \"extras missing dismiss_intent.\");\n return;\n }\n\n if (dismissIntent.getComponent() != null\n && dismissIntent.getComponent().getClassName()\n .equals(EXPORTED_SMARTSPACE_TRAMPOLINE_ACTIVITY_NAME)) {\n // Dismiss the card Smartspace data through Smartspace trampoline activity.\n mContext.startActivity(dismissIntent);\n } else {\n mBroadcastSender.sendBroadcast(dismissIntent);\n }\n };\n bindGutsMenuCommon(\n /* isDismissible= */ true,\n appName.toString(),\n mRecommendationViewHolder.getGutsViewHolder(),\n onDismissClickedRunnable);\n\n mController = null;\n if (mMetadataAnimationHandler == null || !mMetadataAnimationHandler.isRunning()) {\n mMediaViewController.refreshState();\n }\n Trace.endSection();\n }", "public ReviewsAdapter() {\n\t\tmovieReviews = new ArrayList<MovieReview>();\n\t}", "public Model(DataHandler data){\n //assign the data parameter to the instance\n //level variable data. The scope of the parameter\n //is within the method and that is where the JVM \n //looks first for a variable or parameter so we \n //need to specify that the instance level variable \n //is to be used by using the keyword 'this' followed \n //by the '.' operator.\n this.data = data;\n }", "private RatingModel(int rating, BeerModel beerModel, UserModel userModel) {\n \t\tthis.domainObject = new Rating(new Date(System.currentTimeMillis()), beerModel.getDomainObject(), userModel.getDomainObject(), rating);\n \t\tthis.node = DBUtil.createNode(NodeType.RATING);\n \t\tDBUtil.createRelationship(this.node, RelType.CONTAINS, beerModel.getNode());\n \t\tDBUtil.createRelationship(userModel.getNode(), RelType.DOES, this.node);\n \t\tthis.setRating(rating);\n \t\tthis.setDate(this.domainObject.getDate());\n \t}", "public Review(String myReview, String myReviewer, String myReviewed, String myDatePosted, String myRole,\n int myReviewID, double myRating) {\n this.myReview = myReview;\n this.myReviewer = myReviewer;\n this.myReviewed = myReviewed;\n this.myDatePosted = myDatePosted;\n this.myRole = myRole;\n this.myReviewID = myReviewID;\n this.myRating = myRating;\n }", "private Agent getRecommenderFromNode()\n\t{\n\t\tMap<String,ComputationOutputBuffer> nodeInputs =\n\t\t\t\tcomputationNode.getInputs();\n\n\t\tAgent agent = new Agent();\n\t\tagent.setType(computationNode.getRecommenderClass());\n if (options == null) {\n \tOptionEdge optionEdge = (OptionEdge)\n \t\t\tnodeInputs.get(\"options\").getNext();\n nodeInputs.get(\"options\").block();\n options = new NewOptions(optionEdge.getOptions());\n }\n\t\tagent.setOptions(options.getOptions());\n\t\treturn agent;\n\t}", "public EncogModel(VersatileMLDataSet theDataset) {\n\t\tthis.dataset = theDataset;\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_FEEDFORWARD,\n\t\t\t\tnew FeedforwardConfig());\n\t\tthis.methodConfigurations\n\t\t\t\t.put(MLMethodFactory.TYPE_SVM, new SVMConfig());\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_RBFNETWORK,\n\t\t\t\tnew RBFNetworkConfig());\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_NEAT,\n\t\t\t\tnew NEATConfig());\n\t\tthis.methodConfigurations\n\t\t\t\t.put(MLMethodFactory.TYPE_PNN, new PNNConfig());\n\t}", "public Question(String data) {\n //Transforma a string recebida pelo pedido http para json\n JsonParser jsonParser = new JsonParser();\n JsonObject Question = (JsonObject) jsonParser.parse(data);\n //Exibe os dados, em formato json\n System.out.println(Question.entrySet());\n /**\n * Revalidar TUDO, formatos, campos vazios, TUDO!!\n */\n regist();\n validateData();\n //Associa os dados ao objecto Question\n this._id = getLastID() + 1; //ir buscar o max id da bd + 1 \n this.title = Question.get(\"title\").getAsString();\n this.category = Question.get(\"category\").getAsInt();\n this.description = Question.get(\"description\").getAsString();\n this.image = Question.get(\"image\").getAsString();\n this.algorithm = Question.get(\"algoritmo\").getAsString();\n }", "protected PricingModel() {\n }", "private Recommendation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public RDR_RDR() { \r\n this(new DefaultModelClassFactory());\r\n }", "public Precision(Recommender recommender, Map<String, Object> params) {\n this(\n recommender,\n (int) params.get(\"numberOfRecommendations\"),\n (double) params.get(\"relevantThreshold\"));\n }", "public ModeloRecycler(){\n\n }", "public DieteticBrotherModel() {\n database = new Database();\n availableFood = database.initializeAvailableFood();\n recipes = database.initializeRecipes(availableFood);\n\n recipe = new Recipe(0, \"My Recipe\");\n }", "public EnsembleLibraryModel(Classifier classifier) {\n \n m_Classifier = classifier;\n \n //this may seem redundant and stupid, but it really is a good idea \n //to cache the stringRepresentation to minimize the amount of work \n //that needs to be done when these Models are rendered\n m_StringRepresentation = toString();\n \n updateDescriptionText();\n }", "public Review() {\n this.review_id = \"\";\n this.user_id = \"\";\n this.business_id = \"\";\n this.stars = 0;\n this.useful = 0;\n this.funny = 0;\n this.cool = 0;\n this.date = LocalDateTime.now();\n this.text = \"\";\n }", "private Recommendation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public Model(String r, String s, String p) {\r\n\t\tsetRank(r);\r\n\t\tsetSite(s);\r\n\t\tsetPeople(p);\t\t\r\n\t}", "@Test\n\tpublic void RecommendationModelMaintest() {\n\t\tRecommendationModel object3 = new RecommendationModel();\n\t\tassertNotNull(object3);\n\t}", "public Review(String authorUsername, Integer game_id, Integer givenRating,\n\t\t\tString reviewText, Timestamp reviewDate) {\n\t\tthis.authorUsername = authorUsername;\n\t\tthis.game_id = game_id;\n\t\tthis.givenRating = givenRating;\n\t\tthis.reviewText = reviewText;\n\t\tthis.reviewDate = reviewDate;\n\t}", "protected Review() {}", "public MyAdapter(Context mContext, List<Matches> mModelList1) {\n this.mContext = mContext;\n this.mModelList = mModelList1;\n }", "public RelevanceSet() {\r\n \tinitComponents();\r\n //updateData();\r\n }", "public QuestionPoolItemData(){\n }", "public CategoryratingcriteriaResource() {\n }", "public DataModel()\r\n {\r\n System.out.println(\"New DataModel created\");\r\n \r\n languageList = new LanguageList();\r\n }", "public interface IRecommender {\n\n /**\n * Generate an set of user profiles that are recommended to be followed by a user profile.\n *\n * @param profileId unique identifier of the user profile.\n * @param influencers map of influencer user profiles and those that follow them.\n * @param followers map of follower user profiles and the influencers they follow.\n * @param profiles list of all user profiles in the network.\n * @param numRecs number of user profiles to recommend.\n * @param threshold threshold for the number of followers a user profile needs to have to be\n * considered an influencer.\n * @param recs current set of recommended user profiles.\n * @return unique set of user profiles to follow.\n */\n Set<Integer> recommend(Integer profileId, Map<Integer, Set<Integer>> influencers,\n Map<Integer, Set<Integer>> followers, List<Profile> profiles, Integer numRecs,\n Integer threshold, Set<Integer> recs);\n\n}", "public DataModel(){\n this.listeners = new ArrayList<>();\n this.data = new ArrayList<>();\n }", "public RatingAndReview(double rating, String review){\t\t\n this.rating = rating;\n this.review = review;\n\t}", "public static String testRecommender(String algorithmName, Recommender r) {\r\n\t\tlong learnStart = System.currentTimeMillis();\r\n\t\tr.buildModel(rateMatrix);\r\n\t\tlong learnEnd = System.currentTimeMillis();\r\n\t\t\r\n\t\tlong evalStart = System.currentTimeMillis();\r\n\t\tEvaluationMetrics evalPointTrain = r.evaluate(rateMatrix);\r\n\t\tEvaluationMetrics evalPointTest = r.evaluate(testMatrix);\r\n\t\tRankEvaluator evalRank = new RankEvaluator(rateMatrix, testMatrix, evalPointTrain.getPrediction().plus(evalPointTest.getPrediction()));\r\n\t\tlong evalEnd = System.currentTimeMillis();\r\n\t\t\r\n\t\treturn evalRank.printOneLine() + \"\\t\"\r\n\t\t\t + String.format(\"%.4f\", evalPointTest.getAveragePrecision()) + \"\\t\"\r\n\t\t\t + Printer.printTime(learnEnd - learnStart) + \"\\t\"\r\n\t\t\t + Printer.printTime(evalEnd - evalStart);\r\n\t}", "public Builder setRecommenderSubtype(java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n recommenderSubtype_ = value;\n bitField0_ |= 0x00000004;\n onChanged();\n return this;\n }", "public ReviewsAdapter(Context context, List<ReviewData> list) {\n this.reviewDataList = list;\n }", "public static void main(String[] args) throws IOException, TasteException {\n DataModel dataModel = new FileDataModel(new File(\"D:\\\\2020新毕设\\\\recommendNews\\\\src\\\\main\\\\java\\\\cn\\\\ling\\\\news\\\\recommend\\\\movie.data\"));\n /*\n 计算相似度,相似度算法有很多种,欧几里得、皮尔逊等等。\n 这里使用的是皮尔逊PearsonCorrelationSimilarity\n */\n ItemSimilarity itemSimilarity = new PearsonCorrelationSimilarity(dataModel);\n //构建推荐器,协同过滤推荐有两种,分别是基于用户的和基于物品的,这里使用基于物品的协同过滤推荐\n GenericItemBasedRecommender recommender = new GenericItemBasedRecommender(dataModel, itemSimilarity);\n //给指定用户推荐若干个与指定商品相似的商品\n List<RecommendedItem> recommendedItemList = recommender.recommendedBecause(1, 5, 2);\n //打印推荐的结果\n System.out.println(\"使用基于物品的协同过滤算法\");\n System.out.println(\"根据用户1当前浏览的商品5,推荐2个相似的商品\");\n for (RecommendedItem recommendedItem : recommendedItemList) {\n System.out.println(recommendedItem);\n }\n }", "public DummyModel(String data) {\n textData = data;\n }", "MotifLearner(){\n notes = new ArrayList<>();\n times = new ArrayList<>();\n }", "public FeedBackMultipleAdapter(List<MultiItemEntity> data) {\n super(data);\n addItemType(TYPE_LEVEL_0, R.layout.feedback_item_0);\n addItemType(TYPE_LEVEL_1, R.layout.feedback_item_1);\n }", "@Override\r\n\tpublic void buildClassifier(Instances data) throws Exception {\n\r\n\t}", "public WeightingModel(){}", "public customAdapter() {\n super(SeekerRatingsListActivity.this, R.layout.rating_content, seekerRatingsList);\n }", "public RegressionModel(List<? extends DataEntry> dataSet) {\r\n this.regression = new OLSMultipleLinearRegression();\r\n processDataSet(dataSet);\r\n\r\n regression.newSampleData(regressandValues, regressorValues);\r\n }", "public Ratings() {\n this(DSL.name(\"ratings\"), null);\n }", "public AdapterForDisplayRecipes(Context context, ArrayList<RecipeModel> data) {\n mMainActivity = (MainActivity) context;\n this.mInflater = LayoutInflater.from(context);\n this.mData = data;\n// this.listener = listener;\n }", "public interface ISpeechRecommender\n{\n\n\t/**\n\t * @param pMPs\n\t * the list of MPs a user is interested in.\n\t * @param pKeyWords\n\t * the keywords the user is interested in.\n\t * @return an ArrayList of the recommended speeches in descending order.\n\t */\n\tArrayList<Speech> recommendSpeeches(ArrayList<String> pMPs, ArrayList<String> pKeyWords);\n}", "public CustomAdapter(List<Quiz> quizList) {// Now lets add stuff to the quiz.\n this.quizList = quizList;\n }", "public UserRating() {\n }", "public ReviewInfo()\n {\n m_nReviewValue = REVIEW_VALUE_POSITIVE;\n m_nID = 1;\n m_type = EntityType.kPolices;\n m_strReviewText = \"\";\n }", "public DataSet() {\n this.bars = new ArrayList<Bar>();\n this.reviews = new ArrayList<Review>();\n }", "@JsonCreator\n ReviewImpl(@JsonProperty(\"id\") final String id, @JsonProperty(\"version\") final Long version,\n @JsonProperty(\"createdAt\") final java.time.ZonedDateTime createdAt,\n @JsonProperty(\"lastModifiedAt\") final java.time.ZonedDateTime lastModifiedAt,\n @JsonProperty(\"lastModifiedBy\") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,\n @JsonProperty(\"createdBy\") final com.commercetools.api.models.common.CreatedBy createdBy,\n @JsonProperty(\"key\") final String key, @JsonProperty(\"uniquenessValue\") final String uniquenessValue,\n @JsonProperty(\"locale\") final String locale, @JsonProperty(\"authorName\") final String authorName,\n @JsonProperty(\"title\") final String title, @JsonProperty(\"text\") final String text,\n @JsonProperty(\"target\") final com.commercetools.api.models.common.Reference target,\n @JsonProperty(\"includedInStatistics\") final Boolean includedInStatistics,\n @JsonProperty(\"rating\") final Integer rating,\n @JsonProperty(\"state\") final com.commercetools.api.models.state.StateReference state,\n @JsonProperty(\"customer\") final com.commercetools.api.models.customer.CustomerReference customer,\n @JsonProperty(\"custom\") final com.commercetools.api.models.type.CustomFields custom) {\n this.id = id;\n this.version = version;\n this.createdAt = createdAt;\n this.lastModifiedAt = lastModifiedAt;\n this.lastModifiedBy = lastModifiedBy;\n this.createdBy = createdBy;\n this.key = key;\n this.uniquenessValue = uniquenessValue;\n this.locale = locale;\n this.authorName = authorName;\n this.title = title;\n this.text = text;\n this.target = target;\n this.includedInStatistics = includedInStatistics;\n this.rating = rating;\n this.state = state;\n this.customer = customer;\n this.custom = custom;\n }", "public InterpolationModel() {\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n }", "public QuestionnaireExample() {\n oredCriteria = new ArrayList<Criteria>();\n }", "public IacucProtocolOnlineReviewDeterminationTypeRecommendation() {\n \n }", "public Recommendation(User source, Movie movie, String message) {\n this.recommendationGiver = source;\n this.movie = movie;\n this.message = message;\n }", "public ReviewModel buildReviewModel(JSONObject jsonObject){\n try{\n ReviewModel reviewModel = new ReviewModel();\n reviewModel.setReviewId(jsonObject.getString(\"r_id\"));\n reviewModel.setReviewText(jsonObject.getString(\"r_text\"));\n reviewModel.setLikes(Integer.parseInt(jsonObject.getString(\"upvotes\")));\n reviewModel.setUserId(jsonObject.getString(\"u_id\"));\n reviewModel.setUserName(jsonObject.getString(\"u_name\"));\n reviewModel.setMovieId(jsonObject.getString(\"m_id\"));\n reviewModel.setMovieName(jsonObject.getString(\"m_name\"));\n reviewModel.setReplies(jsonObject.getString(\"r_reply\"));\n reviewModel.setTime(jsonObject.getString(\"r_time\"));\n reviewModel.setFollowing(jsonObject.getString(\"is_following\").equals(\"1\"));\n reviewModel.setLiked(jsonObject.getString(\"is_liked\").equals(\"1\"));\n reviewModel.setUserPrivacy(Integer.parseInt(jsonObject.getString(\"u_privacy\")));\n return reviewModel;\n }catch (Exception e){\n EmailHelper emailHelper = new EmailHelper(context, EmailHelper.TECH_SUPPORT, \"Error: ModelHelper\", e.getMessage() + \"\\n\" + StringHelper.convertStackTrace(e));\n emailHelper.sendEmail();\n }\n return new ReviewModel();\n }", "public HeatingModuleModel(){\n\t}", "public Answers(Vector<Question> myData) {\n\t\tsuper();\n\t\tthis.myData = myData;\n\t}", "public WekaLearner(Classifier classifier) {\n super(Type.MODEL, Type.TRIV);\n this.classifier = classifier;\n }", "public InterpolationModel(Collection<List<String>> sentences) {\n\tthis();\n\tUnigram = new UnigramModel();\n\tBigram = new BigramModel();\n\tTrigram = new TrigramModel();\n\ttrain(sentences);\n }", "public Builder clearRecommenderSubtype() {\n recommenderSubtype_ = getDefaultInstance().getRecommenderSubtype();\n bitField0_ = (bitField0_ & ~0x00000004);\n onChanged();\n return this;\n }", "public ModelRecyclerAdapter(Context context, ArrayList<Model> myDataset) {\n mDataset = myDataset;\n mContext = context.getApplicationContext();\n mInflater = LayoutInflater.from(context);\n }", "public QuestionPoolDataModel(Tree tree, DataModel model)\n {\n this.model = model;\n this.tree=tree;\n //buildTree();\n }", "@Generated(value = \"io.vrap.rmf.codegen.rendering.CoreCodeGenerator\", comments = \"https://github.com/commercetools/rmf-codegen\")\n@JsonDeserialize(as = ProjectCategoryRecommendationMetaImpl.class)\npublic interface ProjectCategoryRecommendationMeta {\n\n /**\n * <p>The product name that was used to generate recommendations.</p>\n * @return productName\n */\n\n @JsonProperty(\"productName\")\n public String getProductName();\n\n /**\n * <p>The product image that was used to generate recommendations.</p>\n * @return productImageUrl\n */\n\n @JsonProperty(\"productImageUrl\")\n public String getProductImageUrl();\n\n /**\n * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p>\n * @return generalCategoryNames\n */\n @NotNull\n @JsonProperty(\"generalCategoryNames\")\n public List<String> getGeneralCategoryNames();\n\n /**\n * <p>The product name that was used to generate recommendations.</p>\n * @param productName value to be set\n */\n\n public void setProductName(final String productName);\n\n /**\n * <p>The product image that was used to generate recommendations.</p>\n * @param productImageUrl value to be set\n */\n\n public void setProductImageUrl(final String productImageUrl);\n\n /**\n * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p>\n * @param generalCategoryNames values to be set\n */\n\n @JsonIgnore\n public void setGeneralCategoryNames(final String... generalCategoryNames);\n\n /**\n * <p>Top 5 general categories that were used internally to generate the project-specific categories. These category names are not related to the categories defined in the project, but they provide additional information to understand the project-specific categories in the results section.</p>\n * @param generalCategoryNames values to be set\n */\n\n public void setGeneralCategoryNames(final List<String> generalCategoryNames);\n\n /**\n * factory method\n * @return instance of ProjectCategoryRecommendationMeta\n */\n public static ProjectCategoryRecommendationMeta of() {\n return new ProjectCategoryRecommendationMetaImpl();\n }\n\n /**\n * factory method to create a shallow copy ProjectCategoryRecommendationMeta\n * @param template instance to be copied\n * @return copy instance\n */\n public static ProjectCategoryRecommendationMeta of(final ProjectCategoryRecommendationMeta template) {\n ProjectCategoryRecommendationMetaImpl instance = new ProjectCategoryRecommendationMetaImpl();\n instance.setProductName(template.getProductName());\n instance.setProductImageUrl(template.getProductImageUrl());\n instance.setGeneralCategoryNames(template.getGeneralCategoryNames());\n return instance;\n }\n\n /**\n * factory method to create a deep copy of ProjectCategoryRecommendationMeta\n * @param template instance to be copied\n * @return copy instance\n */\n @Nullable\n public static ProjectCategoryRecommendationMeta deepCopy(\n @Nullable final ProjectCategoryRecommendationMeta template) {\n if (template == null) {\n return null;\n }\n ProjectCategoryRecommendationMetaImpl instance = new ProjectCategoryRecommendationMetaImpl();\n instance.setProductName(template.getProductName());\n instance.setProductImageUrl(template.getProductImageUrl());\n instance.setGeneralCategoryNames(\n Optional.ofNullable(template.getGeneralCategoryNames()).map(ArrayList::new).orElse(null));\n return instance;\n }\n\n /**\n * builder factory method for ProjectCategoryRecommendationMeta\n * @return builder\n */\n public static ProjectCategoryRecommendationMetaBuilder builder() {\n return ProjectCategoryRecommendationMetaBuilder.of();\n }\n\n /**\n * create builder for ProjectCategoryRecommendationMeta instance\n * @param template instance with prefilled values for the builder\n * @return builder\n */\n public static ProjectCategoryRecommendationMetaBuilder builder(final ProjectCategoryRecommendationMeta template) {\n return ProjectCategoryRecommendationMetaBuilder.of(template);\n }\n\n /**\n * accessor map function\n * @param <T> mapped type\n * @param helper function to map the object\n * @return mapped value\n */\n default <T> T withProjectCategoryRecommendationMeta(Function<ProjectCategoryRecommendationMeta, T> helper) {\n return helper.apply(this);\n }\n\n /**\n * gives a TypeReference for usage with Jackson DataBind\n * @return TypeReference\n */\n public static com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendationMeta> typeReference() {\n return new com.fasterxml.jackson.core.type.TypeReference<ProjectCategoryRecommendationMeta>() {\n @Override\n public String toString() {\n return \"TypeReference<ProjectCategoryRecommendationMeta>\";\n }\n };\n }\n}", "public Classifier selectBestOneR(Instances data) throws Exception{\r\n\t\tSystem.out.println(\"Build OneR\");\r\n\r\n\t\tCVParameterSelection ps = new CVParameterSelection();\r\n\t\tps.setClassifier(new OneR());\r\n\t\tps.setNumFolds(2);\r\n\t\tps.addCVParameter(\"B 1 5 10\");\r\n\r\n\t\t// build and output best options\r\n\t\tps.buildClassifier(data);\r\n\r\n\r\n\t\treturn ps;\r\n\t}", "public static void main(String[] args) throws Exception {\n DataModel model = new FileDataModel(new File(\"data/movies.csv\"));\n\n //define user similarity as Pearson correlation coefficient\n UserSimilarity similarity = new PearsonCorrelationSimilarity(model);\n\n //neighborhood = 50 nearest neighbors\n UserNeighborhood neighborhood = new NearestNUserNeighborhood(50, similarity, model);\n\n // recommender instance - User-based CF\n GenericUserBasedRecommender recommender = new GenericUserBasedRecommender(model, neighborhood, similarity);\n\n //top 10 recommendation for user 50\n List<RecommendedItem> recommendations = recommender.recommend(50, 10);\n\n //print recommendation\n for (RecommendedItem recommendation : recommendations) {\n\n System.out.println(recommendation);\n }\n\n }", "public Series (String t, String s){\n title = t;\n studio = s;\n rating = \"PG\";\n}", "private void initData() throws Exception {\n\t\tString title = personRatingWindow.getTitle();\n\t\ttitle += \" - \" + _studentW.getStudent().getLastFirstName();\n\t\tpersonRatingWindow.setTitle(title);\n\n\t\tList<Skill> skills = new ArrayList<>(); \n\t\t_model.initData(_rko);\n\t\t\n\t\tList<RateCardItem> data = getUserWorkspace().getDataServiceProvider().getRateCard(_studentW.getStudent().getId());\n\t\tdata.stream().forEach((item) -> {\n\t\t\tExercise exercise = _model.getId2ex().get(item.getExerciseId());\n\t\t\tif ( exercise != null ) {\n\t\t\t\taddExcerise(exercise, item);\n\t\t\t\titem.getSkills().stream().forEach((rcItem) -> {\n\t\t\t\t\tSkill skill = _model.getId2skill().get(rcItem.getSkillId() );\n\t\t\t\t\tif ( !_existingSkills.contains(skill) ) {\n\t\t\t\t\t\t_existingSkills.add(skill);\n\t\t\t\t\t\tskills.add(skill);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tCollections.sort(skills, new SkillComparator(true, SkillComparator.TYPE_ORDER));\n\t\tskills.stream().forEach((skill) -> _model.add(skill) );\n\n\t\tif ( listBoxSkills!=null ) {\n\t\t\t_skillModel.setMultiple(true);\n\t\t\t_skillModel.clear();\n\t\t\t_skillModel.addAll(_model.getSkills());\n\t\t\tlistBoxSkills.setModel(_skillModel);\n\t\t}\n\t\t\n\t\tgridSkillsExercises.setModel(_model);\n\t\tlistBoxExercises.setModel(_exerciseListModel);\n\t\t\n\t\t//sampleData();\n\t}", "public PollData() {\n\n\n super(TYPE_NAME);\n }", "public Reviews (ArrayList<Review> list)\n\t{\n\t\tthis.list = list;\n\t}", "public CompareRecyclerListAdapter(Context context, int layoutResourceId,\n ArrayList<Compare> data) {\n super();\n this.layoutResourceId = layoutResourceId;\n this.context = context;\n this.data = data;\n this.picassoSingleton = PicassoSingleton.getInstance(context);\n }", "public Series( String t, String s, String r){\n title = t;\n studio = s;\n rating = r;\n}", "public Wearable(int rank, String name, double price, String bodyLoc, String category, String companyName, \n String companyURL, String companyMappingLocation, String companyCity, String companyUSState, String companyCountry) {\n this.rank = rank;\n this.name = name;\n this.price = price;\n this.bodyLoc = bodyLoc;\n this.category = category;\n this.companyName = companyName;\n this.companyURL = companyURL;\n this.companyMappingLocation = companyMappingLocation;\n this.companyCity = companyCity;\n this.companyUSState = companyUSState;\n this.companyCountry = companyCountry;\n }", "public RatingPeriodResults() {}", "public DailyRecommendationsAdapter(Context context, ArrayList<TimelineModel> list, Display display)\n {\n this.context = context;\n this.list = list;\n this.display = display;\n }", "public DataAdapter() {\n }", "DataModel createDataModel();", "public RateAdapter(ArrayList<Rate> myDataset, Context context) {\n mRates = myDataset;\n mContext = context;\n }", "public CompositeData()\r\n {\r\n }", "public RatingsModel buildRatingsModel(JSONObject jsonObject){\n try{\n RatingsModel ratingsModel = new RatingsModel();\n ratingsModel.setRatingId(jsonObject.getString(\"r_id\"));\n ratingsModel.setUserName(jsonObject.getString(\"u_name\"));\n ratingsModel.setUserId(jsonObject.getString(\"u_id\"));\n ratingsModel.setUserRating(Float.parseFloat(jsonObject.getString(\"u_rating\")));\n ratingsModel.setFollowing(jsonObject.getString(\"is_following\").equals(\"1\"));\n return ratingsModel;\n }catch (Exception e){\n EmailHelper emailHelper = new EmailHelper(context, EmailHelper.TECH_SUPPORT, \"Error: ModelHelper\", e.getMessage() + \"\\n\" + StringHelper.convertStackTrace(e));\n emailHelper.sendEmail();\n }\n return new RatingsModel();\n }", "public Rating(int movieID, String email, float rating){\n this.movieID = movieID;\n this.rating = rating;\n this.email = email;\n }", "public interface RecommendationSource {\n\n /**\n * Returns the title of the module that is sourced (used in rendering)\n */\n String getTitle();\n\n /**\n * Returns a unique module id associated with the module\n */\n String getModuleId();\n\n /**\n * Returns the template type used for rendering recommendations from this module\n */\n RecommendationRenderType getRenderType();\n\n /**\n * Whether or not this module is eligible for resolution given the context\n *\n * @param userUrn User requesting recommendations\n * @param requestContext Context of where the recommendations are being requested\n * @return whether this source is eligible\n */\n boolean isEligible(@Nonnull Urn userUrn, @Nonnull RecommendationRequestContext requestContext);\n\n /**\n * Get recommended items (candidates / content) provided the context\n *\n * @param userUrn User requesting recommendations\n * @param requestContext Context of where the recommendations are being requested\n * @return list of recommendation candidates\n */\n @WithSpan\n List<RecommendationContent> getRecommendations(@Nonnull Urn userUrn, @Nonnull RecommendationRequestContext requestContext);\n\n /**\n * Get the full recommendations module itself provided the request context.\n *\n * @param userUrn User requesting recommendations\n * @param requestContext Context of where the recommendations are being requested\n * @return list of recommendation candidates\n */\n default Optional<RecommendationModule> getRecommendationModule(\n @Nonnull Urn userUrn,\n @Nonnull RecommendationRequestContext requestContext) {\n if (!isEligible(userUrn, requestContext)) {\n return Optional.empty();\n }\n\n List<RecommendationContent> recommendations = getRecommendations(userUrn, requestContext);\n if (recommendations.isEmpty()) {\n return Optional.empty();\n }\n\n return Optional.of(new RecommendationModule().setTitle(getTitle())\n .setModuleId(getModuleId())\n .setRenderType(getRenderType())\n .setContent(new RecommendationContentArray(recommendations)));\n }\n}", "public Book(double weightInKg, double manufacturingPriceDollars,\r\n double suggestedRetailPriceDollars, String uniqueID, \r\n Author author, Date datePublished, String title, BookType bookType) {\r\n super(weightInKg, manufacturingPriceDollars, suggestedRetailPriceDollars, uniqueID);\r\n setAuthor(author);\r\n setDatePublished(datePublished);\r\n setTitle(title);\r\n this.genre = bookType;\r\n }" ]
[ "0.73647815", "0.72415006", "0.687413", "0.64726406", "0.6341262", "0.60112154", "0.5673699", "0.56089205", "0.55726266", "0.5437203", "0.5421927", "0.5407787", "0.5398718", "0.5370841", "0.53501797", "0.5349512", "0.5348809", "0.5333561", "0.5267912", "0.5238461", "0.52251923", "0.5198962", "0.51968914", "0.5192804", "0.51873773", "0.5187071", "0.5163494", "0.5151073", "0.5137289", "0.5117314", "0.5112696", "0.50895506", "0.5078987", "0.50712186", "0.5043196", "0.50250787", "0.5012433", "0.4996563", "0.49908477", "0.49530652", "0.4945812", "0.49328804", "0.49312997", "0.4928102", "0.49227503", "0.49221548", "0.49215984", "0.49092805", "0.48985583", "0.4886106", "0.48827106", "0.48719248", "0.4863853", "0.48600304", "0.48536038", "0.48500928", "0.48354304", "0.48303244", "0.48300758", "0.48294535", "0.4825143", "0.4820534", "0.4808365", "0.48066348", "0.48052052", "0.48041874", "0.48034614", "0.47972083", "0.47824574", "0.47780997", "0.47568825", "0.47353274", "0.47293895", "0.47293004", "0.4723163", "0.47221926", "0.47207624", "0.47116062", "0.46881872", "0.4684304", "0.46700272", "0.46671075", "0.46656466", "0.46596327", "0.46592483", "0.46556357", "0.46519315", "0.4651667", "0.46515608", "0.46404177", "0.4637858", "0.46369585", "0.46303165", "0.46301666", "0.4630078", "0.46250343", "0.4624332", "0.4606563", "0.46048942", "0.46027714" ]
0.6014307
5
/======================================== Model Builder ======================================== Build a model with the given data and algorithm.
public void buildModel(SparseMatrix rm) { rateMatrix = rm; /* ===================== * COMMENT FOR AUTHORS * ===================== * Using the training data in "rm", you are supposed to write codes to learn your model here. * If your method is memory-based one, you may leave the model as rateMatrix itself, simply by "rateMatrix = rm;". * If your method is model-based algorithm, you may not need a reference to rateMatrix. * (In this case, you may remove the variable "rateMatrix", just as matrix-factorization-based methods do in this toolkit.) * Note that in any case train data in "rateMatrix" are read-only. You should not alter any value in it to guarantee proper operation henceforth. */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void build(ClassifierData<U> inputData);", "DataGenModel()\n {\n }", "DataModel createDataModel();", "public void buildModel() {\n }", "Build_Model() {\n\n }", "public hu.blackbelt.epsilon.runtime.model.test1.data.DataModel build() {\n final hu.blackbelt.epsilon.runtime.model.test1.data.DataModel _newInstance = hu.blackbelt.epsilon.runtime.model.test1.data.DataFactory.eINSTANCE.createDataModel();\n if (m_featureNameSet) {\n _newInstance.setName(m_name);\n }\n if (m_featureEntitySet) {\n _newInstance.getEntity().addAll(m_entity);\n } else {\n if (!m_featureEntityBuilder.isEmpty()) {\n for (hu.blackbelt.epsilon.runtime.model.test1.data.util.builder.IDataBuilder<? extends hu.blackbelt.epsilon.runtime.model.test1.data.Entity> builder : m_featureEntityBuilder) {\n _newInstance.getEntity().add(builder.build());\n }\n }\n }\n return _newInstance;\n }", "public DataModelDescriptorBuilder(Class<?> dataModelClass) {\n this.dataModelClass = dataModelClass;\n }", "public static DataModelBuilder create() {\n return new DataModelBuilder();\n }", "private DataModelBuilder() {\n }", "public QuestionPoolDataModel(Tree tree, DataModel model)\n {\n this.model = model;\n this.tree=tree;\n //buildTree();\n }", "public ComputerDataModel() {\n\n }", "@Override\r\n\tpublic void buildClassifier(Instances data) throws Exception {\n\r\n\t}", "public DataModel()\r\n {\r\n System.out.println(\"New DataModel created\");\r\n \r\n languageList = new LanguageList();\r\n }", "private Model(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Model createModel();", "Model createModel();", "Model createModel();", "Model createModel();", "Model createModel();", "Model createModel();", "Model createModel();", "@FunctionalInterface\n public interface Builder {\n BuildingModel build(int x, int y, int angle, int floor);\n }", "private void setupModel() {\n\n //Chooses which model gets prepared\n switch (id) {\n case 2:\n singlePackage = new Node();\n activeNode = singlePackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_solo)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 3:\n multiPackage = new Node();\n activeNode = multiPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_multi_new)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n case 4:\n wagonPackage = new Node();\n activeNode = wagonPackage;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.package_car_new)\n .build().thenAccept(a -> activeRenderable = a)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n\n default:\n mailbox = new Node();\n activeNode = mailbox;\n\n //Builder for model\n ModelRenderable.builder()\n .setSource(ArActivity.this, R.raw.mailbox)\n .build().thenAccept(renderable -> activeRenderable = renderable)\n .exceptionally(\n throwable -> {\n Toast.makeText(this, \"Unable to show \", Toast.LENGTH_SHORT).show();\n return null;\n }\n );\n break;\n }\n }", "Algorithm createAlgorithm();", "public Model(DataHandler data){\n //assign the data parameter to the instance\n //level variable data. The scope of the parameter\n //is within the method and that is where the JVM \n //looks first for a variable or parameter so we \n //need to specify that the instance level variable \n //is to be used by using the keyword 'this' followed \n //by the '.' operator.\n this.data = data;\n }", "DataModel getDataModel ();", "@Test\n public void addModelData() {\n new FactoryInitializer()\n .initialize(\n ((tr, ev, is, np, md) -> new ResNetConv2DFactory(tr,ev,is,np,md).addModelData(new ArrayList<>()))\n );\n }", "public void buildModel(){\r\n\t\t\r\n\t\tsuper.buildModel();\r\n\t\t\r\n\t}", "public void createModelFromAlloy(){\n\t\t// Get signatures list\n\t\tSafeList<Sig> sigs = module.getAllSigs();\n\t\t// Check if the list is empty\n\t\tif(sigs.isEmpty()) assertMessage(\"Error in create Model FromAlloy: no sig found!\");\n\t\t// Generate java class source file for one top-level sig at a time\n\t\tfor(int i = 0; i<sigs.size(); i++) {\n\t\t\tSig aSig = sigs.get(i);\n\t\t\tif (!aSig.isTopLevel()) continue;\n\t\t\tif(!aSig.builtin){ // User-defined sig\n\t\t\t\tif(aSig.isSubsig != null){\n\t\t\t\t\tPrimSig pSig = (PrimSig) aSig;\n\t\t\t\t\trecursiveGenerate(null, pSig);\t\n\t\t\t\t} else assertMessage(\"TODO: Dealt with subset sig\");\n\t\t\t}\n\t\t\telse assertMessage(\"TODO: Dealt with built-in sig\");\n\t\t}\n\t}", "public EncogModel(VersatileMLDataSet theDataset) {\n\t\tthis.dataset = theDataset;\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_FEEDFORWARD,\n\t\t\t\tnew FeedforwardConfig());\n\t\tthis.methodConfigurations\n\t\t\t\t.put(MLMethodFactory.TYPE_SVM, new SVMConfig());\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_RBFNETWORK,\n\t\t\t\tnew RBFNetworkConfig());\n\t\tthis.methodConfigurations.put(MLMethodFactory.TYPE_NEAT,\n\t\t\t\tnew NEATConfig());\n\t\tthis.methodConfigurations\n\t\t\t\t.put(MLMethodFactory.TYPE_PNN, new PNNConfig());\n\t}", "public abstract void fit(BinaryData trainingData);", "public Logic(Model m){\r\n model = m;\r\n }", "public interface IDetectionAlgorithm {\n\n /**\n * Creates a database where an algorithm would store its model\n *\n * @param modelName\n * Name of the database\n * @param dataAccessObject\n * An object of IDataAccessObject\n * @param trainingSettings\n * Training Settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n */\n public void initializeModelAndSettings(String modelName, IDataAccessObject dataAccessObject, String[] trainingSettings) throws TotalADSDBMSException, TotalADSGeneralException;\n\n /**\n * Returns the training settings/options of an algorithm as setting name at\n * index i and value at index i+1.\n *\n * @return Array of Strings as options/settings\n */\n public String[] getTrainingSettings();\n\n /**\n * Returns the testing options/settings of an algorithm as option name at\n * index i and value ate index i+1. It takes database name and connection\n * information, in case if the model (database) is already created and\n * previously modified settings exist in the database\n *\n * @param database\n * Database name\n * @param dataAccessObject\n * IDataAccessObject object\n * @return An array of String as options/settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public String[] getTestSettings(String database, IDataAccessObject dataAccessObject) throws TotalADSDBMSException;\n\n /**\n * Validates the testing options and saves them into the database. On error\n * throws exception\n *\n * @param options\n * Settings array\n * @param database\n * Model(database name)\n * @param dataAccessObject\n * An object to access database\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public void saveTestSettings(String[] options, String database, IDataAccessObject dataAccessObject) throws TotalADSGeneralException, TotalADSDBMSException;\n\n /**\n * Returns settings selected for a model by a user during training and\n * testing. These would be displayed in the properties view.\n *\n * @param database\n * Model(database) name\n * @param dataAccessObject\n * An object to access database\n * @return An array of selected settings\n * @throws TotalADSDBMSException\n * An exception related to the DBMS\n */\n public String[] getSettingsToDisplay(String database, IDataAccessObject dataAccessObject) throws TotalADSDBMSException;\n\n /**\n * An algorithm will take a trace through this function. Some algorithms can\n * train on the traces as they come and some need to wait till the last\n * trace. Caller will make isLastTrace true when the lastTrace will be sent\n * to this function. This function is called for every trace separately\n *\n * @param trace\n * Trace iterator to a trace\n * @param isLastTrace\n * True if the trace is the last trace, else false\n * @param database\n * Database/mode name\n * @param connection\n * Connection object\n * @param outStream\n * Use this object to display the events during processing\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to the trace reader\n */\n public void train(ITraceIterator trace, Boolean isLastTrace, String database, IDataAccessObject connection, IAlgorithmOutStream outStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * This function is called after the train function has finished processing\n * and has built a model. This function is called for every single trace in\n * the validation set separately\n *\n * @param trace\n * Trace iterator to one trace\n * @param database\n * Database name\n * @param dataAccessObject\n * Connection name\n * @param isLastTrace\n * True if the trace is the last trace, else false\n * @param outStream\n * Use this object to display the events during processing\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to the trace reader\n */\n public void validate(ITraceIterator trace, String database, IDataAccessObject dataAccessObject, Boolean isLastTrace, IAlgorithmOutStream outStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * This function evaluates an existing model in the database on the traces\n * in the test set. It is called for every single trace separately.\n *\n * @param trace\n * Trace iterator to a single trace\n * @param database\n * Database name\n * @param dataAccessObject\n * Data accessor\n * @param outputStream\n * Use this object to display the events during processing\n * @return An object of type Result containing the evaluation information of\n * a trace\n * @throws TotalADSGeneralException\n * An exception related to validation of parameters\n * @throws TotalADSDBMSException\n * An exception related to DBMS\n * @throws TotalADSReaderException\n * An exception related to reader\n */\n public Results test(ITraceIterator trace, String database, IDataAccessObject dataAccessObject, IAlgorithmOutStream outputStream) throws TotalADSGeneralException, TotalADSDBMSException, TotalADSReaderException;\n\n /**\n * Returns the total anomalies during testing\n *\n * @return total anomalies\n **/\n public Double getTotalAnomalyPercentage();\n\n /**\n * Returns the graphical result in the form of a chart if any for a trace.\n * Currently unimplemented.\n *\n * @param traceIterator\n * An iterator a trace\n * @return A chart object\n **/\n public org.swtchart.Chart graphicalResults(ITraceIterator traceIterator);\n\n /**\n * Returns a self created instance of the algorithm\n *\n * @return An instance of the algorithm\n **/\n public IDetectionAlgorithm createInstance();\n\n // /////////////////////////////////////////////////////////////////////////////////\n // An algorithm registers itself with the AlgorithmFactory\n // Each derived class must implement the following static method\n // public static void registerAlgorithm() throws TotalADSGeneralException;\n // /////////////////////////////////////////////////////////////////////////////////\n /**\n * Gets the name of the algorithm\n *\n * @return The name\n **/\n public String getName();\n\n /**\n * Gets the description of an algorithm\n *\n * @return The description\n */\n public String getDescription();\n\n /**\n * Returns the acronym of the algorithm; should only be three to four\n * characters long. This acronym is very important as it is used in the name\n * of a model and facilitates in finding out which algorithm represents the\n * model\n *\n * @return Acronym\n */\n public String getAcronym();\n\n /**\n * Returns true if online learning is supported. If false is returned it\n * would mean the algorithm can only train in batch mode and live training\n * is not supported\n *\n * @return True if online learning is supported, else false\n */\n public boolean isOnlineLearningSupported();\n}", "public interface RdbModel {\n\n public Object setThisModelFields(CrawlerData data);\n public InsertSqlModel insertSqlModelBuilder(String tableName);\n}", "private void generateModel() {\n // Initialize a new model object\n mCm = new CategoryModel[nodes.length];\n\n for (int i = 0; i < nodes.length; i++) {\n mCm[i] = new CategoryModel(nodes[i].id, nodes[i].title);\n }\n }", "GoalModel createGoalModel();", "EisModel createEisModel();", "public PredictRequest build() {\n\n\t\t\tcheckArgument(!Strings.isNullOrEmpty(url), \"url is required\");\n\t\t\tcheckArgument(!Strings.isNullOrEmpty(service), \"service name is required\");\n\t\t\tcheckArgument(data != null, \"data is required\");\n\n\t\t\tPredictRequest request = new PredictRequest();\n\t\t\trequest.baseURL = url;\n\t\t\tJsonObject requestData = new JsonObject();\n\t\t\trequestData.addProperty(\"service\", service);\n\n\t\t\tJsonObject paramsObj = new JsonObject();\n\t\t\tif (input != null)\n\t\t\t\tparamsObj.add(\"input\", input);\n\t\t\tif (output != null)\n\t\t\t\tparamsObj.add(\"output\", output);\n\t\t\tif (mllibParams != null)\n\t\t\t\tparamsObj.add(\"mllib\", mllibParams);\n\n\t\t\tif (!paramsObj.isJsonNull()) {\n\t\t\t\trequestData.add(\"parameters\", paramsObj);\n\t\t\t}\n\n\t\t\trequestData.add(\"data\", data);\n\n\t\t\trequest.data = requestData;\n\t\t\treturn request;\n\t\t}", "private void buildInternalRepresentations() {\n new DAGBuilder(data).buildMethods(this);//.dump();\n }", "HdbdtiModel createHdbdtiModel();", "public OTFModelGeneration(Program program) {\n\t\tsuper();\n\t\tthis.program = program;\n\t}", "public TargetGeneratorModel()\n {\n }", "public DynamicModelPart buildUsingSeeds() {\n return this.rotateModelPart(this.rotation).addCuboidsUsingSeeds();\n }", "public WeightingModel(){}", "DomainModel createDomainModel();", "private static String newModel() {\n\n End end = new End(0,0);\n Start start = new Start(0,0);\n End end1 = new End(0,0);\n Start start1 = new Start(0,0);\n End end2 = new End(0,0);\n Start start2 = new Start(0,0);\n Start start3 = new Start(0,0);\n End end3 = new End(0,0);\n Start start4 = new Start(0,0);\n End end4 = new End(0,0);\n\n Start start5 = new Start(2,2);\n End end5 = new End(2,7);\n Start start6 = new Start(2,8);\n End end6 = new End(6,8);\n Start start7 = new Start(4,1);\n End end7 = new End(4,4);\n Start start8 = new Start(7,3);\n End end8 = new End(7,5);\n Start start9 = new Start(9,6);\n End end9 = new End(9,8);\n\n\n\n AircraftCarrier aircraftCarrier = new AircraftCarrier(\"AircraftCarrier\",5,start,end);\n Battleship battleship = new Battleship(\"Battleship\",4,start1,end1);\n Cruiser cruiser = new Cruiser(\"Cruiser\",3,start2,end2);\n Destroyer destroyer = new Destroyer(\"Destroyer\",2,start3,end3);\n Submarine submarine = new Submarine(\"Submarine\",2,start4,end4);\n\n ComputerAircraftCarrier computer_aircraftCarrier = new ComputerAircraftCarrier(\"Computer_AircraftCarrier\",5,start5,end5);\n ComputerBattleship computer_battleship = new ComputerBattleship(\"Computer_Battleship\",4,start6,end6);\n ComputerCruiser computer_cruiser = new ComputerCruiser(\"Computer_Cruiser\",3,start7,end7);\n ComputerDestroyer computer_destroyer = new ComputerDestroyer(\"Computer_Destroyer\",2,start8,end8);\n ComputerSubmarine computer_submarine = new ComputerSubmarine(\"Computer_Submarine\",2,start9,end9);\n ArrayList<Hits>playerHits = new ArrayList<Hits>();\n ArrayList<Misses>playerMisses = new ArrayList<Misses>();\n ArrayList<Misses>computerMisses = new ArrayList<Misses>();\n ArrayList<Hits>computerHits = new ArrayList<Hits>();\n\n BattleshipModel battleshipModel = new BattleshipModel(aircraftCarrier,battleship,cruiser,destroyer,submarine,\n computer_aircraftCarrier,computer_battleship,computer_cruiser,computer_destroyer,computer_submarine,\n playerHits,playerMisses,computerHits,computerMisses);\n\n Gson gson = new Gson();\n String battleshipModelWithJson = gson.toJson(battleshipModel);\n return battleshipModelWithJson;\n }", "V build(K input);", "public static DataModelDescriptorBuilder of(Class<?> dataModelClass) {\n return new DataModelDescriptorBuilder(dataModelClass);\n }", "@Override\n\tpublic void buildClassifier(Instances data) throws Exception {\n decision_tree = new MyID3();\n\t\tdecision_tree.buildClassifier(data);\n\n//\t\tSystem.out.println(decision_tree.toString());\n\n train_data = data;\n\n set_of_rule = convertTreeIntoRules(decision_tree);\n\n\n // DONT DELETE THISSSS\n set_of_rule.setTrainData(data);\n\n List<Rule> listrule = set_of_rule.getList_rule();\n System.out.println(\"\\n\\n\\nBEFORE PRUNEDDD\");\n for (int i = 0; i < listrule.size(); i++ ){\n System.out.println(\"Rule \"+i+\" :\");\n Rule rule = listrule.get(i);\n List<Edge> edges = rule.getPreconditions();\n for (int j=0; j< edges.size(); j++) {\n System.out.println(\"\\t-\"+edges.get(j).getAttribute_name() + \" = \" + edges.get(j).getAttribute_value());\n }\n System.out.println(\"\\tClass = \"+rule.getClass_value());\n }\n\n// selectBestSetofRule();\n\n\t}", "public boolean buildModel() {\n \treturn buildModel(false, false);\n }", "IFMLModel createIFMLModel();", "public String execute(String input) {\n Data data = Serializer.parse(input, Data.class);\n\n // Step #2: Check the discriminator\n final String discriminator = data.getDiscriminator();\n if (discriminator.equals(Discriminators.Uri.ERROR)) {\n // Return the input unchanged.\n return input;\n }\n\n // Create a series of pipes to process the training files\n ArrayList<Pipe> pipeList = new ArrayList<>();\n pipeList.add(new Input2CharSequence(\"UTF-8\"));\n // Pipes: lowercase, tokenize, remove stopwords, map to features\n pipeList.add( new CharSequenceLowercase() );\n pipeList.add( new CharSequence2TokenSequence(Pattern.compile(\"\\\\p{L}[\\\\p{L}\\\\p{P}]+\\\\p{L}\")) );\n pipeList.add( new TokenSequenceRemoveStopwords());\n pipeList.add( new TokenSequence2FeatureSequence());\n pipe = new SerialPipes(pipeList);\n\n // put the directory of files used for training through the pipes\n String directory = data.getParameter(\"directory\").toString();\n InstanceList instances = readDirectory(new File(directory));\n\n // create a topic to be trained\n int numberOfTopics = (Integer) data.getParameter(\"numTopics\");\n ParallelTopicModel topicModel = new ParallelTopicModel(numberOfTopics);\n topicModel.addInstances(instances);\n\n // train the model\n try {\n topicModel.estimate();\n } catch (IOException e){\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to train the model\").asJson();\n }\n\n // write topic keys file\n String path = data.getParameter(\"path\").toString();\n String keysName = data.getParameter(\"keysName\").toString();\n int wordsPerTopic = (Integer) data.getParameter(\"wordsPerTopic\");\n try {\n topicModel.printTopWords(new File(path + \"/\" + keysName), wordsPerTopic, false);\n } catch (IOException e) {\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to write the topic keys to \" + path + \"/\" + keysName).asJson();\n }\n\n // write the .inferencer file\n String inferencerName = data.getParameter(\"inferencerName\").toString();\n try {\n ObjectOutputStream oos =\n new ObjectOutputStream (new FileOutputStream (path + \"/\" + inferencerName));\n oos.writeObject (topicModel.getInferencer());\n oos.close();\n } catch (Exception e) {\n e.printStackTrace();\n return new Data<>(Discriminators.Uri.ERROR,\n \"Unable to write the inferencer to \" + path + \"/\" + inferencerName).asJson();\n }\n\n // Success\n return new Data<>(Discriminators.Uri.TEXT, \"Success\").asJson();\n }", "public void model() \n\t{\n\t\t\n\t\ttry \n\t\t{\n\t\t GRBEnv env = new GRBEnv();\n\t\t GRBModel model = new GRBModel(env, \"resources/students.lp\");\n\n\t\t model.optimize();\n\n\t\t int optimstatus = model.get(GRB.IntAttr.Status);\n\n\t\t if (optimstatus == GRB.Status.INF_OR_UNBD) {\n\t\t model.getEnv().set(GRB.IntParam.Presolve, 0);\n\t\t model.optimize();\n\t\t optimstatus = model.get(GRB.IntAttr.Status);\n\t\t }\n\n\t\t if (optimstatus == GRB.Status.OPTIMAL) {\n\t\t double objval = model.get(GRB.DoubleAttr.ObjVal);\n\t\t System.out.println(\"Optimal objective: \" + objval);\n\t\t } else if (optimstatus == GRB.Status.INFEASIBLE) {\n\t\t System.out.println(\"Model is infeasible\");\n\n\t\t // Compute and write out IIS\n\t\t model.computeIIS();\n\t\t model.write(\"model.ilp\");\n\t\t } else if (optimstatus == GRB.Status.UNBOUNDED) {\n\t\t System.out.println(\"Model is unbounded\");\n\t\t } else {\n\t\t System.out.println(\"Optimization was stopped with status = \"\n\t\t + optimstatus);\n\t\t }\n\n\t\t // Dispose of model and environment\n\t\t model.write(\"resources/model.sol\");\n\t\t model.dispose();\n\t\t env.dispose();\n\n\t\t } catch (GRBException e) {\n\t\t System.out.println(\"Error code: \" + e.getErrorCode() + \". \" +\n\t\t e.getMessage());\n\t\t }\n\t\t\n\t}", "public void buildModel() {\n double loss_pre = Double.MAX_VALUE;\n for (int iter = 0; iter < maxIter; iter ++) {\n Long start = System.currentTimeMillis();\n if (showProgress)\n System.out.println(\"Iteration \"+(iter+1)+\" started\");\n // Update user latent vectors\n IntStream.range(0,userCount).parallel().peek(i->update_user(i)).forEach(j->{});\n /*\n for (int u = 0; u < userCount; u ++) {\n update_user(u);\n }\n */\n if (showProgress) {\n System.out.println(\"Users updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n IntStream.range(0,itemCount).parallel().peek(i->update_item(i)).forEach(j->{});\n // Update item latent vectors\n /*\n for (int i = 0; i < itemCount; i ++) {\n update_item(i);\n }\n */\n if (showProgress) {\n System.out.println(\"Items updated for \" + (System.currentTimeMillis() - start) + \"millis\");\n start = System.currentTimeMillis();\n }\n\n // Show loss\n if (showLoss)\n loss_pre = showLoss(iter, start, loss_pre);\n\n\n } // end for iter\n\n }", "protected abstract D createData();", "public void buildClassifier(Instances data) throws Exception {\n\n // can classifier handle the data?\n getCapabilities().testWithFail(data);\n\n // remove instances with missing class\n data = new Instances(data);\n data.deleteWithMissingClass();\n \n /* initialize the classifier */\n\n m_Train = new Instances(data, 0);\n m_Exemplars = null;\n m_ExemplarsByClass = new Exemplar[m_Train.numClasses()];\n for(int i = 0; i < m_Train.numClasses(); i++){\n m_ExemplarsByClass[i] = null;\n }\n m_MaxArray = new double[m_Train.numAttributes()];\n m_MinArray = new double[m_Train.numAttributes()];\n for(int i = 0; i < m_Train.numAttributes(); i++){\n m_MinArray[i] = Double.POSITIVE_INFINITY;\n m_MaxArray[i] = Double.NEGATIVE_INFINITY;\n }\n\n m_MI_MinArray = new double [data.numAttributes()];\n m_MI_MaxArray = new double [data.numAttributes()];\n m_MI_NumAttrClassInter = new int[data.numAttributes()][][];\n m_MI_NumAttrInter = new int[data.numAttributes()][];\n m_MI_NumAttrClassValue = new int[data.numAttributes()][][];\n m_MI_NumAttrValue = new int[data.numAttributes()][];\n m_MI_NumClass = new int[data.numClasses()];\n m_MI = new double[data.numAttributes()];\n m_MI_NumInst = 0;\n for(int cclass = 0; cclass < data.numClasses(); cclass++)\n m_MI_NumClass[cclass] = 0;\n for (int attrIndex = 0; attrIndex < data.numAttributes(); attrIndex++) {\n\t \n if(attrIndex == data.classIndex())\n\tcontinue;\n\t \n m_MI_MaxArray[attrIndex] = m_MI_MinArray[attrIndex] = Double.NaN;\n m_MI[attrIndex] = Double.NaN;\n\t \n if(data.attribute(attrIndex).isNumeric()){\n\tm_MI_NumAttrInter[attrIndex] = new int[m_NumFoldersMI];\n\tfor(int inter = 0; inter < m_NumFoldersMI; inter++){\n\t m_MI_NumAttrInter[attrIndex][inter] = 0;\n\t}\n } else {\n\tm_MI_NumAttrValue[attrIndex] = new int[data.attribute(attrIndex).numValues() + 1];\n\tfor(int attrValue = 0; attrValue < data.attribute(attrIndex).numValues() + 1; attrValue++){\n\t m_MI_NumAttrValue[attrIndex][attrValue] = 0;\n\t}\n }\n\t \n m_MI_NumAttrClassInter[attrIndex] = new int[data.numClasses()][];\n m_MI_NumAttrClassValue[attrIndex] = new int[data.numClasses()][];\n\n for(int cclass = 0; cclass < data.numClasses(); cclass++){\n\tif(data.attribute(attrIndex).isNumeric()){\n\t m_MI_NumAttrClassInter[attrIndex][cclass] = new int[m_NumFoldersMI];\n\t for(int inter = 0; inter < m_NumFoldersMI; inter++){\n\t m_MI_NumAttrClassInter[attrIndex][cclass][inter] = 0;\n\t }\n\t} else if(data.attribute(attrIndex).isNominal()){\n\t m_MI_NumAttrClassValue[attrIndex][cclass] = new int[data.attribute(attrIndex).numValues() + 1];\t\t\n\t for(int attrValue = 0; attrValue < data.attribute(attrIndex).numValues() + 1; attrValue++){\n\t m_MI_NumAttrClassValue[attrIndex][cclass][attrValue] = 0;\n\t }\n\t}\n }\n }\n m_MissingVector = new double[data.numAttributes()];\n for(int i = 0; i < data.numAttributes(); i++){\n if(i == data.classIndex()){\n\tm_MissingVector[i] = Double.NaN;\n } else {\n\tm_MissingVector[i] = data.attribute(i).numValues();\n }\n }\n\n /* update the classifier with data */\n Enumeration enu = data.enumerateInstances();\n while(enu.hasMoreElements()){\n update((Instance) enu.nextElement());\n }\t\n }", "public interface Algorithm {\n /**\n * Initialize the data store and verifies the data in it.\n * \n * @param datastore\n * @throws InvalidDatastoreException\n */\n void initialize(Datastore datastore) throws InvalidDatastoreException;\n \n /**\n * Classify the document and return the Result\n * \n * @param document\n * The document to classify\n * @param datastore\n * The data store(InMemory)\n * @param defaultCategory\n * The default category to assign Ties are broken by comparing the category\n * @return A Collection of {@link org.apache.mahout.classifier.ClassifierResult}s.\n * @throws InvalidDatastoreException\n */\n ClassifierResult classifyDocument(String[] document,\n Datastore datastore,\n String defaultCategory) throws InvalidDatastoreException;\n \n /**\n * Classify the document and return the top {@code numResults}\n *\n * @param document\n * The document to classify\n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param defaultCategory\n * The default category to assign\n * @param numResults\n * The maximum number of results to return, ranked by score. Ties are broken by comparing the\n * category\n * @return A Collection of {@link ClassifierResult}s.\n * @throws InvalidDatastoreException\n */\n ClassifierResult[] classifyDocument(String[] document,\n Datastore datastore,\n String defaultCategory,\n int numResults) throws InvalidDatastoreException;\n \n /**\n * Get the weighted probability of the feature.\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param label\n * The label of the feature\n * @param feature\n * The feature to calc. the prob. for\n * @return The weighted probability\n * @throws InvalidDatastoreException\n */\n double featureWeight(Datastore datastore, String label, String feature) throws InvalidDatastoreException;\n \n /**\n * Calculate the document weight as the dot product of document vector and the corresponding weight vector\n * of a particular class\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @param label\n * The label to calculate the probability of\n * @param document\n * The document\n * @return The probability\n * @see Algorithm#featureWeight(Datastore, String, String)\n */\n double documentWeight(Datastore datastore, String label, String[] document);\n \n /**\n * Returns the labels in the given Model\n * \n * @param datastore\n * The {@link Datastore} (InMemory)\n * @throws InvalidDatastoreException\n * @return {@link Collection} of labels\n */\n Collection<String> getLabels(Datastore datastore) throws InvalidDatastoreException;\n}", "public ProcessingTarget buildGraph(){\n \t\tgetTibbrGraph();\n \n \t\t//Init a project - and therefore a workspace\n \t\tProjectController pc = Lookup.getDefault().lookup(ProjectController.class);\n \t\tpc.newProject();\n \t\tWorkspace workspace = pc.getCurrentWorkspace();\n \n \t\t//Get a graph model - it exists because we have a workspace\n \t\tGraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();\n \t\tAttributeModel attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();\n \t\tImportController importController = Lookup.getDefault().lookup(ImportController.class);\n \n \t\t//Import file \n \t\tContainer container;\n \t\ttry {\n \t\t\tFile f = new File(this.filename);\n \t\t\tcontainer = importController.importFile(f);\n \t\t\tcontainer.getLoader().setEdgeDefault(EdgeDefault.DIRECTED); //Force DIRECTED\n \t\t container.setAllowAutoNode(false); //Don't create missing nodes\n \t\t} catch (Exception ex) {\n \t\t\tex.printStackTrace();\n \t\t\treturn null;\n \t\t}\n \n \t\t//Append imported data to GraphAPI\n \t\timportController.process(container, new DefaultProcessor(), workspace);\n \n \t\t//See if graph is well imported\n \t\t//DirectedGraph graph = graphModel.getDirectedGraph();\n \t\t//---------------------------\n \n \t\t//Layout for 1 minute\n \t\tAutoLayout autoLayout = new AutoLayout(5, TimeUnit.SECONDS);\n \t\tautoLayout.setGraphModel(graphModel);\n \t\t//YifanHuLayout firstLayout = new YifanHuLayout(null, new StepDisplacement(1f));\n \t\tForceAtlasLayout secondLayout = new ForceAtlasLayout(null);\n \t\tAutoLayout.DynamicProperty adjustBySizeProperty = AutoLayout.createDynamicProperty(\"forceAtlas.adjustSizes.name\", Boolean.TRUE, 0.1f);//True after 10% of layout time\n \t\tAutoLayout.DynamicProperty repulsionProperty = AutoLayout.createDynamicProperty(\"forceAtlas.repulsionStrength.name\", new Double(10000.), 0f);//500 for the complete period\n \t\t//autoLayout.addLayout( firstLayout, 0.5f );\n \t\tautoLayout.addLayout(secondLayout, 1f, new AutoLayout.DynamicProperty[]{adjustBySizeProperty, repulsionProperty});\n \t\tautoLayout.execute();\n \n \n \n \n \n \t\t//Rank color by Degree\n \t\tRankingController rankingController = Lookup.getDefault().lookup(RankingController.class);\n\t\tRanking<?> degreeRanking = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, Ranking.DEGREE_RANKING);\n\t\tAbstractColorTransformer<?> colorTransformer = (AbstractColorTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.RENDERABLE_COLOR);\n \n \t\tcolorTransformer.setColors(new Color[]{new Color(0xFEF0D9), new Color(0xB30000)});\n \t\trankingController.transform(degreeRanking,colorTransformer);\n \n \t\t//Get Centrality\n \t\tGraphDistance distance = new GraphDistance();\n \t\tdistance.setDirected(true);\n \t\tdistance.execute(graphModel, attributeModel);\n \n \t\t//Rank size by centrality\n \t\tAttributeColumn centralityColumn = attributeModel.getNodeTable().getColumn(GraphDistance.BETWEENNESS);\n\t\tRanking<?> centralityRanking = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, centralityColumn.getId());\n\t\tAbstractSizeTransformer<?> sizeTransformer = (AbstractSizeTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.RENDERABLE_SIZE);\n \t\tsizeTransformer.setMinSize(3);\n \t\tsizeTransformer.setMaxSize(20);\n \t\trankingController.transform(centralityRanking,sizeTransformer);\n \n \t\t//Rank label size - set a multiplier size\n\t\tRanking<?> centralityRanking2 = rankingController.getModel().getRanking(Ranking.NODE_ELEMENT, centralityColumn.getId());\n\t\tAbstractSizeTransformer<?> labelSizeTransformer = (AbstractSizeTransformer<?>) rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT, Transformer.LABEL_SIZE);\n \t\tlabelSizeTransformer.setMinSize(1);\n \t\tlabelSizeTransformer.setMaxSize(3);\n \t\trankingController.transform(centralityRanking2,labelSizeTransformer);\n \n \t\tfloat[] positions = {0f,0.33f,0.66f,1f};\n \t\tcolorTransformer.setColorPositions(positions);\n \t\tColor[] colors = new Color[]{new Color(0x0000FF), new Color(0xFFFFFF),new Color(0x00FF00),new Color(0xFF0000)};\n \t\tcolorTransformer.setColors(colors);\n \n \t\t\n \t\t//---------------------------------\n \t\t//Preview configuration\n \t\tPreviewController previewController = Lookup.getDefault().lookup(PreviewController.class);\n \t\tPreviewModel previewModel = previewController.getModel();\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.DIRECTED, Boolean.TRUE);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.BACKGROUND_COLOR, Color.BLACK);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS, Boolean.TRUE);\n \t\tpreviewModel.getProperties().putValue(PreviewProperty.NODE_LABEL_COLOR, new DependantOriginalColor(Color.YELLOW));\n \t\t\n \t\t\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_CURVED, Boolean.TRUE);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_OPACITY, 100);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_RADIUS, 1f);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.EDGE_THICKNESS,0.2f);\n \t\t//previewModel.getProperties().putValue(PreviewProperty.ARROW_SIZE,0.2f);\n \n \t\tpreviewController.refreshPreview();\n \n \t\t//----------------------------\n \n \t\t//New Processing target, get the PApplet\n \t\tProcessingTarget target = (ProcessingTarget) previewController.getRenderTarget(RenderTarget.PROCESSING_TARGET);\n \t\t\n \t\tPApplet applet = target.getApplet();\n \t\tapplet.init();\n \n \t\t// Add .1 second delay to fix stability issue - per Gephi forums\n try {\n \t\t\t\tThread.sleep(100);\n \t\t\t} catch (InterruptedException e) {\n \t\t\t\t// TODO Auto-generated catch block\n \t\t\t\te.printStackTrace();\n \t\t\t}\n \n \t\t\n \t\t//Refresh the preview and reset the zoom\n \t\tpreviewController.render(target);\n \t\ttarget.refresh();\n \t\ttarget.resetZoom();\n \t\ttarget.zoomMinus();\n \t\ttarget.zoomMinus();\n \t\t\n \t\treturn target;\n \t\t\n \n \t}", "public Recommender buildRecommender(DataModel dataModel) \n\t throws TasteException {\n\t \tUserSimilarity userSim=new PearsonCorrelationSimilarity(dataModel);\n\t \tUserNeighborhood nbh = new NearestNUserNeighborhood(10, userSim, dataModel);\n\t \t\t\treturn new GenericUserBasedRecommender(dataModel, nbh, userSim);\n\t }", "private DataObject(Builder builder) {\n super(builder);\n }", "protected abstract String getPreprocessingModel(PipelineData data);", "HdbSequenceModel createHdbSequenceModel();", "public void buildModel() {\n space = new RabbitsGrassSimulationSpace(gridSize);\n space.setModel(this);\n space.spreadGrass(numInitGrass);\n\n for (int i = 0; i < numInitRabbits; i++) {\n addNewRandomRabbit();\n }\n }", "public interface IModelAdapter<THost> {\r\n\r\n\t/**\r\n\t * Returns the result of the model processing given the visitor's classname and the given parameter string using the given host.\r\n\t * @param host The host that runs the given visitor \r\n\t * @param classname The visitor's class name to use\r\n\t * @param param The input parameter to use\r\n\t * @return The result of the processing\r\n\t */\r\n\tString runAlgo(THost host, String classname, String param);\r\n\r\n\t/**\r\n\t * Returns the result of the model processing given the \r\n\t * accumulator's classname and the given parameter string \r\n\t * using the given host with the FoldRAlgo visitor.\r\n\t * @param host The host that runs the FoldRAlgo visitor \r\n\t * @param accClassname The accumulator's class name to use\r\n\t * @return The result of the processing\r\n\t */\r\n\tString runFoldR(THost host, String accClassname);\r\n\t\r\n\t/**\r\n\t * Returns the result of the model processing given the \r\n\t * accumulator's classname and the given parameter string \r\n\t * using the given host with the FoldLAlgo visitor.\r\n\t * @param host The host that runs the FoldLAlgo visitor \r\n\t * @param accClassname The accumulator's class name to use\r\n\t * @return The result of the processing\r\n\t */\t\r\n\tString runFoldL(THost host, String accClassname);}", "public DynamicModelPart build() {\n return this.rotateModelPart(this.rotation).addCuboids();\n }", "public static DAG creatBigFireDectectorModel(Attributes attributes, int nRooms){\n\n /********** Model Definition ************/\n //Create the object handling the random variables of the model\n Variables variables = new Variables();\n\n //Create the random variables of the model.\n // Some of them are associated to one attribute to retrieve its observed values from the data set.\n Variable temperatureBuilding = variables.newGaussianVariable(\"TemperatureBuilding\");\n\n Variable[] fire = new Variable[nRooms];\n Variable[] temperature = new Variable[nRooms];\n Variable[] smoke = new Variable[nRooms];\n Variable[] sensorT1 = new Variable[nRooms];\n Variable[] sensorT2 = new Variable[nRooms];\n Variable[] sensorSmoke = new Variable[nRooms];\n\n for (int i = 0; i < nRooms; i++) {\n fire[i] = variables.newMultinomialVariable(attributes.getAttributeByName(\"Fire_\"+i));\n temperature[i] = variables.newGaussianVariable(\"Temperature_\"+i);\n smoke[i] = variables.newMultinomialVariable(\"Smoke_\"+i, 2);\n sensorT1[i] = variables.newGaussianVariable(attributes.getAttributeByName(\"SensorTemp1_\"+i));\n sensorT2[i] = variables.newGaussianVariable(attributes.getAttributeByName(\"SensorTemp2_\"+i));\n sensorSmoke[i] = variables.newGaussianVariable(attributes.getAttributeByName(\"SensorSmoke_\"+i));\n }\n\n //Create the directed acyclic graph object encoding the conditional independence relationship among the variables of the model.\n DAG dag = new DAG(variables);\n for (int i = 0; i < nRooms; i++) {\n //Define the parent set for each random variable\n dag.getParentSet(sensorT1[i]).addParent(temperature[i]);\n dag.getParentSet(sensorT2[i]).addParent(temperature[i]);\n\n dag.getParentSet(sensorSmoke[i]).addParent(smoke[i]);\n\n dag.getParentSet(temperature[i]).addParent(fire[i]);\n dag.getParentSet(smoke[i]).addParent(fire[i]);\n\n dag.getParentSet(temperature[i]).addParent(temperatureBuilding);\n }\n\n //Print the defined DAG\n System.out.println(dag);\n\n return dag;\n }", "GameModel createGameModel(GameModel gameModel);", "private Data(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "public interface NetworkBuilder {\n\n /**\n * Set neural net layers\n * @param layers an array with the width and depth of each layer\n * @return NetworkBuilder instance\n */\n public abstract NetworkBuilder withLayers(int[] layers);\n\n /**\n * Set the DataSet\n * @param train - training set\n * @param test - test set\n * @return NetworkBuilder instance\n */\n public abstract NetworkBuilder withDataSet(DataSet train, DataSet test);\n\n /**\n * Set the ActivationFunction\n * @param activationFunction\n * @return NetworkBuilder instance\n */\n public abstract NetworkBuilder withActivationFunction(ActivationFunction activationFunction);\n\n /**\n * Set the ErrorMeasure\n * @param errorMeasure\n * @return NetworkBuilder instance\n */\n public abstract NetworkBuilder withErrorMeasure(ErrorMeasure errorMeasure);\n\n /**\n * Train the network\n * @return the trained network for testing\n */\n public abstract FeedForwardNetwork train();\n}", "@Test\r\n public void testDataBuilder_ValidInit(){\r\n \tDataInitializer dataBuild = DataInitializer.getInstance();\r\n \tdataBuild.initValidComputerParts();\r\n \tassertTrue(dataBuild.getCPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of CPUs: \" + dataBuild.getCPUList().size());\r\n \tassertTrue(dataBuild.getGPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of GPUs: \" + dataBuild.getGPUList().size());\r\n \tassertTrue(dataBuild.getMBList().size() > 0);\r\n \tSystem.out.println(\"Total # of Motherboards: \" + dataBuild.getMBList().size());\r\n \tassertTrue(dataBuild.getMEMList().size() > 0);\r\n \tSystem.out.println(\"Total # of Memory Units: \" + dataBuild.getMEMList().size());\r\n \tassertTrue(dataBuild.getPSUList().size() > 0);\r\n \tSystem.out.println(\"Total # of PSUs: \" + dataBuild.getPSUList().size());\r\n \tassertTrue(dataBuild.getDISKList().size() > 0);\r\n \tSystem.out.println(\"Total # of Disks: \" + dataBuild.getDISKList().size());\r\n }", "public ModelStructure(){\n dcModelPurposeIndexMap = new HashMap<String,Integer>();\n dcModelIndexPurposeMap = new HashMap<Integer,String>();\n dcSoaUecIndexMap = new HashMap<String,Integer>();\n dcUecIndexMap = new HashMap<String,Integer>();\n tourModeChoiceUecIndexMap = new HashMap<String,Integer>();\n stopFreqUecIndexMap = new HashMap<String,Integer>();\n stopLocUecIndexMap = new HashMap<String,Integer>();\n tripModeChoiceUecIndexMap = new HashMap<String,Integer>();\n \n segmentedPurposeIndexMap = new HashMap<String,Integer>();\n segmentedIndexPurposeMap = new HashMap<Integer,String>();\n\n primaryPurposeIndexMap = new HashMap<String,Integer>();\n primaryIndexPurposeMap = new HashMap<Integer,String>();\n primaryPurposeIndexMap.put( \"Home\", -1 );\n primaryPurposeIndexMap.put( \"Work\", -2 );\n primaryPurposeIndexMap.put( WORK_PURPOSE_NAME, WORK_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( UNIVERSITY_PURPOSE_NAME, UNIVERSITY_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SCHOOL_PURPOSE_NAME, SCHOOL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( ESCORT_PURPOSE_NAME, ESCORT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SHOPPING_PURPOSE_NAME, SHOPPING_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_MAINT_PURPOSE_NAME, OTH_MAINT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( EAT_OUT_PURPOSE_NAME, EAT_OUT_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( SOCIAL_PURPOSE_NAME, SOCIAL_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( OTH_DISCR_PURPOSE_NAME, OTH_DISCR_PURPOSE_INDEX );\n primaryPurposeIndexMap.put( AT_WORK_PURPOSE_NAME, AT_WORK_PURPOSE_INDEX );\n primaryIndexPurposeMap.put( -1, \"Home\" );\n primaryIndexPurposeMap.put( -2, \"Work\" );\n primaryIndexPurposeMap.put( WORK_PURPOSE_INDEX, WORK_PURPOSE_NAME );\n primaryIndexPurposeMap.put( UNIVERSITY_PURPOSE_INDEX, UNIVERSITY_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SCHOOL_PURPOSE_INDEX, SCHOOL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( ESCORT_PURPOSE_INDEX, ESCORT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SHOPPING_PURPOSE_INDEX, SHOPPING_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_MAINT_PURPOSE_INDEX, OTH_MAINT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( EAT_OUT_PURPOSE_INDEX, EAT_OUT_PURPOSE_NAME );\n primaryIndexPurposeMap.put( SOCIAL_PURPOSE_INDEX, SOCIAL_PURPOSE_NAME );\n primaryIndexPurposeMap.put( OTH_DISCR_PURPOSE_INDEX, OTH_DISCR_PURPOSE_NAME );\n primaryIndexPurposeMap.put( AT_WORK_PURPOSE_INDEX, AT_WORK_PURPOSE_NAME );\n }", "public XMLModel002Builder() {\n }", "ZenModel createZenModel();", "void setTrainData(DataModel trainData);", "public M create(P model);", "public static void main(String... args) throws Exception {\n if (args.length != 3) {\n throw new Exception(\"Expecting three arguments\");\n }\n\n // Reading arguments: the data file path and the data separator\n String dataPath = args[0];\n final String separator = args[1];\n String modelPath = args[2];\n\n // Weights used to generate data subsets\n double[] weights = {.6, .2, .2};\n // Number of iteration performed during ALS\n int numIterations = 20;\n\n // Context initialization\n SparkConf sparkConf = new SparkConf().setAppName(\"ALS model computation\");\n JavaSparkContext jsc = new JavaSparkContext(sparkConf);\n\n // Transforming file content into JavaRDD\n JavaRDD<String> data = jsc.textFile(dataPath);\n\n // Transforming each lines into ratings\n JavaRDD<Rating> ratings = Utils.generateRatings(data, separator);\n\n // Generating train set, cross validation set and test set\n JavaRDD<Rating>[] sets = ratings.randomSplit(weights);\n\n // Caching generated subsets\n sets[0].cache();\n sets[1].cache();\n sets[2].cache();\n\n MatrixFactorizationModel bestModel = null;\n double bestRMSE = 0;\n\n // Computing several model with different values for rank\n for (int rank = 1; rank <= 10; rank++) {\n // Training model with training set\n MatrixFactorizationModel model = ALS.train(sets[0].rdd(), rank, numIterations, 0.01);\n\n // Computing MSE over cross validation set\n double RMSE = Utils.computeRMSE(model, sets[1]);\n System.out.println(\"RMSE for rank \" + rank + \": \" + RMSE);\n\n // Saving model if better than the old one\n if (bestModel == null || RMSE < bestRMSE) {\n bestModel = model;\n bestRMSE = RMSE;\n }\n }\n\n // Evaluating best model on test set\n double RMSE = Utils.computeRMSE(bestModel, sets[2]);\n\n System.out.println(\"Model rank: \" + bestModel.rank());\n System.out.println(\"MSE compute over test set: \" + RMSE);\n\n // Saving best model\n bestModel.save(jsc.sc(), modelPath);\n\n // Stopping context\n\t\tjsc.stop();\n }", "public void build() throws ClusException, IOException {\n m_List = getRun().getDataSet(ClusRun.TRAINSET).getData(); // m_Data;\n }", "void create(Model model) throws Exception;", "private Builder() {\n super(edu.pa.Rat.SCHEMA$);\n }", "private static void buildRegressionModel(Instances data, Instances itemsets, int[] items) throws Exception {\n\t\tif (data.numInstances() <= MAX_NB_LEAF) { //stop criterion possible needs to refined: data.variance(data.numAttributes()-1) < 10)\n\t\t\tdouble prediction = getPrediction(data,PREDICT_AVERAGE); \n\t\t\tdouble[] attributes = new double[data.numAttributes()];\n\t\t\tfor (int i : items) {\n\t\t\t\tattributes[i] = 1;\n\t\t\t}\n\t\t\tattributes[attributes.length-1] = prediction;\n\t\t\titemsets.add(new Instance(1, attributes ));\n\t\t}\n\t\telse{\n\t\t\tint[] items2 = findPattern(data);\n\t\t\tInstanceSelection data2 = select(data, items2);\n\t\t\titems2 = union(items2, items);\n\n\t\t\t// depth-first creation of the tree\n\t\t\tif (data2.getSelected().numInstances() != 0) {\n\t\t\t\tbuildRegressionModel(data2.getSelected(), itemsets, items2);\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (data2.getNotSelected().numInstances() != 0) {\n\t\t\t\tbuildRegressionModel(data2.getNotSelected(), itemsets, items);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "public DieteticBrotherModel() {\n database = new Database();\n availableFood = database.initializeAvailableFood();\n recipes = database.initializeRecipes(availableFood);\n\n recipe = new Recipe(0, \"My Recipe\");\n }", "private FigureData(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }", "ModelData getModel();", "@Override\n\t\t\tpublic Recommender buildRecommender(DataModel model)\n\t\t\t\t\tthrows TasteException {\n\t\t\t\tUserSimilarity similarity = new EuclideanDistanceSimilarity(model);\n\t\t\t\tUserNeighborhood neighbor = new NearestNUserNeighborhood(80, similarity, model);\n\t\t\t\treturn \n\t\t\t\tnew GenericUserBasedRecommender(model, neighbor, similarity);\n//\t\t\t\tnew SlopeOneRecommender(model);\n\t\t\t\t}", "private void buildModel() {\n\t\trabbitSpace = new RabbitsGrassSimulationSpace(xSize, ySize);\n\n\t\trabbitSpace.spreadGrass(initGrass);\n\n\t\tfor (int i = 0; i < numRabbits && i < xSize * ySize; i++) {\n\t\t\taddNewRabbit();\n\t\t}\n\n\t\tfor (int i = 0; i < rabbitList.size(); i++) {\n\t\t\tRabbitsGrassSimulationAgent rabbit = rabbitList.get(i);\n\t\t\trabbit.report();\n\t\t}\n\t}", "public ModelBolting(){}", "abstract Object build();", "public ModelInfo generateInfo() { \n ModelInfo info = new ModelInfo();\n \n // Store basic info\n info.author = Author;\n info.citation = Citation;\n info.description = Description;\n info.property = Property;\n info.training = Model.TrainingStats.NumberTested + \" entries: \" + TrainingSet;\n info.notes = Notes;\n info.trainTime = new SimpleDateFormat(\"dMMMyy HH:mm z\").format(Model.getTrainTime());\n \n // Store units or class names\n if (Model instanceof AbstractClassifier) {\n info.classifier = true;\n info.units = \"\";\n AbstractClassifier clfr = (AbstractClassifier) Model;\n boolean started = false;\n for (String name : clfr.getClassNames()) {\n if (started) {\n info.units += \";\";\n }\n info.units += name;\n started = true;\n }\n } else {\n info.classifier = false;\n info.units = Units;\n }\n \n // Store names of models\n info.dataType = Dataset.printDescription(true);\n info.modelType = Model.printDescription(true);\n \n // Store validation performance data\n info.valMethod = Model.getValidationMethod();\n if (Model.isValidated()) {\n info.valScore = Model.ValidationStats.getStatistics();\n }\n \n return info;\n }", "private List<Model> getModel() {\n \r\n DataBaseTestAdapter1 mDbHelper = new DataBaseTestAdapter1(this); \r\n\t \tmDbHelper.createDatabase(); \r\n\t \tmDbHelper.open(); \r\n\t \t \r\n \t \tpure = (Pure?\"T\":\"F\");\r\n\r\n \t \tString sql =\"SELECT Code FROM \"+major+\" WHERE (Pure='All' OR Pure='\" + pure + \"') ORDER BY Year,Code\"; \r\n\t \tCursor testdata = mDbHelper.getTestData(sql); \r\n\t \tString code = DataBaseUtility1.GetColumnValue(testdata, \"Code\");\r\n\t \tlist.add(new Model(code));\r\n\t \twhile (testdata.moveToNext()){\r\n\t \t\t \r\n\t \tcode = DataBaseUtility1.GetColumnValue(testdata, \"Code\");\r\n\t \tModel temp = new Model(code);\r\n\t \t\r\n\t \tif ((code.equals(\"CommonCore1\") && SA) ||\t\t\t//name conversion\r\n\t \t\t\t(code.equals(\"CommonCore2\") && S_T) ||\r\n\t \t\t\t(code.equals(\"CommonCore3\") && A_H) ||\r\n\t \t\t\t(code.equals(\"CommonCore4\") && Free) ||\r\n\t \t\t\t(code.equals(\"SBM\") && SBM) ||\r\n\t \t\t\t(code.equals(\"ENGG\") && ENGG) ||\r\n\t \t\t\t(code.equals(\"FreeElective\") && FreeE) ||\r\n\t \t\t\t(code.equals(\"COMPElective1\") && compx1) ||\r\n\t \t\t\t((code.equals(\"COMPElective1\")|| code.equals(\"COMPElective2\")) && compx2) ||\r\n\t \t\t\t((code.equals(\"COMPElective1\")|| code.equals(\"COMPElective2\") || code.equals(\"COMPElective3\")) && compx3) ||\r\n\t \t\t\t((code.equals(\"COMPElective1\")|| code.equals(\"COMPElective2\") || code.equals(\"COMPElective3\") || code.equals(\"COMPElective4\")) && compx4) ||\r\n\t \t\t\t((code.equals(\"COMPElective1\")|| code.equals(\"COMPElective2\") || code.equals(\"COMPElective3\") || code.equals(\"COMPElective4\") || code.equals(\"COMPElective5\")) && compx5) ||\r\n\t \t\t\t(code.equals(\"COMP/ELEC/MATH1\") && CEMx1) ||\r\n\t \t\t\t((code.equals(\"COMP/ELEC/MATH1\") || code.equals(\"COMP/ELEC/MATH2\")) && CEMx2) \r\n\t \t\t\t\t\t\t\t){\r\n\t \t\t\r\n\t \t\ttemp.setSelected(true);\r\n\t \t}\r\n\t \r\n\t \tlist.add(temp);\r\n \t}\r\n\r\n\t\ttestdata.close();\r\n \tmDbHelper.close();\r\n\r\n return list;\r\n }", "InstanceModel createInstanceOfInstanceModel();", "private Builder() {\n super(Gel_BioInf_Models.ChiSquare1KGenomesPhase3Pop.SCHEMA$);\n }", "public EnsembleLibraryModel(Classifier classifier) {\n \n m_Classifier = classifier;\n \n //this may seem redundant and stupid, but it really is a good idea \n //to cache the stringRepresentation to minimize the amount of work \n //that needs to be done when these Models are rendered\n m_StringRepresentation = toString();\n \n updateDescriptionText();\n }", "@Test\r\n public void testDataBuilder_Init(){\r\n \tdataBuild.initAllData();\r\n \tassertTrue(dataBuild.getCPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of CPUs: \" + dataBuild.getCPUList().size());\r\n \tassertTrue(dataBuild.getGPUList().size() > 0);\r\n \tSystem.out.println(\"Total # of GPUs: \" + dataBuild.getGPUList().size());\r\n \tassertTrue(dataBuild.getMBList().size() > 0);\r\n \tSystem.out.println(\"Total # of Motherboards: \" + dataBuild.getMBList().size());\r\n \tassertTrue(dataBuild.getMEMList().size() > 0);\r\n \tSystem.out.println(\"Total # of Memory Units: \" + dataBuild.getMEMList().size());\r\n \tassertTrue(dataBuild.getPSUList().size() > 0);\r\n \tSystem.out.println(\"Total # of PSUs: \" + dataBuild.getPSUList().size());\r\n \tassertTrue(dataBuild.getDISKList().size() > 0);\r\n \tSystem.out.println(\"Total # of Disks: \" + dataBuild.getDISKList().size());\r\n }", "com.google.ortools.linearsolver.MPModelProto getModel();", "private SimpleData(Builder builder) {\n super(builder);\n }", "DataFlow createDataFlow();", "PackageBuilder() {\n\t\tweightMap = new HashMap<>();\n\t\tcostMap = new HashMap<>();\n\t\tcombinations = new ArrayList<>();\n\t}", "protected void buildCommonModel(PhysicalDataModel pdm, boolean fhirSchema, boolean oauthSchema, boolean javaBatchSchema) {\n if (fhirSchema) {\n FhirSchemaGenerator gen = new FhirSchemaGenerator(adminSchemaName, schemaName);\n gen.buildSchema(pdm);\n switch (dbType) {\n case DB2:\n gen.buildDatabaseSpecificArtifactsDb2(pdm);\n break;\n case DERBY:\n logger.info(\"No database specific artifacts\");\n break;\n case POSTGRESQL:\n gen.buildDatabaseSpecificArtifactsPostgres(pdm);\n break;\n default:\n throw new IllegalStateException(\"Unsupported db type: \" + dbType);\n }\n }\n\n // Build/update the Liberty OAuth-related tables\n if (oauthSchema) {\n OAuthSchemaGenerator oauthSchemaGenerator = new OAuthSchemaGenerator(oauthSchemaName);\n oauthSchemaGenerator.buildOAuthSchema(pdm);\n }\n\n // Build/update the Liberty JBatch related tables\n if (javaBatchSchema) {\n JavaBatchSchemaGenerator javaBatchSchemaGenerator = new JavaBatchSchemaGenerator(javaBatchSchemaName);\n javaBatchSchemaGenerator.buildJavaBatchSchema(pdm);\n }\n }", "public static Model createEntity(EntityManager em) {\n\t\tModel model = new Model().name(DEFAULT_NAME).type(DEFAULT_TYPE).algorithm(DEFAULT_ALGORITHM)\n\t\t\t\t.status(DEFAULT_STATUS).owner(DEFAULT_OWNER).performanceMetrics(DEFAULT_PERFORMANCE_METRICS)\n\t\t\t\t.modelLocation(DEFAULT_MODEL_LOCATION).featureSignificance(DEFAULT_FEATURE_SIGNIFICANCE)\n\t\t\t\t.builderConfig(DEFAULT_BUILDER_CONFIG).createdDate(DEFAULT_CREATED_DATE)\n\t\t\t\t.deployedDate(DEFAULT_DEPLOYED_DATE).trainingDataset(DEFAULT_TRAINING_DATASET)\n .library(DEFAULT_LIBRARY).project(DEFAULT_PROJECT).version(DEFAULT_VERSION);\n\t\treturn model;\n\t}", "public Model() {\n\t}" ]
[ "0.6594065", "0.6348369", "0.6248028", "0.61992896", "0.61216426", "0.60210377", "0.59218925", "0.58133876", "0.5771144", "0.57311064", "0.5647922", "0.5595435", "0.55729085", "0.5555742", "0.553497", "0.553497", "0.553497", "0.553497", "0.553497", "0.553497", "0.553497", "0.5485355", "0.5451988", "0.5444088", "0.5434698", "0.543016", "0.5410098", "0.54080904", "0.5404811", "0.5375567", "0.5351104", "0.5303952", "0.5301186", "0.52894425", "0.52804536", "0.5280033", "0.5266202", "0.5259475", "0.52579594", "0.52566224", "0.5253579", "0.52449197", "0.52390397", "0.522207", "0.52137214", "0.5208744", "0.5206725", "0.5206041", "0.51921123", "0.51694906", "0.5163025", "0.5162091", "0.5160299", "0.5148202", "0.5142636", "0.5136821", "0.5130161", "0.51273894", "0.5125782", "0.5118708", "0.5097059", "0.5093407", "0.50925744", "0.5089805", "0.50830454", "0.50758725", "0.5073525", "0.50636226", "0.5059031", "0.5058462", "0.5058393", "0.5039969", "0.5035197", "0.50344", "0.5027212", "0.50162065", "0.5008691", "0.500836", "0.500649", "0.49979633", "0.49937686", "0.49934185", "0.49858084", "0.49585187", "0.4957707", "0.49521017", "0.49491584", "0.49485904", "0.49411908", "0.4930143", "0.4930084", "0.49269173", "0.49242207", "0.49048126", "0.48942375", "0.48940432", "0.48928213", "0.4886663", "0.48859516", "0.48844153" ]
0.55255437
21
/======================================== Prediction ======================================== Evaluate the designated algorithm with the given test data.
public EvaluationMetrics evaluate(SparseMatrix testMatrix) { SparseMatrix predicted = new SparseMatrix(userCount+1, itemCount+1); for (int u = 1; u <= userCount; u++) { int[] testItems = testMatrix.getRowRef(u).indexList(); if (testItems != null) { SparseVector predictedForUser = new SparseVector(itemCount); for (int i : testItems) { /* ===================== * COMMENT FOR AUTHORS * ===================== * From your model (model-based) or with your estimation method (memory-based) from rating matrix, * you are supposed to estimate an unseen rating for an item "i" by a user "u" this point. * Please store your estimation for this (u, i) pair in the variable "estimate" below. * If the estimation is not simple, you may make private methods to help the decision. * Obviously again, you should not alter/add/remove any value in testMatrix during the evaluation process. */ double estimate = 0.0; /* ===================== * COMMENT FOR AUTHORS * ===================== * This part ensures that your algorithm always produces a valid estimation. * You may be freely remove this part under your judge, but you should make sure that * your algorithm does not estimate ratings outside of legal range in the domain. */ if (estimate < minValue) estimate = minValue; else if (estimate > maxValue) estimate = maxValue; predictedForUser.setValue(i, estimate); } if (predictedForUser != null) { for (int i : predictedForUser.indexList()) { predicted.setValue(u, i, predictedForUser.getValue(i)); } } } } return new EvaluationMetrics(testMatrix, predicted, maxValue, minValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int predict(double[] testingData);", "public void evaluate(String sampleFile, String featureDefFile, int nFold, float tvs, String modelDir, String modelFile) {\n/* 854 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 855 */ List<List<RankList>> validationData = new ArrayList<>();\n/* 856 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* */ \n/* 860 */ List<RankList> samples = readInput(sampleFile);\n/* */ \n/* */ \n/* 863 */ int[] features = readFeature(featureDefFile);\n/* 864 */ if (features == null) {\n/* 865 */ features = FeatureManager.getFeatureFromSampleVector(samples);\n/* */ }\n/* 867 */ FeatureManager.prepareCV(samples, nFold, tvs, trainingData, validationData, testData);\n/* */ \n/* */ \n/* 870 */ if (normalize)\n/* */ {\n/* 872 */ for (int j = 0; j < nFold; j++) {\n/* */ \n/* 874 */ normalizeAll(trainingData, features);\n/* 875 */ normalizeAll(validationData, features);\n/* 876 */ normalizeAll(testData, features);\n/* */ } \n/* */ }\n/* */ \n/* 880 */ Ranker ranker = null;\n/* 881 */ double scoreOnTrain = 0.0D;\n/* 882 */ double scoreOnTest = 0.0D;\n/* 883 */ double totalScoreOnTest = 0.0D;\n/* 884 */ int totalTestSampleSize = 0;\n/* */ \n/* 886 */ double[][] scores = new double[nFold][]; int i;\n/* 887 */ for (i = 0; i < nFold; i++) {\n/* 888 */ (new double[2])[0] = 0.0D; (new double[2])[1] = 0.0D; scores[i] = new double[2];\n/* 889 */ } for (i = 0; i < nFold; i++) {\n/* */ \n/* 891 */ List<RankList> train = trainingData.get(i);\n/* 892 */ List<RankList> vali = null;\n/* 893 */ if (tvs > 0.0F)\n/* 894 */ vali = validationData.get(i); \n/* 895 */ List<RankList> test = testData.get(i);\n/* */ \n/* 897 */ RankerTrainer trainer = new RankerTrainer();\n/* 898 */ ranker = trainer.train(this.type, train, vali, features, this.trainScorer);\n/* */ \n/* 900 */ double s2 = evaluate(ranker, test);\n/* 901 */ scoreOnTrain += ranker.getScoreOnTrainingData();\n/* 902 */ scoreOnTest += s2;\n/* 903 */ totalScoreOnTest += s2 * test.size();\n/* 904 */ totalTestSampleSize += test.size();\n/* */ \n/* */ \n/* 907 */ scores[i][0] = ranker.getScoreOnTrainingData();\n/* 908 */ scores[i][1] = s2;\n/* */ \n/* */ \n/* 911 */ if (!modelDir.isEmpty()) {\n/* */ \n/* 913 */ ranker.save(FileUtils.makePathStandard(modelDir) + \"f\" + (i + 1) + \".\" + modelFile);\n/* 914 */ System.out.println(\"Fold-\" + (i + 1) + \" model saved to: \" + modelFile);\n/* */ } \n/* */ } \n/* 917 */ System.out.println(\"Summary:\");\n/* 918 */ System.out.println(this.testScorer.name() + \"\\t| Train\\t| Test\");\n/* 919 */ System.out.println(\"----------------------------------\");\n/* 920 */ for (i = 0; i < nFold; i++)\n/* 921 */ System.out.println(\"Fold \" + (i + 1) + \"\\t| \" + SimpleMath.round(scores[i][0], 4) + \"\\t| \" + SimpleMath.round(scores[i][1], 4) + \"\\t\"); \n/* 922 */ System.out.println(\"----------------------------------\");\n/* 923 */ System.out.println(\"Avg.\\t| \" + SimpleMath.round(scoreOnTrain / nFold, 4) + \"\\t| \" + SimpleMath.round(scoreOnTest / nFold, 4) + \"\\t\");\n/* 924 */ System.out.println(\"----------------------------------\");\n/* 925 */ System.out.println(\"Total\\t| \\t\\t| \" + SimpleMath.round(totalScoreOnTest / totalTestSampleSize, 4) + \"\\t\");\n/* */ }", "public void evaluate(String trainFile, String validationFile, String testFile, String featureDefFile) {\n/* 710 */ List<RankList> train = readInput(trainFile);\n/* */ \n/* 712 */ List<RankList> validation = null;\n/* */ \n/* 714 */ if (!validationFile.isEmpty()) {\n/* 715 */ validation = readInput(validationFile);\n/* */ }\n/* 717 */ List<RankList> test = null;\n/* */ \n/* 719 */ if (!testFile.isEmpty()) {\n/* 720 */ test = readInput(testFile);\n/* */ }\n/* 722 */ int[] features = readFeature(featureDefFile);\n/* 723 */ if (features == null) {\n/* 724 */ features = FeatureManager.getFeatureFromSampleVector(train);\n/* */ }\n/* 726 */ if (normalize) {\n/* */ \n/* 728 */ normalize(train, features);\n/* 729 */ if (validation != null)\n/* 730 */ normalize(validation, features); \n/* 731 */ if (test != null) {\n/* 732 */ normalize(test, features);\n/* */ }\n/* */ } \n/* 735 */ RankerTrainer trainer = new RankerTrainer();\n/* 736 */ Ranker ranker = trainer.train(this.type, train, validation, features, this.trainScorer);\n/* */ \n/* 738 */ if (test != null) {\n/* */ \n/* 740 */ double rankScore = evaluate(ranker, test);\n/* 741 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ } \n/* 743 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 745 */ System.out.println(\"\");\n/* 746 */ ranker.save(modelFile);\n/* 747 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "private void test() {\r\n \ttry {\r\n\t\t\ttestWriter.write(\"Testing started...\");\r\n\t\t\r\n\t\t\tpredictions = new HashMap<>();\r\n \trightAnswers = new HashMap<>();\r\n\r\n\r\n \t// Get results and check them\r\n \tEvaluation eval = new Evaluation(numLabels);\r\n \tfinalTestIterator.reset();\r\n\r\n \tint metaDataCounter = 0;\r\n \tint addrCounter = 0;\r\n\r\n \twhile(finalTestIterator.hasNext()) {\r\n \t// If iterator has next dataset\r\n \tfinalTestData = finalTestIterator.next();\r\n \t// Get meta-data from this dataset\r\n\r\n \t@SuppressWarnings(\"rawtypes\")\r\n \tList<?> exampleMetaData = finalTestData.getExampleMetaData();\r\n \tIterator<?> exampleMetaDataIterator = exampleMetaData.iterator();\r\n \ttestWriter.write(\"\\n Metadata from dataset #\" + metaDataCounter + \":\\n\");\r\n \tSystem.out.println(\"\\n Metadata from dataset #\" + metaDataCounter + \":\\n\");\r\n\r\n \t// Normalize data\r\n \tnormalizer.fit(finalTestData);\r\n\r\n \t// Count processed images\r\n \tnumProcessed = (metaDataCounter + 1) * batchSizeTesting;\r\n \tloaded.setText(\"Loaded and processed: \" + numProcessed + \" pictures\");\r\n\r\n \tINDArray features = finalTestData.getFeatures();\r\n \tINDArray labels = finalTestData.getLabels();\r\n \tSystem.out.println(\"\\n Right labels #\" + metaDataCounter + \":\\n\");\r\n \ttestWriter.write(\"\\n Right labels #\" + metaDataCounter + \":\\n\");\r\n \t// Get right answers of NN for every input object\r\n \tint[][] rightLabels = labels.toIntMatrix();\r\n \tfor (int i = 0; i < rightLabels.length; i++) {\r\n \tRecordMetaDataURI metaDataUri = (RecordMetaDataURI) exampleMetaDataIterator.next();\r\n \t// Print address of image\r\n \tSystem.out.println(metaDataUri.getLocation());\r\n \tfor (int j = 0; j < rightLabels[i].length; j++) {\r\n \tif(rightLabels[i][j] == 1) {\r\n \t//public V put(K key, V value) -> key=address, value=right class label\r\n \trightAnswers.put(metaDataUri.getLocation(), j);\r\n \tthis.addresses.add(metaDataUri.getLocation());\r\n \t}\r\n \t}\r\n \t}\r\n \tSystem.out.println(\"\\nRight answers:\");\r\n \ttestWriter.write(\"\\nRight answers:\");\r\n \t// Print right answers\r\n \tfor(Map.Entry<String, Integer> answer : predictions.entrySet()){\r\n \t\ttestWriter.write(String.format(\"Address: %s Right answer: %s \\n\", answer.getKey(), answer.getValue().toString()));\r\n \tSystem.out.printf(String.format(\"Address: %s Right answer: %s \\n\", answer.getKey(), answer.getValue().toString()));\r\n \t}\r\n\r\n \t// Evaluate on the test data\r\n \tINDArray predicted = vgg16Transfer.outputSingle(features);\r\n \tint predFoundCounter = 0;\r\n \tSystem.out.println(\"\\n Labels predicted #\" + metaDataCounter + \":\\n\");\r\n \ttestWriter.write(\"\\n Labels predicted #\" + metaDataCounter + \":\\n\");\r\n \t// Get predictions of NN for every input object\r\n \tint[][] labelsPredicted = predicted.toIntMatrix();\r\n \tfor (int i = 0; i < labelsPredicted.length; i++) {\r\n \tfor (int j = 0; j < labelsPredicted[i].length; j++) {\r\n \tpredFoundCounter++;\r\n \tif(labelsPredicted[i][j] == 1) {\r\n \t//public V put(K key, V value) -> key=address, value=predicted class label\r\n \tpredFoundCounter = 0;\r\n \tthis.predictions.put(this.addresses.get(addrCounter), j);\r\n \t}\r\n \telse {\r\n \tif (predFoundCounter == 3) {\r\n \t// To fix bug when searching positive predictions\r\n \tthis.predictions.put(this.addresses.get(addrCounter), 2);\r\n \t}\r\n \t}\r\n \t}\r\n \taddrCounter++;\r\n \t}\r\n \tSystem.out.println(\"\\nPredicted:\");\r\n \ttestWriter.write(\"\\nPredicted:\");\r\n \t// Print predictions\r\n \tfor(Map.Entry<String, Integer> pred : rightAnswers.entrySet()){\r\n \tSystem.out.printf(\"Address: %s Predicted answer: %s \\n\", pred.getKey(), pred.getValue().toString());\r\n \ttestWriter.write(String.format(\"Address: %s Predicted answer: %s \\n\", pred.getKey(), pred.getValue().toString()));\r\n \t}\r\n \tmetaDataCounter++;\r\n\r\n \teval.eval(labels, predicted);\r\n \t}\r\n\r\n \tSystem.out.println(\"\\n\\n Cheack loaded model on test data...\");\r\n \tSystem.out.println(String.format(\"Evaluation on test data - [Accuracy: %.3f, P: %.3f, R: %.3f, F1: %.3f] \",\r\n \t\t\teval.accuracy(), eval.precision(), eval.recall(), eval.f1()));\r\n \tSystem.out.println(eval.stats());\r\n \tSystem.out.println(eval.confusionToString());\r\n \ttestWriter.write(\"\\n\\n Cheack loaded model on test data...\");\r\n \ttestWriter.write(String.format(\"Evaluation on test data - [Accuracy: %.3f, P: %.3f, R: %.3f, F1: %.3f] \",\r\n \t\t\teval.accuracy(), eval.precision(), eval.recall(), eval.f1()));\r\n \ttestWriter.write(eval.stats());\r\n \ttestWriter.write(eval.confusionToString());\r\n\r\n \t// Save test rates\r\n \tthis.f1_score = eval.f1();\r\n \tthis.recall_score = eval.recall();\r\n \tthis.accuracy_score = eval.accuracy();\r\n \tthis.precision_score = eval.precision();\r\n \tthis.falseNegativeRate_score = eval.falseNegativeRate();\r\n \tthis.falsePositiveRate_score = eval.falsePositiveRate();\r\n\r\n \tthis.f1.setText(\"F1 = \" + String.format(\"%.4f\", f1_score));\r\n \tthis.recall.setText(\"Recall = \" + String.format(\"%.4f\", recall_score));\r\n \tthis.accuracy.setText(\"Accuracy = \" + String.format(\"%.4f\", accuracy_score));\r\n \tthis.precision.setText(\"Precision = \" + String.format(\"%.4f\", precision_score));\r\n \tthis.falseNegativeRate.setText(\"False Negative Rate = \" + String.format(\"%.4f\", falseNegativeRate_score));\r\n \tthis.falsePositiveRate.setText(\"False Positive Rate = \" + String.format(\"%.4f\", falsePositiveRate_score));\r\n \r\n \ttestWriter.write(\"F1 = \" + String.format(\"%.4f\", f1_score));\r\n \ttestWriter.write(\"Recall = \" + String.format(\"%.4f\", recall_score));\r\n \ttestWriter.write(\"Accuracy = \" + String.format(\"%.4f\", accuracy_score));\r\n \ttestWriter.write(\"Precision = \" + String.format(\"%.4f\", precision_score));\r\n \ttestWriter.write(\"False Negative Rate = \" + String.format(\"%.4f\", falseNegativeRate_score));\r\n \ttestWriter.write(\"False Positive Rate = \" + String.format(\"%.4f\", falsePositiveRate_score));\r\n\r\n \tshowBarChart();\r\n \t} catch (IOException e) {\r\n \t\tSystem.err.println(\"Error while writing to log file\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n }", "public void evaluate(String trainFile, double percentTrain, String testFile, String featureDefFile) {\n/* 799 */ List<RankList> train = new ArrayList<>();\n/* 800 */ List<RankList> validation = new ArrayList<>();\n/* 801 */ int[] features = prepareSplit(trainFile, featureDefFile, percentTrain, normalize, train, validation);\n/* 802 */ List<RankList> test = null;\n/* */ \n/* */ \n/* 805 */ if (!testFile.isEmpty()) {\n/* */ \n/* 807 */ test = readInput(testFile);\n/* 808 */ if (normalize) {\n/* 809 */ normalize(test, features);\n/* */ }\n/* */ } \n/* 812 */ RankerTrainer trainer = new RankerTrainer();\n/* 813 */ Ranker ranker = trainer.train(this.type, train, validation, features, this.trainScorer);\n/* */ \n/* 815 */ if (test != null) {\n/* */ \n/* 817 */ double rankScore = evaluate(ranker, test);\n/* 818 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ } \n/* 820 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 822 */ System.out.println(\"\");\n/* 823 */ ranker.save(modelFile);\n/* 824 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "protected abstract void evaluate(Vector target, List<Vector> predictions);", "public abstract double test(ClassifierData<U> testData);", "public void evaluate(String sampleFile, String validationFile, String featureDefFile, double percentTrain) {\n/* 761 */ List<RankList> trainingData = new ArrayList<>();\n/* 762 */ List<RankList> testData = new ArrayList<>();\n/* 763 */ int[] features = prepareSplit(sampleFile, featureDefFile, percentTrain, normalize, trainingData, testData);\n/* 764 */ List<RankList> validation = null;\n/* */ \n/* */ \n/* 767 */ if (!validationFile.isEmpty()) {\n/* */ \n/* 769 */ validation = readInput(validationFile);\n/* 770 */ if (normalize) {\n/* 771 */ normalize(validation, features);\n/* */ }\n/* */ } \n/* 774 */ RankerTrainer trainer = new RankerTrainer();\n/* 775 */ Ranker ranker = trainer.train(this.type, trainingData, validation, features, this.trainScorer);\n/* */ \n/* 777 */ double rankScore = evaluate(ranker, testData);\n/* */ \n/* 779 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* 780 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 782 */ System.out.println(\"\");\n/* 783 */ ranker.save(modelFile);\n/* 784 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "public void test(List<String> modelFiles, String testFile, String prpFile) {\n/* 1014 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 1015 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* 1018 */ int nFold = modelFiles.size();\n/* */ \n/* 1020 */ List<RankList> samples = readInput(testFile);\n/* */ \n/* 1022 */ System.out.print(\"Preparing \" + nFold + \"-fold test data... \");\n/* 1023 */ FeatureManager.prepareCV(samples, nFold, trainingData, testData);\n/* 1024 */ System.out.println(\"[Done.]\");\n/* 1025 */ double rankScore = 0.0D;\n/* 1026 */ List<String> ids = new ArrayList<>();\n/* 1027 */ List<Double> scores = new ArrayList<>();\n/* 1028 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* 1030 */ List<RankList> test = testData.get(f);\n/* 1031 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1032 */ int[] features = ranker.getFeatures();\n/* 1033 */ if (normalize) {\n/* 1034 */ normalize(test, features);\n/* */ }\n/* 1036 */ for (RankList aTest : test) {\n/* 1037 */ RankList l = ranker.rank(aTest);\n/* 1038 */ double score = this.testScorer.score(l);\n/* 1039 */ ids.add(l.getID());\n/* 1040 */ scores.add(Double.valueOf(score));\n/* 1041 */ rankScore += score;\n/* */ } \n/* */ } \n/* 1044 */ rankScore /= ids.size();\n/* 1045 */ ids.add(\"all\");\n/* 1046 */ scores.add(Double.valueOf(rankScore));\n/* 1047 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* 1049 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 1051 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1052 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "@Override\n public int[] test(DataSet test_set) {\n // check\n Example first = test_set.getExample(0);\n if (!(first.get(\"INPUT\").getValue() instanceof Double[])) {\n throw new RuntimeException(\"NeuralNetworkLearner inputs must be passed as a Double[] in the \\\"INPUT\\\" attribute\");\n }\n if (!(first.getOutput() instanceof Double[])) {\n throw new RuntimeException(\"NeuralNetworkLearner output must be set to a Double[]\");\n }\n // test\n int[] results = new int[]{0, 0};\n for (Example e : test_set) {\n System.out.println(Arrays.toString(this.predict(e)));\n System.out.println(Arrays.toString((Double[]) e.getOutput()));\n if (Arrays.equals((Double[]) e.getOutput(), this.predict(e))) {\n results[0]++;\n } else {\n results[1]++;\n }\n }\n // return\n return results;\n }", "public int predict(int[] testData) {\n /*\n * kNN algorithm:\n * \n * This algorithm compare the distance of every training data to the test data using \n * the euclidean distance algorithm, and find a specfic amount of training data \n * that are closest to the test data (the value of k determine that amount). \n * \n * After that, the algorithm compare those data, and determine whether more of those\n * data are labeled with 0, or 1. And use that to give the guess\n * \n * To determine k: sqrt(amount of training data)\n */\n\n /*\n * Problem:\n * Since results and distances will be stored in different arrays, but in the same order,\n * sorting distances will mess up the label, which mess up the predictions\n * \n * Solution:\n * Instead of sorting distances, use a search algorithm, search for the smallest distance, and then\n * the second smallest number, and so on. Get the index of that number, use the index to \n * find the result, and store it in a new ArrayList for evaluation\n */\n\n // Step 1 : Determine k \n double k = Math.sqrt(this.trainingData.size());\n k = 3.0;\n\n // Step 2: Calculate distances\n // Create an ArrayList to hold all the distances calculated\n ArrayList<Double> distances = new ArrayList<Double>();\n // Create another ArrayList to store the results\n ArrayList<Integer> results = new ArrayList<Integer>();\n for (int[] i : this.trainingData) {\n // Create a temp array with the last item (result) eliminated\n int[] temp = Arrays.copyOf(i, i.length - 1);\n double distance = this.eucDistance(temp, testData);\n // Add both the result and the distance into associated arraylists\n results.add(i[i.length - 1]);\n distances.add(distance);\n }\n\n // Step 3: Search for the amount of highest points according to k\n ArrayList<Integer> closestResultLst = new ArrayList<Integer>();\n for (int i = 0; i < k; i++) {\n double smallestDistance = Collections.min(distances);\n int indexOfSmallestDistance = distances.indexOf(smallestDistance);\n int resultOfSmallestDistance = results.get(indexOfSmallestDistance);\n closestResultLst.add(resultOfSmallestDistance);\n // Set the smallest distance to null, so it won't be searched again\n distances.set(indexOfSmallestDistance, 10.0);\n }\n\n // Step 4: Determine which one should be the result by looking at the majority of the numbers\n int yes = 0, no = 0;\n for (int i : closestResultLst) {\n if (i == 1) {\n yes++;\n } else if (i == 0) {\n no++;\n }\n }\n\n // Step 5: Return the result\n // test code\n // System.out.println(yes);\n // System.out.println(no);\n if (yes >= no) {\n return 1;\n } else {\n return 0;\n }\n }", "public static void evaluate(final MLRegression network,\r\n \t\t\tfinal MLDataSet training) {\r\n \t\tint weekNo = ConfigLoto.HI_WEEKNO + 2;\r\n \r\n \t//\tfor (final MLDataPair pair : training) {\r\n \tfor (int i = 0; i < training.size(); i++) {\r\n \t\tfinal MLDataPair pair = training.get(i);\r\n \t\tMLData calculatedOutput = network.compute(pair.getInput());\r\n \t\t\t\r\n \t\t\tlog.debug(\"Predict WeekNo= \" + weekNo++);\r\n \t\t\tlog.debug(\"Input= \"\r\n \t\t\t\t\t+ ConfigLoto.formatData(pair.getInput(), PRECISION));\r\n \t\t\tlog.debug(\"Predict= \" // actual\r\n \t\t\t\t\t+ ConfigLoto.formatData(calculatedOutput, PRECISION + 2));\r\n \t\t\t\r\n \t\t\t// for set12 get the real output from next pair\r\n \t\t\tMLData nextWeekIdeal = null;\r\n \t\t\tif (i < (training.size()-1)){\r\n\t\t\t\t nextWeekIdeal = training.get(i+1).getIdeal();\r\n \t\t\t}\r\n \t\t\telse {\r\n \t\t\t\t nextWeekIdeal = pair.getIdeal();\r\n \t\t\t}\r\n \t\t\tlog.debug(\"RealOutput= \" // ideal\r\n \t\t\t\t\t+ ConfigLoto.formatData(nextWeekIdeal, PRECISION));\r\n \r\n \t\t\tlog.debug(\"Success Report ---------\");\r\n \t\t\tConfigLoto.calculateSuccess(weekNo - 1, calculatedOutput,\r\n \t\t\t\t\tnextWeekIdeal);\r\n \t\t\t\r\n \t\t\tINSERTSAYISALPREDICT = \"INSERT INTO SAYISALPREDICT (`algo`, `targeterr` , `populationsize` , `populationdensity` ,\"\r\n \t\t\t\t\t+ \"`weekid` , `realoutput` , `successfulpredictcount`, `successfulpredict` , `predict`) VALUES (\";\r\n \t\t\tINSERTSAYISALPREDICT = INSERTSAYISALPREDICT\r\n \t\t\t\t\t+ INSERTSAYISALPREDICTPART1 + weekNo + \",\\\"\"\r\n \t\t\t\t\t+ ConfigLoto.formatData(nextWeekIdeal, PRECISION) + \"\\\",\";\r\n \t\t\t\r\n \t\t}\r\n \t}", "@Test\n public void test33() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.correct();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, double0, 0.01D);\n }", "@Test\n public void test36() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.incorrect();\n assertEquals(0.0, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void score(List<String> modelFiles, String testFile, String outputFile) {\n/* 1180 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 1181 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* 1184 */ int nFold = modelFiles.size();\n/* */ \n/* 1186 */ List<RankList> samples = readInput(testFile);\n/* 1187 */ System.out.print(\"Preparing \" + nFold + \"-fold test data... \");\n/* 1188 */ FeatureManager.prepareCV(samples, nFold, trainingData, testData);\n/* 1189 */ System.out.println(\"[Done.]\");\n/* */ try {\n/* 1191 */ BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), \"UTF-8\"));\n/* 1192 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* 1194 */ List<RankList> test = testData.get(f);\n/* 1195 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1196 */ int[] features = ranker.getFeatures();\n/* 1197 */ if (normalize)\n/* 1198 */ normalize(test, features); \n/* 1199 */ for (RankList l : test) {\n/* 1200 */ for (int j = 0; j < l.size(); j++) {\n/* 1201 */ out.write(l.getID() + \"\\t\" + j + \"\\t\" + ranker.eval(l.get(j)) + \"\");\n/* 1202 */ out.newLine();\n/* */ } \n/* */ } \n/* */ } \n/* 1206 */ out.close();\n/* */ }\n/* 1208 */ catch (IOException ex) {\n/* */ \n/* 1210 */ throw RankLibError.create(\"Error in Evaluator::score(): \", ex);\n/* */ } \n/* */ }", "Result evaluate();", "@Test\n public void test23() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n SerializedClassifier serializedClassifier0 = new SerializedClassifier();\n Object[] objectArray0 = new Object[25];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) serializedClassifier0, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "@Test(timeout = 4000)\n public void test108() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.avgCost();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test\n public void test29() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0, (CostMatrix) null);\n double double0 = evaluation0.pctCorrect();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "public void run() throws Exception {\r\n\r\n\r\n LibSVM svm = new LibSVM();\r\n String svmOptions = \"-S 0 -K 2 -C 8 -G 0\"; //Final result: [1, -7 for saveTrainingDataToFileHybridSampling2 ]\r\n svm.setOptions(weka.core.Utils.splitOptions(svmOptions));\r\n System.out.println(\"SVM Type and Keranl Type= \" + svm.getSVMType() + svm.getKernelType());//1,3 best result 81%\r\n // svm.setNormalize(true);\r\n\r\n\r\n// load training data from .arff file\r\n ConverterUtils.DataSource source = new ConverterUtils.DataSource(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSSMOTE464Random.arff\");\r\n System.out.println(\"\\n\\nLoaded data:\\n\\n\" + source.getDataSet());\r\n Instances dataFiltered = source.getDataSet();\r\n dataFiltered.setClassIndex(0);\r\n\r\n // gridSearch(svm, dataFiltered);\r\n Evaluation evaluation = new Evaluation(dataFiltered);\r\n evaluation.crossValidateModel(svm, dataFiltered, 10, new Random(1));\r\n System.out.println(evaluation.toSummaryString());\r\n System.out.println(evaluation.weightedAreaUnderROC());\r\n double[][] confusionMatrix = evaluation.confusionMatrix();\r\n for (int i = 0; i < 2; i++) {\r\n for (int j = 0; j < 2; j++) {\r\n System.out.print(confusionMatrix[i][j] + \" \");\r\n\r\n }\r\n System.out.println();\r\n }\r\n System.out.println(\"accuracy for crime class= \" + (confusionMatrix[0][0] / (confusionMatrix[0][1] + confusionMatrix[0][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for other class= \" + (confusionMatrix[1][1] / (confusionMatrix[1][1] + confusionMatrix[1][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for crime class= \" + evaluation.truePositiveRate(0) + \"%\");\r\n System.out.println(\"accuracy for other class= \" + evaluation.truePositiveRate(1) + \"%\");\r\n\r\n\r\n }", "private void evaluateProbabilities()\n\t{\n\t}", "private void evaluationLogic() {\n // setup for logic:\n // if distToClosestEstimate[i][0] is smaller than threshold, we have a Tp\n // if distToClosestEstimate[i][0] is larger than threshold, we have a Fn\n // all estimatedFeatures that are not assigned Tp are therefore Fp\n for (int i = 0; i < groundTruthInstant.size(); ++i) {\n if (distToClosestEstimate[i][0] < truePositiveThreshold) {\n ++truePositiveCount;\n int assignedEstimatedFeature = (int) distToClosestEstimate[i][1];\n assignedEstimatedFeatures[assignedEstimatedFeature] = true;\n } else\n ++falseNegativeCount;\n }\n for (int i = 0; i < estimatedInstant.size(); ++i)\n if (!assignedEstimatedFeatures[i])\n ++falsePositiveCount;\n }", "public void wekaCalculate()\n\t{\n\t\tfor (int categoryStep = 0; categoryStep < 6; categoryStep++)\n\t\t{\n\t\t\tString trainString = \"Train\";\n\t\t\tString testString = \"Test\";\n\t\t\tString categoryString;\n\t\t\tString resultString = \"Results\";\n\t\t\tString textString;\n\t\t\tString eventString;\n\n\t\t\tswitch (categoryStep)\n\t\t\t{\n\t\t\tcase 0: categoryString = \"Cont.arff\"; break;\n\t\t\tcase 1: categoryString = \"Dona.arff\"; break;\n\t\t\tcase 2: categoryString = \"Offi.arff\"; break;\n\t\t\tcase 3: categoryString = \"Advi.arff\"; break;\n\t\t\tcase 4: categoryString = \"Mult.arff\"; break;\n\t\t\tdefault: categoryString = \"Good.arff\";\n\t\t\t}\n\t\t\t\n\t\t\tswitch (categoryStep)\n\t\t\t{\n\t\t\tcase 0: textString = \"Cont.txt\"; break;\n\t\t\tcase 1: textString = \"Dona.txt\"; break;\n\t\t\tcase 2: textString = \"Offi.txt\"; break;\n\t\t\tcase 3: textString = \"Advi.txt\"; break;\n\t\t\tcase 4: textString = \"Mult.txt\"; break;\n\t\t\tdefault: textString = \"Good.txt\";\n\t\t\t}\n\t\t\t\n\t\t\tfor (int eventStep = 0; eventStep < 15; eventStep++)\n\t\t\t{\n\t\t\t\tString trainingData;\n\t\t\t\tString testData;\n\t\t\t\tString resultText;\n\n\t\t\t\tswitch (eventStep)\n\t\t\t\t{\n\t\t\t\tcase 0: eventString = \"2011Joplin\"; break;\n\t\t\t\tcase 1: eventString = \"2012Guatemala\"; break; \n\t\t\t\tcase 2: eventString = \"2012Italy\"; break;\n\t\t\t\tcase 3: eventString = \"2012Philipinne\"; break;\n\t\t\t\tcase 4: eventString = \"2013Alberta\";\tbreak;\n\t\t\t\tcase 5: eventString = \"2013Australia\"; break;\n\t\t\t\tcase 6: eventString = \"2013Boston\"; break;\t\t\t\t\n\t\t\t\tcase 7: eventString = \"2013Manila\"; break;\n\t\t\t\tcase 8: eventString = \"2013Queens\"; break;\n\t\t\t\tcase 9: eventString = \"2013Yolanda\"; break;\n\t\t\t\tcase 10: eventString = \"2014Chile\"; break;\n\t\t\t\tcase 11: eventString = \"2014Hagupit\"; break;\n\t\t\t\tcase 12: eventString = \"2015Nepal\"; break;\n\t\t\t\tcase 13: eventString = \"2015Paris\"; break;\n\t\t\t\tdefault: eventString = \"2018Florida\"; \t\t\t\t\n\t\t\t\t}\n\n\t\t\t\ttrainingData = eventString;\n\t\t\t\ttrainingData += trainString;\n\t\t\t\ttrainingData += categoryString;\n\n\t\t\t\ttestData = eventString;\n\t\t\t\ttestData += testString;\n\t\t\t\ttestData += categoryString;\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tresultText = eventString;\n\t\t\t\tresultText += resultString;\n\t\t\t\tresultText += textString;\n\t\t\t\t\n\n\t\t\t\ttry {\n\t\t\t\t\tConverterUtils.DataSource loader1 = new ConverterUtils.DataSource(trainingData);\n\t\t\t\t\tConverterUtils.DataSource loader2 = new ConverterUtils.DataSource(testData);\n\n\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(resultText));\n\t\t\t\t\tInstances trainData = loader1.getDataSet();\n\t\t\t\t\ttrainData.setClassIndex(trainData.numAttributes() - 1);\n\n\t\t\t\t\tInstances testingData = loader2.getDataSet();\n\t\t\t\t\ttestingData.setClassIndex(testingData.numAttributes() - 1);\n\n\t\t\t\t\tClassifier cls1 = new NaiveBayes();\t\t\t\t\t\n\t\t\t\t\tcls1.buildClassifier(trainData);\t\t\t\n\t\t\t\t\tEvaluation eval1 = new Evaluation(trainData);\n\t\t\t\t\teval1.evaluateModel(cls1, testingData);\t\n\t\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\t\t\t\t\tbw.write(eval1.toSummaryString());\n\t\t\t\t\tbw.write(eval1.toClassDetailsString());\n\t\t\t\t\tbw.write(eval1.toMatrixString());\n\t\t\t\t\tbw.write(\"\\n\");\n\n\t\t\t\t\tthis.evalNaiveBayesList.add(eval1);\n\n\t\t\t\t\tClassifier cls2 = new SMO();\n\t\t\t\t\tcls2.buildClassifier(trainData);\n\t\t\t\t\tEvaluation eval2 = new Evaluation(trainData);\n\t\t\t\t\teval2.evaluateModel(cls2, testingData);\n\t\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\t\t\t\t\tbw.write(eval2.toSummaryString());\n\t\t\t\t\tbw.write(eval2.toClassDetailsString());\n\t\t\t\t\tbw.write(eval2.toMatrixString());\n\n\t\t\t\t\tthis.evalSMOList.add(eval2);\n\n\t\t\t\t\tbw.close();\n\t\t\t\t} catch (Exception e) {\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void test(String testFile) {\n/* 935 */ List<RankList> test = readInput(testFile);\n/* 936 */ double rankScore = evaluate(null, test);\n/* 937 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ }", "public Map<String, Double> predictAndEvaluate(NodeVecs nodeVecs) {\n int topK = Integer.parseInt(prop.getProperty(\"prediction.numwanted\", \"1\"));\n\n List<Query> testQueries = queryNodes.buildQueries();\n\n int numQueries = testQueries.size();\n float sim = 0;\n int nQueriesEvaluated = 0;\n \n Map<String, int[]> counter = new HashMap<>();\n List<PredictionTuple> rtuples = new ArrayList<>();\n \n for (int qid=0; qid < numQueries; qid++) {\n Query testQuery = testQueries.get(qid);\n \n System.out.println(\"Test Query: \" + testQuery);\n\n AndQuery testAndQuery = (AndQuery)testQueries.get(qid);\n\n if (Boolean.parseBoolean(prop.getProperty(\"prediction.flattenquery\"))) {\n // first flatten the query\n testAndQuery = AndQuery.flatten(testAndQuery);\n }\n // filter the target of the query\n testAndQuery = testAndQuery.withFilter(avp ->\n avp.getAttribute().getId().equals(predictedOutcomeValueAttributeId) // make sure we target the correct outcome value\n && avp.getNumericValue() != null // we don't care about non-numerical OV\n && avp.getNumericValue() <= 100.0); // remove noisy values outside of 0-100%\n //testAndQuery = new AndQuerySimple(testAndQuery);\n System.out.println(\"Test Query: \" + testAndQuery);\n // run the query\n List<SearchResult> results = getResults(testAndQuery, nodeVecs, topK);\n\n //testQuery = testQuery.filteredWith(result -> result.node.getAttribute().getType() == wantedType()); // set the filter\n \n Map<String, List<SearchResult>> groupedResults = groupByAttribs(results); \n groupedResults = collapseToWtAvg(groupedResults);\n\n for (List<SearchResult> perAttribList: groupedResults.values()) {\n System.out.println(resTuple(perAttribList));\n for (SearchResult sr : perAttribList) {\n String stStr = sr.toString();\n int[] count = counter.get(stStr);\n if (count == null) {\n count = new int[1];\n counter.put(stStr, count);\n }\n count[0]++;\n }\n \n // float this_sim = evaluationLogic.evaluate(qid, perAttribList);\n PredictionTuple rtuple = evaluationLogic.evaluate(qid, perAttribList.get(0));\n if (!rtuple.valid()) {\n LOGGER.warn(\"Reference or prediction is not valid (less than 0): {} -- {}\", rtuple.getRef(), rtuple.getPred());\n continue;\n }\n System.out.println(\"Reference:\\t\" + rtuple.getRef() + \"\\tPrediction\\t\" + rtuple.getPred());\n\n rtuples.add(rtuple);\n //sim += this_sim;\n }\n nQueriesEvaluated++;\n }\n \n /*\n if (nQueriesEvaluated > 0)\n System.out.println(\"Mean-average \" + evaluationLogic.getMetricName() + \": \" + Math.sqrt(sim/(float)nQueriesEvaluated));\n */\n try { \n // Print out the result tuples in a file\n FileWriter fw = new FileWriter(\"res.tsv\");\n BufferedWriter bw = new BufferedWriter(fw);\n \n for (PredictionTuple rt: rtuples) {\n bw.write(rt.getRef() + \"\\t\" + rt.getPred());\n bw.newLine();\n }\n bw.close();\n fw.close();\n }\n catch (IOException ex) {\n ex.printStackTrace();\n }\n \n \n Map<String, Double> res = new HashMap<>();\n for (EvaluationMetric metric : evaluationMetrics) {\n String metricName = metric.toString();\n double evaluationResult = metric.compute(rtuples);\n System.out.println(metricName + \": \" + evaluationResult);\n res.put(metricName, evaluationResult);\n }\n \n /*\n // print distribution of all results\n for (Entry<String, int[]> entry : counter.entrySet()) {\n System.out.println(entry.getKey() + \"\\t\" + entry.getValue()[0]);\n }\n */\n\n return res;\n }", "public abstract double evaluateFitness();", "@Test\n public void test22() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n FastVector fastVector0 = evaluation0.predictions();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01D);\n }", "private static String test(double[][] test_data) {\n\n\t\t// Holds score for each word\n\t\tHashMap<Integer, Integer> scores = new HashMap<Integer, Integer>();\n\n\t\t// Euclidean distances hashamp for <Word, Distances> for each row\n\t\t// HashMap<String, double[]> distances = new HashMap<String,\n\t\t// double[]>();\n\t\tdouble[][] distances = new double[training_data.size()][test_data[0].length];\n\n\t\t// Just class names\n\t\tString[] classnames = training_data.keySet().toArray(new String[1]);\n\t\t// names = classnames;\n\t\t// System.out.println(Arrays.toString(classnames));\n\n\t\t// Initialize scores for each word to be 0\n\t\tfor (int i = 0; i < classnames.length; i++) {\n\t\t\tscores.put(i, 0);\n\t\t}\n\n\t\t// Convert MxN test data matrix to NxM for ease of use\n\t\ttest_data = Data.rotate(test_data);\n\n\t\t// Calculate scores for each row and populate the distances matrix\n\t\tfor (int i = 0; i < test_data.length; i++) {\n\t\t\tdouble min = Double.MAX_VALUE;\n\t\t\tint min_index = 0;\n\t\t\tint c = 0;\n\t\t\tfor (String name : training_data.keySet()) {\n\t\t\t\tdouble[][] train = training_data.get(name);\n\t\t\t\ttrain = Data.rotate(train);\n\t\t\t\t// System.out.println(\"Testing \" + name);\n\t\t\t\t// System.out.println(\"Calculating euc distance between: \" +\n\t\t\t\t// Arrays.toString(test_data[i]));\n\t\t\t\t// System.out.println(\" and: \" +\n\t\t\t\t// Arrays.toString(train[i]));\n\t\t\t\tdistances[c][i] = Data.calcEuclideanDistance(test_data[i],\n\t\t\t\t\t\ttrain[i]);\n\t\t\t\t// System.out.println(\"Distance: \" + distances[c][i]);\n\t\t\t\t// new Scanner(System.in).nextLine();\n\t\t\t\tif (min > distances[c][i]) {\n\t\t\t\t\tmin = distances[c][i];\n\t\t\t\t\tmin_index = c;\n\t\t\t\t}\n\t\t\t\tc++;\n\t\t\t}\n\t\t\t// System.out.print(\"\\n\"+classnames[min_index] + \" won with \" +\n\t\t\t// min);\n\t\t\tscores.put(min_index, scores.get(min_index) + 1);\n\t\t}\n\n\t\t// for (int i =0; i < distances.length; i++) {\n\t\t// for (int j = 0; j < distances[0].length; j++) {\n\t\t// System.out.print(distances[i][j] + \" \");\n\t\t// }\n\t\t// System.out.print(\"\\n\");\n\t\t// }\n\n\t\t// Word with the highest score wins\n\t\tdouble max = Double.MIN_VALUE;\n\t\tint index = 0;\n\t\tfor (Integer i : scores.keySet()) {\n\t\t\t// System.out.print(scores.get(i) + \",\");\n\t\t\tif (max < scores.get(i)) {\n\t\t\t\tmax = scores.get(i);\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\tconfusion_matrix.add(scores);\n\t\treturn classnames[index];\n\t}", "public void evaluate ( String predictionFileName ) \n\t\t\t\tthrows IOException\t\n\t{\n\t\tdouble MAE = 0.0, RMSE = 0.0;\n\t\tint countRatings = 0, countTotal = 0;\n\t\t\t\t\n\t\tBufferedWriter wr = new BufferedWriter(new FileWriter(predictionFileName));\n\t\tfor (Integer user : dao.getTestUsers())\t{\n\t\t\tfor (Integer item : dao.getTestItems(user))\t{\n\t\t\t\tcountTotal++;\n\t\t\t\tdouble P = predict(user, item);\n\t\t\t\t// A prediction of -INF is used to indicate that the prediction cannot be made\n\t\t\t\tif (P == Double.NEGATIVE_INFINITY)\n\t\t\t\t\tcontinue;\n\t\t\t\tcountRatings++;\n\t\t\t\tdouble R = dao.getTestRating(user, item);\n\t\t\t\tdouble tmp = P - R;\n\t\t\t\tMAE += Math.abs(tmp);\n\t\t\t\tRMSE += tmp * tmp;\n\t\t\t\twr.write(String.format(\"%d %d %f %f\\n\", user, item, R, P));\n\t\t\t}\n\t\t}\n\t\twr.flush();\n\t\twr.close();\n\n\t\tSystem.out.println(\"Recommender evaluation on test data...\");\n\t\tif (countRatings == 0)\n\t\t\tSystem.out.println(\"Coverage : 0%\");\n\t\telse {\n\t\t\tMAE /= countRatings;\n\t\t\tRMSE = Math.sqrt(RMSE / countRatings);\n\t\t\tSystem.out.printf(\"Coverage %f%%\\n\", (countRatings * 100.0) / countTotal);\n\t\t\tSystem.out.printf(\"MAE : %f\\n\", MAE);\n\t\t\tSystem.out.printf(\"RMSE : %f\\n\", RMSE);\n\t\t}\t\t\n\t}", "private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }", "@Test(timeout = 4000)\n public void test093() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[2];\n evaluation0.evaluateModel((Classifier) null, instances0, objectArray0);\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n }", "public abstract void fit(BinaryData trainingData);", "public static void runIndividual(String algorithmCode, String[] parameters) {\r\n\t\tSystem.out.println(RankEvaluator.printTitle() + \"\\tAvgP\\tTrain Time\\tTest Time\");\r\n\t\t\r\n\t\t// Prefetching user/item similarity:\r\n\t\tif (userSimilarityPrefetch) {\r\n\t\t\tuserSimilarity = calculateUserSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tuserSimilarity = new SparseMatrix(userCount+1, userCount+1);\r\n\t\t}\r\n\t\t\r\n\t\tif (itemSimilarityPrefetch) {\r\n\t\t\titemSimilarity = calculateItemSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\titemSimilarity = new SparseMatrix(itemCount+1, itemCount+1);\r\n\t\t}\r\n\t\t\r\n\t\t// Loss code\r\n\t\tint lossCode = -1;\r\n\t\tif (parameters[0].equals(\"log_mult\")) lossCode = RankEvaluator.LOG_LOSS_MULT;\r\n\t\telse if (parameters[0].equals(\"log_add\")) lossCode = RankEvaluator.LOG_LOSS_ADD;\r\n\t\telse if (parameters[0].equals(\"exp_mult\")) lossCode = RankEvaluator.EXP_LOSS_MULT;\r\n\t\telse if (parameters[0].equals(\"exp_add\")) lossCode = RankEvaluator.EXP_LOSS_ADD;\r\n\t\telse if (parameters[0].equals(\"hinge_mult\")) lossCode = RankEvaluator.HINGE_LOSS_MULT;\r\n\t\telse if (parameters[0].equals(\"hinge_add\")) lossCode = RankEvaluator.HINGE_LOSS_ADD;\r\n\t\telse if (parameters[0].equals(\"abs\")) lossCode = RankEvaluator.ABSOLUTE_LOSS;\r\n\t\telse if (parameters[0].equals(\"sqr\")) lossCode = RankEvaluator.SQUARED_LOSS;\r\n\t\telse if (parameters[0].equals(\"expreg\")) lossCode = RankEvaluator.EXP_REGRESSION;\r\n\t\telse if (parameters[0].equals(\"l1reg\")) lossCode = RankEvaluator.SMOOTH_L1_REGRESSION;\r\n\t\telse if (parameters[0].equals(\"logistic\")) lossCode = RankEvaluator.LOGISTIC_LOSS;\r\n\t\telse lossCode = RankEvaluator.LOG_LOSS_MULT; // default\r\n\t\t\r\n\t\tif (algorithmCode.toLowerCase().equals(\"pgllorma\")) {\r\n\t\t\t// Run the baseline for calculating user/item similarity\r\n\t\t\tdouble learningRate = 0.005;\r\n\t\t\tdouble regularizer = 0.1;\r\n\t\t\tint maxIter = 100;\r\n\t\t\tbaseline = new RegularizedSVD(userCount, itemCount, maxValue, minValue,\t10, learningRate, regularizer, 0, maxIter, false);\r\n\t\t\tSystem.out.println(\"SVD\\tFro\\t10\\t\" + testRecommender(\"SVD\", baseline));\r\n\t\t\t\r\n\t\t\trunPairedGlobalLLORMA(lossCode, Integer.parseInt(parameters[1]), Integer.parseInt(parameters[2]), Double.parseDouble(parameters[3]), true);\r\n\t\t}\r\n\t\telse if (algorithmCode.toLowerCase().equals(\"ranksvd\")) {\r\n\t\t\trunRankBasedSVD(lossCode, Integer.parseInt(parameters[1]), Double.parseDouble(parameters[2]), true);\r\n\t\t}\r\n\t}", "public void doValidation(int currentRound)\n {\n getData(currentRound);\n// System.out.println(\"training unterminated ones\");\n kMeans.setItems(trainingData.get(0));\n kMeans.k=k1;\n kMeans.init();\n List<Cluster> unterminatedClusters=kMeans.doCluster();\n for (int i=0;i<unterminatedClusters.size();i++)\n {\n unterminatedClusters.get(i).label=0;\n }\n \n// System.out.println(\"training terminated ones\");\n kMeans.setItems(trainingData.get(1));\n kMeans.k=k2;\n kMeans.init();\n List<Cluster> terminatedClusters=kMeans.doCluster();\n for (int i=0;i<terminatedClusters.size();i++)\n {\n terminatedClusters.get(i).label=1;\n }\n \n List<Cluster> clusters=new ArrayList<Cluster>();\n clusters.addAll(unterminatedClusters);\n clusters.addAll(terminatedClusters);\n kMeans.setClusters(clusters);\n int[] corrects=new int[2];\n int[] counts=new int[2];\n for (int i=0;i<2;i++)\n {\n corrects[i]=0;\n counts[i]=0;\n }\n for (Item item:testData)\n {\n int label=kMeans.getNearestCluster(item).label;\n counts[label]++;\n if (label==item.type)\n {\n corrects[item.type]++;\n }\n }\n correctness+=corrects[1]*1.0/counts[1];\n correctCount+=corrects[1];\n// for (int i=0;i<2;i++)\n// System.out.println(\"for type \"+i+\": \" +corrects[i]+\" correct out of \"+counts[i]+\" in total (\"+corrects[i]*1.0/counts[i]+\")\");\n }", "@Test(timeout = 4000)\n public void test077() throws Throwable {\n String[] stringArray0 = new String[2];\n stringArray0[1] = \"\";\n Evaluation.main(stringArray0);\n NaiveBayesMultinomial naiveBayesMultinomial0 = new NaiveBayesMultinomial();\n try { \n Evaluation.evaluateModel((Classifier) naiveBayesMultinomial0, stringArray0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // \n // Weka exception: No training file and no object input file given.\n // \n // General options:\n // \n // -h or -help\n // \\tOutput help information.\n // -synopsis or -info\n // \\tOutput synopsis for classifier (use in conjunction with -h)\n // -t <name of training file>\n // \\tSets training file.\n // -T <name of test file>\n // \\tSets test file. If missing, a cross-validation will be performed\n // \\ton the training data.\n // -c <class index>\n // \\tSets index of class attribute (default: last).\n // -x <number of folds>\n // \\tSets number of folds for cross-validation (default: 10).\n // -no-cv\n // \\tDo not perform any cross validation.\n // -split-percentage <percentage>\n // \\tSets the percentage for the train/test set split, e.g., 66.\n // -preserve-order\n // \\tPreserves the order in the percentage split.\n // -s <random number seed>\n // \\tSets random number seed for cross-validation or percentage split\n // \\t(default: 1).\n // -m <name of file with cost matrix>\n // \\tSets file with cost matrix.\n // -l <name of input file>\n // \\tSets model input file. In case the filename ends with '.xml',\n // \\ta PMML file is loaded or, if that fails, options are loaded\n // \\tfrom the XML file.\n // -d <name of output file>\n // \\tSets model output file. In case the filename ends with '.xml',\n // \\tonly the options are saved to the XML file, not the model.\n // -v\n // \\tOutputs no statistics for training data.\n // -o\n // \\tOutputs statistics only, not the classifier.\n // -i\n // \\tOutputs detailed information-retrieval statistics for each class.\n // -k\n // \\tOutputs information-theoretic statistics.\n // -classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\n // \\tUses the specified class for generating the classification output.\n // \\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\n // -p range\n // \\tOutputs predictions for test instances (or the train instances if\n // \\tno test instances provided and -no-cv is used), along with the \n // \\tattributes in the specified range (and nothing else). \n // \\tUse '-p 0' if no attributes are desired.\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -distribution\n // \\tOutputs the distribution instead of only the prediction\n // \\tin conjunction with the '-p' option (only nominal classes).\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -r\n // \\tOnly outputs cumulative margin distribution.\n // -xml filename | xml-string\n // \\tRetrieves the options from the XML-data instead of the command line.\n // -threshold-file <file>\n // \\tThe file to save the threshold data to.\n // \\tThe format is determined by the extensions, e.g., '.arff' for ARFF \n // \\tformat or '.csv' for CSV.\n // -threshold-label <label>\n // \\tThe class label to determine the threshold data for\n // \\t(default is the first label)\n // \n // Options specific to weka.classifiers.bayes.NaiveBayesMultinomial:\n // \n // -D\n // \\tIf set, classifier is run in debug mode and\n // \\tmay output additional info to the console\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "public double getBestSolutionEvaluation();", "public void test(Corpus testData) {\n\t\t// cross validation\n\t\ttestBigramWithNB(testData);\n\t\ttestUnigramWithNB(testData);\n\t}", "public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }", "private static void runAll() throws InterruptedException {\r\n\t\tSystem.out.println(RankEvaluator.printTitle() + \"\\tAvgP\\tTrain Time\\tTest Time\");\r\n\t\t\r\n\t\t// Prefetching user/item similarity:\r\n\t\tif (userSimilarityPrefetch) {\r\n\t\t\tuserSimilarity = calculateUserSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tuserSimilarity = new SparseMatrix(userCount+1, userCount+1);\r\n\t\t}\r\n\t\t\r\n\t\tif (itemSimilarityPrefetch) {\r\n\t\t\titemSimilarity = calculateItemSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\titemSimilarity = new SparseMatrix(itemCount+1, itemCount+1);\r\n\t\t}\r\n\t\t\r\n\t\t// Regularized SVD\r\n\t\tint[] svdRank = {1, 5, 10};\r\n\t\t\r\n\t\tfor (int r : svdRank) {\r\n\t\t\tdouble learningRate = 0.005;\r\n\t\t\tdouble regularizer = 0.1;\r\n\t\t\tint maxIter = 100;\r\n\t\t\t\r\n\t\t\tbaseline = new RegularizedSVD(userCount, itemCount, maxValue, minValue,\r\n\t\t\t\tr, learningRate, regularizer, 0, maxIter, false);\r\n\t\t\tSystem.out.println(\"SVD\\tFro\\t\" + r + \"\\t\" + testRecommender(\"SVD\", baseline));\r\n\t\t}\r\n\t\t\r\n\t\t// Rank-based SVD\r\n\t\tint[] rsvdRank = {1, 5, 10};\r\n\t\tfor (int r : rsvdRank) {\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOGISTIC_LOSS, r, 6000, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_MULT, r, 370, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_ADD, r, 25, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_REGRESSION, r, 40, true);\r\n\t\t}\r\n\t\t\r\n\t\t// Paired Global LLORMA\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 1, 1500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 5, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 10, 900, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 5, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 10, 2000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 1, 450, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 5, 250, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 10, 110, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 5, 400, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 10, 200, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 1, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 5, 13, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 10, 7, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 1, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 5, 25, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 10, 15, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 5, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 10, 300, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 1, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 10, 500, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 1, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 5, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 1, 60, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 5, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 10, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 1, 120, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 5, 80, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 10, 40, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 1, 4500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 5, 3500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 10, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 1, 9000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 5, 7000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 10, 5000, true);\r\n\t}", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[0];\n BinarySparseInstance binarySparseInstance0 = new BinarySparseInstance((-737.608359939284), doubleArray0);\n try { \n evaluation0.evaluationForSingleInstance(doubleArray0, binarySparseInstance0, false);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 0\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "public void test(List<String> modelFiles, List<String> testFiles, String prpFile) {\n/* 1065 */ int nFold = modelFiles.size();\n/* 1066 */ double rankScore = 0.0D;\n/* 1067 */ List<String> ids = new ArrayList<>();\n/* 1068 */ List<Double> scores = new ArrayList<>();\n/* 1069 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* */ \n/* 1072 */ List<RankList> test = readInput(testFiles.get(f));\n/* 1073 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1074 */ int[] features = ranker.getFeatures();\n/* */ \n/* 1076 */ if (normalize) {\n/* 1077 */ normalize(test, features);\n/* */ }\n/* 1079 */ for (RankList aTest : test) {\n/* 1080 */ RankList l = ranker.rank(aTest);\n/* 1081 */ double score = this.testScorer.score(l);\n/* 1082 */ ids.add(l.getID());\n/* 1083 */ scores.add(Double.valueOf(score));\n/* 1084 */ rankScore += score;\n/* */ } \n/* */ } \n/* 1087 */ rankScore /= ids.size();\n/* 1088 */ ids.add(\"all\");\n/* 1089 */ scores.add(Double.valueOf(rankScore));\n/* 1090 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* */ \n/* 1093 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 1095 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1096 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "double[] predictWithContextual(String testUser, OrienteeringEnvironment environment) throws IOException {\n loadData(Paths.get(this.path.toString(), \"userSequencesFile\", this.testSequenceNumber + \".txt\").toString());\r\n loadUserVisitedPOIs(Paths.get(this.path.toString(), \"userAllPOIsFile\", this.testSequenceNumber + \".txt\").toString());\r\n trainWithContextual();\r\n double[] userInt = new double[this.numOfItems];\r\n double z = 0.0;\r\n Integer[] contextPOIs = {environment.start, environment.end};\r\n double[] userContextVector = aggregate(contextPOIs, this.userMatrix[Integer.parseInt(testUser)]);\r\n for (int i = 0; i < this.itemMatrix.length; i++) {\r\n userInt[i] = multiple(userContextVector, this.itemMatrix[i])+this.itemBias[i];\r\n z += Math.exp(userInt[i]);\r\n }\r\n for (int i = 0; i < userInt.length; i++) {\r\n userInt[i] = Math.exp(userInt[i])/z;\r\n }\r\n\r\n\r\n double z2 = 0;\r\n for (int i = 0; i < this.numOfItems; i++) {\r\n if (i != environment.start && i != environment.end){\r\n for (int j = 0; j < this.itemMatrix.length; j++) {\r\n if (i != j && j != environment.start && j != environment.end) {\r\n environment.cooccurrTable[i][j] = multiple(this.itemMatrix[i], this.itemMatrix[j]);\r\n z2 += Math.exp(environment.cooccurrTable[i][j]);\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n for (int i = 0; i < this.numOfItems; i++) {\r\n if(i!=environment.start && i!=environment.end) {\r\n for (int j = 0; j < this.numOfItems; j++) {\r\n if (i != j && j != environment.start && j != environment.end) {\r\n environment.cooccurrTable[i][j] = Math.exp(environment.cooccurrTable[i][j]) / z2;;\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n for (int i = 0; i < userInt.length; i++) {\r\n System.out.print(\"[\"+i+\"] \"+ userInt[i]+\" \");\r\n }\r\n\r\n System.out.println();\r\n return userInt;\r\n\r\n }", "@Test\n public void test21() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.errorRate();\n assertEquals(Double.NaN, double0, 0.01D);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n }", "@Test\n public void testOneUserTrecevalStrategyMultipleRelevance() {\n DataModelIF<Long, Long> test = DataModelFactory.getDefaultModel();\n DataModelIF<Long, Long> predictions = DataModelFactory.getDefaultModel();\n test.addPreference(1L, 2L, 0.0);\n test.addPreference(1L, 3L, 1.0);\n test.addPreference(1L, 4L, 2.0);\n predictions.addPreference(1L, 1L, 3.0);\n predictions.addPreference(1L, 2L, 4.0);\n predictions.addPreference(1L, 3L, 5.0);\n predictions.addPreference(1L, 4L, 1.0);\n\n Precision<Long, Long> precision = new Precision<Long, Long>(predictions, test, 1.0, new int[]{1, 2, 3, 4, 5});\n\n precision.compute();\n\n assertEquals(0.5, precision.getValue(), 0.001);\n assertEquals(1.0, precision.getValueAt(1), 0.001);\n assertEquals(0.5, precision.getValueAt(2), 0.001);\n assertEquals(0.3333, precision.getValueAt(3), 0.001);\n assertEquals(0.5, precision.getValueAt(4), 0.001);\n assertEquals(0.4, precision.getValueAt(5), 0.001);\n\n Map<Long, Double> precisionPerUser = precision.getValuePerUser();\n for (Map.Entry<Long, Double> e : precisionPerUser.entrySet()) {\n long user = e.getKey();\n double value = e.getValue();\n assertEquals(0.5, value, 0.001);\n }\n }", "@Test(timeout = 4000)\n public void test070() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[7];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test103() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0, doubleArray0.length);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test094() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n NaiveBayesMultinomialUpdateable naiveBayesMultinomialUpdateable0 = new NaiveBayesMultinomialUpdateable();\n Evaluation evaluation0 = new Evaluation(instances0);\n Object[] objectArray0 = new Object[0];\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) naiveBayesMultinomialUpdateable0, instances0, objectArray0);\n try { \n evaluation0.evaluateModelOnce(doubleArray0, (Instance) null);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 0\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "@Override\n public void doEvaluation(Individual sample, boolean isTrain) {\n mainEvaluator.doEvaluation(sample, isTrain);\n }", "public void test(String modelFile, String testFile, String prpFile) {\n/* 975 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFile);\n/* 976 */ int[] features = ranker.getFeatures();\n/* 977 */ List<RankList> test = readInput(testFile);\n/* 978 */ if (normalize) {\n/* 979 */ normalize(test, features);\n/* */ }\n/* 981 */ double rankScore = 0.0D;\n/* 982 */ List<String> ids = new ArrayList<>();\n/* 983 */ List<Double> scores = new ArrayList<>();\n/* 984 */ for (RankList aTest : test) {\n/* 985 */ RankList l = ranker.rank(aTest);\n/* 986 */ double score = this.testScorer.score(l);\n/* 987 */ ids.add(l.getID());\n/* 988 */ scores.add(Double.valueOf(score));\n/* 989 */ rankScore += score;\n/* */ } \n/* 991 */ rankScore /= test.size();\n/* 992 */ ids.add(\"all\");\n/* 993 */ scores.add(Double.valueOf(rankScore));\n/* 994 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ \n/* */ \n/* 997 */ if (!prpFile.isEmpty()) {\n/* */ \n/* 999 */ savePerRankListPerformanceFile(ids, scores, prpFile);\n/* 1000 */ System.out.println(\"Per-ranked list performance saved to: \" + prpFile);\n/* */ } \n/* */ }", "@Test\n public void testTrain_RegressionDataSet() {\n System.out.println(\"train\");\n RegressionDataSet trainSet = FixedProblems.getSimpleRegression1(150, new Random(2));\n RegressionDataSet testSet = FixedProblems.getSimpleRegression1(50, new Random(3));\n\n for (boolean modification1 : new boolean[] { true, false })\n for (SupportVectorLearner.CacheMode cacheMode : SupportVectorLearner.CacheMode.values()) {\n PlattSMO smo = new PlattSMO(new RBFKernel(0.5));\n smo.setCacheMode(cacheMode);\n smo.setC(1);\n smo.setEpsilon(0.1);\n smo.setModificationOne(modification1);\n smo.train(trainSet);\n\n double errors = 0;\n for (int i = 0; i < testSet.size(); i++)\n errors += Math.pow(testSet.getTargetValue(i) - smo.regress(testSet.getDataPoint(i)), 2);\n assertTrue(errors / testSet.size() < 1);\n }\n }", "public static void main(String[] args) throws Exception {\n\t\tint i;\r\n\t\tint [][]preci_recall = new int [5][6]; \r\n\r\n\t\tNGRAM ngram = new NGRAM();\r\n\t\t\r\n\t\tfor(i=0; i<5; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println((i+1) + \" th FOLD IS A TEST SET\");\r\n\t\t\t\r\n\t\t\tdouble[][] test_ngram_features = ngram.feature(i,1);\r\n\t\t\tdouble[][] train_ngram_features = ngram.feature(i,0);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"NGRAM FEATURES...OK\");\r\n\t\r\n//\t\t\t\r\n//\t\t\tLIWC liwc = new LIWC();\r\n//\t\t\t\r\n//\t\t\tdouble[][] test_liwc_features = liwc.feature(i,1,test_ngram_features.length);\r\n//\t\t\tdouble[][] train_liwc_features = liwc.feature(i,0,train_ngram_features.length);\r\n//\r\n//\t\t\tSystem.out.println(\"LIWC FEATURES..OK\");\r\n//\t\t\t\r\n//\t\t\tCOMBINE combine = new COMBINE();\r\n//\t\t\tdouble[][] train_features = combine.sum(train_liwc_features,train_ngram_features);\r\n//\t\t\tdouble[][] test_features = combine.sum(test_liwc_features,test_ngram_features);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"COMBINE...OK\");\r\n\t\t\r\n\t\t\tSVMLIGHT svmlight = new SVMLIGHT();\r\n\t\t\tpreci_recall[i]=svmlight.calcc(train_ngram_features, test_ngram_features);\r\n\r\n\t\t}\r\n\t\t\r\n//\t 0 : truthful TP\r\n//\t 1 : truthful TP+FP\r\n//\t 2 : truthful TP+FN\r\n//\t 3 : deceptive TP\r\n//\t 4 : deceptive TP+FP\r\n//\t 5 : deceptive TP+FN\r\n\t\t\r\n\t\tint truthful_TP_sum=0,truthful_TPFP_sum=0,truthful_TPFN_sum=0;\r\n\t\tint deceptive_TP_sum=0,deceptive_TPFP_sum=0,deceptive_TPFN_sum=0;\r\n\t\t\r\n\t\tfor(i=0;i<5;i++) {\r\n\t\t\ttruthful_TP_sum+=preci_recall[i][0];\r\n\t\t\ttruthful_TPFP_sum+=preci_recall[i][1];\r\n\t\t\ttruthful_TPFN_sum+=preci_recall[i][2];\r\n\t\t\t\r\n\t\t\tdeceptive_TP_sum+=preci_recall[i][3];\r\n\t\t\tdeceptive_TPFP_sum+=preci_recall[i][4];\r\n\t\t\tdeceptive_TPFN_sum+=preci_recall[i][5];\r\n\t\t}\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"\\n\\nTRUTHFUL_TP_SUM : \" + truthful_TP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFP_SUM : \" + truthful_TPFP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFN_SUM : \" + truthful_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE_TP_SUM : \" + deceptive_TP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFP_SUM : \" + deceptive_TPFP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFN_SUM : \" + deceptive_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nTRUTHFUL PRECISION : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFP_sum));\r\n\t\tSystem.out.println(\"TRUTHFUL RECALL : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFN_sum));\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE PRECISION : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFP_sum));\r\n\t\tSystem.out.println(\"DECEPTIVE RECALL : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFN_sum));\r\n\t\t\r\n\r\n\t}", "@Test\n public void test38() throws Throwable {\n String[] stringArray0 = new String[9];\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n Capabilities capabilities0 = costSensitiveClassifier0.getCapabilities();\n TestInstances testInstances0 = TestInstances.forCapabilities(capabilities0);\n Instances instances0 = testInstances0.generate(\"um.#R$qWe&4`>*V\");\n Evaluation evaluation0 = new Evaluation(instances0);\n try {\n double[] doubleArray0 = evaluation0.evaluateModel((Classifier) costSensitiveClassifier0, instances0, (Object[]) stringArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 1\n //\n }\n }", "@Test\n public void test40() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n String string0 = evaluation0.toSummaryString();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(0.0, evaluation0.unclassified(), 0.01D);\n }", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.totalCost();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public static void main(String[] args) throws Exception {\n DataSet houseVotes = DataParser.parseData(HouseVotes.filename, HouseVotes.columnNames, HouseVotes.dataTypes, HouseVotes.ignoreColumns, HouseVotes.classColumn, HouseVotes.discretizeColumns);\n DataSet breastCancer = DataParser.parseData(BreastCancer.filename, BreastCancer.columnNames, BreastCancer.dataTypes, BreastCancer.ignoreColumns, BreastCancer.classColumn, HouseVotes.discretizeColumns);\n DataSet glass = DataParser.parseData(Glass.filename, Glass.columnNames, Glass.dataTypes, Glass.ignoreColumns, Glass.classColumn, Glass.discretizeColumns);\n DataSet iris = DataParser.parseData(Iris.filename, Iris.columnNames, Iris.dataTypes, Iris.ignoreColumns, Iris.classColumn, Iris.discretizeColumns);\n DataSet soybean = DataParser.parseData(Soybean.filename, Soybean.columnNames, Soybean.dataTypes, Soybean.ignoreColumns, Soybean.classColumn, Soybean.discretizeColumns);\n \n /*\n * The contents of the DataSet are not always random.\n * You can shuffle them using Collections.shuffle()\n */\n \n Collections.shuffle(houseVotes);\n Collections.shuffle(breastCancer);\n Collections.shuffle(glass);\n Collections.shuffle(iris);\n Collections.shuffle(soybean);\n /*\n * Lastly, you want to split the data into a regular dataset and a testing set.\n * DataSet has a function for this, since it gets a little weird.\n * This grabs 10% of the data in the dataset and sets pulls it out to make the testing set.\n * This also means that the remaining 90% in DataSet can serve as our training set.\n */\n\n DataSet houseVotesTestingSet = houseVotes.getTestingSet(.1);\n DataSet breastCancerTestingSet = breastCancer.getTestingSet(.1);\n DataSet glassTestingSet = glass.getTestingSet(.1);\n DataSet irisTestingSet = iris.getTestingSet(.1);\n DataSet soybeanTestingSet = soybean.getTestingSet(.1);\n \n //KNN\n //House Votes\n System.out.println(HouseVotes.class.getSimpleName());\n KNN knn = new KNN(houseVotes, houseVotesTestingSet, HouseVotes.classColumn, 3);\n String[] knnHouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n knnHouseVotes[i] = knn.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(knnHouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnHouseVotes[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnHouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n \n //Breast Cancer\n System.out.println(BreastCancer.class.getSimpleName());\n knn = new KNN(breastCancer, breastCancerTestingSet, BreastCancer.classColumn, 3);\n String[] knnBreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n knnBreastCancer[i] = knn.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(knnBreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnBreastCancer[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnBreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n \n //Glass\n System.out.println(Glass.class.getSimpleName());\n knn = new KNN(glass, glassTestingSet, Glass.classColumn, 3);\n String[] knnGlass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n knnGlass[i] = knn.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(knnGlass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnGlass[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnGlass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n \n //Iris\n System.out.println(Iris.class.getSimpleName());\n knn = new KNN(iris, irisTestingSet, Iris.classColumn, 3);\n String[] knnIris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n knnIris[i] = knn.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(knnIris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnIris[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnIris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n \n //Soybean\n System.out.println(Soybean.class.getSimpleName());\n knn = new KNN(soybean, soybeanTestingSet, Soybean.classColumn, 3);\n String[] knnSoybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n knnSoybean[i] = knn.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(knnSoybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnSoybean[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnSoybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n \n \n /*\n * Lets setup ID3:\n * DataSet, TestSet, column with the class categorization. (republican, democrat in this case)\n */\n\n System.out.println(HouseVotes.class.getSimpleName());\n ID3 id3 = new ID3(houseVotes, houseVotesTestingSet, HouseVotes.classColumn);\n String[] id3HouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n id3HouseVotes[i] = id3.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(id3HouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3HouseVotes[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3HouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n\n System.out.println(BreastCancer.class.getSimpleName());\n id3 = new ID3(breastCancer, breastCancerTestingSet, BreastCancer.classColumn);\n String[] id3BreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n id3BreastCancer[i] = id3.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(id3BreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3BreastCancer[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3BreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Glass.class.getSimpleName());\n id3 = new ID3(glass, glassTestingSet, Glass.classColumn);\n String[] id3Glass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n id3Glass[i] = id3.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(id3Glass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Glass[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Glass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Iris.class.getSimpleName());\n id3 = new ID3(iris, irisTestingSet, Iris.classColumn);\n String[] id3Iris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n id3Iris[i] = id3.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(id3Iris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Iris[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Iris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Soybean.class.getSimpleName());\n id3 = new ID3(soybean, soybeanTestingSet, Soybean.classColumn);\n String[] id3Soybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n id3Soybean[i] = id3.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(id3Soybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Soybean[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Soybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n }", "public void trainBernoulli() {\t\t\n\t\tMap<String, Cluster> trainingDataSet = readFile(trainLabelPath, trainDataPath, \"training\");\n\t\tMap<String, Cluster> testingDataSet = readFile(testLabelPath, testDataPath, \"testing\");\n\n\t\t// do testing, if the predicted class and the gold class is not equal, increment one\n\t\tdouble error = 0;\n\n\t\tdouble documentSize = 0;\n\n\t\tSystem.out.println(\"evaluate the performance\");\n\t\tfor (int testKey = 1; testKey <= 20; testKey++) {\n\t\t\tCluster testingCluster = testingDataSet.get(Integer.toString(testKey));\n\t\t\tSystem.out.println(\"Cluster: \"+testingCluster.toString());\n\n\t\t\tfor (Document document : testingCluster.getDocuments()) {\n\t\t\t\tdocumentSize += 1; \n\t\t\t\tList<Double> classprobability = new ArrayList<Double>();\n\t\t\t\tMap<String, Integer> testDocumentWordCounts = document.getWordCount();\n\n\t\t\t\tfor (int classindex = 1; classindex <= 20; classindex++) {\n\t\t\t\t\t// used for calculating the probability\n\t\t\t\t\tCluster trainCluster = trainingDataSet.get(Integer.toString(classindex));\n\t\t\t\t\t// System.out.println(classindex + \" \" + trainCluster.mClassId);\n\t\t\t\t\tMap<String, Double> bernoulliProbability = trainCluster.bernoulliProbabilities;\n\t\t\t\t\tdouble probability = Math.log(trainCluster.getDocumentSize()/trainDocSize);\n\t\t\t\t\tfor(int index = 1; index <= voc.size(); index++ ){\n\n\t\t\t\t\t\t// judge whether this word is stop word \n\t\t\t\t\t\tboolean isStopwords = englishStopPosition.contains(index);\n\t\t\t\t\t\tif (isStopwords) continue;\n\n\t\t\t\t\t\tboolean contain = testDocumentWordCounts.containsKey(Integer.toString(index));\t\t\t\t\t\t\n\t\t\t\t\t\tif (contain) {\n\t\t\t\t\t\t\tprobability += Math.log(bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprobability += Math.log(1 - bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// put the probability into the map for the specific class\n\t\t\t\t\tclassprobability.add(probability);\n\t\t\t\t}\n\t\t\t\tObject obj = Collections.max(classprobability);\n\t\t\t\t// System.out.println(classprobability);\n\t\t\t\tString predicte_class1 = obj.toString();\n\t\t\t\t// System.out.println(predicte_class1);\n\t\t\t\t// System.out.println(Double.parseDouble(predicte_class1));\n\t\t\t\tint index = classprobability.indexOf(Double.parseDouble(predicte_class1));\n\t\t\t\t// System.out.println(index);\n\t\t\t\tString predicte_class = Integer.toString(index + 1);\n\n\n\t\t\t\tconfusion_matrix[testKey - 1][index] += 1;\n\n\t\t\t\t// System.out.println(document.docId + \": G, \" + testKey + \"; P: \" + predicte_class);\n\t\t\t\tif (!predicte_class.equals(Integer.toString(testKey))) {\n\t\t\t\t\terror += 1;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize);\n\t\t}\n\n\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize + \" precision rate : \" + (1 - error/documentSize));\n\n\t\t// print confusion matrix\n\t\tprintConfusionMatrix(confusion_matrix);\n\t}", "public static void main(String[] args)\n\t{\n\t\talg.ub.predictor.Predictor predictorUB = new alg.ub.predictor.Resnick();\n\t\talg.ub.neighbourhood.Neighbourhood neighbourhoodUB = new ThresholdNeighbourhood(20,0);\n\t\tSimilarityMetric metricUB = new HybridSim(0.4,0.5,0.1);\n\t\t\n\t\t// configure the Item-based CF algorithm - set the predictor, neighbourhood and similarity metric ...\n\t\tPredictor predictorIB = new Resnick();\n\t\tNeighbourhood neighbourhoodIB = new kNearestNeighbourhood(20);\n\t\tSimilarityMetric metricIB = new HybridSim(0.8,0.3,0.1);\n\n\t\t\n\t\t// set the paths and filenames of the item file, train file and test file ...\n\t\tString itemFile = \"ML dataset\" + File.separator + \"u.item\";\n\t\tString trainFile = \"ML dataset\" + File.separator + \"u.train\";\n\t\tString testFile = \"ML dataset\" + File.separator + \"u.test\";\n\t\t\n\t\t// set the path and filename of the output file ...\n\t\tString outputFile = \"results\" + File.separator + \"predictions.txt\";\n\t\t\n\t\t/////////////////////////////////////////////////////////////////////////////////\n\t\t// Evaluates the CF algorithm:\n\t\t// - the RMSE (if actual ratings are available) and coverage are output to screen\n\t\t// - the output file is created\n\t\tDatasetReader reader = new DatasetReader(itemFile, trainFile, testFile);\n\t\t\n\t\tCFAlgorithm hbcf = new HybirdBasedCF(predictorIB, predictorUB, neighbourhoodIB, neighbourhoodUB, metricIB, metricUB, reader);\n\t\tEvaluator eval = new Evaluator(hbcf, reader.getTestData());\n\t\teval.writeResults(outputFile);\n\t\t\n\t\tDouble RMSE = eval.getRMSE();\n\t\tif(RMSE != null) System.out.println(\"RMSE: \" + RMSE);\n\t\t\n\t\tfor(int i = 1; i <= 5; i++)\n\t\t{\n\t\t\tRMSE = eval.getRMSE(i);\n\t\t\tif(RMSE != null) System.out.println(\"RMSE (true rating = \" + i + \"): \" + RMSE);\n\t\t}\n\t\t\n\t\tdouble coverage = eval.getCoverage();\n\t\tSystem.out.println(\"coverage: \" + coverage + \"%\");\n\t}", "public static void main(String[] args){\n //Variables\n Scanner scnr = new Scanner(System.in);\n //Custom test case\n if(scnr.hasNext()){\n String testInput = \"\";\n while(scnr.hasNext()){\n testInput = scnr.nextLine();\n System.out.println(testInput + \" : \" + evaluate(testInput));\n }\n }\n //Default test case\n else{\n String [] sampletests = {\"(1+(2*3))\", \"(2*(4*(6/3)))\",\"(3+(4*2))\"};\n double [] sampleoutput = {7.0, 16.0, 11.0};\n for(int i = 0; i < sampletests.length; i++){\n if(evaluate(sampletests[i]) != sampleoutput[i]){\n System.out.println(\"Failed sample tests\");\n return;\n }\n }\n System.out.println(\"Passed sample tests\");\n }\n }", "public int predict(int[] testingData) {\n\t\t// HIDDEN LAYER\n\t\tdouble[] hiddenActivations = new double[SIZE_HIDDEN_LAYER];\n\t\t\n\t\tfor(int indexHidden = 0; indexHidden < SIZE_HIDDEN_LAYER; indexHidden++) {\n\t\t\thiddenActivations[indexHidden] = 0;\n\t\t\tfor(int indexInput = 0; indexInput < SIZE_INPUT_LAYER; indexInput++) {\n\t\t\t\thiddenActivations[indexHidden] += weightsOfHiddenLayer[indexHidden][indexInput] * testingData[indexInput];\n\t\t\t}\t\n\t\t\thiddenActivations[indexHidden] += biasOfHiddenLayer[indexHidden];\n\t\t\thiddenActivations[indexHidden] = tanh(hiddenActivations[indexHidden]);\n\t\t}\n\t\t// OUTPUT LAYER \n\t\tdouble[] predictedLabel = new double[testingData.length];\n\n\t\tfor(int i = 0; i < SIZE_OUTPUT_LAYER; i++) {\n\t\t\tpredictedLabel[i] = 0;\n\n\t\t\tfor(int j = 0; j < SIZE_HIDDEN_LAYER; j++) {\n\t\t\t\tpredictedLabel[i] += weightsOfOutputLayer[i][j] * hiddenActivations[j];\n\t\t\t}\n\t\t\tpredictedLabel[i] += biasOfOutputLayer[i]; \n\t\t}\n\t\tsoftmax(predictedLabel);\n\t\tint solution = argmax(predictedLabel);\n\t\treturn solution;\n\t}", "public abstract double evaluateSolution(Solution solution) throws JMException, SimulationException;", "public static void runDecayingRatePerceptron(Data[] data, int index,String testFileName,HashMap<Integer,Integer> words)\r\n{\r\nint t=0;\r\ndouble LearningRates[] = {1, 0.1, 0.01};\r\n\tint minInt =0; // Set To Your Desired Min Value\r\n int maxInt =2;\r\n\tRandom rand = new Random();\r\n\t\r\n\tint randomNum = rand.nextInt((maxInt - minInt) + 1) + minInt;\r\n\r\n\tdouble LearningRate = LearningRates[randomNum];\r\n\t\r\n\t\r\nfor(int i=0;i<LearningRates.length;i++)\r\n{\r\nLearningRate = LearningRates[i];\r\ndouble devAccuracyTotal = (double)0;\r\nint noOfEpochs= 20;\r\nint decreaseRate = 0;\r\n\r\n\tDouble w[] = new Double[74500];\r\n\tDouble min =-0.01; // Set To Your Desired Min Value\r\nDouble max = 0.01;\r\n\t\tdouble smallRandNumber = min + new Random().nextDouble() * (max - min); \r\n\t\tArrays.fill(w, smallRandNumber);\r\n\t\t\r\nfor(int epoch=0;epoch<noOfEpochs;epoch++)\r\n{\r\n\t \tw = learnDecayingPerceptron(data,index,LearningRate,decreaseRate,w);\r\n\t \tdecreaseRate = decreaseRate + index;\r\n\r\n}\r\n// \tfor(int i=0;i<w.length;i++)\r\n// \t\t\tSystem.out.println(w[i]);\r\n//print data \t\r\n// \tfor (Map.Entry<Integer, Double> entry : x.entrySet()) {\r\n// System.out.println(\"\"+entry.getKey() + \" \" + entry.getValue());\r\n//\t \t}\r\n \t \t\r\n\t//keep decreaseRate increasing across epochs, by increasing 1 for each example.\r\n\tdouble cvAccuracy = testTestFile(w,testFileName,words);\r\n\t\r\n//\tSystem.out.println(\"Epoch\" + epoch +\" Dev Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\n\r\n\r\nSystem.out.println(\" ** Cv Accuracy for Decaying Learning Rate \" + LearningRate + \" is \" + cvAccuracy);\r\nSystem.out.println(\" \");\r\n}\r\n\r\n//double testAccuracy = testTestFile(w,testFileName);\r\n\t//System.out.println(\"test Accuracy\" + testAccuracy);\r\n}", "public void score(List<String> modelFiles, List<String> testFiles, String outputFile) {\n/* 1223 */ int nFold = modelFiles.size();\n/* 1224 */ try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), \"UTF-8\"))) {\n/* 1225 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* */ \n/* 1228 */ List<RankList> test = readInput(testFiles.get(f));\n/* 1229 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1230 */ int[] features = ranker.getFeatures();\n/* */ \n/* 1232 */ if (normalize) {\n/* 1233 */ normalize(test, features);\n/* */ }\n/* 1235 */ for (RankList l : test) {\n/* 1236 */ for (int j = 0; j < l.size(); j++) {\n/* 1237 */ out.write(l.getID() + \"\\t\" + j + \"\\t\" + ranker.eval(l.get(j)) + \"\");\n/* 1238 */ out.newLine();\n/* */ }\n/* */ \n/* */ } \n/* */ } \n/* 1243 */ } catch (IOException ex) {\n/* */ \n/* 1245 */ throw RankLibError.create(\"Error in Evaluator::score(): \", ex);\n/* */ } \n/* */ }", "public static void main(String[] args) {\n\t\tint[] featuresRemoved = new int[]{14,15,0,3,7,8,9,13}; //removed age,education,relationship,race,sex,country\n\t\t\n\t\tCrossValidation.Allow_testSet_to_be_Appended = true;\n\t\tDataManager.SetRegex(\"?\");\n\t\tDataManager.SetSeed(0l); //debugging for deterministic random\n\t\t\n\t\tArrayList<String[]> dataSet = DataManager.ReadCSV(\"data/adult.train.5fold.csv\",false);\n\t\tdataSet = DataManager.ReplaceMissingValues(dataSet);\n\t\tDoubleMatrix M = DataManager.dataSetToMatrix(dataSet,14);\n\t\tList<DoubleMatrix> bins = DataManager.split(M, 15);\n\t\t//List<DoubleMatrix> bins = DataManager.splitFold(M, 5,true); //random via permutation debugging\n\t\t\n\t\tArrayList<String[]> testSet = DataManager.ReadCSV(\"data/adult.test.csv\",false);\n\t\ttestSet = DataManager.ReplaceMissingValues(testSet);\n\t\tDoubleMatrix test = DataManager.dataSetToMatrix(testSet,14);\n\t\tList<DoubleMatrix> testBins = DataManager.splitFold(test, 8, false);\n\t\t\n\t\t\n\t\t//initiate threads \n\t\tint threadPool = 16;\n\t\tExecutorService executor = Executors.newFixedThreadPool(threadPool);\n\t\tList<Callable<Record[]>> callable = new ArrayList<Callable<Record[]>>();\t\t\n\t\t\n\t\tlong startTime = System.currentTimeMillis(); //debugging - test for optimisation \n\t\t\n\t\t\n\t\t\n\t\t//unweighted\n\t\tSystem.out.println(\"Validating Unweighted KNN...\");\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\t\n\t\t\tDoubleMatrix Train = new DoubleMatrix(0,bins.get(0).columns);\n\t\t\tDoubleMatrix Validation = bins.get(i);\n\t\t\t\n\t\t\tfor(int j = 0; j < bins.size(); j++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tTrain = DoubleMatrix.concatVertically(Train, bins.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//build worker thread\n\t\t\tCrossValidation fold = new CrossValidation(Train, Validation,14,featuresRemoved,40,2,false);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\t//returned statistics of each fold.\n\t\tList<Record[]> unweightedRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\t//collect all work thread values \n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\tunweightedRecords.add(recordFold.get());\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\t\n\t\n\t\tcallable.clear();\n\t\t\n\t\t\n\t\t\n\t\t//weighted\n\t\tSystem.out.println(\"Validating Weighted KNN...\");\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\tDoubleMatrix Train = new DoubleMatrix(0,bins.get(0).columns);\n\t\t\tDoubleMatrix Validation = bins.get(i);\n\t\t\t\n\t\t\tfor(int j = 0; j < bins.size(); j++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tTrain = DoubleMatrix.concatVertically(Train, bins.get(j));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//build worker thread\n\t\t\tCrossValidation fold = new CrossValidation(Train, Validation,14,featuresRemoved,40,2,true);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\t//returned statistics of each fold.\n\t\tList<Record[]> weightedRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\t//collect all work thread values \n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\tweightedRecords.add(recordFold.get());\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\t//find best parameter \n\t\tint bestKNN = 0;\n\t\tdouble bestAccuracy = 0;\n\t\tboolean weighted = false;\n\t\tint validationIndex = 0;\n\t\tfor(int i = 0; i < unweightedRecords.get(0).length; i++) {\n\t\t\t\n\t\t\tint currentK = 0;\n\t\t\tdouble currentAccuracy = 0;\n\t\t\t\n\t\t\tList<Record[]> a = new ArrayList<Record[]>();\n\t\t\tfor(int j = 0; j < unweightedRecords.size(); j ++) { \n\t\t\t\ta.add(new Record[]{ unweightedRecords.get(j)[i]});\n\t\t\t\tcurrentK = unweightedRecords.get(j)[i].KNN;\n\t\t\t}\n\t\t\t\n\t\t\tint[][] m = DataManager.combineMat(a);\n\t\t\tcurrentAccuracy = DataManager.getAccuracy(m);\n\t\t\t\n\t\t\tif(currentAccuracy > bestAccuracy) {\n\t\t\t\tbestKNN = currentK;\n\t\t\t\tbestAccuracy = currentAccuracy;\n\t\t\t\tweighted = false;\n\t\t\t\tvalidationIndex = i;\n\t\t\t\tSystem.out.println(bestKNN + \" : unweighted : \" +bestAccuracy + \" : Best\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(currentK + \" : unweighted : \" + currentAccuracy);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0; i < weightedRecords.get(0).length; i++) {\n\t\t\t\n\t\t\tint currentK = 0;\n\t\t\tdouble currentAccuracy = 0;\n\t\t\t\n\t\t\tList<Record[]> a = new ArrayList<Record[]>();\n\t\t\tfor(int j = 0; j < weightedRecords.size(); j ++) { \n\t\t\t\ta.add(new Record[]{ weightedRecords.get(j)[i]});\n\t\t\t\tcurrentK = weightedRecords.get(j)[i].KNN;\n\t\t\t}\n\t\t\t\n\t\t\tint[][] m = DataManager.combineMat(a);\n\t\t\tcurrentAccuracy = DataManager.getAccuracy(m);\n\t\t\t\n\t\t\tif(currentAccuracy >= bestAccuracy) {\n\t\t\t\tbestKNN = currentK;\n\t\t\t\tbestAccuracy = currentAccuracy;\n\t\t\t\tweighted = true;\n\t\t\t\tvalidationIndex = i;\n\t\t\t\tSystem.out.println(bestKNN + \" : weighted :\" +bestAccuracy + \" : Best\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(currentK + \" : weighted :\" + currentAccuracy);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\tList<Record[]> bestValidation = new ArrayList<Record[]>();\n\t\tfor(int i = 0; i < bins.size(); i++) {\n\t\t\tif(weighted) {\n\t\t\t\tbestValidation.add(new Record[]{ weightedRecords.get(i)[validationIndex]});\n\t\t\t} else {\n\t\t\t\tbestValidation.add(new Record[]{ unweightedRecords.get(i)[validationIndex]});\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"Testing...\");\n\t\t\n\t\t//KNN on test set\n\t\tcallable.clear();\n\t\t\n\t\t//build worker threads\n\t\tfor(int i = 0; i < testBins.size(); i++) {\n\t\t\tCrossValidation fold = new CrossValidation(M, testBins.get(i),14,featuresRemoved,bestKNN,bestKNN,weighted);\n\t\t\tcallable.add(fold);\n\t\t}\n\t\t\n\t\tList<Record[]> testRecords = new ArrayList<Record[]>();\n\t\t\n\t\ttry {\n\t\t\tList<Future<Record[]>> set = executor.invokeAll(callable);\n\t\t\t\n\t\t\tfor(Future<Record[]> recordFold : set) {\n\t\t\t\ttestRecords.add(recordFold.get());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\tint[][] testM = DataManager.combineMat(testRecords);\n\t\tdouble testAccuracy = DataManager.getAccuracy(testM);\n\t\t//double teststd = DataManager.GetStd(testRecords);\n\t\t\n\t\t//print stuff\n\t\tSystem.out.println(bestKNN + \" : \"+ weighted + \" : \" + testAccuracy);\n\t\tSystem.out.println(testM[0][0] + \", \" + testM[0][1] +\", \" + testM[1][0] + \", \" + testM[1][1]);\n\t\t\n\t\t//delete all worker threads\n\t\texecutor.shutdownNow();\n\t\t\n\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\tlong totalTime = endTime - startTime;\n\t\tSystem.out.println(\"Run time(millisecond): \" + totalTime );\n\t\tSystem.out.println(\"Thread pool: \" + threadPool );\n\t\tSystem.out.println(\"Cores: \" + Runtime.getRuntime().availableProcessors());\n\t\t\n\t\t//prints to file\n\t\tDataManager.saveRecord(\"data/grid.results.txt\", 14, featuresRemoved,\"<=50k\", bestKNN, weighted, bestValidation, testRecords, testRecords.get(0)[0].classType, 5, totalTime, threadPool);\n\t}", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.priorEntropy();\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test098() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n FilteredClassifier filteredClassifier0 = new FilteredClassifier();\n try { \n Evaluation.evaluateModel((Classifier) filteredClassifier0, testInstances0.DEFAULT_WORDS);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // \n // Weka exception: No training file and no object input file given.\n // \n // General options:\n // \n // -h or -help\n // \\tOutput help information.\n // -synopsis or -info\n // \\tOutput synopsis for classifier (use in conjunction with -h)\n // -t <name of training file>\n // \\tSets training file.\n // -T <name of test file>\n // \\tSets test file. If missing, a cross-validation will be performed\n // \\ton the training data.\n // -c <class index>\n // \\tSets index of class attribute (default: last).\n // -x <number of folds>\n // \\tSets number of folds for cross-validation (default: 10).\n // -no-cv\n // \\tDo not perform any cross validation.\n // -split-percentage <percentage>\n // \\tSets the percentage for the train/test set split, e.g., 66.\n // -preserve-order\n // \\tPreserves the order in the percentage split.\n // -s <random number seed>\n // \\tSets random number seed for cross-validation or percentage split\n // \\t(default: 1).\n // -m <name of file with cost matrix>\n // \\tSets file with cost matrix.\n // -l <name of input file>\n // \\tSets model input file. In case the filename ends with '.xml',\n // \\ta PMML file is loaded or, if that fails, options are loaded\n // \\tfrom the XML file.\n // -d <name of output file>\n // \\tSets model output file. In case the filename ends with '.xml',\n // \\tonly the options are saved to the XML file, not the model.\n // -v\n // \\tOutputs no statistics for training data.\n // -o\n // \\tOutputs statistics only, not the classifier.\n // -i\n // \\tOutputs detailed information-retrieval statistics for each class.\n // -k\n // \\tOutputs information-theoretic statistics.\n // -classifications \\\"weka.classifiers.evaluation.output.prediction.AbstractOutput + options\\\"\n // \\tUses the specified class for generating the classification output.\n // \\tE.g.: weka.classifiers.evaluation.output.prediction.PlainText\n // -p range\n // \\tOutputs predictions for test instances (or the train instances if\n // \\tno test instances provided and -no-cv is used), along with the \n // \\tattributes in the specified range (and nothing else). \n // \\tUse '-p 0' if no attributes are desired.\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -distribution\n // \\tOutputs the distribution instead of only the prediction\n // \\tin conjunction with the '-p' option (only nominal classes).\n // \\tDeprecated: use \\\"-classifications ...\\\" instead.\n // -r\n // \\tOnly outputs cumulative margin distribution.\n // -g\n // \\tOnly outputs the graph representation of the classifier.\n // -xml filename | xml-string\n // \\tRetrieves the options from the XML-data instead of the command line.\n // -threshold-file <file>\n // \\tThe file to save the threshold data to.\n // \\tThe format is determined by the extensions, e.g., '.arff' for ARFF \n // \\tformat or '.csv' for CSV.\n // -threshold-label <label>\n // \\tThe class label to determine the threshold data for\n // \\t(default is the first label)\n // \n // Options specific to weka.classifiers.meta.FilteredClassifier:\n // \n // -F <filter specification>\n // \\tFull class name of filter to use, followed\n // \\tby filter options.\n // \\teg: \\\"weka.filters.unsupervised.attribute.Remove -V -R 1,2\\\"\n // -D\n // \\tIf set, classifier is run in debug mode and\n // \\tmay output additional info to the console\n // -W\n // \\tFull name of base classifier.\n // \\t(default: weka.classifiers.trees.J48)\n // \n // Options specific to classifier weka.classifiers.trees.J48:\n // \n // -U\n // \\tUse unpruned tree.\n // -O\n // \\tDo not collapse tree.\n // -C <pruning confidence>\n // \\tSet confidence threshold for pruning.\n // \\t(default 0.25)\n // -M <minimum number of instances>\n // \\tSet minimum number of instances per leaf.\n // \\t(default 2)\n // -R\n // \\tUse reduced error pruning.\n // -N <number of folds>\n // \\tSet number of folds for reduced error\n // \\tpruning. One fold is used as pruning set.\n // \\t(default 3)\n // -B\n // \\tUse binary splits only.\n // -S\n // \\tDon't perform subtree raising.\n // -L\n // \\tDo not clean up after the tree has been built.\n // -A\n // \\tLaplace smoothing for predicted probabilities.\n // -J\n // \\tDo not use MDL correction for info gain on numeric attributes.\n // -Q <seed>\n // \\tSeed for random data shuffling (default 1).\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "private void runAlgorithm(){\n fitness = new ArrayList<Double>(); \n \n int iter = 0;\n \n // While temperature higher than absolute temperature\n this.temperature = getCurrentTemperature(0);\n while(this.temperature > this.p_absoluteTemperature && iter < 100000){\n //while(!stopCriterionMet()){\n // Select next state\n //for(int i=0;i<20;i++){\n int count = 0;\n boolean selected = false;\n while(!selected){\n Problem.ProblemState next = nextState();\n if(isStateSelected(next)){\n selected = true;\n this.state = next;\n }\n \n count++;\n if(count == 10) break;\n }\n //}\n \n // Sample data\n double fvalue = this.state.getFitnessValue();\n this.fitness.add(new Double(fvalue));\n \n iter = iter + 1;\n \n // Lower temperature\n this.temperature = getCurrentTemperature(iter);\n }\n \n this.n_iter = iter;\n return;\n }", "public abstract void runAlgorithm();", "@Test\n\tpublic void testOptimization() throws Exception {\n\t\tfor(int i = 0; i < 20000000; i++) {\n\t\t\tint _300s = (int) (Math.random() * 100);\n\t\t\tint _100s = (int) (Math.random() * 100);\n\t\t\tint _50s = (int) (Math.random() * 100);\n\t\t\tint misses = (int) (Math.random() * 100);\n\t\t\t\n\t\t\tdouble acc = OsuApiScore.getAccuracy(_300s, _100s, _50s, misses);\n\t\t\t\n\t\t\tAccuracyDistribution accuracyDistribution = AccuracyDistribution.closest(\n\t\t\t\t\t_300s + _100s + _50s + misses, misses,\n\t\t\t\t\tacc);\n\t\t\t\n\t\t\tdouble rec = OsuApiScore.getAccuracy(accuracyDistribution.getX300(),\n\t\t\t\t\taccuracyDistribution.getX100(), accuracyDistribution.getX50(),\n\t\t\t\t\taccuracyDistribution.getMiss());\n\t\t\t\n\t\t\tassertEquals(acc, rec, 0d);\n\t\t}\n\t}", "public void predict(String testFileName) throws IOException, InvalidInputException{\r\n BufferedReader reader = new BufferedReader(new FileReader(testFileName));\r\n if(reader.toString().length() == 0){\r\n throw new InvalidInputException(\"Invalid input file! File is empty!\");\r\n }\r\n\r\n int index = 0;\r\n Vector<Double> actuals = new Vector<>();\r\n Vector<Double> predicts = new Vector<>();\r\n while(true) {\r\n String line = reader.readLine();\r\n if (line == null)\r\n break;\r\n\r\n StringTokenizer st = new StringTokenizer(line, \" \\t\\n\\r\\f:\");\r\n\r\n double target = Utils.toDouble(st.nextToken());\r\n int m = st.countTokens() / 2;\r\n svm_node[] x = new svm_node[m];\r\n for (int j = 0; j < m; j++) {\r\n x[j] = new svm_node();\r\n x[j].index = Utils.toInt(st.nextToken());\r\n x[j].value = Utils.toDouble(st.nextToken());\r\n }\r\n double v;\r\n v = svm.svm_predict(this.model, x);\r\n\r\n actuals.add(index, target);\r\n predicts.add(index, v);\r\n\r\n System.out.println(\"[\" + index + \"] Prediction:\" + v + \", actual:\" + target);\r\n index += 1;\r\n }\r\n Metrices me = new Metrices(Utils.toDoubleArray(predicts), Utils.toDoubleArray(actuals), predicts.size());\r\n System.out.println(\"RMSE: \" + me.getRMSE());\r\n }", "public void evaluate()\r\n {\r\n\tdouble max = ff.evaluate(chromos.get(0),generation());\r\n\tdouble min = max;\r\n\tdouble sum = 0;\r\n\tint max_i = 0;\r\n\tint min_i = 0;\r\n\r\n\tdouble temp = 0;\r\n\r\n\tfor(int i = 0; i < chromos.size(); i++)\r\n\t {\r\n\t\ttemp = ff.evaluate(chromos.get(i),generation());\r\n\t\tif(temp > max)\r\n\t\t {\r\n\t\t\tmax = temp;\r\n\t\t\tmax_i = i;\r\n\t\t }\r\n\r\n\t\tif(temp < min)\r\n\t\t {\r\n\t\t\tmin = temp;\r\n\t\t\tmin_i = i;\r\n\t\t }\r\n\t\tsum += temp;\r\n\t }\r\n\r\n\tbestFitness = max;\r\n\taverageFitness = sum/chromos.size();\r\n\tworstFitness = min;\r\n\tbestChromoIndex = max_i;;\r\n\tworstChromoIndex = min_i;\r\n\tbestChromo = chromos.get(max_i);\r\n\tworstChromo = chromos.get(min_i);\r\n\t\r\n\tevaluated = true;\r\n }", "@Test(timeout = 4000)\n public void test120() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctIncorrect();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test\n public void test35() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.pctUnclassified();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertEquals(Double.NaN, double0, 0.01D);\n }", "private void learn() {\n\t\tupdateValues();\n\t\tif(CFG.isUpdatedPerformanceHistory()){\n\t\t\tupdateHistory();\n\t\t}\n\t\tif(CFG.isEvaluated()) evaluate();\n\t}", "@Test\n public void test30() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n boolean boolean0 = evaluation0.getDiscardPredictions();\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01D);\n assertFalse(boolean0);\n }", "public static void main(String argv[]) throws InterruptedException {\r\n\t\t// Set default setting first:\r\n\t\tdataFileName = \"movieLens_100K\";\r\n\t\tevaluationMode = DataSplitManager.SIMPLE_SPLIT;\r\n\t\tsplitFileName = dataFileName + \"_split.txt\";\r\n\t\ttestRatio = 0.5;\r\n\t\tfoldCount = 8;\r\n\t\tuserTrainCount = 10;\r\n\t\tminTestCount = 10;\r\n\t\trunAllAlgorithms = true;\r\n\t\t\r\n\t\t// Parsing the argument:\r\n\t\tif (argv.length > 1) {\r\n\t\t\tparseCommandLine(argv);\r\n\t\t}\r\n\t\t\r\n\t\t// Read input file:\r\n\t\treadArff (dataFileName + \".arff\");\r\n\t\t\r\n\t\t// Train/test data split:\r\n\t\tswitch (evaluationMode) {\r\n\t\t\tcase DataSplitManager.SIMPLE_SPLIT:\r\n\t\t\t\tSimpleSplit sSplit = new SimpleSplit(rateMatrix, testRatio, maxValue, minValue);\r\n\t\t\t\tSystem.out.println(\"Evaluation\\tSimple Split (\" + (1 - testRatio) + \" train, \" + testRatio + \" test)\");\r\n\t\t\t\ttestMatrix = sSplit.getTestMatrix();\r\n\t\t\t\tuserRateAverage = sSplit.getUserRateAverage();\r\n\t\t\t\titemRateAverage = sSplit.getItemRateAverage();\r\n\t\t\t\t\r\n\t\t\t\trun();\r\n\t\t\t\tbreak;\r\n\t\t\tcase DataSplitManager.PREDEFINED_SPLIT:\r\n\t\t\t\tPredefinedSplit pSplit = new PredefinedSplit(rateMatrix, splitFileName, maxValue, minValue);\r\n\t\t\t\tSystem.out.println(\"Evaluation\\tPredefined Split (\" + splitFileName + \")\");\r\n\t\t\t\ttestMatrix = pSplit.getTestMatrix();\r\n\t\t\t\tuserRateAverage = pSplit.getUserRateAverage();\r\n\t\t\t\titemRateAverage = pSplit.getItemRateAverage();\r\n\t\t\t\t\r\n\t\t\t\trun();\r\n\t\t\t\tbreak;\r\n\t\t\tcase DataSplitManager.K_FOLD_CROSS_VALIDATION:\r\n\t\t\t\tKfoldCrossValidation kSplit = new KfoldCrossValidation(rateMatrix, foldCount, maxValue, minValue);\r\n\t\t\t\tSystem.out.println(\"Evaluation\\t\" + foldCount + \"-fold Cross-validation\");\r\n\t\t\t\tfor (int k = 1; k <= foldCount; k++) {\r\n\t\t\t\t\ttestMatrix = kSplit.getKthFold(k);\r\n\t\t\t\t\tuserRateAverage = kSplit.getUserRateAverage();\r\n\t\t\t\t\titemRateAverage = kSplit.getItemRateAverage();\r\n\t\t\t\t\t\r\n\t\t\t\t\trun();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase DataSplitManager.RANK_EXP_SPLIT:\r\n\t\t\t\tRankExpSplit rSplit = new RankExpSplit(rateMatrix, userTrainCount, minTestCount, maxValue, minValue);\r\n\t\t\t\tSystem.out.println(\"Evaluation\\t\" + \"Ranking Experiment with N = \" + userTrainCount);\r\n\t\t\t\ttestMatrix = rSplit.getTestMatrix();\r\n\t\t\t\tuserRateAverage = rSplit.getUserRateAverage();\r\n\t\t\t\titemRateAverage = rSplit.getItemRateAverage();\r\n\t\t\t\t\r\n\t\t\t\trun();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\n Normalized norm = new Normalized();\n double c = 1;\n\n double[][] data = norm.Inputdata(\"input.txt\");\n double[][] w = new double[35][10];\n double[][] last = new double[35][10];\n\n for (int i = 0; i < 35; i++) {\n for (int j = 0; j < 10; j++) {\n w[i][j] = 1;\n last[i][j] = 1;\n\n }\n }\n\n /* for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 35; j++) {\n System.out.print(data[i][j]);\n System.out.print(\" \");\n \n \n }\n System.out.print(\"\\n\");\n }\n */\n //System.out.print(w[5][5]);\n double[] ErrMap = norm.Inputdata2(\"TestMap.txt\");\n //System.out.print(ErrMap[0]);\n\n //System.out.print(\"\\n\");\n w = training(data, w, last, c);\n\n int out = 2;\n\n out = classify(w, ErrMap, c);\n System.out.print(\"product \" + out + \" is max\\n\");\n System.out.print(\"the number classify to \" + out + \"\\n\");\n }", "private ArrayList<Record> test() {\n\t\t\t\tfor (int i = 0; i < numberOfIterations; i++) {\n\t\t\t\t\t// for each training record\n\t\t\t\t\tfor (int j = 0; j < numberOfRecords; j++) {\n\t\t\t\t\t\t// calculate inputs and outputs\n\t\t\t\t\t\tforwardCalculation(records.get(j).input);\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tpostprocessOutputs();\n\t\t// forward pass\n\t\t// back pass\n\t\treturn records;\n\t}", "public static void main(String[] args) {\n ExecuteParams executeParams1 = new ExecuteParams();\n ExecuteParams executeParams2 = new ExecuteParams();\n ExecuteParams executeParams30 = new ExecuteParams();\n ExecuteParams executeParams31 = new ExecuteParams();\n ExecuteParams executeParams32 = new ExecuteParams();\n ExecuteParams executeParams33 = new ExecuteParams();\n ExecuteParams executeParams34 = new ExecuteParams();\n ExecuteParams executeParams41 = new ExecuteParams();\n\n //*** PARAMS\n executeParams1.DeviationPredictor_CosineMetric();\n executeParams2.DeviationPredictor_PearsonMetric();\n executeParams30.DeviationPredictor_PearsonSignifianceWeightMetric(1);\n executeParams31.DeviationPredictor_PearsonSignifianceWeightMetric(5);\n executeParams32.DeviationPredictor_PearsonSignifianceWeightMetric(50);\n executeParams33.DeviationPredictor_PearsonSignifianceWeightMetric(100);\n executeParams34.DeviationPredictor_PearsonSignifianceWeightMetric(200);\n executeParams41.DeviationPredictor_JaccardMetric();\n //***\n\n computeOne(executeParams1);\n computeOne(executeParams2);\n computeOne(executeParams30,\"N = 1\");\n computeOne(executeParams31,\"N = 5\");\n computeOne(executeParams32,\"N = 50\");\n computeOne(executeParams33,\"N = 100\");\n computeOne(executeParams34,\"N = 200\");\n computeOne(executeParams41);\n }", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n CostSensitiveClassifier costSensitiveClassifier0 = new CostSensitiveClassifier();\n CostMatrix costMatrix0 = costSensitiveClassifier0.getCostMatrix();\n Evaluation evaluation0 = null;\n try {\n evaluation0 = new Evaluation(instances0, costMatrix0);\n fail(\"Expecting exception: Exception\");\n \n } catch(Throwable e) {\n //\n // Cost matrix not compatible with data!\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "@Test\n public void testScoreUpdate() {\n try {\n final BestEvalScore score = new BestEvalScore(\"thjtrfwaw\");\n double expected = 0;\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n final Evaluation eval = new Evaluation(2);\n eval.eval(0,1);\n eval.eval(1,1);\n\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(0,1);\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(1,1);\n eval.eval(1,1);\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to create instance!\", e);\n }\n\n\n }", "@Test\n public void TestCase1() {\n VariableMap variables = Variables\n .putValue(\"Role\", \"Executive\")\n .putValue(\"BusinessProcess\", \"PTO Request\")\n .putValue(\"DelegationDateRange\", \"2019-04-31T00:00:00\");\n\n DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);\n\n // Need to establish rule ordering\n assertThat(result.collectEntries(\"result\"))\n .hasSize(2)\n .contains(\"John M\")\n .contains(\"Kerry\");\n }", "protected void runTest() {\n\t\trunTest(getIterations());\n\t}", "public double[] runOptimizer() {\n List<Integer> sents = new ArrayList<Integer>();\n for(int i=0; i<sentNum; i++)\n sents.add(i);\n \n if(needShuffle)\n Collections.shuffle(sents);\n \n double oraMetric, oraScore, predMetric, predScore;\n double[] oraPredScore = new double[4];\n double eta = 1.0; //learning rate, will not be changed if run percep\n double avgEta = 0; //average eta, just for analysis\n double loss = 0;\n double featNorm = 0;\n double featDiffVal;\n double sumMetricScore = 0;\n double sumModelScore = 0;\n String oraFeat = \"\";\n String predFeat = \"\";\n String[] oraPredFeat = new String[2];\n String[] vecOraFeat;\n String[] vecPredFeat;\n String[] featInfo;\n boolean first = true;\n //int processedSent = 0;\n Iterator it;\n Integer diffFeatId;\n double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required\n for(int i=0; i<initialLambda.length; i++)\n avgLambda[i] = 0.0;\n\n //update weights\n for(Integer s : sents) {\n //find out oracle and prediction\n if(first)\n findOraPred(s, oraPredScore, oraPredFeat, initialLambda, featScale);\n else\n findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);\n \n //the model scores here are already scaled in findOraPred\n oraMetric = oraPredScore[0];\n oraScore = oraPredScore[1];\n predMetric = oraPredScore[2];\n predScore = oraPredScore[3];\n oraFeat = oraPredFeat[0];\n predFeat = oraPredFeat[1];\n \n //update the scale\n if(needScale) { //otherwise featscale remains 1.0\n sumMetricScore += java.lang.Math.abs(oraMetric+predMetric);\n sumModelScore += java.lang.Math.abs(oraScore+predScore)/featScale; //restore the original model score\n \n if(sumModelScore/sumMetricScore > scoreRatio)\n featScale = sumMetricScore/sumModelScore;\n\n /* a different scaling strategy \n if( (1.0*processedSent/sentNum) < sentForScale ) { //still need to scale\n double newFeatScale = java.lang.Math.abs(scoreRatio*sumMetricDiff / sumModelDiff); //to make sure modelScore*featScale/metricScore = scoreRatio\n \n //update the scale only when difference is significant\n if( java.lang.Math.abs(newFeatScale-featScale)/featScale > 0.2 )\n featScale = newFeatScale;\n }*/\n }\n// processedSent++;\n\n HashMap<Integer, Double> allOraFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> allPredFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();\n\n vecOraFeat = oraFeat.split(\"\\\\s+\");\n vecPredFeat = predFeat.split(\"\\\\s+\");\n \n for (int i = 0; i < vecOraFeat.length; i++) {\n featInfo = vecOraFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allOraFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));\n }\n\n for (int i = 0; i < vecPredFeat.length; i++) {\n featInfo = vecPredFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allPredFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n\n if (featDiff.containsKey(diffFeatId)) //overlapping features\n featDiff.put(diffFeatId, featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]));\n else //features only firing in the 2nd feature vector\n featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));\n }\n\n if(!runPercep) { //otherwise eta=1.0\n featNorm = 0;\n\n Collection<Double> allDiff = featDiff.values();\n for(it =allDiff.iterator(); it.hasNext();) {\n featDiffVal = (Double) it.next();\n featNorm += featDiffVal*featDiffVal;\n }\n \n //a few sanity checks\n if(! evalMetric.getToBeMinimized()) {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score+ora_metric > pred_score+pred_metric\n * pred_score-pred_metric > ora_score-ora_metric\n * => ora_metric > pred_metric */\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be greater than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for max-metric oracle selection or min-metric prediction selection, the oracle metric \" +\n \t\t\"score must be greater than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n } else {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score-ora_metric > pred_score-pred_metric\n * pred_score+pred_metric > ora_score+ora_metric\n * => ora_metric < pred_metric */\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be smaller than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for min-metric oracle selection or max-metric prediction selection, the oracle metric \" +\n \"score must be smaller than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n }\n \n if(predSelectMode==2) {\n if(predScore+1e-10 < oraScore) {\n System.err.println(\"WARNING: for max-model prediction selection, the prediction model score must be greater than oracle model score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n //cost - margin\n //remember the model scores here are already scaled\n loss = evalMetric.getToBeMinimized() ? //cost should always be non-negative \n (predMetric-oraMetric) - (oraScore-predScore)/featScale: \n (oraMetric-predMetric) - (oraScore-predScore)/featScale;\n \n if(loss<0)\n loss = 0;\n\n if(loss == 0)\n eta = 0;\n else\n //eta = C < loss/(featNorm*featScale*featScale) ? C : loss/(featNorm*featScale*featScale); //feat vector not scaled before\n eta = C < loss/(featNorm) ? C : loss/(featNorm); //feat vector not scaled before\n }\n \n avgEta += eta;\n\n Set<Integer> diffFeatSet = featDiff.keySet();\n it = diffFeatSet.iterator();\n\n if(first) {\n first = false;\n \n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = initialLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n else {\n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = finalLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n \n if(needAvg) {\n for(int i=0; i<avgLambda.length; i++)\n avgLambda[i] += finalLambda[i];\n }\n }\n \n if(needAvg) {\n for(int i=0; i<finalLambda.length; i++)\n finalLambda[i] = avgLambda[i]/sentNum;\n }\n \n avgEta /= sentNum;\n System.out.println(\"Average learning rate: \"+avgEta);\n\n // the intitialLambda & finalLambda are all trainable parameters\n //if (!trainMode.equals(\"3\")) // for mode 3, no need to normalize sparse\n // feature weights\n //normalizeLambda(finalLambda);\n //else\n //normalizeLambda_mode3(finalLambda);\n\n /*\n * for( int i=0; i<finalLambda.length; i++ ) System.out.print(finalLambda[i]+\" \");\n * System.out.println(); System.exit(0);\n */ \n\n double initMetricScore = computeCorpusMetricScore(initialLambda); // compute the initial corpus-level metric score\n double finalMetricScore = computeCorpusMetricScore(finalLambda); // compute final corpus-level metric score // the\n\n // prepare the printing info\n int numParamToPrint = 0;\n String result = \"\";\n\n if (trainMode.equals(\"1\") || trainMode.equals(\"4\")) {\n numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters\n // to print\n result = paramDim > 10 ? \"Final lambda(first 10): {\" : \"Final lambda: {\";\n\n for (int i = 1; i < numParamToPrint; i++)\n // in ZMERT finalLambda[0] is not used\n result += finalLambda[i] + \" \";\n } else {\n int sparseNumToPrint = 0;\n if (trainMode.equals(\"2\")) {\n result = \"Final lambda(regular feats + first 5 sparse feats): {\";\n for (int i = 1; i <= regParamDim; ++i)\n result += finalLambda[i] + \" \";\n\n result += \"||| \";\n\n sparseNumToPrint = 5 < (paramDim - regParamDim) ? 5 : (paramDim - regParamDim);\n\n for (int i = 1; i <= sparseNumToPrint; i++)\n result += finalLambda[regParamDim + i] + \" \";\n } else {\n result = \"Final lambda(first 10 sparse feats): {\";\n sparseNumToPrint = 10 < paramDim ? 10 : paramDim;\n\n for (int i = 1; i < sparseNumToPrint; i++)\n result += finalLambda[i] + \" \";\n }\n }\n\n output.add(result + finalLambda[numParamToPrint] + \"}\\n\" + \"Initial \"\n + evalMetric.get_metricName() + \": \" + initMetricScore + \"\\nFinal \"\n + evalMetric.get_metricName() + \": \" + finalMetricScore);\n\n // System.out.println(output);\n\n if (trainMode.equals(\"3\")) {\n // finalLambda = baseline(unchanged)+disc\n for (int i = 0; i < paramDim; i++)\n copyLambda[i + regParamDim + 1] = finalLambda[i];\n\n finalLambda = copyLambda;\n }\n\n return finalLambda;\n }", "@Test\n void adjectivesScoring() {\n NLPAnalyser np = new NLPAnalyser();\n List<CoreMap> sentences = np.nlpPipeline(\"RT This made my day; glad @JeremyKappell is standing up against #ROC’s disgusting mayor. \"\n + \"Former TV meteorologist Jeremy Kappell suing Mayor Lovely Warren\"\n + \"https://t.co/rJIV5SN9vB (Via NEWS 8 WROC)\");\n HashMap<String, Double> as = np.adjectivesScoring(sentences);\n for (String key : as.keySet()) {\n Double value = as.get(key);\n assertTrue(value >= 0 && value <= 4);\n }\n }", "@Test(timeout = 4000)\n public void test026() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getStructure();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.recall((-9));\n assertEquals(0.0, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "public void soaktest() {\n\t\ttry {\n\t\t\tint errCount = 0;\n\n\t\t\tfor (int i = 1; i <= 100; i++) {\n\t\t\t\tRegression test = new Regression();\n\t\t\t\ttest0();\n\t\t\t\ttest.test1(m1);\n\t\t\t\ttest.test2(m1);\n\t\t\t\ttest.test3(m1);\n\t\t\t\ttest.test4(m1);\n\t\t\t\ttest.test5(m1);\n\t\t\t\ttest.test6(m1);\n\t\t\t\ttest.test7(m1, m2);\n\t\t\t\ttest.test8(m1);\n\t\t\t\ttest.test9(m2);\n\t\t\t\ttest.test10(m3);\n\t\t\t\ttest.test11(m1, m2);\n\t\t\t\ttest.test12(m1);\n\t\t\t\ttest.test13(m1);\n\t\t\t\ttest.test14(m1);\n\t\t\t\ttest.test15(m1);\n\t\t\t\ttest.test16(m1);\n\t\t\t\ttest.test17(m1);\n\t\t\t\ttest.test18(m4);\n\t\t\t\ttest.test19(m2, m3);\n\t\t\t\ttest.test97(m1);\n\t\t\t\tif (test.getErrors())\n\t\t\t\t\terrCount++;\n\t\t\t\tif ((i % 10) == 0) {\n\t\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"error count = \" + errCount + \" rounds = \" + i);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\tassertTrue(false);\n\t\t}\n\t}", "public Prediction apply( double[] confidence );", "void evaluate()\n\t{\n\t\toperation.evaluate();\n\t}", "@Test\n public void testOneUserTrecevalStrategySingleRelevance() {\n DataModelIF<Long, Long> test = DataModelFactory.getDefaultModel();\n DataModelIF<Long, Long> predictions = DataModelFactory.getDefaultModel();\n test.addPreference(1L, 2L, 0.0);\n test.addPreference(1L, 3L, 1.0);\n test.addPreference(1L, 4L, 1.0);\n predictions.addPreference(1L, 1L, 3.0);\n predictions.addPreference(1L, 2L, 4.0);\n predictions.addPreference(1L, 3L, 5.0);\n predictions.addPreference(1L, 4L, 1.0);\n\n Precision<Long, Long> precision = new Precision<Long, Long>(predictions, test, 1.0, new int[]{1, 2, 3, 4, 5});\n\n precision.compute();\n\n assertEquals(0.5, precision.getValue(), 0.001);\n assertEquals(1.0, precision.getValueAt(1), 0.001);\n assertEquals(0.5, precision.getValueAt(2), 0.001);\n assertEquals(0.3333, precision.getValueAt(3), 0.001);\n assertEquals(0.5, precision.getValueAt(4), 0.001);\n assertEquals(0.4, precision.getValueAt(5), 0.001);\n\n Map<Long, Double> precisionPerUser = precision.getValuePerUser();\n for (Map.Entry<Long, Double> e : precisionPerUser.entrySet()) {\n long user = e.getKey();\n double value = e.getValue();\n assertEquals(0.5, value, 0.001);\n }\n }", "protected abstract Value evaluate();", "void calcFittest(){\n System.out.println(\"Wall hugs\");\n System.out.println(this.wallHugs);\n\n System.out.println(\"Freedom points\");\n System.out.println(this.freedomPoints);\n\n System.out.println(\"Visited points\");\n System.out.println(this.vistedPoints);\n\n this.fitnessScore = freedomPoints - wallHugs - vistedPoints;\n System.out.println(\"Individual fit score: \" + fitnessScore);\n }", "public void dmall() {\n \r\n BufferedReader datafile = readDataFile(\"Work//weka-malware.arff\");\r\n \r\n Instances data = null;\r\n\t\ttry {\r\n\t\t\tdata = new Instances(datafile);\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n data.setClassIndex(data.numAttributes() - 1);\r\n \r\n // Choose a type of validation split\r\n Instances[][] split = crossValidationSplit(data, 10);\r\n \r\n // Separate split into training and testing arrays\r\n Instances[] trainingSplits = split[0];\r\n Instances[] testingSplits = split[1];\r\n \r\n // Choose a set of classifiers\r\n Classifier[] models = { new J48(),\r\n new DecisionTable(),\r\n new DecisionStump(),\r\n new BayesianLogisticRegression() };\r\n \r\n // Run for each classifier model\r\n//for(int j = 0; j < models.length; j++) {\r\n int j = 0;\r\n \tswitch (comboClassifiers.getSelectedItem().toString()) {\r\n\t\t\tcase \"J48\":\r\n\t\t\t\tj = 0;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"DecisionTable\":\r\n\t\t\t\tj = 1;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"DecisionStump\":\r\n\t\t\t\tj = 2;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"BayesianLogisticRegression\":\r\n\t\t\t\tj = 3;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n \t\r\n\r\n // Collect every group of predictions for current model in a FastVector\r\n FastVector predictions = new FastVector();\r\n \r\n // For each training-testing split pair, train and test the classifier\r\n for(int i = 0; i < trainingSplits.length; i++) {\r\n Evaluation validation = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvalidation = simpleClassify(models[j], trainingSplits[i], testingSplits[i]);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n predictions.appendElements(validation.predictions());\r\n \r\n // Uncomment to see the summary for each training-testing pair.\r\n// textArea.append(models[j].toString() + \"\\n\");\r\n textArea.setText(models[j].toString() + \"\\n\");\r\n// System.out.println(models[j].toString());\r\n }\r\n \r\n // Calculate overall accuracy of current classifier on all splits\r\n double accuracy = calculateAccuracy(predictions);\r\n \r\n // Print current classifier's name and accuracy in a complicated, but nice-looking way.\r\n textArea.append(models[j].getClass().getSimpleName() + \": \" + String.format(\"%.2f%%\", accuracy) + \"\\n=====================\\n\");\r\n System.out.println(models[j].getClass().getSimpleName() + \": \" + String.format(\"%.2f%%\", accuracy) + \"\\n=====================\");\r\n//}\r\n \r\n\t}", "@Test(timeout = 4000)\n public void test047() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n try { \n Evaluation.evaluateModel(\"\", testInstances0.DEFAULT_WORDS);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't find class with name .\n //\n verifyException(\"weka.classifiers.Evaluation\", e);\n }\n }", "public static void main(String[] args) {\n FileReader fileReader = new FileReader(\"input_roomSize_price.txt\");\n\n GradientDescent gradientDescent = new GradientDescent();\n\n gradientDescent.setTrainingData(fileReader.getData());\n\n gradientDescent.initializeParameters();\n gradientDescent.setLearningRate(0.01);\n\n gradientDescent.train();\n\n double[] parameters = gradientDescent.getParameters();\n for (int i=0; i<parameters.length; i++) {\n System.out.println(\"Parameter \" + i + \": \" + parameters[i]);\n }\n\n System.out.println(\"PREDICTION: \" + gradientDescent.predict(new double[]{1650}));\n\n\n // for multiple feature gradient descent test\n fileReader = new FileReader(\"trainingData.txt\");\n\n gradientDescent = new GradientDescent();\n\n gradientDescent.setTrainingData(fileReader.getData());\n\n gradientDescent.initializeParameters();\n gradientDescent.setLearningRate(0.01);\n\n gradientDescent.train();\n\n parameters = gradientDescent.getParameters();\n for (int i=0; i<parameters.length; i++) {\n System.out.println(\"Parameter \" + i + \": \" + parameters[i]);\n }\n\n System.out.println(\"PREDICTION: \" + gradientDescent.predict(new double[]{1350, 4}));\n }", "public static void main(String[] args) {\n String fileName = \"data1.txt\";\n \n \n //Load the data from the dataset file\n dataSet = getDataSet(fileName);\n \n //Setting up the output file\n String outputFileName = \"\";\n if (fileName.indexOf(\".\") > 0) {\n outputFileName = fileName.substring(0, fileName.lastIndexOf(\".\"));\n }\n \n createFile(outputFileName+\".csv\");\n \n //log the time the algorithm started\n long startTime = System.currentTimeMillis();\n \n //Placeholder of the fittest individual\n fittestIndividual = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n fittestIndividual.generateRulebase(); \n \n //Setup the mating pool\n matingPool = setupArray(POP_SIZE, NUM_RULES, GENE_SIZE, COND_LEN);\n \n //used to run the GA multiple times without doing it manually\n //set to 1 because we want to run the GA once\n for (int a = 0; a < 1; a++) {\n currentBest = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n currentBest.generateRulebase();\n\n //Generate a population\n generatePopulation();\n\n //Initial calculation of the fitness\n calculateFitness(population);\n\n for (int i = 0; i < GENERATION; i++) {\n average = 0; //reset the average\n currentBestArray[i] = currentBest.getFitness();\n \n tournamentSelect(population);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Perfrom crossover on the mating pool\n crossover(matingPool);\n\n //Mutation\n mutation(matingPool);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Evaluate the current population\n for (Individual individual : matingPool) {\n if (individual.getFitness() > currentBest.getFitness()) {\n currentBest = new Individual(individual);\n }\n average = average + individual.getFitness();\n }\n \n\n //Replace the population with the new generation\n for (int j = 0; j < POP_SIZE; j++) {\n population[j] = new Individual(matingPool[j]);\n }\n \n averageArray[i] = average / POP_SIZE;\n }\n \n //Check whether the current best is fitter than the global fittest individual\n if (currentBest.fitness > fittestIndividual.fitness) {\n fittestIndividual = new Individual(currentBest);\n //copy the fittest individuals performance\n fittestArray = Arrays.copyOf(currentBestArray, currentBestArray.length);\n }\n }\n\n System.out.println(\"Best fitness generated for the dataset: \" + fittestIndividual.fitness);\n \n //output the rules\n printRules(fittestIndividual.getRulebase());\n \n //Save the performance data into the output file\n for (int i = 0; i < fittestArray.length; i++) {\n addToFile(i, fittestArray[i], averageArray[i]);\n }\n \n //close the file\n close();\n \n //Evaluate the fitness agaisnt the dataset\n calculateFitness(fittestIndividual);\n double accuracyPercentage = ((double) 100 / dataSet.size()) * fittestIndividual.fitness;\n System.out.format(\"%.2f%% accuracy on the datase set.\\n\", accuracyPercentage);\n \n //Log the duration it took\n long duration = System.currentTimeMillis() - startTime;\n System.out.println(\"Completed in \" + String.format(\"%02d min, %02d.%02d sec\",\n TimeUnit.MILLISECONDS.toMinutes(duration),\n TimeUnit.MILLISECONDS.toSeconds(duration)\n - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)),\n TimeUnit.MILLISECONDS.toMillis(duration) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(duration))\n ));\n }", "public static void main(String[] args) {\n String pathToTrain = \"train.csv\";\n String pathToTest = \"test.csv\";\n try {\n ArrayList<String> trainSentences = readCSV(pathToTrain);\n trainSentences.remove(0);\n ArrayList<String> testSentences = readCSV(pathToTest);\n testSentences.remove(0);\n\n ArrayList<String[]> trainWords = preprocess(trainSentences);\n NaiveBayesClassifier model = new NaiveBayesClassifier();\n model.fit(trainWords);\n\n ArrayList<String[]> testWords = preprocess(testSentences);\n double accuracy = evaluate(testWords, model);\n model.writeParams(\"params.json\");\n System.out.printf(\"Accuracy of the model is: %.4f%n\", accuracy);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }", "@Test(timeout = 4000)\n public void test102() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate(\"\");\n Evaluation evaluation0 = new Evaluation(instances0);\n double[][] doubleArray0 = evaluation0.confusionMatrix();\n assertEquals(0.0, evaluation0.SFEntropyGain(), 0.01);\n assertEquals(2, doubleArray0.length);\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double double0 = evaluation0.SFMeanPriorEntropy();\n assertEquals(Double.NaN, double0, 0.01);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "@Test(timeout = 4000)\n public void test025() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n evaluation0.setPriors(instances0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }" ]
[ "0.74771196", "0.7038689", "0.6959411", "0.6948934", "0.6843137", "0.67486155", "0.6691618", "0.6681547", "0.6610312", "0.64823276", "0.6433801", "0.6388129", "0.63324136", "0.6312765", "0.6251026", "0.62247676", "0.6184394", "0.6181158", "0.6166545", "0.61627805", "0.61281335", "0.610719", "0.6081735", "0.6075845", "0.60692626", "0.60644275", "0.60603327", "0.60551655", "0.60449076", "0.60131913", "0.60097724", "0.5999539", "0.5988291", "0.59725606", "0.5932638", "0.59304804", "0.5917748", "0.5910966", "0.59080315", "0.5873246", "0.5868072", "0.5857415", "0.58453137", "0.58402365", "0.5837345", "0.5836898", "0.5834553", "0.583053", "0.580927", "0.58054745", "0.58035994", "0.57885814", "0.578073", "0.577676", "0.577502", "0.57684124", "0.5765008", "0.57612777", "0.57608914", "0.5759903", "0.5756663", "0.5753762", "0.57377994", "0.5728875", "0.5728868", "0.572805", "0.57233346", "0.572259", "0.57206094", "0.5719357", "0.57151085", "0.5707263", "0.57071304", "0.5704074", "0.5703928", "0.5703197", "0.569587", "0.56910616", "0.5688512", "0.5687181", "0.5684184", "0.5683675", "0.5683441", "0.5680452", "0.5680062", "0.5679637", "0.567814", "0.56655306", "0.5660498", "0.564868", "0.56480145", "0.5647335", "0.5640046", "0.5639715", "0.5633556", "0.5631264", "0.56307226", "0.56256354", "0.56220907", "0.562089" ]
0.5653073
89
Creation of the savedState and loading of XML
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Assigning of the images inside the XML arm = (ImageView) findViewById(R.id.armsImg); ear = (ImageView) findViewById(R.id.earsImg); eyebrow = (ImageView) findViewById(R.id.eyebrowsImg); eye = (ImageView) findViewById(R.id.eyesImg); glass = (ImageView) findViewById(R.id.glassesImg); hat = (ImageView) findViewById(R.id.hatImg); mouth = (ImageView) findViewById(R.id.mouthImg); mustache = (ImageView) findViewById(R.id.mustacheImg); nose = (ImageView) findViewById(R.id.noseImg); shoe = (ImageView) findViewById(R.id.shoesImg); // Check for saved instance if (savedInstanceState != null) { hm = (HashMap<String, Boolean>) savedInstanceState.getSerializable("hm"); // Loop trough the HashMap to check for changed visbilities for (HashMap.Entry<String, Boolean> entry : hm.entrySet()) { // Make a case for every available String inside the HashMap switch(entry.getKey()) { case "arm": // Set visible if Boolean is True and invisible if False if (entry.getValue() == TRUE) arm.setVisibility(View.VISIBLE); else arm.setVisibility(View.GONE); case "ear": if (entry.getValue() == TRUE) ear.setVisibility(View.VISIBLE); else ear.setVisibility(View.GONE); case "eyebrow": if (entry.getValue() == TRUE) eyebrow.setVisibility(View.VISIBLE); else eyebrow.setVisibility(View.GONE); case "eye": if (entry.getValue() == TRUE) eye.setVisibility(View.VISIBLE); else eye.setVisibility(View.GONE); case "glass": if (entry.getValue() == TRUE) glass.setVisibility(View.VISIBLE); else glass.setVisibility(View.GONE); case "hat": if (entry.getValue() == TRUE) hat.setVisibility(View.VISIBLE); else hat.setVisibility(View.GONE); case "mouth": if (entry.getValue() == TRUE) mouth.setVisibility(View.VISIBLE); else mouth.setVisibility(View.GONE); case "mustache": if (entry.getValue() == TRUE) mustache.setVisibility(View.VISIBLE); else mustache.setVisibility(View.GONE); case "nose": if (entry.getValue() == TRUE) nose.setVisibility(View.VISIBLE); else nose.setVisibility(View.GONE); case "shoe": if (entry.getValue() == TRUE) shoe.setVisibility(View.VISIBLE); else shoe.setVisibility(View.GONE); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void save() {\n File file = new File(main.myPath + \"state.xml\");\n Framework.backup(main.myPath + \"state.xml\");\n Framework.transform(stateDoc, new StreamResult(file), null);\n setDirty(false);\n }", "@Override\r\n protected XMLSave createXMLSave() {\r\n prepareSave();\r\n return super.createXMLSave();\r\n }", "public void saveState() { }", "private void serializeBeforeOpen() {\r\n sr.save(this.path);\r\n }", "public void saveState() {\n\t\tsuper.saveState();\n\t}", "@Override\n\tpublic void restoreDataStateFromXml(Element root) {\n\t\t//do nothing\n\t}", "public void readState() {\n FileInputStream stream;\n XmlPullParser parser;\n int type;\n int oldVersion = -1;\n synchronized (this.mFile) {\n synchronized (this) {\n try {\n stream = this.mFile.openRead();\n this.mUidStates.clear();\n try {\n parser = Xml.newPullParser();\n parser.setInput(stream, StandardCharsets.UTF_8.name());\n } catch (IllegalStateException e) {\n Slog.w(TAG, \"Failed parsing \" + e);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (NullPointerException e2) {\n Slog.w(TAG, \"Failed parsing \" + e2);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (NumberFormatException e3) {\n Slog.w(TAG, \"Failed parsing \" + e3);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (XmlPullParserException e4) {\n Slog.w(TAG, \"Failed parsing \" + e4);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (IOException e5) {\n Slog.w(TAG, \"Failed parsing \" + e5);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (IndexOutOfBoundsException e6) {\n Slog.w(TAG, \"Failed parsing \" + e6);\n if (0 == 0) {\n this.mUidStates.clear();\n }\n stream.close();\n } catch (Throwable th) {\n if (0 == 0) {\n this.mUidStates.clear();\n }\n try {\n stream.close();\n } catch (IOException e7) {\n }\n throw th;\n }\n } catch (FileNotFoundException e8) {\n Slog.i(TAG, \"No existing app ops \" + this.mFile.getBaseFile() + \"; starting empty\");\n return;\n }\n while (true) {\n type = parser.next();\n if (type == 2 || type == 1) {\n break;\n }\n }\n if (type == 2) {\n String versionString = parser.getAttributeValue(null, \"v\");\n if (versionString != null) {\n oldVersion = Integer.parseInt(versionString);\n }\n int outerDepth = parser.getDepth();\n while (true) {\n int type2 = parser.next();\n if (type2 == 1 || (type2 == 3 && parser.getDepth() <= outerDepth)) {\n break;\n } else if (type2 != 3) {\n if (type2 != 4) {\n String tagName = parser.getName();\n if (tagName.equals(\"pkg\")) {\n readPackage(parser);\n } else if (tagName.equals(WatchlistLoggingHandler.WatchlistEventKeys.UID)) {\n readUidOps(parser);\n } else {\n Slog.w(TAG, \"Unknown element under <app-ops>: \" + parser.getName());\n XmlUtils.skipCurrentTag(parser);\n }\n }\n }\n }\n if (1 == 0) {\n this.mUidStates.clear();\n }\n try {\n stream.close();\n } catch (IOException e9) {\n }\n } else {\n throw new IllegalStateException(\"no start tag found\");\n }\n }\n }\n synchronized (this) {\n upgradeLocked(oldVersion);\n }\n }", "protected void serializeState() {\n\t\tint ii = 0;\n\t\t\n\t\tfor(GEditorPanel gep : editorPanels) {\n\t\t\tif(gep.getFilePath() != null && gep.getFilePath().length() > 0) {\n\t\t\t\tPreference.PREFERENCES_NODE.put(\"editSession\" + ++ii, gep.getFilePath());\n\t\t\t}\n\t\t}\n\t\t\n\t\tAccessors.INT_ACCESSOR.put(\"numberOfFiles\", ii);\n\t}", "public static String saveState() {\n \n // 1) Encode the state to XML\n ByteArrayOutputStream bout = new ByteArrayOutputStream();\n StaticsXMLEncoder encoder = new StaticsXMLEncoder(bout);\n encoder.writeObject(Exercise.getExercise().getState());\n encoder.close();\n byte[] xmlData = bout.toByteArray();\n \n // 2) Zip it\n Deflater deflater = new Deflater();\n deflater.setInput(xmlData);\n deflater.finish();\n \n ByteArrayOutputStream zout = new ByteArrayOutputStream();\n byte[] partialData = new byte[1024];\n int dataCompressed;\n while ((dataCompressed = deflater.deflate(partialData)) != 0) {\n zout.write(partialData, 0, dataCompressed);\n }\n \n byte[] compressedData = zout.toByteArray();\n deflater.deflate(compressedData);\n \n // 3) Encode it with Base64 for convenience\n String encodedData = Base64.encodeBytes(compressedData);\n return encodedData;\n }", "public void save() {\n JAXB.marshal(this, new File(fileName));\n }", "public void load() throws SAXException, IOException {\n\t\tif (!reader.fileLocation().equals(saveLocation)) {\n\t\t\treader.fileLocation(saveLocation);\n\t\t}\n\t\t\n\t\treader.read();\n\t\tgenerator.document(reader.document());\n\t}", "public void saveState() \n\t{\n\t\tsuper.saveState();\n\t}", "public static void loadState(String stateData) {\n \n // 1) Decode the data with Base64\n byte[] compressedData = Base64.decode(stateData);\n \n // 2) Unzip it\n Inflater inflater = new Inflater();\n inflater.setInput(compressedData);\n ByteArrayOutputStream zout = new ByteArrayOutputStream();\n try {\n int dataDecompressed;\n byte[] partialData = new byte[1024];\n while ((dataDecompressed = inflater.inflate(partialData)) != 0) {\n zout.write(partialData, 0, dataDecompressed);\n }\n } catch (DataFormatException ex) {\n throw new IllegalArgumentException(\"State data did not include a valid state \");\n }\n byte[] xmlData = zout.toByteArray();\n \n // 3) Decode and activate the state\n ByteArrayInputStream bin = new ByteArrayInputStream(xmlData);\n StaticsXMLDecoder decoder = new StaticsXMLDecoder(bin);\n ExerciseState state = (ExerciseState) decoder.readObject();\n \n // init the exercise so that everything is kosher.\n Exercise.getExercise().initExercise();\n \n // now update UI elements\n for (TitledDraggablePopupWindow popup : InterfaceRoot.getInstance().getAllPopupWindows()) {\n if (popup instanceof DescriptionWindow) {\n ((DescriptionWindow) popup).update();\n }\n if (popup instanceof KnownLoadsWindow) {\n ((KnownLoadsWindow) popup).update();\n }\n }\n \n }", "private void importState() {\n SpeakerManager s = new SpeakerManager();\n this.speakerManager = s.importState();\n\n RoomManager r = new RoomManager();\n this.roomManager = r.importState();\n\n OrganizerManager o = new OrganizerManager();\n this.organizerManager = o.importState();\n\n EventManager e = new EventManager();\n this.eventManager = e.importState();\n\n ChatManager c = new ChatManager();\n this.chatManager = c.importState();\n\n AttendeeManager a = new AttendeeManager();\n this.attendeeManager = a.importState();\n\n\n }", "private void loadSnapshot()\n {\n m_snapshotDoc = null;\n m_Element = null;\n m_ElementStatus = null;\n m_bOffline = false;\n try\n {\n File snapshot = new File(MainFrame.getConfig().getUserPath(),\n SNAPSHOTFILE);\n if(snapshot.exists())\n {\n DocumentBuilder db = RXFileTracker.getDocumentBuilder();\n m_snapshotDoc = db.parse(snapshot.getPath());\n m_Element = m_snapshotDoc.getDocumentElement();\n }\n }\n catch(SAXException | IOException ioe)\n {\n log.error(PSExceptionUtils.getMessageForLog(ioe));\n }\n\n }", "public void load() ;", "@Override\r\n\tpublic void load() {\n\t\ts.load();\r\n\r\n\t}", "public void savetoxml() throws FileNotFoundException, JAXBException {\n xml_methods.save(player);\n }", "void setupAppState() {\n // Attempt to load existing config\n app_state = new AppState();\n app_state.loadConfiguration();\n\n // Force user to select a folder where journal will be stored (if not selected already)\n if (!app_state.configurationExists()) {\n DirectoryChooser directory_chooser = new DirectoryChooser();\n directory_chooser.setTitle(\"Journal location\");\n\n // We have to use new window\n StackPane root = new StackPane();\n Stage stage = new Stage();\n stage.setTitle(\"New Stage Title\");\n stage.setScene(new Scene(root, 150, 150));\n\n File selected_directory = directory_chooser.showDialog(stage.getScene().getWindow());\n if (selected_directory != null) {\n Path dir = selected_directory.toPath();\n app_state.changeConfiguration(dir.toString(), \"Journal\");\n } else {\n Helpers.alertErrorExit(\"No journal directory was selected!\");\n }\n\n stage.close();\n }\n\n app_state.loadTree();\n TreeItem<FileTree> root = new TreeItem<>(app_state.file_tree);\n note_tree.setRoot(root);\n\n try {\n fillTreeView(root);\n } catch (IOException e) {\n Helpers.alertErrorExit(\"Couldn't load a note image!\");\n }\n }", "private void storeState() throws IOException {\n for (File outputFile : processedOutputs.keySet()) {\n if (state.outputs.get(outputFile) == null) {\n state.outputs.put(outputFile, new FileState(outputFile));\n }\n }\n\n File parent = stateFile.getParentFile();\n if (!parent.isDirectory() && !parent.mkdirs()) {\n throw new IOException(\"Could not create direcotyr \" + parent);\n }\n\n ObjectOutputStream os =\n new ObjectOutputStream(new GZIPOutputStream(new BufferedOutputStream(new FileOutputStream(\n stateFile))));\n try {\n os.writeObject(state);\n } finally {\n try {\n os.close();\n } catch (IOException e) {\n // ignore secondary exception\n }\n }\n }", "public void load() {\n\t}", "private Bundle saveState() {\n Bundle state = new Bundle();\n // For Example\n //state.putString(\"text\", tv1.getText().toString());\n onSaveState(state);\n return state;\n }", "public void saveCurrentUserState(){\n\t\tCurrentUserState currState = new CurrentUserState();\n\t\tcurrState.setBatchOutput(batchState.getBatchOutput());\n\t\tcurrState.setCurrFields(batchState.getFields());\n\t\tcurrState.setCurrProject(batchState.getProject());\n\t\tcurrState.setCurrScale(display.getScale());\n\t\tcurrState.setCurrSelectedCell(batchState.getSelectedCell());\n\t\tcurrState.setErrorCells(batchState.getErrors());\n\t\t\n\t\tcurrState.setHighlight(display.isToggleOn());\n\t\tcurrState.setInverted(display.isInverted());\n\t\t\n\t\tcurrState.setCurrWindowPos(getLocationOnScreen());\n\t\tcurrState.setCurrWindowSize(getSize());\n\t\t\n\t\tcurrState.setHorizontalDiv(bottomPanel.getDividerLocation());\n\t\tcurrState.setVertivalDiv(centerPanel.getDividerLocation());\n\t\t\n\t\tcurrState.setOriginX(display.getW_originX());\n\t\tcurrState.setOriginY(display.getW_originY());\n\t\t\n\t\tcurrState.setValues(batchState.getValues());\n\t\t\n\t\t//put to xstream\n\t\tXStream xstream = new XStream(new DomDriver());\n\t\ttry {\n\t\t\n\t\t\txstream.toXML(currState, new FileOutputStream(new File(info.getUsername() + \".xml\")));\n\t\t\tSystem.out.println(\"current state is saved!\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"file not found/ couldn't go to xml\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public XmlManager(String saveLocation) throws TransformerConfigurationException, ParserConfigurationException, SAXException, IOException {\n\t\tthis(saveLocation, new XmlGenerator(), new XmlReader(saveLocation));\n\t}", "private void saveStateToArguments() {\n if (getView() != null)\n savedState = saveState();\n if (savedState != null) {\n Bundle b = getArguments();\n if (b != null)\n b.putBundle(\"internalSavedViewState8954201239547\", savedState);\n }\n }", "@Override\n\tpublic Element saveToXml(boolean includeConfigState) {\n\t\treturn null;\n\t}", "State(Main aMain) {\n\tmain = aMain;\n\tback = Integer.parseInt(main.myProps.getProperty(\"yesterdays\"));\n\tfront = Integer.parseInt(main.myProps.getProperty(\"tomorrows\"));\n\tmaps = new Hashtable();\n availWeath = new Hashtable();\n\n main.myFrw.listen(new MapListener(), ScaledMap.TYPE, null);\n main.myFrw.announce(this);\n stateDoc = Framework.parse(main.myPath + \"state.xml\", \"state\");\n availWeath = loadFromDoc();\n }", "public void load() {\n }", "public void saveState() {\n\t\tFileOutputStream fos = null;\n\t\tObjectOutputStream out = null;\n\t\ttry {\n\t\t\tFile savefile = new File(getServletContext().getRealPath(\"/WEB-INF/\"), SAVED_RECEPTOR_FILE_NAME);\n\t\t\tfos = new FileOutputStream(savefile);\n\t\t\tout = new ObjectOutputStream(fos);\n\t\t\tout.writeObject(pgtMap);\n\t\t\tout.close();\n\t\t} catch (IOException ex) {\n\t\t\tSystem.err.println(\"IO Exception saving proxyTicket cache\");\n\t\t\tex.printStackTrace();\n\t\t} catch (Exception e) { //don't think this is possible, but I'm seeing some goofy behavior, so...\n\t\t\tSystem.err.println(\"Non-IO Exception saving proxyTicket cache\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void loadData(){\n try {\n entities.clear();\n\n DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();\n DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();\n Document document = documentBuilder.parse(fileName);\n\n Node root = document.getDocumentElement();\n NodeList nodeList = root.getChildNodes();\n for (int i = 0; i < nodeList.getLength(); i++){\n Node node = nodeList.item(i);\n if (node.getNodeType() == Node.ELEMENT_NODE){\n Element element = (Element) node;\n Department department = createDepartmentFromElement(element);\n try{\n super.save(department);\n } catch (RepositoryException | ValidatorException e) {\n e.printStackTrace();\n }\n }\n }\n } catch (SAXException | ParserConfigurationException | IOException e) {\n e.printStackTrace();\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void restore(Context context){\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = context.openFileInput(\"state.bin\");\n\t\t\tObjectInputStream is = new ObjectInputStream(fis);\n\t\t\tlist = (ArrayList<CounterModel>) is.readObject();\n\t\t\tis.close();\t\n\t\t} catch(FileNotFoundException fnfe){\n\t\t\treturn;\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n public void load() {\n }", "public void setUpLoading() throws JDOMException, XMLException {\r\n\t\tthis.loadingMain = new LoadingGameMain(true, testingXML);\r\n\t\tthis.loadingMasterObj = loadingMain.getLoadMasterObj();\r\n\t\tthis.loadingHelper = loadingMain.getHelper();\r\n\t}", "private void saveToStorage() {\n FileOutputStream fos = null;\n try {\n fos = context.openFileOutput(\"GeoFences\", Context.MODE_PRIVATE);\n ObjectOutputStream oos = new ObjectOutputStream(fos);\n oos.writeObject(currentList);\n oos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n public void saveState(Bundle outBundle) {\n }", "private SavedState(Parcel parcel) {\n super(parcel);\n boolean bl2 = parcel.readInt() != 0;\n this.isOpen = bl2;\n }", "@Override\n\tpublic Element saveDataStateToXml(boolean isTransactionState) {\n\t\treturn null;\n\t}", "public void load();", "public void load();", "public void save(Context context){\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = context.openFileOutput(\"state.bin\", Context.MODE_PRIVATE);\n\t\t\tObjectOutputStream os = new ObjectOutputStream(fos);\n\t\t\tos.writeObject(this.list);\n\t\t\tos.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private static Element getXML(State state) {\n\t\tElement stateEle = new Element(\"State\");\n\t\tstateEle.setAttribute(\"Name\", state.getName());\n\t\tstateEle.setAttribute(\"x\", String.valueOf(state.getPoint().x));\n\t\tstateEle.setAttribute(\"y\", String.valueOf(state.getPoint().y));\n\t\treturn stateEle;\n\t}", "private void initializeXml() {\n Bundle bundle = this.getIntent().getExtras();\n\n // Texts.\n dateText = (TextView)findViewById(R.id.date_text);\n typeText = (TextView)findViewById(R.id.packet_type_text);\n sourceAddressText = (TextView)findViewById(R.id.source_address_text);\n packetDataText = (TextView)findViewById(R.id.packet_data_text);\n\n dateText.setText(bundle.getString(\"date\"));\n typeText.setText(bundle.getString(\"type\"));\n sourceAddressText.setText(bundle.getString(\"sourceAddress\"));\n data = bundle.getString(\"packetData\");\n packetDataText.setText(data);\n\n // Buttons.\n Button compareButton = (Button)findViewById(R.id.compare_button);\n compareButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n handleCompareButtonPressed();\n }\n });\n }", "public FileXmlStateRestorer(StatePersistenceLogger logger)\r\n {\r\n this.logger = logger;\r\n }", "void load();", "void load();", "@Override\r\n\tprotected void load() {\n\t\t\r\n\t}", "private void loadStateDatabase() {\n new Thread( new Runnable() {\n public void run() {\n try {\n loadStates();\n } catch ( final IOException e ) {\n throw new RuntimeException( e );\n }\n }\n }).start();\n }", "public void loadDefault() throws Exception {\r\n\t\tURL tsurl = getClass().getResource(\"/task_states.xml\");\r\n\t\tfromXml(tsurl.openStream());\r\n\t}", "public void loadFromLocalStorage() {\n\t\t\n\t}", "@Override\r\n\tpublic void load() {\n\r\n\t}", "@Override\n\tpublic void onSaveInstanceState(Bundle savedInstanceState) {\n\t savedInstanceState.putBoolean(HAS_RUN, true);\t \n\t //savedInstanceState.putParcelable(MODEL_DATA, dS);\n\t Log.i(\"MAIN\",\"Saved instances\");\n\t // Always call the superclass so it can save the view hierarchy state\n\t super.onSaveInstanceState(savedInstanceState);\n\t}", "@Override\r\n\tpublic void load() {\n\t}", "private void saveState() {\r\n \tSharedPreferences settings = getSharedPreferences(TEMP, 0);\r\n \tEditor editor = settings.edit();\r\n \tif (mRowId != null)\r\n \t\teditor.putLong(DbAdapter.KEY_ROWID, mRowId);\r\n \teditor.putLong(DbAdapter.KEY_DATE, mTime);\r\n \teditor.putString(DbAdapter.KEY_PAYEE, mPayeeText != null && \r\n \t\t\tmPayeeText.getText() != null ? mPayeeText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_AMOUNT, mAmountText != null && \r\n \t\t\tmAmountText.getText() != null ? mAmountText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_CATEGORY, mCategoryText != null && \r\n \t\t\tmCategoryText.getText() != null ? mCategoryText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_MEMO, mMemoText != null && \r\n \t\t\tmMemoText.getText() != null ? mMemoText.getText().toString() : null);\r\n \teditor.putString(DbAdapter.KEY_TAG, mTagText != null && \r\n \t\t\tmTagText.getText() != null ? mTagText.getText().toString() : null);\r\n \teditor.commit();\r\n }", "public void writeState() {\n Throwable th;\n String str;\n String str2;\n IOException e;\n IOException e2;\n List<AppOpsManager.PackageOps> allOps;\n Throwable th2;\n String lastPkg;\n List<AppOpsManager.PackageOps> allOps2;\n String lastPkg2;\n List<AppOpsManager.PackageOps> allOps3;\n String proxyPkg;\n synchronized (this.mFile) {\n try {\n FileOutputStream stream = this.mFile.startWrite();\n String str3 = null;\n List<AppOpsManager.PackageOps> allOps4 = getPackagesForOps(null);\n try {\n XmlSerializer out = new FastXmlSerializer();\n out.setOutput(stream, StandardCharsets.UTF_8.name());\n out.startDocument(null, true);\n out.startTag(null, \"app-ops\");\n out.attribute(null, \"v\", String.valueOf(1));\n synchronized (this) {\n try {\n int uidStateCount = this.mUidStates.size();\n for (int i = 0; i < uidStateCount; i++) {\n try {\n UidState uidState = this.mUidStates.valueAt(i);\n if (uidState.opModes != null && uidState.opModes.size() > 0) {\n out.startTag(null, WatchlistLoggingHandler.WatchlistEventKeys.UID);\n out.attribute(null, \"n\", Integer.toString(uidState.uid));\n SparseIntArray uidOpModes = uidState.opModes;\n int opCount = uidOpModes.size();\n for (int j = 0; j < opCount; j++) {\n int op = uidOpModes.keyAt(j);\n int mode = uidOpModes.valueAt(j);\n out.startTag(null, \"op\");\n out.attribute(null, \"n\", Integer.toString(op));\n out.attribute(null, \"m\", Integer.toString(mode));\n out.endTag(null, \"op\");\n }\n out.endTag(null, WatchlistLoggingHandler.WatchlistEventKeys.UID);\n }\n } catch (Throwable th3) {\n e2 = th3;\n while (true) {\n try {\n break;\n } catch (Throwable th4) {\n e2 = th4;\n }\n }\n throw e2;\n }\n }\n } catch (Throwable th5) {\n e2 = th5;\n while (true) {\n break;\n }\n throw e2;\n }\n }\n if (allOps4 != null) {\n String lastPkg3 = null;\n boolean z = false;\n int i2 = 0;\n while (i2 < allOps4.size()) {\n AppOpsManager.PackageOps pkg = allOps4.get(i2);\n if (pkg.getPackageName() == null) {\n allOps = allOps4;\n } else {\n if (!pkg.getPackageName().equals(lastPkg3)) {\n if (lastPkg3 != null) {\n try {\n out.endTag(str3, \"pkg\");\n } catch (IOException e3) {\n e = e3;\n try {\n Slog.w(TAG, \"Failed to write state, restoring backup.\", e);\n this.mFile.failWrite(stream);\n if (stream != null) {\n }\n } catch (Throwable th6) {\n th = th6;\n if (stream != null) {\n try {\n stream.close();\n } catch (IOException e4) {\n Slog.w(TAG, \"Failed to close stream: \" + e4.getMessage());\n }\n }\n throw th;\n }\n } catch (Throwable th7) {\n th = th7;\n if (stream != null) {\n }\n throw th;\n }\n }\n lastPkg3 = pkg.getPackageName();\n out.startTag(str3, \"pkg\");\n out.attribute(str3, \"n\", lastPkg3);\n }\n out.startTag(str3, WatchlistLoggingHandler.WatchlistEventKeys.UID);\n out.attribute(str3, \"n\", Integer.toString(pkg.getUid()));\n synchronized (this) {\n try {\n Ops ops = getOpsRawLocked(pkg.getUid(), pkg.getPackageName(), z, z);\n if (ops != null) {\n try {\n out.attribute(str3, \"p\", Boolean.toString(ops.isPrivileged));\n } catch (Throwable th8) {\n th2 = th8;\n }\n } else {\n out.attribute(str3, \"p\", Boolean.toString(z));\n }\n } catch (Throwable th9) {\n th2 = th9;\n while (true) {\n try {\n break;\n } catch (Throwable th10) {\n th2 = th10;\n }\n }\n throw th2;\n }\n }\n List<AppOpsManager.OpEntry> ops2 = pkg.getOps();\n int j2 = z;\n while (j2 < ops2.size()) {\n AppOpsManager.OpEntry op2 = ops2.get(j2 == true ? 1 : 0);\n out.startTag(str3, \"op\");\n out.attribute(str3, \"n\", Integer.toString(op2.getOp()));\n if (op2.getMode() != AppOpsManager.opToDefaultMode(op2.getOp())) {\n out.attribute(str3, \"m\", Integer.toString(op2.getMode()));\n }\n LongSparseArray keys = op2.collectKeys();\n if (keys == null) {\n allOps2 = allOps4;\n lastPkg = lastPkg3;\n } else if (keys.size() <= 0) {\n allOps2 = allOps4;\n lastPkg = lastPkg3;\n } else {\n int keyCount = keys.size();\n int k = 0;\n while (k < keyCount) {\n long key = keys.keyAt(k);\n int uidState2 = AppOpsManager.extractUidStateFromKey(key);\n int flags = AppOpsManager.extractFlagsFromKey(key);\n long accessTime = op2.getLastAccessTime(uidState2, uidState2, flags);\n long rejectTime = op2.getLastRejectTime(uidState2, uidState2, flags);\n long accessDuration = op2.getLastDuration(uidState2, uidState2, flags);\n String proxyPkg2 = op2.getProxyPackageName(uidState2, flags);\n int proxyUid = op2.getProxyUid(uidState2, flags);\n if (accessTime > 0 || rejectTime > 0 || accessDuration > 0) {\n proxyPkg = proxyPkg2;\n } else {\n proxyPkg = proxyPkg2;\n if (proxyPkg == null && proxyUid < 0) {\n allOps3 = allOps4;\n lastPkg2 = lastPkg3;\n k++;\n allOps4 = allOps3;\n lastPkg3 = lastPkg2;\n }\n }\n allOps3 = allOps4;\n lastPkg2 = lastPkg3;\n try {\n out.startTag(null, \"st\");\n out.attribute(null, \"n\", Long.toString(key));\n if (accessTime > 0) {\n out.attribute(null, \"t\", Long.toString(accessTime));\n }\n if (rejectTime > 0) {\n out.attribute(null, \"r\", Long.toString(rejectTime));\n }\n if (accessDuration > 0) {\n out.attribute(null, \"d\", Long.toString(accessDuration));\n }\n if (proxyPkg != null) {\n out.attribute(null, \"pp\", proxyPkg);\n }\n if (proxyUid >= 0) {\n out.attribute(null, \"pu\", Integer.toString(proxyUid));\n }\n out.endTag(null, \"st\");\n k++;\n allOps4 = allOps3;\n lastPkg3 = lastPkg2;\n } catch (IOException e5) {\n e = e5;\n Slog.w(TAG, \"Failed to write state, restoring backup.\", e);\n this.mFile.failWrite(stream);\n if (stream != null) {\n }\n }\n }\n allOps2 = allOps4;\n lastPkg = lastPkg3;\n out.endTag(null, \"op\");\n allOps4 = allOps2;\n lastPkg3 = lastPkg;\n str3 = null;\n j2++;\n }\n out.endTag(null, \"op\");\n allOps4 = allOps2;\n lastPkg3 = lastPkg;\n str3 = null;\n j2++;\n }\n allOps = allOps4;\n out.endTag(null, WatchlistLoggingHandler.WatchlistEventKeys.UID);\n lastPkg3 = lastPkg3;\n }\n i2++;\n allOps4 = allOps;\n str3 = null;\n z = false;\n }\n if (lastPkg3 != null) {\n out.endTag(null, \"pkg\");\n }\n }\n out.endTag(null, \"app-ops\");\n out.endDocument();\n this.mFile.finishWrite(stream);\n out.flush();\n if (stream != null) {\n try {\n stream.close();\n } catch (IOException e6) {\n str2 = TAG;\n str = \"Failed to close stream: \" + e6.getMessage();\n }\n }\n } catch (IOException e7) {\n e = e7;\n Slog.w(TAG, \"Failed to write state, restoring backup.\", e);\n this.mFile.failWrite(stream);\n if (stream != null) {\n try {\n stream.close();\n } catch (IOException e8) {\n str2 = TAG;\n str = \"Failed to close stream: \" + e8.getMessage();\n }\n }\n } catch (Throwable th11) {\n th = th11;\n if (stream != null) {\n }\n throw th;\n }\n } catch (IOException e9) {\n Slog.w(TAG, \"Failed to write state: \" + e9);\n return;\n }\n }\n Slog.w(str2, str);\n }", "public void Serialization() {\n\t\tGitlet myGitlet = new Gitlet(1);\n\t\tmyGitlet.myBranch = this.myBranch;\n\t\tmyGitlet.myCommit = this.myCommit;\n\t\tmyGitlet.messageMap = this.messageMap;\n\t\tmyGitlet.myHead = this.myHead;\n\t\tmyGitlet.stagedFiles = this.stagedFiles;\n\t\tmyGitlet.tracked = this.tracked;\n\t\tmyGitlet.stagePath = this.stagePath;\n\t\tmyGitlet.ID = this.ID;\n\t\tmyGitlet.currentBranch = this.currentBranch;\n\t\tmyGitlet.untrackedFiles = this.untrackedFiles;\n\t\tmyGitlet.conflictState = this.conflictState;\n\t\ttry {\n\t\t\tFileOutputStream fileOut = new FileOutputStream(\n\t\t\t\t\t\".gitlet/Serialization.ser\");\n\t\t\tObjectOutputStream outStream = new ObjectOutputStream(fileOut);\n\t\t\toutStream.writeObject(myGitlet);\n\t\t\toutStream.close();\n\t\t\tfileOut.close();\n\n\t\t} catch (IOException i) {\n\t\t\ti.printStackTrace();\n\t\t}\n\n\t}", "private void backupState(BPState curState, FileProcess fileState) {\n\n\t\tprogram.generageCFG(\"/asm/cfg/\" + program.getFileName() + \"_test\");\n\t\tprogram.getResultFileTemp().appendInLine(\n\t\t\t\tprogram.getDetailTechnique() + \" Nodes:\" + program.getBPCFG().getVertexCount() + \" Edges:\"\n\t\t\t\t\t\t+ program.getBPCFG().getEdgeCount() + \" \");\n\t\t//System.out.println();\n\t}", "public void loading() {\n if (state == null) {\n state = new NodeState();\n }\n state.setState(ENodeState.Loading);\n }", "public XMLData () {\r\n\r\n //code description\r\n\r\n try {\r\n DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();\r\n this.document = builder.newDocument(); \r\n }\r\n catch (ParserConfigurationException err) {}\r\n\r\n }", "public static final void prepareInstance() {\r\n prepareInstance(new XmlFactory());\r\n }", "public void loadDocument() {\n\t\ttry {\n\t\t\tString defaultDirectory = Utils.lastVisitedDirectory;\n\t\t\tif (Utils.lastVisitedDocumentDirectory != null)\n\t\t\t\tdefaultDirectory = Utils.lastVisitedDocumentDirectory;\n\n\t\t\tJFileChooser fileChooser = new JFileChooser(defaultDirectory);\n\t\t\tint returnVal = fileChooser.showOpenDialog(new JFrame());\n\n\t\t\tif (returnVal != JFileChooser.APPROVE_OPTION) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tURL fileURL = fileChooser.getSelectedFile().toURL();\n\n\t\t\t((XsdTreeStructImpl) xsdTree).loadDocument(fileURL);\n\t\t\txsdTree.getMessageManager().sendMessage(\"XML document \" + fileURL + \" loaded.\", MessageManagerInt.simpleMessage);\n\t\t} catch (IOException urie) {\n\n\t\t} catch (SAXException saxe) {\n\n\t\t}\n\t\texampleLine = null;\n\t\t// updatePreview();\n\t}", "public void saveState() throws IOException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// create new file if it doesnt exist\n\t\tf.createNewFile();\n\t\t\n\t\t// dump client state into file\n\t\tObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(f));\n\t\tos.writeObject(this);\n\t\tos.close();\n\t}", "public void loadState() throws IOException, ClassNotFoundException {\n\t\tFile f = new File(workingDirectory() + File.separator + id() + FILE_EXTENSION);\n\t\t\n\t\t// load client state from file\n\t\tObjectInputStream is = new ObjectInputStream(new FileInputStream(f));\n\t\tTrackerDaemon client = (TrackerDaemon) is.readObject();\n\t\tis.close();\n\t\t\n\t\t// copy attributes\n\t\tthis.peerRecord = client.peerRecord();\n\t\t\n\t}", "@Override\n public void load() {\n }", "private void initAndSaveGrid(GridGame game) {\n\t\tgame.modeler = createDumbInitModeler(trainingData );\n\t\tint i = 0;\n\t\tfor (TransitionMemory tm : trainingData) {\n\t\t\tif (i++ > 10) break; // just a few to learn the\n\t\t\tgame.modeler.saveMemory(tm);\n\t\t}\n\t\tgame.modeler.learnFromMemory(0, 0, 0, false, 1, 10000); // just to get node dimensions\n\t\tUtils.saveObjectToFile(GRID_FILE, SerializableGridGame.create(game));\n\t\tif (Utils.loadObjectFromFile(GRID_FILE) == null) System.out.println(\"Problem saving grid\");\n\t}", "void saveConfig() {\r\n\t\ttry {\r\n\t\t\tPrintWriter out = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(\"open-ig-mapeditor-config.xml\"), 64 * 1024), \"UTF-8\"));\r\n\t\t\ttry {\r\n\t\t\t\tout.printf(\"<?xml version='1.0' encoding='UTF-8'?>%n\");\r\n\t\t\t\tout.printf(\"<mapeditor-config>%n\");\r\n\t\t\t\tout.printf(\" <window x='%d' y='%d' width='%d' height='%d' state='%d'/>%n\", getX(), getY(), getWidth(), getHeight(), getExtendedState());\r\n\t\t\t\tout.printf(\" <language id='%s'/>%n\", ui.languageEn.isSelected() ? \"en\" : \"hu\");\r\n\t\t\t\tout.printf(\" <splitters main='%d' preview='%d' surfaces='%d'/>%n\", split.getDividerLocation(), toolSplit.getDividerLocation(), featuresSplit.getDividerLocation());\r\n\t\t\t\tout.printf(\" <editmode type='%s'/>%n\", ui.buildButton.isSelected());\r\n\t\t\t\tout.printf(\" <tabs selected='%d'/>%n\", propertyTab.getSelectedIndex());\r\n\t\t\t\tout.printf(\" <lights preview='%d' map='%s'/>%n\", alphaSlider.getValue(), Float.toString(alpha));\r\n\t\t\t\tout.printf(\" <filter surface='%s' building='%s'/>%n\", XML.toHTML(filterSurface.getText()), XML.toHTML(filterBuilding.getText()));\r\n\t\t\t\tout.printf(\" <allocation worker='%s' strategy='%d'/>%n\", ui.allocationPanel.availableWorkers.getText(), ui.allocationPanel.strategies.getSelectedIndex());\r\n\t\t\t\tout.printf(\" <view buildings='%s' minimap='%s' textboxes='%s' zoom='%s' standard-fonts='%s' placement-hints='%s'/>%n\", ui.viewShowBuildings.isSelected(), \r\n\t\t\t\t\t\tui.viewSymbolicBuildings.isSelected(), ui.viewTextBackgrounds.isSelected(), Double.toString(renderer.scale), ui.viewStandardFonts.isSelected()\r\n\t\t\t\t\t\t, ui.viewPlacementHints.isSelected());\r\n\t\t\t\tout.printf(\" <custom-surface-names>%n\");\r\n\t\t\t\tfor (TileEntry te : surfaceTableModel.rows) {\r\n\t\t\t\t\tout.printf(\" <tile id='%s' type='%s' name='%s'/>%n\", te.id, XML.toHTML(te.surface), XML.toHTML(te.name));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </custom-surface-names>%n\");\r\n\t\t\t\tout.printf(\" <custom-building-names>%n\");\r\n\t\t\t\tfor (TileEntry te : buildingTableModel.rows) {\r\n\t\t\t\t\tout.printf(\" <tile id='%s' type='%s' name='%s'/>%n\", te.id, XML.toHTML(te.surface), XML.toHTML(te.name));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </custom-building-names>%n\");\r\n\t\t\t\tout.printf(\" <recent>%n\");\r\n\t\t\t\tfor (int i = ui.fileRecent.getItemCount() - 1; i >= 2 ; i--) {\r\n\t\t\t\t\tout.printf(\" <entry file='%s'/>%n\", XML.toHTML(ui.fileRecent.getItem(i).getText()));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </recent>%n\");\r\n\t\t\t\tout.printf(\"</mapeditor-config>%n\");\r\n\t\t\t} finally {\r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}", "protected void prepareSave() {\r\n EObject cur;\r\n for (Iterator<EObject> iter = getAllContents(); iter.hasNext();) {\r\n cur = iter.next();\r\n \r\n EStructuralFeature idAttr = cur.eClass().getEIDAttribute();\r\n if (idAttr != null && !cur.eIsSet(idAttr)) {\r\n cur.eSet(idAttr, EcoreUtil.generateUUID());\r\n }\r\n }\r\n }", "public void save() {\n int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\r\n int minute = Calendar.getInstance().get(Calendar.MINUTE);\r\n\r\n // Hierarchie: 2010/04/05/01_05042010_00002.xml\r\n File dir = getOutputDir();\r\n File f = new File(dir, getCode().replace(' ', '_') + \".xml\");\r\n Element topLevel = new Element(\"ticket\");\r\n topLevel.setAttribute(new Attribute(\"code\", this.getCode()));\r\n topLevel.setAttribute(\"hour\", String.valueOf(hour));\r\n topLevel.setAttribute(\"minute\", String.valueOf(minute));\r\n // Articles\r\n for (Pair<Article, Integer> item : this.items) {\r\n Element e = new Element(\"article\");\r\n e.setAttribute(\"qte\", String.valueOf(item.getSecond()));\r\n // Prix unitaire\r\n e.setAttribute(\"prix\", String.valueOf(item.getFirst().getPriceInCents()));\r\n e.setAttribute(\"prixHT\", String.valueOf(item.getFirst().getPriceHTInCents()));\r\n e.setAttribute(\"idTaxe\", String.valueOf(item.getFirst().getIdTaxe()));\r\n e.setAttribute(\"categorie\", item.getFirst().getCategorie().getName());\r\n e.setAttribute(\"codebarre\", item.getFirst().getCode());\r\n e.setText(item.getFirst().getName());\r\n topLevel.addContent(e);\r\n }\r\n // Paiements\r\n for (Paiement paiement : this.paiements) {\r\n final int montantInCents = paiement.getMontantInCents();\r\n if (montantInCents > 0) {\r\n final Element e = new Element(\"paiement\");\r\n String type = \"\";\r\n if (paiement.getType() == Paiement.CB) {\r\n type = \"CB\";\r\n } else if (paiement.getType() == Paiement.CHEQUE) {\r\n type = \"CHEQUE\";\r\n } else if (paiement.getType() == Paiement.ESPECES) {\r\n type = \"ESPECES\";\r\n }\r\n e.setAttribute(\"type\", type);\r\n e.setAttribute(\"montant\", String.valueOf(montantInCents));\r\n topLevel.addContent(e);\r\n }\r\n\r\n }\r\n try {\r\n final XMLOutputter out = new XMLOutputter(Format.getPrettyFormat());\r\n out.output(topLevel, new FileOutputStream(f));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public void commit() {\n\t\ttry {\n\t\t\tTransformer transformer = TransformerFactory.newInstance().newTransformer();\n\t\t\tDOMSource domSource = new DOMSource(document);\n\t\t\tStreamResult streamResult = new StreamResult(new File(fileName));\n\t\t\ttransformer.transform(domSource, streamResult);\n\t\t\t//Reload nodes list\n\t\t\tnodes = document.getDocumentElement().getChildNodes();\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static void load(){\n }", "public void persist() {\n\t\ttry {\n\t\t\tFileOutputStream fos = this._context.openFileOutput(\n\t\t\t\t\tConstants.CATALOG_XML_FILE_NAME, Context.MODE_PRIVATE);\n\t\t\tfos.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\".getBytes());\n\t\t\tfos.write(\"<orders>\\n\".getBytes());\n\t\t\tfor (int i = 0; i < getOrderEntryCount(); i++) {\n\t\t\t\tOrderEntry oe = getOrderEntry(i);\n\t\t\t\tfos.write(oe.toXMLString().getBytes());\n\t\t\t}\n\t\t\tfos.write(\"</orders>\\n\".getBytes());\n\t\t\tfos.flush();\n\t\t\tfos.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tLog.d(Constants.LOGTAG, \" \" + OrderList.CLASSTAG\n\t\t\t\t\t+ \"Failed to write out file?\" + e.getMessage());\n\t\t}\n\t}", "@Override\r\n\t\t\tprotected void saveContext() {\n\t\t\t\t\r\n\t\t\t}", "public void saveConfigXml() {\n // Save the xml object to disk\n IPathManager pm = PathManagerFactory.getPathManager();\n LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,\n LocalizationLevel.SITE);\n\n LocalizationFile newXmlFile = pm.getLocalizationFile(lc,\n CONFIG_FILE_NAME);\n\n if (newXmlFile.getFile().getParentFile().exists() == false) {\n // System.out.println(\"Creating new directory\");\n\n if (newXmlFile.getFile().getParentFile().mkdirs() == false) {\n // System.out.println(\"Could not create new directory...\");\n }\n }\n\n try {\n // System.out.println(\"Saving -- \"\n // + newXmlFile.getFile().getAbsolutePath());\n jaxb.marshalToXmlFile(configXml, newXmlFile.getFile()\n .getAbsolutePath());\n newXmlFile.save();\n\n lf = newXmlFile;\n } catch (Exception e) {\n statusHandler.handle(Priority.ERROR, \"Couldn't save config file.\",\n e);\n }\n }", "@Override\n\t\tpublic Parcelable saveState() {\n\t\t\treturn null;\n\t\t}", "private GameModel load(String xmlFilePath) throws Exception {\r\n\t\ttry {\r\n\t\t\t// Load Game from XML\r\n\t\t\tJAXBContext context = JAXBContext.newInstance(GameModel.class);\r\n\t\t\tSystem.out.println(\"instance passed \");\r\n\t\t\tUnmarshaller unmarshaller = context.createUnmarshaller();\r\n\t\t\tSystem.out.println(\"marshaller created\");\r\n\t\t\treturn (GameModel) unmarshaller.unmarshal(new File(xmlFilePath));\r\n\r\n\t\t} catch (Exception ex) {\r\n\t\t\t// log the exception, show the error message on UI\r\n\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\tthrow ex;\r\n\t\t}\r\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "@Override\n\tprotected void load() {\n\t\t\n\t}", "public void xmlPresentation () {\n System.out.println ( \"****** XML Data Module ******\" );\n ArrayList<Book> bookArrayList = new ArrayList<Book>();\n Books books = new Books();\n books.setBooks(new ArrayList<Book>());\n\n bookArrayList = new Request().postRequestBook();\n\n for (Book aux: bookArrayList) {\n books.getBooks().add(aux);\n }\n\n try {\n javax.xml.bind.JAXBContext jaxbContext = JAXBContext.newInstance(Books.class);\n Marshaller jaxbMarshaller = jaxbContext.createMarshaller();\n\n jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\n\n jaxbMarshaller.marshal(books, System.out);\n } catch (JAXBException e) {\n System.out.println(\"Error: \"+ e);\n }\n ClientEntry.showMenu ( );\n }", "private void saveState() throws IOException {\n speakerManager.saveState();\n roomManager.saveState();\n organizerManager.saveState();\n eventManager.saveState();\n chatManager.saveState();\n attendeeManager.saveState();\n\n }", "public void loadPersistence() {\n\t\tFile file = new File(\"data.txt\");\n\t\tif (file.length() == 0) { // no persistent data to use\n\t\t\treturn;\n\t\t}\n\t\tdeserializeFile(file);\n\t\tloadPersistentSettings();\n\t}", "public void save(){\n checkpoint = chapter;\n }", "@Override\n\tprotected void load() {\n\n\t}", "@Override\n\tprotected void load() {\n\n\t}", "public List<Element> getState() {\r\n return savedState_;\r\n }", "public void restore(String state) {\n try {\n byte[] data = Base64.getDecoder().decode(state);\n ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(data));\n widgets = new ArrayList<Widget>();\n int cnt = in.readInt(); // size of array list\n// System.out.println(\"widgets: \" + cnt);\n Widget w = null;\n String widgetType = null;\n for (int i=0; i<cnt; i++) {\n widgetType = (String)in.readObject();\n w = WidgetFactory.getInstance().createWidget(widgetType,0,0);\n w.readObject(in, widgetType);\n widgets.add(w);\n PropManager.getInstance().addPropEditor(w.getModel());\n// TreeView.getInstance().addWidget(getKey(), w.getKey());\n }\n in.close();\n selectedCnt = 0;\n selectedGroupCnt = 0;\n repaint();\n } catch (ClassNotFoundException e) {\n System.out.println(\"ClassNotFoundException occurred.\");\n e.printStackTrace();\n } catch (IOException e) {\n System.out.println(\"IOException occurred.\" + e.toString());\n System.out.flush();\n e.printStackTrace();\n }\n }", "public void saveState() {\n mementos = new ArrayList<>(mementos.subList(0, statePointer + 1));\n Notebook notebookToAdd = new Notebook(this.notebook);\n notebookToAdd.setCurrentClassroom(this.notebook.getCurrentClassroom());\n Memento mementoToAdd = new Memento(notebookToAdd);\n mementos.add(mementoToAdd);\n statePointer++;\n }", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void readFromXMLImpl(XMLStreamReader in) throws XMLStreamException {\n super.readAttributes(in);\n \n // Remove this when the 0.9.x save hack (in Game.java) is gone.\n ownerId = in.getAttributeValue(null, \"owner\");\n \n messageType = Enum.valueOf(MessageType.class, getAttribute(in, \"messageType\", MessageType.DEFAULT.toString()));\n beenDisplayed = Boolean.parseBoolean(in.getAttributeValue(null, \"hasBeenDisplayed\"));\n sourceId = in.getAttributeValue(null, \"source\");\n displayId = in.getAttributeValue(null, \"display\");\n \n super.readChildren(in);\n }", "public static void load() {\n load(false);\n }", "private void saveStateSnapshot(State state){\n\t\ttry{\n\t\t\tif(saveStateSnapshot){\n\t\t\t\t//System.out.println(Utils.treeDesc(state, 2, Tags.Role, Tags.Desc, Tags.Shape, Tags.Blocked));\n\t\t\t\tTaggable taggable = new TaggableBase();\n\t\t\t\ttaggable.set(SystemState, state);\n\t\t\t\tLogSerialiser.log(\"Saving state snapshot...\\n\", LogSerialiser.LogLevel.Debug);\n\t\t\t\tFile file = Util.generateUniqueFile(settings.get(ConfigTags.OutputDir), \"state_snapshot\");\n\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)));\n\t\t\t\toos.writeObject(taggable);\n\t\t\t\toos.close();\n\t\t\t\tsaveStateSnapshot = false;\n\t\t\t\tLogSerialiser.log(\"Saved state snapshot to \" + file.getAbsolutePath() + \"\\n\", LogSerialiser.LogLevel.Info);\n\t\t\t}\n\t\t}catch(IOException ioe){\n\t\t\tthrow new RuntimeException(ioe);\n\t\t}\n\t}", "public void saveState() {\n savedPen.setValues(pm.pen);\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState)\n\t{\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\ttry {\n\t\t\tpstate = PersistentState.load(new InputStreamReader(openFileInput(\"history.txt\"), \"UTF-8\"));\n\t\t} catch (FileNotFoundException x) {\n\t\t} catch (UnsupportedEncodingException x) {\n\t\t\tLog.e(\"LunchFundActivity\", \"onCreate\", x);\n\t\t}\n\t\tif (pstate == null)\n\t\t\tpstate = new PersistentState();\n\t\tpstate.clearModified();\n\n\t\tif (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)\n\t\t\tsetContentView(R.layout.landscape);\n\t\telse\n\t\t\tsetContentView(R.layout.main);\n\t\tredraw();\n\t}", "private void saveState() {\n // Increase capacity if necessary\n if (nSaved == savedC.length) {\n Object tmp;\n tmp = savedC;\n savedC = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedC,0,nSaved);\n tmp = savedCT;\n savedCT = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedCT,0,nSaved);\n tmp = savedA;\n savedA = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedA,0,nSaved);\n tmp = savedB;\n savedB = new int[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedB,0,nSaved);\n tmp = savedDelFF;\n savedDelFF = new boolean[nSaved+SAVED_INC];\n System.arraycopy(tmp,0,savedDelFF,0,nSaved);\n }\n // Save the current sate\n savedC[nSaved] = c;\n savedCT[nSaved] = cT;\n savedA[nSaved] = a;\n savedB[nSaved] = b;\n savedDelFF[nSaved] = delFF;\n nSaved++;\n }", "@Override\r\n\tpublic void onSave(Bundle outState) {\n\t}", "public Document saveAsXML() {\n\tDocument xmldoc= new DocumentImpl();\n\tElement root = createFeaturesElement(xmldoc);\n\txmldoc.appendChild(root);\n\treturn xmldoc;\n }", "public void loadState(ObjectInput in) throws IOException {\n\t\t// loda deikto values\n\t\tdk.loadState(in);\n\t\t// load interpreter values\n\t\tinterpreter.globalActorBox=in.readFloat();\n\t\tinterpreter.globalPropBox=in.readFloat();\n\t\tinterpreter.globalStageBox=in.readFloat();\n\t\tinterpreter.globalEventBox=in.readFloat();\n\t\tinterpreter.globalVerbBox=in.readFloat();\n\t\tinterpreter.globalBNumberBox=in.readFloat();\n\n\t\t// load ticks\n\t\tcMoments = in.readInt();\n\t\t// load inactivity counter\n\t\tcInactivity = in.readInt();\n\t\t// load inactivity counter for the player\n\t\tplayerInactivity = in.readInt();\n\t\t// load storyIsOver\n\t\tstoryIsOver = in.readBoolean();\n\t\tisEpilogueNow = in.readBoolean();\n\t\tisHappilyDone = in.readBoolean();\n\t\tisPenultimateDone = in.readBoolean();\n\n\t\ttry {\n\t\t\t// load storybook\n\t\t\tint size = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*4);\n\t\t\thistoryBook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\thistoryBook.add((Sentence)in.readObject());\n\t\t\t//save random seeds\n\t\t\trandom = (Random)in.readObject();\n\t\t\tinterpreter.scriptRandom.setSeed(in.readLong());\n\t\t\t// load alarms\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\talarms.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\talarms.add((Alarm)in.readObject());\n\t\t\tsize = in.readInt();\n\t\t\tDeikto.checkByteArraySize(size*16);\n\t\t\tstorybookQueue.clear();\n\t\t\tstorybook.clear();\n\t\t\tfor(int i=0;i<size;i++)\n\t\t\t\tstorybook.add(in.readUTF());\n\t\t\tstorybookQueue.addAll(storybook);\n\t\t} catch(ClassNotFoundException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public void testImportXML() throws RepositoryException, IOException{\n String path = \"path\";\n InputStream stream = new ByteArrayInputStream(new byte[0]);\n session.importXML(path, stream, 0);\n \n sessionControl.replay();\n sfControl.replay();\n \n jt.importXML(path, stream, 0);\n }", "private void loadState() {\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n this._tally = prefs.getInt(\"count\", 0);\n }", "public abstract void load();", "private void xmlSave() {\r\n FileDialog fd = new FileDialog(new Frame(), \r\n \"Save as a jMusic XML file...\", \r\n FileDialog.SAVE);\r\n fd.show();\r\n if (fd.getFile() != null) {\r\n jm.util.Write.xml(score, fd.getDirectory() + fd.getFile());\r\n }\r\n }", "@Override protected Parcelable onSaveInstanceState() {\n Parcelable superState = super.onSaveInstanceState();\n SavedState ss = new SavedState(superState);\n ss.rotated = rotated;\n ss.totalSpacingDegree = totalSpacingDegree;\n ss.satelliteDistance = satelliteDistance;\n ss.measureDiff = measureDiff;\n ss.expandDuration = expandDuration;\n ss.closeItemsOnClick = closeItemsOnClick;\n return ss;\n }" ]
[ "0.7214627", "0.64567494", "0.6385921", "0.6278955", "0.6077513", "0.60729665", "0.60708165", "0.6029285", "0.60173815", "0.6013792", "0.5985862", "0.5983309", "0.59466076", "0.59393597", "0.58424354", "0.5836029", "0.577223", "0.5765557", "0.5765164", "0.574713", "0.5701031", "0.56918025", "0.5684938", "0.5680033", "0.5670311", "0.5650463", "0.56365365", "0.5621666", "0.5594292", "0.55816334", "0.5578684", "0.55429435", "0.55419344", "0.5540821", "0.5525477", "0.55233365", "0.55105656", "0.5510274", "0.5510274", "0.55045456", "0.54906994", "0.5488489", "0.5487434", "0.54835755", "0.54835755", "0.54805595", "0.5469267", "0.54622585", "0.54598475", "0.5457576", "0.5449165", "0.54430336", "0.5441676", "0.5430601", "0.54299265", "0.5427167", "0.5426037", "0.5423436", "0.5422137", "0.54008996", "0.5387092", "0.5386171", "0.5383212", "0.5381615", "0.53810215", "0.5379482", "0.53731054", "0.53634185", "0.53582996", "0.53567827", "0.5354194", "0.53469473", "0.5345047", "0.5344144", "0.5338094", "0.5338094", "0.5338094", "0.533696", "0.5332125", "0.53318423", "0.5322062", "0.53148544", "0.53148544", "0.53130746", "0.53073347", "0.53008926", "0.5299299", "0.529675", "0.5296493", "0.5287572", "0.52776504", "0.5272598", "0.5268426", "0.52638257", "0.52636105", "0.5262159", "0.52551985", "0.52512324", "0.5248625", "0.52429575", "0.52381265" ]
0.0
-1
Create outState that holds the HashMap after changing to a new orientation
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putSerializable("hm", (Serializable) hm); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void onSaveInstanceState(Bundle outState) {\n if (mMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, mMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, currentLocation);\n String KEY_TAB_INDEX = \"tab_index\";\n outState.putInt(KEY_TAB_INDEX, tabLayout.getSelectedTabPosition());\n super.onSaveInstanceState(outState);\n }\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putBoolean(STATE_SHOWING_MAP, showingMap);\n\n if (userLatLng != null) outState.putParcelable(STATE_USER_LATLNG, userLatLng);\n if (friendLatLng != null) outState.putParcelable(STATE_FRIEND_LATLNG, friendLatLng);\n if (midLatLng != null) outState.putParcelable(STATE_MID_LATLNG, midLatLng);\n\n outState.putInt(STATE_PAGE_NUMBER, pageNumber);\n outState.putBoolean(STATE_HAS_MORE_DATA, hasMoreData);\n if (nextUrl != null) outState.putString(STATE_NEXT_URL, nextUrl);\n\n outState.putStringArrayList(STATE_SELECTED_IDS, new ArrayList<>(selectedIdsMap.keySet()));\n outState.putIntegerArrayList(STATE_SELECTED_POSITIONS, new ArrayList<>(selectedIdsMap.values()));\n }", "@Override\n public void onSaveInstanceState( @NonNull Bundle outState ) {\n super.onSaveInstanceState( outState );\n mMap.onSaveInstanceState( outState );\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n mapView.onSaveInstanceState(outState);\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState = drawer.saveInstanceState(outState);\n //add the values which need to be saved from the accountHeader to the bundle\n outState = headerResult.saveInstanceState(outState);\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n if (mMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, mMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, mLastKnownLocation);\n super.onSaveInstanceState(outState);\n }\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n if (mMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, mMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, mLastKnownLocation);\n super.onSaveInstanceState(outState);\n }\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n if (mMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, mMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, mLastKnownLocation);\n super.onSaveInstanceState(outState);\n }\n }", "@Override protected Parcelable onSaveInstanceState() {\n Parcelable superState = super.onSaveInstanceState();\n SavedState ss = new SavedState(superState);\n ss.rotated = rotated;\n ss.totalSpacingDegree = totalSpacingDegree;\n ss.satelliteDistance = satelliteDistance;\n ss.measureDiff = measureDiff;\n ss.expandDuration = expandDuration;\n ss.closeItemsOnClick = closeItemsOnClick;\n return ss;\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n if (mMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, mMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, mLastKnownLocation);\n super.onSaveInstanceState(outState);\n }\n }", "private void saveCurrentState(Bundle outState){\n outState.putInt(PLAYER_COUNT_STATE_KEY,playerScore);\n outState.putSerializable(VIEW_MAP_STATE_KEY,globalViewMap);\n outState.putSerializable(CHILD_TEXT_CONTAINER_STATE_KEY,globalChildTextContainer);\n outState.putSerializable(PRIME_RECORD_MAP_KEY,primeRecorderMap);\n outState.putSerializable(CURRENT_SCREEN_GAME_STATE_KEY,currentScreenGameState);\n outState.putLong(GAME_TIME_LEFT_STATE_KEY,gameTimeLeftYet);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState = drawer.saveInstanceState(outState);\n //add the values which need to be saved from the accountHeader to the bundle\n outState = header.saveInstanceState(outState);\n super.onSaveInstanceState(outState);\n }", "@Override\n\t\t\tpublic void onSaveInstanceState(Bundle outState){\n\t\t\t\tsuper.onSaveInstanceState(outState);\n\t\t\t\toutState.putInt(\"offset\",offset);\n\t\t\t}", "@Override\n\t protected void onSaveInstanceState(Bundle outState) {\n\t super.onSaveInstanceState(outState);\n\t // save the current data, for instance when changing screen orientation\n\t outState.putSerializable(\"dataset\", mDataset);\n\t outState.putSerializable(\"renderer\", mRenderer);\n\t outState.putSerializable(\"current_series\", mCurrentSeries);\n\t outState.putSerializable(\"current_renderer\", mCurrentRenderer);\n\t }", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\toutState.putInt(INSTANCE_STATE_CURRENT_SECTION, mCurrentSection);\n\t\tsuper.onSaveInstanceState(outState);\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n this.setLetterPoolString();\n outState.putString(SELECTED_WORD, this.selectedWord);\n outState.putString(CURRENT_GUESS, this.currentAnswer);\n outState.putString(CURRENT_LETTER_POOL, this.letterPool);\n outState.putInt(CURRENT_WORD_LENGTH, this.selectedLength);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putParcelable(\"mIncome\", mIncome);\n outState.putBoolean(\"was_edited\", mWasEdited);\n outState.putString(\"camera_image_file_path\", mCameraImageFilePath);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState)\n {\n super.onSaveInstanceState(outState);\n outState.putInt(\"arms\", arms.getVisibility());\n outState.putInt(\"mustache\", mustache.getVisibility());\n outState.putInt(\"nose\", nose.getVisibility());\n outState.putInt(\"shoes\", shoes.getVisibility());\n outState.putInt(\"glasses\", glasses.getVisibility());\n outState.putInt(\"eyes\", eyes.getVisibility());\n outState.putInt(\"hat\", hat.getVisibility());\n outState.putInt(\"ears\", ears.getVisibility());\n outState.putInt(\"mouth\", mouth.getVisibility());\n outState.putInt(\"eyebrows\", eyebrows.getVisibility());\n\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putBoolean(KEY_IN_RESOLUTION, mIsInResolution);\n }", "@Override\n public Map<String, Object> currentState() {\n\n return new HashMap<>();\n }", "@Override\r\n protected void onSaveInstanceState(Bundle outState) {\r\n super.onSaveInstanceState(outState);\r\n outState.putBoolean(KEY_IN_RESOLUTION, mIsInResolution);\r\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n if (googleMap != null) {\n outState.putParcelable(KEY_CAMERA_POSITION, googleMap.getCameraPosition());\n outState.putParcelable(KEY_LOCATION, mLastKnownLocation);\n super.onSaveInstanceState(outState);\n }\n }", "private void saveHeaderValues(Bundle outState) {\n\t\t// outState.putBoolean(SHOW_HAMBURGER_MENU, showHamburgerMenu);\n\t\t// outState.putString(TITLE, this.title);\n\t\t// outState.putBoolean(SHOW_LOGO, this.showLogo);\n\t\t// outState.putInt(NAVIGATION_ICON_REG_ID, this.navIconRegId);\n\t\t// outState.putIntArray(OVER_FLOW_HIDE_MENU_IDS, this.hideMenuItemIds);\n\t\t// outState.putBoolean(IS_CHILD_FRAGMENT, isChildFragment());\n\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putString(\"NAME_KEY\", name.getText().toString());\n outState.putString(\"METHOD_KEY\", method.getText().toString());\n outState.putString(\"INGREGIENTS_KEY\", ingredients.getText().toString());\n outState.putString(\"DESCRIPTION_KEY\", description.getText().toString());\n outState.putString(\"CHEF_KEY\", chef.getText().toString());\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n outState.putBundle(ICICLE_KEY, mGameView.saveState());\n }", "@Override\n protected void onSaveInstanceState(Bundle b) {\n // Preserve what's at the center of the map\n //\n // Get the GeoPoint that is at the center of the map\n GeoPoint currentPoint = mapView.getMapCenter();\n int latitude = currentPoint.getLatitudeE6(); // Get the map center's latitude\n int longitude = currentPoint.getLongitudeE6(); // Get the map center's longitude\n b.putInt(\"latitude\", latitude); // Save the latitude\n b.putInt(\"longitude\", longitude); // Save the longitude\n\n // Preserve the current map style\n b.putBoolean(\"currentMapInSatelliteView\", mapView.isSatellite());\n // Preserve the current zoom level\n b.putInt(\"currentZoomLevel\", mapView.getZoomLevel());\n\n // Preserve the overlays that are applied to the map\n //\n // Overlay mapping in overlayList: eat, sleep, study, havefun, eat_study_havefun, sleep_study, study_havefun\n boolean overlayList[] = {false, false, false, false, false, false, false};\n\n // Keep track of which overlays for student activities are currently on\n if (mapOverlays.contains(eatOverlay)) {\n overlayList[0] = true;\n }\n if (mapOverlays.contains(sleepOverlay)) {\n overlayList[1] = true;\n }\n if (mapOverlays.contains(studyOverlay)) {\n overlayList[2] = true;\n }\n if (mapOverlays.contains(havefunOverlay)) {\n overlayList[3] = true;\n }\n if (mapOverlays.contains(eat_study_havefun_multiOverlay)) {\n overlayList[4] = true;\n }\n if (mapOverlays.contains(sleep_study_multiOverlay)) {\n overlayList[5] = true;\n }\n if (mapOverlays.contains(study_havefun_multiOverlay)) {\n overlayList[6] = true;\n }\n\n // Save the state of the student activity overlays\n b.putBooleanArray(\"overlayList\", overlayList);\n\n super.onSaveInstanceState(b); // Required call to superclass for app lifecycle management\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n\n outState.putInt(\"roundCount\", roundCount);\n outState.putInt(\"player1Points\", player1Points);\n outState.putInt(\"player2Points\", player2Points);\n outState.putBoolean(\"player1Turn\", player1Turn);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n }", "@Override\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t}", "private void storeState() throws IOException {\n for (File outputFile : processedOutputs.keySet()) {\n if (state.outputs.get(outputFile) == null) {\n state.outputs.put(outputFile, new FileState(outputFile));\n }\n }\n\n File parent = stateFile.getParentFile();\n if (!parent.isDirectory() && !parent.mkdirs()) {\n throw new IOException(\"Could not create direcotyr \" + parent);\n }\n\n ObjectOutputStream os =\n new ObjectOutputStream(new GZIPOutputStream(new BufferedOutputStream(new FileOutputStream(\n stateFile))));\n try {\n os.writeObject(state);\n } finally {\n try {\n os.close();\n } catch (IOException e) {\n // ignore secondary exception\n }\n }\n }", "@Override\r\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t}", "@Override\r\n\tprotected void onSaveInstanceState(Bundle outState) {\r\n\t\tsuper.onSaveInstanceState(outState);\r\n\t\toutState.putInt(\"pos\", mPos);\r\n\t\toutState.putInt(\"showpos\", mShowPos);\r\n\t\toutState.putParcelable(ShowTable.CONTENT_ITEM_TYPE, mUri);\r\n\t}", "public void saveState(ObjectOutput out) throws IOException {\n\t\t// save deikto values\n\t\tdk.saveState(out);\n\t\t// save interpreter values\n\t\tout.writeFloat(interpreter.globalActorBox);\n\t\tout.writeFloat(interpreter.globalPropBox);\n\t\tout.writeFloat(interpreter.globalStageBox);\n\t\tout.writeFloat(interpreter.globalEventBox);\n\t\tout.writeFloat(interpreter.globalVerbBox);\n\t\tout.writeFloat(interpreter.globalBNumberBox);\n\n\t\t// save ticks\n\t\tout.writeInt(cMoments);\n\t\t// save inactivity counter\n\t\tout.writeInt(cInactivity);\n\t\t// save player inactivity\n\t\tout.writeInt(playerInactivity);\n\t\t// save storyIsOver\n\t\tout.writeBoolean(storyIsOver);\n\t\tout.writeBoolean(isEpilogueNow);\n\t\tout.writeBoolean(isHappilyDone);\n\t\tout.writeBoolean(isPenultimateDone);\n\n\t\t// save historyBook\n\t\tout.writeInt(historyBook.size());\n\t\tfor(Sentence s:historyBook)\n\t\t\tout.writeObject(s);\n\t\t// save random seeds\n\t\tout.writeObject(random);\n\t\tout.writeLong(interpreter.scriptRandom.getSeed());\n\t\t// save alarms\n\t\tout.writeInt(alarms.size());\n\t\tfor(Alarm a:alarms)\n\t\t\tout.writeObject(a);\n\t\tout.writeInt(storybook.size());\n\t\tfor(String s:storybook)\n\t\t\tout.writeUTF(s);\n\t}", "@Override\r\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tif (outState != null) {\r\n\t\t\toutState.putString(\"sCameraFilename\", sCameraFilename);\r\n\t\t\toutState.putSerializable(\"fCurrentFile\", fCurrentFile);\r\n\t\t\tPalmchatLogUtils.println(\"--cfd onSaveInstanceState sCameraFilename =\" + sCameraFilename);\r\n\t\t}\r\n\t\t\r\n\t\tsuper.onSaveInstanceState(outState);\r\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\tif (mMapView != null)\n\t\t\tmMapView.onSaveInstanceState(outState);\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\toutState.putInt(\"titile_position\", titile_position);\n\t\toutState.putFloat(\"fromXDelta\", fromXDelta);\n\t}", "protected void onRestoreInstanceState(Bundle savedInstanceState) {\n Log.e(TAG, \"++ RESTORING!!! ++\");\n super.onRestoreInstanceState(savedInstanceState);\n ArrayList<String> tempDestNames = savedInstanceState.getStringArrayList(\"dName\");\n double[] tempDestLongs = savedInstanceState.getDoubleArray(\"dLong\");\n double[] tempDestLats = savedInstanceState.getDoubleArray(\"dLat\");\n ArrayList<String> tempDestAddr = savedInstanceState.getStringArrayList(\"dAddr\");\n\n orderedDestinations.clear();\n for(int i=0; i<tempDestNames.size(); i++){\n Destination tempDest = new Destination(tempDestNames.get(i),tempDestLongs[i],tempDestLats[i]);\n tempDest.address = tempDestAddr.get(i);\n orderedDestinations.add(tempDest);\n }\n\n polylineEncodedString = savedInstanceState.getString(\"poly\");\n buildTable();\n }", "@Override\n public void writeToParcel(Parcel out, int flags){\n out.writeParcelable(history, flags);\n out.writeParcelable(historyValues, flags);\n out.writeParcelable(redoEffects, flags);\n out.writeParcelable(redoParams, flags);\n out.writeMap(images);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState.putParcelable(INSTANCE_ALARM_ADDRESS_DATA, mMapDestination);\n outState.putInt(INSTANCE_ALARM_ID, mAlarmId);\n if(mAlarmRingtone != null)\n outState.putString(INSTANCE_ALARM_RINGTONE, mAlarmRingtone.toString());\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putSerializable(ReportPeer.KEY_ID, mRowId);\n outState.putSerializable(ReportPeer.KEY_TASK_ID, mTaskId);\n outState.putSerializable(ReportPeer.KEY_DATE, mCalendar);\n // We don't need to save form values because this is handled\n // automatically for every View object\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState = result.saveInstanceState(outState);\n //add the values which need to be saved from the accountHeader to the bundle\n outState = headerResult.saveInstanceState(outState);\n super.onSaveInstanceState(outState);\n }", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\toutState.putParcelableArrayList(\"images\",\n\t\t\t\t(ArrayList<? extends Parcelable>) mImageList);\n\t\toutState.putString(\"mSelectedBank\", mSelectedBank);\n\t\toutState.putString(\"mSelectedEmi\", mSelectedEmi);\n\t\t// outState.putBoolean(PENDING_PUBLISH_KEY,\n\t\t// pendingPublishReauthorization);\n\t\t// uiHelper.onSaveInstanceState(outState);\n\t\tSession session = Session.getActiveSession();\n\t\tSession.saveSession(session, outState);\n\n\t}", "@Override\n public void saveState(Bundle outBundle) {\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putBoolean(\"AppRunning\",running);\n outState.putBoolean(\"Latest\",latestOp);\n outState.putBoolean(\"Started\",started);\n outState.putInt(\"Seconds\",sec);\n outState.putInt(\"Score\",score);\n outState.putInt(\"Total\",total);\n }", "@Override\n public void onSaveInstanceState(Bundle savedInstanceState)\n {\n savedInstanceState.putIntArray(\"board\", tttGame.getBoard());\n savedInstanceState.putBoolean(\"turn\", tttGame.getTurn());\n savedInstanceState.putBoolean(\"mode\", tttGame.getAIMode());\n\n savedInstanceState.putInt(\"p1Count\", pOneCounter);\n savedInstanceState.putInt(\"p2Count\", pTwoCounter);\n savedInstanceState.putInt(\"pAICount\",pAICounter);\n savedInstanceState.putInt(\"tieCount\", tieCounter);\n\n boolean[] enabled = getState();\n savedInstanceState.putBooleanArray(\"state\", enabled);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n if (LOCATION != null) {\n outState.putParcelable(\"locatie\", LOCATION);\n }\n if (contactName != null) {\n outState.putString(\"contactName\", contactName);\n }\n if (contactNumber != null) {\n outState.putString(\"contactNumber\", contactNumber);\n }\n }", "@Override\n protected void onSaveInstanceState(@NonNull Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putSerializable(\"datos\", (ArrayList<Institucion>) mDatos);\n }", "public void saveState(Bundle outState) {\n\t\tsynchronized (mNpcs) {\n\t\t\tParcelable[] npcs = new Parcelable[mNpcs.size()];\n\t\t\tfor (int i = 0; i < mNpcs.size(); i++) {\n\t\t\t\tnpcs[i] = mNpcs.get(i);\n\t\t\t}\n\t\t\toutState.putParcelableArray(World.NPCS, npcs);\n\t\t}\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n outState.putBundle(ICICLE_KEY, mSnakeView.saveState());\n super.onSaveInstanceState(outState);\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n }", "private void restoreMappingPreviousState(ApplicationInfo readPerst)\n\t\t\tthrows RowsExceededException, WriteException, BiffException,\n\t\t\tIOException {\n\t\tint size = NcaMappingDispGui.createMappingInstance().availableVariablesListmodel\n\t\t\t\t.size();\n\t\tfor (int i = NcaMappingDispGui.createMappingInstance().availableVariablesListmodel\n\t\t\t\t.size() - 1; i >= 0; i--) {\n\t\t\tNcaMappingDispGui.createMappingInstance().availableVariablesListmodel\n\t\t\t\t\t.remove(i);\n\t\t}\n\n\t\t// setting the available columns\n\t\tfor (int i = 0; i < readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t.getAvailableColumnsVector().size(); i++) {\n\t\t\tNcaMappingDispGui.createMappingInstance().availableVariablesListmodel\n\t\t\t\t\t.add(i, readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t\t.getAvailableColumnsVector().get(i));\n\n\t\t}\n\n\t\t// since sort variables are not populated while creating a new\n\t\t// ncaMainScreen\n\t\t// we need not remove anything, so\n\t\t// setting the sort variables\n\t\tfor (int i = 0; i < readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t.getSortVariablesListVector().size(); i++) {\n\t\t\tNcaMappingDispGui.createMappingInstance().sortVariableListModel\n\t\t\t\t\t.add(i, readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t\t.getSortVariablesListVector().get(i));\n\n\t\t}\n\n\t\t// setting the time column\n\n\t\tNcaMappingDispGui.createMappingInstance().xVariableTextField\n\t\t\t\t.setText(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t.getxColumnName());\n\n\t\t// setting the concentration column\n\n\t\tNcaMappingDispGui.createMappingInstance().yVariableTextField\n\t\t\t\t.setText(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t.getYcolumnName());\n\n\t\t// setting the end time column\n\t\t// restore this value only if the previous analysis is of model type\n\t\t// urine\n\t\tif (readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t.getProcessingInputs().getModelInputsObj().getModelType() == 1) {\n\t\t\tNcaMappingDispGui.createMappingInstance().endTimeVariableTextField\n\t\t\t\t\t.setText(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t\t.getEndTimeColumnName());\n\n\t\t\tNcaMappingDispGui.createMappingInstance().volumeVariableTextField\n\t\t\t\t\t.setText(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t\t.getVolumeColumnName());\n\t\t}\n\n\t\t// setting the subject column name\n\t\t// restore this value only when if it was a sparse analysis\n\t\tif (readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t.getProcessingInputs().getModelInputsObj()\n\t\t\t\t.getisSparseSelected() == true) {\n\n\t\t\tNcaMappingDispGui.createMappingInstance().subjectTextField\n\t\t\t\t\t.setText(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getWorkSheetObjectsAL().get(\n\t\t\t\t\t\t\treadPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getWorkBooksArrayList().get(readPerst.getProjectInfoAL().get(readPerst.getSelectedProjectIndex()).getSelectedWorkBookIndex()).getSelectedSheetIndex()).getNcaInfo()\n\t\t\t\t\t\t\t.getProcessingInputs().getMappingDataObj()\n\t\t\t\t\t\t\t.getSubjectColumnName());\n\t\t}\n}", "public Parcelable onSaveInstanceState() {\n SavedState savedState = new SavedState(super.onSaveInstanceState());\n if (!(this.auk == null || this.auk.aun == null)) {\n savedState.aup = this.auk.aun.getItemId();\n }\n savedState.auq = isOverflowMenuShowing();\n return savedState;\n }", "@Override\r\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\r\n\t}", "State(Main aMain) {\n\tmain = aMain;\n\tback = Integer.parseInt(main.myProps.getProperty(\"yesterdays\"));\n\tfront = Integer.parseInt(main.myProps.getProperty(\"tomorrows\"));\n\tmaps = new Hashtable();\n availWeath = new Hashtable();\n\n main.myFrw.listen(new MapListener(), ScaledMap.TYPE, null);\n main.myFrw.announce(this);\n stateDoc = Framework.parse(main.myPath + \"state.xml\", \"state\");\n availWeath = loadFromDoc();\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n /* Here we put code now to save the state */\n outState.putString(\"path\", mCurrentPhotoPath);\n outState.putString(\"caseId\", caseId.getText().toString());\n outState.putString(\"desc\", desc.getText().toString());\n outState.putString(\"imgName\", this.imgName);\n\n if (dialog != null && dialog.getUserInput() != \"\") {\n System.out.println(\"in onSvaeInstanceSteate \"+dialog.getUserInput());\n outState.putString(\"username\", dialog.getUserInput());\n }\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n Log.i(TAG, \"onSaveInstanceState()\");\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n\n super.onSaveInstanceState(outState);\n\n if(myFingerPainterView.getBrush().equals(Paint.Cap.ROUND))\n outState.putString(\"Shape\", \"Round\");\n else\n outState.putString(\"Shape\", \"Square\");\n\n outState.putInt(\"Colour\", myFingerPainterView.getColour());\n outState.putInt(\"Width\", myFingerPainterView.getBrushWidth());\n }", "@Override\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\toutState.putInt(\"data\", mData);\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putSerializable(\"device\", mDevice);\n }", "@Override \n\tpublic void onSaveInstanceState(Bundle savedInstanceState) {\n\t\tsavedInstanceState.putString(KEY_CHOSEN_CHARS, mCharDisp);\n\t\tsavedInstanceState.putString(KEY_CHOSEN_DIST, mDistDisp);\n\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n }", "@Override\n public void restoreState(Map<String, Object> state) {\n\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState.putParcelable(GAME_TAG, game);\n outState.putBoolean(EXIT_ALERT_VISIBILITY, exitAlertVisible); // is EXIT AlertDialog shown?\n super.onSaveInstanceState(outState);\n }", "@Override\n public void onSaveInstanceState(Bundle arg0) {\n super.onSaveInstanceState(arg0);\n mMapView.onSaveInstanceState(arg0);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n //outState.putInt(\"someVarA\", someVarA);\n //outState.putString(\"someVarB\", someVarB);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState.putParcelableArrayList(\"savedMovies\", gridData);\n super.onSaveInstanceState(outState);\n }", "public void initMap() {\n\t\tmap = new Map();\n\t\tmap.clear();\n\t\tphase = new Phase();\n\t\tmap.setPhase(phase);\n\t\tmapView = new MapView();\n\t\tphaseView = new PhaseView();\n\t\tworldDomiView = new WorldDominationView();\n\t\tcardExchangeView = new CardExchangeView();\n\t\tphase.addObserver(phaseView);\n\t\tphase.addObserver(cardExchangeView);\n\t\tmap.addObserver(worldDomiView);\n\t\tmap.addObserver(mapView);\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n \toutState.putString(\"WORKAROUND_FOR_BUG_19917_KEY\", \"WORKAROUND_FOR_BUG_19917_VALUE\");\n \tsuper.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n\n outState.putParcelable(\"ImageUri1\", mImageUri1);\n outState.putParcelable(\"ImageUri2\", mImageUri2);\n }", "@Override\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n Log.d(TAG, \"onSaveInstanceState:method fYred\");\n outState.putInt(\"qestion We are on\", currentq);\n }", "protected\tvoid\tonSaveInstanceState\t(Bundle\toutState){\n Log.e(TAG, \"++ SAVING!!! ++\");\n\n //grab all the contents of each destination\n double[] listOfDestLong = new double[orderedDestinations.size()];\n double[] listOfDestLat = new double[orderedDestinations.size()];\n ArrayList<String> listOfDestNames = new ArrayList<String>();\n ArrayList<String> listOfDestAddr = new ArrayList<String>();\n for(int i=0; i<orderedDestinations.size(); i++){\n listOfDestNames.add(i,orderedDestinations.get(i).name);\n listOfDestLong[i] = orderedDestinations.get(i).longitude;\n listOfDestLat[i] = orderedDestinations.get(i).latitude;\n listOfDestAddr.add(orderedDestinations.get(i).address);\n }\n\n //Store the contents of each destination in the saved bundled\n outState.putStringArrayList(\"dName\", listOfDestNames);\n outState.putDoubleArray(\"dLong\", listOfDestLong);\n outState.putDoubleArray(\"dLat\", listOfDestLat);\n outState.putStringArrayList(\"dAddr\", listOfDestAddr);\n outState.putString(\"poly\", polylineEncodedString);\n super.onSaveInstanceState(outState);\n }", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\tLog.e(\"mainactivity\", \"onsaveinsstancestate\");\n\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\toutState.putParcelable(BITMAP_STORAGE_KEY, mImageBitmap);\n\t\toutState.putParcelable(VIDEO_STORAGE_KEY, mVideoUri);\n\t\toutState.putBoolean(IMAGEVIEW_VISIBILITY_STORAGE_KEY, (mImageBitmap != null) );\n\t\toutState.putBoolean(VIDEOVIEW_VISIBILITY_STORAGE_KEY, (mVideoUri != null) );\n\t\tsuper.onSaveInstanceState(outState);\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n Parcelable recyclerState = mDashboardList.getLayoutManager().onSaveInstanceState();\n outState.putParcelable(STATE_RECYCLER, recyclerState);\n\n /* call superclass to save any view hierarchy */\n super.onSaveInstanceState(outState);\n }", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n currentStateSaveToSharedPref();\n }", "@Override\n\tpublic void onMySaveInstanceState(Bundle outState) {\n\t\t\n\t}", "@Override\n\tpublic void onMySaveInstanceState(Bundle outState) {\n\t\t\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putString(\"TAG\", tag);\n }", "@Override\n protected void onSaveInstanceState(@NonNull Bundle outState) {\n super.onSaveInstanceState(outState);\n BitmapDrawable drawableVidas = (BitmapDrawable) ivVidas.getDrawable();\n Bitmap bitmapVidas = drawableVidas.getBitmap();\n\n BitmapDrawable drawableNum1 = (BitmapDrawable) ivNumUno.getDrawable();\n Bitmap bitmapNum1 = drawableNum1.getBitmap();\n\n BitmapDrawable drawableNum2 = (BitmapDrawable) ivNumDos.getDrawable();\n Bitmap bitmapNum2 = drawableNum2.getBitmap();\n\n outState.putString(\"nombreTV\", tvNombre.getText().toString());\n outState.putString(\"nombre\", nombreJugador);\n\n outState.putString(\"puntosTV\", tvPuntos.getText().toString());\n outState.putInt(\"puntos\", puntos);\n\n outState.putInt(\"vidas\", vidas);\n outState.putParcelable(\"vidasIV\", bitmapVidas);\n\n outState.putInt(\"num1\", numAleatorioUno);\n outState.putParcelable(\"num1IV\", bitmapNum1);\n outState.putInt(\"num2\", numAleatorioDos);\n outState.putParcelable(\"num2IV\", bitmapNum2);\n outState.putInt(\"resultado\", resultado);\n\n\n }", "public void onSaveInstanceState(Bundle outState) {\n if (loginState){\n save = loginFragment.getSaveInformation();\n outState.putStringArrayList(\"saveLogin\",save);\n }\n else{\n save = signUpFragment.getSaveInformation();\n outState.putStringArrayList(\"saveLogin\",save);\n }\n\n }", "public void storeState(StateInfo stateInfo) {\n \n// Thread.dumpStack();\n super.storeState(stateInfo); \n \n JJStateInfo info = (JJStateInfo) stateInfo;\n info.setSubStates(lexan.getStateInfo());\n \n if (DEBUG) debug.println(\"Storing state [\"+ offset + \",\" + tokenOffset + \"]: \" + info + \"@\" + stopOffset); // NOI18N\n \n }", "@Override\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\tLog.i(TAG, \"onSaveInstanceState\");\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\tLog.v(TAG, \"onSaveInstanceState()\");\n\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n outState.putInt(KEY_HOUR, hour);\n outState.putInt(KEY_MINUTES, minute);\n }", "@Override\n\tpublic void onSaveInstanceState(Bundle savedInstanceState) {\n\t\tsuper.onSaveInstanceState(savedInstanceState);\n\t\t\n\t\tsavedInstanceState.putInt(\"buttonCount\", buttonCount);\n\t\tsavedInstanceState.putIntegerArrayList(\"catCounters\", catCounters);\n\t\tsavedInstanceState.putStringArrayList(\"textArray\", textArray);\n\t\tsavedInstanceState.putString(\"layout_name\", layout_name);\n\t}", "@Override\n\tprotected void onSaveInstanceState(Bundle outState){\n\t\tsuper.onSaveInstanceState(outState);\n\t\t\n\t\t//Save file url in bundle as it will be null on screen orientation changes\n\t\toutState.putParcelable(\"file_uri\", fileUri);\n\t}", "@Override\n public void onSaveInstanceState(Bundle outState){\n // Save current booking times to outstate\n outState.putInt(BOOKING_HOUR_KEY, bookingHour);\n outState.putInt(BOOKING_MINUTE_KEY, bookingMinute);\n\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n super.onSaveInstanceState(outState);\n\n outState.putString(IMAGE_FILE, currentPhotoPath);\n }", "protected Parcelable onSaveInstanceState() {\n SavedState savedState = new SavedState(super.onSaveInstanceState());\n boolean bl2 = this.isSlideable() ? this.isOpen() : this.mPreservedOpenState;\n savedState.isOpen = bl2;\n return savedState;\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n scrollState = mMoviesRecyclerView.getLayoutManager().onSaveInstanceState();\n outState.putParcelable(LIFECYCLE_SCROLL_STATE, scrollState);\n // Save sortBy selection\n outState.putInt(LIFECYCLE_SORT_BY_STATE, mSortBy);\n\n super.onSaveInstanceState(outState);\n }", "@Override\n\tpublic void onSaveInstanceState(Bundle savedInstanceState)\n\t{\n\t\tsuper.onSaveInstanceState(savedInstanceState);\n\n\t\tsavedInstanceState.putString(\"CurSearch\", mCurSearch);\n\t\tsavedInstanceState.putString(\"CurSearchNavi\", mCurSearchNavi);\n\t\tsavedInstanceState.putBoolean(\"ToNavi\", mToNavi);\n\t\tsavedInstanceState.putInt(\"ViewingItem\", mViewingItem);\n\t}", "public static void createMap()\n\t\t\t{\n\t\t\tmap = new Vector<Location>(4);\n\t\n\t\t\tLocation location1 = new Location(\"the southwest room.\",\"You see doors to the north and east.\");\n\t\t\tLocation location2 = new Location(\"the southeast room.\",\"You see doors to the north and west.\");\n\t\t\tLocation location3 = new Location(\"the northwest room.\",\"You see doors to the south and east.\");\n\t\t\tLocation location4 = new Location(\"the northeast room.\",\"You see doors to the south and west.\");\n\n\t\t\tmap.addElement(location1);\n\t\t\tmap.addElement(location2);\n\t\t\tmap.addElement(location3);\n\t\t\tmap.addElement(location4);\n\t\t\t\n\t\t\t// This section defines the exits found in each location and the \n\t\t\t// locations to which they lead.\n\t\t\tlocation1.addExit(new Exit(Exit.north, location3));\n\t\t\tlocation1.addExit(new Exit(Exit.east, location2));\n\t\t\tlocation2.addExit(new Exit(Exit.north, location4));\n\t\t\tlocation2.addExit(new Exit(Exit.west, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.south, location1));\n\t\t\tlocation3.addExit(new Exit(Exit.east, location4));\n\t\t\tlocation4.addExit(new Exit(Exit.west, location3));\n\t\t\tlocation4.addExit(new Exit(Exit.south, location2));\n\t\t\t\n\t\t\tcurrentLocation = location1;\t\t\t\t\n\t\t\t}", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n outState.putSerializable(POPULAR_MOVIES, mPopularList);\n outState.putSerializable(TOP_RATED_MOVIES, mTopTopRatedList);\n super.onSaveInstanceState(outState);\n }", "@Override\n protected void onSaveInstanceState(Bundle outState) {\n //ALWAYS CALL THE SUPER METHOD - To be nice!\n super.onSaveInstanceState(outState);\n Log.d(TAG, \"onSaveInstanceState\");\n\t\t/* Here we put code now to save the state */\n outState.putParcelableArrayList(\"savedList\",bag);\n\n }", "@Override\r\n public void onSaveInstanceState(Bundle outState) {\r\n super.onSaveInstanceState(outState);\r\n // Save Instance State here\r\n }", "@Override\r\n public void onSaveInstanceState(Bundle outState) {\r\n super.onSaveInstanceState(outState);\r\n // Save Instance State here\r\n }", "private void generateMaps() {\r\n\t\tthis.tablesLocksMap = new LinkedHashMap<>();\r\n\t\tthis.blocksLocksMap = new LinkedHashMap<>();\r\n\t\tthis.rowsLocksMap = new LinkedHashMap<>();\r\n\t\tthis.waitMap = new LinkedHashMap<>();\r\n\t}" ]
[ "0.6406531", "0.6233034", "0.6228899", "0.6058819", "0.59632283", "0.5920703", "0.5920703", "0.5920703", "0.591787", "0.59059095", "0.59014964", "0.5861135", "0.58270013", "0.5744083", "0.5682073", "0.5667482", "0.56573415", "0.5628438", "0.5613629", "0.5600917", "0.5590653", "0.5567086", "0.5558635", "0.5557289", "0.5548677", "0.55361176", "0.5532569", "0.55271596", "0.5526479", "0.55239314", "0.5522582", "0.55194104", "0.55087686", "0.55072653", "0.55024326", "0.5495719", "0.5475769", "0.5440398", "0.5423353", "0.5411246", "0.54049814", "0.5397845", "0.53935397", "0.53620493", "0.535219", "0.53421396", "0.53415436", "0.5331396", "0.53071165", "0.5302856", "0.53007954", "0.5300744", "0.52931625", "0.5288787", "0.5287306", "0.5284835", "0.5278175", "0.5277803", "0.52747047", "0.5273734", "0.52675515", "0.52675515", "0.52613527", "0.525826", "0.52532583", "0.5239568", "0.5217429", "0.5216508", "0.52100617", "0.5208172", "0.5202787", "0.5198459", "0.5191294", "0.5189702", "0.5182345", "0.5178258", "0.51771784", "0.51757777", "0.51749194", "0.51749194", "0.5170641", "0.5153377", "0.5141182", "0.51227826", "0.5117321", "0.5115634", "0.5114207", "0.5111427", "0.51074916", "0.5102007", "0.5099899", "0.50962883", "0.50923157", "0.50865495", "0.50842494", "0.50824296", "0.50700754", "0.50682205", "0.50682205", "0.5064278" ]
0.62330115
2
Function to check if checkboxes are clicked and change the Img accordingly
public void onCheckboxClicked(View view) { // Check if the checkbox is checked boolean checked = ((CheckBox) view).isChecked(); // Case for every possible checkbox switch(view.getId()) { case R.id.arms: // If checked makes ImgView visible and puts item in HashMap to keep track if you change orientation if (checked) { arm.setVisibility(View.VISIBLE); hm.put("arm", TRUE); } // Does the opposite if the checkbox is not checked else { arm.setVisibility(View.GONE); hm.put("arm", FALSE); } break; case R.id.ears: if (checked) { ear.setVisibility(View.VISIBLE); hm.put("ear", TRUE); } else { ear.setVisibility(View.GONE); hm.put("ear", FALSE); } break; case R.id.eyebrows: if (checked) { eyebrow.setVisibility(View.VISIBLE); hm.put("eyebrow", TRUE); } else { eyebrow.setVisibility(View.GONE); hm.put("eyebrow", FALSE); } break; case R.id.eyes: if (checked) { eye.setVisibility(View.VISIBLE); hm.put("eye", TRUE); } else { eye.setVisibility(View.GONE); hm.put("eye", FALSE); } break; case R.id.glasses: if (checked) { glass.setVisibility(View.VISIBLE); hm.put("glass", TRUE); } else { glass.setVisibility(View.GONE); hm.put("glass", FALSE); } break; case R.id.hat: if (checked) { hat.setVisibility(View.VISIBLE); hm.put("hat", TRUE); } else { hat.setVisibility(View.GONE); hm.put("hat", FALSE); } break; case R.id.mouth: if (checked) { mouth.setVisibility(View.VISIBLE); hm.put("mouth", TRUE); } else { mouth.setVisibility(View.GONE); hm.put("mouth", FALSE); } break; case R.id.mustache: if (checked) { mustache.setVisibility(View.VISIBLE); hm.put("mustache", TRUE); } else { mustache.setVisibility(View.GONE); hm.put("mustache", FALSE); } break; case R.id.nose: if (checked) { nose.setVisibility(View.VISIBLE); hm.put("nose", TRUE); } else { nose.setVisibility(View.GONE); hm.put("nose", FALSE); } break; case R.id.shoes: if (checked) { shoe.setVisibility(View.VISIBLE); hm.put("shoe", TRUE); } else { shoe.setVisibility(View.GONE); hm.put("shoe", FALSE); } break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onCheckboxClicked(View view) {\n boolean checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch(view.getId()) {\n case R.id.green_jersey:\n if (checked){\n mJerseyImageView.setImageResource(R.drawable.green_jersey);\n }\n\n break;\n case R.id.purple_jersey:\n if (checked){\n mJerseyImageView.setImageResource(R.drawable.purple_jersey);\n }\n\n\n break;\n\n }\n }", "public void checkClicked(View v)\n {\n CheckBox checkbox = (CheckBox) v;\n Log.d(\"potato\", \"checkClicked: \");\n String get_name = checkbox.getText().toString();\n\n // use string name resource for the id of the image\n resID_from_name = getResources().getIdentifier(get_name, \"id\", getPackageName()); //google power\n\n // check if checkbox is checked. And show or don't shown image accordingly\n if(checkbox.isChecked() == false)\n {\n image = findViewById(resID_from_name);\n image.setVisibility(View.INVISIBLE);\n }\n\n else\n {\n image = findViewById(resID_from_name);\n image.setVisibility(View.VISIBLE);\n }\n }", "@Override\r\n\t public void onItemClick(AdapterView<?> arg0, View v,int position, long arg3) {\n\r\n\t\t\t\t\tImageView ivSelect = (ImageView) v.findViewById(R.id.im_check);\r\n\t\t\t\t\tif (lvContact.isItemChecked(position)) {\r\n\t\t\t\t\t\tivSelect.setImageResource(R.drawable.circle_check);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tivSelect.setImageResource(R.drawable.circle);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t }", "@Override\n public void onCheckedChanged(CompoundButton buttonView,\n boolean isChecked) {\n if(isChecked){\n //选中\n jumpFlag = 0;\n iv_choose_type.setImageDrawable(getResources().getDrawable(R.mipmap.login_switch_on));\n }else{\n //未选中\n jumpFlag = 1;\n iv_choose_type.setImageDrawable(getResources().getDrawable(R.mipmap.login_switch_off));\n }\n }", "public void onClick(View v) {\n CheckBox cb = (CheckBox) v;\r\n int id = cb.getId();\r\n if (Activity_CoSetup_SearchHsn.thumbnailsselection[id]) {\r\n cb.setChecked(false);\r\n Activity_CoSetup_SearchHsn.thumbnailsselection[id] = false;\r\n } else {\r\n cb.setChecked(true);\r\n Activity_CoSetup_SearchHsn.thumbnailsselection[id] = true;\r\n }\r\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n MyCheckBox myCheckBox = (MyCheckBox) buttonView;\n NLog.e(TAG, \"onCheckedChanged:%s\", localPosition);\n if (imgSum >= imageNum && isChecked) {\n buttonView.setChecked(false);\n Toast.makeText(mContext, \"最多设置\" + imageNum + \"张图片\", Toast.LENGTH_SHORT).show();\n return;\n }\n mImageInfos.get(localPosition).select = isChecked;\n imgSum += isChecked ? 1 : -1;\n NLog.e(TAG, \"imgSum:%d\", imgSum);\n\n }", "public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) //Questo metodo permette di cambiare l'immagine associata all'imageview nel layout,in funzione dello stato del bottone\n\t\t\t{ \n\t\t\t\t{\n\t\t\t\t\tif (isChecked) \n\t\t\t\t\t{\t\n\t\t\t\t\t\tiv.setImageResource(R.drawable.button_pause);\t//Se lo stato del bottone è checked,allora viene associato all'imageview l'immagine button_pause\t\n\t\t\t\t\t} \n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tiv.setImageResource(R.drawable.button_play);\t//Se lo stato del bottone è unchecked,allora viene associato all'imageview l'immagine button_play\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "private void change_im_check(boolean boo){\r\n if(boo){ //IMAGEN SI EL MEASURE ES CORRECTO\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }else{ //IMAGEN PARA LA BUSQUEDA DE UN MEASURE\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img34.png\")));\r\n }\r\n }", "public final void onChanged(Boolean bool) {\n if (bool != null && bool.booleanValue()) {\n ((ImageView) this.f53754a.mo78146a(R.id.btnSliceOrder)).setImageResource(R.drawable.bfy);\n }\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (((MemeLab.get(getActivity())).getMemes()).contains(\n MemeLab.get(getActivity()).getMeme(selectedImagePath)) ||\n ((MemeLab.get(getActivity())).getMyanmarMemes()).contains(\n MemeLab.get(getActivity()).getMeme(selectedImagePath)) ||\n (MemeLab.get(getActivity())\n .getCustomMemes()\n .contains(MemeLab.get(getActivity()).getMeme(selectedImagePath)))) {\n if (isChecked) {\n Toast.makeText(getActivity(), \"added to Favorites\", Toast.LENGTH_SHORT).show();\n sendResult(FAVORITE_RESULT, true);\n }\n if (!isChecked) {\n Toast.makeText(getActivity(), \"removed from Favorites\", Toast.LENGTH_SHORT).show();\n sendResult(FAVORITE_RESULT, false);\n }\n } else {\n Toast.makeText(getActivity(), \"cannot add Custom images to Favorites\", Toast.LENGTH_SHORT)\n .show();\n }\n }", "public void onCheckboxClicked(View view) {\n boolean aprendido = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch (view.getId()) {\n case R.id.checkboxAprendido:\n if (aprendido == true) {\n // Put some meat on the sandwich\n break;\n }\n }\n }", "@Override\r\n public void onClick(View view){\r\n int actualClicked = view.getId();\r\n\r\n for(SpecialPoint box: allCheckBoxes){\r\n int tempId = box.getCheckBox().getId();\r\n CheckBox currentBox = box.getCheckBox();\r\n\r\n if(tempId == actualClicked && currentBox.isChecked()){\r\n currentBox.setChecked(true);\r\n }else{\r\n currentBox.setChecked(false);\r\n }\r\n }\r\n }", "public void setState(boolean isOn, boolean isClicked) {\n\n // YOUR CODE HERE\n \n BufferedImage img0 = ImageIO.read(new File(\"./Icons/Light-0.png\"));\n icon0 = new ImageIcon(img0);\n \n \n \n\n BufferedImage img1 = ImageIO.read(new File(\"./Icons/Light-1.png\"));\n icon1=new ImageIcon(img1);\n \n \n \n\n BufferedImage img2 = ImageIO.read(new File(\"./Icons/Light-2.png\"));\n icon2=new ImageIcon(img2);\n \n \n\n BufferedImage img3 = ImageIO.read(new File(\"./Icons/Light-3.png\"));\n icon3=new ImageIcon(img3);\n \n \n \n\n\n if(isOn == true){\n lbl.setIcon(icon0);\n state = 1; \n }else{ \n lbl.setIcon(icon1);\n state = 0;\n }\n if(isClicked == true){\n //0 means light off\n //1 means light on\n //2 means light on for solution\n //3 means light on for optimal solution\n if(state == 0 ){\n lbl.setIcon(icon0);\n state = 1;\n }\n if(state == 1){\n lbl.setIcon(icon1);\n state = 0; \n }\n if(state == 2 ){\n lbl.setIcon(icon2);\n state = 1;\n }\n if(state == 3){\n lbl.setIcon(icon3);\n state = 1;\n }\n }\n\n }", "public void handleActionChosenImageView(MouseEvent event){\n Integer actionSelected = buttonAction.get(event.getSource());\n System.out.println(\"input sent from gameboard Controller : execute action \" + actionSelected.toString());\n sender.sendInput(\"execute action \" + actionSelected.toString());\n\n for (Map.Entry<Integer, ImageView> entry : coverImages.entrySet()) {\n\n entry.getValue().setVisible(false);\n }\n\n }", "public void changeImage(){\n if(getImage()==storeItemImg) setImage(selected);\n else setImage(storeItemImg);\n }", "private void checkClicked()\n {\n if (Greenfoot.mouseClicked(this))\n {\n if (musicPlaying == true)\n {\n setImage(\"volumeOn.png\");\n GreenfootImage volumeOn = getImage();\n volumeOn.scale(70,70);\n setImage(volumeOn); \n soundtrack.playLoop();\n musicPlaying = false;\n }\n else if (musicPlaying == false)\n {\n setImage(\"volumeOff.png\");\n GreenfootImage volumeOff = getImage();\n volumeOff.scale(70,70);\n soundtrack.stop();\n musicPlaying = true;\n }\n }\n }", "public void onCheckBoxClicked(View view) {\n\n switch (view.getId()) {\n\n case R.id.checkbox_answer1:\n answer1Clicked = true;\n break;\n case R.id.checkbox_answer2:\n answer2Clicked = true;\n break;\n case R.id.checkbox_answer3:\n answer3Clicked = true;\n break;\n case R.id.checkbox_answer4:\n answer4Clicked = true;\n break;\n }\n\n }", "public void onAssetCheckboxClicked(View view) {\n\n boolean assetBoxChecked = ((CheckBox) view).isChecked(); // variable to check if the checkbox is checked or not\n\n switch (view.getId()){\n\n case R.id.checkbox_chequing:\n checkedAsset = findViewById(R.id.checkbox_chequing);\n chequingAccountAsset = chequingAccount.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset, assetBoxChecked,chequingAccountTV.getText().toString(), chequingAccountAsset);\n break;\n\n case R.id.checkbox_savings:\n checkedAsset = findViewById(R.id.checkbox_savings);\n savingsAndTaxesAsset = savingsAndTaxesAmount.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,savingsAndTaxesTV.getText().toString(), savingsAndTaxesAsset);\n break;\n\n case R.id.checkbox_rainydayFund:\n checkedAsset = findViewById(R.id.checkbox_rainydayFund);\n rainyDayFundAsset = rainyDayFund.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,rainyDayFunTV.getText().toString(), rainyDayFundAsset);\n break;\n\n case R.id.checkbox_pdSavings:\n checkedAsset = findViewById(R.id.checkbox_pdSavings);\n personalDevelopmentSavingsAsset = personalDevelopmentSavings.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,personalDevelopmentSavingsTV.getText().toString(), personalDevelopmentSavingsAsset);\n break;\n\n case R.id.checkbox_travelSavings:\n checkedAsset = findViewById(R.id.checkbox_travelSavings);\n travelSavingsAsset = travelSavings.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,travelSavingsTv.getText().toString(), travelSavingsAsset);\n break;\n\n case R.id.checkbox_investments:\n checkedAsset = findViewById(R.id.checkbox_investments);\n investmentsAsset = investments.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,investmentsTV.getText().toString(), investmentsAsset);\n break;\n\n case R.id.checkbox_primeHome:\n checkedAsset = findViewById(R.id.checkbox_primeHome);\n primaryHomeAsset = primaryHomeAmount.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,primaryHomeAmountTV.getText().toString(), primaryHomeAsset);\n break;\n\n case R.id.checkbox_secHome:\n checkedAsset = findViewById(R.id.checkbox_secHome);\n secondaryHomeAsset = secondaryHomeAmount.getText().toString();\n addOrRemoveAssetInMaps(checkedAsset,assetBoxChecked,secondaryHomeAmountTV.getText().toString(), secondaryHomeAsset);\n break;\n\n\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tcheckboxsActionPerformed(evt);\n\t\t\t}", "@SuppressLint(\"NewApi\")\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onCheckedChanged(CompoundButton buttonView,\n\t\t\t\t\t\t\tboolean isChecked) {\n\n\t\t\t\t\t\tToggleButton tb = (ToggleButton) buttonView;\n\t\t\t\t\t\tint id = tb.getId();\n\n\t\t\t\t\t\tif (tb.isChecked()) {\n\t\t\t\t\t\t\ttb.setChecked(true);\n\t\t\t\t\t\t\tthumbnailsselection[id] = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttb.setChecked(false);\n\t\t\t\t\t\t\tthumbnailsselection[id] = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}", "public void onCheckboxClicked(View view) {\n boolean checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch(view.getId()) {\n case R.id.LED1:\n if (checked) {\n Toast.makeText(getApplicationContext(), \"LED1 ON\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getApplicationContext(), \"LED1 OFF\", Toast.LENGTH_SHORT).show();\n }\n case R.id.LED2:\n if (checked) {\n Toast.makeText(getApplicationContext(), \"LED2 ON\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getApplicationContext(), \"LED2 OFF\", Toast.LENGTH_SHORT).show();\n }\n case R.id.LED3:\n if (checked) {\n Toast.makeText(getApplicationContext(), \"LED3 ON\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getApplicationContext(), \"LED2 OFF\", Toast.LENGTH_SHORT).show();\n }\n case R.id.LED4:\n if (checked) {\n Toast.makeText(getApplicationContext(), \"LED4 ON\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(getApplicationContext(), \"LED4 OFF\", Toast.LENGTH_SHORT).show();\n }\n\n break;\n // TODO: Veggie sandwich\n }\n }", "public void actionPerformed(ActionEvent evt) {\n Object source = evt.getSource();\n\n if (source instanceof JCheckBoxMenuItem) {\n if ((JCheckBoxMenuItem) source == disableAll) {\n if (disableAll.isSelected()) {\n allocation.setSelected(false);\n remaining.setSelected(false);\n observability.setSelected(false);\n zoneOfAvoidance.setSelected(false);\n } else {\n allocation.setSelected(true);\n remaining.setSelected(true);\n observability.setSelected(true);\n zoneOfAvoidance.setSelected(true);\n }\n } else {\n disableAll.setSelected(false);\n }\n\n localQuerytool.setAllocationConstraint(!allocation.isSelected());\n localQuerytool.setRemainingConstraint(!remaining.isSelected());\n localQuerytool.setObservabilityConstraint(\n !observability.isSelected());\n localQuerytool.setZoneOfAvoidanceConstraint(\n !zoneOfAvoidance.isSelected());\n if (allocation.isSelected() && remaining.isSelected()\n && observability.isSelected()\n && zoneOfAvoidance.isSelected()) {\n // If all selected - set to green light\n URL url = ClassLoader.getSystemResource(\"green_light1.gif\");\n ImageIcon icon = new ImageIcon(url);\n InfoPanel.searchButton.setIcon(icon);\n table.setBackground(Color.WHITE);\n\n } else if (!allocation.isSelected() && !remaining.isSelected()\n && !observability.isSelected()\n && !zoneOfAvoidance.isSelected()) {\n // No constraints disabled - set to red\n URL url = ClassLoader.getSystemResource(\"red_light1.gif\");\n ImageIcon icon = new ImageIcon(url);\n InfoPanel.searchButton.setIcon(icon);\n table.setBackground(Color.RED.darker());\n\n } else {\n // Some constraints disabled - set to amber\n URL url = ClassLoader.getSystemResource(\"amber_light1.gif\");\n ImageIcon icon = new ImageIcon(url);\n InfoPanel.searchButton.setIcon(icon);\n table.setBackground(Color.YELLOW.darker());\n }\n } else if (source instanceof JMenuItem) {\n JMenuItem thisItem = (JMenuItem) source;\n String thisText = thisItem.getText();\n\n if (INDEX.equalsIgnoreCase(thisText)) {\n new HelpPage();\n\n } else if (ABOUT.equalsIgnoreCase(thisText)) {\n String version = System.getProperty(\"version\", \"unknown\");\n JOptionPane.showMessageDialog(null,\n \"Build corresponds to Git commit : \\n\" + version);\n\n } else if (RELOAD_CAL.equalsIgnoreCase(thisText)) {\n calibrationMenu.reload();\n\n } else if (EXIT.equalsIgnoreCase(thisText)) {\n exitQT();\n\n } else if (COLUMNS.equalsIgnoreCase(thisText)) {\n new ColumnSelector(this);\n\n } else if (LOG.equalsIgnoreCase(thisText)) {\n LogViewer viewer = new LogViewer();\n viewer.showLog(System.getProperty(\"QT_LOG_DIR\") + \"/QT.log\");\n\n } else if (INFRA_RED.equalsIgnoreCase(thisText)) {\n infoPanel.getSatPanel().setDisplay(thisItem.getText());\n\n } else if (WATER_VAPOUR.equalsIgnoreCase(thisText)) {\n infoPanel.getSatPanel().setDisplay(thisItem.getText());\n }\n } else if (source instanceof JButton) {\n JButton thisButton = (JButton) source;\n\n if (thisButton.getText().equals(EXIT)) {\n exitQT();\n } else {\n logger.debug(\"Popup send MSB\");\n performSendToStagingArea();\n }\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n selectButton = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n selectedPic = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n cannyIrisImage = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n htIrisImage = new javax.swing.JLabel();\n cannyPupilImage = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n htPupilImage = new javax.swing.JLabel();\n jLabel12 = new javax.swing.JLabel();\n eyeDetectedImage = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n editedImage = new javax.swing.JLabel();\n jLabel15 = new javax.swing.JLabel();\n userData = new javax.swing.JLabel();\n jLabel1 = new javax.swing.JLabel();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n jMenu2 = new javax.swing.JMenu();\n jMenu3 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Iris-Pupil detection\");\n setBackground(new java.awt.Color(153, 153, 153));\n setFont(new java.awt.Font(\"Times New Roman\", 3, 24)); // NOI18N\n setMinimumSize(new java.awt.Dimension(860, 640));\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n selectButton.setText(\"select image\");\n selectButton.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n selectButtonMouseClicked(evt);\n }\n });\n selectButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n selectButtonActionPerformed(evt);\n }\n });\n getContentPane().add(selectButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 580, 105, -1));\n\n jLabel2.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel2.setForeground(new java.awt.Color(0, 51, 153));\n jLabel2.setText(\"selected image\");\n getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 20, 118, -1));\n\n selectedPic.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/resources/empty.png\"))); // NOI18N\n selectedPic.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(selectedPic, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, 256, 160));\n\n jLabel4.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel4.setForeground(new java.awt.Color(0, 51, 153));\n jLabel4.setText(\"canny iris\");\n getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 20, 101, -1));\n\n cannyIrisImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(cannyIrisImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 50, 256, 160));\n\n jLabel6.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel6.setForeground(new java.awt.Color(0, 51, 153));\n jLabel6.setText(\"hough transformed iris\");\n getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 20, -1, -1));\n\n htIrisImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(htIrisImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 50, 256, 160));\n\n cannyPupilImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(cannyPupilImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 260, 256, 160));\n\n jLabel9.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel9.setForeground(new java.awt.Color(0, 51, 153));\n jLabel9.setText(\"Iris-Pupil detected\");\n getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 230, 150, -1));\n\n jLabel10.setBackground(new java.awt.Color(255, 255, 255));\n jLabel10.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel10.setForeground(new java.awt.Color(0, 51, 153));\n jLabel10.setText(\"canny pupil\");\n getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 230, -1, 20));\n jLabel10.getAccessibleContext().setAccessibleDescription(\"\");\n\n htPupilImage.setBackground(new java.awt.Color(204, 204, 204));\n htPupilImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(htPupilImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 260, 256, 160));\n\n jLabel12.setFont(new java.awt.Font(\"Times New Roman\", 1, 18)); // NOI18N\n jLabel12.setForeground(new java.awt.Color(0, 51, 153));\n jLabel12.setText(\"hough transformed pupil\");\n getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(620, 230, 210, -1));\n\n eyeDetectedImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(eyeDetectedImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 260, 256, 160));\n\n jButton1.setText(\"Insert in database\");\n jButton1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton1MouseClicked(evt);\n }\n });\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 580, -1, -1));\n\n jButton2.setText(\"Compare with database images\");\n jButton2.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jButton2MouseClicked(evt);\n }\n });\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 580, -1, -1));\n\n editedImage.setBorder(javax.swing.BorderFactory.createTitledBorder(\"\"));\n getContentPane().add(editedImage, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 50, 256, 160));\n\n jLabel15.setFont(new java.awt.Font(\"Times New Roman\", 3, 18)); // NOI18N\n jLabel15.setForeground(new java.awt.Color(0, 51, 153));\n jLabel15.setText(\"Radius: \\n\");\n getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 520, 760, 50));\n\n userData.setFont(new java.awt.Font(\"Times New Roman\", 3, 18)); // NOI18N\n getContentPane().add(userData, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 460, 950, 40));\n\n jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/resources/hi-tech-tehnologii-glaz.jpg\"))); // NOI18N\n jLabel1.setMaximumSize(new java.awt.Dimension(1024, 680));\n jLabel1.setMinimumSize(new java.awt.Dimension(1024, 680));\n getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(-10, 10, 1450, 840));\n\n jMenu1.setText(\"File\");\n jMenuBar1.add(jMenu1);\n\n jMenu2.setText(\"Edit\");\n jMenuBar1.add(jMenu2);\n\n jMenu3.setText(\"help\");\n jMenuBar1.add(jMenu3);\n\n setJMenuBar(jMenuBar1);\n\n pack();\n }", "public void onCheckboxClicked(View view, ScoutFormData sfd) {\n // Is the view now checked?\n boolean checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch(view.getId()) {\n case R.id.eCheck_StackYellow:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSYELLOW_COLUMN(\"1\");\n sfd.setEBONUSYELLOW_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSYELLOW_COLUMN(\"0\");\n sfd.setEBONUSYELLOW_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_StackTop:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSTOP_COLUMN(\"1\");\n sfd.setEBONUSTOP_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSTOP_COLUMN(\"0\");\n sfd.setEBONUSTOP_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_StackBottom:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSBOTTOM_COLUMN(\"1\");\n sfd.setEBONUSBOTTOM_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEBONUSBOTTOM_COLUMN(\"0\");\n sfd.setEBONUSBOTTOM_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_AbleCollect:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPCOLLECT_COLUMN(\"1\");\n sfd.setEHPCOLLECT_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPCOLLECT_COLUMN(\"0\");\n sfd.setEHPCOLLECT_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_Stacker:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPSTACKER_COLUMN(\"1\");\n sfd.setEHPSTACKER_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPSTACKER_COLUMN(\"0\");\n sfd.setEHPSTACKER_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_Herder:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPHERDER_COLUMN(\"1\");\n sfd.setEHPHERDER_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPHERDER_COLUMN(\"0\");\n sfd.setEHPHERDER_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_BinSpecialist:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPBIN_COLUMN(\"1\");\n sfd.setEHPBIN_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPBIN_COLUMN(\"0\");\n sfd.setEHPBIN_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_NoodleSpecialist:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPNOODLE_COLUMN(\"1\");\n sfd.setEHPNOODLE_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPNOODLE_COLUMN(\"0\");\n sfd.setEHPNOODLE_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_Inbound:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPINBOUND_COLUMN(\"1\");\n sfd.setEHPINBOUND_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPINBOUND_COLUMN(\"0\");\n sfd.setEHPINBOUND_COLUMN(\"0\");\n }\n break;\n case R.id.eCheck_Other:\n if (checked) {\n Log.i(\"Stack Yellow\", \"Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPOTHER_COLUMN(\"1\");\n sfd.setEHPOTHER_COLUMN(\"1\");\n }\n else {\n Log.i(\"Stack Yellow\", \"Un-Checked\");\n //((ScoutFormActivity) getActivity()).getScoutForm().setEHPOTHER_COLUMN(\"0\");\n sfd.setEHPOTHER_COLUMN(\"0\");\n }\n break;\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n picLabel = new javax.swing.JLabel();\n sourceButton = new javax.swing.JButton();\n searchButton = new javax.swing.JButton();\n refineButton = new javax.swing.JButton();\n imgLabel1 = new javax.swing.JLabel();\n imgLabel2 = new javax.swing.JLabel();\n imgLabel3 = new javax.swing.JLabel();\n imgLabel6 = new javax.swing.JLabel();\n imgLabel5 = new javax.swing.JLabel();\n imgLabel4 = new javax.swing.JLabel();\n imgLabel7 = new javax.swing.JLabel();\n imgLabel8 = new javax.swing.JLabel();\n imgLabel9 = new javax.swing.JLabel();\n imgLabel10 = new javax.swing.JLabel();\n jCheckBox1 = new javax.swing.JCheckBox();\n jCheckBox2 = new javax.swing.JCheckBox();\n jCheckBox3 = new javax.swing.JCheckBox();\n jCheckBox4 = new javax.swing.JCheckBox();\n jCheckBox5 = new javax.swing.JCheckBox();\n jCheckBox6 = new javax.swing.JCheckBox();\n jCheckBox7 = new javax.swing.JCheckBox();\n jCheckBox8 = new javax.swing.JCheckBox();\n jCheckBox9 = new javax.swing.JCheckBox();\n jCheckBox10 = new javax.swing.JCheckBox();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"HYBRID CBIR INTERFACE\");\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n getContentPane().add(picLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(448, 11, 128, 128));\n\n sourceButton.setText(\"Select Source\");\n sourceButton.setToolTipText(\"Select source image\");\n sourceButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n sourceButtonActionPerformed(evt);\n }\n });\n getContentPane().add(sourceButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(479, 145, -1, -1));\n\n searchButton.setText(\"Search\");\n searchButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n searchButtonActionPerformed(evt);\n }\n });\n getContentPane().add(searchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(479, 310, 97, -1));\n searchButton.getAccessibleContext().setAccessibleDescription(\"Search image database\");\n\n refineButton.setText(\"Refine\");\n refineButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n refineButtonActionPerformed(evt);\n }\n });\n getContentPane().add(refineButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(479, 393, 97, -1));\n refineButton.getAccessibleContext().setAccessibleDescription(\"Refine selected images\");\n\n getContentPane().add(imgLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 254, 128, 128));\n getContentPane().add(imgLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 254, 128, 128));\n getContentPane().add(imgLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 254, 128, 128));\n getContentPane().add(imgLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 395, 128, 128));\n getContentPane().add(imgLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 395, 128, 128));\n getContentPane().add(imgLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 395, 128, 128));\n getContentPane().add(imgLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 535, 128, 128));\n getContentPane().add(imgLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 535, 128, 128));\n getContentPane().add(imgLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 535, 128, 128));\n getContentPane().add(imgLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 535, 128, 128));\n getContentPane().add(jCheckBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 360, -1, -1));\n getContentPane().add(jCheckBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 360, -1, -1));\n getContentPane().add(jCheckBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 360, -1, -1));\n getContentPane().add(jCheckBox4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 500, -1, -1));\n getContentPane().add(jCheckBox5, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 500, -1, -1));\n getContentPane().add(jCheckBox6, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 500, -1, -1));\n getContentPane().add(jCheckBox7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 640, -1, -1));\n getContentPane().add(jCheckBox8, new org.netbeans.lib.awtextra.AbsoluteConstraints(156, 640, -1, -1));\n getContentPane().add(jCheckBox9, new org.netbeans.lib.awtextra.AbsoluteConstraints(302, 640, -1, -1));\n getContentPane().add(jCheckBox10, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 640, -1, -1));\n\n pack();\n }", "@Override\n public void onClick(View v) {\n SharedPreferences.Editor prefsEditor = settingsPreferences.edit();\n if (settingsPreferences.getBoolean(TAG_VIBE_NOTIFICATION, false)) {\n prefsEditor.putBoolean(TAG_VIBE_NOTIFICATION, false);\n cbVibeNotify.setImageResource(R.drawable.check2);\n } else {\n prefsEditor.putBoolean(TAG_VIBE_NOTIFICATION, true);\n cbVibeNotify.setImageResource(R.drawable.check0);\n }\n prefsEditor.commit();\n }", "private void changeGraphic(ToggleButton toggleButton, Image diceImage){\n\t toggleButton.setGraphic(new ImageView(diceImage));\n\t}", "public void onCheckboxClicked(View view) {\n checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch(view.getId()) {\n case R.id.checkBox2:\n if (checked)\n {\n email_confirmation.setChecked(false);\n email_notification.setChecked(false);\n emailPref = \"No\";\n\n }\n else\n {\n emailPref = \"Yes\";\n email_confirmation.setChecked(true);\n email_notification.setChecked(true);\n }\n break;\n\n }\n }", "@SuppressLint(\"SetTextI18n\")\n public void tileClicked(View view) {\n\n if (!gameOver) {\n TextView textView = findViewById(R.id.textView2);\n textView.setText(\"\");\n\n // determines row and column of checked box\n int id = view.getId();\n int row;\n int column;\n\n if (id == R.id.imageButton1) {\n row = 0;\n column = 0;\n } else if (id == R.id.imageButton2) {\n row = 1;\n column = 0;\n } else if (id == R.id.imageButton3) {\n row = 2;\n column = 0;\n } else if (id == R.id.imageButton4) {\n row = 0;\n column = 1;\n } else if (id == R.id.imageButton5) {\n row = 1;\n column = 1;\n } else if (id == R.id.imageButton6) {\n row = 2;\n column = 1;\n } else if (id == R.id.imageButton7) {\n row = 0;\n column = 2;\n } else if (id == R.id.imageButton8) {\n row = 1;\n column = 2;\n } else {\n row = 2;\n column = 2;\n }\n\n // changes box to user's tile (i.e. cross or circle)\n Tile tile = game.draw(row, column);\n\n // checks whether board has three of the same tiles in a row\n GameState gamestate = game.check(row, column, tile);\n\n // changes UI to user's tile (i.e. cross or circle)\n ImageButton button = findViewById(id);\n switch (tile) {\n case CROSS:\n button.setBackgroundResource(R.drawable.cross);\n break;\n case CIRCLE:\n button.setBackgroundResource(R.drawable.circle);\n break;\n }\n\n // returns statement if one of the player's has won the game\n if (gamestate == GameState.PLAYER_ONE) {\n if (playersCount == 2) {\n textView.setText(player1 + \" wins!\");\n gameOver = true;\n } else {\n textView.setText(\"Game won!\");\n gameOver = true;\n }\n } else if (gamestate == GameState.PLAYER_TWO) {\n if (playersCount == 2) {\n textView.setText(player2 + \" wins!\");\n gameOver = true;\n } else {\n textView.setText(\"Game won!\");\n gameOver = true;\n }\n }\n }\n }", "@Override\n public void onClick(View v) {\n\n if (image.getId() == v.getId()) {\n Integer idCurrentDrawable = (Integer) image.getTag();\n if (idCurrentDrawable == R.drawable.image1) {\n image.setImageResource(R.drawable.imagen2);\n image.setTag(R.drawable.imagen2);\n modificarFuente();\n } else {\n image.setImageResource(R.drawable.image1);\n image.setTag(R.drawable.image1);\n campoDeTexto.setText(\"Hola mundo!!!\");\n\n }\n }\n }", "@FXML\n private void handleIsPaid(MouseEvent event) \n {\n Image Paid = new Image(\"/examProjectTheDisciplesOfSkrumm/GUI/Icons/Paid.png\");\n Image NotPaid = new Image(\"/examProjectTheDisciplesOfSkrumm/GUI/Icons/NotPaid.png\");\n \n if(isPaidNum == 0)\n {\n ClientRateTextField.setDisable(false);\n isPaidNum = 1;\n IspaidImageView.setImage(Paid);\n \n }\n else if (isPaidNum == 1)\n {\n ClientRateTextField.setDisable(true);\n isPaidNum = 0;\n IspaidImageView.setImage(NotPaid);\n }\n }", "@Override\n public void onClick(View v) {\n filteredNewsgroupItems.get(fPosition).setSelected(((CheckBox)v).isChecked());\n }", "@Override\n public void onClick(View v) {\n chooseImage();\n }", "@Override\n public void onClick(View v) {\n SharedPreferences.Editor prefsEditor = settingsPreferences.edit();\n if (settingsPreferences.getBoolean(TAG_ASCAN_MODIFIED_FILES, false)) {\n prefsEditor.putBoolean(TAG_ASCAN_MODIFIED_FILES, false);\n cbModFiles.setImageResource(R.drawable.check2);\n } else {\n prefsEditor.putBoolean(TAG_ASCAN_MODIFIED_FILES, true);\n cbModFiles.setImageResource(R.drawable.check0);\n }\n prefsEditor.commit();\n }", "public void onCheckboxClicked(View view) {\n boolean checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch(view.getId()) {\n case R.id.checkbox_termos:\n if (checked) {\n termosAceitos = true;\n }else {\n termosAceitos = false;\n }\n break;\n }\n }", "public void drawImg(Graphics g, ArrayList<Atom> recipe){\n for(int i = 0; i < chkArr.length; i++){\n for(int j = 0; j < chkArr[0].length; j++){\n for(int k = 0; k < recipe.size(); k++){\n if(chkArr[i][j] == k+1 ){\n recipe.get(k).drawImg(g,j*32,i*32);\n }\n }\n }\n }\n }", "public void onCheckboxClicked(View view) {\n boolean checked = ((CheckBox) view).isChecked();\n\n // Check which checkbox was clicked\n switch (view.getId()) {\n case R.id.cb_cod:\n if (cb_cod.isChecked()) {\n cod = \"1\";\n } else {\n cod = \"0\";\n }\n\n\n break;\n }\n }", "public void actionPerformed(ActionEvent e)\n {\n JCheckBoxMenuItem menuItem = (JCheckBoxMenuItem) e.getSource();\n\n for (Map.Entry<ChatTransport, JCheckBoxMenuItem> transportMenuItem\n : transportMenuItems.entrySet())\n {\n ChatTransport chatTransport = transportMenuItem.getKey();\n\n if (transportMenuItem.getValue().equals(menuItem))\n {\n this.setSelected( menuItem,\n chatTransport,\n (ImageIcon) menuItem.getIcon());\n\n chatSession.getChatSessionRenderer()\n .setChatIcon(new ImageIcon(\n Constants.getStatusIcon(chatTransport.getStatus())));\n\n return;\n }\n }\n\n if (logger.isDebugEnabled())\n logger.debug( \"Could not find contact for menu item \"\n + menuItem.getText() + \". contactsTable(\"\n + transportMenuItems.size()+\") is : \"\n + transportMenuItems);\n }", "private void imagenCheck(ImageIcon iconCheck, JLabel imagenCheck) {\n\n /*Imagen en jLabel*/\n Image img = iconCheck.getImage();\n Image newimg = img.getScaledInstance(28, 21, java.awt.Image.SCALE_SMOOTH);\n ImageIcon newIcon = new ImageIcon(newimg);\n\n imagenCheck.setIcon(newIcon);\n imagenCheck.setSize(28, 21);\n\n imagenCheck.setVisible(true);\n }", "public static void updateActiveCheck(boolean success) {\n \n if(success) {\n \n \n /*System.out.println(\"YES\" + x);\n ACTIVE_ICON.setIcon(ICON_ACTIVE);// = new ImageIcon(\"/images/Start_ACTIVE.png\"););\n ACTIVE_ICON.setVisible(true);\n INACTIVE_ICON.setVisible(false);*/\n updateChecker.updateActiveCheck(true);\n x = true;\n viewStudentsButton.setVisible(true);\n \n }\n else if(!success) {\n /*\n System.out.println(\"NO\" + x);\n ACTIVE_ICON.setIcon(y);\n ACTIVE_ICON.setVisible(false);\n INACTIVE_ICON.setVisible(true);*/\n x = false;\n updateChecker.updateActiveCheck(false);\n viewStudentsButton.setVisible(false);\n\n }\n }", "public void itemStateChanged(ItemEvent check) {\r\n\r\n // Process the reaction class checkboxes. First\r\n // get the components of the relevant panels\r\n // and store in Component arrays (Note: the method\r\n // getComponents() is inherited from the Container\r\n // class by the subclass Panel).\r\n\r\n Component [] components4 = panel4.getComponents();\r\n Component [] components5 = panel5.getComponents();\r\n\r\n // Now process these components that are checkboxes\r\n // (only the first element of each array is). First cast the\r\n // Component to a Checkbox. Then use the getState()\r\n // method of Checkbox to return boolean true if\r\n // checked and false otherwise.\r\n\r\n Checkbox cb4 = (Checkbox)components4[0]; // Checkbox for panel4\r\n Checkbox cb5 = (Checkbox)components5[0]; // Checkbox for panel5\r\n\r\n // Then use the getState() method of Checkbox to\r\n // return boolean true if checked and false otherwise.\r\n // Use this logic to disable one or the other sets of\r\n // choices for temperature and density input.\r\n\r\n if( cb4.getState() ) {\r\n checkBox[1].setState(false); // Seems needed despite CheckBoxGroup\r\n rho.disable();\r\n rho.setBackground(disablebgColor);\r\n rhoL.setForeground(disablefgColor);\r\n T9.disable();\r\n T9.setBackground(disablebgColor);\r\n T9L.setForeground(disablefgColor);\r\n profile.enable();\r\n profile.setBackground(panelBackColor);\r\n profileL.setForeground(panelForeColor);\r\n } else if ( cb5.getState() ) {\r\n checkBox[0].setState(false);\r\n rho.enable();\r\n rho.setBackground(panelBackColor);\r\n rhoL.setForeground(panelForeColor);\r\n T9.enable();\r\n T9.setBackground(panelBackColor);\r\n T9L.setForeground(panelForeColor);\r\n profile.disable();\r\n profile.setBackground(disablebgColor);\r\n profileL.setForeground(disablefgColor);\r\n }\r\n }", "public boolean imageIsSelected() {\n return getBikeImagePath() != null;\n }", "private void setImage() {\n\t\t\n\t\tfor(int i=0; i<user.getIsVisited().length; i++) {\n\t\t\tif(user.getIsVisited()[i])\n\t\t\t\tspots[i].setBackgroundResource(R.drawable.num1_certified + i*2);\n\t\t\telse\n\t\t\t\tspots[i].setBackgroundResource(R.drawable.num1 + i*2);\n\t\t}\n\t}", "public void checkbox() {\r\n\t\tcheckBox.click();\r\n\t}", "private void doStuff(ImageView iv, int card)\n {\n if (cardsArray[card] == 101)\n {\n iv.setImageResource(image101);\n }\n else if (cardsArray[card] == 102)\n {\n iv.setImageResource(image102);\n }\n if (cardsArray[card] == 201)\n {\n iv.setImageResource(image201);\n }\n else if (cardsArray[card] == 202)\n {\n iv.setImageResource(image202);\n }\n\n\n\n //check which image is selected and save it to the temporary variable\n if (cardNumber == 1)\n {\n firstCard = cardsArray[card];\n if (firstCard > 200)\n {\n firstCard = firstCard - 100;\n }\n cardNumber = 2;\n clickedFirst = card;\n iv.setEnabled(false);\n }\n else if (cardNumber == 2)\n {\n secondCard = cardsArray[card];\n if (secondCard > 200)\n {\n secondCard = secondCard - 100;\n }\n cardNumber = 1;\n clickedSecond = card;\n\n iv_11.setEnabled(false);\n iv_12.setEnabled(false);\n iv_13.setEnabled(false);\n iv_14.setEnabled(false);\n\n Handler handler = new Handler();\n handler.postDelayed(new Runnable()\n {\n @Override\n public void run()\n {\n //check if the selected images are equal\n calculate();\n }\n },1000);\n\n }\n\n }", "public void haumeaRadioButtonListener()\r\n {\r\n \r\n if (haumeaRadioButton.isSelected())\r\n dwarfPlanetsImageView.setImage(haumeaImage);\r\n discoveredByLabel.setText(\"Discovered By: Sierra Nevada Observatory\");\r\n dateOfDiscoveryLabel.setText(\"Date of Discovery: March 7, 2003\");\r\n orbitPeriodLabel.setText(\"Orbit Period: 281.93 Earth Years\");\r\n lengthOfDayLabel.setText(\"Length of Day: 3.91 Hours\");\r\n namedAfterLabel.setText(\"Named After: The Hawaiian goddess of childbirth and fertility\");\r\n \r\n }", "@Override\n public void onClick(View v) {\n cdt.cancel();\n if(CorrectAnswer==1)\n {\n score = score+4;\n status.setText(\"Correct\");\n next.setVisibility(View.VISIBLE);\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.correct);\n\n }\n else\n {\n status.setText(\"Wrong\");\n next.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(),\"Correct Answer is option \"+CorrectAnswer,Toast.LENGTH_SHORT).show();\n if(score>0) {\n score = score - 1;\n }\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.wrong);\n chances++;\n }\n //disable images\n option1.setEnabled(false);\n option2.setEnabled(false);\n option3.setEnabled(false);\n option4.setEnabled(false);\n imageMain.setImageResource(images[images_numbers[turn]]);\n }", "public void toggleButton(){\r\n\t\tImageIcon xImage = new ImageIcon(\"image/x.png\");\t//Inserting image to the button\r\n\t\tImageIcon oImage = new ImageIcon(\"image/o.png\");\t//Inserting image to the button\r\n\t\tfor(int i=0;i<3;i++){\t\t\t\t\t//Update the buttons' text base on array of state\r\n\t\t\tfor(int j=0;j<3;j++){\r\n\t\t\t\t this.b[i][j].setIcon(Exer10.state[i][j]==1?xImage:(Exer10.state[i][j]==2?oImage:null));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void jMenuItem1ActionPerformed(ActionEvent evt) {\n\n\t\tif (!entry.isDisabled) {\n\n\t\t\tBufferedImage selectedImage;\n\n\t\t\tJFileChooser _fileChooser = new JFileChooser();\n\t\t\tint retval = _fileChooser.showOpenDialog(Main.this);\n\n\t\t\t/**\n\t\t\t * extensions of images user is allowed to choose\n\t\t\t */\n\t\t\tfinal String[] okFileExtensions = new String[] { \"jpg\", \"png\", \"gif\", \"bmp\", \"jpeg\" };\n\t\t\tFile file;\n\n\t\t\tif (retval == JFileChooser.APPROVE_OPTION) {\n\t\t\t\ttry {\n\t\t\t\t\tfile = _fileChooser.getSelectedFile();\n\t\t\t\t\tBoolean flag = false;\n\t\t\t\t\tfor (String extension : okFileExtensions) {\n\t\t\t\t\t\tif (file.getName().toLowerCase().endsWith(extension)) {\n\t\t\t\t\t\t\toutputFile = file;\n\t\t\t\t\t\t\tfileExtension = extension;\n\t\t\t\t\t\t\tflag = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!flag) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(this, \"Please choose a jpg, jpeg, png, bmp or gif file only.\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tentry.SavedImages.clear();\n\t\t\t\t\tentry.RedoImages.clear();\n\t\t\t\t\tselectedImage = ImageIO.read(file);\n\t\t\t\t\tImage tmg = createImage(((Image) selectedImage).getWidth(this), ((Image) selectedImage).getHeight(this));\n\t\t\t\t\tGraphics tg = tmg.getGraphics();\n\t\t\t\t\ttg.drawImage(selectedImage, 0, 0, null);\n\t\t\t\t\tentry.SavedImages.push(selectedImage);\n\t\t\t\t\tentryImage = tmg;\n\t\t\t\t\tentry.showImage(entryImage);\n\t\t\t\t\tentry.setPreferredSize(new Dimension(entryImage.getWidth(this), entryImage.getHeight(this)));\n\t\t\t\t\tint w = Math.min(entryImage.getWidth(this) + 3, getContentPane().getWidth());\n\t\t\t\t\tint h = Math.min(entryImage.getHeight(this) + 3, getContentPane().getHeight());\n\t\t\t\t\tpictureScrollPane.setBounds((getContentPane().getWidth() - w) / 2, (getContentPane().getHeight() - h) / 2, w, h);\n\t\t\t\t\tpictureScrollPane.setViewportView(entry);\n\t\t\t\t} catch (IOException ex) {\n\t\t\t\t\tLogger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tCheckBox checkbox = (CheckBox) arg0;\r\n\t\t\t\tcProducts.get(position).setCheck(checkbox.isChecked());\r\n\t\t\t\tif (itemChangedListener != null) {\r\n\t\t\t\t\titemChangedListener.itemCilck(position,\r\n\t\t\t\t\t\t\tcheckbox.isChecked());\r\n\t\t\t\t}\r\n\t\t\t\tnotifyDataSetChanged();\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n cdt.cancel();\n if(CorrectAnswer==3)\n {\n score=score+4;\n status.setText(\"Correct\");\n next.setVisibility(View.VISIBLE);\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.correct);\n\n }\n else\n {\n status.setText(\"Wrong\");\n next.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(),\"Correct Answer is option \"+CorrectAnswer,Toast.LENGTH_SHORT).show();\n if(score>0) {\n score = score - 1;\n }\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.wrong);\n chances++;\n }\n //disable images\n option1.setEnabled(false);\n option2.setEnabled(false);\n option3.setEnabled(false);\n option4.setEnabled(false);\n imageMain.setImageResource(images[images_numbers[turn]]);\n }", "@Override\n public void onClick(View v) {\n cdt.cancel();\n if(CorrectAnswer==2)\n {\n score=score+4;\n status.setText(\"Correct\");\n next.setVisibility(View.VISIBLE);\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.correct);\n\n }\n else\n {\n status.setText(\"Wrong\");\n next.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(),\"Correct Answer is option \"+CorrectAnswer,Toast.LENGTH_SHORT).show();\n if(score>0) {\n score = score - 1;\n }\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.wrong);\n chances++;\n }\n //disable images\n option1.setEnabled(false);\n option2.setEnabled(false);\n option3.setEnabled(false);\n option4.setEnabled(false);\n imageMain.setImageResource(images[images_numbers[turn]]);\n }", "@Override\n public void onClick(View v) {\n GalleryConfig.Builder builder = new GalleryConfig.Builder(MainActivity.this);\n if (mRbUil.isChecked()) {\n builder.imageloader(new UILImageLoader());\n } else if (mRbXutils.isChecked()) {\n builder.imageloader(new XUtilsImageLoader(MainActivity.this));\n } else if (mRbXutils3.isChecked()) {\n builder.imageloader(new XUtils3ImageLoader());\n } else if (mRbGlide.isChecked()) {\n builder.imageloader(new GlideImageLoader());\n } else {\n builder.imageloader(new PicassoImageLoader());\n }\n\n if (mRbSingleSelect.isChecked()) {\n builder.singleSelect();\n } else {\n builder.mutiSelect();\n if (TextUtils.isEmpty(mEtMaxSize.getText().toString())) {\n Toast.makeText(getApplicationContext(), \"请输入MaxSize\", Toast.LENGTH_SHORT).show();\n return;\n }\n int maxSize = Integer.parseInt(mEtMaxSize.getText().toString());\n builder.mutiSelectMaxSize(maxSize);\n }\n\n if (mCbEdit.isChecked()) {\n builder.enableEdit();\n }\n\n if (mCbRotate.isChecked()) {\n builder.enableRotate();\n }\n\n if (mCbCrop.isChecked()) {\n builder.enableCrop();\n if (!TextUtils.isEmpty(mEtCropWidth.getText().toString())) {\n int width = Integer.parseInt(mEtCropWidth.getText().toString());\n builder.cropWidth(width);\n }\n\n if (!TextUtils.isEmpty(mEtCropHeight.getText().toString())) {\n int height = Integer.parseInt(mEtCropHeight.getText().toString());\n builder.cropHeight(height);\n }\n\n if (mCbCropSquare.isChecked()) {\n builder.cropSquare();\n }\n }\n\n if (mCbShowCamera.isChecked()) {\n builder.showCamera();\n }\n\n GalleryConfig config = builder.build();\n GalleryFinal.open(config);\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n checkBox_seleccionados[position] = holder.chkItem.isChecked();\n }", "@Override\n\tpublic void onClick(ClickEvent event) {\n\t\tImage image=(Image)event.getSource();\n\t\tif (image.getAltText().equals(\"nonotice\")) {\n\t\t\timage.setUrl(\"images/notice.jpg\");\n\t\t\timage.setAltText(\"notice\");\n\t\t} else {\n\t\t\timage.setUrl(\"images/nonotice.jpg\");\n\t\t\timage.setAltText(\"nonotice\");\n\t\t}\n\t\treadFeed();\n\t}", "boolean isImageDisplayed();", "@Override\n public void onClick(View v) {\n cdt.cancel();\n if(CorrectAnswer==4)\n {\n score=score+4;\n status.setText(\"Correct\");\n next.setVisibility(View.VISIBLE);\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.correct);\n\n }\n else\n {\n\n status.setText(\"Wrong\");\n next.setVisibility(View.VISIBLE);\n Toast.makeText(getApplicationContext(),\"Correct Answer is option \"+CorrectAnswer,Toast.LENGTH_SHORT).show();\n if(score>0) {\n score = score - 1;\n }\n icon.setVisibility(View.VISIBLE);\n icon.setImageResource(R.drawable.wrong);\n chances++;\n }\n //disable images\n option1.setEnabled(false);\n option2.setEnabled(false);\n option3.setEnabled(false);\n option4.setEnabled(false);\n imageMain.setImageResource(images[images_numbers[turn]]);\n }", "public void mouseReleased(MouseEvent e) {\r\n ((JLabel)e.getSource()).setIcon(new ImageIcon(\"images\" + File.separator + \"notSelected.gif\")); \r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(\n\t\t\t\t\t\tIntent.ACTION_PICK,\n\t\t\t\t\t\tandroid.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n\t\t\t\tstartActivityForResult(i, RESULT_LOAD_IMAGE);\n\n\t\t\t refreshResult();\n\t\t\t LeftEdge.setImageResource(R.drawable.left_edgeicon);\n\t\t\t RightEdge.setImageResource(R.drawable.right_edgeicon);\n\t\t\t// ChannelCheck0.setImageResource(R.drawable.control);\n\t\t\t \n\t\t\t}", "public void mousePressed(MouseEvent e) {\r\n ((JLabel)e.getSource()).setIcon(new ImageIcon(\"images\" + File.separator + \"selected.gif\"));\r\n }", "@Override\n public void onCheckedChanged(RadioGroup group, int checkedId) {\n Log.v(\"reached\",\"on click\");\n\n // ArrayAdapter<String> myadapter= new ArrayAdapter<String>(getContext(),android.R.layout.simple_list_item_1,WORDS);\n\n //Use myadapter as input to list\n //drinks.setAdapter(myadapter);\n\n\n\n\n\n\n // Check which radio button was clicked\n switch(checkedId) {\n case R.id.coffee:\n //if (checked)\n Log.v(\"coffee image\",\"is set\");\n image.setImageResource(R.drawable.coffee);\n word = \"Coffee..................................................................$2\";\n\n break;\n case R.id.coke:\n //if (checked)\n Log.v(\"coke image\",\"is set\");\n image.setImageResource(R.drawable.coke);\n word = \"Coke.....................................................................$3\";\n\n break;\n case R.id.tea:\n //if (checked)\n\n image.setImageResource(R.drawable.tea);\n word = \"Tea.......................................................................$2\";\n\n\n break;\n case R.id.water:\n //if (checked)\n\n image.setImageResource(R.drawable.water);\n word = \"Water....................................................................$1\";\n\n\n break;\n }\n\n //Toast.makeText(getContext(), word, Toast.LENGTH_SHORT).show();\n\n overviewOrder fragment = (overviewOrder) getFragmentManager().findFragmentById(R.id.frag_main3);\n if(fragment!=null) {\n fragment.setText(word);\n }\n\n }", "@Override\r\n\t\t\tpublic void stateChanged(ChangeEvent arg0) {\n\t\t\t\ttapNum = jtp.getSelectedIndex();\r\n\t\t\t\tif (tapNum == 2 && tapCheck == true && sendAge != 0) {\r\n\t\t\t\t\tif ((sendAge >= 0 && sendAge < 6) && tapCheck == true) {\r\n\t\t\t\t\t\twho = \"유아\";\r\n\t\t\t\t\t\tteethcheckurl = getClass().getClassLoader()\r\n\t\t\t\t\t\t\t\t.getResource(\"agePart1.png\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\timage = ImageIO.read(teethcheckurl);\r\n\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO 자동 생성된 catch 블록\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfilename1 = new ImageIcon(image);\r\n\t\t\t\t\t\ttapCheck = false;\r\n\t\t\t\t\t\tcheckImg.setIcon(filename1);\r\n\t\t\t\t\t\tinfo_babyTooth.setText(\"20\");\r\n\r\n\t\t\t\t\t} else if ((sendAge >= 6 && sendAge < 12)\r\n\t\t\t\t\t\t\t&& tapCheck == true) {\r\n\t\t\t\t\t\twho = \"아동\";\r\n\t\t\t\t\t\tteethcheckurl = getClass().getClassLoader()\r\n\t\t\t\t\t\t\t\t.getResource(\"agePart2.png\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\timage = ImageIO.read(teethcheckurl);\r\n\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO 자동 생성된 catch 블록\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfilename1 = new ImageIcon(image);\r\n\t\t\t\t\t\ttapCheck = false;\r\n\t\t\t\t\t\tcheckImg.setIcon(filename1);\r\n\t\t\t\t\t\tinfo_babyTooth.setText(\"20\");\r\n\t\t\t\t\t\tinfo_permanentTooth.setText(\"24\");\r\n\r\n\t\t\t\t\t} else if ((sendAge >= 12 && sendAge < 20)\r\n\t\t\t\t\t\t\t&& tapCheck == true) {\r\n\t\t\t\t\t\twho = \"청소년\";\r\n\t\t\t\t\t\tteethcheckurl = getClass().getClassLoader()\r\n\t\t\t\t\t\t\t\t.getResource(\"agePart3.png\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\timage = ImageIO.read(teethcheckurl);\r\n\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO 자동 생성된 catch 블록\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfilename1 = new ImageIcon(image);\r\n\t\t\t\t\t\ttapCheck = false;\r\n\t\t\t\t\t\tcheckImg.setIcon(filename1);\r\n\t\t\t\t\t\tinfo_permanentTooth.setText(\"28\");\r\n\r\n\t\t\t\t\t} else if (sendAge >= 20 && tapCheck == true) {\r\n\t\t\t\t\t\twho = \"청년\";\r\n\t\t\t\t\t\tteethcheckurl = getClass().getClassLoader()\r\n\t\t\t\t\t\t\t\t.getResource(\"agePart4.png\");\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\timage = ImageIO.read(teethcheckurl);\r\n\t\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t\t// TODO 자동 생성된 catch 블록\r\n\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfilename1 = new ImageIcon(image);\r\n\t\t\t\t\t\ttapCheck = false;\r\n\t\t\t\t\t\tcheckImg.setIcon(filename1);\r\n\t\t\t\t\t\tinfo_permanentTooth.setText(\"28\");\r\n\t\t\t\t\t} else if (sendAge <= 0) {\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "public void restaura(){ \n super.restauraE();\n setImage(\"FrtEA1.png\"); \n check = false; \n }", "public void toglecheckbox(CheckBox ch){\n\t if(ch.isChecked()){\n\t ch.setText(\"This is my business card\");\n\t isyourcard = \"yes\";\n\t }else{\n\t ch.setText(\"This is not my business card\");\n\t isyourcard = \"no\";\n\t }\n\t }", "private void highlightView(AdapterList.ViewHolder holder) {\n holder.checkIcon.setImageResource(R.drawable.check_icon);\n// holder.checkIcon.setVisibility(View.VISIBLE);\n }", "private void updateBay(int indx, boolean newState)\n {\t\n \tImageView iv;\n \tif (indx == 0)\n \t\tiv = (ImageView) findViewById(R.id.imageView1);\n \t\telse if (indx == 1)\n \t\t\tiv = (ImageView) findViewById(R.id.imageView2);\n \t\t\telse if (indx ==2)\n \t\t\t\tiv = (ImageView) findViewById(R.id.imageView1);\n \t\t\telse iv = (ImageView) findViewById(R.id.imageView1);\n \t\n \t//ImageButton btn = (ImageButton) findViewById(R.id.bay0000);\n \t//ImageView iv = (ImageView) findViewById(R.id.imageView1);\n \t\n \tif( states[indx] == false && newState == true)\n \t{\n \t//btn.setImageResource(R.drawable.occupied);\n \tiv.setImageResource(R.drawable.occupied);\n \tiv.animate();\n \tstates[indx] = true;\n \t}\n \telse if( states[indx] == true && newState == false)\n \t{\n \t//btn.setImageResource(R.drawable.avail);\n \tiv.setImageResource(R.drawable.avail);\n \tiv.animate();\n \t//iv.\n \tiv.refreshDrawableState();\n \tstates[indx] = false;\n \t}\n \t\n }", "@Override\n public void onClick(View v) {\n SharedPreferences.Editor prefsEditor = settingsPreferences.edit();\n if (settingsPreferences.getBoolean(TAG_SOUND_NOTIFICATION, false)) {\n prefsEditor.putBoolean(TAG_SOUND_NOTIFICATION, false);\n cbSoundNotify.setImageResource(R.drawable.check2);\n } else {\n prefsEditor.putBoolean(TAG_SOUND_NOTIFICATION, true);\n cbSoundNotify.setImageResource(R.drawable.check0);\n }\n prefsEditor.commit();\n }", "@Override\n\tpublic void itemStateChanged(ItemEvent e) {\n Object source = e.getItemSelectable();\n \n //Now that we know which button was pushed, find out\n //whether it was selected or deselected.\n if (e.getStateChange() == ItemEvent.SELECTED) {\n if (source == this.nbVCheck) {\n\t\t\t\tthis.nbVBox.setVisible(false);\n } else if (source == this.capaCheck) {\n\t\t\t\tthis.capaBox.setVisible(false);\n\t\t\t\tthis.capaExplain.setVisible(false);\n } \n }\n else if (e.getStateChange() == ItemEvent.DESELECTED) {\n if (source == this.nbVCheck) {\n\t\t\t\tthis.nbVBox.setVisible(true);\n } else if (source == this.capaCheck) {\n\t\t\t\tthis.capaBox.setVisible(true);\n\t\t\t\tthis.capaExplain.setVisible(true);\n } \n }\n\t}", "@Override\n public void onClick(View view) {\n\n photoStorage.addImage(currentLabel, currentVisibleImagePath);\n addImage.setEnabled(false);\n }", "@Override\n\t\t public void onClick(View v) {\n\t\t if (v.equals(button1)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill1);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus\");\n\t\t } \n\t\t else if (v.equals(button2)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill2);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus\");\n\t\t }\n\t\t else if (v.equals(button3)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill3);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus\");\n\t\t }\n\t\t else if (v.equals(button4)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill4);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus Main Foyer\");\n\t\t }\n\t\t else if (v.equals(button5)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill5);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus Science Lab\");\n\t\t }\n\t\t else if (v.equals(button6)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill6);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus Cafe Area\");\n\t\t }\n\t\t else if (v.equals(button7)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill7);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus\");\n\t\t }\n\t\t else if (v.equals(button8)) {\n\t\t \tImageView image = (ImageView) findViewById(R.id.imageView2);\n\t\t image.setImageResource(R.drawable.sighthill8);\n\t\t TextView tv = (TextView)findViewById(R.id.textView2);\n\t\t tv.setText(\"Sighthill Campus Learning Resource Centre (LRC)\");\n\t\t }\n\t\t }", "public void changePicture() {\n ImageView imgView = (ImageView)findViewById(R.id.poll_object_btn_image);\n Resources res = getContext().getResources();\n if(type == \"generic\") {\n //add the new picture for the generic type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"location\") {\n //add the new picture for the location type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n else if(type == \"picture\"){\n //add the new picture for the picture type\n Bitmap bitmap = BitmapFactory.decodeResource(res,R.drawable.generic_view);\n imgView.setImageBitmap(bitmap);\n }\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView,\n boolean isChecked) {\n\n\n\n }", "public void itemStateChanged(ItemEvent e) {\n\t\tJCheckBox checkBoxSource = (JCheckBox) e.getSource();\n\n\t\tPLayer currLayer = null;\n\n\t\tif (checkBoxSource == edgesCheckBox) {\n\t\t\tif (vd.getCurrentEdgeLayer() != null) {\n\t\t\t\tcurrLayer = vd.getCurrentEdgeLayer();\n\t\t\t} else {\n\t\t\t\tcurrLayer = pvc.getLayer(PVisualizationCanvas.EDGE_LAYER_NAME);\n\t\t\t}\n\t\t} else if (checkBoxSource == eventsCheckBox) {\n\t\t\tcurrLayer = pvc.getLayer(PVisualizationCanvas.EVENT_LAYER_NAME);\n\t\t} else if (checkBoxSource == labelsCheckBox) {\n\t\t\tcurrLayer = pvc.getLayer(PVisualizationCanvas.LABEL_LAYER_NAME);\n\t\t}\n\n\t\tif (e.getStateChange() == ItemEvent.SELECTED) {\n\t\t\tcurrLayer.setVisible(true);\n\t\t} else {\n\t\t\tcurrLayer.setVisible(false);\n\t\t}\n\t}", "public void setTrangThaiImage(String active){\n if(active.equals(\"true\")){\n mTrangThaiImage.setImageResource(R.drawable.ic_notifications_on_white_24dp);\n }else if (active.equals(\"false\")) {\n mTrangThaiImage.setImageResource(R.drawable.ic_notifications_off_grey600_24dp);\n }\n }", "@Override\n public void mouseClicked(MouseEvent e) {\n JLabel check_label = (JLabel) e.getSource();\n for (int i = 0; i < 9; i++) {\n if (check_label == arr[i]) {\n try {\n namel.setText(list.get(9 * next + i).getName());\n codel.setText(list.get(9 * next + i).getCode());\n pricel.setText(list.get(9 * next + i).getPrice() + \"\");\n detailsl.setText(list.get(9 * next + i).getDetails());\n categoryl.setText(list.get(9 * next + i).getCategory());\n shopid.setText(list.get(9 * next + i).getShop_id());\n data_panal.setVisible(true);\n } catch (Exception ex) {}\n }\n\n }\n }", "public void toggleButtonImageCamera() {\n if (isCameraOn) {\n btnCamera.setImageResource(R.drawable.cam_on);\n } else {\n btnCamera.setImageResource(R.drawable.cam_off);\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser jfc=new JFileChooser(); \r\n\t\t jfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES ); \r\n\t\t jfc.showDialog(new JLabel(), \"选择\"); \r\n\t\t File file=jfc.getSelectedFile();\r\n\t\t if(null==file){\r\n\t\t \treturn;\r\n\t\t }\r\n\t\t if(file.isDirectory()){\r\n\t\t System.out.println(\"文件夹:\"+file.getAbsolutePath()); \r\n\t\t }else if(file.isFile()){\r\n\t\t System.out.println(\"文件:\"+file.getAbsolutePath()); \r\n\t\t }\r\n\t\t if(Util.isImage(file)){\r\n\t\t \tImageIcon img = new ImageIcon(file.getAbsolutePath());\r\n\t\t\t\t\tlbImage.setIcon(img);\r\n\t\t\t\t\tMain.img = img.getImage();\r\n\t\t }else{\r\n\t\t \tJOptionPane.showMessageDialog(Main.this, \"请选择图片\");\r\n\t\t }\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n turn++;\n ys.setText(\"Your Score : \"+score);\n if(turn==19 || chances==3)\n {\n checkEnd();\n }\n else\n {\n\n setImages();\n }\n icon.setVisibility(View.INVISIBLE);\n }", "private void onCheckBoxTeilungLinks()\n\t{\n\t\tif (istBeimTaktLaden)\n\t\t\treturn;\n\n\t\tistBeimTaktLaden = true;\n\t\t\n\t\thandleTeilung(getJCheckBoxTeilungLinks().isSelected(),\n\t\t\t\t\t\tgetJCheckBoxTeilungMitte().isSelected(),\n\t\t\t\t\t\tgetJCheckBoxTeilungRechts().isSelected());\n\t\t\t\t\n\t\tistBeimTaktLaden = false;\n\t}", "public void initComp(){\n\n\n mResultImg = (ImageView) findViewById(R.id.result_imageView);\n\n mResultImg.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (mNormalImg){\n mResultImg.setImageDrawable(PicSingleton.getInstance().getPicShaped());\n mNormalImg = false;\n }\n else {\n mResultImg.setImageBitmap(PicSingleton.getInstance().getPicToShape());\n mNormalImg = true;\n }\n }\n });\n\n mResultImg.setOnLongClickListener(new View.OnLongClickListener() {\n @Override\n public boolean onLongClick(View v) {\n\n showSaveDialog();\n return true;\n }\n });\n\n }", "@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tString name = file.getName().split(\"\\\\.\")[0].trim(); //获取当前图片的名字\n\t\t\tif(name.equals(answerText.getText().trim())) {\n\t\t\t\tanswerText.setText(\"\");\n\t\t\t\tresultText.setText(\"回答正确!\");\n\t\t\t\tfile = files[new Random().nextInt(files.length)];\n\t\t\t\ttry {\n\t\t\t\t\tpicturePanel.image = getImage(file);\n\t\t\t\t\tpicturePanel.repaint();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tanswerText.setText(\"\");\n\t\t\t\tresultText.setText(\"回答错误!\");\n\t\t\t}\n\t\t}", "@Override\n public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {\n if (!isChecked) {\n //show password of door\n type3.setTransformationMethod(PasswordTransformationMethod.getInstance());\n new1.setTransformationMethod(PasswordTransformationMethod.getInstance());\n } else {\n //hide password of door\n type3.setTransformationMethod(HideReturnsTransformationMethod.getInstance());\n new1.setTransformationMethod(HideReturnsTransformationMethod.getInstance());\n }\n }", "private void checkStatus() {\n\t\tif(mApp.isTwitterAuthorized()){\n\t\t\t((ImageButton)findViewById(R.id.fs_share_twitter))\n\t\t\t\t\t.setImageResource(R.drawable.ic_twitter);\n\t\t}else{\n\t\t\t((ImageButton)findViewById(R.id.fs_share_twitter))\n\t\t\t\t\t.setImageResource(R.drawable.ic_twitter_disabled);\n\t\t}\n\t\t// Lo mismo para Facebook\n\t\tif(mApp.isFacebookAuthorized()){\n\t\t\t((ImageButton)findViewById(R.id.fs_share_facebook))\n\t\t\t\t\t.setImageResource(R.drawable.ic_facebook);\n\t\t}else{\n\t\t\t((ImageButton)findViewById(R.id.fs_share_facebook))\n\t\t\t\t\t.setImageResource(R.drawable.ic_facebook_disabled);\n\t\t}\n\t}", "private void checkImage(int id, GraphicsContext gc)\n {\n switch (id)\n {\n case 1:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/hero_onder.png\", 5, 5);\n break;\n case 2:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n break;\n case 3:\n drawImage(gc, \"/images/doel.png\", 0, 0);\n break;\n case 4:\n drawImage(gc, \"/images/muur.png\", 0, 0);\n break;\n case 5:\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/kist.png\", 5, 5);\n break;\n }\n }", "public void onClick(View v) {\n\n ImageButton angel = (ImageButton)findViewById(R.id.angel);\n ImageButton devil = (ImageButton)findViewById(R.id.devil);;\n\n switch (v.getId()) {\n\n case R.id.angel:\n naughty = 1;\n devil.getBackground().clearColorFilter();\n angel.getBackground().setColorFilter(0xe0f47521, PorterDuff.Mode.SRC_ATOP);\n\n break;\n\n case R.id.devil:\n naughty = 2;\n angel.getBackground().clearColorFilter();\n devil.getBackground().setColorFilter(0xe0f47521, PorterDuff.Mode.SRC_ATOP);\n break;\n\n\n default:\n break;\n }\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView,\n boolean isChecked) {\n }", "private void foto1MouseClicked(java.awt.event.MouseEvent evt) {\n boolean r = insertarImagenCrear(foto1, lista1, 0);\n //SI ES TRUE PONEMOS LA VARIABLE F1 EN TRUE, HACIENDO REFERENCIA A QUE EL CUADRO DE LA FOTO SE ENCUENTRA OCUPADO\n if (r) {\n btnEliminar1.setVisible(true);\n btnGuardar.setEnabled(true);\n btnLimpiarLabel.setEnabled(true);\n }\n }", "private Image getImage(boolean isSelected) {\n\t\tString key = isSelected ? CHECKED_IMAGE : UNCHECKED_IMAGE;\n\t\treturn imageRegistry.get(key);\n\t}", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n if (isChecked) {\n\n } else {\n\n }\n }", "@Override\n public void onPutCupRaised() {\n if (!theFSM.getCupPlaced()) {\n BufferedImage myPicture = null;\n try {\n myPicture = ImageIO.read(new File(\"./picts/gobeletPolluant.jpg\"));\n } catch (IOException e) {\n e.printStackTrace();\n }\n currentPicture.setIcon(new ImageIcon(myPicture));\n takeCupButton.setVisible(false);\n }\n }", "@Override \r\n public void onCheckedChanged(CompoundButton buttonView, \r\n boolean isChecked) {\n if(isChecked){ \r\n Log.d(TAG, \"Selected\");\r\n }else{ \r\n Log.d(TAG, \"NO Selected\");\r\n } \r\n }", "public void actionPerformed(ActionEvent e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\t\tchooser.showOpenDialog(null);\r\n\t\t\t\t\tFile f = chooser.getSelectedFile();\r\n\t\t\t\t\tString filename = f.getAbsolutePath();\r\n\t\t\t\t\tprofilePictureAddress = filename;\r\n\t\t\t\t\tString extension = filename.substring(filename.lastIndexOf(\".\") + 1, filename.length());\r\n\t\t\t\t\tif (extension.equals(\"jpg\") || extension.equals(\"png\") || extension.equals(\"jpeg\")\r\n\t\t\t\t\t\t\t|| extension.equals(\"JPG\") || extension.equals(\"JPEG\") || extension.equals(\"gif\")\r\n\t\t\t\t\t\t\t|| extension.equals(\"PNG\")) {\r\n\t\t\t\t\t\tImageIcon imageIcon = new ImageIcon(new ImageIcon(filename).getImage().getScaledInstance(\r\n\t\t\t\t\t\t\t\tlblContactImage.getWidth(), lblContactImage.getHeight(), Image.SCALE_DEFAULT));\r\n\t\t\t\t\t\tlblContactImage.setIcon(imageIcon);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please choose an Image !\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e2) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}", "@Override\n public void render() {\n DepictedItem item = getContent();\n checkedView.setChecked(item.isSelected());\n depictsLabel.setText(item.getName());\n description.setText(item.getDescription());\n final String imageUrl = item.getImageUrl();\n if (TextUtils.isEmpty(imageUrl)) {\n imageView.setImageURI(UriUtil.getUriForResourceId(R.drawable.ic_wikidata_logo_24dp));\n } else {\n imageView.setImageURI(Uri.parse(imageUrl));\n }\n }", "private void setOnClickListener() {\n listener = (itemView, adapterPosition) -> {\n CheckBox cb = itemView.findViewById(R.id.cbIsChecked);\n\n // If checkbox is checked --> add classId of chosen class to classIds\n if(cb.isChecked()) {\n classesIds += classes.get(adapterPosition).getClassId() + \";\";\n }\n // If checkbox is unchecked --> remove classId of chosen class from classIds\n else {\n classesIds = classesIds.replace(classes.get(adapterPosition).getClassId() + \";\", \"\");\n }\n };\n }", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n final TextView sucursal2 = (TextView) findViewById(R.id.textSucursal2);\n boolean i = buttonView.isChecked();\n if (i == false) {\n// sucursal2.setVisibility(View.VISIBLE);\n sucursal2.animate()\n .translationX(0)\n .alpha(1.0f)\n .setDuration(300)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n sucursal2.setVisibility(View.VISIBLE);\n }\n });\n\n\n } else if (i == true) {\n// sucursal2.setVisibility(View.GONE);\n sucursal2.animate()\n .translationX(sucursal2.getWidth())\n .alpha(0.0f)\n .setDuration(300)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n super.onAnimationEnd(animation);\n sucursal2.setVisibility(View.GONE);\n }\n });\n\n }\n\n }", "private void getUserPhotoChoice() {\n int checkedChipId = mBinding.chipGroupPhoto.getCheckedChipId();\n if (checkedChipId == R.id.chip_1_photo) {\n mChipPhotoInput = 1;\n } else if (checkedChipId == R.id.chip_3_photo) {\n mChipPhotoInput = 3;\n } else if (checkedChipId == R.id.chip_5_photo) {\n mChipPhotoInput = 5;\n } else {\n mChipPhotoInput = 0;\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tActivityDataRequest.getImage(MainActivity.this, img1);\n\t\t\t}", "@Override\n public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n }", "public void makemakeRadioButtonListener()\r\n {\r\n \r\n if (makemakeRadioButton.isSelected())\r\n dwarfPlanetsImageView.setImage(makemakeImage);\r\n discoveredByLabel.setText(\"Discovered By: Brown, Trujillo, and Rabinowitz\");\r\n dateOfDiscoveryLabel.setText(\"Date of Discovery: March 31, 2005\");\r\n orbitPeriodLabel.setText(\"Orbit Period: 305.34 Earth Years\");\r\n lengthOfDayLabel.setText(\"Length of Day: 22.48 Hours\");\r\n namedAfterLabel.setText(\"Named After: The Rapanui god of fertility\");\r\n }", "public void actionPerformed(ActionEvent arg0) {\n \t\tfor (int row = 0; row <=2; row++) {\r\n \t\t\tfor (int col = 0; col <=2; col++) {\r\n \t\t\t\t// as the loop continues on each button is getting enabled\r\n \t\t\t\tboxes[row][col].setEnabled(true);\r\n \t\t\t\t// the icon is set to the carback image \r\n \t\t\t\tboxes[row][col].setDisabledIcon(tictac.c);\r\n \t\t\t\t// the check is reset for each box so clicks is 0 to old memory is deleted\r\n \t\t\t\ttictac.check[row][col] = 0;\r\n \t\t\t\t// win is 0 so the gae can be played again\r\n \t\t\t\ttictac.win = 0;\r\n \t\t\t\t// number of clicks = 0 so that the game can be played again\r\n \t\t\t\ttictac.clicks = 0;\r\n \t\t\t\t// set the colours of the txtboxes back to white since they flash yellow when a win in the category is added\r\n \t\t txtAdidas.setBackground(Color.WHITE);\r\n \t\t txtNike.setBackground(Color.WHITE);\r\n \t\t txtTie.setBackground(Color.WHITE);\r\n \t\t\t}\r\n \t\t}\r\n \t}" ]
[ "0.74533504", "0.7381062", "0.6347855", "0.62978333", "0.62930894", "0.6288196", "0.6274842", "0.6240183", "0.6222663", "0.61450887", "0.61126935", "0.6110491", "0.61029816", "0.581781", "0.58037955", "0.5783825", "0.57676965", "0.5736549", "0.5727028", "0.57090557", "0.56895286", "0.5685148", "0.56731665", "0.5663951", "0.5662563", "0.5661817", "0.56351614", "0.5621333", "0.56181663", "0.56101245", "0.56048757", "0.55827475", "0.5573956", "0.5563047", "0.5554316", "0.5544242", "0.55398494", "0.5539699", "0.55357224", "0.5519207", "0.550369", "0.5489943", "0.5485462", "0.54735553", "0.5466117", "0.5453232", "0.5431527", "0.54301524", "0.5429009", "0.5415885", "0.54089856", "0.5401434", "0.5401057", "0.5400652", "0.5400028", "0.53847784", "0.5382218", "0.53821826", "0.53777814", "0.53741294", "0.5369014", "0.5363762", "0.5354966", "0.535363", "0.5351777", "0.5350894", "0.5347661", "0.5344314", "0.53412473", "0.53380936", "0.53330016", "0.53284603", "0.5319172", "0.53107154", "0.52997124", "0.52964765", "0.52952814", "0.52863765", "0.52754766", "0.52723545", "0.52552617", "0.5255038", "0.52438104", "0.52425724", "0.52405375", "0.52400696", "0.52353233", "0.5231323", "0.5230387", "0.5227964", "0.5224212", "0.5219866", "0.5212582", "0.5211018", "0.5210895", "0.5206846", "0.5204714", "0.5204672", "0.5201019", "0.51995015" ]
0.6509661
2
Constructs a new object with given JDBC template.
public DressDaoJdbc(NamedParameterJdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void create(QueryCursor cursor, String indexName, String... templateProperties) throws SQLException;", "public void setTemplate(JdbcTemplate template) {\n\t\tthis.template = template;\n\t}", "public T create(T object) throws SQLException;", "@Autowired\n public ConsoleDaoJdbcTemplateImpl(JdbcTemplate jdbcTemplate) {\n this.jdbcTemplate = jdbcTemplate;\n }", "Statement createStatement();", "Statement createStatement();", "Statement createStatement();", "public SimpleJdbcUpdate(JdbcTemplate jdbcTemplate) {\n super(jdbcTemplate);\n }", "public TracingWrappedJdbcTemplate() {\n\t}", "BSQL2Java2 createBSQL2Java2();", "@Autowired\n public TransactionDao(JdbcTemplate jdbcTemplate) {\n this.jdbcTemplate = jdbcTemplate;\n }", "public OracleSchema(JdbcTemplate jdbcTemplate, OracleDbSupport dbSupport, String name) {\n super(jdbcTemplate, dbSupport, name);\n }", "private Template() {\r\n\r\n }", "private void insertTemplateRow(Connection con,\n IdentifiedRecordTemplate template) throws SQLException {\n PreparedStatement insert = null;\n \n try {\n int internalId = getNextId(TEMPLATE_TABLE, \"templateId\");\n template.setInternalId(internalId);\n String externalId = template.getExternalId();\n String templateName = template.getTemplateName();\n \n insert = con.prepareStatement(INSERT_TEMPLATE);\n insert.setInt(1, internalId);\n insert.setString(2, externalId);\n insert.setString(3, templateName);\n insert.execute();\n } finally {\n DBUtil.close(insert);\n }\n }", "JavaStatement createJavaStatement();", "FromTable createFromTable();", "public void setTemplate(HibernateTemplate template) {\n\t\tthis.template = template;\n\t}", "public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {\n this.jdbcTemplate = jdbcTemplate;\n }", "public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {\r\n this.jdbcTemplate = jdbcTemplate;\r\n }", "public interface JdbcFactory {\n\n void create();\n}", "public TblrefTemplateRecord() {\n super(TblrefTemplate.TBLREF_TEMPLATE);\n }", "public JdbcTemplate getJdbcTemplate() {\n if (jdbcTemplate == null) {\n if (dataSource == null) {\n throw new IllegalStateException(\"ff4j-jdbc: DatabaseStore has not been properly initialized, datasource is null\");\n }\n this.jdbcTemplate = new JdbcTemplate(dataSource);\n }\n return jdbcTemplate;\n }", "public RepositoryImpl(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException {\n\n try {\n\n // Create table from the T class\n TableUtils.createTableIfNotExists(connectionSource,dataClass);\n this.dao = DaoManager.createDao(connectionSource,dataClass);\n\n\n } catch (SQLException e){\n throw new RuntimeException(e);\n }\n\n }", "public TblrefTemplateRecord(Integer tempid, String tempname, String tempcontent, Byte isactive, Timestamp createddate, String createduser) {\n super(TblrefTemplate.TBLREF_TEMPLATE);\n\n set(0, tempid);\n set(1, tempname);\n set(2, tempcontent);\n set(3, isactive);\n set(4, createddate);\n set(5, createduser);\n }", "String createConnectionFromTemplate(String userId,\n String assetManagerGUID,\n String assetManagerName,\n boolean assetManagerIsHome,\n String templateGUID,\n ExternalIdentifierProperties externalIdentifierProperties,\n TemplateProperties templateProperties) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException;", "public TableDefinition(Class<T> model){\n this.singleton = this;\n this.model = model;\n try {\n OBJECT = Class.forName(model.getName());\n createTableDefinition();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Bean\n public JdbcTemplate jdbcTemplate() {\n return new JdbcTemplate(dataSource());\n }", "StringTemplate createStringTemplate();", "protected AbstractJdbcUpdate(JdbcTemplate jdbcTemplate) {\r\n\t\tAssert.notNull(jdbcTemplate, \"JdbcTemplate must not be null\");\r\n\t\tthis.jdbcTemplate = jdbcTemplate;\r\n\t\tsetNativeJdbcExtractor(jdbcTemplate.getNativeJdbcExtractor());\r\n\t}", "public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {\r\n\r\n\t\tthis.jdbcTemplate = jdbcTemplate;\r\n\t}", "public ClassTemplate() {\n\t}", "public JdbcObjectStudentDAO() {\n\t\tsuper();\n\t}", "@Override\n\tprotected VtbObject createImpl(Connection conn, VtbObject domainObject)\n\t\t\tthrows SQLException, MappingException {\n\t\treturn null;\n\t}", "@Bean\n @Scope(\"prototype\")\n public JdbcTemplate jdbcTemplate(DruidDataSource datasourceRouter){\n return new JdbcTemplate(datasourceRouter);\n }", "public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {\n\t\tthis.jdbcTemplate = jdbcTemplate;\n\t}", "public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {\n\t\tthis.jdbcTemplate = jdbcTemplate;\n\t}", "static protected <T extends DbConnection<T>> T create(String connectionString, CreateDBFn<T> fn) {\r\n try {\r\n T result = fn.create();\r\n\r\n result.connectionString = connectionString;\r\n\r\n result.connection = DriverManager.getConnection(connectionString);\r\n\r\n synchronized (migratedConnections) {\r\n migratedConnections.add(result.getClass());\r\n }\r\n\r\n result.migrate();\r\n\r\n result.init();\r\n\r\n return result;\r\n } catch (SQLException e) {\r\n throw new DbException(e);\r\n }\r\n }", "T createEntity(ResultSet resultSet)\n throws CreatorException;", "public Sql(Class<?> packageClass, String sqlResource) throws IOException {\n \n this();\n append(packageClass, sqlResource);\n }", "public JDBCCityDAO(DataSource dataSource) {\n\t\tthis.jdbcTemplate = new JdbcTemplate(dataSource);\n\t}", "public TemplateFactoryImpl()\n {\n super();\n }", "public ListTemplate() {\n }", "public DBObject createNew() {\n DBObjectImpl obj = (DBObjectImpl) getNewObject();\n obj.DELETE_STMT_STR = DELETE_STMT_STR;\n obj.INSERT_STMT_STR = INSERT_STMT_STR;\n obj.UPDATE_STMT_STR = UPDATE_STMT_STR;\n obj.QUERY_STMT_STR = QUERY_STMT_STR;\n\n return obj;\n }", "private IdentifiedRecordTemplate selectTemplateRow(Connection con,\n String externalId) throws SQLException {\n PreparedStatement select = null;\n ResultSet rs = null;\n \n try {\n select = con.prepareStatement(SELECT_TEMPLATE);\n select.setString(1, externalId);\n rs = select.executeQuery();\n \n if (!rs.next()) {\n return null;\n }\n int internalId = rs.getInt(1);\n String templateName = rs.getString(3);\n \n IdentifiedRecordTemplate template = new IdentifiedRecordTemplate(\n new GenericRecordTemplate());\n template.setInternalId(internalId);\n template.setExternalId(externalId);\n template.setTemplateName(templateName);\n return template;\n } finally {\n DBUtil.close(rs, select);\n }\n }", "public Template(String html) {\r\n\t\tjsObj = create(html.replaceAll(\"'\", \"\\\"\"));\r\n\t\tthis.html = html;\r\n\t}", "public SQLInfo (Element sql) throws TemplateException, SQLException {\r\n\t \r\n\t //code description\r\n\t \r\n\t if (sql == null) throw new NullPointerException();\r\n\t this.id = sql.getAttribute(\"name\");\r\n\t if (\"\".equals(this.id.trim())) throw new IllegalArgumentException(); \r\n\t if (\"jct:prepared-sql\".equals(sql.getTagName())) {\r\n\t\t //это параметризованный запрос\r\n\t\t NodeList text = sql.getElementsByTagName(\"jct:prepared-text\");\r\n\t\t if (text.getLength() == 0) throw new TemplateException(\"SQL Info - required 'jct:prepared-text' not found in 'jct:prepared-sql'.\");\r\n\t\t this.SQL = this.getSQL((Element)text.item(0));\t\t\t\t \r\n\t\t this.parameters = this.getParameters(sql);\r\n\t }\r\n\t else {\r\n\t\t //обычный запрос\r\n\t\t this.SQL = this.getSQL(sql); \r\n\t }\t \t \t \t \t\r\n\t if (this.SQL.startsWith(\"SELECT\")) { \r\n\t //выясним в каком виде ожидается результат: набор записей или XML-структур\r\n\t String xml = sql.getAttribute(\"xml\");\r\n\t if (\"true\".equals(xml)) {\r\n\t \t //набор XML-структур\r\n\t \t this.type = SQLInfo.TYPES[SQLInfo.XML_TYPE];\t \r\n\t }\r\n\t else {\r\n\t \t //набор записей:\r\n\t \t //check if SQL template has other attributes:\r\n\t //result-sum - the index of numeric field names the value sum of which\r\n\t //must be calculated; result-group - the group by some field\r\n\t \t this.setResultSumFieldsAttr(sql.getAttribute(\"result-sum\"));\r\n\t \t this.setResultGroupFieldsAttr(sql.getAttribute(\"result-group\"));\t \r\n\t \t this.type = SQLInfo.TYPES[SQLInfo.SELECT_TYPE];\t \t \t\r\n\t } \r\n\t }\r\n\t else {\r\n\t this.type = SQLInfo.TYPES[SQLInfo.UPDATE_TYPE];\t \t\t \r\n\t }\t \r\n\t \r\n }", "private Template makeTemplate() {\n return new Template(\"spamHardGenerated\", \"SPAM HARD\\n$$template_EOO\\n\" + sendedWorld.getText() + \"\\n$$template_EOF\\n$$var_name osef\\n$$var_surname osef\");\n }", "public DB2zosSchema(JdbcTemplate jdbcTemplate, DB2zosDbSupport dbSupport, String name) {\n super(jdbcTemplate, dbSupport, name);\n }", "@Override\r\n\t\tpublic Statement createStatement() throws SQLException {\n\t\t\treturn this.conn.createStatement();\r\n\t\t}", "protected abstract T createEntityFromResult (final ResultSet result) throws SQLException;", "private <T> T createObject(ResultSet resultSet, Class<T> destinationClass, Map<String, Field> fields) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n logger.trace(\"Constructing new {} instance\", destinationClass);\n final T dto = destinationClass.getConstructor().newInstance();\n\n for (Map.Entry<String, Field> entry : fields.entrySet()) {\n final String key = entry.getKey();\n final Field field = entry.getValue();\n\n try {\n logger.trace(\"Retrieving '{}' from the ResultSet\", key);\n final Object value = resultSet.getObject(key);\n logger.debug(\"Retrieval of '{}' has resulted to: {}\", key, value);\n\n logger.trace(\"Setting the value '{}' to the field: {}\", value, field.getName());\n field.set(dto, tryConvertValue(field, value));\n logger.trace(\"Value set successfully.\");\n } catch (SQLException ex) {\n final boolean fieldWarningsNotSuppressed = !(hasClassLevelWarningSuppression || field.isAnnotationPresent(SuppressWarnings.class));\n\n if (fieldWarningsNotSuppressed) {\n logger.warn(ex.getMessage());\n }\n }\n }\n\n return dto;\n }", "public ResultSet construct(String szQuery) {\n\t\treturn null;\n\t}", "public static IORTemplate makeIORTemplate(InputStream paramInputStream) {\n/* 113 */ return (IORTemplate)new IORTemplateImpl(paramInputStream);\n/* */ }", "protected abstract DBObject getNewObject();", "public void setSimpleJdbcTemplate(SimpleJdbcTemplate simpleJdbcTemplate) {\r\n this.simpleJdbcTemplate = simpleJdbcTemplate;\r\n }", "public void loadTemplate() throws Exception {\n\t\tScanner fs = new Scanner(this.getClass().getClassLoader().getResourceAsStream(template));\n\t\t\n\t\tStringBuffer sql = new StringBuffer();\n\t\ttry {\n\t\t\twhile(fs.hasNextLine()) {\n\t\t\t\tsql.append(fs.nextLine() + \"\\n\");\n\t\t\t}\n\t\t}finally {\n\t\t\tfs.close();\n\t\t}\n\t\tsqlText = sql.toString();\n\t}", "public CustomerModelDS(String nomeDb, String activity) {\r\n\t\ttry {\r\n\t\t\tContext initCtx = new InitialContext();\r\n\t\t\tContext envCtx = (Context) initCtx.lookup(\"java:comp/env\");\r\n\t\t\tds = (DataSource) envCtx.lookup(\"jdbc/\"+nomeDb);\r\n\t\t\tconnection = ds.getConnection();\r\n\t\t\tthis.tableName = activity.toLowerCase()+table;\r\n\t\t } catch (NamingException | SQLException e) {\r\n\t\t\ttry {\r\n\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\t\tconnection = DriverManager.getConnection(\"jdbc:mysql://localhost/\"+nomeDb, \"root\", \"\");\r\n\t\t\t\tconnection.setAutoCommit(false);\r\n\t\t\t} catch (SQLException | ClassNotFoundException ex) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t }\r\n\t}", "public static TemplateBasedScriptBuilder fromTemplateScript(String scriptTemplate) {\n return new TemplateBasedScriptBuilder(scriptTemplate);\n }", "public TemplateCodec() {\n this.documentCodec = new DocumentCodec();\n }", "protected abstract ODatabaseInternal<?> newDatabase();", "public RepoSQL() { // constructor implicit\r\n\t\t super();\r\n\t }", "private TemplateBasedScriptBuilder(String scriptTemplate) {\n if (!scriptTemplate.contains(BODY_PLACEHOLDER)) {\n throw new CitrusRuntimeException(\"Invalid script template - please define '\" + \n BODY_PLACEHOLDER + \"' placeholder where your code comes in\");\n }\n \n scriptHead = scriptTemplate.substring(0, scriptTemplate.indexOf(BODY_PLACEHOLDER));\n scriptTail = scriptTemplate.substring((scriptTemplate.indexOf(BODY_PLACEHOLDER) + BODY_PLACEHOLDER.length()));\n }", "public NewSupplier() {\n initComponents();\n String url = \"jdbc:mysql://localhost:3306/valuemart\";\n String user = \"root\";\n String password = \"\";\n\n try {\n connection = DriverManager.getConnection(url, user, password);\n statement = (Statement) connection.createStatement();\n \n } catch (Exception ex) {\n System.err.println(ex.getMessage());\n }\n }", "public ClassSQLContract(SQLTagsGeneratorTable sqlTagsGeneratorTable){\n //---------------------------------------------------------------------------\n this.sqlTagsGeneratorTable=sqlTagsGeneratorTable;\n this.tableName=sqlTagsGeneratorTable.getTableName();\n createClassSQLContract();\n }", "public DatabaseConnection newConnection();", "protected Connection createConnection() {\n Properties connectionProperties = new Properties();\n JdbcPropertyAdapter adapter = getPropertyAdapter(dbType, properties);\n adapter.getExtraProperties(connectionProperties);\n\n String url = translator.getUrl(properties);\n logger.info(\"Opening connection to: \" + url);\n Connection connection;\n try {\n connection = DriverManager.getConnection(url, connectionProperties);\n connection.setAutoCommit(false);\n } catch (SQLException x) {\n throw translator.translate(x);\n }\n return connection;\n }", "public void setup(String driverClass, String url, String user, String pass) throws SQLException {\n\t BasicDataSource bds = new BasicDataSource();\n bds.setDriverClassName(driverClass);\n bds.setUrl(url);\n bds.setMaxTotal(MAX_TOTAL_CONNECTIONS);\n bds.setMaxIdle(MAX_IDLE_CONNECTIONS);\n bds.setUsername(user);\n bds.setPassword(pass);\n bds.setValidationQuery(\"SELECT 1\");\n bds.setTestOnBorrow(true);\n bds.setDefaultAutoCommit(true);\n\n //check that everything works OK \n bds.getConnection().close();\n\n //initialize the jdbc template utility\n jdbcTemplate = new JdbcTemplate(bds);\n\n //keep the dataSource for the low-level manual example to function (not actually required)\n dataSource = bds;\n }", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public static String SQLBuilder(String sqlTemplate, HashMap<String, String> parameters){\n StringBuilder sb = new StringBuilder(sqlTemplate);\n \n // Loop over ever key in the parameters hash map\n for(String key : parameters.keySet()){\n String value = parameters.get(key).replaceAll(\"'\", \"''\");\n \n // The keys in the sql will be formated *key*. And so that is what\n // we need to search in the sql by.\n String realKey = \"*\" + key + \"*\";\n int keyLength = realKey.length();\n \n int startLocation = 0;\n // Keep searching the sql until we there are no more keys for use to\n // replace with their value.\n while( (startLocation = sb.indexOf(realKey)) != -1){\n sb.replace(startLocation, startLocation + keyLength, value);\n }\n }\n return sb.toString();\n }", "private Resource createStatement(String resourceURI, String propertyURI, String definitionURI) {\n // create parts\n Resource resource = model.createResource(resourceURI);\n Property property = model.createProperty(propertyURI);\n Resource definition = model.createResource(definitionURI);\n // make a statement out of them\n Statement stmt = model.createStatement(resource, property, definition);\n // add it to the model\n model.add(stmt);\n // provide the resource to the caller for future use\n return resource;\n }", "protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }", "public DataSource createImpl()\n {\n if (_impl == null)\n {\n // create a param defining the datasource\n \n \tJdbcDataSourceParam dsParam = new JdbcDataSourceParam(getName(),\n getJdbcDriver(), getJdbcUrl() , //getJdbcCatalog(),\n getJdbcUser(), getJdbcPassword());//+ \":\" + getJdbcCatalog()\n\n // get/create the datasource\n _impl = DataManager.getDataSource(dsParam);\n\n // get the entities, create and add them\n Vector v = getEntities();\n for (int i = 0; i < v.size(); i++)\n {\n EntityDobj ed = (EntityDobj) v.get(i);\n _impl.addEntity(ed.createImpl());\n }\n\n // get the joins, create and add them\n v = getJoins();\n for (int i = 0; i < v.size(); i++)\n {\n JoinDobj jd = (JoinDobj) v.get(i);\n _impl.addJoin(jd.createImpl());\n }\n }\n\n return _impl;\n }", "public JdbcTemplate getSimpleJdbcTemplate() {\n\t\treturn simpleJdbcTemplate;\n\t}", "public DatabaseTable() { }", "public static ObjectReferenceTemplate makeObjectReferenceTemplate(ORB paramORB, IORTemplate paramIORTemplate) {\n/* 151 */ return (ObjectReferenceTemplate)new ObjectReferenceTemplateImpl(paramORB, paramIORTemplate);\n/* */ }", "PSTemplate load(String id) throws PSDataServiceException;", "public NamedParameterJdbcTemplate getJdbcTemplate() {\n return _jdbcTemplate;\n }", "public Driver() throws SQLException {\n // Required for Class.forName().newInstance()\n }", "public DBHandler() {\n\n driverName = \"com.mysql.jdbc.Driver\";\n url = \"jdbc:mysql://us-cdbr-azure-southcentral-e.cloudapp.net/newsstand\";\n userId = (String) \"ba7e286a39ae9e\";\n password = (String) \"d89b6d9b\";\n \n }", "public JDBCModelReader(DBObjectFactory factory, DBTypeConverter typeConverter, Connection connection,\n\t\t\tString schemeName, List<String> includeTableNamePatterns) {\n\t\tsuper();\n\t\tthis.connection = connection;\n\t\tthis.factory = factory;\n\t\tthis.includeTableNamePatterns = includeTableNamePatterns;\n\t\tthis.schemeName = schemeName;\n\t\tthis.typeConverter = typeConverter;\n\t}", "public T_2698Dao() {\n\t\tsuper(org.jooq.test.jdbc.generatedclasses.tables.T_2698.T_2698, org.jooq.test.jdbc.generatedclasses.tables.pojos.T_2698.class);\n\t}", "public TracingWrappedJdbcTemplate(DataSource dataSource) {\n\t\tsuper(dataSource);\n\t}", "public static Connection createConnection() throws SQLException {\n\t\t// DriverManager.setLogStream( System.out );\n\t\ttry {\n\t\t\tClass.forName(\"smallsql.jdbc.SSDriver\");\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn DriverManager.getConnection(JDBC_URL + \"?create=true;locale=en\");\n\t}", "public void setTemplate(Template template)\n/* */ {\n/* 62 */ this.template = template;\n/* */ }", "public static void createAppointment(Appointment TemplateAppointment) {\n String sql = \"INSERT INTO appointments Values(NULL, ?, ?,?,?,?,?,Now(),'',Now(),'',?,?,?)\";\n // (Appointment_ID,Title,Description, Type, Phone, Division_ID) VALUES (5, '', 'test', '', 'test','')\" ;\n\n try {\n PreparedStatement ps = DBConnection.getConnection().prepareStatement(sql);\n ps.setString(1, TemplateAppointment.getTitle());\n ps.setString(2, TemplateAppointment.getDescription());\n ps.setString(3, TemplateAppointment.getLocation());\n ps.setString(4, TemplateAppointment.getType());\n LocalDateTime start = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getStartTime());\n start = WashTimeZone(start, ZoneId.systemDefault(), ZoneId.of(\"UTC\"));\n LocalDateTime end = LocalDateTime.of(TemplateAppointment.getDate(), TemplateAppointment.getEndTime());\n end = WashTimeZone(end, ZoneId.systemDefault(), ZoneId.of(\"UTC\"));\n Timestamp Tstart = Timestamp.valueOf(start);\n Timestamp Tend = Timestamp.valueOf(end);\n ps.setTimestamp(5, Tstart);\n ps.setTimestamp(6, Tend);\n//timezone work needs to happen here\n\n ps.setInt(7, TemplateAppointment.getCustomerid());\n ps.setInt(8, TemplateAppointment.getUserid());\n ps.setInt(9, TemplateAppointment.getContactid());\n\n ps.execute();\n\n } catch (SQLException ex) {\n ex.printStackTrace();\n }\n }", "public abstract DataType<T> newInstance(String format);", "public static IORTemplate makeIORTemplate(ObjectKeyTemplate paramObjectKeyTemplate) {\n/* 106 */ return (IORTemplate)new IORTemplateImpl(paramObjectKeyTemplate);\n/* */ }", "private Object getSQLClass(String SQLInnerClassName) throws Exception\r\n\t{\r\n\t\tClass outerClass = getClass();\r\n\t\tString outerClassName = outerClass.getName();\r\n\t\tString innerClassName = outerClassName + \"$\" + SQLInnerClassName;\r\n\t\tClass innerClass = Class.forName(innerClassName);\r\n\t\tConstructor c = innerClass.getConstructor(new Class[]{outerClass});\r\n\t\treturn c.newInstance(new Object[]{this});\r\n\t}", "final public static PreparedStatement createPstmtInsert(Connection conn, DotProjectObject obj)\n\t{\n\t\tClass<? extends DotProjectObject> clazz = obj.getClass();\n\t\tStringBuffer sb = new StringBuffer();\n\t\tString table = null;\n\t\tField[] beanFields = null;\n\t\tString[] dbFields = null;\n\t\tObject[] dbValues = null;\n\t\tPreparedStatement stmt = null;\n\t\t\n\t\ttable = AnnotationUtil.getAnnotationValue(clazz, DbAnnotations.TABLE_ANNOTATION);\n\t\tsb.append(\"INSERT INTO \");\n\t\tsb.append(table);\n\t\t\n\t\tbeanFields = AnnotationUtil.getAnnotatedFields(clazz, DbAnnotations.PROPERTY_ANNOTATION);\n\t\tdbFields = new String[beanFields.length];\n\t\tdbValues = new Object[beanFields.length];\n\t\tfor (int i = 0; i < beanFields.length; i++) {\n\t\t\t// Identificator fields are automatically set by the database.\n\t\t\tif (beanFields[i].isAnnotationPresent(DbAnnotations.IDENTIFICATOR_ANNOTATION)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tdbFields[i] = AnnotationUtil.getAnnotationValue(beanFields[i], DbAnnotations.PROPERTY_ANNOTATION);\n\t\t\ttry {\n\t\t\t\tdbValues[i] = beanFields[i].get(obj);\n\t\t\t\tif (dbValues[i] == null) {\n\t\t\t\t\tdbFields[i] = null;\n\t\t\t\t\tdbValues[i] = null;\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (Exception iae) {\n\t\t\t\tdbFields[i] = null;\n\t\t\t\tdbValues[i] = null;\n\t\t\t}\n\t\t}\n\t\tdbFields = ArrayUtil.clean(dbFields);\n\t\tdbValues = ArrayUtil.clean(dbValues);\n\t\t\t\n\t\tsb.append(\" (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(dbFields[i]);\n\t\t}\n\t\t\n\t\tsb.append(\") values (\");\n\t\tfor (int i = 0; i < dbFields.length; i++) {\n\t\t\tif (i > 0) {\n\t\t\t\tsb.append(\", \");\n\t\t\t}\n\t\t\tsb.append(\"?\");\n\t\t}\n\t\tsb.append(\")\");\n\n\t\ttry {\n\t\t\tstmt = conn.prepareStatement(sb.toString());\n\t\t\tfor (int i = 1; i <= dbValues.length; i++) {\n\t\t\t\tstmt.setObject(i, dbValues[i - 1]);\n\t\t\t}\n\t\t} catch (SQLException se) {\n\t\t\tstmt = null;\n\t\t}\n\t\t\n\t\treturn stmt;\n\t}", "public Template(InputStream is) throws IOException, TemplateException, JDOMException {\n super(is, new ScriptEngineDataModel(new ScriptEngineManager().getEngineByName(\"javascript\")));\n }", "public AbstractJDBCDataService(Properties configuration)\n throws DataServiceException {\n this.configuration = configuration;\n String driver = getDriver();\n try {\n if (driver == null) {\n ProvenanceConfigurator\n .missingPropertyMessage(ProvenanceConfigurator.MYGRID_DATASERVICE_JDBC_DRIVER);\n }\n Class.forName(driver).newInstance();\n connectionURL = getConnectionURL();\n username = getUser();\n password = getPassword();\n String optionalMaxConnections = configuration\n .getProperty(\"taverna.datastore.jdbc.pool.max\");\n if (optionalMaxConnections != null) {\n try {\n maxConnections = Integer.parseInt(optionalMaxConnections);\n } catch (NumberFormatException nfe) {\n log.warn(nfe.getMessage(), nfe);\n }\n }\n pool = new JDBCConnectionPool(driver, connectionURL, username,\n password, maxConnections);\n } catch (Exception ex) {\n throw new DataServiceCreationException(ex);\n }\n\n if (!tablesExist())\n createTables();\n }", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "DbObjectName createDbObjectName();", "public DBCreator(DBConnection connection) {\n this.dbConnection = connection;\n }", "public static Product of(final Product template) {\n ProductImpl instance = new ProductImpl();\n instance.setId(template.getId());\n instance.setVersion(template.getVersion());\n instance.setCreatedAt(template.getCreatedAt());\n instance.setLastModifiedAt(template.getLastModifiedAt());\n instance.setLastModifiedBy(template.getLastModifiedBy());\n instance.setCreatedBy(template.getCreatedBy());\n instance.setKey(template.getKey());\n instance.setProductType(template.getProductType());\n instance.setMasterData(template.getMasterData());\n instance.setTaxCategory(template.getTaxCategory());\n instance.setState(template.getState());\n instance.setReviewRatingStatistics(template.getReviewRatingStatistics());\n instance.setPriceMode(template.getPriceMode());\n return instance;\n }", "public String onNewRow(Recordset rs, String rowTemplate) \r\n\t\tthrows Throwable;", "private void insertTemplateFieldRows(Connection con,\n IdentifiedRecordTemplate template) throws SQLException, FormException {\n PreparedStatement insert = null;\n \n try {\n insert = con.prepareStatement(INSERT_TEMPLATE_FIELD);\n \n int internalId = template.getInternalId();\n FieldTemplate[] fields = template.getFieldTemplates();\n for (int i = 0; i < fields.length; i++) {\n insert.setInt(1, internalId);\n insert.setString(2, fields[i].getFieldName());\n insert.setInt(3, i);\n insert.setString(4, fields[i].getTypeName());\n if (fields[i].isMandatory()) {\n insert.setInt(5, 1);\n } else {\n insert.setInt(5, 0);\n }\n if (fields[i].isReadOnly()) {\n insert.setInt(6, 1);\n } else {\n insert.setInt(6, 0);\n }\n insert.setInt(7, 1);\n insert.execute();\n }\n } finally {\n DBUtil.close(insert);\n }\n }", "TemplateParameter createTemplateParameter();", "public Crn createDatabaseCrnFrom(String resource) {\n return Crn.builder()\n .setService(Crn.Service.REDBEAMS)\n .setAccountId(\"ACCOUNT_ID\")\n .setResourceType(Crn.ResourceType.DATABASE)\n .setResource(resource)\n .build();\n }", "public JasperDesign create(Template template) throws JRException, ParserConfigurationException, SAXException, FileNotFoundException, ClassNotFoundException\n\t{\n\t\tJasperDesign design = new JasperDesign();\n\t\t\n\t\t//Create basic elements\n\t\tdesign.setName(template.getId());\n\t\tJRDesignQuery query = new JRDesignQuery();\n\t\tquery.setText(\"//*\");\n\t\tquery.setLanguage(\"XPath\");\n\t\tdesign.setQuery(query);\n\t\tdesign.setBottomMargin(72);\n\t\tdesign.setTopMargin(72);\n\t\tdesign.setLeftMargin(72);\n\t\tdesign.setRightMargin(72);\n\t\tdesign.setLanguage(\"groovy\");\n\t\tdesign.setColumnWidth(450);\n\t\t\n\t\t//Load the elements from template\n\t\tfor (Element element : template.getElement())\n\t\t{\n\t\t\tInputStream is = mrl.searchIs(reportRoot +\"/templates/\" +element.getFile() +\".jrxml\");\n\t\t\t\n\t\t\tlogger.warn(ReportUtilTemplate.class.getSimpleName()+\" code is commented out, will be fixed asap!\");\n//\t\t\tJRXmlLoader jlo = new JRXmlLoader(JRXmlDigesterFactory.createDigester());\n\t\t\tJRXmlLoader jlo = null;\n\t\t\n\t\t\t\n\t\t\tJasperDesign elementDesign = jlo.loadXML(is); \n\t\t\tif (element.getType().equals(\"header\"))\n\t\t\t{\n\t\t\t\tlogger.debug(\"entering header section\");\n\t\t\t\tdesign.setPageHeader(elementDesign.getTitle());\n\t\t\t}\n\t\t\tif (element.getType().equals(\"footer\"))\n\t\t\t{\n\t\t\t\tlogger.debug(\"entering footer section\");\n\t\t\t\tdesign.setPageFooter(elementDesign.getPageFooter());\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Now, the standard fields need to be declared (holding title, subtitle, logo, footer and record date)\n\t\tfor (Field field : template.getField())\n\t\t{\n\t\t\tif (field.getType().equals(\"field\"))\n\t\t\t{\n\t\t\t\tJRDesignField reportField = new JRDesignField();\n\t\t\t\treportField.setName(field.getName());\n\t\t\t\treportField.setDescription(field.getExpression());\n\t\t\t\treportField.setValueClassName(field.getClassName());\n\t\t\t\tdesign.addField(reportField);\n\t\t\t}\n\t\t\telse if (field.getType().equals(\"parameter\"))\n\t\t\t{\n\t\t\t\tJRDesignParameter parameter = new JRDesignParameter();\n\t\t\t\tparameter.setName(field.getName());\n\t\t\t\tparameter.setValueClassName(field.getClassName());\n\t\t\t\tdesign.addParameter(parameter);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//JRXmlWriter cares about writing the in-memory design to an OutputStream\n\t\tJRXmlWriter.writeReport(design, System.out, \"UTF-8\");\n\t\treturn design;\n\t}" ]
[ "0.64434075", "0.6027336", "0.5864106", "0.58422285", "0.58190686", "0.58190686", "0.58190686", "0.57467586", "0.5689277", "0.5653322", "0.55705166", "0.5490102", "0.5489728", "0.54782027", "0.54664904", "0.54319406", "0.5400676", "0.5378978", "0.5374004", "0.5349321", "0.5345051", "0.5344799", "0.5344006", "0.5326106", "0.53111637", "0.5304656", "0.5301728", "0.5228745", "0.5222481", "0.5217309", "0.52156764", "0.52075696", "0.5177395", "0.5173948", "0.51670635", "0.51670635", "0.51507825", "0.5149684", "0.514313", "0.51317745", "0.51301867", "0.5130035", "0.51286346", "0.5127867", "0.51259214", "0.51202255", "0.5100247", "0.5099096", "0.50837994", "0.50811684", "0.5074995", "0.5070682", "0.50603", "0.5032426", "0.50287676", "0.50150734", "0.5012315", "0.5009412", "0.500916", "0.50038534", "0.49992868", "0.49753332", "0.49675533", "0.4966608", "0.49541008", "0.4952254", "0.49339655", "0.49243814", "0.4921828", "0.4920729", "0.49204892", "0.4919966", "0.49148902", "0.49116853", "0.4900434", "0.48945203", "0.4892654", "0.4890693", "0.4888914", "0.48831552", "0.4875618", "0.4875493", "0.48718488", "0.487118", "0.48532763", "0.48474756", "0.4836489", "0.48324367", "0.48258632", "0.48231924", "0.48169097", "0.48148528", "0.48142192", "0.48127636", "0.48092976", "0.48055333", "0.48037323", "0.48025686", "0.47964892", "0.47876486" ]
0.636273
1
Finds dress by ID.
@Override public Optional<Dress> findById(Integer dressId) { LOGGER.debug("Find dress by ID {}", dressId); SqlParameterSource namedParameters = new MapSqlParameterSource(DRESS_ID, dressId); List<Dress> dresses = jdbcTemplate .query(findByIdSql, namedParameters, dressRowMapper); return Optional.ofNullable(DataAccessUtils.uniqueResult(dresses)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Doctor findById(int id);", "public static Adage find(int id) {\n\tAdage adage = null;\n\tfor (Adage a : adages) {\n\t if (a.getId() == id) {\n\t\tadage = a;\n\t\tbreak;\n\t }\n\t}\t\n\treturn adage;\n }", "@Override\r\n\tpublic void find(Integer id) {\n\r\n\t}", "private static Person findPersonById(int id) {\n Person personReturn = null;\n\n for (Person person : persons) {\n if (id == person.getId()) {\n personReturn = person;\n }\n }\n\n return personReturn;\n }", "@Override\n public List<Doctor> searchById(int id) throws IOException, ClassNotFoundException {\n doctorList = FileSystem.readFile(file, Doctor.class);\n List<Doctor> searchList = search(doctorList, Doctor::getId, id);\n return searchList;\n }", "@Override\r\n\tpublic Adress findAdressById(Long id) {\n\t\treturn em.find(Adress.class, id);\r\n\t}", "@RequestMapping(value = \"/drones/{id}\", method = RequestMethod.GET)\r\n\tpublic ResponseEntity<Drone> findDroneByDroneId(@PathVariable(\"id\") Long id) {\r\n\t\tDrone drone = droneManager.findDroneByDroneId(id);\r\n\r\n\t\tif (null == drone) {\r\n\t\t\tLOGGER.log(Level.SEVERE, \" >No Drone found for findDroneByDroneId(\" + id + \"). One was expected!\");\r\n\t\t\treturn new ResponseEntity<Drone>(HttpStatus.NOT_FOUND);\r\n\t\t}\r\n\t\treturn new ResponseEntity<Drone>(drone, HttpStatus.OK);\r\n\t}", "@Override\r\n\tpublic Personne find(int id) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Carpo findCar(String id) {\n\t\treturn inList.find(id);\n\t}", "@Override\n\tpublic Eleve findById(int id) {\n\t\treturn map.get(id);\n\t}", "@Override\n\tpublic Dates find(int id) {\n\t\tDates date = new Dates();\n\t\tString query = \"SELECT * FROM dates WHERE ID = ? \";\n\t\ttry {\n\t\t\tjava.sql.PreparedStatement statement = this.connect.prepareStatement(query);\n\t\t\tstatement.setInt(1, id);\n\t\t\tResultSet result = statement.executeQuery();\n\n\t\t\tif (result.first()) {\n\t\t\t\t\n\t\t\t\tdate = new Dates(id, result.getString(\"Dates\"));\n\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn date;\n\t}", "public static Sighting find(int id) {\n\t\t try(Connection con = DB.sql2o.open()) {\n\t\t\t String sql = \"SELECT * FROM sightings where id=:id\";\n\t\t\t Sighting sighting = con.createQuery(sql)\n\t\t\t\t .addParameter(\"id\", id)\n\t\t\t\t .executeAndFetchFirst(Sighting.class);\n\t\t\t return sighting;\n\n\t\t }\n\t }", "public Recipe getRecipeAt(Long id) {\r\n \t\tfor (Recipe recipe : recipeList)\r\n \t\t\tif (recipe.getId() == id)\r\n \t\t\t\treturn recipe;\r\n \t\treturn null;\r\n \t}", "@Override\n\tpublic Food findFoodById(int id) {\n\t\treturn fb.findFoodById(id);\n\t}", "@Override\r\n\tpublic District findById(int id) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Disease findByDiseaseId(int id) {\r\n\t\t// setting logger info\r\n\t\tlogger.info(\"Get the disease details By Id\");\r\n\t\tOptional<Disease> disease = diseaseRepo.findById(id);\r\n\t\tif(!disease.isPresent()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tlogger.info(disease.get());\r\n\t\treturn disease.get();\r\n\t}", "@Override\r\n\tpublic Person findbyid(int id) {\n\t\tQuery query=em.createQuery(\"Select p from Person p where p.id= \"+id);\r\n\t\tPerson p=(Person) query.getSingleResult();\r\n\t\treturn p;\r\n\t\r\n\t}", "private void handleFindById(String[] args) {\n if (args.length < 3) {\n String requiredArgs = \"<id>\";\n Messages.badNumberOfArgsMessage(args.length, FIND_BY_ID_OPERATION, requiredArgs);\n System.exit(1);\n }\n\n Long id = null;\n try {\n id = Long.parseLong(args[2]);\n } catch (NumberFormatException e) {\n System.out.println(\"Error - argument '\" + args[2] + \"' must be a number\");\n System.exit(1);\n }\n\n Client client = ClientBuilder.newBuilder().build();\n WebTarget webTarget = client.target(\"http://localhost:8080/pa165/rest/bricks/\" + id.toString());\n webTarget.register(auth);\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n invocationBuilder.header(\"accept\", MediaType.APPLICATION_JSON);\n\n Response response = invocationBuilder.get();\n\n if (response.getStatus() == Response.Status.OK.getStatusCode()) {\n BrickDto brickDto = response.readEntity(BrickDto.class);\n System.out.println(\"Brick found. \" + brickDto);\n } else if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) {\n System.out.println(\"Error - brick was not found, wrong id: \" + id + \" Server returned: \" + response.getStatus());\n } else {\n System.out.println(\"Error on server, server returned \" + response.getStatus());\n }\n }", "public static Patient find(int id) {\n\tPatient patient = null;\n\tfor (Patient a : patients) {\n\t if (a.getId() == id) {\n\t\tpatient = a;\n\t\tbreak;\n\t }\n\t}\t\n\t\n\treturn patient;\n }", "@Override\n\tpublic List<Person> search(Integer id) {\n\t\treturn null;\n\t}", "public Data findById(Object id);", "public Singer find(int singerId);", "public T find(int id) {\n\t \treturn getEntityManager().find(getEntityClass(), id);\n\t }", "public void findbyid() throws Exception {\n try {\n Ume_unidade_medidaDAO ume_unidade_medidaDAO = getUme_unidade_medidaDAO();\n List<Ume_unidade_medidaT> listTemp = ume_unidade_medidaDAO.getByPK( ume_unidade_medidaT);\t \n\n ume_unidade_medidaT= listTemp.size()>0?listTemp.get(0):new Ume_unidade_medidaT();\n \n } catch (Exception e) {\n e.printStackTrace();\n setMsg(\"Falha ao realizar consulta!\");\t\n } finally {\n\tclose();\n }\n }", "@Override\n\tpublic Town getById(String id) {\n\t\treturn townDAO.searchUniqueByPropertyEqual(\"id\", id);\n\t}", "public void findbyid() throws Exception {\n try {\n IPi_per_intDAO pi_per_intDAO = getPi_per_intDAO();\n List<Pi_per_intT> listTemp = pi_per_intDAO.getByPK(pi_per_intT);\n\n pi_per_intT = listTemp.size() > 0 ? listTemp.get(0) : new Pi_per_intT();\n\n } catch (Exception e) {\n easyLogger.error(e.getMessage(), e);\n setMsg(ERROR, \"Falha ao realizar consulta!\");\n } finally {\n close();\n }\n }", "@Override\n\tpublic Facture findById(int id) {\n\t\treturn null ;\n\t}", "@Override\n\tpublic HotelDetails findHotel(int id) {\n\t\treturn bookingDao.findHotel(id);\n\t}", "@Override\n\tpublic Recipe findById(Integer id) {\n\t\treturn null;\n\t}", "public Pessoa find(Long id){\n\t\treturn db.findOne(id);\n\t}", "public Recipe findById(Long id) {\n\t\tOptional<Recipe> findRecipe = recipeRepository.findById(id);\n\t\tif(findRecipe.isPresent()) {\n\t\t\treturn findRecipe.get();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n\tpublic Borne find(long id) {\r\n\t\tBorne borne = new Borne();\r\n\t\t\r\n\t\r\n\t\tStatement st =null;\r\n\t\tResultSet rs =null;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\tst = this.connect.createStatement();\r\n\t\t\tString sql = \"SELECT * FROM Borne WHERE id=\"+id;\r\n\t\t\trs = st.executeQuery(sql);\r\n\t\t\t\r\n\t\t\tif(rs.first()) {\r\n\t\t\t\tborne = new Borne(rs.getInt(\"id\"),\r\n\t\t\t\t\t\t\t\t DAOzone.find(rs.getInt(\"idZone\")));\r\n\t\t\t}\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn borne;\r\n\t}", "public static DataCaseWorker find(int id) {\n return where(\"id\", \"\" + id);\n }", "@Override\n\tpublic Oglas find(Long id) {\n\t\treturn (Oglas) repository.getOne(id);\n\t}", "public Recipe getRecipe(int id) {\n int i = id - 1000;\n if(i < 0 || i > recipes.get(recipes.size() - 1).getID()-1000){\n //throw new IndexOutOfBoundsException();\n Recipe r = null;\n return r;\n }\n return recipes.get(i);\n }", "private SiteReservation findById(Integer id){\n SiteReservation reservation;\n try {\n reservation = repo.findById(id).get();\n } catch (NoSuchElementException e){\n throw new ReservationNotFoundException(id);\n }\n return reservation;\n }", "public Node find(int id) {\n return tree.find(id);\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic Dorf findById(int id) {\n\t\treturn (Dorf) getSession().get(Dorf.class,id);\r\n\t}", "@Override\n\tpublic Gasto findById(Integer id) {\n\t\treturn gastoModel.findById(id).orElseThrow(null);\n\t}", "public void findHouse() {\n System.out.println(\"-----Search House-----\");\n System.out.println(\"enter id: \");\n int findId = Utility.readInt();\n //call service search method\n House h = houseService.searchHouse(findId);\n if (h != null) {\n System.out.println(h);\n } else {\n System.out.println(\"no designate house found\");\n }\n }", "@Override\n public List<Clip> findById(int id) {\n return fillList(logsCollection.find(eq(\"id\", id)));\n }", "public CyPoj findById(Integer id) {\n\t\treturn d.findById(id);\r\n\t}", "@Override\r\n\tpublic Address findById(Integer id) {\r\n\t\tValidationReturn validation = validator.findById(id);\r\n\t\t\r\n\t\tif (!validation.getStatus().equals(200)) {\r\n\t\t\tthrow new DBException(validation.toString());\r\n\t\t}\r\n\t\t\r\n\t\tDAOJDBC DAOJDBCModel = new DAOJDBC();\r\n\t\tStatement sqlStatement = null;\r\n\t\t\r\n\t\tResultSet item = DAOJDBCModel.singleCallReturn(\"SELECT * FROM address WHERE id='\" + id + \"';\", sqlStatement);\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (item != null) {\r\n\t\t\t\treturn new Address(item.getInt(\"id\"), item.getString(\"street\"), item.getString(\"district\"),\r\n\t\t\t\t\t\titem.getInt(\"number\"), item.getString(\"note\"));\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tDB.closeStatament(sqlStatement);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public HexModel searchByID(String id) {\n\t\tfor (int y = 0; y < grid[0].length; y++) {\r\n\t\t\tfor (int x = 0; x < grid[y].length; x++) {\r\n\t\t\t\tif (grid[y][x] != null && grid[y][x].getId().equals(id))\r\n\t\t\t\t\treturn grid[y][x];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic DomainObject find(long id) {\n\t\treturn null;\n\t}", "public Desserts getDesserts(int searchID)\r\n\t {\r\n\t\t Desserts foundDesserts= new Desserts();\r\n\t try{\r\n\t Class.forName(\"com.mysql.jdbc.Driver\");\r\n\t Connection conn = DriverManager.getConnection(url+dbName,userName,password);\r\n\t statement=conn.createStatement();\r\n\t resultSet=statement.executeQuery(\"select * from g13restaurant.desserts where g13restaurant.desserts.dessert_ID=\" + searchID);\r\n\t \r\n\t while ( resultSet.next() ) {\r\n\t \t foundDesserts = new Desserts(resultSet.getInt(\"dessert_ID\"), resultSet.getString(\"dessert_Name\"),\r\n\t resultSet.getString(\"dessert_Description\"), resultSet.getFloat(\"dessert_Cost\"),\r\n\t resultSet.getString(\"dessert_Type\").toString() ); \r\n\t } \r\n\t conn.close();\r\n\t } \r\n\t catch (Exception e) {\r\n\t e.printStackTrace();\r\n\t } \r\n\t return foundDesserts;\r\n\t }", "private Domino getdominoByID(int id) {\n Game game = KingdominoApplication.getKingdomino().getCurrentGame();\n for (Domino domino : game.getAllDominos()) {\n if (domino.getId() == id) {\n return domino;\n }\n }\n throw new java.lang.IllegalArgumentException(\"Domino with ID \" + id + \" not found.\");\n }", "public abstract ArrayList<T> findFromReference(int id);", "@Override\r\n\tpublic Visit findById(Long id) {\n\t\treturn super.findById(id);\r\n\t}", "@Override\r\n public Damagething damfindById(Integer da_id) {\n return userMapper.damfindById(da_id);\r\n }", "@Override\n public T findById(ID id) throws SQLException {\n\n return this.dao.queryForId(id);\n\n }", "T findById(ID id) ;", "public Conge find( Integer idConge ) ;", "@Override\n public RiceptDto getRicept(int id) {\n Optional<Ricept> ricept = riceptRepository.findById(id);\n if (!ricept.isPresent()) {\n log.error(\"Ricept not found by id. Class RiceptServiceImpl, method getRicept\");\n throw new NotFoundException(\"Ricept not found by id\");\n }\n log.info(\"Get ingredient by id. Class RiceptServiceImpl, method getRicept\");\n return RiceptDto.of(ricept.get());\n }", "public Personel findPersonelById(int id) {\n\t\treturn personelDao.findPersonelById(id);\r\n\t}", "public T findById(int id) {\n\t\tConnection connection = null;\n\t\tPreparedStatement st = null;\n\t\tResultSet rs = null;\n\t\tString query = createSelectQuery(\"id\");\n\t\ttry {\n\t\t\tconnection = ConnectionFactory.createCon();\n\t\t\tst = connection.prepareStatement(query);\n\t\t\tst.setInt(1, id);\n\t\t\trs = st.executeQuery();\n\t\t\t\n\t\t\treturn createObjects(rs).get(0);\n\t\t}catch(SQLException e) {\n\t\t\tLOGGER.fine(type.getName() + \"DAO:findBy\" + e.getMessage());\n\t\t}\n\t\treturn null;\n\t}", "public Personne find(int id) {\n\t\tPersonne p= null;\n\t\ttry {\n\t\t\t\tString req = \"SELECT id,nom, prenom, evaluation FROM PERSONNE_1 WHERE ID=?\";\n\t\t\t\tPreparedStatement ps= connect.prepareStatement(req);\n\t\t\t\tps.setInt(1, id);\n\t\t\t\tResultSet rs = ps.executeQuery();\n\t\t\t\tp =new Personne (id, rs.getString(1),rs.getString(2));\n\t\t\t}catch (SQLException e) {e.printStackTrace();}\n\t\t\t\t\n\t\treturn p;\n\t\t\n\t}", "@Override\n public T findById(Long id) {\n return manager.find(elementClass, id);\n }", "@Override\n public Person findByID(Long id) {\n Session session = getSessionFactory().openSession();\n Person p = session.load(Person.class, id);\n session.close();\n return p;\n }", "public void findbyid() throws Exception {\n try {\n Con_contadorDAO con_contadorDAO = getCon_contadorDAO();\n List<Con_contadorT> listTemp = con_contadorDAO.getByPK( con_contadorT);\n\n con_contadorT= listTemp.size()>0?listTemp.get(0):new Con_contadorT();\n \n } catch (Exception e) {\n e.printStackTrace();\n setMsg(\"Falha ao realizar consulta!\");\t\n } finally {\n\tclose();\n }\n }", "@Override\r\n\tpublic List<Disease> findByDiseaseIdLessThan(int id) {\r\n\t\t// setting logger info\r\n\t\tlogger.info(\"Get the disease details By Id that is lesser than\");\r\n\t\treturn diseaseRepo.findByDiseaseIdLessThan(id);\r\n\t}", "@Override\n public Pessoa buscar(int id) {\n try {\n for (Pessoa p : pessoa.getPessoas()){\n if(p.getCodPessoa()== id){\n return p;\n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AnimalDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "@Override\n\tpublic Employee findById(int id) {\n\t\tList<Employee> employeeList= \n\t\tlistEmployee().stream().filter((e -> e.getId()==id)).collect(Collectors.toList());\n\t\t\n\t\treturn (Employee)employeeList.get(0);\n\t}", "@Override\r\n\tpublic Factura findById(Long id) {\n\t\treturn facturaDao.findById(id);\r\n\t}", "@Override\n\tpublic Factura findById(Integer id) {\n\t\treturn facturaRepository.findById(id).orElse(null);\n\t}", "@Override\r\n\tpublic CodeRangeDis findById(String id) {\n\t\treturn codeRangeDisMapper.findById(id);\r\n\t}", "@Override\n public Dish get(int id, int restaurantId) {\n List<Dish> dishes = crudRepository.get(id, restaurantId);\n return DataAccessUtils.singleResult(dishes);\n }", "@Override\r\n\tpublic Plate findById(long id) {\n\t\treturn null;\r\n\t}", "public person findbyid(int id){\n\t\t\treturn j.queryForObject(\"select * from person where id=? \", new Object[] {id},new BeanPropertyRowMapper<person>(person.class));\r\n\t\t\r\n\t}", "public District findDistrictById(String id);", "public Airplane find(int id);", "D getById(K id);", "@Override\n\tpublic LidPOJO findLid(int id) throws SQLException {\n \tConnection connect = getConnection();\n\n\t\tString queryString = \"SELECT * FROM leden WHERE id = \" + id;\n\t\tResultSet res = getConnection().prepareStatement(queryString).executeQuery();\n\t\tLidPOJO lid = new LidPOJO();\n\t\twhile (res.next()) {\n\t\t\tlid = new LidPOJO(res.getString(\"naam\"), res.getString(\"achternaam\"), res.getInt(\"leeftijd\"), res.getInt(\"teamcode\"), res.getString(\"pasw\"));\n\t\t\tlid.setId(res.getInt(\"id\"));\n\t\t}\n\t\tconnect.close();\n\t\treturn lid;\n }", "public Recipe findByIdRecipe(int id) {\n\t\tSession session = sessionFactory.openSession();\n\t\treturn (Recipe) session.get(Recipe.class, id);\n\t}", "private int find(int[] roots , int id){\n\n if (roots[id] == id) return id;\n roots[id] = find(roots, roots[id]);\n return roots[id];\n }", "Coach findById(long id);", "public Voto find(int id ) { \n\t\treturn em.find(Voto.class, id);\n\t}", "public Addresses getAddresses(Long id) {\n\t\treturn addressesRepository.findOne(id);\r\n\t}", "ReferenceData findById(ReferenceDataId id) throws DataException;", "@Override\r\n\tpublic Account findById(int id) {\n\t\treturn daoref.findById(id);\r\n\t}", "public BlogEntry findBlogEntry(Long id);", "@Override\n\tpublic Object findByID(Serializable id) {\n\t\treturn getSession().get(DirectTalentAdvertBean.class, id);\n\t}", "List<Dress> selectByExample(DressExample example);", "@Override\n\tpublic Document find(int id) {\n\t\treturn null;\n\t}", "public Money find(long id) {\n\t\tif (treeMap.containsKey(id))\n\t\t\treturn treeMap.get(id).price;\n\t\treturn new Money();\n\t}", "@Override\r\n\tpublic LookMast findOne(int id) {\n\t\treturn lookMastRepository.findOne(id);\r\n\t}", "@Override\n public ICategory findById(Long id) {\n return locationDao.findById(id);\n }", "@Override\n\tpublic Reservation findById(Integer id) {\n\t\treturn null;\n\t}", "RiceCooker getById(long id);", "public Numbers findById(long id);", "@Override\n\tpublic DvdCd getById(Integer id) {\n\t\tlogger.info(\"Buscando DVD/CD por ID \"+id);\n\t\tOptional<DvdCd> obj = itemRepository.findById(id);\n\t\tif (!obj.isPresent()) {\n\t\t\tlogger.error(\"DvdCd nao encontrado, \"+DvdCdServiceImpl.class);\n\t\t\tthrow new ObjectNotFoundException(\"DvdCd nao encontrado, id: \"+id);\n\t\t}\n\t\t\n\t\treturn obj.get();\n\t}", "@Override\n public SideDishEntity find(Long id) throws ObjectNotFoundUserException {\n return null;\n }", "@Override\n\tpublic Stock Find(Integer id) {\n\t\tStock stock = _stockDao.selectByPrimaryKey(id);\n\t\tif (stock == null) {\n\t\t\treturn new Stock();\n\t\t}\n\t\treturn stock;\n\t}", "@Override\n public BookmarkEntity findById(String id) {\n logger.info(\"Entering findById() in BookmarkDAO\");\n return bookmarkRepository.findByID(id);\n }", "public T findById(int id)\n {\n Connection connection = null;\n PreparedStatement statement = null;\n ResultSet resultSet = null;\n String query = createSelectQuery(\"id\");\n try\n {\n connection = ConnectionFactory.getConnection();\n statement = connection.prepareStatement(query);\n statement.setInt(1,id);\n resultSet = statement.executeQuery();\n\n return createObjects(resultSet).get(0);\n }catch (SQLException e)\n {\n LOGGER.log(Level.WARNING,type.getName() + \"DAO:findById\"+ e.getMessage());\n }finally {\n ConnectionFactory.close(resultSet);\n ConnectionFactory.close(statement);\n ConnectionFactory.close(connection);\n }\n return null;\n }", "public int find(int id) {\n\t\tGraphAdjListRep280 holder = G;\t// Holder for the graph so we do not need to alter the actual Graph's curso position\n\n\t\tholder.goIndex(id);\t// Move the vertex cursor to the vertex located in location id\n\t\tholder.eGoFirst(G.item());\t// Move the edge cursor to the first edge attached to vertex id\n\t\twhile (holder.eItemExists()) {\t// While the item exist\n\t\t\tholder.goVertex(holder.eItemAdjacentVertex());\t// Move the vertex to the vertex adjacent to the current vertex\n\t\t\tholder.eGoFirst(holder.item());\t// Move edge cursor to the first edge of the vertex cursor\n\t\t}\n\n\t\treturn holder.itemIndex();\t// Result\n\t}", "@Override\r\n\tpublic Food getFoodById(int id) {\n\t\tString sql=\"select * from food where id=?\";\r\n\t\tList<Food> list=(List<Food>) BaseDao.select(sql, Food.class,id);\r\n\t\tif(list.size()>0) {\r\n\t\t\treturn list.get(0);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n public MyBook findById(final int id) {\n System.err.println(\"MyBookRepositoryImpl:159 - not implement\");\n System.exit(1);\n return null;\n }", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n\t\tpublic ResponseEntity<Optional<Pedido>> find(@PathVariable Integer id) {\n\t\t\tOptional<Pedido> obj = service.find(id);\n\t\t\treturn ResponseEntity.ok().body(obj);\n\t\t}", "public abstract T findOne(int id);" ]
[ "0.6720157", "0.66951895", "0.6638803", "0.6633083", "0.6624849", "0.65506387", "0.641194", "0.63865155", "0.6302173", "0.62637615", "0.6256245", "0.6207953", "0.6180502", "0.6148253", "0.6147843", "0.6132764", "0.611633", "0.61106867", "0.6027068", "0.5985859", "0.5984699", "0.59745437", "0.597229", "0.59665084", "0.5961026", "0.5956179", "0.5943312", "0.59395415", "0.5937115", "0.5932406", "0.5928663", "0.59260124", "0.5925242", "0.5924704", "0.58942366", "0.5888534", "0.5884503", "0.5879642", "0.5876104", "0.58760697", "0.58632", "0.58582824", "0.585315", "0.58438563", "0.58344156", "0.58333576", "0.5818697", "0.58022475", "0.5794641", "0.57876855", "0.5770069", "0.5769836", "0.5767156", "0.5766366", "0.5765964", "0.5761094", "0.57545245", "0.575076", "0.57408726", "0.5737476", "0.5736991", "0.5722108", "0.57189333", "0.57188255", "0.57123613", "0.5705732", "0.5697176", "0.5696855", "0.5696278", "0.5694444", "0.5692554", "0.5687801", "0.5687642", "0.56825674", "0.56799847", "0.56730974", "0.5669035", "0.5668816", "0.56661063", "0.5663548", "0.5649846", "0.5647399", "0.56404865", "0.5640472", "0.5638678", "0.56295997", "0.56219506", "0.56200725", "0.5615454", "0.5611649", "0.5611238", "0.5609761", "0.56051725", "0.5602205", "0.56016964", "0.5599662", "0.5588729", "0.558592", "0.557895", "0.5574419" ]
0.7168877
0
Saves the dress to a data source.
@Override public Integer create(Dress dress) { LOGGER.debug("Create new dress {}", dress); if (isNameAlreadyExist(dress)) { throw new IllegalArgumentException( "Dress with the same name is already exists in DB."); } SqlParameterSource namedParameters = new MapSqlParameterSource(DRESS_NAME, dress.getDressName()); KeyHolder keyHolder = new GeneratedKeyHolder(); jdbcTemplate.update(createSql, namedParameters, keyHolder); return Objects.requireNonNull(keyHolder.getKey()).intValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveData() {\n\t\tdataSaver.save(data);\n\t}", "private void saveData() {\n }", "public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}", "public void save() {\t\n\t\n\t\n\t}", "@Override\n\tpublic void saveDataSource() {\n\t\tsaveServerOffline();\n\t}", "public void saveData() {\n\t\t//place to save notes e.g to file\n\t}", "void save();", "void save();", "void save();", "@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}", "Destination save(Destination destination);", "private void saveData() {\n\t\tthis.dh = new DataHelper(this);\n\t\tthis.dh.updateData(String.valueOf(mData.getText()), i.getId());\n\t\tthis.dh.close();\n\t\tToast\n\t\t\t\t.makeText(ctx, \"Changes saved successfully...\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\n\t\tIntent myIntent = new Intent(EditActivity.this, StartActivity.class);\n\t\tEditActivity.this.startActivity(myIntent);\n\t\tfinish();\n\t}", "void saveShipment(Shipment shipment);", "public void saveData(){\r\n file.executeAction(modelStore);\r\n }", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "public void save();", "public void save();", "public void save();", "public void save();", "@Override\r\n\tpublic void saveDistrict(District district) {\n\t\t\r\n\t}", "@Override\n\tpublic void save(Domingo domingo) {\n\t\tdomingoDAO.save(domingo);\t\t\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "void saveSaves(Object data, Context context);", "public static void save() {\n\t\tfor (TeleporterData tld : teleports.values()) {\n\t\t\ttld.write();\n\t\t}\n\t}", "public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}", "public void saveDataModel(DataModel dm) throws Exception {\r\n\t\tif (dm == null) {\r\n\t\t\tthrow new NullPointerException(\"The data model passed to \" +\r\n\t\t\t\t\t\"the DefaultDataSource's saveDataModel method cannot \" +\r\n\t\t\t\t\t\"be null\");\r\n\t\t}\r\n\t\t\r\n\t\tif (!dataModels.contains(dm)) {\r\n\t\t\tthrow new IllegalArgumentException(\"The data model passed to \" +\r\n\t\t\t\t\t\"the DefaultDataSource's saveDataModel method must \" +\r\n\t\t\t\t\t\"have been previously added by addDataModel\");\r\n\t\t}\r\n\t}", "private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }", "public void save() throws DfException {\n\t\tobject.save();\n\t}", "public void save()\n\t{\n\t\tfor(PlayerData pd : dataMap.values())\n\t\t\tpd.save();\n\t}", "@Override\n\tpublic VisitorDetails saveData(VisitorDetails data) {\n\t\treturn repo.save(data);\n\t}", "public final void saveDodle() {\n System.out.println(\"SaveTool::saveDodle - deprecated. Send `SAVE_DODLE` event instead.\");\n //toolRegistry.setActiveTool(null);\n //stateManager.fireSaveEvent();\n }", "public void save() {\n UTILS.write(FILE.getAbsolutePath(), data);\n }", "protected void saveValues() {\n dataModel.persist();\n }", "protected void save() {\n close();\n if(saveAction != null) {\n saveAction.accept(getObject());\n }\n }", "public void saveMealPlanner(){\n Data.<Days>saveList(ObservableWeekList, mealPlannerFile);\n }", "public void save() {\n }", "@Override\n\tpublic void save(DataKey arg0) {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\t\n\t}", "private void save() {\n Saver.saveTeam(team);\n }", "public void storeData() {\n try {\n ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(\"DB/Guest.ser\"));\n out.writeInt(guestList.size());\n out.writeInt(Guest.getMaxID());\n for (Guest guest : guestList)\n out.writeObject(guest);\n //System.out.printf(\"GuestController: %,d Entries Saved.\\n\", guestList.size());\n out.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "@Override\r\n public void storePin() {\n DataStoreGP1 data = (DataStoreGP1) ds;\r\n data.pin = data.temp_p;\r\n System.out.println(\"Pin has been saved successfully..\");\r\n }", "@Override\n public void save() {\n graphicsEnvironmentImpl.save(canvas);\n }", "public void save() {\n\t\tSystem.out.println(\"-----------from PersonDao.save()\");\n\t}", "void saveData() throws SerializerException;", "@Override\n public void Save() {\n\t \n }", "void saveTrip(Trip parTrip);", "@Override\r\n\tpublic final void saveObjectData() throws BillingSystemException{\n\t}", "public void save(){\r\n\t\tmanager.save(this);\r\n\t}", "@Override\r\n\tpublic void save() throws SaveException {\n\t\t\r\n\t}", "public void saveData() {\n throw new UnsupportedOperationException(\"Not yet supported\");\n }", "Source updateDatasourceOAI(Source ds) throws RepoxException;", "@Override\n\tpublic void save(CorsoDiLaurea corso) {\n\t\t\n\t}", "@Override\n\tpublic void save() {\n\t\tSystem.out.println(\"save method\");\n\t}", "@Override\n public void saveData() {\n System.out.println(\"GateWay\");\n }", "public void setData(D s){\n\t\tdata = s;\n\t}", "private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}", "public void saveToDB() {\n \twipeDB();\n\t\tSQLiteDatabase db = nodeData.getReadableDatabase();\n\t\tContentValues values = new ContentValues();\n\t\tfor (int i = 0; i < wallpapers.size(); i++) {\n\t\t\tvalues.put(EventDataSQLHelper.NODE, nodeToString(wallpapers.get(i)));\n\t\t\ttry {\t\t\t\t\n\t\t\t\tdb.insertOrThrow(EventDataSQLHelper.TABLE, null, values);\n\t\t\t\tLog.d(\"AddToDB\", nodeToString(wallpapers.get(i)));\n\t\t\t} catch (SQLException e) {\n\t\t\t\tLog.d(\"AddToDB\", \"\" + e.getMessage());\n\t\t\t}\n\t\t}\n\t\tdb.close();\n }", "public SaveResidenceTask(Residence residence) {\n this.residence = residence;\n }", "@Override\r\n\tpublic void save() {\n\r\n\t}", "@Override\r\n\tpublic void save() {\n\r\n\t}", "public static void saveDrops() {\n DropTable.serialize(file);\n }", "public void save() {\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(\"studentData.dat\");\n\n\t\t\tObjectOutputStream oos;\n\t\t\ttry {\n\t\t\t\toos = new ObjectOutputStream(fos);\n\n\t\t\t\toos.writeObject(studentList);\n\t\t\t\toos.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(\"File is finished writing to the hard drive\");\n\t}", "@Override\n public void save() {\n \n }", "public void setDataWriter(DataWriter dataWriter);", "public void save() {\n super.storageSave(listPedidosAssistencia.toArray());\n }", "public void saveJbdTravelPoint2014(JbdTravelPoint2014 jbdTravelPoint2014);", "@Override\r\n\tpublic void save(TQssql sql) {\n\r\n\t}", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "@Override\n public void save() {\n\n }", "public void saveBorrowings() {\n\t}", "public void save(String addressbookname,AddressbookModel addressbook){\n Addressbookservices.WriteToACsv(addressbook,addressbookname);\n }", "@Override\n public void save()\n {\n \n }", "void saveObject(DataObject sdo, XMLStreamWriter writer) throws XMLStreamException;", "void save(Bill bill);", "public void save() {\n\n\t\tint[][] rawData = new int[2][CHUNK_SIZE * CHUNK_SIZE];\n\n\t\tfor (int l = 0; l < 2; l++) {\n\t\t\tLayer layer = Layer.get(l);\n\t\t\tfor (int y = 0; y < CHUNK_SIZE; y++) {\n\t\t\t\tfor (int x = 0; x < CHUNK_SIZE; x++) {\n\t\t\t\t\trawData[l][x + y * CHUNK_SIZE] = getTileId(layer, x, y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.saveData = new RawChunkData(rawData);\n\t}", "public void saveData(){\n reporter.info(\"Save edited form\");\n clickOnElement(LOCATORS.getBy(COMPONENT_NAME,\"SAVE_BUTTON\"));\n }", "@Override\n public void save(final String filename) throws IOException {\n Filer.getInstance().save(this, DGraphIOFactory.getInstance(), filename);\n }", "public void save(RaceSituation raceSituation);", "public void saveGame(){\n \tsaveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n \tsaveGame.saveGame(saveOriginator);\n }", "public void save()\n\t{\n\t\tif(entity != null)\n\t\t\t((SaveHandler)DimensionManager.getWorld(0).getSaveHandler()).writePlayerData(entity);\n\t}", "private void save(Store store) {\n if (saved) {\n return;\n }\n\n if (saves.isEmpty()) {\n saved = true;\n return;\n }\n\n store.save(saves);\n saved = true;\n }", "public void save() {\n\t\tInputManager.resetWriter(false);\n\t\tInputManager.writer(InputManager.newDelimeterOne + \" \" + InputManager.newDelimeterTwo);\n\t\tfor(Row r: rows) {\n\t\t\tInputManager.writer(r.toString());\n\t\t}\n\t}", "void saveCity(City city);", "public void save(){\n BoardSerializer.serialize(this);\n }", "public boolean save(Data model);", "public void Save() {\r\n //solo se salvara el container\r\n vc.getContainer();\r\n }", "private Evidence saveEvidence(Evidence evidence){\n\t\t\tdemoBuilder.getIndicators().removeIf(e -> evidence.getId().equals(e.getId()));\n\t\t\tdemoBuilder.getIndicators().add(evidence);\n\t\t\treturn evidence;\n\t}", "public void StoreData(DataStore ds)\n {\n ((DataStore2)ds).setPin();\n\tSystem.out.println(\"Account 2:The set PIN is \" + ((DataStore2)ds).getPin() );\n ((DataStore2)ds).setUid();\n\tSystem.out.println(\"Account 2:The set User ID is \" + ((DataStore2)ds).getUid() );\n ((DataStore2)ds).setBalance();\n\tSystem.out.println(\"Account 2:The Balance is \" + ((DataStore2)ds).getBalance() );\n }", "public SavePresentationEvent(Object source, String saveLocation) {\n super(source);\n this.saveLocation = saveLocation;\n }", "public void save () {\r\n\t\tlog.debug(\"TunnelList:save()\");\r\n\t\tlog.info(\"Saving to file\");\r\n\t\tFileTunnel.saveTunnels(this);\r\n\t}", "public void saveAsSerialization() {\n try(ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(new File(\"saves/data.dat\")))){\n os.writeObject(this);\n } catch (FileNotFoundException e){\n System.out.println(\"Could not create file: \" + e.getMessage());\n } catch (IOException e){\n System.out.println(\"IO exception occurred: \" + e.getMessage());\n }\n\n }", "public void save(Object instance);", "public void save(String filename) throws IOException\n {\n DataOutputStream output;\n\n try\n {\n output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(new File(filename))));\n }\n catch (Exception e)\n {\n throw new IOException(\"Cannot open output file \" + filename + \":\" + e.getMessage());\n }\n save(output);\n output.flush();\n output.close();\n }", "String saveRecord(String recordID, Source ds, String recordXML) throws RepoxException;", "protected abstract void doSave();", "private void exportFile()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdrinkListFileOutput = new BufferedWriter(new FileWriter(drinkListFile));\n\t\t\tdrinkListFileOutput.write(exportDrinkList);//insert string of drinks\n\t\t\tdrinkListFileOutput.close();\n\t\t\tJOptionPane.showMessageDialog(null, \"Successfully saved drinks\");\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.toString();//change this\n\t\t\tJOptionPane.showMessageDialog(null, \"Drink save error: \" + e.toString());//change this);\n\t\t}\n\n\n\n\t}", "public void storeValuesDump() throws SQLException{ //store DUMP values into the database\n \tString sqlDump = \"INSERT INTO dump VALUES ('\" + massSelection + \"', '\" + smokeSelection + \"', '\" + framesText.getText() + \"', '\" + dtDevcText.getText() + \"');\";\n \tConnectionClass connectionClass = new ConnectionClass();\n\t\tConnection connection = connectionClass.getConnection();\n\t\tStatement statement = connection.createStatement();\n\t\tstatement.executeUpdate(sqlDump);\n }", "public void save(){\r\n\t\t//System.out.println(\"call save\");\r\n\t\tmodel.printDoc();\r\n\t}", "@Override\n\t\tpublic void finishIteration() {\n\t\t\trailroad.save();\n\t\t\tSystem.out.println(\"SAVING!\");\n\t\t\tsuper.finishIteration();\n\t\t}", "public boolean save();" ]
[ "0.6063408", "0.60104245", "0.5813506", "0.580833", "0.5704215", "0.5689312", "0.5676244", "0.5676244", "0.5676244", "0.56188685", "0.5588433", "0.5585552", "0.5545281", "0.5538718", "0.55252075", "0.54971886", "0.54971886", "0.54971886", "0.54971886", "0.54970264", "0.54622865", "0.54568714", "0.5435112", "0.54090655", "0.53889537", "0.5382141", "0.53785306", "0.53751385", "0.53750575", "0.536519", "0.5364023", "0.53573364", "0.5349314", "0.5338828", "0.53241974", "0.53223723", "0.5315411", "0.5310034", "0.5310034", "0.53089964", "0.52846104", "0.5278894", "0.5275516", "0.52744055", "0.527287", "0.52619135", "0.52520955", "0.5251772", "0.52393925", "0.5238021", "0.52228385", "0.5220424", "0.52156067", "0.52092737", "0.5195462", "0.5189452", "0.51788", "0.51708853", "0.5157822", "0.5156572", "0.5156572", "0.51554066", "0.5131167", "0.51197714", "0.51192737", "0.51057625", "0.5092232", "0.50920427", "0.5075258", "0.5071807", "0.5070835", "0.5068986", "0.5067789", "0.5067566", "0.50663567", "0.50544834", "0.5047488", "0.5043696", "0.50426656", "0.50284326", "0.5009394", "0.50035733", "0.5002892", "0.49979085", "0.49966747", "0.49962997", "0.498778", "0.49787167", "0.49780658", "0.49732557", "0.49728224", "0.49711454", "0.4960078", "0.49551973", "0.4954105", "0.49537462", "0.49522763", "0.4944568", "0.49440268", "0.49392885", "0.4936719" ]
0.0
-1
Updates an existing dress with a new object.
@Override public Integer update(Dress dress) { LOGGER.debug("Update dress {}", dress); if (isNameAlreadyExist(dress)) { throw new IllegalArgumentException( "Dress with the same name is already exists in DB."); } Map<String, Object> namedParameters = new HashMap<>(); namedParameters.put(DRESS_ID, dress.getDressId()); namedParameters.put(DRESS_NAME, dress.getDressName()); return jdbcTemplate.update(updateSql, namedParameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Adress updateAdress(Adress adress) {\n\t\treturn em.merge(adress);\r\n\t}", "@Override\n\tpublic void update(Unidade obj) {\n\n\t}", "D update(D dto);", "public Address update(Address entity);", "void update(Seller obj);", "void update(Seller obj);", "@Override\r\n\tpublic void update(Cidade obj) {\n\r\n\t}", "int updateByPrimaryKey(Dress record);", "public boolean update(New object);", "public void updateByObject()\r\n\t{\n\t}", "void update(T objectToUpdate);", "@Override\n\tpublic Book update(Book dto) {\n\t\treturn null;\n\t}", "int updateByExample(@Param(\"record\") Dress record, @Param(\"example\") DressExample example);", "public void updateDistrict(District District);", "public Address updateAddress(Address newAddress);", "void update(Serializable objectId);", "public void update(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}", "Restaurant setRestaurant(Restaurant modifiedRest);", "@Test\n public void testUpdateSightingGP() throws InvalidIdException, InvalidEntityException {\n Sighting original = new Sighting(1, LocalDate.parse(\"2010-01-01\"), loc1, hero1);\n Sighting updated = new Sighting(1, LocalDate.parse(\"2015-01-01\"), loc1, hero1);\n \n Sighting toCheck = service.getSightingById(1);\n assertEquals(original, toCheck);\n \n service.updateSighting(updated);\n \n toCheck = service.getSightingById(1);\n assertEquals(updated, toCheck);\n assertNotEquals(original, toCheck);\n }", "void update(Employee nurse);", "int updateByPrimaryKeySelective(Dress record);", "int updateByExampleSelective(@Param(\"record\") Dress record, @Param(\"example\") DressExample example);", "@Override\r\n\tpublic void update(Object object) {\n\t\t\r\n\t}", "void update(T obj) throws PersistException;", "T update(T object);", "void update(Reservierung reservierung, int id) throws ReservierungException;", "public void update(Object obj) throws HibException;", "public Client update(Client object) throws DataNotFoundException {\n\t\treturn null;\r\n\t}", "@Override\n public Integer create(Dress dress) {\n LOGGER.debug(\"Create new dress {}\", dress);\n if (isNameAlreadyExist(dress)) {\n throw new IllegalArgumentException(\n \"Dress with the same name is already exists in DB.\");\n }\n\n SqlParameterSource namedParameters\n = new MapSqlParameterSource(DRESS_NAME, dress.getDressName());\n KeyHolder keyHolder = new GeneratedKeyHolder();\n jdbcTemplate.update(createSql, namedParameters, keyHolder);\n return Objects.requireNonNull(keyHolder.getKey()).intValue();\n }", "@Override\r\n\tpublic boolean updHouse(House h) {\n\t\treturn adi.updHouse(h);\r\n\t}", "protected void updateRecord() throws DAOException {\r\n\t\t// Prepara para actualizar\r\n\t\tobject.prepareToUpdate();\r\n\t\t// Actualiza objeto\r\n\t\tobjectDao.update(object);\r\n\t\t// Actualiza relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\tsedrelcoDao.update(relco);\r\n\t\t}\r\n\t}", "<T> void update(T persistentObject);", "public Hoppy update(Hoppy hoppy) throws DataAccessException;", "private void updateObject(Object object) {\n Connection connection = ConnectionPoll.getConnection();\n CRUDService crudService = new CRUDService(connection, object.getClass());\n\n try {\n crudService.update((SimpleORMInterface) object);\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n ConnectionPoll.releaseConnection(connection);\n\n try {\n connection.close();\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }", "public void update(Triplet t) throws DAOException;", "@Override\n\tpublic int update(Reservation objet) {\n\t\treturn 0;\n\t}", "RocketDTO updateRocket(UpdateRocketDTO rocket);", "public abstract boolean update(Domain d);", "E update(E entiry);", "@Override\r\n\tpublic void update(Person person) {\n\r\n\t}", "@Override\n public void update(Object object, Object id) throws DAOException {\n\n }", "@Override\r\n\tpublic Ressource update(Ressource obj) {\n\t\treturn null;\r\n\t}", "int updateByPrimaryKey(Dish record);", "@Override\n\tpublic Disease update(Disease disease) {\n\t\tDisease toUpdate = diseaseRepository.getOne(disease.getId());\n\t\ttoUpdate.setDiseaseType(disease.getDiseaseType());\n\t\ttoUpdate.setName(disease.getName());\n\t\ttoUpdate.setSymptoms(disease.getSymptoms());\n\t\treturn diseaseRepository.save(toUpdate);\n\t}", "@Override\r\n\tpublic void update(Person p) \r\n\t{\n\t\t\r\n\t}", "@Override\n public void update(String name, String surname) {\n this.name = name;\n this.surname = surname;\n }", "public void update(){}", "public void update(){}", "@Override\n\tpublic void update() {\n\t\tobj.update();\n\t}", "@Override\n\tpublic void update(Object o) {\n\n\t}", "@Override\n\tpublic void update(Object o) {\n\n\t}", "public void updateRecord(Record object);", "Weather update(Long id, WeatherInformation weatherInformation);", "Patient update(Patient patient);", "@Override\n\tpublic void update(Recipe entity) {\n\t\t\n\t}", "void update(Student entity);", "void update(ReferenceData instance) throws DataException;", "public void update(String t, String d, int p, int g)\n {\n this.title = t;\n this.des = d;\n this.price = p;\n this.guests = g;\n }", "E update(E entity);", "E update(E entity);", "@Override\n\tpublic void updateRestaurant(Restaurant restaurant) {\n\t\tem.merge(restaurant);\n\t}", "@Override\n\tpublic Address updateAddress(Address address) {\n\t\treturn repository.save(address);\n\t}", "public void doUpdate(T objectToUpdate) throws SQLException;", "public boolean update(Object obj) throws Exception;", "public void update() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.update(this); // routine now uses leaseDao to get CampLease class\r\n\t}", "public void updateEntity();", "void update(T transientObject);", "@Override\r\n\tpublic Borne update(Borne obj) {\n\t\tStatement st =null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tst = this.connect.createStatement();\r\n\t\t\tString sql = \"UPDATE Borne SET idZone = '\"+obj.getZone().getId()+\"' WHERE id =\"+obj.getId();\r\n\t\t\tSystem.out.println(sql);\r\n\t\t\tst.executeUpdate(sql);\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn obj;\r\n\t}", "@Override\n\tpublic void update(Review object) {\n\t\t\n\t}", "@Override\n\tpublic boolean update(Eleve o) {\n\t\tmap.replace(o.getId(), o);\n\t\treturn true;\n\t}", "public abstract <T> T update(Object object, Class<T> clazz);", "@Override\r\n\tpublic Disease update(Disease disease) {\r\n\t\t// setting logger info\r\n\t\tlogger.info(\"update the details of the disease\");\r\n\r\n\t\tOptional<Disease> diseases= diseaseRepo.findById(disease.getDiseaseId());\r\n\t\tif(!diseases.isPresent()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tdiseases.get().setDiseaseName(disease.getDiseaseName());\r\n\t\tdiseases.get().setDiseaseType(disease.getDiseaseType());\r\n\t\tdiseases.get().setDiseaseSymptoms(disease.getDiseaseSymptoms());\r\n\t\treturn diseaseRepo.save(diseases.get());\r\n\t}", "@Override\n public void upsert(Novel novel) {\n cassandraTemplate.update(\n Query.query( Criteria.where(\"category\").is(novel.getCategory()))\n .and(Criteria.where(\"author\").is(novel.getAuthor()))\n .and(Criteria.where(\"genre\").is(novel.getGenre()))\n .and(Criteria.where(\"name\").is(novel.getName())),\n Update.empty().increment(\"sale_count\"), Novel.class);\n }", "public Weather update(Weather weather);", "@Override\n\tpublic void updateWaybill(WaybillEntity waybill) {\n\t\t\n\t}", "@Override\n\tpublic void update(Discount discount) {\n\t\t\n\t}", "Test update(TestData testData, Test test);", "@Override\n\tpublic void editDomanda(Long id, String newCatName) {\n\t\tDB db = getDB();\n\t\tMap<Long, Domanda> domande = db.getTreeMap(\"domande\");\n\t\tlong hash = id.hashCode();\n\t\tDomanda domanda = domande.get(hash);\n\t\tdomanda.getCat().setNome(newCatName);\n\t\tdomande.put(hash, domanda);\n\t\tdb.commit();\n\t}", "public abstract void update(Object obj) ;", "public static void putRDOToCache(String id, ResDesObject rdo) {\n\t\tResourceObject ro = getROFromCache(id);\r\n\t\ttry {\r\n\t\t\tif (ro == null) // not found, get from db\r\n\t\t\t\tro = DataEngine.getROById(id, true);\r\n\t\t} catch (Exception e) {\r\n\t\t\tLog.error(\"get ro failed, id=\" + id);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (ro == null) // ro no exist any more\r\n\t\t{\r\n\t\t\tLog.error(\"get ro failed, id=\" + id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// add rdo\r\n\t\tro.addResDesObject(rdo);\r\n\r\n\t\t// update cache\r\n\t\tMemCachedClient mc = new MemCachedClient(MEMCACHED_POOL_NAME);\r\n\t\t//mc.setPoolName(MEMCACHED_POOL_NAME);\r\n\t\tif (!mc.set(id, ro))\r\n\t\t\tLog.error(\"put resource object \" + id + \" to caceh failed\");\r\n\r\n\t}", "@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }", "@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }", "@PatchMapping(\"recipes/{id}\")\n public RecipeDto updateBook(@PathVariable(\"id\") Long id, @RequestBody RecipeDto toUpdate) {\n logger.info(\"updating book with id: [{}] with new attributes: [{}]\", id, toUpdate);\n return recipeService.updateRecipeWithAttributes(id, toUpdate);\n }", "AdPartner updateAdPartner(AdPartner adPartner);", "public void updatePost(Long id, BlogPost post);", "RecipeObject addRecipe(RecipeObject recipe);", "void update(ObjectType object)\n throws GuacamoleException;", "@Update\n void updateEggDaily(EggDaily eggDaily);", "public void update(Pessoa p) {\n\t\tdb.save(p);\t\t\n\t}", "int updTravelById(Travel record) throws TravelNotFoundException;", "@Override\n\tpublic void update(T obj) throws Exception {\n\t\t\n\t}", "void updateGarage(Garage updatedGarage);", "public void update(T object) throws SQLException;", "void setData (Object newData) { /* package access */ \n\t\tdata = newData;\n\t}", "public void updateSupplierDetail(Supplier obj) {\n\t\t\r\n\t}", "@Override\n\tpublic AuditDetail update(AuditDetail domainObject) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void updateById(Doublematchscore doublematchscore) throws Exception {\n\t\tdoublematchscoreMapper.updateById(doublematchscore);\n\t}", "@Override\r\n\tpublic void update(Object obj) throws DAOException {\n\r\n\t}", "@Override\n\tpublic Studentbean2 updateAddress(AddressBean upd) {\n\t\tStudentbean2 s=null;\n\t\tfor(Studentbean2 e:stu2)\n\t\t{ \n\t\t\tif(e.getId()==upd.getId())\n\t\t\t{ \n\t\t\t\te.setA(upd);\n\t\t\t\ts=e;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}" ]
[ "0.62566805", "0.59963673", "0.5963297", "0.5909789", "0.5848197", "0.5848197", "0.58384424", "0.5822151", "0.57395136", "0.57021195", "0.565042", "0.5641122", "0.5614609", "0.5590357", "0.55751204", "0.55592394", "0.55409837", "0.55023324", "0.54856277", "0.54688656", "0.54440355", "0.5432585", "0.54046917", "0.54034114", "0.5398395", "0.53789616", "0.53766143", "0.5367067", "0.53622234", "0.53509986", "0.5348213", "0.5345913", "0.5337262", "0.5326171", "0.53173405", "0.53150475", "0.52947104", "0.52811754", "0.52771056", "0.5274984", "0.5272429", "0.5272203", "0.52683955", "0.5261989", "0.5254517", "0.52528375", "0.52522206", "0.5226988", "0.5226988", "0.5221258", "0.5214627", "0.5214627", "0.52041173", "0.5198521", "0.51809806", "0.517534", "0.51706177", "0.51705056", "0.5170126", "0.5157507", "0.5157507", "0.51573884", "0.5155664", "0.51530874", "0.5152343", "0.5150905", "0.5141106", "0.51321614", "0.5129544", "0.51281023", "0.51125354", "0.5112137", "0.51110435", "0.5110239", "0.51098555", "0.5105952", "0.510223", "0.5093667", "0.5089191", "0.50864345", "0.5083026", "0.50816685", "0.50816685", "0.50711095", "0.50685245", "0.5064947", "0.50636095", "0.5060723", "0.50498855", "0.504497", "0.50391775", "0.50360596", "0.50321984", "0.50309736", "0.50308615", "0.5030372", "0.50303483", "0.50284785", "0.50241417", "0.502106" ]
0.660019
0
Deletes dress from data source.
@Override public Integer delete(Integer dressId) { LOGGER.debug("Delete dress with id = {}", dressId); if (isDressHasRents(dressId)) { throw new UnsupportedOperationException( "This dress has orders and cannot be removed."); } SqlParameterSource namedParameters = new MapSqlParameterSource(DRESS_ID, dressId); return jdbcTemplate.update(deleteSql, namedParameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void delData();", "public void delete() {\n \t\t try(Connection con = DB.sql2o.open()) {\n \t\t\t String sql = \"DELETE FROM sightings where id=:id\";\n\t\t\t con.createQuery(sql)\n\t\t\t.addParameter(\"id\", this.id)\n\t\t\t.executeUpdate();\n\n \t\t }\n \t }", "@Override\r\n\tpublic boolean delSource(int resourceid) {\n\t\treturn this.excuteDb(\"delete from resource where resource_id=?\",new Object[]{\r\n\t\t\t\tresourceid \r\n\t\t} );\r\n\t}", "int deleteByExample(DressExample example);", "public void delete() {\n if (this.sourceInfo != null) {\n this.sourceInfo.removeSSRC(this);\n }\n }", "public abstract void delete(DataAction data, DataRequest source) throws ConnectorOperationException;", "public void destroy() {\n\t\tAL10.alDeleteSources(id);\n\t}", "String deleteDatasource(String dsID) throws RepoxException;", "public void deleteDataSource(Integer[] sysIds) throws Exception {\n\t\tdataSourceMapper.deleteDataSource(sysIds);\n\t}", "public void deleteBidStateData() throws DataLayerException\r\n\t{\r\n\t\tbidStateDao.deleteAll();\r\n\t}", "private void deleteOldData() {\n Date today = SunshineDateUtils.getNormalizedUtcDateForToday();\n weatherDao.deleteOldWeather(today);\n }", "public void deleteDataInStageTable() throws SQLException {\n\t\tdeleteData(\"stage_value\",idCondition);\n\t\tdeleteData(\"stage\",idCondition);\n\t}", "@Override\n\tpublic void del() {\n\t\ttarget.del();\n\t}", "public void clearPersons() throws DataAccessException {\n try (Statement stmt = conn.createStatement()) {\n String sql = \"DELETE FROM persons\";\n stmt.executeUpdate(sql);\n } catch (SQLException e) {\n throw new DataAccessException(\"SQL Error encountered while clearing persons table\");\n }\n }", "public void removeSourceData(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SOURCEDATA$0, i);\r\n }\r\n }", "public void deleteTaskStateData() throws DataLayerException\r\n\t{\r\n\t\ttaskStateDao.deleteAll();\r\n\t}", "@Override\n \tpublic Representation deleteResource() {\n \t\tString interId = (String) this.getRequestAttributes().get(\"interId\");\n \t\tString srcId = (String) this.getRequestAttributes().get(\"sourceId\");\n \t\t\n \t\t// On s'assure qu'il n'est plus prsent en base de donnes\n \t\n \t\tIntervention inter = Interventions.getInstance().getIntervention(interId);\n \t\tList<Source> sources = inter.getSources();\n \t\tfor (int i = 0; i < sources.size(); i++) {\n \t\t\tif (sources.get(i).getUniqueID().equals(srcId)) {\n \t\t\t\tsources.remove(sources.get(i));\n \t\t\t}\n \t\t}\n \t\t\n \t\treturn null;\n \t}", "public void clean() {\r\n\t\t\r\n\t\tlogger.trace(\"Enter clean\");\r\n\t\t\r\n\t\tdata.clear();\r\n\t\tfireTableDataChanged();\r\n\t\t\r\n\t\tlogger.trace(\"Exit clean\");\r\n\t}", "private void deleteTestDataSet() {\n LOG.info(\"deleting test data set...\");\n try {\n Statement stmt = _conn.createStatement();\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_person\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_employee\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_payroll\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_address\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_contract\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_category\");\n stmt.executeUpdate(\"DELETE FROM tc8x_pks_project\");\n } catch (Exception e) {\n LOG.error(\"deleteTestDataSet: exception caught\", e);\n }\n }", "public void removeAllData() {\n dbHelper.removeAllData(db);\n }", "private void delete() {\n\n\t}", "public void destory(){\n \n }", "public synchronized void delete() {\n if (this.swigCPtr != 0) {\n if (this.swigCMemOwn) {\n this.swigCMemOwn = false;\n libVisioMoveJNI.delete_VgIDatabaseDatasetDescriptor(this.swigCPtr);\n }\n this.swigCPtr = 0;\n }\n }", "public void deldrumentry(String idi) {\n\t\tourDatabase.delete(DATABASE_TABLE, Drum_RowID + \"=\" +idi, null);\n\t\t\t\n\t}", "private void clearData() {\n em.createQuery(\"delete from ViajeroEntity\").executeUpdate();\n }", "void removeAllData() throws DatabaseNotAccessibleException;", "public void delete() {\n\t\tcp.delete();\n\t}", "public void cleanSlate(View view) {\n Log.d(LOG, \"in cleanSlate\");\r\n dbh.deleteAllData();\r\n Log.d(LOG, \"all data deleted\");\r\n }", "void removeAll() throws DataException;", "private void clearData() throws SQLException {\n//Lay chi so dong cuoi cung\n int n = tableModel.getRowCount() - 1;\n for (int i = n; i >= 0; i--) {\n tableModel.removeRow(i);//Remove tung dong\n }\n }", "public void DeleteAllRecordsInTable() {\n\n final List<Address> gndPlan = GetAllRecordsFromTable();\n for (int i = 0; i < gndPlan.size(); i++) {\n\n gndPlan.get(i).delete();\n //delete all item in table House\n }\n\n }", "public void deleteAll() {\n try (Connection connection = dataSource.getConnection();\n Statement statement = connection.createStatement()) {\n statement.execute(INIT.DELETE_ALL.toString());\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "@Override\r\n\tpublic boolean pdsdelete(int seq) {\n\t\treturn pdsdao.pdsdelete(seq);\r\n\t}", "@Override\n\t\tpublic void delete() {\n\n\t\t}", "void deleteDoctor(Doctor target);", "@Override\r\n\tpublic void destory() {\n\t\t\r\n\t}", "public void removeIdenticalDataSources(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource s=iter.next();\n if (s.equals(source)) iter.remove();\n } \n }", "@Override\n public void deleteSighting(int sightingId) {\n jdbcTemplate.update(SQL_DELETE_HVSIGHTING,\n sightingId);\n // delete sighting\n jdbcTemplate.update(SQL_DELETE_SIGHTING,\n sightingId);\n }", "public NodeSet deleteDataInstances() throws JNCException {\n this.dataInstances = null;\n String path = \"data-instances\";\n return delete(path);\n }", "public void removeDataSourcesWithSameOrigin(DataSource source) {\n Iterator<DataSource> iter=datasources.iterator();\n while (iter.hasNext()) {\n DataSource old=iter.next();\n if (old.hasSameOrigin(source)) iter.remove();\n }\n }", "public void deleteCoordinates() {\n this.openWriteableDB();\n db.delete(COORD_TABLE, null, null);\n this.close();\n }", "protected void zDelete(MithraDataObject dataToDelete) throws MithraDatabaseException\r\n {\r\n long startTime = System.currentTimeMillis();\r\n Object source = this.getSourceAttributeValueFromObjectGeneric(dataToDelete);\r\n String sql = \"delete from \" + this.getFullyQualifiedTableNameGenericSource(source);\r\n\r\n sql += this.getSqlWhereClauseForDelete(dataToDelete);\r\n\r\n Connection con = null;\r\n PreparedStatement stm = null;\r\n try\r\n {\r\n con = this.getConnectionForWriteGenericSource(source);\r\n TimeZone databaseTimeZone = this.getDatabaseTimeZoneGenericSource(source);\r\n DatabaseType dt = this.getDatabaseTypeGenericSource(source);\r\n\r\n if (this.getSqlLogger().isDebugEnabled())\r\n {\r\n PrintablePreparedStatement pps = new PrintablePreparedStatement(sql);\r\n this.setPrimaryKeyAttributes(pps, 1, dataToDelete, databaseTimeZone, dt);\r\n this.logWithSource(this.getSqlLogger(), source, \"deleting with: \" + pps.getPrintableStatement());\r\n }\r\n stm = con.prepareStatement(sql);\r\n this.setPrimaryKeyAttributes(stm, 1, dataToDelete, databaseTimeZone, dt);\r\n int deleted = stm.executeUpdate();\r\n stm.close();\r\n stm = null;\r\n checkDeletedRows(deleted, dataToDelete);\r\n\r\n String dbid = this.getDatabaseIdentifierGenericSource(source);\r\n getNotificationEventManager().addMithraNotificationEvent(dbid, this.getFullyQualifiedFinderClassName(), MithraNotificationEvent.DELETE, dataToDelete, source);\r\n }\r\n catch (SQLException e)\r\n {\r\n this.analyzeAndWrapSqlExceptionGenericSource(\"delete failed \" + e.getMessage(), e, source, con);\r\n }\r\n finally\r\n {\r\n this.closeStatementAndConnection(con, stm);\r\n }\r\n this.getPerformanceData().recordTimeForDelete(1, startTime);\r\n }", "@RequestMapping(value = \"/{dataViewId}\", method = RequestMethod.DELETE)\n public void deleteDataView(@PathVariable String dataViewId) {\n System.exit(0);\n\n }", "void deleteAllDiscounts();", "@Override\r\n\tpublic void deleteAdress(Adress adress) {\n\t\tem.remove(em.merge(adress));;\r\n\t}", "public void delete()\n {\n if (this.data != null)\n {\n this.data.free();\n this.data = null;\n }\n \n this.width = 0;\n this.height = 0;\n \n this.mipmaps = 1;\n }", "@FXML\r\n public void deleteTreatmentButton(){\r\n int sIndex = treatmentTabletv.getSelectionModel().getSelectedIndex();\r\n String sID = treatmentData.get(sIndex).getIdProperty();\r\n\r\n String deleteTreatment = \"delete from treatment where treatmentID = ?\";\r\n try{\r\n ps = mysql.prepareStatement(deleteTreatment);\r\n ps.setString(1,sID);\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe more in this exception\r\n }\r\n\r\n treatmentData.remove(sIndex);\r\n }", "int deleteByExample(XdSpxxExample example);", "public void deleteDistrict(District District);", "public static void clearThreadDataSource() {\n\t\tthreadDataSource.remove();\n//\t\tSystem.out.println(\"TradingDataSourceHolder Method ClearThreadDataSource ##:[clearThreadDataSource] \"+stackSource);\n\t}", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "@Override\r\n\tpublic void deleteDistrict(Integer districtId) {\n\t\t\r\n\t}", "public void deleteEpicsData(EpicsType epicsType, int run);", "@Override\n\tpublic void delete(Facture y) {\n\t\t\n\t}", "public void deleteRoleData() throws DataLayerException\r\n\t{\r\n\t\troleDao.deleteAll();\r\n\t}", "public void removeAll()\r\n {\n db = this.getWritableDatabase(); // helper is object extends SQLiteOpenHelper\r\n db.execSQL(\"drop table \"+\"campaing\");\r\n db.execSQL(\"drop table \"+\"cafe\");\r\n db.execSQL(\"drop table \"+\"points\");\r\n\r\n db.close ();\r\n }", "public void delete() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.delete(this);\r\n\t}", "public void deleteSnippeFromDB(int id) {\r\n statsRepo.deleteById(id);\r\n }", "public void cleanupData() {\n\t}", "private void clearData() {\r\n em.createQuery(\"delete from MonitoriaEntity\").executeUpdate();\r\n }", "public static void clearData() {\n cutPoints.clear();\n data.delete(0, data.length());\n }", "public void delete(){\n if (shx!=null) shx.delete();\n if (shp!=null) shp.delete();\n if (dbf!=null) dbf.delete();\n if (prj!=null) prj.delete();\n }", "public void deleteData(String filename, SaveType type);", "@Override\n public int delete( J34SiscomexPaises j34SiscomexPaises ) {\n return super.doDelete(j34SiscomexPaises);\n }", "@Test\n public void deleteDoctor() {\n\t\tList<Doctor> doctors = drepository.findByName(\"Katri Halonen\");\n\t\tassertThat(doctors).hasSize(1);\n \tdrepository.deleteById((long) 3);\n \tdoctors = drepository.findByName(\"Katri Halonen\");\n \tassertThat(doctors).hasSize(0);\n }", "@Delete(\"DELETE from addresses WHERE id_address=#{addressId}\")\n void deleteAddress(int addressId);", "public void deleteSiteStats () throws DataServiceException;", "public void delete() {\n\n\t}", "@Override\n\tpublic void destory() {\n\t\t\n\t}", "@Override\n\tpublic void destory() {\n\t\t\n\t}", "private void clearData() {}", "void unsetDSTSavings();", "@Override\n\tpublic boolean DeleteDataByID(String sID) throws SQLException {\n\t\treturn false;\n\t}", "public void delete() {\n\t\ttry {\n\t\t\tStatement stmt = m_db.m_conn.createStatement();\n\t\t\tString sqlString;\n\t\t\tString ret;\n\n\t\t\tsqlString = \"DELETE from country WHERE countryid=\" + m_country_id;\n\t\t\tm_db.runSQL(sqlString, stmt);\n\t\t\tstmt.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\">>>>>>>> EXCEPTION <<<<<<<<\");\n\t\t\tSystem.out.println(\"An Exception occured in delete().\");\n\t\t\tSystem.out.println(\"MESSAGE: \" + e.getMessage());\n\t\t\tSystem.out.println(\"LOCALIZED MESSAGE: \" + e.getLocalizedMessage());\n\t\t\tSystem.out.println(\"CLASS.TOSTRING: \" + e.toString());\n\t\t\tSystem.out.println(\">>>>>>>>>>>>>-<<<<<<<<<<<<<\");\n\t\t}\n\t}", "@Override\r\n\tpublic void eliminar() {\n\t\tLOG.info(\"Eliminar los datos del equipo\");\r\n\t}", "public final void delete() {\n\t\tOllie.delete(this);\n\t\tOllie.removeEntity(this);\n\t\tnotifyChange();\n\t\tid = null;\n\t}", "@Override\n public void delete()\n {\n }", "int deleteByExample(DiseaseExample example);", "public void removeByDataSetId(long dataSetId);", "public void deleteIscrizione() throws SQLException {\r\n\r\n\t\tPreparedStatement pstmt = null;\r\n\r\n\t\ttry {\r\n\t\t\tpstmt = con.prepareStatement(STATEMENTDEL);\r\n\t\t\t\r\n\t\t\tpstmt.setString(1, i.getGiocatore());\r\n\t\t\tpstmt.setInt(2, i.getTorneo());\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\tpstmt.execute();\r\n\r\n\t\t} finally {\r\n\t\t\tif (pstmt != null) {\r\n\t\t\t\tpstmt.close();\r\n\t\t\t}\r\n\r\n\t\t\tcon.close();\r\n\t\t}\r\n\r\n\t}", "public void delete() throws SQLException {\r\n\t\t//SQL Statement\r\n\r\n\t\tString sql = \"DELETE FROM \" + table+ \" WHERE \" + col_genreID + \" = ?\";\r\n\t\tPreparedStatement stmt = DBConnection.getConnection().prepareStatement(sql);\r\n\t\tstmt.setInt(1, this.getGenreID());\r\n\r\n\t\tint rowsDeleted = stmt.executeUpdate();\r\n\t\tSystem.out.println(\"Es wurden \"+rowsDeleted+ \"Zeilen gelöscht\");\r\n\t\tstmt.close();\r\n\t}", "public void deleteAll(){\r\n\t\thead = null;\r\n\t}", "void removeDrawDetail(Pool pool);", "int deleteByExample(DestinationsExample example);", "public void deleteData()\n {\n SQLiteDatabase db = this.getWritableDatabase();\n db.delete(TABLE_NAME, null, null);\n //context.deleteDatabase(DATABASE_NAME);\n\n }", "public void removeData(String dataName){\r\n this.mData.remove(dataName);\r\n }", "public void deleteAll(UUID accId) {\n txMgr.doInTransaction(() -> {\n Set<UUID> notebooksIds = datasourcesIdx.delete(accId);\n\n datasourceTbl.deleteAll(notebooksIds);\n });\n }", "public void destroy() throws SourceException {\n }", "@Override\r\n\tpublic int deleteByExample(FarmerCreditExample example) {\n\t\treturn farmerCreditDao.deleteByExample(example);\r\n\t}", "public void deletar() {\n\t\tClienteDAO Clientedao = new ClienteDAO();\t\r\n\t\tClientedao.delete(this);\r\n\t\t\r\n\t\tnovoRegistro();\r\n\t\tnotifyObservers();\r\n\t}", "@Override\r\n\tpublic void delete(int id) {\n\t\tconsigMetalDtRepository.delete(id);\r\n\t\t\r\n\t}", "@Override\n\t\t\t\tpublic void rowsDeleted(int firstRow, int endRow) {\n\n\t\t\t\t}", "void unsetValueSampledData();", "public void doDelete ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t// cancel copy if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_COPY_FLAG)))\n\t\t{\n\t\t\tinitCopyContext(state);\n\t\t}\n\n\t\t// cancel move if there is one in progress\n\t\tif(! Boolean.FALSE.toString().equals(state.getAttribute (STATE_MOVE_FLAG)))\n\t\t{\n\t\t\tinitMoveContext(state);\n\t\t}\n\n\t\tParameterParser params = data.getParameters ();\n\n\t\tList Items = (List) state.getAttribute(STATE_DELETE_ITEMS);\n\n\t\t// Vector deleteIds = (Vector) state.getAttribute (STATE_DELETE_IDS);\n\n\t\t// delete the lowest item in the hireachy first\n\t\tHashtable deleteItems = new Hashtable();\n\t\t// String collectionId = (String) state.getAttribute (STATE_COLLECTION_ID);\n\t\tint maxDepth = 0;\n\t\tint depth = 0;\n\n\t\tIterator it = Items.iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tBrowseItem item = (BrowseItem) it.next();\n\t\t\tdepth = ContentHostingService.getDepth(item.getId(), item.getRoot());\n\t\t\tif (depth > maxDepth)\n\t\t\t{\n\t\t\t\tmaxDepth = depth;\n\t\t\t}\n\t\t\tList v = (List) deleteItems.get(new Integer(depth));\n\t\t\tif(v == null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tv.add(item);\n\t\t\tdeleteItems.put(new Integer(depth), v);\n\t\t}\n\n\t\tboolean isCollection = false;\n\t\tfor (int j=maxDepth; j>0; j--)\n\t\t{\n\t\t\tList v = (List) deleteItems.get(new Integer(j));\n\t\t\tif (v==null)\n\t\t\t{\n\t\t\t\tv = new Vector();\n\t\t\t}\n\t\t\tIterator itemIt = v.iterator();\n\t\t\twhile(itemIt.hasNext())\n\t\t\t{\n\t\t\t\tBrowseItem item = (BrowseItem) itemIt.next();\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tif (item.isFolder())\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeCollection(item.getId());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tContentHostingService.removeResource(item.getId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (PermissionException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"notpermis6\") + \" \" + item.getName() + \". \");\n\t\t\t\t}\n\t\t\t\tcatch (IdUnusedException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t}\n\t\t\t\tcatch (TypeException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"wrongtype\"));\n\t\t\t\t}\n\t\t\t\tcatch (ServerOverloadException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t\tcatch (InUseException e)\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"deleteres\") + \" \" + item.getName() + \" \" + rb.getString(\"locked\"));\n\t\t\t\t}// try - catch\n\t\t\t\tcatch(RuntimeException e)\n\t\t\t\t{\n\t\t\t\t\tlogger.debug(\"ResourcesAction.doDelete ***** Unknown Exception ***** \" + e.getMessage());\n\t\t\t\t\taddAlert(state, rb.getString(\"failed\"));\n\t\t\t\t}\n\t\t\t}\t// for\n\n\t\t}\t// for\n\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\t// delete sucessful\n\t\t\tstate.setAttribute (STATE_MODE, MODE_LIST);\n\n\t\t\tif (((String) state.getAttribute (STATE_SELECT_ALL_FLAG)).equals (Boolean.TRUE.toString()))\n\t\t\t{\n\t\t\t\tstate.setAttribute (STATE_SELECT_ALL_FLAG, Boolean.FALSE.toString());\n\t\t\t}\n\n\t\t}\t// if-else\n\n\t}", "private void removeSource(String sourceName) {\n\t\t\n\t}", "public void deleteTableRecords()\n {\n coronaRepository.deleteAll();\n }", "@Override\n\tpublic void delete(Long id) {\n\t\tdiseaseRepository.deleteById(id);\n\t\t\n\t}", "protected void deleteRecord() throws DAOException {\r\n\t\t// Elimina relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\tsedrelcoDao.delete(relco);\r\n\t\t}\r\n\t\t// Elimina objeto\r\n\t\tobjectDao.delete(object);\r\n\t}", "private void Drop(String[]p){\n List<DeputyTableItem> dti;\n dti = Drop1(p);\n for(DeputyTableItem item:dti){\n deputyt.deputyTable.remove(item);\n }\n }", "@Override\r\n\tpublic void deleteSoftDrinkRecord(int sId) {\n\t\ttempList2 = new ArrayList<SoftDrinkBean>();\r\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(original2);\r\n\t\t\tois = new ObjectInputStream(fis);\r\n\t\t\tdrink = (List<SoftDrinkBean>) ois.readObject();\r\n\t\t\tfor (SoftDrinkBean s: drink) {\r\n\t\t\t\tif ( s.getsId()== sId) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttempList2.add(s);\r\n\t\t\t\t}\r\n\t\t\t\tfos = new FileOutputStream(tempFile2);\r\n\t\t\t\toos = new ObjectOutputStream(fos);\r\n\t\t\t\toos.writeObject(tempList2);\r\n\t\t\t\toriginal.delete();\r\n\t\t\t\ttempFile2.renameTo(original2);\r\n\t\t\t}\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t}\r\n\t\tSystem.out.println(\"SoftDrink deleted Successfully\");\r\n\r\n\t}" ]
[ "0.6539361", "0.6259312", "0.61989784", "0.61217004", "0.60785776", "0.6075391", "0.60602194", "0.6048967", "0.5987209", "0.5969715", "0.58158684", "0.5795331", "0.5794519", "0.5789591", "0.57691664", "0.57629937", "0.57522607", "0.5750595", "0.5718705", "0.56921405", "0.5692121", "0.56800056", "0.5673568", "0.5645977", "0.56456363", "0.561114", "0.55995095", "0.55913734", "0.55892545", "0.55864847", "0.5572936", "0.5562806", "0.5556005", "0.55546623", "0.5547285", "0.5516283", "0.5514076", "0.5513487", "0.55001056", "0.5498691", "0.5495555", "0.5487964", "0.5484394", "0.5477653", "0.5472204", "0.5461946", "0.54565394", "0.5455981", "0.54513735", "0.5449956", "0.5445289", "0.54384947", "0.5433686", "0.54215497", "0.54191166", "0.54184455", "0.5414253", "0.5410352", "0.5394493", "0.5393536", "0.53854907", "0.5383021", "0.5383019", "0.53818226", "0.5376498", "0.53736395", "0.5371444", "0.5370565", "0.536893", "0.536893", "0.5365201", "0.53651077", "0.5354337", "0.5353003", "0.5351657", "0.5350778", "0.5350114", "0.53411084", "0.5338731", "0.5334897", "0.53310555", "0.5327334", "0.5325001", "0.5323717", "0.53207994", "0.53168404", "0.53136057", "0.5308655", "0.53048676", "0.5303099", "0.5303083", "0.52983797", "0.5298058", "0.5297332", "0.52950597", "0.5292858", "0.52851933", "0.528387", "0.528127", "0.5280311" ]
0.61379033
3
Checks if the name of the dress is already exist.
@SuppressWarnings("ConstantConditions") @Override public Boolean isNameAlreadyExist(Dress dress) { LOGGER.debug("is name exists - {}", dress); MapSqlParameterSource parameterSource = new MapSqlParameterSource(); if (dress.getDressId() == null) { parameterSource.addValue(DRESS_ID, 0); } else { parameterSource.addValue(DRESS_ID, dress.getDressId()); } parameterSource.addValue(DRESS_NAME, dress.getDressName()); return jdbcTemplate.queryForObject(uniqueNameSql, parameterSource, Integer.class) != 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean isExist(String name) {\n\t\treturn false;\n\t}", "private void ensureNameExists(String name) throws BadFileException {\n\t\tif (name.equals(\"OuterWalls\") || boardItemMap.containsKey(name)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthrow new BadFileException(name + \" name does not exist yet\");\r\n\t}", "public boolean nameAlreadyExists(String name){\n\t\tFileReader r;\n\t\ttry {\n\t\t\tr = new FileReader (\"mapRecords.txt\");\n\t\t\tBufferedReader b = new BufferedReader (r);\n\t\t\tString s=b.readLine();\n\t\t\t\n\t\t\twhile(s!=null){\n\t\t\t\tif(s.equals(name))\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\ts=b.readLine();\n\t\t\t}\n\n\t\t\tr.close();\n\t\t\tb.close();\n\t\t\t\n\t\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found\");\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"Can't read file\");\n\t\t}\n\n\t\treturn false;\n\t\t\n\t}", "private int isDesigNameExist(String desigName) {\n\t\treturn adminServiceRef.isDesigNameExist(desigName);\r\n\t}", "public boolean isDuplicateName(String name) {\n return presenter.isDuplicateName(name);\n }", "public boolean checkName(String name)\n\t{\n\t\treturn (robotHM.containsKey(name));\n\t}", "private boolean checkName(String name) {\n if (!name.equals(\"\")) {\n //Check si le nom est déjà utilisé\n return myDbA.checkName(name);\n }\n return false;\n }", "private boolean validEntry() {\n EditText locationName = (EditText) findViewById(R.id.nameInput);\n\n // Validate required null fields\n if (locationName.getText().toString().trim().equals(\"\"))\n {\n return false;\n }\n\n // Query database to determine if name already exists in database\n String placeName = locationName.getText().toString();\n if (!placeName.equals(currentPlace.name)) {\n try {\n PlacesDB db = new PlacesDB((Context) this);\n SQLiteDatabase pDB = db.openDB();\n Cursor cur = pDB.rawQuery(\"select name from places where name=? ;\", new String[]{placeName});\n if (cur.getCount() > 0) {\n return false;\n }\n } catch (Exception ex) {\n android.util.Log.w(this.getClass().getSimpleName(), \"Unable to load places from database.\");\n }\n }\n return true;\n }", "private boolean checkNameExistAdd(String userName) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private static boolean checkCwpNameExists(String name, Object value) {\r\n\t\tList<?> boIds = QueryUtil.executeQuery(\r\n\t\t\t\t\"select bo.id from \" + Cwp.class.getSimpleName() + \" bo\", null, new FilterParams(\r\n\t\t\t\t\t\tname, value), AhRestoreNewMapTools.getonlyDomain().getId());\r\n\t\treturn !boIds.isEmpty();\r\n\t}", "public boolean checkName(String name)\n {\n return true;\n }", "public static boolean isNameUnique(int ID, String name) throws IOException {\r\n if (pcQD == null) throw new IOException(\"Can't verify new component\");\r\n for (QuickDic qd : pcQD)\r\n if (qd.getID() != ID && qd.getFirstVal().equalsIgnoreCase(name))\r\n return false;\r\n return true;\r\n }", "public boolean existsInstance(String name)\r\n\t{\r\n\t\treturn obtainOntResource(name) != null;\r\n\t}", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "boolean hasName();", "public boolean alreadyExist(String nameRoom) throws SQLException{\n return roomDao.alreadyExist(nameRoom);\n }", "private boolean personAlreadyExists(AddPeopleRequest addPeopleRequest) {\n // query db for this user\n AddPeopleRequest matchingEntry =\n this.addPersonRequestMongoRepository\n .findPersonByFirstAndLastName(\n addPeopleRequest.getFirstName(),\n addPeopleRequest.getLastName());\n // if the value returned is null.. the value did not exist..\n if (matchingEntry == null) {\n return false;\n } else {\n return true;\n }\n }", "@Override\r\n\tpublic boolean isExist() {\n\t\treturn false;\r\n\t}", "private static boolean checkDuplicateDocName(User user, String name) {\n\n\t\t// Check if document name is already in user's documents\n\t\tboolean isInvalid = false;\n\n\t\tfor(@SuppressWarnings(\"unchecked\")\n\t\tIterator<Document> iter = user.getDocumentList().iterator(); iter.hasNext(); ) {\n\t\t\tDocument doc = iter.next();\n\t\t\tif(doc.getDocName().equals(name)) {\n\t\t\t\tisInvalid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isInvalid;\n\t}", "public boolean isSetUniqueName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(UNIQUENAME$10) != 0;\r\n }\r\n }", "public boolean exists(String name) throws IOException;", "public boolean exsitName(String name) {\n\t\tKynamic kynamic = this.kynamicDao.getKynamicByName(name);\r\n\t\treturn kynamic!=null?true:false;\r\n\t}", "public static boolean isDapartmentNameDuplicated(ObservableList<Department> deList, String name, int size) {\n\n for (int i = 0; i < size; i++) {\n if (deList.get(i).getName().equals(name)) {\n\n return true;\n }\n }\n return false;\n }", "public Boolean Exist(String name)\n\t{\n\t\tBoolean res = false;\n\n\t\tint f = this.FindByName(name);\n\n\t\tif (f == -1)\n\t\t{\n\t\t\tres = false;\n\t\t} else\n\t\t{\n\t\t\tres = true;\n\t\t}\n\n\t\treturn res;\n\t}", "public boolean isExisted(String addressId) {\n //check if this address is already existed.\n return true;\n }", "public boolean hasUniqueName(final long id, final String name) {\n Map<String, Object> params = new HashMap<>();\n params.put(\"id\", id);\n params.put(\"name\", name);\n List<Tariff> resultList = tariffDao.getQueryResult(Tariff.HAS_UNIQUE_NAME, Tariff.class, params);\n if (resultList.isEmpty()) {\n return true;\n }\n return false;\n }", "boolean existsByName(String name);", "boolean nameExists(Key name);", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$8) != 0;\n }\n }", "public static boolean exists(String kingdomName) {\n try {\n java.sql.PreparedStatement s = QuartzKingdoms.DBKing.prepareStatement(\"SELECT * FROM Kingdoms WHERE KingdomName=?;\");\n s.setString(1, kingdomName);\n ResultSet res2 = s.executeQuery();\n if (res2.next()) {\n return true;\n } else {\n return false;\n }\n } catch (SQLException e) {\n e.printStackTrace();\n return false;\n }\n }", "private boolean isNameUnique(String name) {\n boolean isUnique = true;\n for (User user : this.users) {\n if (user.getName().equals(name)) {\n isUnique = false;\n break;\n }\n }\n return isUnique;\n }", "boolean hasDame();", "private boolean isContactExist(String name) {\n boolean existance;\n existance = contactList.stream()\n .anyMatch(personElement ->\n personElement.getFirstName().equals(name) ||\n personElement.getLastName().equals(name));\n return existance;\n }", "public void verifyToDoNotExist(String todoName) {\n try {\n getLogger().info(\"Verify deleted todo: \" + todoName);\n boolean isExisted = false;\n for (int i = 0; i < eleToDoNameRow.size(); i++) {\n if (todoName.equals(getTextByAttributeValue(eleToDoNameRow.get(i), \"Todo expected not Exist\"))) {\n AbstractService.sStatusCnt++;\n NXGReports.addStep(\"Fail: Todo still existed: \" + todoName, LogAs.FAILED,\n new CaptureScreen(CaptureScreen.ScreenshotOf.BROWSER_PAGE));\n isExisted = true;\n }\n }\n if (!isExisted) {\n NXGReports.addStep(\"Todo deleted success\", LogAs.PASSED, null);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public static void checkNameExist(String name, UserProfile userProfile) throws PlaylistExceptions {\n for (String log : userProfile.getPlaylistNames()) {\n if (name.equals(log)) {\n throw new PlaylistExceptions(\"ohno u already have a playlist with the same name :( \"\n + \"pls try again with another name for this playlist\");\n }\n }\n }", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "public boolean isSetName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(NAME$0) != 0;\n }\n }", "private boolean isExist(String name, Date date) {\n\t\t\n\t\tString sql = \"SELECT * from `expenses` WHERE Name='\"+name+\"' AND Date='\"+date+\"';\";\n\t\tResultSet rs = this.queryHandler.executeQuery(sql);\n\t\ttry {\n\t\t\tboolean exist = false;\n\t\t\twhile(rs.next()) {\n\t\t\t\texist = true;\n\t\t\t}\n\t\t\treturn exist;\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.queryHandler.close();\n\t\treturn false;\n\t}", "public boolean isInsert(String name){\n Cursor a = db.query(TABLE_NAME,new String[]{NAME}, NAME + \" LIKE \\\"\" + name + \"\\\"\",null,null,null, null);\n\n if (a.getCount() == 0){\n return false;\n }else{\n return true;\n }\n }", "public boolean isExisting() throws Exception\r\n\t\t{\r\n\t\tRouteGroup myR = (RouteGroup) myRouteGroup.get();\r\n\t\tthis.UUID = myR.getUUID();\r\n\t\t\r\n\t\tVariables.getLogger().debug(\"Item \"+this.name+\" already exist in the CUCM\");\r\n\t\treturn true;\r\n\t\t}", "public abstract boolean doesExist();", "public boolean addName(String name) {\n\t\tboolean resultOK = false;\n\t\tPreparedStatement ps = null;\n\t\ttry{\n\t\t\tString responces = \"insert into responses values(?, null, null, null, null)\";\n\t\t\tps = conn.prepareStatement(responces);\n\t\t\tps.setString(1, name);\n\t\t ps.executeUpdate(); \n\t\t resultOK = true;\n\t\t ps.close();\n\t\t} catch (SQLException e) {\n\t\t resultOK = false; // one reason may be that the name is already in the database\n\t\t if(e.getErrorCode()==1062 && e.getSQLState().equals(\"23000\")){ \n\t\t \t// duplicate key error\n\t\t \t// System.out.println(name + \" already exists in the database\");\n\t\t } else {\n\t\t\t\tprintSqlError(e);\n\t\t }\n\t\t} finally {\n\t\t\tif(ps != null){\n\t\t\t\ttry {\n\t\t\t\t\tps.close();\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\tprintSqlError(e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn resultOK;\n\t}", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(NAME$0) != 0;\r\n }\r\n }", "@Test\n\tpublic void IscaseNameExist(){\n\t\tString caseName = \"leather case\";\n\t\tboolean isExist;\n\t\ttry {\n\t\t\tisExist = CaseManagerValidator.isCaseNameExist(caseName);\n\t\t\tassertTrue(isExist);\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\t\n\t}", "public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}", "private boolean isNameValid(String name) {\n\n }", "private boolean moreProfileExists(String name) {\n \tdb = dbHelper.getReadableDatabase();\n\t Cursor cursor = db.query(DbContract.MoreEntry.TN, DbContract.MoreEntry.allColumns, DbContract.MoreEntry.CN_NAME + \" = '\" + name + \"'\", null, null, null, null);\n cursor.moveToFirst();\n if (cursor.getCount() == 0 || cursor.getString(1) == null){\n \tcursor.close();\n \treturn false;\n } \n cursor.close();\n return true;\n\t}", "boolean hasDataName();", "@Test\n\tpublic void testAddTheNotUniqueNameOfRecipe() {\n\t\tcoffeeMaker.addRecipe(recipe1);\n\t\tassertFalse(coffeeMaker.addRecipe(recipe1));\n\t}", "public boolean checkIfNameExists(String name) {\n String[] projection = {\n MediaStore.Audio.Playlists._ID,\n MediaStore.Audio.Playlists.NAME\n };\n\n String selection = MediaStore.Audio.Playlists.NAME + \" = ? \";\n String[] selectionArgs = {\n name\n };\n\n Cursor cursor = getContentResolver().query(\n MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,\n projection,\n selection,\n selectionArgs,\n null);\n\n // id is the ID of the playlist that is found to have the same name as the new name, if no\n // playlist if found for this name, id = -1\n int id = -1;\n\n if (cursor != null) {\n cursor.moveToFirst();\n if (!cursor.isAfterLast()) {\n id = cursor.getInt(0);\n }\n }\n cursor.close();\n\n if (id == -1) {\n return false;\n } else {\n return true;\n }\n\n }", "public boolean verificaUnicidadeNome() {\n\t\tif(!EntidadesDAO.existeNome(entidades.getNome())) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean check_ab_exist(String ab_name){\n if(ab_store.get(ab_name) != null)\n return true;\n else\n return false;\n }", "public boolean isExistant(Noeud noeud)\t{\r\n \treturn noeud != null && noeuds.containsValue(noeud);\r\n }", "public void NoGodHasSuchName() {\n notifyGodNotCorrect(this.getCurrentTurn().getCurrentPlayer().getNickname(), availableGods, chosenGodList);\n }", "public boolean checkUserNameIsOccupied(String name) {\n \t\tif (users.size() != 0) {\n \t\t\tfor (int i = 0; i < users.size(); i++) {\n \t\t\t\tif (name.equals(users.get(i).getName())) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}", "private boolean exists(String pathName)\n {\n if(new File(pathName).exists())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "private void validateTruthExists(long attrId) throws NameSystemException {\n DbTruth dbTruth = getTruthDAO().get(attrId);\n if (dbTruth == null) {\n //TODO: Need log entry to bring up to current logging standard\n throw new NameDataException(getMessage(\"attr.08.not_found\", attrId));\n }\n }", "public boolean joueurExiste(String nomJoueur) {\n\t\treturn stats.containsKey(nomJoueur);\n\t}", "public boolean exist() {\n\t\treturn false;\n\t}", "public boolean deckExists(String name)\n {\n return deckStore.exists(name);\n }", "static public boolean isSanitaryName(String name) {\n return sanitizeName(name).equals(name);\n }", "private boolean validTitle(String targetTitle) {\n Query q = new Query(\"Location\").setFilter(new FilterPredicate(\"title\", FilterOperator.EQUAL,\n targetTitle));\n int numOfSameEntities = ds.prepare(q).countEntities();\n return (numOfSameEntities == 0);\n }", "private boolean isAlreadyExist(String name, String extension) {\n if (extension.equals(\"\")) {\n if (isSameNameExist(tree.getRoot(), name, true, extension)) {\n SC.warn(\"Folder is already exist\");\n if (\"yellow\".equals(leftLayout.getBackgroundColor())) {\n leftLayout.setBackgroundColor(\"white\");\n }\n return true;\n }\n } else {\n if (isSameNameExist(tree.getRoot(), name, false, extension)) {\n SC.warn(\"File is already exist\");\n if (\"yellow\".equals(leftLayout.getBackgroundColor())) {\n leftLayout.setBackgroundColor(\"white\");\n }\n return true;\n }\n }\n return false;\n }", "public Boolean addEntry(NameSurferEntry entry) {\r\n\t\tint index = indexOfNameSurfer(entry.getName());\r\n\t\t/* Prevent from adding a same name multiple times */\r\n\t\tif(index < 0) {\r\n\t\t\tnameInGraph.add(entry);\r\n\t\t\tnameColor.add(generateColor());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean checkDupplicate(UUID sessionId) throws DuplicateUsernameException {\n return ioListeners.containsKey(sessionId);\n }", "private void validateCanDeleteName(long truthSetId) throws NameSystemException {\n DbTruthSet dbTruthSet = getTruthSetDAO().get(truthSetId);\n if (dbTruthSet == null) {\n throw new NameDataException(getMessage(\"name.05.not_found\", truthSetId));\n }\n\n List<DbTruth> dbAttrs = getTruthDAO().getByNameId(truthSetId);\n if (dbAttrs != null && dbAttrs.size() > 0) {\n //TODO: Need log entry to bring up to current logging standard\n throw new NameDataException(getMessage(\"name.06.has_attr\", truthSetId));\n }\n }", "public boolean isNamed(String n) {\n return name.equals(n);\n }", "boolean isNameRequired();", "public boolean noDogsOfName(String name){\n boolean noDogsOfName = true;\n for(Dog d : dogs){\n if(d.getName().equals(name)){\n noDogsOfName = false;\n break;\n }\n }\n return noDogsOfName;\n }", "public boolean saucerExist(String name){\r\n if(findSaucerByName(name) != -1){\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public boolean checkPuNameCollisions(Log logger,String puName){\n PUNameCollision p = _puNameCollisions.get(puName);\n if (p != null){\n p.logCollision(logger);\n return true;\n }\n return false;\n }", "public void addPerson(String name){\n Person newPerson = new Person(name,this.x1,this.x2);\n for(Person p : personList){\n if(p.equals(newPerson)){\n System.out.println(\"Error! The person already exists.\");\n }\n }\n personList.add(newPerson);\n }", "private static boolean duplicateSetName(String setName){\n boolean duplicate = false;\n for (Set set : SetManager.getInstance().getSets()) {\n if (set.getName() != null) {\n if (set.getName().equals(setName)) {\n duplicate = true;\n }\n }\n }\n return duplicate;\n }", "private boolean doesDoctorExist(HashMap<String,String> data) {\n ArrayList<String> doctorsFields = doctorFields();\n //check each field against the database\n for (String field : doctorsFields){\n //if one of the doctors does not exists in the database - return false\n //TODO - For prototype we assume only one country exists - for later versions probably a country will also have to integrated ito this method\n if(!dbController.doesDoctorExists(data.get(field))){\n return false;\n }\n }\n //all doctors exist - return true\n return true;\n }", "public boolean hasError(String name) {\n\t\treturn errors.containsKey(name);\n\t}", "@Deprecated\n boolean checkNameExistence(String documentName) throws NonUniqueResultException;", "private void checkNameValidation(String name) throws noStudentNameException{\n\t\tif (name.isEmpty()){\n\t\t\tthrow new noStudentNameException(\"Student Name Cannot be Empty!\");\n\t\t}\n\t}", "public boolean isSetName()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().find_attribute_user(NAME$2) != null;\r\n }\r\n }", "public boolean existsHost(String name)\n {\n try\n {\n return (lookup(name)!=null); \n }\n catch (UnknownHostException e)\n {\n return false; \n }\n }" ]
[ "0.691964", "0.64166975", "0.63755417", "0.6325582", "0.6276639", "0.62439364", "0.61373645", "0.61316764", "0.61255187", "0.60420495", "0.60405946", "0.60381776", "0.6022024", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.60172707", "0.5998868", "0.5993218", "0.5981476", "0.5953596", "0.59522945", "0.5949511", "0.59190404", "0.59051895", "0.5884079", "0.5857173", "0.58491814", "0.58373183", "0.57975876", "0.5755824", "0.57479733", "0.5743664", "0.5729344", "0.5726903", "0.5714828", "0.57065845", "0.5704406", "0.5704406", "0.5703087", "0.56843495", "0.5662789", "0.565381", "0.5641131", "0.56251436", "0.56204456", "0.56148607", "0.56078833", "0.56076294", "0.56064945", "0.5606446", "0.55997473", "0.55943286", "0.55838585", "0.5572773", "0.5568991", "0.5555304", "0.5553415", "0.5542675", "0.55401826", "0.55393183", "0.55389297", "0.5525836", "0.55119747", "0.55032253", "0.5500401", "0.54994863", "0.5493273", "0.54777086", "0.54657334", "0.54653794", "0.54594064", "0.5455524", "0.5451115", "0.54500914", "0.54494745", "0.54450554", "0.54381704", "0.5436364", "0.5431928", "0.54244214" ]
0.7764639
0
Checks if the dress with a given ID has orders.
@SuppressWarnings("ConstantConditions") @Override public Boolean isDressHasRents(Integer dressId) { LOGGER.debug("is dress id={} has rents", dressId); return jdbcTemplate.queryForObject(dressOrdersSql, new MapSqlParameterSource(DRESS_ID, dressId), Integer.class) > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean checkOrderNotAcceptedYet(int idOrder);", "public boolean isExists(String orderId);", "boolean hasOrderId();", "boolean hasOrderId();", "public boolean isRunningOrderExist(int iID){\n\t\treturn hmRunningOrder.containsKey(iID);\n\t}", "public boolean isExecutedOrderExist(int iID){\n\t\treturn hmExecutedOrder.containsKey(iID);\n\t}", "boolean hasID(int id) {\r\n for (Customer customer : customers) {\r\n if (customer != null && customer.getID() == id) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean orderNumberUnique(int id, ArrayList<Order> orders){\n\t\t\tint count = 0;\n\t\t\tfor(Order i : orders){\n\t\t\t\tif(i.getOrderUniqueId() == id){\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count>=1)\n\t\t\t\treturn false;\n\t\t\telse \n\t\t\t\treturn true;\n\t\t\t\n\t\t}", "public boolean isPossible(Order order) {\n for (DishWrapper dishWrapper : order.getItems()) {\n for (Ingredient ingredient : dishWrapper.getDish().getIngredients()) {\n if (dishWrapper.getAmount() * ingredient.getAmount() > stock.get(stock.indexOf(ingredient)).getAmount()) {\n return false;\n }\n }\n }\n return true;\n }", "public boolean isCancelledOrderExist(int iID){\n\t\treturn hmCancelledOrder.containsKey(iID);\n\t}", "boolean isOrderCertain();", "public boolean isSetOrders() {\n return this.orders != null;\n }", "boolean hasOrderPersonId();", "@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Order)) {\n return false;\n }\n return id != null && id.equals(((Order) o).id);\n }", "public boolean checkIfIdExists(int id) {\n return bidListRep.existsById(id);\n }", "private static boolean checkOrderList() {\n if (size != MainGUI.orderList.size()) {\n size = MainGUI.orderList.size();\n return true;\n }\n\n return false;\n }", "public Boolean deleteOrder(String idOrder) {\n\n\t\tOrderDetails od = new OrderDetails();\n\t\tod.deleteAllOrderDetails(idOrder);\n\n\t\ttry {\n\t\t\tString sql = \"DELETE FROM restodb.order WHERE idorder = \" + idOrder;\n\t\t\tjava.sql.PreparedStatement statement = mysqlConnect.connect().prepareStatement(sql);\n\n\t\t\tint x = statement.executeUpdate(sql);\n\n\t\t\tif (x > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tmysqlConnect.disconnect();\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean checkDating(int id);", "public boolean IDUsed(int id){\n for (int i = 0 ; i< IDList.size();i++){\n if (IDList.get(i) == id){\n return true;\n }\n }\n return false;\n }", "public boolean placeOrder(int pId) {\n\t\tboolean orderFulfilled = false;\n\n\t\tProduct product = new Product();\n\t\t//checks if product is available\n\t\tif (InventoryService.isAvailable(product)) {\n\t\t\tlogger.info(\"Product with ID: {} is available.\", product.getId());\n\t\t\t//paying service\n\t\t\tboolean paymentConfirmed = PaymentService.makePayment();\n\n\t\t\tif (paymentConfirmed) {\n\t\t\t\tlogger.info(\"Payment confirmed...\");\n\t\t\t\t//shipping service\n\t\t\t\tShippingService.shipProduct(product);\n\t\t\t\tlogger.info(\"Product shipped...\");\n\t\t\t\torderFulfilled = true;\n\t\t\t}\n\n\t\t}\n\t\treturn orderFulfilled;\n\t}", "public boolean hasOrderPersonId() {\n return orderPersonId_ != null;\n }", "public boolean checkId(String id){\r\n\t\treturn motorCycleDao.checkId(id);\r\n\t}", "public static boolean findLimitOrder(List<LimitOrder> orders, LimitOrder order, String id) {\n boolean found = false;\n\n for (LimitOrder openOrder : orders) {\n if (openOrder.getId().equalsIgnoreCase(id)) {\n if (order.getCurrencyPair().equals(openOrder.getCurrencyPair()) &&\n (order.getTradableAmount().compareTo(openOrder.getTradableAmount()) == 0) &&\n (order.getLimitPrice().compareTo(openOrder.getLimitPrice()) == 0)) {\n found = true;\n }\n }\n }\n\n return found;\n }", "@Override\r\n\tpublic boolean delOrder(int id) {\n\t\treturn adi.delOrder(id);\r\n\t}", "public Boolean checkHouseWithId(){\n\t\t\tif(removeHouse == null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Order)) {\n return false;\n }\n Order other = (Order) object;\n if ((this.orderID == null && other.orderID != null) || (this.orderID != null && !this.orderID.equals(other.orderID))) {\n return false;\n }\n return true;\n }", "boolean hasMoneyID();", "boolean hasMoneyID();", "boolean hasMoneyID();", "private boolean userHasOrder(LogicFacade logic, User user) throws LegoCustomException {\r\n ArrayList<HouseOrder> orders = logic.getAllOrdersByUser(user.getId());\r\n boolean hasOrder = false;\r\n for (HouseOrder houseOrder : orders) {\r\n hasOrder = (houseOrder.getUserID() == user.getId());\r\n }\r\n return hasOrder;\r\n }", "boolean isOrderable();", "@Test\n public void getOrderByIdTest() {\n Long orderId = 10L;\n Order response = api.getOrderById(orderId);\n Assert.assertNotNull(response);\n Assert.assertEquals(10L, response.getId().longValue());\n Assert.assertEquals(10L, response.getPetId().longValue());\n Assert.assertEquals(1, response.getQuantity().intValue());\n\n verify(exactly(1), getRequestedFor(urlEqualTo(\"/store/order/10\")));\n }", "boolean hasOrderDate();", "public static boolean collectOrder(int foodItemNumber) {\n\t\tif (!checkStatus((foodItemNumber))) {\n\t\t\tRandom r = new Random();\n\t\t\tSystem.out.println(\"Sorry this \" + Menu.getDishName(foodItemNumber)\n\t\t\t\t\t+ \" is unavailable, Check our top other dishes \" + Menu.getDishName(r.nextInt(18) + 1));\n\t\t\treturn false;\n\t\t} else {\n\t\t\torder.add(foodItemNumber); // if there is availability we add the foodItemNumber in Order ArrayList.\n\t\t}\n\t\treturn true;\n\n\t}", "private boolean checkIdentity(Order otherOrder) {\n\t\treturn getId() != otherOrder.getId();\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Corder)) {\n return false;\n }\n Corder other = (Corder) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "boolean deleteOrder(long orderId);", "public boolean checkExistenceId(int id) {\n\t\tfor (int i=0; i<getDataLength(); i++) {\n\t\t\tif (this.dataList.get(i).getId()==id)\n\t\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean hasOrderPersonId() {\n return orderPersonIdBuilder_ != null || orderPersonId_ != null;\n }", "void acceptOrd(final int vId) {\r\n Orders emp = OrdersFactory.getvalidateOrders();\r\n if (emp != null) {\r\n showPlacedOrders(vId);\r\n System.out.println(\"Enter the Order ID to Accept :\");\r\n int ordid = option.nextInt();\r\n int val = OrdersFactory.acceptOrders(ordid);\r\n System.out.println(\"Succes value is :\" + val);\r\n if (val == 1) {\r\n System.out.println(\"Accepted the Order\");\r\n return;\r\n }\r\n } else {\r\n System.out.println(\"---------No Placed Orders---------\");\r\n return;\r\n }\r\n }", "boolean hasDependencyRelation(int parentID, int childID){\n if (parentID < 0 || parentID >= size_)\n throw new IllegalArgumentException(\"the parent ID is out of range.\");\n if (childID < 0 || childID >= size_)\n throw new IllegalArgumentException(\"the child ID is out of range.\");\n\n return nodes_[childID].parent_ == parentID;\n }", "public boolean isExisted(String addressId) {\n //check if this address is already existed.\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof PurchaseOrder)) {\n return false;\n }\n PurchaseOrder other = (PurchaseOrder) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public boolean hasDependencies(int pk) {\n return (employeeDao.select(pk).getSubordinate() != null);\n }", "public Boolean dealWith(Order otherOrder) {\n\t\treturn checkIdentity(otherOrder) && checkVolume(otherOrder) && checkPrice(otherOrder);\n\t}", "boolean hasOrderSize();", "public boolean orderConfirm(int id) {\n\t\ttry {\n\t\t\tConnection conn=DB.getConn();\n\t\t\tPreparedStatement stmt=conn.prepareStatement(\"update orders set status='confirm' where id=?\");\n\t\t\tstmt.setInt(1,id);\n\t\t\tstmt.executeUpdate();\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public final boolean hasAuraResult(int id) {\n\t\treturn auramap.containsKey(id);\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Orderdet)) {\r\n return false;\r\n }\r\n Orderdet other = (Orderdet) object;\r\n if ((this.orderid == null && other.orderid != null) || (this.orderid != null && !this.orderid.equals(other.orderid))) {\r\n return false;\r\n }\r\n return true;\r\n }", "public boolean existenTrasladosAsociadosDeposito(Long idDiposit, Boolean valid) throws InfrastructureException {\r\n\t\tList traslado;\r\n\t\ttry {\r\n\t\t\tlogger.debug(\"existenTrasladosAsociadosDeposito ini\");\r\n\t\t\tString q = \"select count(dip.id) from Diposit dip \" +\r\n\t\t\t\"where dip.id = \" + idDiposit + \" and \" +\r\n\t\t\t\"dip in (select elements(tdi.diposits) from Trasllat tdi where 1 = 1 and tdi.esDiposit = true \";\r\n\t\t\tif (valid != null && valid.booleanValue()) q += \" and tdi.valid = true \";\r\n\t\t\tif (valid != null && !valid.booleanValue()) q += \" and tdi.valid = false \";\r\n\t\t\tq += \")\";\r\n\t\t\ttraslado = getHibernateTemplate().find(q);\r\n\t\t} catch (HibernateException ex) {\r\n\t\t\tlogger.error(\"existenTrasladosAsociadosDeposito failed\", ex);\r\n\t\t\tthrow new InfrastructureException(ex);\r\n\t\t}\r\n\t\tif (traslado != null && traslado.size()> 0 && ((Long)traslado.get(0)).intValue() > 0) {\r\n\t\t\tlogger.debug(\"existenTrasladosAsociadosDeposito fin\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tlogger.debug(\"existenTrasladosAsociadosDeposito fin\");\r\n\t\treturn false;\r\n\t}", "public boolean hasOrderId() {\n return ((bitField0_ & 0x00002000) == 0x00002000);\n }", "public boolean existsById(Integer id) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic int checkEditDuplicate(String checkProductionOrderNo, String id) {\n\t\tint list1 = 0;\r\n\t\ttry {\r\n\t\t\tlist1 = productionOrderProcessDao.checkEditDuplicate(checkProductionOrderNo, id);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\t\treturn list1;\r\n\t}", "public boolean checkDocementExist(int custid, String docname) {\n\t\treturn dao.checkDocementExist(custid, docname);\n\t}", "boolean checkForUnfinishedOrders (int userId) throws ServiceException;", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof WoodOrder)) {\n return false;\n }\n WoodOrder other = (WoodOrder) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "public Boolean existInvoice(int id_drain) throws NotFoundDBException, SQLException {\n String sql = \"SELECT COUNT(*) AS tot FROM invoice where id_drain=? AND active=1\";\r\n String[] pars = new String[1];\r\n pars[0] = \"\" + id_drain;\r\n ResultSet rs = this.db.PreparedStatement(sql, pars);\r\n int occ = 0;\r\n while (rs.next()) {\r\n occ = rs.getInt(\"tot\");\r\n }\r\n if (occ > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public boolean hasOrderId() {\n return ((bitField0_ & 0x00002000) == 0x00002000);\n }", "public synchronized void checkTooLateToCancel(String orderId) throws InvalidDataException, OrderNotFoundException {\n\t\tif (orderId == null || orderId.isEmpty()) throw new InvalidDataException(\"The order id cannot be null.\");\n\t\tIterator<Price> priceIterator = getOldEntries().keySet().iterator();\n\t\tboolean found = false;\n\t\twhile (priceIterator.hasNext() && !found) {\n\t\t\tArrayList<Tradable> trades = getOldEntries().get(priceIterator.next());\n\t\t\tIterator<Tradable> tradeIterator = trades.iterator();\n\t\t\twhile (tradeIterator.hasNext() && !found) {\n\t\t\t\tTradable nextTrade = tradeIterator.next();\n\t\t\t\tif (nextTrade.getId().equals(orderId)) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tCancelMessage cm = makeCancelMessage(nextTrade,\"Too Late to Cancel\");\n\t\t\t\t\tMessagePublisher.getInstance().publishCancel(cm);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!found) throw new OrderNotFoundException(\"The requested order could not be found.\");\n\t}", "public String checkOrder(ArrayList<ArrayList<Furniture>> orders, boolean gui){\n ArrayList<ArrayList<Furniture>> last = new ArrayList<ArrayList<Furniture>>();\n // if the amount requested is larger than the amount of valid orders found then the request fails\n if(getRequestNum() > orders.size()){\n return printOutputFail(gui);\n }else{\n for(int i = 0; i < getRequestNum(); i++){\n last.add(orders.get(i));\n }\n deleteOrders(last);\n return printOutput(last, gui);\n }\n }", "boolean hasTruckId();", "public boolean checkWhetherOrderValid(NewOrder o) {\n\t\tboolean atLeastOneCheckBox = false;\n\t\tboolean someTextEntered = false;\n\t\tfor (CheckBox cb : o.getBoxes()) {\n\t\t\tif (cb.isSelected()) {\n\t\t\t\tatLeastOneCheckBox = true;\n\t\t\t}\n\t\t}\n\t\tif (!o.getTickNo().getText().isEmpty()) {\n\t\t\t//Check that the number being entered is actually a number\n\t\t\tif (removeSpecialCharactersSetToInt(o.getTickNo().getText()) != -1) {\n\t\t\t\tsomeTextEntered = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (atLeastOneCheckBox && someTextEntered) {\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof CustomerOrder)) {\n return false;\n }\n CustomerOrder other = (CustomerOrder) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof MyOrder)) {\n return false;\n }\n MyOrder other = (MyOrder) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic List<OrderDetailsEntity> findBuyOrderId(Long id) {\n\t\treturn oderDet.findAllBuyOrderId(id);\n\t}", "public boolean exists(String id);", "public boolean doesIDExist(String id)\n {\n return idReferences.containsKey(id);\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Purchaseorder)) {\n return false;\n }\n Purchaseorder other = (Purchaseorder) object;\n if ((this.purchaseOrderID == null && other.purchaseOrderID != null) || (this.purchaseOrderID != null && !this.purchaseOrderID.equals(other.purchaseOrderID))) {\n return false;\n }\n return true;\n }", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof OrderSpare)) {\n return false;\n }\n OrderSpare other = (OrderSpare) object;\n if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n return false;\n }\n return true;\n }", "@Override\n\tpublic boolean equals(Object object) {\n\t\tif (!(object instanceof Storyorder)) {\n\t\t\treturn false;\n\t\t}\n\t\tStoryorder other = (Storyorder) object;\n\t\tif ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean exists(String id){\n return eventIdsList.contains(id);\n }", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "boolean hasID();", "public boolean checkIfAuthor(int paperId, HashMap<Integer,Integer> authorsOrder) throws DLException {\n\t\tboolean isAuthor=false;\n\t\tfor(int order: authorsOrder.keySet()) {\n\t\t\tif(currentUser.getUserId()==authorsOrder.get(order)) {\n\t\t\t\tisAuthor=true;\n\t\t\t}\n\t\t}\n\t\treturn isAuthor;\n\t}", "public boolean isValidOrderId(String pOrderId, String pSiteId) throws RepositoryException{\n MutableRepository rep = getOrderRepository();\n RepositoryItem it = rep.getItem(pOrderId, ORDER_PARAMETER);\n if (it != null) {\n String siteId = it.getPropertyValue(SITE_ID_PARAMETER).toString();\n if ((siteId != null) && (siteId.contains(pSiteId))) {\n return true;\n }\n }\n return false;\n }", "private boolean checkDoors(ArrayList<Door> doors, int direction) {\n\t\tboolean stopSeaching = false;\n\t\tboolean found = false;\n\t\tfor (int i = 0; i < doors.size() && !stopSeaching; i++) {\n\t\t\tstopSeaching = doors.get(i).isInRange(player.pos);\n\t\t\tif (stopSeaching) {\n\t\t\t\tfound = checkDoor(doors.get(i), direction);\n\t\t\t}\n\t\t}\n\t\treturn found;\n\t}", "public boolean checkAllToDoIsDelete() {\n if (!checkListIsEmpty(eleToDoRowList) || !checkListIsEmpty(eleToDoCompleteRowList)) {\n return false;\n }\n return true;\n }", "public boolean exists(String id) {\n\t\treturn false;\n\t}", "public boolean harGods(int godsId) {\n return finnGods(godsId) != null;\n }", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "boolean hasTruckid();", "public boolean exists( Integer idConge ) ;", "public static ru.terralink.mvideo.sap.Orders load(long id)\n {\n return (ru.terralink.mvideo.sap.Orders)(DELEGATE.load(id));\n }", "public boolean checkHotelPresent(int hotelId);", "@Override\n\tpublic boolean existsById(Integer id) {\n\t\treturn false;\n\t}", "public boolean checkRowIsDeleteOutOfToDoList(List<WebElement> eleList, String idRow) {\n int totalRows = eleList.size();\n for (int i = 0; i < totalRows; i++) {\n if (eleList.get(i).getAttribute(\"data-id\").equals(idRow))\n return false;\n }\n return true;\n }", "private boolean validateOrder() {\n\t\t// players with no id\n\t\tList<String> playersNoId = new ArrayList<>();\n\t\tList<ChesspairingPlayer> players = mTournament.getPlayers();\n\t\tfor (ChesspairingPlayer player : players) {\n\t\t\tif (player.getInitialOrderId() <= 0) {\n\t\t\t\tplayersNoId.add(player.getName());\n\t\t\t}\n\t\t}\n\t\tif (playersNoId.size() > 0) {\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tsb.append(\"You have players with no initialOrderId: \");\n\t\t\tfor (String name : playersNoId) {\n\t\t\t\tsb.append(name + \", \");//\n\t\t\t}\n\t\t\tint id = sb.lastIndexOf(\", \");\n\t\t\tsb.replace(id, sb.length(), \"\");\n\t\t\tPairingSummary parringSummary = new PairingSummary();\n\t\t\tparringSummary.setShortMessage(PairingSummary.PARRING_NOT_OK);\n\t\t\tparringSummary.setLongMessage(sb.toString());\n\t\t\tmTournament.setParringSummary(parringSummary);\n\t\t\treturn false;\n\t\t}\n\n\t\t// players with the same id\n\t\tMap<Integer, ChesspairingPlayer> map = new HashMap<>();\n\t\tfor (ChesspairingPlayer player : players) {\n\t\t\tif (map.containsKey(player.getInitialOrderId())) {\n\t\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\t\tsb.append(\"You have players with the same initialOrderId: \");\n\t\t\t\tsb.append(map.get(player.getInitialOrderId()).getName() + \" and \");\n\t\t\t\tsb.append(player.getName());\n\t\t\t\tPairingSummary parringSummary = new PairingSummary();\n\t\t\t\tparringSummary.setShortMessage(PairingSummary.PARRING_NOT_OK);\n\t\t\t\tparringSummary.setLongMessage(sb.toString());\n\t\t\t\tmTournament.setParringSummary(parringSummary);\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tmap.put(player.getInitialOrderId(), player);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean hasQuestID();", "boolean hasQuestID();" ]
[ "0.71365064", "0.69322294", "0.64809114", "0.64809114", "0.6371883", "0.63213617", "0.63198686", "0.61036986", "0.6038921", "0.6034458", "0.6023731", "0.5940864", "0.58500993", "0.5810251", "0.57568944", "0.5743764", "0.57293606", "0.57041353", "0.57003975", "0.5635387", "0.5633101", "0.5619122", "0.56173193", "0.56146866", "0.5610822", "0.55958104", "0.55598176", "0.55598176", "0.55598176", "0.5555114", "0.5541304", "0.55175656", "0.55093545", "0.5471254", "0.54572046", "0.5422505", "0.5404381", "0.5404312", "0.5385732", "0.53770983", "0.53406423", "0.5319481", "0.5313218", "0.53010595", "0.52895004", "0.52727956", "0.52719194", "0.52716666", "0.5271275", "0.52642566", "0.526374", "0.52626264", "0.52613646", "0.52608293", "0.5256116", "0.5252774", "0.5252654", "0.52482903", "0.52418435", "0.52240145", "0.5221511", "0.5219807", "0.52179503", "0.52154225", "0.5201721", "0.5193107", "0.51833117", "0.518001", "0.51769584", "0.5176464", "0.51729876", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5170927", "0.5165175", "0.51556295", "0.5148464", "0.51459676", "0.5136804", "0.51261306", "0.51167506", "0.51167506", "0.51167506", "0.51167506", "0.51167506", "0.51167506", "0.51131755", "0.5112968", "0.5105474", "0.50942796", "0.50925833", "0.5067719", "0.5061341", "0.5061341" ]
0.62758034
7
Use Jama package to invert matrix.
public Driver(){ this.D = Parameters.numberOfDocuments; this.K = Parameters.numberOfTopics; this.V = Parameters.sizeOfVocabulary; this.oldAlpha = new double[this.K]; this.newAlpha = new double[this.K]; this.hessian = new double[this.K][this.K]; this.gradient = new double[this.K]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JamMatrix invert() {\n RealMatrix apacheUT = decomposition.getUT();\n RealMatrix apacheV = decomposition.getV();\n RealMatrix apacheDinv = getApacheDinv();\n\n return JamMatrix.wrap(apacheV.multiply(apacheDinv.multiply(apacheUT)).getData());\n }", "public static Matrix inverse(Matrix amat){\r\n \tint n = amat.nrow;\r\n \tif(n!=amat.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = amat.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \treturn invmat;\r\n \t}", "public Matrix inverse(){\r\n \tint n = this.nrow;\r\n \tif(n!=this.ncol)throw new IllegalArgumentException(\"Matrix is not square\");\r\n \tdouble[] col = new double[n];\r\n \tdouble[] xvec = new double[n];\r\n \tMatrix invmat = new Matrix(n, n);\r\n \tdouble[][] invarray = invmat.getArrayReference();\r\n \tMatrix ludmat;\r\n\r\n\t \tludmat = this.luDecomp();\r\n \tfor(int j=0; j<n; j++){\r\n \t\tfor(int i=0; i<n; i++)col[i]=0.0D;\r\n \t\tcol[j]=1.0;\r\n \t\txvec=ludmat.luBackSub(col);\r\n \t\tfor(int i=0; i<n; i++)invarray[i][j]=xvec[i];\r\n \t}\r\n \t\treturn invmat;\r\n \t}", "public Matrix inverse() throws JPARSECException {\n return solve(identity(m,m));\n }", "public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }", "public Matrix inverse() {\n\t\tMatrix a = copy();\n\t\tif (a.M != a.N) {\n\t\t\tthrow new RuntimeException(\"This matrix is not square!\");\n\t\t}\n\t\tMatrix i = identity(a.N);\n\t\tMatrix ai = a.augment(i);\n\t\tai = ai.specialrref();\n\t\tMatrix[] split = ai.split(a.N);\n\t\tif (split[0].equals(i)) {\n\t\t\treturn split[1];\n\t\t} else {\n\t\t\tthrow new RuntimeException(\"This matrix is not invertible!\");\n\t\t}\n\t}", "public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;", "public final void invert(Matrix3f m1) {\n\tset(m1);\n\tinvert();\n }", "Matrix InverseT()\n {\n Matrix ad = new Matrix( y.cross(z), z.cross(x), x.cross(y) );\n float inv_det = 1.0f / ( x.dot( ad.x ) );\n ad.timesEqual( inv_det );\n return ad;\n }", "public static Matrix opposite(Matrix amat){\r\n \tMatrix opp = Matrix.copy(amat);\r\n \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\topp.matrix[i][j]=-amat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "Matrix inverse(Matrix m){\r\n Matrix mtemp = new Matrix(m.M);\r\n Matrix miden = new Matrix(m.rows,m.cols);\r\n miden = miden.identity();\r\n for(int i=0;i<mtemp.rows-1;i++){\r\n for(int j=i+1; j<mtemp.rows; j++){\r\n if(mtemp.M[i][i]<mtemp.M[j][i]){\r\n swapRow(mtemp,i,j);\r\n swapRow(miden,i,j);\r\n }\r\n }\r\n for(int k=i+1; k<mtemp.rows; k++){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=0;j<mtemp.cols;j++){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n for(int i=mtemp.rows-1;i>0;i--){\r\n for(int k=i-1; k>-1; k--){\r\n double ratio = mtemp.M[k][i]/mtemp.M[i][i];\r\n for(int j=mtemp.cols-1;j>-1;j--){\r\n mtemp.M[k][j] -= ratio*mtemp.M[i][j];\r\n miden.M[k][j] -= ratio*miden.M[i][j];\r\n }\r\n\r\n }\r\n\r\n }\r\n \r\n\r\n for(int i=0; i<mtemp.rows; i++){\r\n for(int j=0; j<mtemp.cols; j++){\r\n miden.M[i][j] /= mtemp.M[i][i];\r\n }\r\n }\r\n return miden;\r\n\r\n }", "public void invertFastEqual()\r\n\t{\r\n\t\tE3DMatrix4x4F scratchMatrix = new E3DMatrix4x4F();\r\n\t\t\r\n//\t\tscratchMatrix.matrix4x4[0][0] = scratchMatrix.matrix4x4[]\r\n\t\tscratchMatrix.matrix4x4[0][1] = matrix4x4[1][0];\r\n\t\tscratchMatrix.matrix4x4[0][2] = matrix4x4[2][0];\r\n\t\tscratchMatrix.matrix4x4[1][0] = matrix4x4[0][1];\r\n//\t\tscratchMatrix.matrix4x4[1][1] = \r\n\t\tscratchMatrix.matrix4x4[1][2] = matrix4x4[2][1];\r\n\t\tscratchMatrix.matrix4x4[2][0] = matrix4x4[0][2];\r\n\t\tscratchMatrix.matrix4x4[2][1] = matrix4x4[1][2];\r\n//\t\tscratchMatrix.matrix4x4[2][2] =\r\n\t\t\r\n\t\tmatrix4x4[0][1] = scratchMatrix.matrix4x4[0][1];\r\n\t\tmatrix4x4[0][2] = scratchMatrix.matrix4x4[0][2];\r\n\t\tmatrix4x4[1][0] = scratchMatrix.matrix4x4[1][0];\r\n\t\tmatrix4x4[1][2] = scratchMatrix.matrix4x4[1][2];\r\n\t\tmatrix4x4[2][0] = scratchMatrix.matrix4x4[2][0];\r\n\t\tmatrix4x4[2][1] = scratchMatrix.matrix4x4[2][1];\r\n\t}", "public static double [][] inv(double [][] a) {\n int N = a.length;\n double [] col = new double[N];\n int [] indx = new int[N];\n double [][] y = new double[N][N];\n \n double d = ludcmp(a, indx);\n for (int j=0; j<N; j++ ) {\n for (int i=0; i<N; i++) \n col[i] = 0.0;\n col[j] = 1.0;\n lubksb(a, indx, col);\n for (int i=0; i<N; i++)\n y[i][j] = col[i];\n }\n return y; \n }", "private DoubleMatrix invertCholesky(DoubleMatrix matrix) {\n int numOfRows = matrix.rows;\n double sum;\n int i, j, k;\n // ______ Compute inv(L) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n matrix.put(i, i, 1. / matrix.get(i, i));\n for (j = i + 1; j < numOfRows; ++j) {\n sum = 0.;\n for (k = i; k < j; ++k) {\n sum -= matrix.get(j, k) * matrix.get(k, i);\n }\n matrix.put(j, i, sum / matrix.get(j, j));\n }\n }\n // ______ Compute inv(A)=inv(LtL) store in lower of A ______\n for (i = 0; i < numOfRows; ++i) {\n for (j = i; j < numOfRows; ++j) {\n sum = 0.;\n for (k = j; k < numOfRows; ++k) {\n sum += matrix.get(k, i) * matrix.get(k, j); // transpose\n }\n matrix.put(j, i, sum);\n }\n }\n return matrix;\n }", "public final void invert(Matrix4rad toInvert) {\r\n\t\tthis.set(toInvert);\r\n\t\tinvert();\r\n\t}", "public static double[][] matrixInversion(double[][] a) {\r\n\t\t// Code for this function and the functions it calls was adapted from\r\n\t\t// http://mrbool.com/how-to-use-java-for-performing-matrix-operations/26800\r\n\t\t\r\n\t\treturn (divideBy(transpose(cofactor(a)), determinant(a)));\r\n\t}", "public final void invert() {\n\tdouble s = determinant();\n\tif (s == 0.0)\n\t return;\n\ts = 1/s;\n\t// alias-safe way.\n\tset(\n\t m11*m22 - m12*m21, m02*m21 - m01*m22, m01*m12 - m02*m11,\n\t m12*m20 - m10*m22, m00*m22 - m02*m20, m02*m10 - m00*m12,\n\t m10*m21 - m11*m20, m01*m20 - m00*m21, m00*m11 - m01*m10\n\t );\n\tmul((float)s);\n }", "public Matrix opposite(){\r\n \tMatrix opp = Matrix.copy(this);\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\topp.matrix[i][j]=-this.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \treturn opp;\r\n \t}", "@Override\n public void Invert() {\n\t \n }", "public Matrix inverse() {\n int n = L.getNrows();\n Matrix inv = Matrix.identity(n);\n solve(inv);\n return inv;\n }", "public Matrix inverseMatrix(Matrix L, Matrix U, Matrix P, int n)\n {\n\tMatrix Uinv = new Matrix(n,n);\n\tMatrix Linv = new Matrix(n,n);\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// forward substitution for L y = b.\n\t\tfor (int i = 1; i < n; i++)\n\t\t\tfor (int j = 0; j < i; j++)\n\t\t\t\ttemp.vector[i] -= L.matrix[i][j] * temp.vector[j];\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tLinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n\n\tfor (int k = 0; k < n; k++)\n\t{\n\t\tVector temp = new Vector(n);\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tif (i == k)\n\t\t\t\ttemp.vector[i] = 1;\n\t\t\telse\n\t\t\t\ttemp.vector[i] = 0;\n\t\t}\n\t\t// back substitution for U x = y. \n\t\tfor (int i = n - 1; i >= 0; i--) {\n\t\t\tfor (int j = i + 1; j < n; j++) \n temp.vector[i] -= U.matrix[i][j] * temp.vector[j];\n\t\t\ttemp.vector[i] /= U.matrix[i][i];\n\t\t}\n\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tUinv.matrix[i][k] = temp.vector[i];\n\t\t}\n\n\t}\n Matrix LinP = new Matrix();\n\tLinP = LinP.multiplication(Linv, P);\n Matrix results = new Matrix();\n results = results.multiplication(Uinv, LinP);\n\treturn results;\n\n }", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "static int[][] inverse(int A[][]) \n { \n int inverse[][] = new int[4][4];\n // Find determinant of A[][] \n int det = determinant(A, N)%26; \n System.out.println(det);\n if (det == 0) \n { \n System.out.print(\"Singular matrix, can't find its inverse\"); \n return null; \n } \n \n // Find adjoint \n int [][]adj = new int[N][N]; \n adjoint(A, adj); \n \n // Find Inverse using formula \"inverse(A) = adj(A)/det(A)\" \n for (int i = 0; i < N; i++) \n for (int j = 0; j < N; j++) {\n inverse[i][j] = adj[i][j]/det; \n inverse[i][j] = inverse[i][j]%26;\n System.out.print(inverse[i][j]);\n }\n return inverse; \n }", "public JTensor cinv() {\n JTensor r = new JTensor();\n TH.THTensor_(cinv)(r, this);\n return r;\n }", "public static void invert(int[] a) {\r\n\t\tint n = a.length;\r\n\t\tint j = n - 1;\r\n\t\tfor (int i = 0; i < j; i++) {\r\n\t\t\tint tmp = a[i];\r\n\t\t\ta[i] = a[j];\r\n\t\t\ta[j] = tmp;\r\n\t\t\tj--;\r\n\t\t}\r\n\t}", "public void SetMatrixToIdentity() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 1;\t this.mat_f_m[0][1] = 0;\tthis.mat_f_m[0][2] = 0;\t this.mat_f_m[0][3] = 0;\n\tthis.mat_f_m[1][0] = 0;\t this.mat_f_m[1][1] = 1;\tthis.mat_f_m[1][2] = 0;\t this.mat_f_m[1][3] = 0;\n\tthis.mat_f_m[2][0] = 0;\t this.mat_f_m[2][1] = 0;\tthis.mat_f_m[2][2] = 1;\t this.mat_f_m[2][3] = 0;\n\tthis.mat_f_m[3][0] = 0;\t this.mat_f_m[3][1] = 0;\tthis.mat_f_m[3][2] = 0;\t this.mat_f_m[3][3] = 1;\t\n \n }", "public T invert() {\n T ret = createLike();\n\n if (!ops.invert(mat, ret.mat))\n throw new SingularMatrixException();\n if (ops.hasUncountable(ret.mat))\n throw new SingularMatrixException(\"Solution contains uncountable numbers\");\n\n return ret;\n }", "public Matrix getInversematrixS()\n {\n // Build alpha * I\n double [][] alphainvmatrix;\n alphainvmatrix = new double[x + 1][x + 1];\n for(int i = 0; i < x + 1; i++)\n {\n alphainvmatrix[i][i] = alpha;\n\n }\n Matrix alphamatrixnew = new Matrix(alphainvmatrix);\n\n // calculate summation\n Matrix sum = new Matrix(x + 1, 1);\n int i = 1;\n while (i <= arraylistofprices.size() - 1) {\n phimatrix(i);\n\n sum.plusEquals(phi);\n\n i++;\n }\n Matrix summation = sum.times(phiT);\n summation.timesEquals(beta); \n\n // alpha * I + beta * sum\n Matrix sInv = alphamatrixnew.plus(summation);\n return sInv;\n }", "public Matrix transpose(){\r\n \tMatrix tmat = new Matrix(this.ncol, this.nrow);\r\n \tdouble[][] tarray = tmat.getArrayReference();\r\n \tfor(int i=0; i<this.ncol; i++){\r\n \t\tfor(int j=0; j<this.nrow; j++){\r\n \t\ttarray[i][j]=this.matrix[j][i];\r\n \t\t}\r\n \t}\r\n \treturn tmat;\r\n \t}", "public static double[] inv_J(double a, double m, double[] x, double[] y) {\r\n\t\tdouble[] J = new double[4];\r\n\t\tJ[0] = f1_a(a, m, x, y);\r\n\t\tJ[1] = f1_m(a, m, x, y);\r\n\t\tJ[2] = f2_a(a, m, x, y);\r\n\t\tJ[3] = f2_m(a, m, x, y);\r\n\t\tdouble temp = 1 / (J[0] * J[3] - J[1] * J[2]);\r\n\t\tdouble[] inv_J = new double[4];\r\n\t\tinv_J[0] = temp * J[3];\r\n\t\tinv_J[1] = -temp * J[1];\r\n\t\tinv_J[2] = -temp * J[2];\r\n\t\tinv_J[3] = temp * J[0];\r\n\t\treturn inv_J;\r\n\t}", "Matrix<T> getTransposed();", "public void invert() {\n\t\tthis.vector.setXYZ(-this.vector.x(), -this.vector.y(), -this.vector.z());\n\t\tthis.energy = -this.energy;\n\t}", "public Matrix getTranspose() {\r\n double[][] jadi = new double[matrix[0].length][matrix.length];\r\n for (int i = 0; i < jadi.length; i++) {\r\n for (int j = 0; j < jadi[0].length; j++) {\r\n jadi[i][j] = matrix[j][i];\r\n }\r\n }\r\n return new Matrix(jadi);\r\n }", "public Index invert() {\n \t\tint n=length();\n \t\tIndex ni=new Index(n);\n \t\tfor (int i=0; i<n; i++) {\n \t\t\tni.set(this.get(i), i);\n \t\t}\n \t\treturn ni;\n \t}", "private Matriks Transpose(){\r\n\t\tMatriks Mhasil = new Matriks(KolEff,BrsEff);\r\n\t\tfor(int i=0;i<BrsEff;i++){\r\n\t\t\tfor(int j=0;j<KolEff;j++){\r\n\t\t\t\tMhasil.Elmt[j][i] = this.Elmt[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Mhasil;\r\n\t}", "public static Matrix transpose(Matrix amat){\r\n \tMatrix tmat = new Matrix(amat.ncol, amat.nrow);\r\n \tdouble[][] tarray = tmat.getArrayReference();\r\n \tfor(int i=0; i<amat.ncol; i++){\r\n \t\tfor(int j=0; j<amat.nrow; j++){\r\n \t\ttarray[i][j]=amat.matrix[j][i];\r\n \t\t}\r\n \t}\r\n \treturn tmat;\r\n \t}", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "public PMVMatrix(boolean useBackingArray) {\n projectFloat = new ProjectFloat();\n \n // I Identity\n // T Texture\n // P Projection\n // Mv ModelView\n // Mvi Modelview-Inverse\n // Mvit Modelview-Inverse-Transpose\n if(useBackingArray) {\n matrixBufferArray = new float[6*16];\n matrixBuffer = null;\n // matrixBuffer = FloatBuffer.wrap(new float[12*16]);\n } else {\n matrixBufferArray = null;\n matrixBuffer = Buffers.newDirectByteBuffer(6*16 * Buffers.SIZEOF_FLOAT);\n matrixBuffer.mark();\n }\n \n matrixIdent = slice2Float(matrixBuffer, matrixBufferArray, 0*16, 1*16); // I\n matrixTex = slice2Float(matrixBuffer, matrixBufferArray, 1*16, 1*16); // T\n matrixPMvMvit = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit \n matrixPMvMvi = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 3*16); // P + Mv + Mvi\n matrixPMv = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 2*16); // P + Mv\n matrixP = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 1*16); // P\n matrixMv = slice2Float(matrixBuffer, matrixBufferArray, 3*16, 1*16); // Mv\n matrixMvi = slice2Float(matrixBuffer, matrixBufferArray, 4*16, 1*16); // Mvi\n matrixMvit = slice2Float(matrixBuffer, matrixBufferArray, 5*16, 1*16); // Mvit\n \n if(null != matrixBuffer) {\n matrixBuffer.reset();\n } \n ProjectFloat.gluMakeIdentityf(matrixIdent);\n \n vec3f = new float[3];\n matrixMult = new float[16];\n matrixTrans = new float[16];\n matrixRot = new float[16];\n matrixScale = new float[16];\n matrixOrtho = new float[16];\n matrixFrustum = new float[16];\n ProjectFloat.gluMakeIdentityf(matrixTrans, 0);\n ProjectFloat.gluMakeIdentityf(matrixRot, 0);\n ProjectFloat.gluMakeIdentityf(matrixScale, 0);\n ProjectFloat.gluMakeIdentityf(matrixOrtho, 0);\n ProjectFloat.gluMakeZero(matrixFrustum, 0);\n \n matrixPStack = new ArrayList<float[]>();\n matrixMvStack= new ArrayList<float[]>();\n \n // default values and mode\n glMatrixMode(GL_PROJECTION);\n glLoadIdentity();\n glMatrixMode(GL_MODELVIEW);\n glLoadIdentity();\n glMatrixMode(GL.GL_TEXTURE);\n glLoadIdentity();\n setDirty();\n update();\n }", "static public int[][] flipAndInvertImage(int[][] A) {\n for(int i =0;i<A.length;i++){\n processARow(A[i]);\n }\n return A;\n }", "public void reverseEdge(int[][] mat) {\n\t\tint row = mat.length;\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor(int j = i; j < row; j ++) {\n\t\t\t\tif(i != j) {\n\t\t\t\t\tint temp = mat[i][j];\n\t\t\t\t\tmat[i][j] = mat[j][i];\n\t\t\t\t\tmat[j][i] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void foo2()\n {\n double[][] entries = new double[][]{\n {1.000, 0.001}};\n \n DMatrixRMaj matrixJ = new DMatrixRMaj(entries);\n \n int numRows = matrixJ.getNumRows();\n int numColumns = matrixJ.getNumCols();\n boolean needU = true;\n boolean needV = true;\n boolean compact = false;\n \n SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(numRows, numColumns, needU, needV, compact);\n svd.decompose(matrixJ);\n \n double[] singularValues = svd.getSingularValues();\n DMatrixRMaj matrixU = new DMatrixRMaj(numRows, numRows);\n DMatrixRMaj matrixW = new DMatrixRMaj(numRows, numColumns);\n DMatrixRMaj matrixVTranspose = new DMatrixRMaj(numColumns, numColumns);\n \n boolean transposeU = false;\n boolean transposeV = true;\n svd.getU(matrixU, transposeU);\n svd.getV(matrixVTranspose, transposeV);\n svd.getW(matrixW);\n \n System.out.println(\"matrixJ = \" + matrixJ);\n System.out.println(\"matrixU = \" + matrixU);\n System.out.println(\"matrixW = \" + matrixW);\n System.out.println(\"matrixV = \" + matrixVTranspose);\n \n DMatrixRMaj matrixJReconstructed = reconstructMatrix(matrixU, matrixW, matrixVTranspose);\n System.out.println(\"matrixJReconstructed = \" + matrixJReconstructed);\n\n MatrixTestTools.assertMatrixEquals(matrixJ, matrixJReconstructed, 1e-7);\n \n DMatrixRMaj matrixJTranspose = new DMatrixRMaj(matrixJ);\n CommonOps_DDRM.transpose(matrixJTranspose);\n \n DMatrixRMaj matrixJJTranspose = new DMatrixRMaj(matrixJ.getNumRows(), matrixJ.getNumRows());\n CommonOps_DDRM.mult(matrixJ, matrixJTranspose, matrixJJTranspose);\n \n DMatrixRMaj matrixJJTransposeInverse = new DMatrixRMaj(matrixJJTranspose);\n CommonOps_DDRM.invert(matrixJJTransposeInverse);\n \n\n DMatrixRMaj jPlus = new DMatrixRMaj(matrixJ.getNumCols(), matrixJ.getNumRows());\n CommonOps_DDRM.mult(matrixJTranspose, matrixJJTransposeInverse, jPlus);\n\n System.out.println(\"jPlus = \" + jPlus);\n\n \n DMatrixRMaj jPlusJ = new DMatrixRMaj(jPlus.getNumRows(), matrixJ.getNumCols());\n CommonOps_DDRM.mult(jPlus, matrixJ, jPlusJ);\n \n System.out.println(\"jPlusJ = \" + jPlusJ);\n \n DMatrixRMaj identity = CommonOps_DDRM.identity(jPlusJ.getNumRows());\n DMatrixRMaj matrixQ = new DMatrixRMaj(identity.getNumRows(), identity.getNumCols());\n \n CommonOps_DDRM.subtract(identity, jPlusJ, matrixQ);\n System.out.println(\"matrixQ = \" + matrixQ);\n\n\n }", "public static native void Inverse(long lpjFbxDualQuaternion);", "@Override\n public void onClick(View view) {\n Matrix matrix = ctx.getLastMatrix();\n try {\n Matrix matrixInv = matrix.inv();\n txtOutput.setText(matrixInv.convertToString());\n } catch (Exception e) {\n System.out.println(e.getStackTrace());\n txtOutput.setText(MatrixContext.INPUT_ERROR);\n }\n\n }", "public RMTransform getTransformInverse() { return getTransform().invert(); }", "public void transpose() {\n // Follow this plan: \n // (1) Create a new ImageArray ia, using currentIM's row-major order array\n // and rows and columns, but swap the roles of its numbers\n // of rows and columns.\n // (2) Store the transpose of the currentIm array in ia, using currentIm's\n // 2-parameter getPixel function and ia's 3-parameter setPixel\n // function.\n // (3) assign ia to currentIm.\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n ImageArray ia= new ImageArray(currentIm.getRmoArray(), cols, rows);\n \n //Copy each element ImageArray[r,c] to ia[c,r]\n // invariant: rows 0..r-1 have been copied to ia[.., 0..r-1]\n for (int r= 0; r != rows; r= r+1)\n // invariant: elements [r..0..c-1] have been copied to ia[0..c-1, r]\n for (int c= 0; c != cols; c= c+1) {\n ia.setPixel(c, r, currentIm.getPixel(r,c));\n }\n \n currentIm= ia;\n }", "public Matrix xMatrixTranspose(){\n if(!this.pcaDone)this.pca();\n double denom = this.nItems;\n if(!super.nFactorOption)denom -= 1.0;\n Matrix mat = dataMinusMeansTranspose.times(1.0/Math.sqrt(denom));\n return mat;\n }", "public org.apache.spark.mllib.linalg.Matrix toLocalMatrix () { throw new RuntimeException(); }", "@Test\n public void testJamaProblem() throws IOException {\n\n Primitive64Store problematic = Primitive64Store.FACTORY\n .rows(new double[][] { { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 1 }, { 0, 0, 0, 1, 0 }, { 1, 1, 0, 0, 1 }, { 1, 0, 1, 0, 1 } });\n\n CaseEigenvalue.doVerifyGeneral(problematic);\n }", "public void matrizInversa(){\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n //System.out.println(\"\");getDeter();\n getMatriz()[i][j] = getMatrizAdjunta()[i][j]/getDeter();\n }\n }\n mostrarMatriz(getMatriz(),\"Matriz inversa\");\n }", "void invertAllBits();", "public LUDecomposition (@Nonnull final Matrix aMatrix)\n {\n // Use a \"left-looking\", dot-product, Crout/Doolittle algorithm.\n m_aLU = aMatrix.getArrayCopy ();\n m_nRows = aMatrix.getRowDimension ();\n m_nCols = aMatrix.getColumnDimension ();\n m_aPivot = new int [m_nRows];\n for (int i = 0; i < m_nRows; i++)\n m_aPivot[i] = i;\n int nPivSign = 1;\n double [] aLUrowi;\n final double [] aLUcolj = new double [m_nRows];\n\n // Outer loop.\n for (int j = 0; j < m_nCols; j++)\n {\n // Make a copy of the j-th column to localize references.\n for (int i = 0; i < m_nRows; i++)\n aLUcolj[i] = m_aLU[i][j];\n\n // Apply previous transformations.\n for (int i = 0; i < m_nRows; i++)\n {\n aLUrowi = m_aLU[i];\n\n // Most of the time is spent in the following dot product.\n final int kmax = Math.min (i, j);\n double s = 0.0;\n for (int k = 0; k < kmax; k++)\n s += aLUrowi[k] * aLUcolj[k];\n\n aLUrowi[j] = aLUcolj[i] -= s;\n }\n\n // Find pivot and exchange if necessary.\n int p = j;\n for (int i = j + 1; i < m_nRows; i++)\n if (MathHelper.abs (aLUcolj[i]) > MathHelper.abs (aLUcolj[p]))\n p = i;\n final double [] aLUj = m_aLU[j];\n if (p != j)\n {\n final double [] aLUp = m_aLU[p];\n for (int k = 0; k < m_nCols; k++)\n {\n final double t = aLUp[k];\n aLUp[k] = aLUj[k];\n aLUj[k] = t;\n }\n final int k = m_aPivot[p];\n m_aPivot[p] = m_aPivot[j];\n m_aPivot[j] = k;\n nPivSign = -nPivSign;\n }\n\n // Compute multipliers.\n if (j < m_nRows && aLUj[j] != 0.0)\n for (int i = j + 1; i < m_nRows; i++)\n m_aLU[i][j] /= aLUj[j];\n }\n m_nPivSign = nPivSign;\n }", "public Vector3 invert()\n {\n this.scale(-1);\n return this;\n }", "float[] getModelMatrix();", "public void phitransposeMatrix()\n {\n double [][] martixtranspose;\n martixtranspose = new double[1][x + 1];\n int i = 0;\n while (i <= x) {\n martixtranspose[0][i] = Math.pow(arraylistofprices.size(), i);\n\n i++;\n }\n phiT = new Matrix(martixtranspose);\n }", "public void setInvert (boolean invert) {\r\n\t\tthis.invert = invert;\r\n\t}", "public static void flipHorizontalAxis(int[][] matrix){\n\n int beginIndex = 0;\n int endIndex = (matrix.length - 1);\n int[] begin = matrix[beginIndex];\n int[] end = matrix[endIndex];\n int[] temp;\n\n\n while(endIndex > beginIndex){\n //swap the arrays with a temp variable\n temp = Arrays.copyOf(begin, begin.length);\n begin = Arrays.copyOf(end, end.length);\n end = Arrays.copyOf(temp, temp.length);\n\n //update the new arrays in the matrix\n matrix[beginIndex] = begin;\n matrix[endIndex] = end;\n\n //update the new indexes\n beginIndex++;\n endIndex--;\n\n //move begin and end to the next set to be swapped\n begin = matrix[beginIndex];\n end = matrix[endIndex];\n }\n\n }", "private static void trans(Board board) {\n\t\tint[][] M = new int[board.size][board.size];\n\t\tfor (int i = 0; i < board.size; i++)\n\t\t\tfor (int j = 0; j < board.size; j++)\n\t\t\t\tM[i][j] = board.board[j][i];\n\t\tboard.board = M.clone();\n\t}", "Matrix transpose(){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n // if(!itRow[i].isEmpty()){\n itRow.moveFront();\n // itRow[i].moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(c.column, i, c.value);\n itRow.moveNext();\n }\n }\n return newM;\n }", "private static void rotate(int[][] matrix) {\n int rows = matrix.length;\n int cols = matrix[0].length;\n\n for (int[] ints : matrix) {\n reverse(ints, 0, cols - 1);\n }\n\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols - i; j++) {\n swapMatrix(matrix, i, j, cols - 1 - j, rows - 1 - i);\n }\n }\n }", "public void invertOrientation() {\n\t\tPoint3D temp = getPoint(2);\n\t\tsetPoint(2, getPoint(1));\n\t\tsetPoint(1, temp);\n\n\t\tTriangleElt3D temp2 = getNeighbour(2);\n\t\tsetNeighbour(2, getNeighbour(1));\n\t\tsetNeighbour(1, temp2);\n\t\tif (this.getNetComponent() != null)\n\t\t\tthis.getNetComponent().setOriented(false);\n\t}", "static void rotate(int[][] matrix) {\n int n = matrix.length;\n for (int i = 0; i < (n + 1) / 2; i++) {\n for (int j = 0; j < n / 2; j++) {\n int temp = matrix[n - 1 - j][i];\n matrix[n - 1 - j][i] = matrix[n - 1 - i][n - j - 1];\n matrix[n - 1 - i][n - j - 1] = matrix[j][n - 1 - i];\n matrix[j][n - 1 - i] = matrix[i][j];\n matrix[i][j] = temp;\n }\n }\n }", "public void SetMatrixToOnes() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 1;\t this.mat_f_m[0][1] = 1;\tthis.mat_f_m[0][2] = 1;\t this.mat_f_m[0][3] = 1;\n\tthis.mat_f_m[1][0] = 1;\t this.mat_f_m[1][1] = 1;\tthis.mat_f_m[1][2] = 1;\t this.mat_f_m[1][3] = 1;\n\tthis.mat_f_m[2][0] = 1;\t this.mat_f_m[2][1] = 1;\tthis.mat_f_m[2][2] = 1;\t this.mat_f_m[2][3] = 1;\n\tthis.mat_f_m[3][0] = 1;\t this.mat_f_m[3][1] = 1;\tthis.mat_f_m[3][2] = 1;\t this.mat_f_m[3][3] = 1;\t\n \n }", "public void cinv_() {\n TH.THTensor_(cinv)(this, this);\n }", "public Matrix transpose() {\n Matrix A = new Matrix(N, M);\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n A.data[j][i] = this.data[i][j];\n return A;\n }", "<T> void inverse(final T[] array);", "public Matrix transpose() {\n Matrix result = new Matrix(cols, rows);\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n result.matrix.get(j)[i] = matrix.get(i)[j];\n }\n }\n return result;\n }", "public T pseudoInverse() {\n T ret = createLike();\n ops.pseudoInverse(mat, ret.mat);\n return ret;\n }", "public void flipV() {\r\n int tmp, sym;\r\n for (int col = 0; col < pixels.length; ++col) {\r\n for (int row = 0; row < pixels[col].length / 2; ++row) {\r\n // find the column index of the vertically symmetric pixel\r\n sym = pixels[col].length - 1 - row;\r\n // swap the pixel value between the two\r\n tmp = pixels[col][row];\r\n pixels[col][row] = pixels[col][sym];\r\n pixels[col][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "public static Transform inverse(Transform t) {\n\t\tfloat inv_det = 1.0f / (t.a * t.d - t.c * t.b);\n\t\treturn transpose(t.d * inv_det, -t.c * inv_det, (t.c * t.ty - t.tx * t.d) * inv_det, -t.b * inv_det,\n\t\t\t\t\t\t t.a * inv_det, (t.tx * t.b - t.a * t.ty) * inv_det);\n\t}", "public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}", "private static void rotate(int[][] matrix) {\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = i; j < matrix[0].length; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[j][i];//转置,第i行变成第i列\r\n\t\t\t\tmatrix[j][i] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int i = 0; i < matrix.length; i++) {\r\n\t\t\tfor (int j = 0; j < matrix.length / 2; j++) {\r\n\t\t\t\tint temp = 0;\r\n\t\t\t\ttemp = matrix[i][j];\r\n\t\t\t\tmatrix[i][j] = matrix[i][matrix.length - 1 - j];\r\n\t\t\t\tmatrix[i][matrix.length - 1 - j] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public Matrix transpose() {\n\t\tMatrix a = copy();\n\t\tComplexNumber[][] values = new ComplexNumber[a.N][];\n\t\tfor (int col = 0; col < a.N; col++) {\n\t\t\tvalues[col] = new ComplexNumber[a.M];\n\t\t\tfor (int row = 0; row < a.M; row++) {\n\t\t\t\tvalues[col][row] = a.ROWS[row][col]; \t\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(values);\n\t}", "public void makeIdentity() {\n if (rows == cols) {\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n if (i == j) {\n matrix.get(i)[j] = 1;\n }\n else {\n matrix.get(i)[j] = 0;\n }\n }\n }\n }\n else {\n throw new NonSquareMatrixException();\n }\n }", "public void minusEquals(Matrix bmat){\r\n \tif((this.nrow!=bmat.nrow)||(this.ncol!=bmat.ncol)){\r\n \t\tthrow new IllegalArgumentException(\"Array dimensions do not agree\");\r\n \t}\r\n \tint nr=bmat.nrow;\r\n \tint nc=bmat.ncol;\r\n\r\n \tfor(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tthis.matrix[i][j] -= bmat.matrix[i][j];\r\n \t\t}\r\n \t}\r\n \t}", "public static Matrix getUpperMatrix(Matrix A) {\n\t\tint size = A.getColumnDimension();\n\t\t\n\t\tdouble[][] u = new double[size][size];\n\t\t\n\t\tfor(int i = 0; i<size; i++){\n\t\t\tfor(int j=0; j < size; j++){\n\t\t\t\tif(j>i) u[i][j] = A.get(i, j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tMatrix U = new Matrix(u);\n\t\t\n\t\treturn U;\n\t}", "public void invert() throws NoninvertibleTransform3DException {\r\n\t\tthis.set(getInverse());\r\n\t}", "public void rotate(int[][] matrix) {\n if(matrix.length <= 0) {\n return;\n }\n \n int N= matrix.length;\n \n for(int i = 0 ; i < N/2; i++) {\n for(int j = i ; j < N-i-1; j ++) {\n int temp = matrix[i][j];\n matrix[i][j] = matrix[N-1-j][i];\n matrix[N-1-j][i] = matrix[N-1-i][N-1-j];\n matrix[N-1-i][N-1-j] = matrix[j][N-1-i];\n matrix[j][N-1-i] = temp;\n }\n \n }\n }", "private static int[][] rotateMartix(int[][] matrix) {\n for(int i=0;i<matrix.length;i++) {\n for(int j=i;j< matrix.length;j++) {\n int tmp=matrix[i][j];\n matrix[i][j]=matrix[j][i];\n matrix[j][i]=tmp;\n }\n }\n //swap columns\n for(int i=0;i<matrix.length;i++){\n int low = 0;\n int high = matrix.length-1;\n\n while(low < high)\n {\n int temp = matrix[i][low];\n matrix[i][low] = matrix[i][high];\n matrix[i][high] = temp;\n\n low++;\n high--;\n }\n }\n return matrix;\n }", "private void transpose() {\n\n // Make a copy of current orientation of rgb and energy arrays.\n int[][] rgbCopy = new int[width][height];\n for (int col = 0; col < width; col++) {\n rgbCopy[col] = rgb[col].clone();\n }\n double[][] energyCopy = new double[width][height];\n for (int col = 0; col < width; col++) {\n energyCopy[col] = energy[col].clone();\n }\n\n // Swap axes.\n int temp = width;\n width = height;\n height = temp;\n\n // Re-init arrays with swapped dimensions.\n rgb = new int[width][height];\n energy = new double[width][height];\n\n // Swap individual pixels in rgb and energy arrays.\n for (int col = 0; col < width; col++) {\n for (int row = 0; row < height; row++) {\n rgb[col][row] = rgbCopy[row][col];\n energy[col][row] = energyCopy[row][col];\n }\n }\n }", "public final void transpose() {\n\tfloat tmp = m01;\n\tm01 = m10;\n\tm10 = tmp;\n\n\ttmp = m02;\n\tm02 = m20;\n\tm20 = tmp;\n\n\ttmp = m12;\n\tm12 = m21;\n\tm21 = tmp;\n\n }", "@Override\n public void invert() {\n getInvertibles().parallelStream().forEach(Invertible::invert);\n }", "public static Mat invert(JPEGCategory[] input) {\n\t\tdouble[] data = new double[64];\n\t\tint k = 0;\n\t\t\n\t\tfor (int i = 0; i < input.length; i++) {\n\t\t\tdouble[] subArr = convertToDouble(input[i]);\n\t\t\tfor (int j = 0; j < subArr.length; j++) {\n\t\t\t\tdata[k] = subArr[j];\n\t\t\t\tk++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble[] newData = { \n\t\t\t data[0], data[1], data[5], data[6], data[14], data[15], data[27], data[28], \n\t\t\t data[2], data[4], data[7], data[13], data[16], data[26], data[29], data[42], \n\t\t\t data[3], data[8], data[12], data[17], data[25], data[30], data[41], data[43], \n\t\t\t data[9], data[11], data[18], data[24], data[31], data[40], data[44], data[53], \n\t\t\tdata[10], data[19], data[23], data[32], data[39], data[45], data[52], data[54], \n\t\t\tdata[20], data[22], data[33], data[38], data[46], data[51], data[55], data[60], \n\t\t\tdata[21], data[34], data[37], data[47], data[50], data[56], data[59], data[61], \n\t\t\tdata[35], data[36], data[48], data[49], data[57], data[58], data[62], data[63] \n\t\t};\n\n\t\tMat result = new Mat(8, 8, CvType.CV_64FC1);\n\t\tresult.put(0, 0, newData);\n\t\treturn result;\n\t}", "private static ArrayList<ArrayList<Integer>> transposeMatrix(ArrayList<ArrayList<Integer>> matrix){\r\n\t\tint numRows = matrix.size();\r\n\t\tint numCols = matrix.get(0).size();\r\n\t\tArrayList<ArrayList<Integer>> newMat = new ArrayList<ArrayList<Integer>>();\r\n\t\t//Put this in second for-loop to not have to loop twice?\r\n\t\tfor(int i = 0; i < numCols; i++) newMat.add(new ArrayList<Integer>());\r\n\t\tfor(int i = 0; i < numRows; i++){\r\n\t\t\tfor (int j = 0; j < numCols; j++){\r\n\t\t\t\tnewMat.get(j).add(matrix.get(i).get(j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn newMat;\r\n\t}", "public void rotateInPlace(int[][] matrix) {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = i; j < matrix[0].length; j++) {\n int temp = 0;\n temp = matrix[i][j];\n matrix[i][j] = matrix[j][i];\n matrix[j][i] = temp;\n }\n }\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix.length / 2; j++) {\n int temp = 0;\n temp = matrix[i][j];\n matrix[i][j] = matrix[i][matrix.length - 1 - j];\n matrix[i][matrix.length - 1 - j] = temp;\n }\n }\n }", "public void invert()\n {\n assert isComplete;\n \n isInverted = !isInverted;\n }", "public void invert() {\n \n for(T first : getFirstDimension()) {\n \n for(T second : getMatches(first)) {\n \n Double sim = get(first, second);\n \n if(sim!=null && sim > 0.0) {\n set(first, second, 1.0/sim);\n }\n \n }\n \n }\n }", "public void rotate(int[][] matrix) {\n int m = matrix.length;\n int n = matrix[0].length;\n if (m != n) {\n return;\n }\n int[][] result = new int[n][n];\n for (int i = 0; i < n; i++) {\n for (int j = 0; j < n; j++) {\n result[i][j] = matrix[n - j - 1][i];\n }\n }\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n matrix[i][j] = result[i][j];\n }\n }\n }", "public void setInverted(boolean invert) {\r\n inverted = invert;\r\n }", "private void makeInverse() {\n if (_map != null) {\n for (Map.Entry<Integer, Integer> e : _map.entrySet()) {\n _inverse.put(e.getValue(), e.getKey());\n }\n }\n }", "private static void swapMatrix(int[][] matrix, int i1, int j1, int i2, int j2) {\n int temp = matrix[i1][j1];\n matrix[i1][j1] = matrix[i2][j2];\n matrix[i2][j2] = temp;\n }", "public static Matrix asin(Matrix matrix)\n {\n double[][] internal = matrix.getArray();\n int row = matrix.getRowDimension(), col = matrix.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n double[][] M = matrix.getArray();\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n if (M[i][j] <= 1.0d || M[i][j] >= -1.0d)\n {\n C[i][j] = Math.asin(M[i][j]);\n }\n else\n {\n C[i][j] = Double.NaN;\n }\n }\n }\n return X;\n }", "public void inverse(Projection projection);", "public Matriks Inverse(Matriks M){\r\n\t\tMatriks Minv = M.MatriksCofactor(M);\r\n\t\tMinv = Minv.Transpose();\r\n\t\tdouble det = M.DetCofactor(M);\r\n\t\tint sign = 1;\r\n\t\tfor(int i=0; i<BrsEff;i++){\r\n\t\t\tfor(int j=0; j<KolEff; j++){\r\n\t\t\t\tMinv.Elmt[i][j] = sign*(1/det)*Minv.Elmt[i][j];\r\n\t\t\t\tsign *= -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn Minv;\r\n\t}", "@Nonnull\n public Matrix getU ()\n {\n final Matrix aNewMatrix = new Matrix (m_nCols, m_nCols);\n final double [] [] aNewArray = aNewMatrix.internalGetArray ();\n for (int nRow = 0; nRow < m_nCols; nRow++)\n {\n final double [] aSrcRow = m_aLU[nRow];\n final double [] aDstRow = aNewArray[nRow];\n for (int nCol = 0; nCol < m_nCols; nCol++)\n if (nRow <= nCol)\n aDstRow[nCol] = aSrcRow[nCol];\n else\n aDstRow[nCol] = 0.0;\n }\n return aNewMatrix;\n }", "public Matrix(Matrix bb){\r\n\t\tthis.nrow = bb.nrow;\r\n\t\tthis.ncol = bb.ncol;\r\n\t\tthis.matrix = bb.matrix;\r\n\t\tthis.index = bb.index;\r\n this.dswap = bb.dswap;\r\n \t}", "public final void invert() {\r\n\t\tRadical1 s = determinant();\r\n\t\tif (s.equals(Radical1.ZERO))\r\n\t\t\treturn;\r\n\r\n\t\tif (!s.equals(Radical1.ONE))\r\n\t\t\tthrow new ArithmeticException(\"can't invert radical expressions that have non-1 determinant (i.e. that rescale)\");\r\n\r\n\t\t// see Matrix4f.invert for an explination\r\n\r\n\t\tl1.setZero();\r\n\t\tl2.setZero();\r\n\t\tl3.setZero();\r\n\t\tl4.setZero();\r\n\t\tl5.setZero();\r\n\t\tl6.setZero();\r\n\t\tl7.setZero();\r\n\t\tl8.setZero();\r\n\t\tl9.setZero();\r\n\t\tl10.setZero();\r\n\t\tl11.setZero();\r\n\t\tl12.setZero();\r\n\t\tl13.setZero();\r\n\t\tl14.setZero();\r\n\t\tl15.setZero();\r\n\t\tl16.setZero();\r\n\r\n\t\tcalcPartInverse(5, 10, 15, 11, 14, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(6, 11, 13, 9, 15, op1, op2, op3, op4, l1);\r\n\t\tcalcPartInverse(7, 9, 14, 10, 13, op1, op2, op3, op4, l1);\r\n\r\n\t\tcalcPartInverse(9, 2, 15, 3, 14, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(10, 3, 13, 1, 15, op1, op2, op3, op4, l2);\r\n\t\tcalcPartInverse(11, 1, 14, 2, 13, op1, op2, op3, op4, l2);\r\n\r\n\t\tcalcPartInverse(13, 2, 7, 3, 6, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(14, 3, 5, 1, 7, op1, op2, op3, op4, l3);\r\n\t\tcalcPartInverse(15, 1, 6, 2, 5, op1, op2, op3, op4, l3);\r\n\r\n\t\tcalcPartInverse(1, 7, 10, 6, 11, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(2, 5, 11, 7, 9, op1, op2, op3, op4, l4);\r\n\t\tcalcPartInverse(3, 6, 9, 5, 10, op1, op2, op3, op4, l4);\r\n\r\n\t\tcalcPartInverse(6, 8, 15, 11, 12, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(7, 10, 12, 8, 14, op1, op2, op3, op4, l5);\r\n\t\tcalcPartInverse(4, 11, 14, 10, 15, op1, op2, op3, op4, l5);\r\n\r\n\t\tcalcPartInverse(10, 0, 15, 3, 12, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(11, 2, 12, 0, 14, op1, op2, op3, op4, l6);\r\n\t\tcalcPartInverse(8, 3, 14, 2, 15, op1, op2, op3, op4, l6);\r\n\r\n\t\tcalcPartInverse(14, 0, 7, 3, 4, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(15, 2, 4, 0, 6, op1, op2, op3, op4, l7);\r\n\t\tcalcPartInverse(12, 3, 6, 2, 7, op1, op2, op3, op4, l7);\r\n\r\n\t\tcalcPartInverse(2, 7, 8, 4, 11, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(3, 4, 10, 6, 8, op1, op2, op3, op4, l8);\r\n\t\tcalcPartInverse(0, 6, 11, 7, 10, op1, op2, op3, op4, l8);\r\n\r\n\t\tcalcPartInverse(7, 8, 13, 9, 12, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(4, 9, 15, 11, 13, op1, op2, op3, op4, l9);\r\n\t\tcalcPartInverse(5, 11, 12, 8, 15, op1, op2, op3, op4, l9);\r\n\r\n\t\tcalcPartInverse(11, 0, 13, 1, 12, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(8, 1, 15, 3, 13, op1, op2, op3, op4, l10);\r\n\t\tcalcPartInverse(9, 3, 12, 0, 15, op1, op2, op3, op4, l10);\r\n\r\n\t\tcalcPartInverse(15, 0, 5, 1, 4, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(12, 1, 7, 3, 5, op1, op2, op3, op4, l11);\r\n\t\tcalcPartInverse(13, 3, 4, 0, 7, op1, op2, op3, op4, l11);\r\n\r\n\t\tcalcPartInverse(3, 5, 8, 4, 9, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(0, 7, 9, 5, 11, op1, op2, op3, op4, l12);\r\n\t\tcalcPartInverse(1, 4, 11, 7, 8, op1, op2, op3, op4, l12);\r\n\r\n\t\tcalcPartInverse(4, 10, 13, 9, 14, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(5, 8, 14, 10, 12, op1, op2, op3, op4, l13);\r\n\t\tcalcPartInverse(6, 9, 12, 8, 13, op1, op2, op3, op4, l13);\r\n\r\n\t\tcalcPartInverse(8, 2, 13, 1, 14, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(9, 0, 14, 2, 12, op1, op2, op3, op4, l14);\r\n\t\tcalcPartInverse(10, 1, 12, 0, 13, op1, op2, op3, op4, l14);\r\n\r\n\t\tcalcPartInverse(12, 2, 5, 1, 6, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(13, 0, 6, 2, 4, op1, op2, op3, op4, l15);\r\n\t\tcalcPartInverse(14, 1, 4, 0, 5, op1, op2, op3, op4, l15);\r\n\r\n\t\tcalcPartInverse(0, 5, 10, 6, 9, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(1, 6, 8, 4, 10, op1, op2, op3, op4, l16);\r\n\t\tcalcPartInverse(2, 4, 9, 5, 8, op1, op2, op3, op4, l16);\r\n\r\n\t\tvalues[0].set(l1);\r\n\t\tvalues[1].set(l2);\r\n\t\tvalues[2].set(l3);\r\n\t\tvalues[3].set(l4);\r\n\t\tvalues[4].set(l5);\r\n\t\tvalues[5].set(l6);\r\n\t\tvalues[6].set(l7);\r\n\t\tvalues[7].set(l8);\r\n\t\tvalues[8].set(l9);\r\n\t\tvalues[9].set(l10);\r\n\t\tvalues[10].set(l11);\r\n\t\tvalues[11].set(l12);\r\n\t\tvalues[12].set(l13);\r\n\t\tvalues[13].set(l14);\r\n\t\tvalues[14].set(l15);\r\n\t\tvalues[15].set(l16);\r\n\r\n\t\tif (s.equals(Radical1.MINUS_ONE))\r\n\t\t\tnegate();\r\n\t}", "int ainverse(int z)\n {\n return (65536-z);\n }", "public static long[][] rotate(long[][] matrix){\n int n = matrix[0].length;\n\n // We are going from the outside to the inside of the matrix\n for(int layer=0; layer<n/2; layer++){\n\n // The boundaries of the current layer\n int first = layer;\n int last = n - (layer + 1);\n\n // Swap each edge of the layer to the next edge\n for(int j=layer; j<last; j++){\n\n // The offset for the current pixel \n int offset = j - first;\n\n // Save the values of the pixels that will be swapped\n long pixelTop = matrix[first][j];\n long pixelRight = matrix[j][last];\n long pixelBottom = matrix[last][last-offset];\n long pixelLeft = matrix[last-offset][first];\n\n // Swap Top to Right\n matrix[j][last] = pixelTop;\n\n // Swap Right to Bottom\n matrix[last][last-offset] = pixelRight;\n\n // Swap Bottom to Left\n matrix[last-offset][first] = pixelBottom;\n\n // Swap Left to Top\n matrix[first][j] = pixelLeft;\n }\n }\n\n return matrix;\n }", "@Override\n public Matrix idct(final MatrixView in) {\n check(in);\n double[][] out = new double[in.getRows()][in.getColumns()];\n double tmp1, tmp2, tmp3, tmp4;\n double tmpm0 = 0, tmpm1 = 0, tmpm2 = 0, tmpm3 = 0, tmpm4 = 0, tmpm5 = 0, tmpm6 = 0, tmpm7 = 0;\n double tmpm20, tmpm21, tmpm22, tmpm23, tmpm24, tmpm25, tmpm26, tmpm27 = 0;\n double[] outtmpmyi = null;\n\n for (int my = 0; my < in.getRows(); my += SIZE) {\n for (int mx = 0; mx < in.getColumns(); mx += SIZE) {\n for (int i = 0; i < 8; i++) {\n outtmpmyi = out[my + i];\n\n tmpm0 = in.getDouble(my + i, mx + 0);\n tmpm1 = in.getDouble(my + i, mx + 1);\n tmpm2 = in.getDouble(my + i, mx + 2);\n tmpm3 = in.getDouble(my + i, mx + 3);\n tmpm4 = in.getDouble(my + i, mx + 4);\n tmpm5 = in.getDouble(my + i, mx + 5);\n tmpm6 = in.getDouble(my + i, mx + 6);\n tmpm7 = in.getDouble(my + i, mx + 7);\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n outtmpmyi[mx + 0] = tmpm0 + tmpm7;\n outtmpmyi[mx + 7] = tmpm0 - tmpm7;\n outtmpmyi[mx + 1] = tmpm1 + tmpm6;\n outtmpmyi[mx + 6] = tmpm1 - tmpm6;\n outtmpmyi[mx + 2] = tmpm2 + tmpm5;\n outtmpmyi[mx + 5] = tmpm2 - tmpm5;\n outtmpmyi[mx + 3] = tmpm3 + tmpm4;\n outtmpmyi[mx + 4] = tmpm3 - tmpm4;\n\n }\n\n for (int i = 0; i < 8; i++) {\n\n tmpm0 = out[my + 0][mx + i];\n tmpm1 = out[my + 1][mx + i];\n tmpm2 = out[my + 2][mx + i];\n tmpm3 = out[my + 3][mx + i];\n tmpm4 = out[my + 4][mx + i];\n tmpm5 = out[my + 5][mx + i];\n tmpm6 = out[my + 6][mx + i];\n tmpm7 = out[my + 7][mx + i];\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n out[my + 0][mx + i] = tmpm0 + tmpm7;\n out[my + 7][mx + i] = tmpm0 - tmpm7;\n out[my + 1][mx + i] = tmpm1 + tmpm6;\n out[my + 6][mx + i] = tmpm1 - tmpm6;\n out[my + 2][mx + i] = tmpm2 + tmpm5;\n out[my + 5][mx + i] = tmpm2 - tmpm5;\n out[my + 3][mx + i] = tmpm3 + tmpm4;\n out[my + 4][mx + i] = tmpm3 - tmpm4;\n }\n }\n }\n\n return new DoubleMatrix(in.getRows(), in.getColumns(), out);\n }", "public static Bitmap InvertColor(Bitmap src) {\n Bitmap bmOut = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig());\n // color info\n int A, R, G, B;\n int pixelColor;\n // image size\n int height = src.getHeight();\n int width = src.getWidth();\n\n // scan through every pixel\n for (int y = 0; y < height; y++) {\n for (int x = 0; x < width; x++) {\n // get one pixel\n pixelColor = src.getPixel(x, y);\n // saving alpha channel\n A = Color.alpha(pixelColor);\n // inverting byte for each R/G/B channel\n R = 255 - Color.red(pixelColor);\n G = 255 - Color.green(pixelColor);\n B = 255 - Color.blue(pixelColor);\n // set newly-inverted pixel to output image\n bmOut.setPixel(x, y, Color.argb(A, R, G, B));\n }\n }\n\n // return final bitmap\n return bmOut;\n\n }", "@Test\n public void testGetInversa() {\n System.out.println(\"getInversa\");\n double[][] mat = new double[][] {{120,111,721},{770,110,121},{115,417,221}};\n\n// double[][] mat = new double[][]{{476,555,678},{250,345,455},{551,145,725}};\n// double[][] mat = new double[][]{{478,592,327},{295,712,592},{674,417,556}};\n// double[][] mat = new double[][]{{130,150,121},{245,580,756},{567,445,624}};\n// double[][] mat = new double[][]{{553,721,317},{454,315,699},{640,755,418}};\n// double[][] mat = new double[][]{{338,687,437},{445,132,647},{523,459,147}};\n Matrix matrix = new Matrix(mat);\n Matrix expResult = null;\n Matrix result = utilsHill.getInversa(matrix);\n utilsHill.printMatrix(result);\n assertEquals(expResult, result);\n }" ]
[ "0.7058909", "0.69921196", "0.68320936", "0.657796", "0.6572723", "0.6470449", "0.6337791", "0.624794", "0.6168735", "0.6167877", "0.6145299", "0.6124837", "0.60772425", "0.60662717", "0.6063777", "0.59709835", "0.59510005", "0.5935766", "0.5919535", "0.5868522", "0.58615845", "0.5822208", "0.5743589", "0.57383156", "0.5727376", "0.57205856", "0.56483626", "0.5632576", "0.5579594", "0.5565135", "0.55538565", "0.552953", "0.5523132", "0.55198395", "0.5511382", "0.5482167", "0.5426454", "0.5418133", "0.5408169", "0.53939575", "0.53803426", "0.53303385", "0.53074044", "0.5298889", "0.5296174", "0.52919626", "0.52837986", "0.5279286", "0.52661335", "0.52516353", "0.5239051", "0.52263105", "0.5214333", "0.5209315", "0.51762444", "0.51744616", "0.51740414", "0.5167467", "0.51603", "0.51558423", "0.51531684", "0.5147025", "0.51406544", "0.51303554", "0.51104355", "0.51069576", "0.51026756", "0.50922036", "0.5088456", "0.50854105", "0.50850385", "0.5083715", "0.50691015", "0.50618416", "0.50604194", "0.5057721", "0.50519115", "0.5045671", "0.5039878", "0.5036897", "0.5034274", "0.50176907", "0.50142235", "0.50066257", "0.49984077", "0.4976574", "0.49420565", "0.49382314", "0.49268395", "0.4924908", "0.49183014", "0.49167866", "0.49143863", "0.49135897", "0.49092126", "0.4906623", "0.49063343", "0.49062023", "0.49016476", "0.4886808", "0.48791063" ]
0.0
-1
The convergence test takes the biggest difference between the old and the new vector and return true if that difference is below some threshold or if the number of iterations exeeded the maximum number allowed
public void setNewAlpha(){ retrieveAlpha(); retrieveReducerOutput(); double[] alphaVectorUpdate = new double[K]; double[] alphaGradientVector = new double[K]; double[] alphaHessianVector = new double[K]; double[] alphaVector = oldAlpha.clone(); double[] alphaSufficientStatistics = rDelta; int alphaUpdateIterationCount = 0; // update the alpha vector until converge boolean keepGoing = true; try { int decay = 0; double alphaSum = 0; for (int j = 0; j < K; j++) { alphaSum += alphaVector[j]; } while (keepGoing) { double sumG_H = 0; double sum1_H = 0; for (int i = 0; i < K; i++) { // compute alphaGradient alphaGradientVector[i] = D * (Gamma.digamma(alphaSum) - Gamma.digamma(alphaVector[i])) + alphaSufficientStatistics[i]; // compute alphaHessian alphaHessianVector[i] = -D * Gamma.trigamma(alphaVector[i]); if (alphaGradientVector[i] == Double.POSITIVE_INFINITY || alphaGradientVector[i] == Double.NEGATIVE_INFINITY) { throw new ArithmeticException("Invalid ALPHA gradient matrix..."); } sumG_H += alphaGradientVector[i] / alphaHessianVector[i]; sum1_H += 1 / alphaHessianVector[i]; } double z = D * Gamma.trigamma(alphaSum); double c = sumG_H / (1 / z + sum1_H); while (true) { boolean singularHessian = false; for (int i = 0; i < K; i++) { double stepSize = Math.pow(Parameters.DEFAULT_ALPHA_UPDATE_DECAY_FACTOR, decay) * (alphaGradientVector[i] - c) / alphaHessianVector[i]; if (alphaVector[i] <= stepSize) { // the current hessian matrix is singular singularHessian = true; break; } alphaVectorUpdate[i] = alphaVector[i] - stepSize; } if (singularHessian) { // we need to further reduce the step size decay++; // recover the old alpha vector alphaVectorUpdate = alphaVector; if (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) { break; } } else { // we have successfully update the alpha vector break; } } // compute the alpha sum and check for alpha converge alphaSum = 0; keepGoing = false; for (int j = 0; j < K; j++) { alphaSum += alphaVectorUpdate[j]; if (Math.abs((alphaVectorUpdate[j] - alphaVector[j]) / alphaVector[j]) >= Parameters.DEFAULT_ALPHA_UPDATE_CONVERGE_THRESHOLD) { keepGoing = true; } } if (alphaUpdateIterationCount >= Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_ITERATION) { keepGoing = false; } if (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) { break; } alphaUpdateIterationCount++; alphaVector = alphaVectorUpdate; } } catch (IllegalArgumentException iae) { System.err.println(iae.getMessage()); iae.printStackTrace(); } catch (ArithmeticException ae) { System.err.println(ae.getMessage()); ae.printStackTrace(); } newAlpha = alphaVector; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean convergenceTest(int iteration) throws IOException {\n\t\tfs = FileSystem.get(conf);\n\t\tPath data = new Path(dataPath + (iteration - 1) + \".seq\");\n\n\t\tSequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);\n\t\tIntWritable key = new IntWritable();\n\t\tDoubleWritable value = new DoubleWritable();\n\n\t\tint index = 0;\n\t\tloglikelihood = 0;\n\t\twhile (reader.next(key, value)) {\n\t\t\tloglikelihood += value.get();\n\t\t\tindex++;\n\t\t}\n\t\tloglikelihood /= index;\n\n\t\treader.close();\n\n\t\tfs.delete(path, true);\n\t\tif (fs.exists(data))\n\t\t\tfs.delete(data, true);\n\n\t\tSystem.out.println(\"NEW LOG LIKELIHOOD : \" + loglikelihood + \"\\n\"\n\t\t\t\t+ \"OLD LOG LIKELIHOOD : \" + loglikelihood_old);\n\t\tif (Math.abs(loglikelihood - loglikelihood_old) > CONST_CONVERGENCE) {\n\t\t\tflag = true;\n\t\t\tloglikelihood_old = loglikelihood;\n\t\t} else {\n\t\t\tflag = false;\n\t\t}\n\t\treturn flag;\n\t}", "private static boolean findTermination(int count, double[][] oldM, double[][] m){\n\t boolean check = true;\n\t if(count + 2 > MaxCount){\n\t \tcheck = false;\t \t\n\t }\t \n\n\t if (!IgnoreMaxError){\n\t \tdouble err = 0.0;\n\t\t for (int i = 0; i <m.length; i++){\n\t double sumEuclidDistance = 0.0;\n\t for (int j=0; j<m[i].length; j++){\n\t sumEuclidDistance += Math.pow((m[i][j] - oldM[i][j]), 2);\n\t }\n\t\t err = Math.sqrt(sumEuclidDistance);\n\n\t\t if ((err < MaxError && err > 0) || (err == 0 && count > 1)){\n\t\t check = false;\n\t\t }\n\t\t }\n\t\t currentError = err;\n\t } \n\n\t return check;\n }", "private boolean convergence(List<Page> pages) {\n\t\tdouble aveHubDelta = 100;\n\t\tdouble aveAuthDelta = 100;\n\t\tif (pages == null) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// get current values from pages\n\t\tdouble[] currHubVals = new double[pages.size()];\n\t\tdouble[] currAuthVals = new double[pages.size()];\n\t\tfor (int i = 0; i < pages.size(); i++) {\n\t\t\tPage currPage = pages.get(i);\n\t\t\tcurrHubVals[i] = currPage.hub;\n\t\t\tcurrHubVals[i] = currPage.authority;\n\t\t}\n\t\tif (prevHubVals == null || prevAuthVals == null) {\n\t\t\tprevHubVals = currHubVals;\n\t\t\tprevAuthVals = currAuthVals;\n\t\t\treturn false;\n\t\t}\n\t\t// compare to past values\n\t\taveHubDelta = getAveDelta(currHubVals, prevHubVals);\n\t\taveAuthDelta = getAveDelta(currAuthVals, prevAuthVals);\n\t\tif (aveHubDelta + aveAuthDelta < DELTA_TOLERANCE || (Math.abs(prevAveHubDelta - aveHubDelta) < 0.01\n\t\t\t\t&& Math.abs(prevAveAuthDelta - aveAuthDelta) < 0.01)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tprevHubVals = currHubVals;\n\t\t\tprevAuthVals = currAuthVals;\n\t\t\tprevAveHubDelta = aveHubDelta;\n\t\t\tprevAveAuthDelta = aveAuthDelta;\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean stop(int iter, int lastImprovement, long start) {\n if (USE_TIME)\n return System.currentTimeMillis() - start >= MAX_TIME;\n else\n return iter >= MAX_ITERATION || lastImprovement >= MAX_ITERATION / 5;\n }", "boolean updateValue() {\n boolean ret;\n\n if (Math.abs(curUtilityValue - nextUtilityValue) < Math.abs(curUtilityValue) * MAX_ERR_PERCENT / 100)\n ret = true;\n else {\n ret = false;\n // System.out.println(\" no match cell: x: \"+x+\" y: \"+y);\n }\n curUtilityValue = nextUtilityValue;\n return ret;\n\n }", "@Override\n protected boolean stoppingCriteriaSatisfied(KPMPSolution generatedSolution, RandomStepFunction stepFunction) {\n numberOfIterations++;\n numberOfIterationsWithoutImprovement++;\n KPMPSolutionChecker solutionChecker = new KPMPSolutionChecker();\n int crossingsOnOriginalPage = solutionChecker.getCrossingNumberOfEdge(bestSolution.getSpineOrder(), bestSolution.getEdgePartition(), originalPageIndex, edge);\n int crossingsOnNewPage = solutionChecker.getCrossingNumberOfEdge(generatedSolution.getSpineOrder(), generatedSolution.getEdgePartition(), newPageIndex, edge);\n if (crossingsOnNewPage < crossingsOnOriginalPage) {\n bestSolution = generatedSolution;\n numberOfIterationsWithoutImprovement = 0;\n\n crossingNumber = crossingNumber - (crossingsOnOriginalPage - crossingsOnNewPage);\n }\n return numberOfIterations >= Main.localSearchIterationLimit || numberOfIterations >= bestSolution.getEdgePartition().size() * bestSolution.getNumberOfPages() || numberOfIterationsWithoutImprovement >= Main.iterationMultiplier || ((System.nanoTime() - Main.START) / 1000000) >= (Main.secondsBeforeStop * 1000) || numberOfIterations >= Main.localSearchIterationLimit;\n }", "@Override\n\tprotected boolean isStoppingConditionReached() {\n\t\t\n\t\tboolean flag = iteration > maxIteration || \n\t\t\t\tlocalSearchTime > maxLocalSearchTime || \n\t\t\t\t!isUpdate;\n\t\tisUpdate = false ;\n\t\treturn flag ;\n\t}", "private boolean terminateSearch( boolean converged ) {\n\t\tthis.hasConverged = converged;\n\t\treturn true;\n\t}", "public boolean hasConverged (final NeuralNetwork anotherNet) {\n final double weightDiff = averDiff(anotherNet);\n final double convergeThreshold = learnRate * CONVERGE_FACTOR;\n if (Double.compare(weightDiff, convergeThreshold) < 0) {\n return true;\n } else {\n return false;\n }\n }", "private boolean caculate(double currentValue, double lastValue, NotifyStrategy.Expression expr,\n Map<String, Object> judgeResult) {\n\n double diff = currentValue - lastValue;\n double upperLimit = 0;\n String upperLimitString = expr.getUpperLimit();\n\n // get upperLimit\n if (upperLimitString.contains(\"#\")) {\n upperLimit = Double.parseDouble(upperLimitString.substring(upperLimitString.indexOf('#') + 1));\n }\n else if (upperLimitString.contains(\"%\")) {\n upperLimit = Double.parseDouble(upperLimitString.substring(0, upperLimitString.indexOf('%')));\n diff = diff * 100 / lastValue;\n }\n else if (!upperLimitString.contains(\"*\")) {\n upperLimit = Double.parseDouble(upperLimitString);\n }\n\n if (!upperLimitString.contains(\"*\") && diff > upperLimit) {\n judgeResult.put(\"actualValue\", String.format(\"%.2f\", diff) + (upperLimitString.contains(\"%\") ? \"%\" : \"\"));\n judgeResult.put(\"expectedValue\", upperLimitString);\n judgeResult.put(\"upperORlower\", \"upper\");\n\n return true;\n }\n\n diff = currentValue - lastValue;\n double lowerLimit = 0;\n String lowerLimitString = expr.getLowerLimit();\n\n // get lowerLimit\n if (lowerLimitString.contains(\"#\")) {\n lowerLimit = 0 - Double.parseDouble(lowerLimitString.substring(lowerLimitString.indexOf('#') + 1));\n }\n else if (lowerLimitString.contains(\"%\")) {\n lowerLimit = Double.parseDouble(lowerLimitString.substring(0, lowerLimitString.indexOf('%')));\n diff = diff * 100 / lastValue;\n }\n else if (!lowerLimitString.contains(\"*\")) {\n lowerLimit = Double.parseDouble(lowerLimitString);\n }\n\n if (!lowerLimitString.contains(\"*\") && diff < 0 - lowerLimit) {\n judgeResult.put(\"actualValue\", String.format(\"%.2f\", diff) + (lowerLimitString.contains(\"%\") ? \"%\" : \"\"));\n judgeResult.put(\"expectedValue\", lowerLimitString);\n judgeResult.put(\"upperORlower\", \"lower\");\n\n return true;\n }\n\n return false;\n }", "public void testComparisons() {\n\tfinal double small = Math.pow(2.0, -42);\n\n\t// Input: a, b\n\tdouble[][] input = new double[][] { new double[] { 1, 1 },\n\t\tnew double[] { 1, 2 }, new double[] { 1, 1 - small / 10 },\n\t\tnew double[] { 1, 1 + small / 10 },\n\n\t\tnew double[] { 0, 1 }, new double[] { 0, 0 },\n\t\tnew double[] { 0, -1 }, new double[] { 0, small / 100 },\n\t\tnew double[] { 2100000001.0001, 2100000001.0003 }, };\n\n\t// Output: less, equals\n\tboolean[][] output = new boolean[][] { new boolean[] { false, true },\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true },\n\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true }, };\n\n\tfor (int i = 0; i < input.length; ++i) {\n\t boolean l = StandardFloatingPointComparator.getDouble().less(\n\t\t input[i][0], input[i][1]);\n\t boolean e = StandardFloatingPointComparator.getDouble().equals(\n\t\t input[i][0], input[i][1]);\n\n\t boolean ne = StandardFloatingPointComparator.getDouble().notEquals(\n\t\t input[i][0], input[i][1]);\n\t boolean le = StandardFloatingPointComparator.getDouble()\n\t\t .lessOrEquals(input[i][0], input[i][1]);\n\t boolean g = StandardFloatingPointComparator.getDouble().greater(\n\t\t input[i][0], input[i][1]);\n\t boolean ge = StandardFloatingPointComparator.getDouble()\n\t\t .greaterOrEquals(input[i][0], input[i][1]);\n\n\t boolean less = output[i][0];\n\t boolean equals = output[i][1];\n\n\t boolean notEquals = !equals;\n\t boolean lessOrEquals = less || equals;\n\t boolean greater = !lessOrEquals;\n\t boolean greaterOrEquals = !less;\n\n\t assertFalse(l != less);\n\t assertFalse(g != greater);\n\t assertFalse(e != equals);\n\t assertFalse(ne != notEquals);\n\t assertFalse(le != lessOrEquals);\n\t assertFalse(ge != greaterOrEquals);\n\t}\n }", "public boolean feasibilityTest(int candidateValue, int amount, int changeGenerated ){\n\n\t\t//-----------------------------\n\t\t//Output Variable --> InitialValue\n\t\t//-----------------------------\n\n\t\tif (candidateValue + changeGenerated <= amount) {\n\t\t\treturn true;\n\t\t}\n\t\t//-----------------------------\n\t\t//Output Variable --> Return FinalValue\n\t\t//-----------------------------\t\t\n\t\treturn false;\t\t\n\t}", "@Override\n protected boolean stoppingCriteriaSatisfied(KPMPSolution generatedSolution, FirstImprovementStepFunction stepFunction) {\n KPMPSolutionChecker solutionChecker = new KPMPSolutionChecker();\n int crossingsOnOriginalPage = solutionChecker.getCrossingNumberOfEdge(bestSolution.getSpineOrder(), bestSolution.getEdgePartition(), originalPageIndex, edge);\n int crossingsOnNewPage = solutionChecker.getCrossingNumberOfEdge(generatedSolution.getSpineOrder(), generatedSolution.getEdgePartition(), newPageIndex, edge);\n if (crossingsOnNewPage < crossingsOnOriginalPage) {\n bestSolution = generatedSolution;\n return true;\n }\n if (index == bestSolution.getEdgePartition().size() && pageCounter != bestSolution.getNumberOfPages() - 1) {\n index = 0;\n pageCounter++;\n }\n return ((System.nanoTime() - Main.START) / 1000000) >= (Main.secondsBeforeStop * 1000) || index == bestSolution.getEdgePartition().size() && pageCounter == bestSolution.getNumberOfPages() - 1;\n }", "@Override\n protected boolean stoppingCriteriaSatisfied(KPMPSolution generatedSolution, BestImprovementStepFunction stepFunction) {\n KPMPSolutionChecker solutionChecker = new KPMPSolutionChecker();\n int crossingsOnOriginalPage = solutionChecker.getCrossingNumberOfEdge(bestSolution.getSpineOrder(), bestSolution.getEdgePartition(), originalPageIndex, edge);\n int crossingsOnNewPage = solutionChecker.getCrossingNumberOfEdge(generatedSolution.getSpineOrder(), generatedSolution.getEdgePartition(), newPageIndex, edge);\n if (crossingsOnNewPage < crossingsOnOriginalPage) {\n bestSolution = generatedSolution;\n index = 0;\n pageCounter = 0;\n\n crossingNumber = crossingNumber - (crossingsOnOriginalPage - crossingsOnNewPage);\n\n //assert(crossingNumber == new KPMPSolutionChecker().getCrossingNumber(bestSolution));\n }\n if (index == bestSolution.getEdgePartition().size() && pageCounter != bestSolution.getNumberOfPages() - 1) {\n index = 0;\n pageCounter++;\n }\n return ((System.nanoTime() - Main.START) / 1000000) >= (Main.secondsBeforeStop * 1000) || index == bestSolution.getEdgePartition().size() && pageCounter == bestSolution.getNumberOfPages() - 1 || numberOfIterations >= Main.localSearchIterationLimit;\n }", "public boolean isMaximumBetter(){\n return false;\n }", "@Override\n protected boolean isFinished() {\n return Math.abs(m_currentError) <= constants.tolerance;\n }", "Integer getMaxSuccessiveDeltaCycles();", "private boolean performLineSearch() {\n\t\t// if true then it can't iterate any more\n\t\tif( lineSearch.iterate() ) {\n\t\t\t// see if the line search failed\n\t\t\tif( !lineSearch.isConverged() ) {\n\t\t\t\tif( firstStep ) {\n\t\t\t\t\t// if it failed on the very first step then it might have been too large\n\t\t\t\t\t// try halving the step size\n\t\t\t\t\tinitialStep /= 2;\n\t\t\t\t\tif( initialStep != 0 ) {\n\t\t\t\t\t\tinvokeLineInitialize(fx, maxStep);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif( verbose != null && verboseLevel != 0 ) {\n\t\t\t\t\t\t\tverbose.println(\"Initial step reduced to zero\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn terminateSearch(false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn terminateSearch(false);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfirstStep = false;\n\t\t\t}\n\n\t\t\t// update variables\n\t\t\tdouble step = lineSearch.getStep();\n\n\t\t\t// save the new x\n\t\t\tSystem.arraycopy(function.getCurrentState(),0,x.data,0,N);\n\t\t\t// compute the change in the x\n\t\t\tfor( int i = 0; i < N; i++ )\n\t\t\t\ts.data[i] = step * searchVector.data[i];\n\t\t\tupdated = true;\n\n\t\t\t// convergence tests\n\t\t\t// function value at end of line search\n\t\t\tdouble fstp = lineSearch.getFunction();\n\n\t\t\tif( verbose != null ) {\n\t\t\t\tdouble actualStep = NormOps_DDRM.fastNormF(s);\n\t\t\t\tdouble ftest_val = Math.abs(fstp-fx)/Math.abs(fx);\n\t\t\t\tdouble gtest_val = Math.abs(derivAtZero);\n\n\t\t\t\tverbose.printf(\"%-4d %9.3E %10.3E %9.3E %9.3E %9.3E %6.3f\\n\",\n\t\t\t\t\t\titerations, fstp, fstp - fx,actualStep,ftest_val,gtest_val, maxStep);\n\t\t\t}\n\n\t\t\t// see if the actual different and predicted differences are smaller than the\n\t\t\t// error tolerance\n\t\t\tif( Math.abs(fstp-fx) <= ftol*Math.abs(fx) || Math.abs(derivAtZero) < gtol ) {\n\t\t\t\tif( verbose != null ) {\n\t\t\t\t\tverbose.println(\"converged after line search.\");\n\t\t\t\t}\n\t\t\t\treturn terminateSearch(true);\n\t\t\t}\n\n\t\t\tif( fstp > fx ) {\n\t\t\t\tthrow new RuntimeException(\"Bug! Worse results!\");\n\t\t\t}\n\n\t\t\t// current function value is now the previous\n\t\t\tfx = fstp;\n\n\t\t\t// start the loop again\n\t\t\tmode = 0;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean isFinished() {\n double[] positions = drivetrain.getPositions();\n\n return Math.abs(positions[0] - targetDistance) <= allowedError && Math.abs(positions[1] - targetDistance) <= allowedError;\n }", "public boolean isWithinLimit() {\n return assumptionsFailed.get() < assumptionLimit;\n }", "boolean isPerfect(double score);", "@Test\n\tpublic void increasingSignal() {\n\t\tDataset xData = data(0.0, 1.0);\n\t\tDataset yData = data(0.0, 1.0);\n\n\t\tdouble target = 0.4;\n\t\tdouble tolerance = 0.01;\n\n\t\tdouble expectedX = target - tolerance;\n\t\tdouble expectedY = target - tolerance;\n\n\t\ttest(xData, yData, target, tolerance, expectedX, expectedY);\n\t}", "protected boolean update_best_value(Knapsack knapsack) {\n iteration+=1;\n if (knapsack.get_value()>best_value)\n {\n best_value=knapsack.get_value();\n return true;\n }\n if (iteration%100000==0)\n System.out.println(\"iteration:\"+iteration+\" time:\"+System.currentTimeMillis()+\n \" best_value:\"+best_value);\n return false;\n }", "public static boolean almost_equals(double a, double b, long maxUlps) {\n if (a == b) { // if two numbers are equal, then the are almost_equal\n return true;\n }\n\n // special case of comparing to zero.\n if (a == 0.0 || b == 0.0) {\n double comp = 1.0e-13; // should correspond to PRECISION_DEFAULT;\n if (maxUlps == PRECISION5) comp = 1.0e-5;\n if (maxUlps == PRECISION7) comp = 1.0e-7;\n if (maxUlps == PRECISION9) comp = 1.0e-9;\n if (maxUlps == PRECISION13) comp = 1.0e-13;\n if (Math.abs(a) < comp && Math.abs(b) < comp) {\n return true;\n }\n }\n\n //if (Double.isNaN(a) || Double.isNaN(b)) { // this operation is slooooooow\n // return false;\n // }\n if (!(a < b || b < a)) { // idiom to filter out NaN's\n return false;\n }\n if (Double.isInfinite(a) || Double.isInfinite(b)) {\n return false;\n }\n\n\n long aInt = Double.doubleToLongBits(a);\n\n // Make aInt lexicographically ordered as a twos-complement long\n if (aInt < 0)\n aInt = 0x8000000000000000l - aInt;\n\n // Make bInt lexicographically ordered as a twos-complement long\n long bInt = Double.doubleToLongBits(b);\n\n if (bInt < 0)\n bInt = 0x8000000000000000l - bInt;\n\n long intDiff = Math.abs(aInt - bInt); // This is valid because IEEE-754\n // doubles are required to be\n // lexically ordered\n\n if (intDiff <= maxUlps) {\n return true;\n }\n\n return false;\n }", "public double tolerance() {return tolerance;}", "private boolean done(Complex[] a, Complex[] b) {\n\t\tboolean unchanged = true;\n\t\tComplex delta;\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tdelta = a[i].subtract(b[i]);\n\t\t\tunchanged &= Math.abs(delta.getReal()) < epsilon\n\t\t\t\t\t&& Math.abs(delta.getImaginary()) < epsilon;\n\t\t}\n\t\treturn unchanged;\n\t}", "private static boolean _close(Option<Double> a, Option<Double> b, Double tolerance) {\n return a.flatMap(a0 -> b.map(b0 -> Math.abs(a0 - b0) <= tolerance)).getOrElse(false);\n }", "protected boolean isFinished() {\n \tdouble changeInX = targetX - Robot.sensors.getXCoordinate();\n \tdouble changeInY = targetY - Robot.sensors.getYCoordinate();\n \tdouble distance = Math.sqrt(Math.pow(changeInX, 2) + Math.pow(changeInY, 2));\n return distance < 8 || System.currentTimeMillis() >= stopTime;\n }", "private boolean equals(double x, double y) {\n return Math.abs(x - y) <= TOLERANCE;\n }", "boolean requiresRestart(Operation nextBestOp) {\n\t\t\treturn nextBestOp.val == Integer.MAX_VALUE;\n\n\t\t}", "private static boolean isDistanceOK(double[] diff) {\n\t\tfor (double d : diff) {\n\t\t\tif (Math.abs(d) > MAX_PIXEL_DISTANCE) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tpublic void nearestSmallerEqFibTest() {\n\t\tAssert.assertTrue(ifn.nearestSmallerEqFib(30) == 21);\n\t}", "private void verifyGradient(Instance instance,\r\n\t\t\tMap<Integer, Double> mpFeatureIdToGradient) {\r\n\t\tdouble before = getObjectiveFunctionValueForSingleInstanceOriginal(instance);\r\n\t\tfor (int featureId : mpFeatureIdToGradient.keySet()) {\r\n\t\t\tdouble delta = param.gradientVerificationDelta;\r\n\t\t\tx[featureId][0] += delta;\r\n\t\t\tsum_x[0] += delta;\r\n\t\t\tdouble after = getObjectiveFunctionValueForSingleInstanceOriginal(instance);\r\n\t\t\tdouble gradientCalculated = mpFeatureIdToGradient.get(featureId);\r\n\t\t\tif (Math.abs(before + delta * gradientCalculated - after) > Constant.SMALL_THAN_AS_ZERO) {\r\n\t\t\t\tSystem.out.println(before + delta * gradientCalculated);\r\n\t\t\t\tSystem.out.println(after);\r\n\t\t\t}\r\n\t\t\tExceptionUtility\r\n\t\t\t\t\t.assertAsException(\r\n\t\t\t\t\t\t\tMath.abs(before + delta * gradientCalculated\r\n\t\t\t\t\t\t\t\t\t- after) < Constant.SMALL_THAN_AS_ZERO,\r\n\t\t\t\t\t\t\t\"Gradient verification fails!\");\r\n\t\t\t// Revert the actions.\r\n\t\t\tx[featureId][0] -= delta;\r\n\t\t\tsum_x[0] -= delta;\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean isStoppingConditionReached() {\n\n\t\tlong currentComputingTime = System.currentTimeMillis() - iterationStartingTime;\n\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByTime()) // byTime\n\t\t\treturn super.isStoppingConditionReached() || currentComputingTime > durationThreshold;\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByPrematureConvergence()) // byPrematureConvergence\n\t\t\treturn super.isStoppingConditionReached() || isStagnantState();\n\t\t// computeStagnantState\n\t\tif (Configurator.eINSTANCE.isSearchBudgetByPrematureConvergenceAndTime()) // byBoth\n\t\t\treturn super.isStoppingConditionReached() || isStagnantState() || currentComputingTime > durationThreshold;\n\t\treturn super.isStoppingConditionReached(); // classic\n\n\t}", "private void checkStability() {\n double maxDeviation = Double.NEGATIVE_INFINITY;\n\n DeviationIterator itr = new DeviationIterator(currentOutcome, nActs);\n while (itr.hasNext()) {\n int[] devOutcome = itr.next();\n\n // this shouldn't happen\n if (eGame.getNumSamples(devOutcome) <= 0) {\n System.out.println(\"BRD: checking equilibrium with unsampled deviations!\");\n System.out.println(\"Current: \" + Arrays.toString(currentOutcome));\n System.out.println(\"Unsampled: \" + Arrays.toString(devOutcome));\n return;\n }\n\n double devBenefit = eGame.getPayoff(devOutcome, itr.getDeviatingPlayer()) -\n eGame.getPayoff(currentOutcome, itr.getDeviatingPlayer());\n\n maxDeviation = Math.max(maxDeviation, devBenefit);\n\n // terminate early; not better than one we have already confirmed\n if (maxDeviation >= confirmedStability) return;\n }\n\n if (maxDeviation < confirmedStability) {\n confirmedStability = maxDeviation;\n mostStableConfirmed = currentOutcome.clone();\n if (samplesToConfirmEquilibrium < 0 &&\n confirmedStability <= 0) {\n samplesToConfirmEquilibrium = eGame.getTotalNumSamples();\n }\n }\n }", "@Test\n\tpublic void testMaximumNumber() {\n\t\tdouble tmpRndVal = 0.0;\n\t\tdouble tmpRndVal2 = 0.0;\n\t\tdouble tmpResult = 0.0;\n\t\t\n\t\t//testing with negative numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomNegativeNumbers();\n\t\t\ttmpRndVal2 = doubleRandomNegativeNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue( (tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) );\n\t\t}\n\t\t\n\t\t//testing with positive numbers\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\ttmpRndVal = doubleRandomPositiveNumbers();\n\t\t\ttmpRndVal2 = doubleRandomPositiveNumbers();\n\t\t\ttmpResult = Math.max(tmpRndVal, tmpRndVal2);\n\t\t\tassertTrue((tmpResult == ac.maximumNumber(tmpRndVal, tmpRndVal2))\n\t\t\t|| (0.0 == ac.maximumNumber(tmpRndVal, tmpRndVal2)) \n\t\t\t|| (-0.123456789 == ac.maximumNumber(tmpRndVal, tmpRndVal2)));\n\t\t}\n\t\t\n\t\t//testing with zero\n\t\tdouble zero = 0.0;\n\t\tdouble inpResult = 0.0;\n\t\t\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tinpResult = Math.max(zero, zero);\n\t\t\t//System.out.println(inpResult + \" ############\");\n\t\t\tassertTrue( (inpResult == ac.maximumNumber(zero, zero)) );\n\t\t}\n\t\t\n\t}", "boolean evolveCurrentAngle() {\n float checkSum = 0;\n for (int i = 0; i < 2; i++) {\n float delta = target_angle[i] - angle[i];\n float sign = 1;\n if (Math.abs(delta) > Math.PI) {\n // go the other way\n boolean isPos = delta > 0;\n sign = -1;\n delta = (float) (2 * Math.PI - Math.abs(delta));\n if (!isPos) delta = -delta;\n }\n angle[i] += sign * 0.1f * delta;\n if (angle[i] > Math.PI) angle[i] = (float) -(2 * Math.PI - angle[i]);\n if (angle[i] < -Math.PI) angle[i] = (float) (2 * Math.PI - angle[i]);\n checkSum += Math.abs(delta);\n }\n\n float delta = target_angle[2] - angle[2];\n float sign = 1;\n if (Math.abs(delta) > Math.PI / 2) {\n // go the other way\n boolean isPos = delta > 0;\n sign = -1;\n delta = (float) (Math.PI - Math.abs(delta));\n if (!isPos) delta = -delta;\n }\n angle[2] += sign * 0.1f * delta;\n if (angle[2] > Math.PI / 2) angle[2] = (float) -(Math.PI - angle[2]);\n if (angle[2] < -Math.PI / 2) angle[2] = (float) (Math.PI - angle[2]);\n checkSum += Math.abs(delta);\n\n if (checkSum < 0.0001) {\n for (int i = 0; i < target_angle.length; i++) {\n angle[i] = target_angle[i];\n }\n return false;\n }\n return true;\n }", "boolean testDependence(DependenceVector dv);", "@Model\n private boolean isValidMaxVelocity(double max){\n \treturn !(max > SPEED_OF_LIGHT || !Helper.isValidDouble(max) || max < 0);\n }", "boolean improvesRatio(List<Entity> currentRow, double nextEntity, double length) {\n\n if (currentRow.size() == 0) {\n return true;\n }\n\n double minCurrent = Double.MAX_VALUE, maxCurrent = Double.MIN_VALUE;\n for (Entity entity : currentRow) {\n if (getNormalizedWeight(entity) > maxCurrent) {\n maxCurrent = getNormalizedWeight(entity);\n }\n\n if (getNormalizedWeight(entity) < minCurrent) {\n minCurrent = getNormalizedWeight(entity);\n }\n }\n\n double minNew = (nextEntity < minCurrent) ? nextEntity : minCurrent;\n double maxNew = (nextEntity > maxCurrent) ? nextEntity : maxCurrent;\n\n double sumCurrent = 0;\n for (Entity entity : currentRow) {\n sumCurrent += getNormalizedWeight(entity);\n }\n double sumNew = sumCurrent + nextEntity;\n\n double currentRatio = max(pow(length, 2) * maxCurrent / pow(sumCurrent, 2),\n pow(sumCurrent, 2) / (pow(length, 2) * minCurrent));\n double newRatio = max(pow(length, 2) * maxNew / pow(sumNew, 2),\n pow(sumNew, 2) / (pow(length, 2) * minNew));\n\n return currentRatio >= newRatio;\n }", "public boolean goodEnough(HashMap<RouteState, ActionValue<RouteAction>> v0, HashMap<RouteState, ActionValue<RouteAction>> v) {\r\n\t\tdouble maxDiff = 0.0;\r\n\t\tfor (RouteState state : v0.keySet()) {\r\n\t\t\tdouble diff = Math.abs(v0.get(state).value - v.get(state).value);\r\n\t\t\tif (diff > maxDiff) {\r\n\t\t\t\tmaxDiff = diff;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn maxDiff < epsilon; //2*epsilon*discount/(1-discount);\r\n\t}", "private boolean isUtilityConverged(Map<ClassInfo, BigDecimal> previousUtilities) {\n\t\tboolean converged = true;\n\t\tMap<ClassInfo, BigDecimal> currentUtilities = getUtilities();\n\t\t\n\t\tif (currentUtilities.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// no previous utilities, so update with current ones and return not converged\n\t\tif (previousUtilities.isEmpty()) {\n\t\t\tpreviousUtilities.putAll(currentUtilities);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Use current utilities to compare with previousUtilities\n\t\tfor (ClassInfo classInfo : currentUtilities.keySet()) {\n\t\t\tBigDecimal currentUtility = currentUtilities.get(classInfo);\n\t\t\tBigDecimal previousUtility = previousUtilities.get(classInfo);\n\t\t\tBigDecimal utilityGap = currentUtility.subtract(previousUtility).abs();\n\t\t\tif (utilityGap.compareTo(MIN_UTILITY_GAP) <= 0) {\n\t\t\t\tconverged = converged && true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconverged = false;\n\t\t\t}\n\t\t}\n\t\tpreviousUtilities.clear();\n\t\tpreviousUtilities.putAll(currentUtilities);\n\t\treturn converged;\n\t}", "private static void assertEquals(double expected, double actual, double delta) {\n if (Math.abs(actual - expected) >= delta) {\n System.err.println(\"Test Failure! Expected: \" + expected + \", actual: \" + actual);\n doesPass = false;\n (new Exception()).printStackTrace(); // trick to show stack trace to identify failure\n }\n }", "public int compare(Tensor newCost, Tensor oldCost) {\n if (oldCost.length() != newCost.length() || oldCost.length() != slack.length())\n throw TensorRuntimeException.of(oldCost, newCost, slack);\n int cmp = 0;\n for (int index = 0; index < oldCost.length() && cmp == 0; ++index) {\n Scalar min = oldCost.Get(index);\n if (Scalars.isZero(min))\n cmp = Scalars.compare(newCost.Get(index), min);\n else {\n Scalar diffRatio = newCost.Get(index).subtract(min).divide(min);\n cmp = Scalars.lessEquals(diffRatio.abs(), slack.Get(index)) //\n ? 0\n : Sign.of(diffRatio).number().intValue();\n }\n }\n return cmp;\n }", "public boolean almostEqual(double a, double b);", "@Test\r\n public void testMinMaxVector() {\r\n System.out.println(\"minMaxVector\");\r\n int[] vector = {1,8,3,4};\r\n VectorHelper instance = new VectorHelper();\r\n int[]expResult= {1,8};\r\n int []result=instance.minMaxVector(vector);\r\n assertArrayEquals(expResult,result);\r\n \r\n }", "public boolean checkAvailability(int x0, int y0, int newX, int newY) {\n\n int vectorX = newX - x0;\n int vectorY = newY - y0;\n\n if ((Math.abs(vectorX) == 1 && Math.abs(vectorY) == 2) ||\n (Math.abs(vectorX) == 2 && Math.abs(vectorY) == 1)) {\n return true;\n }\n\n return false;\n }", "@Override\n public boolean acceptMove(int baselineObjectiveValue, int newObjectiveValue) {\n if (newObjectiveValue > baselineObjectiveValue) {\n return true;\n }\n else {\n return false;\n }\n }", "public boolean shouldUpdate() {\n\t\tBinaryInstance binInst = (BinaryInstance) (this._instance);\n\t\tBinaryFeatures binFeats = (BinaryFeatures) binInst.getFeatures();\n\t\tFeatureVector instFeaturesVector = binFeats.getFeatureVector();\n\t\tdouble prediction = MathTools.dotProduct(instFeaturesVector, this._mu);\n\n\t\t// Should we make an update?\n\t\t// Sigma * X\n\t\tthis._sigma_x = MathTools.product(this._sigma, instFeaturesVector);\n\t\t// B = x' * sigma * x;\n\t\tdouble B = FeatureVector.dotProduct(this._sigma_x, instFeaturesVector);\n\t\tBinaryLabel binLabel = (BinaryLabel) binInst.getLabel();\n\t\tdouble Y = binLabel.tag;\n\n\t\tdouble m = prediction * Y;\n\n\t\t// update?\n\t\tthis._update = (m <= this._phi * B) && (B != 0);\n\n\t\tif (this._update) {\n\t\t\tdouble term1 = 1 + 2 * this._phi * m;\n\t\t\tdouble term2 = m - this._phi * B;\n\t\t\tthis._alpha = (-term1 + Math.sqrt(Math.pow(term1, 2) - 8\n\t\t\t\t\t* this._phi * term2))\n\t\t\t\t\t/ (4 * this._phi * B);\n\t\t\tthis._factor = (2 * this._alpha * this._phi)\n\t\t\t\t\t/ (1 + 2 * this._alpha * this._phi * B);\n\t\t}\n\n\t\treturn this._update;\n\t}", "@Override\n public void testIncreasingTolerance() {\n doTestIncreasingTolerance(Decimal64Field.getInstance(), 1.3, 1.0e-12);\n }", "@Test\n public void testIsInLimitUpper() {\n Assertions.assertFalse(saab.isInLimit(.5, 1.5, 2.0));\n }", "private boolean checkGreedyDefense() {\r\n return enTotal.get(2)+1 < myTotal.get(2) && enTotal.get(0)+1 < myTotal.get(0);\r\n }", "boolean updatePolicy() {\n double maxUtilityVal = -Double.MAX_VALUE;\n //if(x==19&&y==0)\n // System.out.println(\"minVal: \"+maxUtilityVal);\n for (int i = 0; i < AbsoluteDirection.values().length; i++) {\n double proposedValue = calculateUtility(AbsoluteDirection.values()[i]);\n // if(x==19&&y==0) {\n // System.out.println(\"Proposed value at cell \" + x + \", \" + y + \" is\" + proposedValue);\n\n // }\n if (proposedValue > maxUtilityVal) {\n policyDirection = AbsoluteDirection.values()[i];\n nextUtilityValue = proposedValue; // update curValues to nextValues at the end of iteration\n maxUtilityVal = proposedValue;\n }\n }\n\n return true;\n }", "public boolean LocalImprovementDNF (TableVar Variables, TableDat Examples) {\r\n IndDNF solucion = new IndDNF(Variables.getNVars(), Variables);\r\n QualityMeasures res, new_res;\r\n int mejor, cambio;\r\n int[] indices = new int[Variables.getNVars()];\r\n float[] evalua = new float[Variables.getNVars()];\r\n boolean improvement = true;\r\n boolean retValue = false;\r\n int control;\r\n\r\n // Store the pos of the best guy in \"mejor\"\r\n mejor = poblac.getBestGuy();\r\n\r\n // Copy in \"solucion\" the rule to improve\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n for (int j=0; j<=Variables.getNLabelVar(i); j++)\r\n solucion.setCromElemGene(i, j, poblac.getCromElemGene(mejor,i,j));\r\n\r\n // Evaluate de rule and get the measures\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++; // Increment the number of trials\r\n res = solucion.getMedidas();\r\n\r\n control = 1;\r\n\r\n while ((improvement)&&(control<Variables.getNVars())) {\r\n improvement = false; // By now, there is no improvement\r\n for (int i=0; i<Variables.getNVars(); i++) {\r\n indices[i]=i;\r\n // It does not matter if the variable is discrete or continuous\r\n if (solucion.getCromElemGene(i,Variables.getNLabelVar(i))==0)\r\n // If variable does not actually takes part in the rule\r\n evalua[i] = -1;\r\n else {\r\n // The initial value is not stored cause we know the value is 1\r\n solucion.setCromElemGene(i, Variables.getNLabelVar(i),0);\r\n solucion.evalInd(this, Variables, Examples, false);\r\n Trials++;\r\n new_res = solucion.getMedidas();\r\n\r\n if ((new_res.getCnf() >= res.getCnf())&&(new_res.getSup() >= res.getSup())) {\r\n evalua[i] = new_res.getSup();\r\n improvement = true;\r\n }\r\n else\r\n evalua[i]=-1;\r\n // Restore initial values of \"solucion\"\r\n solucion.setCromElemGene(i, Variables.getNLabelVar(i), 1);\r\n }\r\n }\r\n\r\n if (improvement) {\r\n Utils.OrCrecIndex (evalua,0,Variables.getNVars()-1,indices);\r\n cambio = indices[Variables.getNVars()-1];\r\n for (int j=0; j<=Variables.getNLabelVar(cambio); j++)\r\n solucion.setCromElemGene(cambio, j, 0);\r\n\r\n res.setSup(evalua[Variables.getNVars()-1]);\r\n // Important: take into account not to eliminate all the variables of the rule\r\n\r\n // If there is improvement, set return value to true\r\n retValue = true;\r\n control++;\r\n\r\n }\r\n } // End while \"improvement\"\r\n\r\n // Store the new rule if it was improved\r\n if (retValue==true){\r\n for (int i=0; i<Variables.getNVars(); i++)\r\n for (int j=0; j<=Variables.getNLabelVar(i); j++)\r\n poblac.setCromElemGene(mejor, i, j, solucion.getCromElemGene(i,j));\r\n poblac.setIndivEvaluated(mejor,false);\r\n }\r\n\r\n return retValue;\r\n\r\n }", "private boolean m(){\r\n int m = countColors - maxSat;\r\n if (m <= TH){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public void testPercentSwapFreeBelowThreshold() {\n String jvmOptions = null;\n GcManager gcManager = new GcManager();\n Jvm jvm = new Jvm(jvmOptions, null);\n JvmRun jvmRun = gcManager.getJvmRun(jvm, Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n jvmRun.getJvm().setSwap(1000);\n jvmRun.getJvm().setSwapFree(945);\n jvmRun.doAnalysis();\n Assert.assertEquals(\"Percent swap free not correct.\", 94, jvmRun.getJvm().getPercentSwapFree());\n Assert.assertTrue(Analysis.INFO_SWAPPING + \" analysis not identified.\",\n jvmRun.getAnalysis().contains(Analysis.INFO_SWAPPING));\n }", "private void checkIsBetterSolution() {\n if (solution == null) {\n solution = generateSolution();\n //Si la solucion que propone esta iteracion es mejor que las anteriores la guardamos como mejor solucion\n } else if (getHealthFromAvailableWorkers(availableWorkersHours, errorPoints.size()) < solution.getHealth()) {\n solution = generateSolution();\n }\n }", "boolean hasMaximumBackoff();", "int tryScale(){\n int numAccepted = 0;\n \n for(int c=0; c<numCandScaleTuning; c++){\n DoubleMatrix1D y = nextCandidate();\n if(checkCandidate(y))//accept\n numAccepted++;\n }\n \n return numAccepted;\n }", "public static boolean doTestsPass() {\r\n // todo: implement more tests, please\r\n // feel free to make testing more elegant\r\n boolean testsPass = true;\r\n double result = power(2,-2);\r\n return testsPass && result==0.25;\r\n }", "@Test\n public final void testSmallerThanMax() {\n for (ArrayList<TradeGood> planetsGoods : goods) {\n for (TradeGood good : planetsGoods) {\n assertTrue(good.getPrice() < good.type.mhl);\n }\n }\n }", "protected boolean hasNext() {\n\t\treturn (counter + incrValue) < max && (counter + incrValue) > min;\n\t}", "@Override\n\tpublic int getMaxIterations() {\n\t\treturn maxIterations;\n\t}", "public abstract void improveValueFunction(Vector<BeliefState> vBeliefPoints, Vector<BeliefState> vNewBeliefPoints);", "private boolean validationPhase(Secret secretA, Secret secretB, int smallestSize, double[] optimalBox) {\n\n\t\t// number of all possible subsets with a size of smallestSize\n\t\tint numberSubsets; \n\t\tif((secretA.getTimes().size() / smallestSize) <= (secretB.getTimes().size() / smallestSize)) {\n\t\t\tnumberSubsets = (secretA.getTimes().size() / smallestSize);\n\t\t} else {\n\t\t\tnumberSubsets = (secretB.getTimes().size() / smallestSize);\n\t\t}\n\n\t\t// rest of the size modulo all subsets\n\t\tint restA = secretA.getTimes().size() % (numberSubsets * smallestSize);\n\t\tint restB = secretB.getTimes().size() % (numberSubsets * smallestSize);\n\n\t\tArrayList<Time> subsetA; \n\t\tArrayList<Time> subsetB;\n\n\t\tint countWrongResults = 0;\n\n\t\tArrayList<String> validateSubsetSignificantDifferent = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapA = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapB = new ArrayList<String>();\n\t\tArrayList<Time> prevSubsetA = new ArrayList<Time>();\n\t\tArrayList<Time> prevSubsetB = new ArrayList<Time>();\n\n\n\t\tfor (int i = 0; i < numberSubsets; ++i) {\n\n\t\t\tint countInvalid = 0;\n\t\t\t// the rest will be deducted at the beginning\n\t\t\tsubsetA = secretA.getBisectedTimes(restA + (smallestSize * i), smallestSize);\n\t\t\tsubsetB = secretB.getBisectedTimes(restB + (smallestSize * i), smallestSize);\n\n\t\t\tCollections.sort(subsetA);\n\t\t\tCollections.sort(subsetB);\n\n\t\t\tif (BoxTest.boxTestSmaller(subsetA, subsetB, optimalBox)) {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"o\");\n\n\t\t\t} else {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"x\");\n\t\t\t\t//logger.info(\"subset \" + i + \": wrong result\");\n\t\t\t\t++countInvalid;\n\t\t\t}\n\t\t\t\n\t\t\tif(i != 0) {\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetA, subsetA, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"o\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t} \n\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetB, subsetB, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"o\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": right result\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different, subset A overlaps\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(countInvalid > 0) {\n\t\t\t\t++countWrongResults;\n\t\t\t}\n\n\t\t\tprevSubsetA = new ArrayList<Time>();\n\t\t\tprevSubsetB = new ArrayList<Time>();\n\n\t\t\tprevSubsetA = subsetA;\n\t\t\tprevSubsetB = subsetB;\n\t\t}\n\n\t\tdouble confidenceInterval = 100 - (countWrongResults * 100 / numberSubsets);\n\n\t\tthis.boxTestResults.get(this.boxTestResults.size() - 1).saveValidation(smallestSize, confidenceInterval, validateSubsetOverlapA, validateSubsetOverlapB, validateSubsetSignificantDifferent);\n\t\tlogger.finest(\"\\n\\\"o\\\" = successful box test \\n\\\"x\\\" = unsuccesful box test\\n\");\n\t\tlogger.finest(secretA.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapA));\n\t\tlogger.finest(secretB.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapB));\n\t\tlogger.finest(secretA.getName() + \" < \" + secretB.getName() + \": \" + Folder.convertArrayListToString(validateSubsetSignificantDifferent));\n\n\t\tlogger.info(secretA.getName() + \" < \" + secretB.getName() + \": validate smallest size \" + smallestSize + \": \" + countWrongResults + \" out of \" + numberSubsets + \" comparisons returned wrong results.\");\n\n\t\tif(countWrongResults != 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public double maxDifference()\n {\n double maxD = 0.0;\n double testD = 0.0;\n \n for (int i=0; i < data.length -1; i++) // stopping 1 early because reading ahead\n {\n testD = Math.abs(data[i]-data[i+1]);\n if (testD > maxD)\n {\n maxD = testD;\n }\n }\n \n return maxD;\n }", "private static boolean checkLikelyEqual(EquationSystem system, Map<Sort, List<Term>> smallTerms) {\n //int searchDepth = 0;\n //Term convergence = null;\n\n return true;\n /*\n\n for (int i = 0; i < 2; i++) {\n Set<Term> leftTerms = new HashSet<>();\n Set<Term> rightTerms = new HashSet<>();\n\n Term left = system.getGoal().getLeft();\n Term right = system.getGoal().getRight();\n\n for (Variable var : left.getVariables()) {\n left = left.substitute(var, smallTerms.get(var.getSort()).get(i));\n right = right.substitute(var, smallTerms.get(var.getSort()).get(i));\n }\n\n leftTerms.add(left);\n rightTerms.add(right);\n\n Logger.d(\"Checking convergence of \" + left.toString() + \" to \" + right.toString());\n\n while (convergence == null && searchDepth < 5) {\n leftTerms.addAll(Prover.rewriteAll(leftTerms, system.getEquations(), null, true, true));\n rightTerms.addAll(Prover.rewriteAll(rightTerms, system.getEquations(), null, true, true));\n\n searchDepth++;\n convergence = checkConvergence(leftTerms, rightTerms);\n }\n\n if (convergence == null) {\n return false;\n }\n }\n\n return true;*/\n }", "public boolean almostEquals(Vect3 v, long maxUlps) {\n\t\treturn Util.almost_equals(x, v.x, maxUlps) && Util.almost_equals(y, v.y, maxUlps) && \n\t\t\t\tUtil.almost_equals(z, v.z, maxUlps);\n\t}", "private boolean foundChavrousse(ArrayList<Gelt> m_gelts, Gelt m_gelt) {\n\t\tplay.Logger.info(\"Found Chavrousee Algorithm Started\");\n\t\tboolean isUpdate = false;\n\t\tfor (Gelt currGelt : m_gelts) {\n\t\t\tif (!isUpdate) {\n\t\t\t\tif ((currGelt.getDebterID() == m_gelt.getDebterID())\n\t\t\t\t\t\t&& (currGelt.getEntitledID() == m_gelt.getEntitledID())\n\t\t\t\t\t\t&& (currGelt.getGroupID() == m_gelt.getGroupID())) {\n\t\t\t\t\tcurrGelt.setnAmount(currGelt.getAmount() + m_gelt.getAmount());\n\t\t\t\t\tisUpdate = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplay.Logger.info(\"Found Chavrousee Algorithm Finished with value : \" + isUpdate);\n\t\treturn isUpdate;\n\t}", "public static boolean almost_geq(double a, double b, long maxUlps) {\n return a >= b || almost_equals(a, b, maxUlps);\n }", "private boolean canReduceBins() {\n\t\tint oldBinCount = binCount;\n\t\tboolean canReduce = false;\n\t\tbinCount = binCount / 2;\n\t\tint[] chromosome = eliteChromosome.clone();\n\n\t\tif (getFitness(chromosome) <= binCount)\n\t\t\tcanReduce = true;\n\t\telse\n\t\t\tcanReduce = false;\n\t\tbinCount = oldBinCount; //no side effects\n\t\treturn canReduce;\n\t}", "public boolean overMax() {\n if (this.levelMessage.getDoubleParameter() > this.configuration.getMaximalLimitLevel()) {\n return true;\n }\n return false;\n }", "protected abstract boolean nbrToursMax();", "public boolean larger(CRational1 r) {\n\t\tint cn = (this.n * r.d) - (this.d * r.n);\r\n\t\tif (cn < 0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public boolean solve() {\r\n\r\n\tint nextBox = findLeast();\r\n\t//coors for the least box\r\n\tint c = nextBox % 10;\r\n\tint r = nextbox/10;\r\n\t\r\n\r\n\t//look for least\r\n\t//for the numbers in the least box\r\n\t//assignT == true \r\n\t//check the max; if max is 100; well done! return true\r\n\t//if its not then if (solve() == true) again\r\n\t//if \r\n }", "public boolean needsMoreVoters(double numVotersInDistrict, int districts)\n {\n double threshold = 0.01 * avgVotersPerDistrict;\n\n if (avgVotersPerDistrict*districts - numVotersInDistrict > threshold)\n return true;\n return false;\n }", "@Test\n public void testUnpreconditionedResidual() {\n final int n = 10;\n final int maxIterations = n;\n final RealLinearOperator a = new HilbertMatrix(n);\n final ConjugateGradient solver;\n solver = new ConjugateGradient(maxIterations, 1E-15, true);\n final RealVector r = new ArrayRealVector(n);\n final RealVector x = new ArrayRealVector(n);\n final IterationListener listener = new IterationListener() {\n\n @Override\n public void terminationPerformed(final IterationEvent e) {\n // Do nothing\n }\n\n @Override\n public void iterationStarted(final IterationEvent e) {\n // Do nothing\n }\n\n @Override\n public void iterationPerformed(final IterationEvent e) {\n final IterativeLinearSolverEvent evt;\n evt = (IterativeLinearSolverEvent) e;\n RealVector v = evt.getResidual();\n r.setSubVector(0, v);\n v = evt.getSolution();\n x.setSubVector(0, v);\n }\n\n @Override\n public void initializationPerformed(final IterationEvent e) {\n // Do nothing\n }\n };\n solver.getIterationManager().addIterationListener(listener);\n final RealVector b = new ArrayRealVector(n);\n for (int j = 0; j < n; j++) {\n b.set(0.);\n b.setEntry(j, 1.);\n\n boolean caught = false;\n try {\n solver.solve(a, b);\n } catch (MaxCountExceededException e) {\n caught = true;\n final RealVector y = a.operate(x);\n for (int i = 0; i < n; i++) {\n final double actual = b.getEntry(i) - y.getEntry(i);\n final double expected = r.getEntry(i);\n final double delta = 1E-6 * JdkMath.abs(expected);\n final String msg = String\n .format(\"column %d, residual %d\", i, j);\n Assert.assertEquals(msg, expected, actual, delta);\n }\n }\n Assert\n .assertTrue(\"MaxCountExceededException should have been caught\",\n caught);\n }\n }", "@Test\n public void testIsInLimitLower() {\n Assertions.assertTrue(saab.isInLimit(.3, .9, .6));\n }", "private static boolean moveCloserToTarget() {\n Direction f = forward;\n int startingDistance = target.distanceSquaredTo(S.rc.getLocation());\n forward = S.rc.getLocation().directionTo(target);\n forward = forward.rotateLeft();\n for (int i = 0; i < 8; i++) {\n if (target.distanceSquaredTo(S.rc.getLocation().add(forward)) < startingDistance)\n if (moveForwardStrict())\n return true;\n forward = forward.rotateRight();\n }\n forward = f;\n return false;\n }", "@Test\n public void computeResult_resultAlwaysInsideProvidedBoundaries() {\n int datasetSize = 10;\n for (int i = 0; i < 100; ++i) {\n Random random = new Random();\n double lower = random.nextDouble() * 100;\n double upper = lower + random.nextDouble() * 100;\n\n variance =\n BoundedVariance.builder()\n .epsilon(EPSILON)\n .noise(new LaplaceNoise())\n .maxPartitionsContributed(1)\n .maxContributionsPerPartition(1)\n .lower(lower)\n .upper(upper)\n .build();\n\n List<Double> dataset =\n random\n .doubles()\n .map(x -> x * 300 * getRandomSign(random))\n .limit(datasetSize)\n .boxed()\n .collect(toImmutableList());\n\n variance.addEntries(dataset);\n\n assertWithMessage(\n \"lower = %s\\nupper = %s\\ndataset = [%s]\",\n lower, upper, dataset.stream().map(x -> Double.toString(x)).collect(joining(\",\\n\")))\n .that(variance.computeResult())\n .isIn(Range.closed(0.0, (upper - lower) * (upper - lower) / 4.0));\n }\n }", "private boolean capacityController(Arrival newArrival) {\n int[] duration = calculateDuration(newArrival);\n for (int i = duration[0]; i <= duration[1]; i++) {\n if (this.parentTrainStation.getMaxCapacity() <= capacityArray[i]) {\n return false;\n }\n }\n for (int i = duration[0]; i <= duration[1]; i++) {\n capacityArray[i]++;\n }\n return true;\n }", "@Test\n void testUpdateGoaliePositionLimitsYmax() {\n goalie.setPosition(new Vector(goalie.getX(), 512f));\n\n // save the goalie position\n Vector prev_goalie_position = goalie.getPosition();\n\n // Set a moving direction for goalie in the positive direction\n goalie.setNext_direction(new Vector(0,1));\n\n // Generate a translation\n goalie.GenerateNextTranslation();\n\n // Apply translation\n goalie.UpdateGoaliePosition();\n\n // Check if new position is in the yMin position still\n // Check previous and new position are the same\n Vector new_goalie_position = goalie.getPosition();\n if (( prev_goalie_position.getY() - new_goalie_position.getY()) == 0)\n assertEquals(1,1);\n else {\n assertEquals(1, 0, \"\\nFailed testUpdateGoaliePositionMovedLimitsYmax\" +\n \" Goalie moved past the Y-Max limit\");\n }\n\n }", "public boolean lose(){\n\t\tif(steps>limit)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean updateTo(int barID, double target, double max) {\r\n\t\t// If the index is valid;\r\n\t\tif (barID >= 0 && barID < barCount) {\r\n\t\t\t// Updating status before maximum because the reset feature needs to\r\n\t\t\t// handle overflows first based on the initial maximum, if reset is\r\n\t\t\t// active.\r\n\t\t\tupdate(barID, Math.abs(target) - currentTarget[barID]);\r\n\t\t\tmaxValue[barID] = Math.abs(max);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static BiPredicate<World, BlockPos> touchingNonSteppablePredicate(float stepheight, Box box, double oldY, double newY) {\n return (world, pos) -> {\n VoxelShape shape = world.getBlockState(pos).getCollisionShape(world, pos).offset(pos.getX(), pos.getY(), pos.getZ());\n if (newY <= oldY) return intersects(shape, box);\n if (intersects(shape, box)) {\n MutableDouble stepHeight = new MutableDouble(Double.MAX_VALUE);\n shape.forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> {\n if (maxY < stepHeight.doubleValue() && box.intersects(minX, minY, minZ, maxX, maxY, maxZ)) {\n stepHeight.setValue(maxY);\n }\n });\n double stepDelta = stepHeight.doubleValue() - oldY;\n if (stepDelta > stepheight) {\n return true;\n }\n Box translatedBox = new Box(box.minX, box.minY + stepDelta, box.minZ, box.maxX, box.maxY + stepDelta, box.maxZ).expand(-0.1);\n return intersects(shape, translatedBox);\n }\n return false;\n };\n }", "public void testPercentSwapFreeAtThreshold() {\n String jvmOptions = null;\n GcManager gcManager = new GcManager();\n Jvm jvm = new Jvm(jvmOptions, null);\n JvmRun jvmRun = gcManager.getJvmRun(jvm, Constants.DEFAULT_BOTTLENECK_THROUGHPUT_THRESHOLD);\n jvmRun.getJvm().setSwap(1000);\n jvmRun.getJvm().setSwapFree(946);\n jvmRun.doAnalysis();\n Assert.assertEquals(\"Percent swap free not correct.\", 95, jvmRun.getJvm().getPercentSwapFree());\n Assert.assertFalse(Analysis.INFO_SWAPPING + \" analysis incorrectly identified.\",\n jvmRun.getAnalysis().contains(Analysis.INFO_SWAPPING));\n }", "@Test\n\tpublic void decreasingSignal() {\n\t\tDataset xData = data(0.0, 1.0);\n\t\tDataset yData = data(1.0, 0.0);\n\n\t\tdouble target = 0.4;\n\t\tdouble tolerance = 0.01;\n\n\t\tdouble predictedY = target + tolerance;\n\t\tdouble predictedX = (predictedY - 1) * -1;\n\n\t\ttest(xData, yData, target, tolerance, predictedX, predictedY);\n\t}", "boolean hasSolverTimeLimitSeconds();", "public static boolean closeToAnyOf(ArrayList<Vector> vectors, Vector v, double epsilon) {\r\n \r\n for(Vector w : vectors){ \r\n if( Vector.distanceSquared(v,w) < epsilon ){ return true; }\r\n }\r\n return false;\r\n }", "public static boolean almost_leq(double a, double b, long maxUlps) {\n return a <= b || almost_equals(a, b, maxUlps);\n }", "public Map<BooleanVariable, Double> calculateDiff(SimulationResults perturbed,\n\t\t\t\t\t\t\t\t\t\t\t \t\t SimulationResults base,\n\t\t\t\t\t\t\t\t\t\t\t \t\t int maxTimeStep) {\n\t // BooleanNetworks can be compared (e.g. minor modification in a BooleanNetwork).\n\t // Make sure two Results are generated from the same network\n\t if (perturbed.getNetwork() != base.getNetwork() && varPropertyKey == null)\n\t throw new IllegalArgumentException(\"The passed two parameters don't have the same BooleanNetwork! \"\n\t + \"To compare two different BooleanNetworks, set varPropertyKey.\");\n\t\tperturbed.expandTracks(maxTimeStep);\n\t\tbase.expandTracks(maxTimeStep);\n\t\t// Calculate AUC\n\t\tMap<BooleanVariable, Double> pertVarToAuc = perturbed.calculateAUC();\n\t\tMap<BooleanVariable, Double> baseVarToAuc = base.calculateAUC();\n\t\tMap<String, Double> pertPropToAuc = null;\n\t\tif (varPropertyKey != null) {\n\t\t pertPropToAuc = convertVarToAucMap(pertVarToAuc, varPropertyKey);\n\t\t}\n\t\tfinal Map<String, Double> finalPertPropToAuc = pertPropToAuc;\n\t\tMap<BooleanVariable, Double> varToDiff = new HashMap<>();\n\t\t// Get the percent change\n\t\tbaseVarToAuc.forEach((var, baseAuc) -> {\n\t\t Double pertAuc = null;\n\t\t if (varPropertyKey != null) {\n\t\t String property = var.getProperty(varPropertyKey);\n\t\t pertAuc = finalPertPropToAuc.get(property);\n\t\t }\n\t\t else\n\t\t pertAuc = pertVarToAuc.get(var);\n\t\t\tif (pertAuc == null)\n\t\t\t return; \n\t\t\t// Assign the minimum value to avoid NaN\n\t\t\tif (baseAuc < MIN_VALUE)\n\t\t\t baseAuc = MIN_VALUE;\n\t\t\tif (pertAuc < MIN_VALUE)\n\t\t\t pertAuc = MIN_VALUE;\n//\t\t\tdouble change = Math.abs(pertAuc - baseAuc) / baseAuc;\n\t\t\tdouble change = (pertAuc - baseAuc) / (pertAuc + baseAuc); // Use this formula to control small values\n\t\t\tvarToDiff.put(var, change);\n\t\t});\n\t\t\n\t\treturn varToDiff;\n\t}", "private boolean stepDivision(){\r\n\t\tif(stepNumber == 2){//the first step, k = 2\r\n\t\t\t//do division for all attributes on currentTable\r\n\t\t\tint attrNum = currentTable.getNumberofAttributes();\r\n\t\t\tint caseNum = currentTable.getnumberofCases();\r\n\t\t\tallmaxmin = currentTable.calcuateAllMaxMin();\r\n\t\t\tBigDecimal tempcutPoint;\r\n\t\t\tBigDecimal tempcompare;\r\n\t\t\tfor(int i = 0; i < attrNum; i++){\r\n\t\t\t\ttempcutPoint = allmaxmin[i*2].add(allmaxmin[i*2+1]).multiply(new BigDecimal(0.5));\r\n\t\t\t\tfor(int j = 0;j < caseNum;j++){\r\n\t\t\t\t\ttempcompare = new BigDecimal(originalTable.getItemByIndexinTable(j, i));\r\n\t\t\t\t\tif(tempcompare.compareTo(tempcutPoint) == -1){\r\n\t\t\t\t\t\tcurrentTable.setItemByIndexinTable(j,i,Utils.Round2(allmaxmin[i*2+1])+\"..\"+Utils.Round2(tempcutPoint));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tcurrentTable.setItemByIndexinTable(j,i,Utils.Round2(tempcutPoint)+\"..\"+Utils.Round2(allmaxmin[i*2]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcutPointsNumber[i] = 1; //at first, only one cut point for each attribute\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{//only divide the worst case\r\n\t\t\tcutPointsNumber[currentWorstAttribute]++;\r\n\t\t\tint cutSize = cutPointsNumber[currentWorstAttribute];\r\n\t\t\tBigDecimal[] maxmin = originalTable.calcuateMaxandMinAttribute(currentWorstAttribute);\r\n\t\t\tBigDecimal interval = (maxmin[0].subtract(maxmin[1])).divide(new BigDecimal(cutSize+1),3, RoundingMode.HALF_UP);\r\n\t\t\tif(interval.compareTo(new BigDecimal(0)) == 0){\r\n\t\t\t\t//System.out.println();\r\n\t\t\t}\r\n\t\t\tBigDecimal intervalstart,intervalend;\r\n\t\t\tint caseNum = currentTable.getnumberofCases();\r\n\t\t\tBigDecimal tempcompare;\r\n\t\t\tfor(int i = 0;i < caseNum;i++){\r\n\t\t\t\tfor(int j = 0;j < cutSize+1;j++){\r\n\t\t\t\t\ttempcompare = new BigDecimal(originalTable.getItemByIndexinTable(i, currentWorstAttribute));\r\n\t\t\t\t\tintervalstart = maxmin[1].add(interval.multiply(new BigDecimal(j)));\r\n\t\t\t\t\tif(j == cutSize){\r\n\t\t\t\t\t\tintervalend = maxmin[0];\r\n\t\t\t\t\t\tif(tempcompare.compareTo(intervalstart) >= 0&&tempcompare.compareTo(intervalend) <= 0){\r\n\t\t\t\t\t\t\tcurrentTable.setItemByIndexinTable(i, currentWorstAttribute, Utils.Round2(intervalstart)+\"..\"+Utils.Round2(intervalend));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tintervalend = intervalstart.add(interval);\r\n\t\t\t\t\t\tif(tempcompare.compareTo(intervalstart) >= 0&&tempcompare.compareTo(intervalend) == -1){\r\n\t\t\t\t\t\t\tcurrentTable.setItemByIndexinTable(i, currentWorstAttribute, Utils.Round2(intervalstart)+\"..\"+Utils.Round2(intervalend));\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\tcurrentTable.printoutDecisionTable();\r\n\t\t\t//System.out.println();\r\n\t\t}\r\n\t\tConsistencyChecker newchecker = new ConsistencyChecker(currentTable);\r\n\t\tif(newchecker.ifConsistency() == true){\r\n\t\t\tSystem.out.println(\"Discretization Succeed!\");\r\n\t\t\t//currentTable.enablePrint = true;\r\n\t\t\tcurrentTable.printoutDecisionTable();\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstepNumber++;\r\n\t\t\tcurrentTable.printoutDecisionTable();\r\n\t\t\tcurrentWorstAttribute = getWorstAttributeNo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}", "public boolean getFull(){\n if(current==max)\n return false;\n return true;\n }", "@LargeTest\n public void testVignetteApproximateRelaxed() {\n TestAction ta = new TestAction(TestName.VIGNETTE_APPROXIMATE_RELAXED);\n runTest(ta, TestName.VIGNETTE_APPROXIMATE_RELAXED.name());\n }", "private boolean checkGreedyEnergy() {\r\n return myTotal.get(2) < 10 || (myTotal.get(2) < 13 && myTotal.get(2) <= enTotal.get(2));\r\n }", "public boolean couldBeProfitable(){\n return this.priceBought < this.maximumMachineProfit;\n }", "@Test\n public void fastLogitInversesSigmoidCorrectly()\n {\n\n double maxDiff1 = Double.MIN_VALUE;\n double maxDiff2 = Double.MIN_VALUE;\n\n for (int k = 0; k < 20; k++)\n {\n double x = (double) k / 2 - 5;\n double fastSigmoidAlternative1 = fastSigmoidAlternative(x);\n double fastLogitAlternative1 = fastLogitAlternative(fastSigmoidAlternative1);\n double diff1 = abs(x - fastLogitAlternative1);\n if (!Double.isNaN(diff1) && !Double.isInfinite(diff1))\n maxDiff1 = max(diff1, maxDiff1);\n for (int i = 0; i < 20; i++)\n {\n for (int j = 0; j < 20; j++)\n {\n double rangeLow = (double) i / 10 - 1;\n double rangeHigh = (double) j / 10;\n double fastSigmoidAlternative2 = fastSigmoidAlternative(x, rangeLow, rangeHigh);\n double fastLogitAlternative2 = fastLogitAlternative(fastSigmoidAlternative2, rangeLow, rangeHigh);\n double diff2 = abs(x - fastLogitAlternative2);\n if (!Double.isNaN(diff2) && !Double.isInfinite(diff2) && ! DoubleMath.fuzzyEquals(rangeLow, rangeHigh, 1E-10))\n maxDiff2 = max(diff2, maxDiff2);\n }\n }\n }\n\n // Verify that x = logit(sigmoid(x))\n assertThat(maxDiff1, closeTo(0, .0000000001));\n assertThat(maxDiff2, closeTo(0, .0000000001));\n }", "public boolean isOutOfMemory() {\n if (isEnabled())\n return ((getMax() - getCurrent()) < (getInitial() + 200000));\n else\n return false;\n }", "private boolean compareOutput(double sum, Sample sample) {\n switch (sample.getTarget()) {\n case 1:\n if (sum > 0) {\n return true;\n }\n break;\n case -1:\n if (sum <= 0) {\n return true;\n }\n break;\n }\n return false;\n }", "public boolean equals(Vector330Class v){\n return (Math.abs(this.x-v.x) <= EPS || Math.abs(this.y-v.y) <= EPS);\n }" ]
[ "0.62177205", "0.60853755", "0.593133", "0.57881224", "0.57327175", "0.5666033", "0.565645", "0.5588042", "0.5574351", "0.5487377", "0.5481054", "0.54545", "0.54318696", "0.5420688", "0.5419151", "0.5394058", "0.536709", "0.5355524", "0.5333948", "0.52728844", "0.52463377", "0.52378625", "0.5237246", "0.52366066", "0.5235271", "0.5230101", "0.5223927", "0.52186644", "0.52131826", "0.52125245", "0.5192506", "0.5185269", "0.51624346", "0.5160724", "0.5159089", "0.5121941", "0.510382", "0.50998807", "0.50979614", "0.508538", "0.506363", "0.50488853", "0.5047323", "0.504611", "0.50452", "0.5045195", "0.5038656", "0.5030894", "0.50260895", "0.50246114", "0.5020757", "0.5020519", "0.5017422", "0.5014891", "0.5009154", "0.5004051", "0.49982184", "0.4995048", "0.4993786", "0.49914002", "0.4990681", "0.49697173", "0.49606436", "0.4951337", "0.4946937", "0.49325594", "0.4928565", "0.4924514", "0.4921679", "0.4917021", "0.49120504", "0.4911212", "0.49086323", "0.49084392", "0.4908065", "0.4901594", "0.4895219", "0.48809555", "0.48798382", "0.48778233", "0.4874979", "0.48667744", "0.48663503", "0.48607585", "0.48569742", "0.4854478", "0.48514944", "0.48439178", "0.4842195", "0.4835905", "0.48298913", "0.4820625", "0.48164293", "0.48158616", "0.4801833", "0.48006442", "0.4796761", "0.4796665", "0.4795944", "0.4793961", "0.47810918" ]
0.0
-1
TODO Here we need to write the result of the previous computation to the alpha file.
public void writeNewAlpha(){ FileSystemHandler.writeVector(Parameters.pathToAlphas, this.newAlpha); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setNewAlpha(){\n\n\t\tretrieveAlpha();\n\t\tretrieveReducerOutput();\n\t\t\n\t\tdouble[] alphaVectorUpdate = new double[K];\n\t\tdouble[] alphaGradientVector = new double[K];\n\t\tdouble[] alphaHessianVector = new double[K];\n\n\t\tdouble[] alphaVector = oldAlpha.clone();\n\t\tdouble[] alphaSufficientStatistics = rDelta;\n\n\t\tint alphaUpdateIterationCount = 0;\n\n\t\t// update the alpha vector until converge\n\t\tboolean keepGoing = true;\n\t\ttry {\n\t\t\tint decay = 0;\n\n\t\t\tdouble alphaSum = 0;\n\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\talphaSum += alphaVector[j];\n\t\t\t}\n\n\t\t\twhile (keepGoing) {\n\t\t\t\tdouble sumG_H = 0;\n\t\t\t\tdouble sum1_H = 0;\n\n\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t// compute alphaGradient\n\t\t\t\t\talphaGradientVector[i] = D\n\t\t\t\t\t\t\t* (Gamma.digamma(alphaSum) - Gamma.digamma(alphaVector[i]))\n\t\t\t\t\t\t\t+ alphaSufficientStatistics[i];\n\n\t\t\t\t\t// compute alphaHessian\n\t\t\t\t\talphaHessianVector[i] = -D * Gamma.trigamma(alphaVector[i]);\n\n\t\t\t\t\tif (alphaGradientVector[i] == Double.POSITIVE_INFINITY\n\t\t\t\t\t\t\t|| alphaGradientVector[i] == Double.NEGATIVE_INFINITY) {\n\t\t\t\t\t\tthrow new ArithmeticException(\"Invalid ALPHA gradient matrix...\");\n\t\t\t\t\t}\n\n\t\t\t\t\tsumG_H += alphaGradientVector[i] / alphaHessianVector[i];\n\t\t\t\t\tsum1_H += 1 / alphaHessianVector[i];\n\t\t\t\t}\n\n\t\t\t\tdouble z = D * Gamma.trigamma(alphaSum);\n\t\t\t\tdouble c = sumG_H / (1 / z + sum1_H);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tboolean singularHessian = false;\n\n\t\t\t\t\tfor (int i = 0; i < K; i++) {\n\t\t\t\t\t\tdouble stepSize = Math.pow(Parameters.DEFAULT_ALPHA_UPDATE_DECAY_FACTOR, decay)\n\t\t\t\t\t\t\t\t* (alphaGradientVector[i] - c) / alphaHessianVector[i];\n\t\t\t\t\t\tif (alphaVector[i] <= stepSize) {\n\t\t\t\t\t\t\t// the current hessian matrix is singular\n\t\t\t\t\t\t\tsingularHessian = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\talphaVectorUpdate[i] = alphaVector[i] - stepSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (singularHessian) {\n\t\t\t\t\t\t// we need to further reduce the step size\n\t\t\t\t\t\tdecay++;\n\n\t\t\t\t\t\t// recover the old alpha vector\n\t\t\t\t\t\talphaVectorUpdate = alphaVector;\n\t\t\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// we have successfully update the alpha vector\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// compute the alpha sum and check for alpha converge\n\t\t\t\talphaSum = 0;\n\t\t\t\tkeepGoing = false;\n\t\t\t\tfor (int j = 0; j < K; j++) {\n\t\t\t\t\talphaSum += alphaVectorUpdate[j];\n\t\t\t\t\tif (Math.abs((alphaVectorUpdate[j] - alphaVector[j]) / alphaVector[j]) >= Parameters.DEFAULT_ALPHA_UPDATE_CONVERGE_THRESHOLD) {\n\t\t\t\t\t\tkeepGoing = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (alphaUpdateIterationCount >= Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_ITERATION) {\n\t\t\t\t\tkeepGoing = false;\n\t\t\t\t}\n\n\t\t\t\tif (decay > Parameters.DEFAULT_ALPHA_UPDATE_MAXIMUM_DECAY) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\talphaUpdateIterationCount++;\n\t\t\t\talphaVector = alphaVectorUpdate;\n\t\t\t}\n\t\t} catch (IllegalArgumentException iae) {\n\t\t\tSystem.err.println(iae.getMessage());\n\t\t\tiae.printStackTrace();\n\t\t} catch (ArithmeticException ae) {\n\t\t\tSystem.err.println(ae.getMessage());\n\t\t\tae.printStackTrace();\n\t\t}\n\n\t\tnewAlpha = alphaVector;\n\n\n\t}", "@Override\n\tpublic void computeAlpha() {\n\t\t//Allocate memory for the alphas array\n\t\talpha = new double[training[0].length-1];\n\t\t\n\t\t//Checks every feature\n\t\tfor(int i = 0; i < training[0].length-1; i++) {\n\t\t\t//Sets the position of the array corresponding to itself to NaN and continues the loop\n\t\t\tif(i == node_id) {\n\t\t\t\talpha[i] = Double.NaN;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t//Allocate memory to keep track of the counts\n\t\t\tint[][][] Nijkc = new int[max_values[i]+1][max_values[node_id]+1][max_values[max_values.length-1]+1];\n\t\t\tint[][] Nikc = new int[max_values[node_id]+1][max_values[max_values.length-1]+1];\n\t\t\tint[][] Nijc = new int[max_values[i]+1][max_values[max_values.length-1]+1];\n\t\t\tint[] Nc = new int[max_values[max_values.length-1]+1];\n\t\t\tint N = training.length;\n\t\t\t\n\t\t\t//Counts the patterns found on the training dataset\n\t\t\tfor(int n = 0; n < training.length; n++) {\n\t\t\t\tNijkc[training[n][i]][training[n][node_id]][training[n][training[n].length-1]]++;\n\t\t\t\tNikc[training[n][node_id]][training[n][training[n].length-1]]++;\n\t\t\t\tNijc[training[n][i]][training[n][training[n].length-1]]++;\n\t\t\t\tNc[training[n][training[n].length-1]]++;\n\t\t\t}\n\t\t\t\n\t\t\t//Computes the values of the alpha for a given node(self)->node(target) using the MDL score\n\t\t\tdouble total = 0;\n\t\t\tfor(int j = 0; j < max_values[i] + 1; j++) {\n\t\t\t\tfor(int k = 0; k < max_values[node_id] + 1; k++) {\n\t\t\t\t\tfor(int l = 0; l < max_values[max_values.length-1] + 1; l++) {\n\t\t\t\t\t\tif(Nijkc[j][k][l] == 0 || Nikc[k][l] == 0 || Nijc[j][l] == 0) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\ttotal += ((double)Nijkc[j][k][l] / (double)N) * (Math.log(((double)Nijkc[j][k][l]*(double)Nc[l])/((double)Nikc[k][l]*(double)Nijc[j][l])) / Math.log(2));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ttotal = total - ((((max_values[max_values.length-1]+1)*max_values[node_id]*max_values[i])/(2))*Math.log(N));\n\t\t\t\n\t\t\t//Attribution of the value to the corresponding position on the array\n\t\t\talpha[i] = total;\n\t\t}\n\t\t\n\t\t//System.out.println(Arrays.toString(alpha));\n\t}", "public void run(IEncoding solution, double Temp_i, double Temp_f, double alpha);", "public void writeSimScore() throws IOException, MalformedURLException, ParseException {\n FileWriter fw = new FileWriter(new File(scoreFile+new Double(alphaValue).toString()+\".txt\")); \r\n BufferedWriter bw = new BufferedWriter(fw);\r\n\r\n int numQueries = queryList.size();\r\n for (int i = 0; i < numQueries; i++) {\r\n String query1 = queryList.get(i);\r\n for (int j = 0; j < numQueries; j++) {\r\n String query2 = queryList.get(j);\r\n double sim = alphaValue * scorematrix[i][j] + (1 - alphaValue) * calSemanticSim(i, j);\r\n bw.write(new Double(sim).toString());\r\n bw.write(\" \");\r\n }\r\n // System.out.println(\"entered \" + i);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n\r\n }", "protected void calcAlpha(Sequence seq)\n {\n int T = seq.length();\n int nStates = getNumStates();\n alpha = Library.allocMatrixDouble(T, nStates, Library.LOG_ZERO);\n calcB(seq);\n\n // we can start anywhere, according to the prior probs\n for(int i = 0; i < nStates; i++)\n alpha[0][i] = piStart[i] + bmat[i][0];\n\n // fill in the alpha matrix\n for(int t = 1; t < T; t++){\n // calc j -> i\n for(int i = 0; i < nStates; i++){\n for(int j = 0; j < nStates; j++)\n alpha[t][i] = Library.logadd(alpha[t][i], alpha[t - 1][j] + tran[j][i]);\n alpha[t][i] += bmat[i][t];\n }\n }\n }", "abstract public boolean alphaConversion();", "private double computeSumAlpha()\n\t{\n\t\tdouble sum = 0;\n\t\tdouble[] a = svm.getAlphas();\n\t\tfor(double d : a)\n\t\t\tsum += Math.abs(d);\n\t\treturn sum;\n\t}", "private void prga(){\n int i = 0;\n int a = 0;\n int b = 0;\n StringBuilder sb = new StringBuilder();\n fileEncrypted.clear();\n\n byte[] code = new byte[filePlain.size()];\n while (i<filePlain.size()){\n a = (a + 1) % 256;\n b = (b + s_box.get(a)) % 256;\n Collections.swap(s_box, a, b);\n\n int key_int = s_box.get((s_box.get(a) + s_box.get(b))% 256);\n byte cypher = (byte) (key_int^filePlain.get(i));\n\n fileEncrypted.add(cypher);\n sb.append((char)cypher);\n code[i] = cypher;\n i++;\n }\n\n System.out.println(\"aaa\");\n// export file\n Helper.exportFile(code, extension, true);\n }", "final private void accumulate()\n\t{\n\t\tfinal int argb = target.get().get();\n\t\taccA += ( ( argb >> 24 ) & 0xff ) * weights[ code ];\n\t\taccR += ( ( argb >> 16 ) & 0xff ) * weights[ code ];\n\t\taccG += ( ( argb >> 8 ) & 0xff ) * weights[ code ];\n\t\taccB += ( argb & 0xff ) * weights[ code ];\n\n//\t\tSystem.out.print( \"accumulating value at \" + target );\n//\t\tSystem.out.print( \"with weights [\" );\n//\t\tprintCode();\n//\t\tSystem.out.printf( \"] = %f\" + \"\\n\", weights[ code ] );\n\t}", "public String LateralOp() {\n String line1, line2, tmpBuf1, tmpBuf2;\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(file1));\n BufferedWriter bw = new BufferedWriter(new FileWriter(\"output\" + mProcCount + extension));\n\n // Working with two files\n if (file2 != null) {\n BufferedReader br2 = new BufferedReader(new FileReader(file2));\n\n do{\n line1 = br.readLine(); line2 = br2.readLine();\n tmpBuf1 = line1 == null ? \"\" : line1;\n tmpBuf2 = line2 == null ? \"\" : line2;\n\n bw.write(tmpBuf1 + tmpBuf2);\n bw.newLine();\n }while (line1!= null || line2 != null);\n bw.flush();\n }\n // Working with spacers\n else{\n line2 = \"\";\n for (int i = 0; i < spaceCount; ++i) {\n line2 += spacer;\n }\n do{\n line1 = br.readLine();\n bw.write(line1 + line2);\n bw.newLine();\n }while(line1 != null);\n bw.flush();\n }\n }\n catch (FileNotFoundException e) {\n System.err.println(\"ERROR: File does not exist. Please input a valid file.\");\n }\n catch (IOException e) {\n System.err.println(\"ERROR: Failure while reading from file.\");\n }\n ++mProcCount;\n return \"output\" + mProcCount + extension;\n }", "public void calcOutput()\n\t{\n\t}", "private void analysisText(){\n\n FileOutput fout = null;\n if(this.fileNumberingSet){\n fout = new FileOutput(this.outputFilename, 'n');\n }\n else{\n fout = new FileOutput(this.outputFilename);\n }\n\n // perform PCA if not already performed\n if(!pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // output title\n fout.println(\"PRINCIPAL COMPONENT ANALYSIS\");\n fout.println(\"Program: PCA - Analysis Output\");\n for(int i=0; i<this.titleLines; i++)fout.println(title[i]);\n Date d = new Date();\n String day = DateFormat.getDateInstance().format(d);\n String tim = DateFormat.getTimeInstance().format(d);\n fout.println(\"Program executed at \" + tim + \" on \" + day);\n fout.println();\n if(this.covRhoOption){\n fout.println(\"Covariance matrix used\");\n }\n else{\n fout.println(\"Correlation matrix used\");\n }\n fout.println();\n\n // output eigenvalue table\n // field width\n int field1 = 10;\n int field2 = 12;\n int field3 = 2;\n\n fout.println(\"ALL EIGENVALUES\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Unordered \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\"Difference \");\n\n fout.print(\" \", field1);\n fout.print(\"index\", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print((this.eigenValueIndices[i]+1), field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n if(i<this.nItems-1){\n fout.print(Fmath.truncate((this.orderedEigenValues[i] - this.orderedEigenValues[i+1]), this.trunc), field2);\n }\n else{\n fout.print(\" \", field2);\n }\n fout.print(\" \", field3);\n\n fout.println();\n }\n fout.println();\n\n\n // Extracted components\n int nMax = this.greaterThanOneLimit;\n if(nMax<this.meanCrossover)nMax=this.meanCrossover;\n if(nMax<this.percentileCrossover)nMax=this.percentileCrossover;\n fout.println(\"EXTRACTED EIGENVALUES\");\n fout.print(\" \", field1);\n fout.print(\"Greater than unity\", 3*field2 + field3);\n fout.print(\"Greater than Monte Carlo Mean \", 3*field2 + field3);\n fout.println(\"Greater than Monte Carlo Percentile\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\" \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n int ii=0;\n while(ii<nMax){\n fout.print(ii+1, field1);\n\n if(ii<this.greaterThanOneLimit){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.meanCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.percentileCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n }\n fout.println();\n ii++;\n }\n fout.println();\n\n\n fout.println(\"PARALLEL ANALYSIS\");\n fout.println(\"Number of simulations = \" + this.nMonteCarlo);\n if(this.gaussianDeviates){\n fout.println(\"Gaussian random deviates used\");\n }\n else{\n fout.println(\"Uniform random deviates used\");\n }\n fout.println(\"Percentile value used = \" + this.percentile + \" %\");\n\n fout.println();\n fout.print(\"Component \", field1);\n fout.print(\"Data \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n fout.print(\"Data \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.println(\"Monte Carlo \");\n\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.println(\"Eigenvalue \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field3);\n fout.print(\" \", field2);\n fout.print(\"Percentile \", field2);\n fout.print(\"Mean \", field2);\n fout.println(\"Standard Deviation \");\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n fout.print(\" \", field3);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesPercentiles[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesMeans[i], this.trunc), field2);\n fout.println(Fmath.truncate(this.randomEigenValuesSDs[i], this.trunc));\n }\n fout.println();\n\n // Correlation Matrix\n fout.println(\"CORRELATION MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.correlationMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Covariance Matrix\n fout.println(\"COVARIANCE MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.covarianceMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n\n fout.println();\n\n // Eigenvectors\n fout.println(\"EIGENVECTORS\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println(\"Vector corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.orderedEigenVectorsAsRows[i][j], this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Loading factors\n fout.println(\"LOADING FACTORS\");\n fout.println(\"Original indices in parenthesis\");\n fout.println(\"Loading factors corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.loadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(proportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(cumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n // Rotated loading factors\n fout.println(\"ROTATED LOADING FACTORS\");\n if(this.varimaxOption){\n fout.println(\"NORMAL VARIMAX\");\n }\n else{\n fout.println(\"RAW VARIMAX\");\n }\n\n String message = \"The ordered eigenvalues with Monte Carlo means and percentiles in parenthesis\";\n message += \"\\n (Total number of eigenvalues = \" + this.nItems + \")\";\n int nDisplay = this.nItems;\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n int screenHeight = screenSize.height;\n int nDisplayLimit = 20*screenHeight/800;\n if(nDisplay>nDisplay)nDisplay = nDisplayLimit;\n for(int i=0; i<nDisplay; i++){\n message += \"\\n \" + Fmath.truncate(this.orderedEigenValues[i], 4) + \" (\" + Fmath.truncate(this.randomEigenValuesMeans[i], 4) + \" \" + Fmath.truncate(this.randomEigenValuesPercentiles[i], 4) + \")\";\n }\n if(nDisplay<this.nItems)message += \"\\n . . . \";\n message += \"\\nEnter number of eigenvalues to be extracted\";\n int nExtracted = this.greaterThanOneLimit;\n nExtracted = Db.readInt(message, nExtracted);\n this.varimaxRotation(nExtracted);\n\n fout.println(\"Varimax rotation for \" + nExtracted + \" extracted factors\");\n fout.println(\"Rotated loading factors and eigenvalues scaled to ensure total 'rotated variance' matches unrotated variance for the extracted factors\");\n fout.println(\"Original indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.rotatedIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n\n for(int i=0; i<nExtracted; i++){\n fout.print((i+1) + \" (\" + (rotatedIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.rotatedLoadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(rotatedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(rotatedProportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(rotatedCumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n fout.println(\"DATA USED\");\n fout.println(\"Number of items = \" + this.nItems);\n fout.println(\"Number of persons = \" + this.nPersons);\n\n\n if(this.originalDataType==0){\n fout.printtab(\"Item\");\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n }\n fout.println();\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n for(int j=0; j<this.nPersons; j++){\n fout.printtab(Fmath.truncate(this.scores0[i][j], this.trunc));\n }\n fout.println();\n }\n }\n else{\n fout.printtab(\"Person\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n }\n fout.println();\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n for(int j=0; j<this.nItems; j++){\n fout.printtab(Fmath.truncate(this.scores1[i][j], this.trunc));\n }\n fout.println();\n }\n }\n\n fout.close();\n }", "public void saveLayerAlpha(int sx, int sy, int i, int j, int multipliedAlpha) {\n\t\t\n\t}", "public void run() {\n\n long startTime = System.nanoTime();\n\n /*\"*********************************\n * Getting data from the algorithm *\n ***********************************/\n\n // Posterior values, get them from memory instead of propagating again. Since this method is called write,\n // it should only write.\n HashMap<Variable, TablePotential> results = algorithm.getLastPosteriorValues();\n\n // Samples\n double[][] sampleStorage;\n try {\n sampleStorage = algorithm.getSamples();\n if (sampleStorage.length == 0) { // Case of empty database\n throw new NullPointerException();\n }\n\n } catch (NullPointerException e) { // Case of empty database and no database\n logger.error(\"No samples found to write\");\n LocalizedException NoDatabaseException =\n new LocalizedException(new OpenMarkovException(\"Exception.NoDatabase\"), this.dialog);\n NoDatabaseException.showException();\n return;\n }\n\n // Variables\n List<Variable> sampledVariables = algorithm.getVariablesToSample();\n\n // The maximum number of states defines the number of columns of the second sheet in Excel.\n int maxNStates = 0;\n for (Variable variable : sampledVariables) {\n if (variable.getNumStates() > maxNStates) {\n maxNStates = variable.getNumStates();\n }\n }\n\n // Evidence variables\n EvidenceCase evidence = algorithm.getFusedEvidence();\n List<Variable> evidenceVariables = evidence.getVariables();\n\n // Time measuring for this phase\n long elapsedMS = (System.nanoTime() - startTime) / 1000000;\n logger.info(\"Data obtained from the algorithm: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Data obtained from the algorithm: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"***********************\n * Creating the workbook *\n *************************/\n\n SXSSFWorkbook workbook = new SXSSFWorkbook(1000);\n\n /* Styles */\n\n // Styles to convey graphically the weight\n\n // Weight = 0\n XSSFCellStyle incompatibleSample = (XSSFCellStyle) workbook.createCellStyle();\n incompatibleSample.setFillForegroundColor(new XSSFColor(INCOMPATIBLE_SAMPLE));\n incompatibleSample.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n\n // Weight = 1\n XSSFCellStyle compatibleSample = (XSSFCellStyle) workbook.createCellStyle();\n compatibleSample.setFillForegroundColor(new XSSFColor(COMPATIBLE_SAMPLE));\n compatibleSample.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n\n\n /// Font with big emphasis for the next styles\n XSSFFont bigBoldArial = (XSSFFont) workbook.createFont();\n bigBoldArial.setFontName(\"Arial\");\n bigBoldArial.setFontHeightInPoints((short) 11);\n bigBoldArial.setBold(true);\n\n // Header of table\n XSSFCellStyle topTable = (XSSFCellStyle) workbook.createCellStyle();\n\n topTable.setFillForegroundColor(new XSSFColor(HEADER_COLOR));\n topTable.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n topTable.setAlignment(HorizontalAlignment.LEFT);\n topTable.setFont(bigBoldArial);\n\n // Header of table centered\n XSSFCellStyle centeredTopTable = (XSSFCellStyle) workbook.createCellStyle();\n\n centeredTopTable.setFillForegroundColor(new XSSFColor(HEADER_COLOR_2));\n centeredTopTable.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n centeredTopTable.setAlignment(HorizontalAlignment.CENTER);\n centeredTopTable.setFont(bigBoldArial);\n\n\n /// Font with some emphasis\n XSSFFont bigArial = (XSSFFont) workbook.createFont();\n bigArial.setFontName(\"Arial\");\n bigArial.setFontHeightInPoints((short) 10);\n bigArial.setBold(true);\n\n // Chance node\n XSSFCellStyle chanceNode = (XSSFCellStyle) workbook.createCellStyle();\n\n chanceNode.setFillForegroundColor(new XSSFColor(CHANCE_NODE_COLOR));\n chanceNode.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n chanceNode.setFont(bigArial);\n\n // Algorithm name\n XSSFCellStyle subTopTable = (XSSFCellStyle) workbook.createCellStyle();\n\n subTopTable.setFont(bigArial);\n\n\n /// Font with some emphasis and white for contrast\n XSSFFont bigWhiteArial = (XSSFFont) workbook.createFont();\n bigWhiteArial.setFontName(\"Arial\");\n bigWhiteArial.setFontHeightInPoints((short) 11);\n bigWhiteArial.setColor(new XSSFColor(new Color(255, 255, 255)));\n\n // Node with finding\n XSSFCellStyle findingNode = (XSSFCellStyle) workbook.createCellStyle();\n\n findingNode.setFillForegroundColor(new XSSFColor(FINDING_NODE_COLOR));\n findingNode.setFillPattern(FillPatternType.SOLID_FOREGROUND);\n findingNode.setFont(bigWhiteArial);\n\n\n\n // No more than four decimal places\n XSSFCellStyle smartDecimals = (XSSFCellStyle) workbook.createCellStyle();\n smartDecimals.setDataFormat(workbook.createDataFormat().getFormat(\"0.0000\"));\n\n // No more than two decimal places\n XSSFCellStyle smartFewDecimals = (XSSFCellStyle) workbook.createCellStyle();\n smartFewDecimals.setDataFormat(workbook.createDataFormat().getFormat(\"0.##\"));\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Workbook styles created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Workbook styles created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"******************\n * Sheet of samples *\n ********************/\n SXSSFSheet samples = workbook.createSheet(dialog.stringDatabase.getString(\"SheetNames.Samples\"));\n\n /* Title row */\n Row titlesRow = samples.createRow(0);\n titlesRow.createCell(0).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.SampleN\"));\n for (int colNum = 1; colNum < sampledVariables.size() + 1; colNum++) { // Names of variables\n titlesRow.createCell(colNum).setCellValue(sampledVariables.get(colNum - 1).toString());\n }\n titlesRow.createCell(sampledVariables.size() + 1).setCellValue(dialog.stringDatabase.\n getString(\"ColumnTitles.Weight\"));\n\n // Apply header style\n for (int colNum = 0; colNum < sampledVariables.size() + 2; colNum++) {\n titlesRow.getCell(colNum).setCellStyle(topTable);\n }\n\n // Auto-size columns of first sheet\n for (int colNum = 0; colNum < sampledVariables.size() + 2; colNum++) {\n samples.trackAllColumnsForAutoSizing();\n samples.autoSizeColumn(colNum);\n }\n\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Header of samples sheet: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Header of samples sheet: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /* Sample's rows */\n int rowNum;\n\n // Sample's loop\n for (rowNum = 1; rowNum < algorithm.getSampleSize() + 1; rowNum++) {\n\n Row sampleRow = samples.createRow(rowNum);\n sampleRow.createCell(0).setCellValue(rowNum);\n double weight = sampleStorage[rowNum - 1][sampledVariables.size()];\n for (int colNum = 1; colNum < sampledVariables.size() + 2; colNum++) { // Sampled states\n sampleRow.createCell(colNum).setCellValue(sampleStorage[rowNum - 1][colNum - 1]);\n if (weight == 0) {\n sampleRow.getCell(colNum).setCellStyle(incompatibleSample);\n } else {\n sampleRow.getCell(colNum).setCellStyle(compatibleSample);\n }\n }\n }\n\n\n\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Sample rows created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Sample rows created: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"************************\n * Sheet of general stats *\n **************************/\n\n SXSSFSheet generalStats = workbook.createSheet(dialog.stringDatabase.getString(\"SheetNames.GeneralStats\"));\n\n /* Rows of algorithm data */\n\n rowNum = 0;\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.Algorithm\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(dialog.algorithmName);\n generalStats.getRow(rowNum).getCell(1).setCellStyle(subTopTable);\n\n rowNum++; // Row 1\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.TotalSamples\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getSampleSize());\n\n rowNum++; // Row 2\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.RuntimePerSample\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).\n setCellValue(algorithm.getAlgorithmExecutionTime()/algorithm.getSampleSize());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartDecimals);\n\n rowNum++; // Row 3\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.Runtime\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).\n setCellValue(algorithm.getAlgorithmExecutionTime());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartFewDecimals);\n\n rowNum++; // Row 4\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.ValidSamples\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getNumPositiveSamples());\n\n rowNum++; // Row 5\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.AccumulatedWeight\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(algorithm.getAccumulatedWeight());\n generalStats.getRow(rowNum).getCell(1).setCellStyle(smartFewDecimals);\n\n rowNum++; // Row 6\n generalStats.createRow(rowNum).createCell(0).setCellValue(dialog.stringDatabase.\n getString(\"RowTitles.ExactAlgorithmName\"));\n generalStats.getRow(rowNum).getCell(0).setCellStyle(topTable);\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n generalStats.getRow(rowNum).createCell(1).setCellValue(dialog.stringDatabase.getString(\"Algorithms.Hugin\"));\n\n // Empty row\n\n rowNum +=2; // rows written until now\n\n /* Row of titles */\n titlesRow = generalStats.createRow(rowNum);\n titlesRow.createCell(0).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.Variable\"));\n\n // Big long cell for state names\n generalStats.addMergedRegion(new CellRangeAddress(rowNum, rowNum, 1, maxNStates));\n titlesRow.createCell(1).setCellValue(dialog.stringDatabase.getString(\"ColumnTitles.States\"));\n\n // Set header style\n for (int colNum = 0; colNum < 2; colNum++) {\n titlesRow.getCell(colNum).setCellStyle(centeredTopTable);\n }\n\n // Empty row for clarity\n if (evidenceVariables.size() > 0) {\n rowNum++ ;\n }\n\n // Write about evidence variables that have not been sampled\n for (Variable evidenceVariable : evidenceVariables) {\n if (!sampledVariables.contains(evidenceVariable)) {\n\n /* Row of names */\n Row namesRow = generalStats.createRow(rowNum);\n // Write the name of the variable\n Cell variableName = namesRow.createCell(0);\n variableName.setCellValue(evidenceVariable.toString());\n variableName.setCellStyle(findingNode); // The color marks it as a finding\n\n // and then the names of their states\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n Cell stateName = namesRow.createCell(colNum);\n stateName.setCellValue(evidenceVariable.getStateName(colNum - 1));\n stateName.setCellStyle(findingNode);\n }\n\n /* Row of occurrences */\n // Write \"non-sampled\"\n Row occurrencesRow = generalStats.createRow(rowNum + 1);\n Cell nSamples = occurrencesRow.createCell(0);\n nSamples.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Ocurrences\"));\n\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n occurrencesRow.createCell(colNum)\n .setCellValue(dialog.stringDatabase.getString(\"NonSampled\"));\n }\n\n /* Row of finding */\n // Write the finding\n Row approxProbsRow = generalStats.createRow(rowNum + 2);\n Cell approximateProbs = approxProbsRow.createCell(0);\n approximateProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Finding\"));\n\n for (int colNum = 1; colNum < evidenceVariable.getNumStates() + 1; colNum++) {\n int value = 0;\n if (evidence.getState(evidenceVariable) == colNum - 1) {\n value = 1;\n }\n approxProbsRow.createCell(colNum).setCellValue(value);\n }\n\n // Empty row\n Row emptyRow = generalStats.createRow(rowNum + 4);\n emptyRow.setHeight((short) 120);\n\n rowNum += 4; // Go to the next variable (each variable uses 4 rows)\n }\n }\n\n rowNum++; // Empty row for clarity.\n\n // Write sampled variables\n for (int variablePosition = 0; variablePosition < sampledVariables.size(); variablePosition++) {\n\n Variable variableToWrite = sampledVariables.get(variablePosition);\n\n /* Row of names */\n Row namesRow = generalStats.createRow(rowNum);\n // Write the name of the variable\n Cell variableName = namesRow.createCell(0);\n variableName.setCellValue(sampledVariables.get(variablePosition).toString());\n\n // and then the names of its states\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n Cell stateName = namesRow.createCell(colNum);\n stateName.setCellValue(variableToWrite.getStateName(colNum - 1));\n }\n\n // In logical sampling, evidence variables are samples. If so, mark them as findings.\n if (evidenceVariables.contains(variableToWrite)) {\n for (int colNum = 0; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n namesRow.getCell(colNum).setCellStyle(findingNode);\n }\n } else {\n for (int colNum = 0; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n namesRow.getCell(colNum).setCellStyle(chanceNode);\n }\n }\n\n /* Row of occurrences */\n Row occurrencesRows = generalStats.createRow(rowNum + 1);\n // Write the title of the row\n Cell nSamples = occurrencesRows.createCell(0);\n nSamples.setCellValue(dialog.stringDatabase.getString(\"RowTitles.Ocurrences\"));\n // Write how many times each state has been sampled\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n occurrencesRows.createCell(colNum)\n .setCellValue(getStateOccurrences(sampleStorage, variablePosition,colNum - 1));\n }\n\n /* Row of approximate probabilities */\n Row approxProbsRow = generalStats.createRow(rowNum + 2);\n // Write the title of the row\n Cell approximateProbs = approxProbsRow.createCell(0);\n approximateProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.ApproximateProbability\"));\n // Write the sampled probability\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n if (evidenceVariables.contains(variableToWrite)) {\n // Logic Sampling: in case of a sampled evidence variable, probability = 1 for the finding.\n int value = 0;\n if (evidence.getState(variableToWrite) == colNum - 1) {\n value = 1;\n }\n approxProbsRow.createCell(colNum).setCellValue(value);\n\n } else {\n approxProbsRow.createCell(colNum)\n .setCellValue(results.get(variableToWrite).getValues()[colNum - 1]);\n }\n approxProbsRow.getCell(colNum).setCellStyle(smartDecimals);\n }\n\n\n /* Row of exact probabilities */\n Row exactProbsRow = generalStats.createRow(rowNum + 3);\n // Write the title of the row\n Cell exactProbs = exactProbsRow.createCell(0);\n exactProbs.setCellValue(dialog.stringDatabase.getString(\"RowTitles.ExactProbability\"));\n // Write how many times each state has been sampled\n for (int colNum = 1; colNum < variableToWrite.getNumStates() + 1; colNum++) {\n exactProbsRow.createCell(colNum)\n .setCellValue(exactPosteriorValues.get(variableToWrite).getValues()[colNum - 1]);\n exactProbsRow.getCell(colNum).setCellStyle(smartDecimals);\n }\n\n // Empty row\n Row emptyRow = generalStats.createRow(rowNum + 4);\n emptyRow.setHeight((short) 120);\n\n rowNum += 5; // Go to the next variable (each variable uses 5 rows)\n\n }\n\n // Auto-size columns of second sheet (variable column + states columns)\n for (int colNum = 0; colNum <= 1 + maxNStates; colNum++) {\n generalStats.trackAllColumnsForAutoSizing();\n generalStats.autoSizeColumn(colNum);\n }\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"General stats added: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"General stats added: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n /*\"*****************\n * Output the file *\n *******************/\n try {\n FileOutputStream outputStream = new FileOutputStream(fileName);\n workbook.write(outputStream);\n // remember to close\n outputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n LocalizedException OutputException =\n new LocalizedException(new OpenMarkovException(\"Exception.Output\"), this.dialog);\n OutputException.showException();\n }\n\n // Time measuring for this phase\n elapsedMS = (System.nanoTime() - startTime)/1000000;\n logger.info(\"Writing done: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n System.out.println(\"Writing done: \" + Long.toString(elapsedMS) + \" ms elapsed\");\n\n String conclusion = dialog.stringDatabase.getString(\"Conclusion\") + \"\\n\" + fileName;\n logger.info(conclusion);\n System.out.println(conclusion);\n JOptionPane.showMessageDialog(dialog, conclusion,\n dialog.stringDatabase.getString(\"ConclusionTitle\"), JOptionPane.DEFAULT_OPTION);\n }", "public static double getAlpha()\n\t{\n\t\treturn alpha;\n\t}", "private void writeResults() {\n File externalStorage = Environment.getExternalStorageDirectory();\n if (!externalStorage.canWrite()) {\n Log.v(TAG, \"sdcard is not writable\");\n return;\n }\n File resultFile = new File(externalStorage, RESULT_FILE);\n resultFile.setWritable(true, false);\n try {\n BufferedWriter rsWriter = new BufferedWriter(new FileWriter(resultFile));\n Log.v(TAG, \"Saved results in: \" + resultFile.getAbsolutePath());\n java.text.DecimalFormat df = new java.text.DecimalFormat(\"######.##\");\n\n for (int ct=0; ct < IPTestListJB.TestName.values().length; ct++) {\n IPTestListJB.TestName t = IPTestListJB.TestName.values()[ct];\n final float r = mResults[ct];\n float r2 = rebase(r, t);\n String s = new String(\"\" + t.toString() + \", \" + df.format(r) + \", \" + df.format(r2));\n rsWriter.write(s + \"\\n\");\n }\n rsWriter.close();\n } catch (IOException e) {\n Log.v(TAG, \"Unable to write result file \" + e.getMessage());\n }\n }", "public static void main(String arg[]) throws IOException, InterruptedException {\n\n\t\tString fileName = new File(arg[0]).getName();\n\t final String path = \"C:\\\\Users\\\\alessandro\\\\Desktop\\\\Test\\\\\"+fileName+\".txt\";\n\n\t File file = new File(path);\n\t \n\t \n\t double archi, nodi,densitÓ;\n\n\t\tImmutableGraph graph1 = ArcListASCIIGraph.loadOffline(arg[0]);\n\t\t\t\n\t\t\tif(file.exists()){\n\t\t\tSystem.out.println(\"dentro if\");\n\t\t\t\tBufferedWriter bw = null;\n\t\t\t\t\tFileWriter fw = null;\n\t\t\t\t\tfw = new FileWriter(file.getAbsoluteFile(), true);\n\t\t\t\t\tbw = new BufferedWriter(fw);\n//\t\t\t\t\t dispersionCentrality disp = new dispersionCentrality();\n//\t\t\t\t\t Date primaDisp = new Date();\n//\t\t\t\t\t\tbw.write(\"Dispersion Index:\" +disp.dispersionCentrality(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\t\tDate dopoDisp = new Date();\n//\t\t\t\t\t\tbw.write(dopoDisp.getTime()-primaDisp.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\t\n//\t\t\t\t\t embeddednessIndex embe = new embeddednessIndex();\t\n//\n//\t\t\t\t\t Date primaEmb = new Date();\n//\t\t\t\t\t\tbw.write(\"Embeddedness Index: \"+embe.computeEmbeddedness(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\t\tDate dopoEmb = new Date();\n//\t\t\t\t\t\tbw.write(dopoEmb.getTime()-primaEmb.getTime()+\" ms \\r\\n\");\n\t\t\t\t\t\n//\t\t\t\t\tdegreeCentrality degree = new degreeCentrality();\n//\t\t\t\t\tDate primaDegree = new Date();\n//\t\t\t\t\tbw.write(\"Index Degree centrality node: \"+degree.computeNodeDegree(graph1)+\" tempo dis esecuzione: \");\n//\t\t\t\t\tDate dopoDegree = new Date();\n//\t\t\t\t\tbw.write(dopoDegree.getTime()-primaDegree.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\n//\t\t\t\t\tcenter cent = new center();\n//\t\t\t\t\tDate primaCenter = new Date();\n//\t\t\t\t\tbw.write(\"Center of Graph: \"+ cent.getcenter(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\tDate dopoCenter = new Date();\n//\t\t\t\t\tbw.write(dopoCenter.getTime()-primaCenter.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\tSystem.out.println(\"DONE\");\n//\t\t\t\t\tbw.close();\n\t\t\t\t\t\n\t\t\t\t\t deleteDuplicate delete = new deleteDuplicate();\n\t\t\t\t\t delete.stripDuplicatesFromFile(arg[0]);\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\tarchi=graph1.numArcs();\n\t\t\tnodi =graph1.numNodes();\n\t\t\tdensitÓ = archi/(nodi*(nodi-1));\n\t\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tfr = new FileReader(arg[0]);\n\t\tbr = new BufferedReader(fr);\n\t\t\n\t\tString sCurrentLine;\n\t\tString app;\n\n\t\tbr = new BufferedReader(new FileReader(arg[0]));\n\t\tint countLine = 0;\n\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\tcountLine = countLine + 1;\n\t\t\tapp = sCurrentLine.replaceAll(\"[^0-9]+\", \" \");\n\t\tfor (String s : Arrays.asList(app.trim().split(\" \")))\n\t\t\t\tListanodi.add(Integer.valueOf(s));\n\n\t\t}\n\t\tif (br != null)\n\t\t\tbr.close();\n\n\t\tif (fr != null)\n\t\t\tfr.close();\n\t\tDirectedGraph<String, DefaultEdge> graph = createStringGraph(Listanodi);\n\t\tConnectivityInspector<String, DefaultEdge> inspector = new ConnectivityInspector<String, DefaultEdge>(\n\t\t\t\tgraph);\n\t\t\t\t\n\t\tKosarajuStrongConnectivityInspector<String,DefaultEdge>finder = new KosarajuStrongConnectivityInspector<String,DefaultEdge>( graph);\n\t\t\n\t\t\n\t\tBridge bridge= new Bridge();\n\t\tList<String> weaklyBridge =bridge.numberOfWeaklyBridge(graph, Listanodi, inspector.connectedSets().size());\n\t\tList<String> strongBridge =bridge.numberStrongBridge(graph, Listanodi, finder.stronglyConnectedSets().size());\n\t\t\n\t\tarticulationPoint artPoint = new articulationPoint();\n\t\tList<String> weaklyArtPoit = artPoint.numberOfWeaklyArticulationPoint(graph, Listanodi, inspector.connectedSets().size());\n\t\tList<String> strengthArtPoint = artPoint.numberOfStrongArticulationPoint(graph, Listanodi, finder.stronglyConnectedSets().size());\n\t\t\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\n\t\tcomponentiConnesse componenti = new componentiConnesse();\n\t\t\n\t\t\n\t\t double sum=0,average;\n\t\t List<Integer> temp = new ArrayList<Integer>();\n\t\t for(int i = 0; i<nodi ;i++){\n\t\t\ttemp.add(graph1.outdegree(i));\n\t\t\tsum= sum+graph1.outdegree(i); \n\t\t }\n\t\t average = sum/nodi;\n\t\t\n\t\t \n\t\t\n\t\t List<Double> ListOfneighbourdhood = new ArrayList<Double>();\n\t\t neighbourhood prova = new neighbourhood();\n\t\t ListOfneighbourdhood = prova.computeNeighbour(graph1, 10);\n\t\t\n\t\tcenter cent = new center();\n\t\t \n\t\t diameter d = new diameter();\n\t\t double diameter = d.effectiveDiamete(0.9, ListOfneighbourdhood);\n\t\t\n\t\t NeighbourhoodFunction n = new NeighbourhoodFunction();\n\t\tlong [] x = n.computeExact(graph1, 0, new ProgressLogger());\n\t\n\t\tdouble diametro =n.effectiveDiameter(0.9, n.compute(graph1,0,new ProgressLogger()));\n\t\t\n\t\tcloseness closeness = new closeness();\n\t\tbetweenness between = new betweenness();\n\t\tdegreeCentrality degree = new degreeCentrality();\n\t\tpageRankCentrality page = new pageRankCentrality();\n\t\t clusteringIndex cluster = new clusteringIndex();\n\t\t embeddednessIndex embe = new embeddednessIndex();\t\n\t\t dispersionCentrality disp = new dispersionCentrality();\t\t\n\n\t\t\n\t\ttry {\n\n\n\t\t\tfw = new FileWriter(path);\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\n\t\t\t\n\t\t\tbw.write(\"Numero nodi: \"+nodi+\"\\r\\n\");\n\t\t\tbw.write(\"Numero archi: \"+archi+\"\\r\\n\");\n\t\t\tbw.write(\"Dimensione grafo: \"+ archi+\"\\r\\n\");\n\t\t\tbw.write(\"DensitÓ: \"+densitÓ+\"\\r\\n\");\n\t\t\tbw.write(\"Numero Componenti Connesse di un grafo: \"+componenti.computeWeakConnectedComponents(graph1)+\"\\r\\n\");\n\t\t\tbw.write(\"Numero Componenti Fortemente Connesse: \"+ componenti.computeStrongConnectedComponents(graph1)+\"\\r\\n\");\n\t\t\t\n\t\t\t bw.write(\"Numero Medio Grado Nodo: \"+ average+\"\\r\\n\");\n\t\t\t bw.write(\"Massimo: \"+ Collections.max(temp)+\"\\r\\n\");\n\t\t\t bw.write(\"Minimo:\"+ Collections.min(temp)+\"\\r\\n\");\n\t\t\t\n\t\t\t ParallelBreadthFirstVisit grafo = new ParallelBreadthFirstVisit(graph1, 0,false,null);\n\t\t\t for (int i=0 ; i< nodi ; i++){\n\t\t\t\t bw.write(\"Nodi visitati: \"+grafo.visit(i)+\"\\r\\n\");\n\n\t\t\t }\n\t\t\t \n\t\t\t bw.write(\"Lista vicinanza: \"+ListOfneighbourdhood+\"\\r\\n\");\n\t\t\t Date primaCenter = new Date();\n\t\t\t\tbw.write(\"Center of Graph: \"+ cent.getcenter(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCenter = new Date();\n\t\t\t\tbw.write(dopoCenter.getTime()-primaCenter.getTime()+\" ms \\r\\n\");\n\t\t\t bw.write(\"effective diameter: \"+ diameter+\"\\r\\n\");\n\t\t\t\tfor ( int i=0 ; i< x.length;i++)\n\t\t\t\t\t bw.write(\"visitati i nodi x[\"+i+\"]: \"+x[i]+\"\\r\\n\" );\n\t\t\t bw.write(\"Diametro: \"+diametro+\"\\r\\n\");\n\t\t\t Date primaWBridge = new Date();\n\t\t\t bw.write(\"WeakBridge: \"+weaklyBridge+\" tempo di esecuzione: \");\n\t\t\t Date dopoWBridge = new Date();\n\t\t\t \n\t\t\tbw.write(dopoWBridge.getTime()-primaWBridge.getTime()+\" ms \\r\\n\");\n\t\t\t\n\t\t\tDate primaSBridge = new Date();\n\t\t\t bw.write(\"StrengtBridge: \"+strongBridge+\" tempo di esecuzione: \");\n\t\t\t Date dopoSBridge = new Date();\n\t\t\t\tbw.write(dopoSBridge.getTime()-primaSBridge.getTime()+\" ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaWArt = new Date();\n\t\t\t bw.write(\"Weak ArticulationPoint: \"+weaklyArtPoit+\" tempo di esecuzione: \");\n\t\t\t Date dopoWArt = new Date();\n\t\t\t\tbw.write(dopoWArt.getTime()-primaWArt.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaSArt = new Date();\n\t\t\t bw.write(\"Strengt ArticulationPoint: \"+strengthArtPoint+\" tempo di esecuzione: \");\n\t\t\t Date dopoSArt = new Date();\n\t\t\t\tbw.write(dopoSArt.getTime()-primaSArt.getTime()+\" ms \\r\\n\");\n\n\t\t\t \n\t\t\t bw.write(\"\\r\\n\\r\\n\\r\\n Indici di centralitÓ:\\r\\n\");\n\t\t\t\tDate primaCloseness = new Date();\n\t\t\t\tbw.write(\"Set Of Closeness: \"+closeness.computeCloseness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCloseness = new Date();\n\t\t\t\tbw.write(dopoCloseness.getTime()-primaCloseness.getTime()+\"ms \\r\\n\");\n\t\t\t\tDate primaBetweenness = new Date();\n\t\t\t\tbw.write(\"List of Betweenness: \"+ between.computeBetweenness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoBetweenness = new Date();\n\t\t\t\tbw.write(dopoBetweenness.getTime()-primaBetweenness.getTime()+\"ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaNBetweenness = new Date();\n\t\t\t\t\n\t\t\t\tbw.write(\"List of Normalized Betweenness: \"+between.normalize(between.computeBetweenness(graph1),nodi)+\" tempodiesecuzione: \");\n\t\t\t\tDate dopoNBetweenness= new Date();\n\t\t\t\tbw.write(dopoNBetweenness.getTime()-primaNBetweenness.getTime()+\"ms \\r\\n\");\n\n\t\t\t\tDate primaDegree = new Date();\n\t\t\t\tbw.write(\"Index of degree:\"+degree.computeDegreeCentrality(graph1)+\"\\r\\n\");\n\t\t\t\tDate dopoDegree = new Date();\n\t\t\t\tbw.write(dopoDegree.getTime()-primaDegree.getTime()+\"ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaSDegree = new Date();\n\t\t\t\tbw.write(\"Index Degree centrality node: \"+degree.computeNodeDegree(graph1)+\" tempo dis esecuzione: \");\n\t\t\t\tDate dopoSDegree = new Date();\n\t\t\t\tbw.write(dopoSDegree.getTime()-primaSDegree.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaPage = new Date();\n\t\t\t\tbw.write(\"Indice di Autovettore:\"+page.getPageRankIntex(page.computePageRankCentrality(graph1))+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoPage = new Date();\n\t\t\t\tbw.write(dopoPage.getTime()-primaPage.getTime()+\"ms \\r\\n\");\n\n\t\t\t\tfor(int i=0 ; i<graph1.numNodes();i++)\n\t\t\t\tbw.write(\"Per il nodo:\"+i+\" il valore di Clustering Ŕ pari a :\"+cluster.clusterCoefficent(graph1, i)+\"\\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaCluster =new Date();\n\t\t\t\tbw.write(\"L'Indice di Clustering Ŕ pari a: \"+cluster.clusterIndex(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCluster = new Date();\n\t\t\t\tbw.write(dopoCluster.getTime()-primaCluster.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaEmb = new Date();\n\t\t\t\tbw.write(\"Embeddedness Index: \"+embe.computeEmbeddedness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoEmb = new Date();\n\t\t\t\tbw.write(dopoEmb.getTime()-primaEmb.getTime()+\" ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaDisp = new Date();\n\t\t\t\tbw.write(\"Dispersion Index:\" +disp.dispersionCentrality(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoDisp = new Date();\n\t\t\t\tbw.write(dopoDisp.getTime()-primaDisp.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tSystem.out.println(\"Done\");\n\n\t\t} catch (IOException e) {\n\n\t\t\te.printStackTrace();\n\n\t\t} finally {\n\n\t\t\ttry {\n\n\t\t\t\tif (bw != null)\n\t\t\t\t\tbw.close();\n\n\t\t\t\tif (fw != null)\n\t\t\t\t\tfw.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t}\n\t}", "public static void writeFileForAverage( String file ) throws Exception{\r\n\t\tBufferedOutputStream writer = new BufferedOutputStream( new FileOutputStream( file ) );\r\n\t\t//BufferedWriter writer = new BufferedWriter( new FileWriter( file ) );\r\n\t\t//char ch;\r\n\t\t\r\n\t\twriter.write( 'P' );\r\n\t\twriter.write( '5' );\r\n\t\twriter.write( ' ' );\r\n\t\twriter.write( '1' );\r\n\t\twriter.write( '2' );\r\n\t\twriter.write( '8' );\r\n\t\twriter.write( ' ' );\r\n\t\twriter.write( '1' ); \r\n\t\twriter.write( '2' );\r\n\t\twriter.write( '8' );\r\n\t\twriter.write( ' ' );\r\n\t\twriter.write( '2' );\r\n\t\twriter.write( '5' );\r\n\t\twriter.write( '5' );\r\n\t\twriter.write( ' ' );\r\n\r\n\t\tfor ( int i = 0; i < WIDTH; i++ ){\r\n\t\t\tfor ( int j = 0; j < HEIGHT; j++ ){\r\n\t\t\t\twriter.write( aResult[i][j] );\t\r\n\t\t\t\t//if ( aResult[i][j] > 255 )\r\n\t\t\t\t\t//System.out.print( aResult[i][j] + \" \" );\r\n\t\t\t}\r\n\t\t\tSystem.out.println( );\r\n\t\t}\r\n\t\t\r\n\t\twriter.close();\r\n\t}", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void finalSave1() {\n ArrayList<ArrayList<Tensor<?>>> at = getWeightsPrueba();\n int ctr = 0;\n ArrayList<float[]> diff = new ArrayList<>();\n ArrayList<ArrayList<Tensor<?>>> bt = getWeightsPrueba();\n for (int x = 0; x < 2; x++) { ///vale 2 porque solo w1 y b1\n ArrayList<Tensor<?>> u1 = at.get(x); //para pruebas\n Tensor<?> u = at.get(x).get(0); //variable auxiliar para pruebas\n float[] d = new float[flattenedWeight(bt.get(x).get(0)).length];\n float[] bw = flattenedWeight(bt.get(x).get(0));\n float[] aw = flattenedWeight(at.get(x).get(0));\n\n diff.add(aw);\n\n // float aux = at.get(x).get(0);\n // diff.add(at.get(x).get(0));\n for(int j = 0; j < bw.length; j++)\n {\n d[j] = aw[j] - bw[j];\n }\n diff.add(d);\n }\n Log.i(\"COUNTER: \", String.valueOf(ctr));\n savePrueba1(diff);\n }", "public void outputToFile(MethodCallExpr original, MethodCallExpr mutant) {\n if (comp_unit == null || currentMethodSignature == null){\n return;\n }\n num++;\n String f_name = getSourceName(\"ARGR\");\n String mutant_dir = getMuantID(\"ARGR\");\n try {\n PrintWriter out = getPrintWriter(f_name);\n ARGR_Writer writer = new ARGR_Writer(mutant_dir, out);\n writer.setMutant(original, mutant);\n writer.setMethodSignature(currentMethodSignature);\n writer.writeFile(comp_unit);\n out.flush();\n out.close();\n }\n catch (IOException e) {\n System.err.println(\"ARGR: Fails to create \" + f_name);\n logger.error(\"Fails to create \" + f_name);\n }\n }", "private void analysisExcel(){\n\n FileOutput fout = null;\n if(this.fileNumberingSet){\n fout = new FileOutput(this.outputFilename, 'n');\n }\n else{\n fout = new FileOutput(this.outputFilename);\n }\n\n // perform PCA if not already performed\n if(!pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // output title\n fout.println(\"PRINCIPAL COMPONENT ANALYSIS\");\n fout.println(\"Program: PCA - Analysis Output\");\n for(int i=0; i<this.titleLines; i++)fout.println(title[i]);\n Date d = new Date();\n String day = DateFormat.getDateInstance().format(d);\n String tim = DateFormat.getTimeInstance().format(d);\n fout.println(\"Program executed at \" + tim + \" on \" + day);\n fout.println();\n if(this.covRhoOption){\n fout.println(\"Covariance matrix used\");\n }\n else{\n fout.println(\"Correlation matrix used\");\n }\n fout.println();\n\n // output eigenvalue table\n fout.println(\"ALL EIGENVALUES\");\n\n fout.printtab(\"Component \");\n fout.printtab(\"Unordered \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.println(\"Difference \");\n\n fout.printtab(\" \");\n fout.printtab(\"index\");\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.println(\" \");\n\n\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab(i+1);\n fout.printtab((this.eigenValueIndices[i]+1));\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[i], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[i], this.trunc));\n if(i<this.nItems-1){\n fout.printtab(Fmath.truncate((this.orderedEigenValues[i] - this.orderedEigenValues[i+1]), this.trunc));\n }\n else{\n fout.printtab(\" \");\n }\n fout.printtab(\" \");\n\n fout.println();\n }\n fout.println();\n\n\n // Extracted components\n int nMax = this.greaterThanOneLimit;\n if(nMax<this.meanCrossover)nMax=this.meanCrossover;\n if(nMax<this.percentileCrossover)nMax=this.percentileCrossover;\n fout.println(\"EXTRACTED EIGENVALUES\");\n fout.printtab(\" \");\n fout.printtab(\"Greater than unity\");\n fout.printtab(\" \");fout.printtab(\" \");fout.printtab(\" \");\n fout.printtab(\"Greater than Monte Carlo Mean \");\n fout.printtab(\" \");fout.printtab(\" \");fout.printtab(\" \");\n fout.println(\"Greater than Monte Carlo Percentile\");\n\n fout.printtab(\"Component \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.println(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n\n fout.printtab(\" \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.println(\" \");\n\n int ii=0;\n while(ii<nMax){\n fout.printtab(ii+1);\n\n if(ii<this.greaterThanOneLimit){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n fout.printtab(\" \");\n }\n\n if(ii<this.meanCrossover){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n fout.printtab(\" \");\n }\n\n if(ii<this.percentileCrossover){\n fout.printtab(Fmath.truncate(this.orderedEigenValues[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[ii], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n }\n fout.println();\n ii++;\n }\n fout.println();\n\n\n fout.println(\"PARALLEL ANALYSIS\");\n fout.println(\"Number of simulations = \" + this.nMonteCarlo);\n if(this.gaussianDeviates){\n fout.println(\"Gaussian random deviates used\");\n }\n else{\n fout.println(\"Uniform random deviates used\");\n }\n fout.println(\"Percentile value used = \" + this.percentile + \" %\");\n\n fout.println();\n fout.printtab(\"Component \");\n fout.printtab(\"Data \");\n fout.printtab(\"Proportion \");\n fout.printtab(\"Cumulative \");\n fout.printtab(\" \");\n fout.printtab(\"Data \");\n fout.printtab(\"Monte Carlo \");\n fout.printtab(\"Monte Carlo \");\n fout.println(\"Monte Carlo \");\n\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"as % \");\n fout.printtab(\"percentage \");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Eigenvalue \");\n fout.printtab(\"Eigenvalue \");\n fout.println(\"Eigenvalue \");\n\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\" \");\n fout.printtab(\"Percentile \");\n fout.printtab(\"Mean \");\n fout.println(\"Standard Deviation \");\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab(i+1);\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.proportionPercentage[i], this.trunc));\n fout.printtab(Fmath.truncate(this.cumulativePercentage[i], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(this.randomEigenValuesPercentiles[i], this.trunc));\n fout.printtab(Fmath.truncate(this.randomEigenValuesMeans[i], this.trunc));\n fout.println(Fmath.truncate(this.randomEigenValuesSDs[i], this.trunc));\n }\n fout.println();\n\n // Correlation Matrix\n fout.println(\"CORRELATION MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.correlationMatrix.getElement(j,i), this.trunc));\n fout.println();\n }\n fout.println();\n\n // Covariance Matrix\n fout.println(\"COVARIANCE MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.covarianceMatrix.getElement(j,i), this.trunc));\n fout.println();\n }\n fout.println();\n\n // Eigenvectors\n fout.println(\"EIGENVECTORS\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println(\"Vector corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.println();\n fout.println(\"component\");\n\n for(int i=0; i<this.nItems; i++){\n fout.printtab((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.orderedEigenVectorsAsRows[i][j], this.trunc));\n fout.println();\n }\n fout.println();\n\n // Loading factors\n fout.println(\"LOADING FACTORS\");\n fout.println(\"Original indices in parenthesis\");\n fout.println(\"Loading factors corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue\");\n fout.printtab(\"% Proportion\");\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.loadingFactorsAsRows[i][j], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(this.orderedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(proportionPercentage[i], this.trunc));\n fout.println(Fmath.truncate(cumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n // Rotated loading factors\n fout.println(\"ROTATED LOADING FACTORS\");\n if(this.varimaxOption){\n fout.println(\"NORMAL VARIMAX\");\n }\n else{\n fout.println(\"RAW VARIMAX\");\n }\n\n String message = \"The ordered eigenvalues with Monte Carlo means and percentiles in parenthesis\";\n message += \"\\n (Total number of eigenvalues = \" + this.nItems + \")\";\n int nDisplay = this.nItems;\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n int screenHeight = screenSize.height;\n int nDisplayLimit = 20*screenHeight/800;\n if(nDisplay>nDisplay)nDisplay = nDisplayLimit;\n for(int i=0; i<nDisplay; i++){\n message += \"\\n \" + Fmath.truncate(this.orderedEigenValues[i], 4) + \" (\" + Fmath.truncate(this.randomEigenValuesMeans[i], 4) + \" \" + Fmath.truncate(this.randomEigenValuesPercentiles[i], 4) + \")\";\n }\n if(nDisplay<this.nItems)message += \"\\n . . . \";\n message += \"\\nEnter number of eigenvalues to be extracted\";\n int nExtracted = this.greaterThanOneLimit;\n nExtracted = Db.readInt(message, nExtracted);\n this.varimaxRotation(nExtracted);\n\n fout.println(\"Varimax rotation for \" + nExtracted + \" extracted factors\");\n fout.println(\"Rotated loading factors and eigenvalues scaled to ensure total 'rotated variance' matches unrotated variance for the extracted factors\");\n fout.println(\"Original indices in parenthesis\");\n fout.println();\n fout.printtab(\" \");\n fout.printtab(\"component\");\n for(int i=0; i<this.nItems; i++)fout.printtab((this.rotatedIndices[i]+1) + \" (\" + (i+1) + \")\");\n fout.printtab(\" \");\n fout.printtab(\"Eigenvalue\");\n fout.printtab(\"% Proportion\");\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<nExtracted; i++){\n fout.printtab((i+1) + \" (\" + (this.rotatedIndices[i]+1) + \")\");\n fout.printtab(\" \");\n for(int j=0; j<this.nItems; j++)fout.printtab(Fmath.truncate(this.rotatedLoadingFactorsAsRows[i][j], this.trunc));\n fout.printtab(\" \");\n fout.printtab(Fmath.truncate(rotatedEigenValues[i], this.trunc));\n fout.printtab(Fmath.truncate(rotatedProportionPercentage[i], this.trunc));\n fout.println(Fmath.truncate(rotatedCumulativePercentage[i], this.trunc));\n }\n\n\n fout.println();\n\n\n fout.println(\"DATA USED\");\n fout.println(\"Number of items = \" + this.nItems);\n fout.println(\"Number of persons = \" + this.nPersons);\n\n if(this.originalDataType==0){\n fout.printtab(\"Item\");\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n }\n fout.println();\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n for(int j=0; j<this.nPersons; j++){\n fout.printtab(Fmath.truncate(this.scores0[i][j], this.trunc));\n }\n fout.println();\n }\n }\n else{\n fout.printtab(\"Person\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n }\n fout.println();\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n for(int j=0; j<this.nItems; j++){\n fout.printtab(Fmath.truncate(this.scores1[i][j], this.trunc));\n }\n fout.println();\n }\n }\n\n fout.close();\n }", "@Override\n\tpublic void run() {\n\t\tfileName = \"out_\" + Program.getProgram().getFileName() + \"_\";\n\t\tint numAddStop = 0;\n\t\t//fileName = \"out_themida_\";\n\n\t\t//fileState.clearContentFile();\n\t\t//bkFile.clearContentFile();\n\t\toverallStartTime = System.currentTimeMillis();\n\t\tlong overallStartTemp = overallStartTime;\n\t\t// BE-PUM algorithm\n\t\tSystem.out.println(\"Starting On-the-fly Model Generation algorithm.\");\n\t\tprogram.getResultFileTemp().appendInLine('\\n' + program.getFileName() + '\\t');\n\t\t\n\t\t// Set up initial context\n\t\tX86TransitionRule rule = new X86TransitionRule();\n\t\tBPCFG cfg = Program.getProgram().getBPCFG();\n\t\tEnvironment env = new Environment();\n\t\t//env.getMemory().resetImportTable(program);\n\t\tAbsoluteAddress location = Program.getProgram().getEntryPoint();\n\t\tInstruction inst = Program.getProgram().getInstruction(location, env);\n\t\tList<BPPath> pathList = new ArrayList<BPPath>();\n\t\t\n\t\t// Insert start node\n\t\tBPVertex startNode = null;\n\t\tstartNode = new BPVertex(location, inst);\n\t\tstartNode.setType(0);\n\t\tcfg.insertVertex(startNode);\n\n\t\tBPState curState = null;\n\t\tBPPath path = null;\n\t\tcurState = new BPState(env, location, inst);\n\t\tpath = new BPPath(curState, new PathList(), new Formulas());\n\t\tpath.setCurrentState(curState);\n\t\tpathList.add(path);\n\n\t\t/*if (Program.getProgram().getFileName().equals(\"api_test_v2.3_lvl1.exe\") \n\t\t\t\t&& isRestored) {\n\t\t\tSystem.out.println(\"Restore State from File.\");\n\t\t\tFileProcess reFile = new FileProcess(\"data/data/restoreState.txt\");\n\t\t\tpathList = restoreState(reFile);\n\t\t\t// bkFile.clearContentFile();\n\t\t\tSystem.out.println(\"Finished restoring state!\");\n\t\t}*/\n\n\t\t// Update at first -----------------------------\n\t\tTIB.setBeUpdated(true);\n\t\tTIB.updateTIB(curState);\n\t\t// ---------------------------------------------\n\n\t\t// PHONG - 20150801 /////////////////////////////\n\t\t// Packer Detection via Header\n\t\tSystem.out.println(\"================PACKER DETECTION VIA HEADER ======================\");\n\t\tif (OTFModelGeneration.detectPacker)\n\t\t{\n\t\t\tprogram.getDetection().detectViaHeader(program);\n\t\t\tprogram.getDetection().setToLogFirst(program);\n\t\t}\n\t\tSystem.out.println(\"==================================================================\");\n\t\t/////////////////////////////////////////////////\n\t\t\n\t\tsynchronized (OTFThreadManager.getInstance()) {\n\t\t\ttry {\n\t\t\t\tOTFThreadManager.getInstance().check(this, pathList);\n\t\t\t\tOTFThreadManager.getInstance().wait();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t// PHONG - 20150724\n\t\tSystem.out.println(\"================PACKER DETECTION VIA OTF======================\");\n\t\tprogram.getDetection().packedByTechniques();\n\t\tprogram.getDetection().packedByTechniquesFrequency();\n\t\tSystem.out.println(\"==============================================================\");\n\t}", "@Test\n public void testCompacityUsed() {\n System.out.println(\"compacityUsed\");\n RecordFile instance = new RecordFile();\n \n Assert.assertEquals(0, instance.compacityUsed());\n \n byte[] bytes = new byte[10];\n instance.insert(bytes, 0);\n Assert.assertEquals(1, instance.compacityUsed());\n \n bytes = new byte[12];\n instance.write(bytes, 0);\n Assert.assertEquals(1, instance.compacityUsed());\n \n bytes = new byte[100];\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n instance.insert(bytes, 0);\n Assert.assertEquals(10, instance.compacityUsed());\n \n bytes = new byte[100];\n instance.remove(0);\n Assert.assertEquals(9, instance.compacityUsed());\n \n bytes = new byte[100];\n instance.remove(0);\n Assert.assertEquals(8, instance.compacityUsed());\n }", "private static void spaceSaver(FileWriter output) throws IOException {\n\t\tint totalFrequency = 0;\n\t\tint modifiedCode = 0;\n\t\t\n\t\tfor(int i = 0; i < resultIndex; i++) {\n\t\t\tmodifiedCode += (((String) results[i][1]).length()) * (Integer)(results[i][2]);\n\t\t\ttotalFrequency += (Integer)results[i][2];\n\t\t}\n\t\t\n\t\tint saved = (totalFrequency * 8) - modifiedCode;\n\t\toutput.write(\"Space Saved: \" + saved + \"bits\");\n\t}", "double getAlpha() {\n return alpha;\n }", "public static void main(String[] args)\n {\n\n try {\n PrintStream printStreamFile = new PrintStream(new BufferedOutputStream(new FileOutputStream(folderInput + \"btc_result_triple.nt\")));\n\n System.setOut(printStreamFile);\n\n fromQuadToTriple(folderInput + \"result.nt\");\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n\n }", "public abstract void alphaConversion(Variable x, Variable y);", "public double getAlpha()\n {\n return alpha;\n }", "public void writeToFile(List<Float> x, List<Float> y, List<Float> z, List<Float> x_g, List<Float> y_g, List<Float> z_g, int minVal) {\n File file = new File(PATH + \"/data.txt\");\n //File acc_file = new File(PATH + \"/accData.txt\");\n //File gyro_file = new File(PATH + \"/gyroData.txt\");\n FileOutputStream fOut = null;\n //FileOutputStream accfOut = null;\n //FileOutputStream gyrofOut = null;\n\n try {\n fOut = new FileOutputStream(file, true);\n //accfOut = new FileOutputStream(acc_file, true);\n //gyrofOut = new FileOutputStream(gyro_file, true);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n for(int i=0; i<minVal; i++){\n String x_acc= Float.toString(x.get(i));\n String y_acc= Float.toString(y.get(i));\n String z_acc= Float.toString(z.get(i));\n\n String x_gyro = Float.toString(x_g.get(i));\n String y_gyro = Float.toString(y_g.get(i));\n String z_gyro = Float.toString(z_g.get(i));\n try {\n fOut.write((x_acc+\",\").getBytes());\n fOut.write((y_acc+\",\").getBytes());\n fOut.write((z_acc+\",\").getBytes());\n fOut.write((x_gyro+\",\").getBytes());\n fOut.write((y_gyro+\",\").getBytes());\n fOut.write((z_gyro+\",\").getBytes());\n fOut.write((subject+\",\").getBytes());\n fOut.write((activity_label+\"\\n\").getBytes());\n\n Log.d(\"Data\", \"Data Written\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n try {\n fOut.close();\n //accfOut.close();\n //gyrofOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws FileNotFoundException\n {\n File file = new File(System.getProperty(\"user.home\") + \"/Desktop\", \"lion.off\");\n Scanner s = new Scanner(file);\n s.nextLine(); // Skip first line of context\n\n // Create result file(mesh2C.off)\n try { fileManager.CreateResultFile(); }\n catch(IOException exc) { System.out.println(\"Error: \" + exc.getMessage()); }\n \n // Initializing PrintWriter instance for writing data to result file\n PrintWriter pw = new PrintWriter(System.getProperty(\"user.home\") + \"/Desktop/mesh2C.off\");\n pw.println(\"OFF\"); // Write first line to mesh2C.off\n\n // Get number of vertices which lion.off has\n String str_num_of_vertices = s.next();\n String str_num_of_faces = s.next();\n int num_of_vertices = Integer.parseInt(str_num_of_vertices);\n int num_of_faces = Integer.parseInt(str_num_of_faces);\n pw.println(Integer.toString(num_of_vertices + 8) + \" \" + Integer.toString(num_of_faces + 6) + s.nextLine());\n\n // Extract max and min value of each axis(X, Y, Z) separately\n double minX = 0, maxX = 0;\n double minY = 0, maxY = 0;\n double minZ = 0, maxZ = 0;\n\n for(int i = 0; i < num_of_vertices; i++)\n {\n double x = Double.parseDouble(s.next());\n if(x < minX) { minX = x; }\n if(x > maxX) { maxX = x; }\n double y = Double.parseDouble(s.next());\n if(y < minY) { minY = y; }\n if(y > maxY) { maxY = y; }\n double z = Double.parseDouble(s.next());\n if(z < minZ) { minZ = z; }\n if(z > maxZ) { maxZ = z; }\n\n String tmp = Double.toString(x) + \" \" + Double.toString(y) + \" \" + Double.toString(z);\n pw.println(tmp); \n }\n\n // Calculate and create String arrays for Vertices and faces\n String vStr[] = new String[8];\n String fStr[] = new String[6];\n\n vStr[0] = Double.toString(minX) + \" \" + Double.toString(maxY) + \" \" + Double.toString(maxZ);\n vStr[1] = Double.toString(minX) + \" \" + Double.toString(minY) + \" \" + Double.toString(maxZ);\n vStr[2] = Double.toString(maxX) + \" \" + Double.toString(minY) + \" \" + Double.toString(maxZ);\n vStr[3] = Double.toString(maxX) + \" \" + Double.toString(maxY) + \" \" + Double.toString(maxZ);\n vStr[4] = Double.toString(minX) + \" \" + Double.toString(maxY) + \" \" + Double.toString(minZ);\n vStr[5] = Double.toString(minX) + \" \" + Double.toString(minY) + \" \" + Double.toString(minZ);\n vStr[6] = Double.toString(maxX) + \" \" + Double.toString(minY) + \" \" + Double.toString(minZ);\n vStr[7] = Double.toString(maxX) + \" \" + Double.toString(maxY) + \" \" + Double.toString(minZ);\n\n for(int i = 0; i < 8; i++) { pw.println(vStr[i]); }\n \n // Calculate face list and write into result file\n String id_quad_1 = Integer.toString(num_of_vertices);\n String id_quad_2 = Integer.toString(num_of_vertices + 1);\n String id_quad_3 = Integer.toString(num_of_vertices + 2);\n String id_quad_4 = Integer.toString(num_of_vertices + 3);\n String id_quad_5 = Integer.toString(num_of_vertices + 4);\n String id_quad_6 = Integer.toString(num_of_vertices + 5);\n String id_quad_7 = Integer.toString(num_of_vertices + 6);\n String id_quad_8 = Integer.toString(num_of_vertices + 7);\n\n fStr[0] = \"4 \" + id_quad_1 + \" \" + id_quad_4 + \" \" + id_quad_3 + \" \" + id_quad_2;\n fStr[1] = \"4 \" + id_quad_5 + \" \" + id_quad_6 + \" \" + id_quad_7 + \" \" + id_quad_8;\n fStr[2] = \"4 \" + id_quad_1 + \" \" + id_quad_5 + \" \" + id_quad_8 + \" \" + id_quad_4;\n fStr[3] = \"4 \" + id_quad_3 + \" \" + id_quad_7 + \" \" + id_quad_6 + \" \" + id_quad_2;\n fStr[4] = \"4 \" + id_quad_2 + \" \" + id_quad_6 + \" \" + id_quad_5 + \" \" + id_quad_1;\n fStr[5] = \"4 \" + id_quad_4 + \" \" + id_quad_8 + \" \" + id_quad_7 + \" \" + id_quad_3;\n\n // Copy face data from original lion.off file to result file\n s.nextLine();\n for(int i = 0; i < num_of_faces; i++) { pw.println(s.nextLine()); }\n \n // Add new face data at the bottom of result file\n for(int i = 0; i < 6; i++) { pw.println(fStr[i]); }\n\n // Terminate filestream\n s.close();\n pw.close();\n }", "public void resetAlphaValues();", "public void logResult() {\r\n resTime = resTime * 1000;\r\n int b = (int) Math.round(resTime);\r\n resTime = (double) b / 1000;\r\n double averageTime = resTime / countTESTS;\r\n averageTime = averageTime * 1000;\r\n int i = (int) Math.round(averageTime);\r\n averageTime = (double) i / 1000;\r\n try (FileWriter writer = new FileWriter(\".//result.txt\")) {\r\n writer.write(resultOpen);\r\n writer.write(resultTitle);\r\n writer.write(resultSource);\r\n writer.write(resultLinkByName);\r\n writer.write(resultLinkByHref);\r\n writer.write(\"Total tests: \" + countTESTS + \"\\n\");\r\n writer.write(\"Passed/Failed: \" + PASSED_TEST + \"/\" + FAILED_TEST + \"\\n\");\r\n writer.write(\"Total time: \" + resTime + \"\\n\");\r\n writer.write(\"Average time: \" + averageTime + \"\\n\");\r\n writer.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public static void main(String[] args) {\n\t\tdouble[] x = new double[SIZE];\r\n\t\tdouble[] y = new double[SIZE];\r\n\t\tdouble[] a = new double[SIZE];\r\n\t\tdouble[] b = new double[SIZE];\r\n\t\tdouble[] c = new double[SIZE];\r\n\t\tdouble[] d = new double[SIZE];\r\n\t\tdouble[] ksi = new double[SIZE];\r\n\t\tdouble[] eta = new double[SIZE];\r\n\t\tdouble hPow2 = Math.pow(h, 2);\r\n\t\tdouble alpha0 = -1.95, alpha1 = 2.0;\r\n\t\tdouble A1 = 0.0, B1 = -6.02;\r\n\t\tdouble beta0 = -1.2, beta1 = 1.0;\r\n\t\tksi[1] = -(alpha1/alpha0);\r\n\t\teta[1] = -(A1/alpha0);\r\n\t\tfor(int k = 1; k < SIZE; k++){\r\n\t\t\ta[k] = 1.0;\r\n\t\t\tx[k] = A + k*h;\r\n\t\t\tb[k] = 2 + hPow2*(x[k]+1);\r\n\t\t\tc[k] = 1.0;\r\n\t\t\td[k] = hPow2*(Math.pow(x[k],5)+Math.pow(x[k],3)-6*x[k]);\r\n\t\t\tif(k!=SIZE-1){\r\n\t\t\t\tksi[k+1] = (c[k])/(b[k]-ksi[k]*c[k]);\r\n\t\t\t\teta[k+1] = (a[k]*eta[k]-d[k])/(b[k]-ksi[k]*c[k]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tint n = SIZE - 1;\r\n\t\ty[n] = (B1-beta0*eta[n])/(beta1+beta0*ksi[n]);\r\n\t\tfor(int k = n-1; k > 0; k--){\r\n\t\t\ty[k] = ksi[k+1]*y[k+1] + eta[k+1];\r\n\t\t\tSystem.out.print(\"ksi: \" + ksi[k] + \" eta: \" + eta[k] + \" y: \"+ y[k]);\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private float calculateAlpha() {\n float alpha = 1.2f*(myCamera.getViewportWidth()/(2*Const.WORLD_WIDTH-myCamera.getViewportWidth()))-0.2f;\n if(alpha < 0) alpha = 0;\n if(alpha > 1) alpha = 1;\n return alpha;\n }", "@Override\n\tprotected void updateOtherProgress() {\n\t\t\n\t\ttempList.clear();\n\t\titeration++;\n\t\tJMetalLogger.logger.info(iteration + \" iteration...\");\n\t\t\n//\t\ttry {\n//\t\t\tnew SolutionListOutput(getPopulation()).printObjectivesToFile(\"results/media/FUN\"+iteration+\".tsv\");\n//\t\t} catch (IOException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "public static List<double[]> readAlpha(File f)\n/* */ throws Exception\n/* */ {\n/* 89 */ throw new Error(\"Unresolved compilation problem: \\n\");\n/* */ }", "public double getAlpha();", "public double getAlpha();", "public static void main(String [] args) throws IOException\n {\n System.out.println(\"PLAINTEXT FREQUENCY\");\n \n FrequencyAnalysis fa = new FrequencyAnalysis(); \n PrintWriter outFile1 = new PrintWriter (new File(\"plaintextfreq.txt\")); \n fa.readFile(\"plaintext.txt\"); \n int total1 = fa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile1.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n int l = 0;\n for (int k : fa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n outFile1.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n l++;\n }\n outFile1.close();\n \n System.out.println();\n System.out.println();\n System.out.println(\"CIPHER FREQUENCY\");\n \n FrequencyAnalysis cfa = new FrequencyAnalysis(); \n PrintWriter outFile2 = new PrintWriter (new File(\"ciphertextfreq.txt\")); \n cfa.readFile(\"ciphertext.txt\"); \n int total2 = cfa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile2.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n l = 0;\n for (int k : cfa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n outFile2.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n l++;\n }\n outFile2.close();\n \n \n }", "private void clearAlphaInfo() {\n \n alphaInfo_ = 0;\n }", "public void alpha(int alpha);", "private static void writeFinalRuleBase (boolean printStdOut) throws IllegalArgumentException, IOException{\n \t\n \tFileSystem fs = FileSystem.get(Mediator.getConfiguration());\n \tPath textPath = new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_text.txt\");\n BufferedWriter bwText = new BufferedWriter(new OutputStreamWriter(fs.create(textPath,true)));\n FileStatus[] status = fs.listStatus(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"));\n \tWriter writer = SequenceFile.createWriter(Mediator.getConfiguration(), \n \t\t\tWriter.file(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath())), \n \t\t\tWriter.keyClass(ByteArrayWritable.class), Writer.valueClass(FloatWritable.class));\n Reader reader;\n\t\tByteArrayWritable rule = new ByteArrayWritable();\n\t\tFloatWritable ruleWeight = new FloatWritable();\n\t\tint id = 0;\n \n bwText.write(\"\\nRULE BASE:\\n\\n\");\n if (printStdOut)\n \tSystem.out.println(\"\\nRULE BASE:\\n\");\n \t\n \t// Read all sequence files from stage 2\n \tfor (FileStatus fileStatus:status){\n \t\t\n \t\tif (!fileStatus.getPath().getName().contains(\"_SUCCESS\")){\n \t\t\n\t \t\t// Open sequence file\n\t \t\treader = new Reader(Mediator.getConfiguration(), Reader.file(fileStatus.getPath()));\n\t \n\t // Read all rules\n\t while (reader.next(rule, ruleWeight)) {\n\t \t\n\t \t// Write rule in the output sequence file\n\t \twriter.append(rule, ruleWeight);\n\t \t\n\t \tbwText.write(\"Rule (\"+id+\"): IF \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(\"Rule (\"+id+\"): IF \");\n\t \t\n\t \t// Write antecedents\n\t \tfor (int i = 0; i < rule.getBytes().length - 2; i++){\n\t \t\t\n\t \t\tbwText.write(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[i].getName()+\" IS \");\n\t \t\tif (Mediator.getVariables()[i] instanceof NominalVariable){\n\t \t\t\tbwText.write(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[i]).getNominalValue(rule.getBytes()[i])+\" AND \");\n\t \t\t}\n\t \t\t\telse {\n\t \t\t\t\tbwText.write(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[i]+\" AND \");\n\t \t\t\t}\n\t \t\t\n\t \t}\n\t \t\n\t \t// Write the last antecedent\n\t \tbwText.write(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (printStdOut)\n\t \t\tSystem.out.print(Mediator.getVariables()[rule.getBytes().length-2].getName()+\" IS \");\n\t \tif (Mediator.getVariables()[rule.getBytes().length-2] instanceof NominalVariable){\n\t \t\tbwText.write(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t\tif (printStdOut)\n\t \t\tSystem.out.print(((NominalVariable)Mediator.getVariables()[rule.getBytes().length-2]).getNominalValue(rule.getBytes()[rule.getBytes().length-2]));\n\t \t}\n\t \t\telse {\n\t \t\t\tbwText.write(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t\tif (printStdOut)\n\t \t\tSystem.out.print(\"L_\"+rule.getBytes()[rule.getBytes().length-2]);\n\t \t\t}\n\t \t\n\t \t// Write the class and rule weight\n\t \tbwText.write(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \tbwText.write(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \tif (printStdOut){\n\t \t\tSystem.out.print(\" THEN CLASS = \"+Mediator.getClassLabel(rule.getBytes()[rule.getBytes().length-1]));\n\t \t\tSystem.out.print(\" WITH RW = \"+ruleWeight.get()+\"\\n\\n\");\n\t \t}\n\t\n\t \tid++;\n\t \t\n\t }\n\t \n\t reader.close();\n \n \t\t}\n \t\t\n \t}\n \t\n \tbwText.close();\n writer.close();\n \t\n \t// Remove temporary rule base\n \tfs.delete(new Path(Mediator.getHDFSLocation()+Mediator.getLearnerRuleBasePath()+\"_TMP\"),true);\n \t\n }", "public double getAlpha() {\n return alpha;\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"HALTING Files\", EXT);\n\t\t\t\tchooser.setFileFilter(filter);\n\t\t\t\tint choice = chooser.showSaveDialog(MainWindow.this);\n\t\t\t\tif (choice != JFileChooser.APPROVE_OPTION)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t// ensure correct extension\n\t\t\t\tFile file = chooser.getSelectedFile();\n\t\t\t\tif (! file.getName().endsWith(\".\" + EXT))\n\t\t\t\t\tfile = new File(file + \".\" + EXT);\n\t\t\t\tString filename = file.getAbsolutePath();\n\n\t\t\t\t// attempt to output automaton to file\n\t\t\t\ttry {\n\t\t\t\t\toutputToFile(filename);\n\t\t\t\t\t\n\t\t\t\t\t// delete the original (if overwriting)\n\t\t\t\t\tif (file.exists())\n\t\t\t\t\t\tFiles.delete(file.toPath());\n\t\t\t\t\t\n\t\t\t\t\t// rename the tmp file\n\t\t\t\t\tFile newFile = new File(filename + \".tmp\");\n\t\t\t\t\tif (!newFile.renameTo(file))\n\t\t\t\t\t\tthrow new FileError(file.getAbsolutePath(), true);\n\t\t\t\t}\n\t\t\t\t// warn the user about a failure\n\t\t\t\tcatch (Exception e) {\n\t\t\t\t\tString msg = e.getMessage();\n\t\t\t\t\treportException(new FileError(msg == null ? filename \n\t\t\t\t\t\t\t : msg, true));\n\t\t\t\t}\n\t\t\t}", "public void endCompute();", "public static void main(String[] args) {\n\t\tHashMap<String, HashMap<String, Double>> file_alph_tf = new HashMap<String, HashMap<String, Double>>();\n\t\tHashMap<String, Double> file_alph_idf = new HashMap<String, Double>();\n\t\tHashMap<String, Double> tmp_idf = new HashMap<String, Double>();\n\t\tHashMap<String, HashMap<String, Double>> result_map = new HashMap<String, HashMap<String, Double>>();\n\t\t// 이후에 cosine similarity를 계산할때 사용할 top5해쉬맵\n\t\tHashMap<String, HashMap<String, Double>> top5 = new HashMap<String, HashMap<String, Double>>();\n\t\t\n\t\tTest01 t1 = new Test01();\n\t\tTest02 t2 = new Test02();\n\t\tTest03 t3 = new Test03();\n\t\t\n\t\t// 각 문서의 특성을 추출 : Test04 - map\t\t\n\t\t\n\t\tFile[] fileList = t1.get_file();\n\t\t\n\t\tfor (File file : fileList) {\n\t\t\t\n\t\t\tHashMap <String, Double> tmp_map = new HashMap <String, Double>();\n\t\t\t\n\t\t\t// count alphabet _ each files\n\t\t\ttry {\n\t\t\t\tFileReader file_reader = new FileReader(file);\n\t\t\t\tint cur = 0;\n\t\t\t\twhile ((cur = file_reader.read()) != -1) {\n\t\t\t\t\tif (cur != 32) {\n\t\t\t\t\t\tif (!tmp_map.containsKey(String.valueOf((char)cur))) {\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur), (double) 1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdouble temp_num = tmp_map.get(String.valueOf((char)cur));\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur),temp_num+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(FileNotFoundException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t} catch(IOException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// calc_TF\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(tmp_map.keySet());\n\t\t\tdouble sum_value = 0;\n\t\t\t// TF의 분모 문서내에 오는 모든수 더하기\n\t\t\tfor (String k : key_lst) {\n\t\t\t\tsum_value += tmp_map.get(k);\t\n\t\t\t}\n\t\t\t// TF의 분자 : 해당 파일에 있는 알파벳의 갯수 (tmp_map에 저장되어있음) / tf분모\n\t\t\tfor (String tf_k : key_lst) {\n\t\t\t\tdouble tf = tmp_map.get(tf_k) / sum_value;\n\t\t\t\ttmp_map.put(tf_k, tf);\n\t\t\t}\n\t\t\tsum_value = 0;\n\t\t\tfile_alph_tf.put(file.getName(), tmp_map);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// calc_IDF_Bottom : counting IDF_Bottom\n\t\t\ttmp_idf = file_alph_tf.get(file.getName());\n\t\t\t\n\t\t\tfor (String idf_k : key_lst) {\n\t\t\t\tif (tmp_idf.get(idf_k) != 0) {\n\t\t\t\t\tif (!file_alph_idf.containsKey(idf_k)) {\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, (double) 1);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tdouble tmp_num = file_alph_idf.get(idf_k);\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, tmp_num+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t} // file의 이름으로 반복\n\t\t\n\t\t\n\t\t// calc_IDF\n\t\tfor (File file : fileList) {\n\t\t\tHashMap<String, Double> aa = new HashMap<String, Double>();\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(file_alph_idf.keySet());\n\t\t\tdouble temp_num = 0;\n\t\t\tfor (String key : key_lst) {\n\t\t\t\t\n\t\t\t\tdouble tf;\n\t\t\t\ttemp_num = 0;\n\t\t\t\ttry {\n\t\t\t\t\ttf = file_alph_tf.get(file.getName()).get(key);\n\t\t\t\t\tif (file_alph_idf.get(key) != 0) {\n\t\t\t\t\t\tdouble tt = file_alph_idf.get(key);\n\t\t\t\t\t\ttemp_num = 7/tt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp_num = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch(NullPointerException e) {\n\t\t\t\t\ttf = 0;\n\t\t\t\t}\n\t\t\t\tdouble idf = Math.log(1+ temp_num);\n\t\t\t\tdouble tfidf = tf*idf;\n\t\t\t\taa.put(key, tfidf);\n\t\t\t}\n//\t\t\tSystem.out.println();\n\t\t\tresult_map.put(file.getName(), aa);\n\t\t}\t\n\t\n\t\t\n\t\t\n\t\t\n\t\tfor(File f : fileList) {\n\t\t\t\n\t//---------------------------------------상위 5개-------------------------------------------\t\t\t\n\t\t\t\n//\t\t\tSystem.out.println(f.getName());\n\t\t\tString f_n = f.getName(); \n\t\t\t\n\t\t\t// 0. 정렬 전 파일 출력\n//\t\t\tArrayList <String> key_lst = new ArrayList<String>(result_map.get(f_n).keySet());\n//\t\t\tfor (String kk : key_lst) {\n//\t\t\t\tSystem.out.println(kk + \" : \" + result_map.get(f_n).get(kk));\n//\t\t\t}\n\t\t\t\n\t\t\tArrayList<String> Top5List = sortHSbyValue_double(result_map.get(f_n));\n//\t\t\tSystem.out.println(Top5List);\n\t\t\tHashMap<String, Double> map = new HashMap<String, Double>();\n\t\t\tfor (String s : Top5List) {\n\t\t\t\tmap.put(s, result_map.get(f_n).get(s));\n\t\t\t}\n\n\t\t\ttop5.put(f_n, map);\t\n\t\t}\n\t\t\n\t\t// cosine_similarity\n\t\t// 구하기 전에 벡터의 차원을 맞춰준다.\n\t\t// input받는 파일을 제외한 나머지 파일들과의 유사도를 구한다.\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"문서 이름을 입력하세요 : \");\n\t\tString input = sc.next();\n\t\t\n\t\tHashMap<String, Double> csMap = new HashMap<String, Double>();\n\t\t\n\t\tfor (File f : fileList) {\n\t\t\tHashMap<String, Double> a = (HashMap<String, Double>) top5.get(input).clone();\n\t\t\tArrayList<String> a_key_lst = new ArrayList<String>(a.keySet());\n\t\t\tArrayList<String> total_key = new ArrayList<String>();\n\t\t\t\n\t\t\tif (input.equals(f.getName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tHashMap<String, Double> b = (HashMap<String, Double>) top5.get(f.getName()).clone();\n\t\t\tArrayList<String> b_key_lst = new ArrayList<String>(b.keySet());\n\t\t\t\n\t\t\tfor (String a_k : a_key_lst) {\n\t\t\t\ttotal_key.add(a_k);\n\t\t\t}\n\t\t\tfor (String b_k : b_key_lst) {\n\t\t\t\ttotal_key.add(b_k);\n\t\t\t}\n\t\t\t\n\t\t\tfor (String t_k : total_key) {\n\t\t\t\tif(!a.containsKey(t_k)) {\n\t\t\t\t\ta.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t\tif(!b.containsKey(t_k)) {\n\t\t\t\t\tb.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble[] a_lst = t3.mapToList(a);\n\t\t\tdouble[] b_lst = t3.mapToList(b);\n\t\t\tdouble cs = cosinSimilarity(a_lst, b_lst);\n\t\t\tcsMap.put(f.getName(), cs);\n\t\t\t\n\t\t\ta_key_lst.clear();\n\t\t\ttotal_key.clear();\n\t\t\t\n\t\t}\n\t\t\n\t\tt2.sort_print(csMap, input);\n\t\t\n\t\tSystem.out.println();\n\t}", "private static void outputResult(int result, File file) {\n\n try (FileWriter fileWriter = new FileWriter(file)) {\n fileWriter.write(result + \"\");\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }", "@Override\n protected void updateAlpha(TcpPacket packet, long dataSizeAcknowledgedBytes) {\n\n // ECN statistics\n totalBytes += dataSizeAcknowledgedBytes;\n if (packet.isECE()) {\n markedBytes += dataSizeAcknowledgedBytes;\n }\n\n // Check if a full window has already passed\n if (totalBytes >= alphaUpdateWindow) {\n\n // Update the fraction: alpha <- (1 - g) * alpha + g * F\n if (totalBytes > 0) {\n alphaFraction = DCTCP_WEIGHT_OLD_ESTIMATION * alphaFraction + DCTCP_WEIGHT_NEW_ESTIMATION * ((double) markedBytes) / ((double) totalBytes);\n } else {\n alphaFraction = 0.0;\n }\n\n // Reset counters\n markedBytes = 0;\n totalBytes = 0;\n\n // It must wait until a full currently sized congestion window has been\n // sent until it can re-evaluate the window (this is roughly once per RTT)\n alphaUpdateWindow = (long) congestionWindow;\n\n }\n\n }", "public void computeSaving(File inputFile, File outputFile){\n clearFile(outputFile);\n \n int normBits =0;\n int huffBits =0;\n try{\n Scanner sc = new Scanner(inputFile);\n BufferedWriter output = new BufferedWriter(new FileWriter(outputFile,true));\n while(sc.hasNextLine()){\n String line = sc.nextLine();\n \n for(int i =0; i<line.length();i++){\n Character toCaculate = line.charAt(i);\n \n huffBits = encodedTable.get(toCaculate).length()*freqTable.get(toCaculate);\n normBits = 8*freqTable.get(toCaculate);\n savings = normBits - huffBits;\n \n String encoded = \"\";\n encoded = encodedTable.get(toCaculate);\n output.write(encoded);\n }\n }\n output.close();\n }\n catch(IOException e){\n System.out.println(\"IOException\");\n }\n }", "public static double track2math(double alpha) {\n return Math.PI/2 - alpha;\n }", "public double getAlpha()\n\t{\n\t\treturn Math.toRadians(alpha);\n\t}", "public void processRun(int nr, boolean logAtomics) throws IOException {\r\n\t\tString out =\"\";\r\n\t\t\r\n\t\tif(logAtomics) {\r\n\t\t\tout = \"\"+data.getName()+\" run \"+nr;\r\n\t\t\twriter.write(out);\r\n\t\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\t\tout = \"gen\"+SEP+\"fitness\"+SEP+\"pfm\"+SEP+\"f_full\"+SEP+\"f_1to1\"+SEP+\"dur\"+SEP+\"AUC_full\"+SEP+\"AUC_1to1\"+SEP+\"AUC_pfm\"+SEP+\"metric\"+SEP+\"prec\"+SEP+\"recall\";\r\n\t\t\twriter.write(out);\r\n\t\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\t\t// write to file\r\n\t\t\twriter.flush();\r\n\t\t}\r\n\t\tdouble xBefore = 0;\r\n\t\t\r\n\t\tdouble aucFull = 0; double yFullBefore = 0;\r\n\t\t\r\n\t\tdouble auc1to1 = 0; double y1to1Before = 0;\r\n\t\t\r\n\t\tdouble aucpfm = 0; double ypfmBefore = 0;\r\n\t\t\r\n\t\tMapping reference = data.getReferenceMapping();\r\n\t\tfor(int i = 0; i<perRunAndDataSet.size(); i++) {\r\n\t\t\tEvaluationPseudoMemory mem = perRunAndDataSet.get(i);\r\n\t\t\tMapping map = fitness.getMapping(mem.metric.getExpression(), mem.metric.getThreshold(), true);\r\n\t\t\t// For real F-measures use best 1-to-1 mapping\r\n\t\t\tMapping map_1to1 = Mapping.getBestOneToOneMappings(map);\r\n\t\t\tdouble prec, recall, fMeasure, prec_1to1, recall_1to1, fMeasure_1to1;\r\n\t\t\tPRFCalculator prf = new PRFCalculator();\r\n\t\t\tprec = prf.precision(map, reference);\r\n\t\t\trecall = prf.recall(map, reference);\r\n\t\t\tfMeasure = prf.fScore(map, reference);\r\n\t\t\t\r\n\t\t\tif(Double.isNaN(fMeasure) || Double.isInfinite(fMeasure)) {\r\n\t\t\t\tSystem.err.println(\"NaN computation on Fmeasure, setting it to 0\");\r\n\t\t\t\tfMeasure = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmem.precision=prec;\r\n\t\t\tmem.recall=recall;\r\n\t\t\tmem.fmeasue=fMeasure;\r\n\t\t\t\r\n\t\t\tprec_1to1 = prf.precision(map_1to1, reference);\r\n\t\t\trecall_1to1 = prf.recall(map_1to1, reference);\r\n\t\t\tfMeasure_1to1 = prf.fScore(map_1to1, reference);\r\n\t\t\t\r\n\t\t\tif(Double.isNaN(fMeasure_1to1) || Double.isInfinite(fMeasure_1to1)) {\r\n\t\t\t\tSystem.err.println(\"NaN computation on Fmeasure 1-to-1, setting it to 0\");\r\n\t\t\t\tfMeasure_1to1 = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmem.precision_1to1=prec_1to1;\r\n\t\t\tmem.recall_1to1=recall_1to1;\r\n\t\t\tmem.fmeasue_1to1=fMeasure_1to1;\r\n\t\t\t// compute auc values\r\n\t\t\tdouble xNow=mem.generation;\r\n\t\t\taucFull += computeAUCSummand(xBefore, xNow, yFullBefore, fMeasure);\r\n\t\t\tauc1to1 += computeAUCSummand(xBefore, xNow, y1to1Before, fMeasure_1to1);\r\n\t\t\taucpfm += computeAUCSummand(xBefore, xNow, ypfmBefore, mem.pseudoFMeasure);\r\n\t\t\t//log\r\n\t\t\tif(logAtomics) {\r\n\t\t\t\tlogAtomic(mem, aucFull, auc1to1, aucpfm);\r\n\t\t\t}\r\n\t\t\txBefore = xNow;\r\n\t\t\tyFullBefore = fMeasure;\r\n\t\t\ty1to1Before = fMeasure_1to1;\t\r\n\t\t\typfmBefore = mem.pseudoFMeasure;\r\n\t\t}\r\n\t\t// log to statistics final fs,auc\r\n\t\tF_full.add(yFullBefore);\r\n\t\tF_1to1.add(y1to1Before);\r\n\t\tPFM.add(ypfmBefore);\r\n\t\tAUC_full.add(aucFull);\r\n\t\tAUC_1to1.add(auc1to1);\r\n\t\tAUC_pfm.add(aucpfm);\r\n\t\t\r\n\t\tout = data.getName()+\" run:\"+nr+\"\\n\"+\"gens\"+SEP+\"fit\"+SEP+\"pfm\"+SEP+\"f\"+SEP+\"f_1to1\"+SEP+\"dur\"+SEP+\"AUC\"+SEP+\"AUC_1to1\"+SEP+\"AUC_pfm\";\r\n\t\twriter.write(out);\r\n\t\twriter.write(System.getProperty(\"line.separator\"));\r\n\t\tlogAtomic(perRunAndDataSet.getLast(),aucFull,auc1to1,aucpfm);\r\n\t}", "float getAlpha();", "void setAlpha(double alpha) {\n this.alpha = alpha;\n }", "public final double getAlpha() {\n\t\treturn alpha;\n\t}", "public Recording run(Cluster cluster, JProgressBar prog) {\r\n ArrayList<Atom> atoms = cluster.getAtoms();\r\n int step = 0;\r\n int progress = 0;\r\n double potentialEnergy;\r\n totalTime = 0.0;\r\n\r\n //Set current step to parameter passed by user\r\n currentStep = stepSize;\r\n isConverged = false;\r\n\r\n //Set the cluster and initialize space for temporary saved data\r\n this.cluster = cluster;\r\n\r\n if(algorithm.equals(\"Conjugate Gradient\")) {\r\n savedLocations = new Vector3D[atoms.size()];\r\n savedForces = new Vector3D[atoms.size()];\r\n savedVectors = new Vector3D[atoms.size()];\r\n for(int i = 0; i < atoms.size(); i++) {\r\n savedLocations[i] = new Vector3D();\r\n savedForces[i] = new Vector3D();\r\n savedVectors[i] = new Vector3D();\r\n }\r\n } else {\r\n savedLocations = new Vector3D[atoms.size()];\r\n for(int i = 0; i < atoms.size(); i++)\r\n savedLocations[i] = new Vector3D();\r\n }\r\n\r\n //Set up the output recording\r\n Recording output = new Recording(cluster, outputInterval);\r\n\r\n output.setType(type);\r\n output.setStep(timestep);\r\n //Set up the progress bar\r\n prog.setMinimum(0);\r\n prog.setMaximum(numSteps - 1);\r\n prog.setValue(0);\r\n\r\n //Add the initial frame\r\n Frame initial = new Frame();\r\n ArrayList<Point3D> ilocations = new ArrayList<Point3D>();\r\n\r\n for(Atom a : atoms) {\r\n ilocations.add(new Point3D(a.location.x, a.location.y, a.location.z));\r\n }\r\n\r\n HashMap<String, Double> ienergies = cluster.getEnergies();\r\n potentialEnergy = 0.0;\r\n for(String eName : ienergies.keySet()) {\r\n //Convert each energy from CEU to kcal\r\n double energyTerm = ienergies.get(eName).doubleValue() * CEU_TO_KCAL;\r\n ienergies.put(eName, energyTerm);\r\n\r\n //Accumulate to total potential\r\n potentialEnergy += energyTerm;\r\n }\r\n\r\n initial.setLocations(ilocations);\r\n initial.setEnergies(ienergies);\r\n initial.setTime(totalTime);\r\n initial.potentialEnergy = potentialEnergy;\r\n initial.totalEnergy = potentialEnergy;\r\n initial.temperature = 0.0;\r\n initial.kineticEnergy = 0.0;\r\n output.addFrame(initial);\r\n\r\n //Advance the simulation by each timestep\r\n for(step = 1; step < numSteps; step++) {\r\n if(algorithm.equals(\"Steepest Descent\"))\r\n steepestDescent();\r\n else if(algorithm.equals(\"Conjugate Gradient\"))\r\n conjugateGradient(step);\r\n\r\n //If the step is on the output interval, add a frame\r\n if((step % outputInterval) == 0 || isConverged) {\r\n //Calculate potential energies for each association and add accumulate to get total potential energy\r\n HashMap<String, Double> energies = cluster.getEnergies();\r\n potentialEnergy = 0.0;\r\n for(String eName : energies.keySet()) {\r\n //Convert each energy from CEU to kcal\r\n double energyTerm = energies.get(eName).doubleValue() * CEU_TO_KCAL;\r\n energies.put(eName, energyTerm);\r\n\r\n //Accumulate to total potential\r\n potentialEnergy += energyTerm;\r\n }\r\n\r\n //Create a frame\r\n Frame f = new Frame();\r\n ArrayList<Point3D> locations = new ArrayList<Point3D>();\r\n\r\n for(Atom a : atoms) {\r\n locations.add(new Point3D(a.location.x, a.location.y, a.location.z));\r\n }\r\n\r\n f.setLocations(locations);\r\n f.setEnergies(energies);\r\n f.setTime(totalTime);\r\n f.potentialEnergy = potentialEnergy;\r\n f.totalEnergy = potentialEnergy;\r\n f.temperature = 0.0;\r\n f.kineticEnergy = 0.0;\r\n\r\n output.addFrame(f);\r\n }\r\n\r\n //Check for convergence and exit if finished\r\n if(isConverged)\r\n break;\r\n }\r\n\r\n //Indicate completion\r\n prog.setValue(numSteps - 1);\r\n\r\n return output;\r\n }", "public void printer() throws Exception{\n File outputFile = new File(\"output.txt\");\n FileOutputStream is = new FileOutputStream(outputFile);\n OutputStreamWriter osw = new OutputStreamWriter(is);\n Writer w = new BufferedWriter(osw);\n w.write(this.result());\n w.close();\n }", "public void update(double[] x, double y, double alpha){ \n\t\tfor (int i = 0; i < x.length; i++) {\n\t\t\tdouble wi = weights[i]; \n\t\t\tdouble xi = x[i];\t\t\t\t\t\t\t// Follow the update rule\n\t\t\tweights[i] = wi + alpha*(y - eval(x)) * eval(x)*(1.0 - eval(x)) * xi;\t\n\t\t\t//System.out.printf(\"%.5f\\n\", weights[i]);\n\t\t\t\n\t\t}\n\t}", "public EnigmaFile() throws Exception\n {\n\n String path = Main.class.getClassLoader().getResource(\"filein.txt\").getPath();\n File currentDirectory=new File(path);\n finstream = new FileInputStream(currentDirectory);\n\n\n String pathToWrite = path.replaceFirst(\"filein.txt\",\"fileout.txt\");\n File outputFile = new File(pathToWrite);\n br = new BufferedReader(new InputStreamReader(finstream));\n outputFile.createNewFile();\n FileWriter fileWrite = new FileWriter(outputFile.getAbsoluteFile());\n writer = new BufferedWriter(fileWrite);\n\n\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void finalSave() {\n ArrayList<ArrayList<Tensor<?>>> at = getWeights();\n\n ArrayList<float[]> diff = new ArrayList<>();\n ArrayList<ArrayList<Tensor<?>>> bt = getWeights();\n for(int x = 0; x < 4; x++)\n {\n float[] d = new float[flattenedWeight(bt.get(x).get(0)).length];\n float[] bw = flattenedWeight(bt.get(x).get(0));\n float[] aw = flattenedWeight(at.get(x).get(0));\n\n for(int j = 0; j < bw.length; j++)\n {\n d[j] = aw[j] - bw[j];\n }\n diff.add(d);\n }\n\n save(diff);\n }", "private void updateImageFile() throws FileNotFoundException {\n \t\tfinal PrintWriter out = new PrintWriter(asciiImageFile);\n \t\tout.print(asciiImage(false));\n \t\tout.close();\n \t}", "public void saveResult() {\n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(new FileOutputStream(resultFile));\n\t\t\tout.println(record.resultToString());\n\t\t\tout.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void compute() {}", "@Override\r\n public void calculate() {\r\n TextOutput();\r\n }", "private void arretes_fR(){\n\t\tthis.cube[13] = this.cube[10]; \n\t\tthis.cube[10] = this.cube[12];\n\t\tthis.cube[12] = this.cube[16];\n\t\tthis.cube[16] = this.cube[14];\n\t\tthis.cube[14] = this.cube[13];\n\t}", "public static void main( String args[] )\n {\n double Ei = 500;\n double EPS = 10;\n double phi = 60;\n float mutS = 0.1f;\n float mutA = 0.2f;\n float gamma = 45;\n double energy = Ei - EPS;\n\n double self = SelfShielding( energy, Ei, phi, mutS, mutA, gamma );\n System.out.println( \"self shielding factor = \" + self );\n // result should be: 1.1944503488285683\n\n String filename = \"/usr2/HRCS_TEST/hrcs3084.run\";\n RunfileRetriever rr = new RunfileRetriever( filename );\n DataSet ds = rr.getDataSet(1);\n Operator ToEL = new SpectrometerTofToEnergyLoss( ds, 0, 0, 0 );\n ds = (DataSet)ToEL.getResult();\n new ViewManager( ds, IViewManager.IMAGE );\n\n Vector result = SelfShielding( ds, mutS, mutA, gamma, true );\n\n DataSet ss_ds_1 = (DataSet)result.elementAt(0); \n new ViewManager( ss_ds_1, IViewManager.IMAGE );\n\n DataSet ss_ds_2 = (DataSet)result.elementAt(1); \n new ViewManager( ss_ds_2, IViewManager.IMAGE );\n }", "public static void addBatchResultsEncode(Args args, double finalTime, long coded_size, float factor){\n BufferedWriter output;\n //The header is:\n // tilesize threshold seekrange gop | codeTime codedSize compressionFactor | decodeTime qualityFactor\n try {\n output = new BufferedWriter(new FileWriter(\"encodeBatch.txt\", true));\n String result = args.tileSize + \" \" + args.thresh + \" \" + args.seekRange + \" \" + args.gop + \" | \" + finalTime + \" \" + coded_size + \" \" + factor;\n output.append(result);\n output.close();\n } catch (IOException ex) {\n Logger.getLogger(ProjectePractiques.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void finish(){\n numDCtoVolatility();\n }", "public static void main(String[] args) throws IOException, ClassNotFoundException {\n\n //Test library merge and append\n File file1 = new File(\"C:/pandyDS/SpecA.mgf\");\n File file2 = new File(\"C:/pandyDS/SpecA_converted.msp\");\n SpectraReader rd = new MgfReader(file1);\n SpectraWriter wr = new MspWriter(file2);\n \n ArrayList<Spectrum> spectraAll;\n spectraAll=rd.readAll();\n for(Spectrum s:spectraAll){\n wr.write(s);\n }\n \n // File file3 = new File(\"C:/pandyDS/testfile3.msp\");\n // MergeLibrary mrg = new MergeLibrary(file1, file2, file3);\n // mrg.Start();\n\n //AppendLibrary appnd=new AppendLibrary(file1, file2);\n //appnd.Append();\n// File file=new File(\"C:/pandyDS/testfile.mgf\");\n// File decoyFile = new File(\"C:/pandyDS/testfile_decoy\" + \".mgf\");\n// BufferedWriter bw=null;\n// \n// Indexer gi;\n// try {\n// gi = new Indexer(file);\n// \n// List<IndexKey> indxList=gi.generate();\n// \n// \n// SpectraReader rd = new MgfReader(file, indxList);\n// SpectraWriter wr = new MgfWriter(decoyFile);\n//\n// bw = new BufferedWriter(new FileWriter(decoyFile));\n// Spectrum spectrum;\n// for (IndexKey indx : indxList) {\n// Long pos = indx.getPos();\n// spectrum = rd.readAt(pos);\n// wr.write(spectrum, bw);\n// }\n//\n// \n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }finally {\n// try {\n// bw.close();\n// } catch (IOException ex) {\n// Logger.getLogger(MspWriter.class.getName()).log(Level.SEVERE, null, ex);\n// }\n// }\n// \n// \n// \n// File specfile = new File(\"C:/pandyDS/MSMSpos20_6.mzML\");// human_hcd_selected.msp// MSMSpos20_6.mzML//AdLungCD4_Medium.mgf\n// File opfile = new File(\"C:/pandyDS/AdLungCD4_Medium.mgf\");\n//\n//// if (specfile.getName().endsWith(\"mzML\")) {\n////\n//// MzmlReader reader = new MzmlReader(specfile);\n//// ArrayList<Spectrum> spec = reader.readAll();\n//// System.out.println(\"reading finished\" + spec.toString());\n////\n//// }\n//\n// String indxfilename = specfile.getName().substring(0, specfile.getName().lastIndexOf(\".\"));\n// File indxfile = new File(specfile.getParent(), indxfilename + \".idx\");\n//\n// double pcm = 1298.5546875;//584.8876; //;\n// double error = 0.03;\n//\n// List<Spectrum> spectra = null;\n// List<IndexKey> indxList;\n//\n// if (indxfile.exists()) {\n//\n// Indexer indxer = new Indexer();\n// indxList = indxer.readFromFile(indxfile);\n//\n// } else {\n//\n// Indexer gi = new Indexer(specfile);\n// indxList = gi.generate();\n// Collections.sort(indxList);\n//\n// }\n//\n// SpectraReader rd = null;\n// SpectraWriter wr = null;\n// if (specfile.getName().endsWith(\"mgf\")) {\n// rd = new MgfReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// } else if (specfile.getName().endsWith(\"msp\")) {\n// rd = new MspReader(specfile, indxList);\n// wr = new MspWriter(opfile, spectra);\n//\n// }\n//\n// if (rd != null) {\n// spectra = rd.readPart(pcm, error);\n// wr.write();\n// }\n }", "public void storeToFile() throws IOException {\n\t\t\n\t\tDLProgramStorer storer = new DLProgramStorerImpl();\n\t\t\n\t\t//String datalogFile = inputCKR.getGlobalOntologyFilename() + \".dlv\";\n\t\t//String datalogFile = \"./testcase/output.dlv\";\n\t\t//System.out.println(datalogGlobal.getStatements().size());\n\t\t\n\t\tFileWriter writer = new FileWriter(outputFilePath);\n\t\tstorer.store(datalogCKR, writer);\n\t\t//writer.flush();\n\t\twriter.close();\n\t\t\n\t\t//System.out.println(\"CKR program saved in: \" + outputFilePath);\n\t}", "private void updateOutputValues()\n {\n // TODO: You may place code here to update outputY and outputZ\n \t// Drawing code belongs in drawOnTheCanvas\n \t\n // example:\n outputY = inputA && inputC;\n }", "public String VerticalOp() {\n String line;\n try {\n BufferedReader br = new BufferedReader(new FileReader(file1));\n BufferedReader br2 = new BufferedReader(new FileReader(file2));\n BufferedWriter bw = new BufferedWriter(new FileWriter(\"output\" + mProcCount + extension));\n\n do{\n line = br.readLine();\n bw.write(line);\n }while(line != null);\n\n do{\n line = br2.readLine();\n bw.write(line);\n bw.newLine();\n }while(line != null);\n bw.flush();\n }\n catch(FileNotFoundException e) {\n System.out.println(\"ERROR: File does not exist. Please input a valid input file.\");\n }\n catch(IOException e) {\n System.out.println(\"ERROR: Failure while reading from file.\");\n }\n ++mProcCount;\n return \"output\" + mProcCount + extension;\n }", "@Override\n\tprotected void saveResults(){\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"_yyyy_MM_dd_HH:mm:ss\");\n\t\tDate date = new Date();\n\t\ttry(BufferedWriter bw=new BufferedWriter(new FileWriter(\"/home/daniel/results/\"+this.mAffinityType+\"/\"+this.getClass().getSimpleName()+\"/\"+MAX_TASK_AGE+\"/\"+mOutputFileName+dateFormat.format(date)))){\n\t\t\tbw.write(this.getClass().getSimpleName()+\" with max age=\"+MAX_TASK_AGE+\"\\n\");\n\t\t\tbw.write(\"Total processing time: \"+cycles+\" TU\\n\");\n\t\t\tint count=0;\n\t\t\tfor(Task t : mTasks){\n\t\t\t\tbw.write(++count + \":\");\n\t\t\t\tif(t.getmAge()>=MAX_TASK_AGE){\n\t\t\t\t\tbw.write(\"Aging used\\n\");\n\t\t\t\t}else{\n\t\t\t\t\tbw.write(\"Aging not used\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbw.write(\"###############################################################\\n\");\n\t\t\tfor(int i=0;i<Task.TYPES_OF_TASK_NUMBER;++i){\n\t\t\t\tfor(int j=0;j<Task.TYPES_OF_TASK_NUMBER;++j){\n\t\t\t\t\tfor(int k=0;k<Task.TYPES_OF_TASK_NUMBER;++k){\n\t\t\t\t\t\t DecimalFormat df = new DecimalFormat(\"0.0\");\n\t\t\t\t\t\tbw.write(\"[\"+df.format(AFFINITY3[i][j][k])+\"]\");\n\t\t\t\t\t}\n\t\t\t\t\tbw.write(\"\\n\");\n\t\t\t\t}\n\t\t\t\tbw.write(\"###############################################################\\n\");\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void gen_encrypted_image(double mat[][])\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tgetpixel_1(mat);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgetpixel_2(mat);\n\t\t}\n\t\ttry\n\t\t{\n\t\t\tImageIO.write(img, \"jpg\", new File(folder+\"Encrypted_\"+name));\n\t\t\tRuntime.getRuntime().exec(folder+\"Encrypted_\"+name);\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t}\t\t\n }", "public void calculate() {\n float xoff = 0;\n for (int i = 0; i < cols; i++)\n { \n float yoff = 0;\n for (int j = 0; j < rows; j++)\n {\n z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120);\n yoff += 0.1f;\n }\n xoff += 0.1f;\n }\n zoff+=0.01f;\n }", "public float getAlpha() {\n \t\treturn alpha;\n\t}", "private static void save(Aircraft ac, String fileName) {\n\t\ttry {\n\t\t\tbw = new BufferedWriter(new FileWriter(fileName, true));\n\t\t\tbw.append(ac.toString().replace(\"\\n\", \"\\r\\n\"));\n\t\t\tbw.newLine();\n\t\t\tbw.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IO ERROR received: \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void renderScore() {\r\n FileDialog fd = new FileDialog(this, \"Save as an audio file...\", FileDialog.SAVE);\r\n fd.setFile(\"FileName.au\");\r\n fd.show();\r\n //write a MIDI file to disk\r\n if ( fd.getFile() != null) {\r\n this.audioFileName = fd.getDirectory() + fd.getFile();\r\n Write.au(score, audioFileName, insts);\r\n \r\n }\r\n audioViewBtn.setEnabled(true);\r\n audioPlayBtn.setEnabled(true);\r\n }", "public void SetLearnRate (double alpha) { this.alpha = alpha; }", "private void finalCalculation()\n {\n // Variables for computational tasks during this part alone\n double result = 0;\n String stringOperator = \"\";\n String stringValue1 = \"\";\n String stringValue2 = \"\";\n\n try\n {\n // If an operator has previously been assigned, ignore key press\n if(values.size() == 0 || isOperator(values.get(values.size()-1).toString()) || !hasOperator)\n {\n return;\n }\n \n\n // Calculate the total value\n for(Iterator<String> i = values.iterator(); i.hasNext();)\n {\n // Get text\n String item = i.next();\n \n // If it is an operator\n if(isOperator(item))\n {\n // Calculate previous values and add to value1 - then set latest operator\n if(!\"\".equals(stringOperator))\n {\n // Calculate previously stored\n result = calculate(Double.parseDouble(stringValue1), Double.parseDouble(stringValue2), stringOperator);\n stringValue1 = result + \"\"; // Add calculated value as first result\n stringValue2 = \"\";\n }\n stringOperator = item;\n }\n else\n {\n // If no operator has previously been assigned, just append values to first value\n if(\"\".equals(stringOperator))\n {\n // Append values on eachother\n stringValue1 = stringValue1 + item;\n }\n else\n {\n // Operator have been assigned, which means we already have a value1 - add to string value 2 instead\n stringValue2 = stringValue2 + item;\n }\n }\n \n // If this is our last loop, calculate total and add into result\n if(!i.hasNext())\n {\n result = calculate(Double.parseDouble(stringValue1), Double.parseDouble(stringValue2), stringOperator);\n } \n }\n \n // Output results\n textOutput.setText(result + \"\");\n \n // Clear stored values\n values.clear();\n \n // Reset\n reset = true;\n hasOperator = false;\n \n }\n catch(Exception ex)\n {\n // Output results\n textOutput.setText(0 + \"\");\n \n // Clear stored values\n values.clear();\n \n // Reset\n reset = true;\n hasOperator = false;\n } \n }", "public String LateralOp(String name) {\n String line1, line2, tmpBuf1, tmpBuf2;\n try {\n BufferedReader br = new BufferedReader(new FileReader(file1));\n BufferedWriter bw = new BufferedWriter(new FileWriter(name));\n\n // Working with two files\n if (file2 != null) {\n BufferedReader br2 = new BufferedReader(new FileReader(file2));\n\n do{\n line1 = br.readLine(); line2 = br2.readLine();\n tmpBuf1 = line1 == null ? \"\" : line1;\n tmpBuf2 = line2 == null ? \"\" : line2;\n\n bw.write(tmpBuf1 + tmpBuf2);\n bw.newLine();\n }while (line1!= null || line2 != null);\n bw.flush();\n }\n // Working with spacers\n else{\n line2 = \"\";\n for (int i = 0; i < spaceCount; ++i) {\n line2 += spacer;\n }\n while((line1 = br.readLine()) != null) {\n bw.write(line1 + line2);\n bw.newLine();\n }\n bw.flush();\n }\n }\n catch (FileNotFoundException e) {\n System.err.println(\"ERROR: File does not exist. Please input a valid file.\");\n }\n catch (IOException e) {\n System.err.println(\"ERROR: Failure while reading from file.\");\n }\n return name;\n }", "@Override\n\tpublic void actionPerformed (ActionEvent e)\n\t{\n\t\n\t\t// Create the File Save dialog.\n\t\tFileDialog fd = new FileDialog(\n\t\t\tAppContext.cartogramWizard, \n\t\t\t\"Save Computation Report As...\", \n\t\t\tFileDialog.SAVE);\n\n\t\tfd.setModal(true);\n\t\tfd.setBounds(20, 30, 150, 200);\n\t\tfd.setVisible(true);\n\t\t\n\t\t// Get the selected File name.\n\t\tif (fd.getFile() == null)\n\t\t\treturn;\n\t\t\n\t\tString path = fd.getDirectory() + fd.getFile();\n\t\tif (path.endsWith(\".txt\") == false)\n\t\t\tpath = path + \".txt\";\n\t\t\n\t\t\n\t\t// Write the report to the file.\n\t\ttry\n\t\t{\n\t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(path));\n\t\t\tout.write(AppContext.cartogramWizard.getCartogram().getComputationReport());\n\t\t\tout.close();\n\t\t} \n\t\tcatch (IOException exc)\n\t\t{\n\t\t}\n\n\t\t\n\t\n\t}", "private void outputToFile() {\n\t\tPath filePath = Paths.get(outputFile);\n\n\t\ttry (BufferedWriter writer = Files.newBufferedWriter(filePath,\n\t\t\t\tCharset.forName(\"UTF-8\"));) {\n\t\t\tRowIterator iterator = currentGen.iterateRows();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tElemIterator elem = iterator.next();\n\t\t\t\twhile (elem.hasNext()) {\n\t\t\t\t\tMatrixElem mElem = elem.next();\n\t\t\t\t\twriter.write(mElem.rowIndex() + \",\" + mElem.columnIndex());\n\t\t\t\t\twriter.newLine();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to write to the provided file\");\n\t\t}\n\n\t}", "public void make(String readFileName, String writeFileName) throws IOException {\n try (BufferedWriter bw = new BufferedWriter(new FileWriter(writeFileName, append));\n BufferedReader br = new BufferedReader(new FileReader(readFileName))) {\n String expression;\n double res;\n while((expression=br.readLine())!=null){\n try {\n res = function.calculate(expression);\n bw.write(makeAnswer(expression, res));\n } catch (Exception ex) {\n bw.write(ex.getMessage());\n }\n bw.newLine();\n }\n }\n }", "public void write(File dest, boolean writeAlpha) throws IOException, RenderException {\r\n\t\trenderer.writeImage(this, new FileOutputStream(dest), writeAlpha);\r\n\t}", "private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }", "public static void main(String[] args, String str) {\n\t\tHashMap<String, HashMap<String, Double>> file_alph_tf = new HashMap<String, HashMap<String, Double>>();\n\t\tHashMap<String, Double> file_alph_idf = new HashMap<String, Double>();\n\t\tHashMap<String, Double> tmp_idf = new HashMap<String, Double>();\n\t\tHashMap<String, HashMap<String, Double>> result_map = new HashMap<String, HashMap<String, Double>>();\n\t\t// 이후에 cosine similarity를 계산할때 사용할 top5해쉬맵\n\t\tHashMap<String, HashMap<String, Double>> top5 = new HashMap<String, HashMap<String, Double>>();\n\t\t\n\t\tTest01 t1 = new Test01();\n\t\tTest02 t2 = new Test02();\n\t\tTest03 t3 = new Test03();\n\t\t\n\t\t// 입력\n\t\t\n\t\tFile[] fileList = t1.get_file();\n\t\t\n\t\tfor (File file : fileList) {\n\t\t\t\n\t\t\tHashMap <String, Double> tmp_map = new HashMap <String, Double>();\n\t\t\t\n\t\t\t// count alphabet _ each files\n\t\t\ttry {\n\t\t\t\tFileReader file_reader = new FileReader(file);\n\t\t\t\tint cur = 0;\n\t\t\t\twhile ((cur = file_reader.read()) != -1) {\n\t\t\t\t\tif (cur != 32) {\n\t\t\t\t\t\tif (!tmp_map.containsKey(String.valueOf((char)cur))) {\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur), (double) 1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdouble temp_num = tmp_map.get(String.valueOf((char)cur));\n\t\t\t\t\t\t\ttmp_map.put(String.valueOf((char)cur),temp_num+1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch(FileNotFoundException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t} catch(IOException e) {\n\t\t\t\te.getStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// calc_TF\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(tmp_map.keySet());\n\t\t\tdouble sum_value = 0;\n\t\t\t// TF의 분모 문서내에 오는 모든수 더하기\n\t\t\tfor (String k : key_lst) {\n\t\t\t\tsum_value += tmp_map.get(k);\t\n\t\t\t}\n\t\t\t// TF의 분자 : 해당 파일에 있는 알파벳의 갯수 (tmp_map에 저장되어있음) / tf분모\n\t\t\tfor (String tf_k : key_lst) {\n\t\t\t\tdouble tf = tmp_map.get(tf_k) / sum_value;\n\t\t\t\ttmp_map.put(tf_k, tf);\n\t\t\t}\n\t\t\tsum_value = 0;\n\t\t\tfile_alph_tf.put(file.getName(), tmp_map);\n\t\t\t\n\t\t\t// calc_IDF_Bottom : counting IDF_Bottom\n\t\t\ttmp_idf = file_alph_tf.get(file.getName());\n\t\t\t\n\t\t\tfor (String idf_k : key_lst) {\n\t\t\t\tif (tmp_idf.get(idf_k) != 0) {\n\t\t\t\t\tif (!file_alph_idf.containsKey(idf_k)) {\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, (double) 1);\n\t\t\t\t\t}else {\n\t\t\t\t\t\tdouble tmp_num = file_alph_idf.get(idf_k);\n\t\t\t\t\t\tfile_alph_idf.put(idf_k, tmp_num+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} // file의 이름으로 반복\n\t\t\n\t\t\n\t\t\n\t\t// calc_IDF\n\t\tfor (File file : fileList) {\n\t\t\tHashMap<String, Double> aa = new HashMap<String, Double>();\n\t\t\tArrayList<String> key_lst = new ArrayList<String>(file_alph_idf.keySet());\n\t\t\tdouble temp_num = 0;\n\t\t\tfor (String key : key_lst) {\n\t\t\t\t\n\t\t\t\tdouble tf;\n\t\t\t\ttemp_num = 0;\n\t\t\t\ttry {\n\t\t\t\t\ttf = file_alph_tf.get(file.getName()).get(key);\n\t\t\t\t\tif (file_alph_idf.get(key) != 0) {\n\t\t\t\t\t\tdouble tt = file_alph_idf.get(key);\n\t\t\t\t\t\ttemp_num = 7/tt;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp_num = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch(NullPointerException e) {\n\t\t\t\t\ttf = 0;\n\t\t\t\t}\n\t\t\t\tdouble idf = Math.log(1+ temp_num);\n\t\t\t\tdouble tfidf = tf*idf;\n\t\t\t\taa.put(key, tfidf);\n\t\t\t}\n\t\t\tresult_map.put(file.getName(), aa);\n\t\t}\t\n\t\n\t\t\n\t\t\n\t\t\n\t\tfor(File f : fileList) {\n\t\t\t\n\t//---------------------------------------상위 5개-------------------------------------------\t\t\t\n\t\t\t\n//\t\t\t\n\t\t\tString f_n = f.getName(); \n//\t\t\tSystem.out.println(f_n);\n\t\t\t// 0. 정렬 전 파일 출력\n//\t\t\tArrayList <String> key_lst = new ArrayList<String>(result_map.get(f_n).keySet());\n//\t\t\tfor (String kk : key_lst) {\n//\t\t\t\tSystem.out.println(kk + \" : \" + result_map.get(f_n).get(kk));\n//\t\t\t}\n\t\t\t\n\t\t\tArrayList<String> Top5List = sortHSbyValue_double(result_map.get(f_n));\n\t\t\tHashMap<String, Double> map = new HashMap<String, Double>();\n\t\t\tfor (String s : Top5List) {\n\t\t\t\tmap.put(s, result_map.get(f_n).get(s));\n\t\t\t}\n\n\t\t\ttop5.put(f_n, map);\n\t\t\t\n\t\t}\n\t\t\n\t\t// cosine_similarity\n\t\t// 구하기 전에 벡터의 차원을 맞춰준다.\n\t\t// input받는 파일을 제외한 나머지 파일들과의 유사도를 구한다.\n\t\tString input = str;\n\t\tHashMap<String, Double> csMap = new HashMap<String, Double>();\n\t\t\n\t\tfor (File f : fileList) {\n\t\t\tHashMap<String, Double> a = (HashMap<String, Double>) top5.get(input).clone();\n\t\t\tArrayList<String> a_key_lst = new ArrayList<String>(a.keySet());\n\t\t\tArrayList<String> total_key = new ArrayList<String>();\n\t\t\t\n\t\t\tif (input.equals(f.getName())) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tHashMap<String, Double> b = (HashMap<String, Double>) top5.get(f.getName()).clone();\n\t\t\tArrayList<String> b_key_lst = new ArrayList<String>(b.keySet());\n\t\t\t\n\t\t\tfor (String a_k : a_key_lst) {\n\t\t\t\ttotal_key.add(a_k);\n\t\t\t}\n\t\t\tfor (String b_k : b_key_lst) {\n\t\t\t\ttotal_key.add(b_k);\n\t\t\t}\n\t\t\t\n\t\t\tfor (String t_k : total_key) {\n\t\t\t\tif(!a.containsKey(t_k)) {\n\t\t\t\t\ta.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t\tif(!b.containsKey(t_k)) {\n\t\t\t\t\tb.put(t_k, (double)0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble[] a_lst = t3.mapToList(a);\n\t\t\tdouble[] b_lst = t3.mapToList(b);\n\t\t\tdouble cs = cosinSimilarity(a_lst, b_lst);\n\t\t\tcsMap.put(f.getName(), cs);\n\t\t\t\n\t\t\ta_key_lst.clear();\n\t\t\ttotal_key.clear();\n\t\t\t\n\t\t}\n\n\t\tt2.sort_print(csMap, input);\n\t\t\n\t\tSystem.out.println();\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t@SuppressWarnings(\"serial\")\r\n\t\t\t\tJFileChooser fc = new JFileChooser(){\r\n\t\t\t\t @Override\r\n\t\t\t\t public void approveSelection(){\r\n\t\t\t\t File f = getSelectedFile();\r\n\t\t\t\t if(f.exists() && getDialogType() == SAVE_DIALOG){\r\n\t\t\t\t int result = JOptionPane.showConfirmDialog(this,\"The file exists, overwrite?\",\"Existing file\",JOptionPane.YES_NO_OPTION);\r\n\t\t\t\t switch(result){\r\n\t\t\t\t case JOptionPane.YES_OPTION:\r\n\t\t\t\t super.approveSelection();\r\n\t\t\t\t return;\r\n\t\t\t\t case JOptionPane.NO_OPTION:\r\n\t\t\t\t return;\r\n\t\t\t\t case JOptionPane.CLOSED_OPTION:\r\n\t\t\t\t return;\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t super.approveSelection();\r\n\t\t\t\t } \r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\tfc.setFileFilter(new FileNameExtensionFilter(\"Antenna Array Synthesizer File (*.aas)\",\"aas\"));\r\n\t\t\t\t\r\n\t\t\t\tint returnVal = fc.showSaveDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\t\t\t\r\n\t\t\t\t\t// Fetch the all corresponding values from the user interface.\r\n\t\t\t\t\tgetParametersFromUserInterface();\r\n\t\t\t\t\t// Antenna Parameters\r\n\t\t\t\t\tCurrentConfiguration cc = new CurrentConfiguration();\r\n\t\t\t\t\tcc.numberofElements = numberOfElements;\r\n\t\t\t\t\tcc.L = L;\r\n\t\t\t\t\tcc.H = H;\r\n\t\t\t\t\tcc.amplitudeIsUsed = amplitudeIsUsed;\r\n\t\t\t\t\tcc.phaseIsUsed = phaseIsUsed;\r\n\t\t\t\t\tcc.positionIsUsed = positionIsUsed;\r\n\t\t\t\t\tcc.amplitudeValues = antennaArray.amplitude;\r\n\t\t\t\t\tcc.phaseValues = antennaArray.phase;\r\n\t\t\t\t\tcc.positionValues = antennaArray.position;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// For Outer Mask\r\n\t\t\t\t\tint numberOfOuterMask = mask.outerMaskSegments.size();\r\n\t\t\t\t\tcc.nameForOuter = new String[numberOfOuterMask];\r\n\t\t\t\t\tcc.startAngleForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.stopAngleForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.numberOfPointsForOuter = new int[numberOfOuterMask];\r\n\t\t\t\t\tcc.levelForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.weightForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tfor(int s=0; s<numberOfOuterMask; s++) {\r\n\t\t\t\t\t\tcc.nameForOuter[s] = mask.outerMaskSegments.get(s).name;\r\n\t\t\t\t\t\tcc.startAngleForOuter[s] = mask.outerMaskSegments.get(s).startAngle;\r\n\t\t\t\t\t\tcc.stopAngleForOuter[s] = mask.outerMaskSegments.get(s).stopAngle;\r\n\t\t\t\t\t\tcc.numberOfPointsForOuter[s] = mask.outerMaskSegments.get(s).numberOfPoints;\r\n\t\t\t\t\t\tcc.levelForOuter[s] = mask.outerMaskSegments.get(s).level;\r\n\t\t\t\t\t\tcc.weightForOuter[s] = mask.outerMaskSegments.get(s).weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// For Inner Mask\r\n\t\t\t\t\tint numberOfInnerMask = mask.innerMaskSegments.size();\r\n\t\t\t\t\tcc.nameForInner = new String[numberOfInnerMask];\r\n\t\t\t\t\tcc.startAngleForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.stopAngleForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.numberOfPointsForInner = new int[numberOfInnerMask];\r\n\t\t\t\t\tcc.levelForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.weightForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tfor(int s=0; s<numberOfInnerMask; s++) {\r\n\t\t\t\t\t\tcc.nameForInner[s] = mask.innerMaskSegments.get(s).name;\r\n\t\t\t\t\t\tcc.startAngleForInner[s] = mask.innerMaskSegments.get(s).startAngle;\r\n\t\t\t\t\t\tcc.stopAngleForInner[s] = mask.innerMaskSegments.get(s).stopAngle;\r\n\t\t\t\t\t\tcc.numberOfPointsForInner[s] = mask.innerMaskSegments.get(s).numberOfPoints;\r\n\t\t\t\t\t\tcc.levelForInner[s] = mask.innerMaskSegments.get(s).level;\r\n\t\t\t\t\t\tcc.weightForInner[s] = mask.innerMaskSegments.get(s).weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Algorithm Parameters\r\n\t\t\t\t\tcc.populationNumber = populationNumber;\r\n\t\t\t\t\tcc.maximumIterationNumber = maximumIterationNumber;\r\n\t\t\t\t\tcc.F = F;\r\n\t\t\t\t\tcc.Cr = Cr;\r\n\t\t\t\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = fc.getSelectedFile();\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(\"aas\")) {\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t file = new File(file.toString() + \".aas\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\tFileOutputStream fileOut = new FileOutputStream(file.getAbsolutePath());\r\n\t\t\t\t\t\tObjectOutputStream out = new ObjectOutputStream(fileOut);\r\n\t\t\t\t\t\tout.writeObject(cc);\r\n\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t\tfileOut.close();\r\n\t\t\t\t\t}catch(IOException i)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ti.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "private void computeHermiteCoefficients (KBKeyFrame kf0,\r\n KBKeyFrame kf1,\r\n KBKeyFrame kf2,\r\n KBKeyFrame kf3) {\r\n\r\n\r\n Point3f deltaP = new Point3f();\r\n Point3f deltaS = new Point3f();\r\n float deltaH;\r\n float deltaT;\r\n float deltaB;\r\n\r\n // Find the difference in position and scale \r\n deltaP.x = kf2.position.x - kf1.position.x;\r\n deltaP.y = kf2.position.y - kf1.position.y;\r\n deltaP.z = kf2.position.z - kf1.position.z;\r\n\r\n deltaS.x = kf2.scale.x - kf1.scale.x;\r\n deltaS.y = kf2.scale.y - kf1.scale.y;\r\n deltaS.z = kf2.scale.z - kf1.scale.z;\r\n\r\n // Find the difference in heading, pitch, and bank\r\n deltaH = kf2.heading - kf1.heading;\r\n deltaT = kf2.pitch - kf1.pitch;\r\n deltaB = kf2.bank - kf1.bank;\r\n \r\n // Incoming Tangent\r\n Point3f dd_pos = new Point3f();\r\n Point3f dd_scale = new Point3f();\r\n float dd_heading, dd_pitch, dd_bank;\r\n\r\n // If this is the first keyframe of the animation \r\n if (kf0.knot == kf1.knot) {\r\n\r\n float ddab = 0.5f * (dda + ddb);\r\n\r\n // Position\r\n dd_pos.x = ddab * deltaP.x;\r\n dd_pos.y = ddab * deltaP.y;\r\n dd_pos.z = ddab * deltaP.z;\r\n\r\n // Scale \r\n dd_scale.x = ddab * deltaS.x;\r\n dd_scale.y = ddab * deltaS.y;\r\n dd_scale.z = ddab * deltaS.z;\r\n\r\n // Heading, Pitch and Bank\r\n dd_heading = ddab * deltaH;\r\n dd_pitch = ddab * deltaT;\r\n dd_bank = ddab * deltaB;\r\n\r\n } else {\r\n\r\n float adj0 = (kf1.knot - kf0.knot)/(kf2.knot - kf0.knot);\r\n\r\n // Position\r\n dd_pos.x = adj0 * \r\n ((ddb * deltaP.x) + (dda * (kf1.position.x - kf0.position.x)));\r\n dd_pos.y = adj0 *\r\n ((ddb * deltaP.y) + (dda * (kf1.position.y - kf0.position.y)));\r\n dd_pos.z = adj0 * \r\n ((ddb * deltaP.z) + (dda * (kf1.position.z - kf0.position.z)));\r\n\r\n // Scale \r\n dd_scale.x = adj0 * \r\n ((ddb * deltaS.x) + (dda * (kf1.scale.x - kf0.scale.x)));\r\n dd_scale.y = adj0 * \r\n ((ddb * deltaS.y) + (dda * (kf1.scale.y - kf0.scale.y)));\r\n dd_scale.z = adj0 * \r\n ((ddb * deltaS.z) + (dda * (kf1.scale.z - kf0.scale.z)));\r\n\r\n // Heading, Pitch and Bank\r\n dd_heading = adj0 * \r\n ((ddb * deltaH) + (dda * (kf1.heading - kf0.heading)));\r\n dd_pitch = adj0 * \r\n ((ddb * deltaT) + (dda * (kf1.pitch - kf0.pitch)));\r\n dd_bank = adj0 * \r\n ((ddb * deltaB) + (dda * (kf1.bank - kf0.bank)));\r\n }\r\n \r\n // Outgoing Tangent\r\n Point3f ds_pos = new Point3f();\r\n Point3f ds_scale = new Point3f();\r\n float ds_heading, ds_pitch, ds_bank;\r\n\r\n // If this is the last keyframe of the animation \r\n if (kf2.knot == kf3.knot) {\r\n\r\n float dsab = 0.5f * (dsa + dsb);\r\n\r\n // Position\r\n ds_pos.x = dsab * deltaP.x;\r\n ds_pos.y = dsab * deltaP.y;\r\n ds_pos.z = dsab * deltaP.z;\r\n \r\n // Scale\r\n ds_scale.x = dsab * deltaS.x;\r\n ds_scale.y = dsab * deltaS.y;\r\n ds_scale.z = dsab * deltaS.z;\r\n\r\n // Heading, Pitch and Bank\r\n ds_heading = dsab * deltaH;\r\n ds_pitch = dsab * deltaT;\r\n ds_bank = dsab * deltaB;\r\n\r\n } else {\r\n\r\n float adj1 = (kf2.knot - kf1.knot)/(kf3.knot - kf1.knot);\r\n\r\n // Position\r\n ds_pos.x = adj1 * \r\n ((dsb * (kf3.position.x - kf2.position.x)) + (dsa * deltaP.x));\r\n ds_pos.y = adj1 * \r\n ((dsb * (kf3.position.y - kf2.position.y)) + (dsa * deltaP.y));\r\n ds_pos.z = adj1 * \r\n ((dsb * (kf3.position.z - kf2.position.z)) + (dsa * deltaP.z));\r\n\r\n // Scale\r\n ds_scale.x = adj1 * \r\n ((dsb * (kf3.scale.x - kf2.scale.x)) + (dsa * deltaS.x));\r\n ds_scale.y = adj1 * \r\n ((dsb * (kf3.scale.y - kf2.scale.y)) + (dsa * deltaS.y));\r\n ds_scale.z = adj1 * \r\n ((dsb * (kf3.scale.z - kf2.scale.z)) + (dsa * deltaS.z));\r\n\r\n // Heading, Pitch and Bank \r\n ds_heading = adj1 * \r\n ((dsb * (kf3.heading - kf2.heading)) + (dsa * deltaH));\r\n ds_pitch = adj1 * \r\n ((dsb * (kf3.pitch - kf2.pitch)) + (dsa * deltaT));\r\n ds_bank = adj1 * \r\n ((dsb * (kf3.bank - kf2.bank)) + (dsa * deltaB));\r\n }\r\n\r\n // Calculate the coefficients of the polynomial for position\r\n c0 = new Point3f();\r\n c0.x = kf1.position.x;\r\n c0.y = kf1.position.y;\r\n c0.z = kf1.position.z;\r\n\r\n c1 = new Point3f();\r\n c1.x = dd_pos.x;\r\n c1.y = dd_pos.y;\r\n c1.z = dd_pos.z;\r\n\r\n c2 = new Point3f();\r\n c2.x = 3*deltaP.x - 2*dd_pos.x - ds_pos.x;\r\n c2.y = 3*deltaP.y - 2*dd_pos.y - ds_pos.y;\r\n c2.z = 3*deltaP.z - 2*dd_pos.z - ds_pos.z;\r\n\r\n c3 = new Point3f();\r\n c3.x = -2*deltaP.x + dd_pos.x + ds_pos.x;\r\n c3.y = -2*deltaP.y + dd_pos.y + ds_pos.y;\r\n c3.z = -2*deltaP.z + dd_pos.z + ds_pos.z;\r\n\r\n // Calculate the coefficients of the polynomial for scale \r\n e0 = new Point3f();\r\n e0.x = kf1.scale.x;\r\n e0.y = kf1.scale.y;\r\n e0.z = kf1.scale.z;\r\n\r\n e1 = new Point3f();\r\n e1.x = dd_scale.x;\r\n e1.y = dd_scale.y;\r\n e1.z = dd_scale.z;\r\n\r\n e2 = new Point3f();\r\n e2.x = 3*deltaS.x - 2*dd_scale.x - ds_scale.x;\r\n e2.y = 3*deltaS.y - 2*dd_scale.y - ds_scale.y;\r\n e2.z = 3*deltaS.z - 2*dd_scale.z - ds_scale.z;\r\n\r\n e3 = new Point3f();\r\n e3.x = -2*deltaS.x + dd_scale.x + ds_scale.x;\r\n e3.y = -2*deltaS.y + dd_scale.y + ds_scale.y;\r\n e3.z = -2*deltaS.z + dd_scale.z + ds_scale.z;\r\n\r\n // Calculate the coefficients of the polynomial for heading, pitch \r\n // and bank\r\n h0 = kf1.heading;\r\n p0 = kf1.pitch;\r\n b0 = kf1.bank;\r\n\r\n h1 = dd_heading;\r\n p1 = dd_pitch;\r\n b1 = dd_bank;\r\n\r\n h2 = 3*deltaH - 2*dd_heading - ds_heading;\r\n p2 = 3*deltaT - 2*dd_pitch - ds_pitch;\r\n b2 = 3*deltaB - 2*dd_bank - ds_bank;\r\n\r\n h3 = -2*deltaH + dd_heading + ds_heading;\r\n p3 = -2*deltaT + dd_pitch + ds_pitch;\r\n b3 = -2*deltaB + dd_bank + ds_bank;\r\n }", "@Test\n public void shouldEvaluateWorkProperlyCase4() throws FileNotFoundException {\n Front storeFront = new ArrayFront(\"/pareto_fronts/ZDT1.pf\") ;\n\n DoubleProblem problem = new MockDoubleProblem(2) ;\n\n List<DoubleSolution> frontToEvaluate = new ArrayList<>() ;\n for (int i = 0 ; i < storeFront.getNumberOfPoints(); i++) {\n DoubleSolution solution = problem.createSolution() ;\n solution.setObjective(0, storeFront.getPoint(i).getValue(0));\n solution.setObjective(1, storeFront.getPoint(i).getValue(1));\n frontToEvaluate.add(solution) ;\n }\n\n WFGHypervolume<DoubleSolution> hypervolume = new WFGHypervolume<>() ;\n double result = hypervolume.computeHypervolume(frontToEvaluate, new ArrayPoint(new double[]{1.0, 1.0})) ;\n\n assertEquals(0.6661, result, 0.0001) ;\n }", "private void arretes_fG(){\n\t\tthis.cube[31] = this.cube[28]; \n\t\tthis.cube[28] = this.cube[30];\n\t\tthis.cube[30] = this.cube[34];\n\t\tthis.cube[34] = this.cube[32];\n\t\tthis.cube[32] = this.cube[31];\n\t}", "private void persist() {\n \t\ttry {\n \t\t\tproblemFile = File.createTempFile(\"p2Encoding\", \".opb\"); //$NON-NLS-1$//$NON-NLS-2$\n \t\t\tBufferedWriter w = new BufferedWriter(new FileWriter(problemFile));\n \t\t\tint clauseCount = tautologies.size() + dependencies.size() + constraints.size();\n \n \t\t\tint variableCount = variables.size();\n \t\t\tw.write(\"* #variable= \" + variableCount + \" #constraint= \" + clauseCount + \" \"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n \t\t\tw.newLine();\n \t\t\tw.write(\"*\"); //$NON-NLS-1$\n \t\t\tw.newLine();\n \n \t\t\tif (variableCount == 0 && clauseCount == 0) {\n \t\t\t\tw.close();\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tw.write(objective);\n \t\t\tw.newLine();\n \t\t\tw.newLine();\n \n \t\t\tw.write(explanation + \" ;\"); //$NON-NLS-1$\n \t\t\tw.newLine();\n \t\t\tw.newLine();\n \n \t\t\tfor (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tfor (Iterator iterator = constraints.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tfor (Iterator iterator = tautologies.iterator(); iterator.hasNext();) {\n \t\t\t\tw.write((String) iterator.next());\n \t\t\t\tw.newLine();\n \t\t\t}\n \t\t\tw.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "private static void printToFile(FrequencyCounter<Integer> freqCounter, ArrayList<Pair<Integer, Float>> plot) {\r\n\t\tPrintWriter writer;\r\n\t\ttry {\r\n\t\t\tString fName = \"experimentalResults\" + File.separator + \"results\" + freqCounter.getname() + \".txt\";\r\n\t\t\twriter = new PrintWriter(new File(fName));\r\n\t\t\tfor (Pair<Integer, Float> p : plot)\r\n\t\t\t\twriter.println(p);\r\n\r\n\t\t\twriter.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n AdjListGraph adjListGraph = null;\r\n AdjMatrixGraph adjMatGraph = null;\r\n AdjMatrixMoreEfficientGraph adjEffGraph = null;\r\n \r\n // Create object for input sequence according to the file name\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n System.out.print(\"Enter input filename: \");\r\n String filename = br.readLine();\r\n \r\n // Inserting data to each graph, pay attention to different path representation for ubuntu and windows\r\n In inputFile = new In(\"data/\" + filename);\r\n adjListGraph = new AdjListGraph(inputFile);\r\n inputFile = new In(\"data/\" + filename);\r\n adjMatGraph = new AdjMatrixGraph(inputFile);\r\n inputFile = new In(\"data/\" + filename);\r\n adjEffGraph = new AdjMatrixMoreEfficientGraph(inputFile);\r\n \r\n /*\r\n * Step 2\r\n * get the size of graph of each representation\r\n * AdjListGraph.java: adj\r\n * AdjMatrixGraph.java: adj\r\n\t\t * Please use adjListGraph.sizeOfGraph() to get the memory usage of the graph with list implementation. \r\n\t\t * Please use adjMatGraph.sizeOfGraph() to get the memory usage of the graph with matrix implementation. \r\n */\r\n \r\n // Output every required data from all versions\r\n System.out.format(\"1. Number of vertices = %d \\n\", adjListGraph.V());\r\n System.out.format(\"2. Number of edges = %d \\n\", adjListGraph.E());\r\n System.out.format(\"3. Output of the graph using adjacency list:\\n\");\r\n //adjListGraph.printGraph();\r\n System.out.format(\"4. Adjacency list\\n (a) Memory needed to record edges = %d\\n\", adjListGraph.E() * Size.INTEGER);\r\n System.out.format(\" (b) Total amount of memory used = %d\\n\", adjListGraph.sizeOfGraph());\r\n System.out.format(\" (c) Efficiency = %f\\n\", 100.0 * adjListGraph.E() * Size.INTEGER / adjListGraph.sizeOfGraph());\r\n System.out.format(\"5. Output of the graph using matrix:\\n\");\r\n //adjMatGraph.printGraph();\r\n System.out.format(\"6. Adjacency matrix\\n (a) Memory needed to record edges = %d\\n\", adjMatGraph.E() * Size.BOOLEAN);\r\n System.out.format(\" (b) Total amount of memory used = %d\\n\", adjMatGraph.sizeOfGraph());\r\n System.out.format(\" (c) Efficiency = %f\\n\", 100.0 * adjMatGraph.E() * Size.BOOLEAN / adjMatGraph.sizeOfGraph());\r\n //adjEffGraph.printGraph();\r\n System.out.format(\"Additional task: Efficient Adjacency matrix\\n (a) Memory needed to record edges = %d\\n\", adjEffGraph.E() * Size.BOOLEAN);\r\n System.out.format(\" (b) Total amount of memory used = %d\\n\", adjEffGraph.sizeOfGraph());\r\n System.out.format(\" (c) Efficiency = %f\\n\", 100.0 * adjEffGraph.E() * Size.BOOLEAN / adjEffGraph.sizeOfGraph());\r\n }", "private void aretes_aR(){\n\t\tthis.cube[13] = this.cube[52]; \n\t\tthis.cube[52] = this.cube[19];\n\t\tthis.cube[19] = this.cube[1];\n\t\tthis.cube[1] = this.cube[28];\n\t\tthis.cube[28] = this.cube[13];\n\t}", "public void execute(String[] args) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tString formula = args[0];\n\t\t\tString C12_File = args[1];\n\t\t\tString C13_File = args[2];\n\t\t\tString N15_File = args[3];\n\t\t\tString sampled_element = args[4];\n\t\t\tint charge = new Integer(args[5]);\n\t\t\tdouble ppm = new Double(args[6]);\n\t\t\tboolean single_check = false;\n\t\t\tdouble ppm_val = ppm;\n\t\t\t//for (double ppm_val = 10; ppm_val <= 100; ppm_val = ppm_val + 10) {\n\t\t\t_ppm = ppm_val;\n\t\t\t\n\t\t\t\n\t\t\tString H2_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_H2.txt\";\n\t\t\tString C12_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_C12.txt\";\n\t\t\tString C13_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_C13.txt\";\n\t\t\tString N15_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_N15.txt\";\n\t\t\t\n\t\t\tdouble big_step = 0.05;\n\t\t\t\n\t\t\tint _charge = charge;\n\t\t\t\n\t\t\t//String formula = \"C100N29O36H147\"; // this looks the best\n\n\t\t\t//String formula = \"C100N29O28H274\";\n\t\t\t//String formula = \"C100N29O26S1H274\";\n\t\t\t//String formula = \"C100N29O24S2H274\"; // pretty close too\n\t\t\t//String formula = \"C100N29O34SH147\"; //\n\t\t\t//String formula = \"O9H290C100S9N29\"; // another candidate\n\t\t\t//String formula = \"C100N29O33S5H36\"; //\n\t\t\t//String formula = \"C100N29O21S7H163\";\n\t\t\t\n\t\t\t//\n\n\t\t\t//printTime();\n\t\t\t//IsotopePattern reference_pattern = getPeakInfo(\"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\DataFitting\\\\C24H49NO7P_C12.peak\");\n\t\t\t//IsotopePattern reference_pattern = getPeakInfo(\"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\DataFitting\\\\unknown_C12.peak\");\n\t\t\tIsotopePattern reference_pattern = getPeakInfo(C12_File);\n\t\t\t\n\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\n\t\t\tdouble C12 = 0.9893;\n\t\t\tdouble N14 = 0.99632;\n\t\t\tdouble H1 = 0.999885;\n\t\t\t\n\t\t\tdouble simulated_C12 = -1;\n\t\t\tdouble simulated_N15 = -1;\n\t\t\tdouble simulated_C13 = -1;\n\t\t\tdouble simulated_H2 = -1;\n\t\t\tIsotopePattern query_pattern = null;\n\t\t\t\n\t\t\tif (single_check) {\n\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1, _charge);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < query_pattern.getNumberOfIsotopes(); i++) {\n\t\t\t\t\tIsotopeContainer container = query_pattern.getIsotope(i);\n\t\t\t\t\tSystem.out.println(container.getMass() + \"\\t\" + container.getIntensity());\n\t\t\t\t}\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\t\n\t\t\tboolean check_C12 = false;\n\t\t\tboolean check_C13 = false;\n\t\t\tboolean check_H2 = false;\n\t\t\tboolean check_N15 = false;\n\t\t\tif (sampled_element.equals(\"C12\")) {\n\t\t\t\tcheck_C12 = true;\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"C13\")) {\n\t\t\t\tcheck_C13 = true;\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"N15\")) {\n\t\t\t\tcheck_N15 = true;\n\t\t\t}\n\t\t\tdouble step = 0.001;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (check_H2) {\n\t\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double H1_sample = 0; H1_sample <= 1; H1_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1_sample, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = H1_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = H1_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= (1 - big_step)) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double H1_sample = 0; H1_sample < smallest; H1_sample += step) {\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double H1_sample = smallest; H1_sample <= largest; H1_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1_sample, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_H2 = H1_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + similarity_score);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tfor (double H1_sample = largest + step; H1_sample <= 1.0; H1_sample += step) {\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (check_C13) {\n\t\t\t\treference_pattern = getPeakInfo(C13_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample <= 1; C12_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = C12_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample < smallest; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = smallest; C12_sample <= largest; C12_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_C13 = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println((1 - C12_sample) + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = largest + step; C12_sample <= 1.0; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (check_N15) {\n\t\t\t\treference_pattern = getPeakInfo(N15_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double N14_sample = 0; N14_sample < smallest; N14_sample += step) {\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double N14_sample = 0; N14_sample <= 1; N14_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14_sample, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = N14_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = N14_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double N14_sample = smallest; N14_sample <= largest; N14_sample += step) {\n\t\t\t\t//double N14_sample = 0.01;\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14_sample, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_N15 = N14_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double N14_sample = largest + step; N14_sample <= 1.0; N14_sample += step) {\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (check_C12) {\n\t\t\t\treference_pattern = getPeakInfo(C12_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample <= 1; C12_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = C12_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample < smallest; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = smallest; C12_sample <= largest; C12_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_C12 = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\t//out.write(C12_sample + \"\\t\" + similarity_score + \"\\n\");\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = largest + step; C12_sample <= 1.0; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"C12\")) {\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tC12:\" + simulated_C12);\n\t\t\t} else if (sampled_element.equals(\"C13\")) {\n\t\t\t\tdouble result = (1 - simulated_C13);\n\t\t\t\tif (result < 0) {\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tC13:\" + result);\n\t\t\t} else if (sampled_element.equals(\"N15\")) {\n\t\t\t\tdouble result = (1 - simulated_N15);\n\t\t\t\tif (result < 0) {\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tN15:\" + result);\n\t\t\t}\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void writeResults() {\n gfmBroker.storeResults(this.responses, fileOutputPath);\n }", "private static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "static public ArrayList<Long> Share(int t) throws IOException {\n ArrayList<Long> ret = new ArrayList();\n\n \n for(int i=0 ; i<t ;i++){\n Long a = randomval(); \n if (a < 0){\n a=a+p;\n }\n if (i>0)\n System.out.print(\"S = \");\n else \n System.out.print(\"M = \");\n System.out.println(a);\n \n equation.add(a);\n }\n byte[] content= equation.get(0).toString().getBytes();\n FileReader.savefile(\"secret.txt\", content);\n\n for (int i = 1; i <= t; i++) {\n Long y = new Long(0);\n for (int j = 0; j < equation.size(); j++) {\n y = y + ((equation.get(j) * pow(i, j)));\n y=y % p ;\n }\n ret.add(y);\n }\n return ret;\n }", "public static void main(String[] args){\n\n // Create file\n File file = new File(inputfileName);\n\n try {\n BufferedReader in = new BufferedReader(new FileReader(file.getAbsoluteFile()));\n try {\n\n //Read the first 3 lines\n String string1 = in.readLine();\n String string2 = in.readLine();\n String string3 = in.readLine();\n //Ignore an empty string\n in.readLine();\n\n String[] mn = string1.split(\" \");\n String[] sc = string2.split(\" \");\n\n //Initialize m, n, lineNumber, colmn, condition\n m = Integer.parseInt(mn[0]);\n n = Integer.parseInt(mn[1]);\n lineNumber = Integer.parseInt(sc[0]);\n colmn = Integer.parseInt(sc[1]);\n condition = Integer.parseInt(string3);\n\n //Validation of basic parameters\n validation(m, n, condition, lineNumber, colmn);\n\n //----------------------We alternately read all the matrices------------------------\n for (int i = 0; i < m; i++){\n String matrixStr = \"\";\n for (int j = 0; j < n; j++){\n matrixStr += in.readLine() + \" \";\n }\n in.readLine();\n\n int[] tmpIntArray = strToIntArr(matrixStr.trim().split(\" \"));\n\n if(i == 0){\n rezult = getFirstResultString(tmpIntArray);\n continue;\n }else {\n multiplication(matrixStr);\n }\n }\n\n //The desired number\n int rezultValue = rezult[colmn - 1];\n\n //Check the result of the last multiplication\n if(rezultValue >= condition){\n write((rezultValue % condition) + \"\");\n }else {\n write(rezultValue + \"\");\n }\n //---------------------------------------------------------------------------------\n } finally {\n in.close();\n }\n } catch(IOException e) {\n throw new RuntimeException(e);\n }\n }" ]
[ "0.64113957", "0.58586806", "0.57869166", "0.5635263", "0.5448267", "0.5428702", "0.5372357", "0.53663707", "0.5326905", "0.52655154", "0.5233504", "0.51248795", "0.51202327", "0.5110529", "0.51069945", "0.51063514", "0.51023054", "0.5091691", "0.50841767", "0.5082497", "0.5074729", "0.507374", "0.5051434", "0.5049926", "0.50482136", "0.50287396", "0.5018504", "0.5005515", "0.50016165", "0.4999799", "0.49981254", "0.49890956", "0.497644", "0.49537048", "0.49474064", "0.49410337", "0.49293807", "0.49293807", "0.49231493", "0.49229783", "0.49054158", "0.49038258", "0.4892917", "0.48819262", "0.48617992", "0.4860986", "0.48583776", "0.4850614", "0.4847103", "0.48382562", "0.4836477", "0.4833936", "0.4831242", "0.48295313", "0.48287827", "0.48274764", "0.48242944", "0.48186508", "0.4811598", "0.48086894", "0.48045316", "0.47918746", "0.47662064", "0.4765362", "0.47632656", "0.47564578", "0.4751019", "0.47507638", "0.47486997", "0.4746317", "0.47429365", "0.47418466", "0.47395003", "0.47372493", "0.4737005", "0.47340176", "0.4732631", "0.47304067", "0.47254717", "0.47136667", "0.4708448", "0.47079012", "0.47022167", "0.46955594", "0.4688591", "0.4687686", "0.46850097", "0.46839", "0.46792766", "0.46789896", "0.4678788", "0.4674979", "0.46744868", "0.46736076", "0.46719447", "0.46606174", "0.466057", "0.46599355", "0.465889", "0.4654309" ]
0.6496023
0
Created by songqiaolin on 2017/5/28.
public interface StudyStarScoreService { StudyStarScoreDo getStarScore(Long lessonId, Integer type); void setStarScore(Long lessonId, Integer type, Integer score); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo4359a() {\n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void memoria() {\n \n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo6081a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n public void init() {\n\n }", "Petunia() {\r\n\t\t}", "private void strin() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void getExras() {\n }", "public Pitonyak_09_02() {\r\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void gored() {\n\t\t\n\t}", "private UsineJoueur() {}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void init() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n public void init() {\n }", "private Singletion3() {}", "private void m50366E() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo55254a() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "private void kk12() {\n\n\t}", "private TMCourse() {\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo9848a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "private void init() {\n\n\n\n }", "public void mo12930a() {\n }", "@Override\n public int describeContents() { return 0; }", "public void mo21877s() {\n }", "@Override\n protected void init() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "private zza.zza()\n\t\t{\n\t\t}", "@Override\n public void init() {}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "protected void mo6255a() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public static void listing5_14() {\n }", "@Override\n public void initialize() {\n \n }", "@Override\n\tpublic void debite() {\n\t\t\n\t}" ]
[ "0.6175086", "0.6083951", "0.5852385", "0.5811765", "0.5811765", "0.58027554", "0.57898384", "0.5745007", "0.5740644", "0.5706344", "0.5685952", "0.56680965", "0.5657357", "0.5638348", "0.5631986", "0.5624363", "0.5622997", "0.5619107", "0.5617458", "0.5571755", "0.5569443", "0.5557429", "0.5554875", "0.55342233", "0.5525414", "0.5525414", "0.55161387", "0.5509564", "0.55060196", "0.55060196", "0.55060196", "0.55060196", "0.55060196", "0.55060196", "0.55060196", "0.54986626", "0.5498065", "0.54958355", "0.54790163", "0.54622644", "0.5461562", "0.5459923", "0.5445123", "0.5438271", "0.5421673", "0.5421008", "0.5417574", "0.5417333", "0.5417333", "0.5417333", "0.5417333", "0.5417333", "0.5417333", "0.5408183", "0.54075396", "0.54074156", "0.53993875", "0.53933233", "0.5391875", "0.53907883", "0.53854716", "0.53815836", "0.53815836", "0.53815836", "0.53815836", "0.53815836", "0.53782046", "0.5364281", "0.5362133", "0.5351283", "0.5326324", "0.5325751", "0.5325751", "0.53155017", "0.53155017", "0.53139114", "0.5311457", "0.5306226", "0.53034663", "0.5302484", "0.530152", "0.5299376", "0.5298603", "0.52940303", "0.52939653", "0.52939653", "0.52939653", "0.5293777", "0.52880657", "0.52798843", "0.52798843", "0.52798843", "0.5270295", "0.5270295", "0.5270295", "0.5269128", "0.5268674", "0.5267488", "0.5267454", "0.5256977", "0.5247364" ]
0.0
-1
Test of readBoolean method, of class ByteArray.
@Test public void testReadWriteBoolean() { System.out.println("readBoolean"); ByteArray instance = new ByteArray(); instance.writeBoolean(true, 0); instance.writeBoolean(false, 1); instance.writeBoolean(true, instance.compacity()); assertEquals(true, instance.readBoolean(0)); assertEquals(false, instance.readBoolean(1)); assertEquals(true, instance.readBoolean(instance.compacity() - 1)); instance.writeBoolean(true, 1); assertEquals(true, instance.readBoolean(1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean readBoolean() throws IOException {\n\t\treturn ( (_buff.get() & 0xFF) != 0 );\n\t}", "String byteOrBooleanRead();", "boolean readBoolean();", "public abstract boolean read_boolean();", "abstract protected boolean read();", "public byte[] readRawBool() throws IOException {\n byte[] bytes = new byte[2];\n bytes[0] = (byte) Type.BOOL.code;\n in.readFully(bytes, 1, 1);\n return bytes;\n }", "public abstract void read_boolean_array(boolean[] value, int offset, int\nlength);", "public boolean readBoolean() throws IOException {\n\n\t\tint b = read();\n\t\tif (b == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean getRead();", "public boolean readBool() throws IOException {\n return in.readBoolean();\n }", "public boolean getBoolean(int index) throws ArrayIndexOutOfBoundsException\n\t{\n\t\treturn bytes[index] > 0;\n\t}", "public boolean readBoolean()\r\n/* 381: */ {\r\n/* 382:394 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 383:395 */ return super.readBoolean();\r\n/* 384: */ }", "private boolean parseBoolean(final byte[] buffer, final int offset) {\n return buffer[offset] == 1;\n }", "boolean hasByte();", "boolean hasRead();", "public boolean readBoolean() throws IOException {\n boolean bool = fDataInputStream.readBoolean();\n DebugLog.stdoutPrintln(\"Connection marshalling boolean \" + \n bool, DebugLog.BSF_LOG_L3);\n return bool;\n\t}", "public boolean readBoolean() {\n return (((readLong() & 1) == 1) ? true : false);\n }", "public int read(boolean[] b) throws IOException {\n\t\treturn read(b, 0, b.length);\n\t}", "boolean getForRead();", "private native boolean Df1_Read_Boolean(String plcAddress) throws Df1LibraryNativeException;", "boolean hasBinaryData();", "abstract boolean testBit(int index);", "String byteOrBooleanWrite();", "public static Boolean readBoolean(DataInputStream dis) throws IOException {\r\n\t\tif(dis.readBoolean())\r\n\t\t\treturn new Boolean(dis.readBoolean());\r\n\t\treturn null;\r\n\t}", "boolean hasForRead();", "abstract public boolean getAsBoolean();", "boolean verify(byte[] expected);", "public int read(boolean[] b, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\n\t\t\t\tif (pos >= count) {\n\t\t\t\t\tfillBuf(1);\n\t\t\t\t}\n\n\t\t\t\tif (buf[pos] == 1) {\n\t\t\t\t\tb[i] = true;\n\t\t\t\t} else {\n\t\t\t\t\tb[i] = false;\n\t\t\t\t}\n\t\t\t\tpos += 1;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 1);\n\t\t}\n\t\treturn len;\n\t}", "public boolean readBoolean() {\n\t\tif(!isInit) return false;\n\t\tboolean result = false;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Boolean input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Boolean.parseBoolean(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= false;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "byte readByte();", "boolean readByte(int c, String streamProvider) throws RawDataEventException ;", "public boolean readBooleanNonBlock() {\n return (((readLongNonBlock() & 1) == 1) ? true : false);\n }", "public byte[] read();", "public boolean readBoolean() throws IOException {\n int token = fTokenizer.nextToken();\n if (token == StreamTokenizer.TT_NUMBER)\n return ((int) fTokenizer.nval) == 1;\n\n String msg = \"Integer expected in line: \" + fTokenizer.lineno();\n throw new IOException(msg);\n }", "@Test\n public void testBooleanProperty() {\n try (ReleasableVariant started = classObject.get(\"Started\")) {\n Assertions.assertTrue(started.booleanValue());\n }\n }", "public static boolean toBoolean(byte[] value) {\r\n\t\treturn toBoolean(value, 0);\r\n\t}", "protected final boolean didRead (boolean value) { return didRead = value;}", "boolean supportsBinaryInProc();", "boolean getBit(int index);", "public boolean read() {\n return this.read;\n }", "boolean shouldReadValue();", "private String parseBoolean () {\r\n \r\n assert iMessage!=null;\r\n assert iIndex>=0;\r\n assert iIndex<=iMessage.length();\r\n \r\n char chr=next();//get next character\r\n assert \"ft\".indexOf(chr)>=0;//assert valid boolean start character\r\n switch (chr) {//switch on first character\r\n case 'f': skip(4);//skip to last character\r\n return \"false\";\r\n case 't': skip(3);//skip to last character\r\n return \"true\";\r\n default: assert false;//assert that we do not reach this statement\r\n return null;\r\n }//switch on first character\r\n \r\n }", "@SuppressFBWarnings(\"NP_BOOLEAN_RETURN_NULL\")\r\n public static Boolean fromByte(byte b)\r\n {\r\n return b == 0 ? null : b == 1 ? Boolean.FALSE : Boolean.TRUE;\r\n }", "boolean read(final ByteBuffer dst);", "public Boolean asBoolean();", "@Override\n public boolean isRead(int index)\n {\n if (index == 3)\n {\n return m_Unit != 0;\n }\n return super.isRead(index);\n }", "public boolean readOne() throws DomainLayerException {\n try {\n int isOne = (input[actualByte] >> (7-readedBit))&0x01;\n ++readedBit;\n ++actualBit;\n if(readedBit == 8) {\n ++actualByte;\n readedBit = 0;\n }\n return isOne == 1;\n }\n catch (IndexOutOfBoundsException e) {\n throw new DomainLayerException(\"An error has occurred while decompress the image content, operation aborted.\\n\\n\" +\n \"The compressed content seems to be corrupted.\");\n }\n }", "public static boolean readBoolean() {\n try {\n String token = readString();\n if (\"true\".equalsIgnoreCase(token)) return true;\n if (\"false\".equalsIgnoreCase(token)) return false;\n if (\"1\".equals(token)) return true;\n if (\"0\".equals(token)) return false;\n throw new InputMismatchException(\"attempts to read a 'boolean' value from standard input, \"\n + \"but the next token is \\\"\" + token + \"\\\"\");\n }\n catch (NoSuchElementException e) {\n throw new NoSuchElementException(\"attempts to read a 'boolean' value from standard input, \"\n + \"but no more tokens are available\");\n }\n }", "public boolean isRead(){\n \treturn isRead;\n }", "public boolean parse(ByteBuffer byteBuffer);", "public boolean getRead()\n\t{\n\t\treturn this.read;\n\t}", "public static boolean readBoolean(InputStream input) {\n Boolean b = readAny(input).getBooleanResult();\n return b;\n }", "public boolean wasRead(){\n return isRead==null || isRead;\n }", "public ByteBuf writeBoolean(boolean value)\r\n/* 527: */ {\r\n/* 528:538 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 529:539 */ return super.writeBoolean(value);\r\n/* 530: */ }", "byte[] readBytes();", "@Test\n public void testBooleanPropertyQuick() {\n Assertions.assertTrue(classObject.getBoolean(\"Started\"));\n }", "public boolean read() {\n return so;\n }", "@Test\n public void testIsIndexable() {\n System.out.println(\"isIndexable\");\n BasicEncoder instance = new BinaryEncoder();\n boolean expResult = false;\n boolean result = instance.isIndexable();\n assertEquals(expResult, result);\n }", "boolean hasSendReading();", "boolean getBinaryFileAttribute();", "public abstract byte read_octet();", "boolean isBinary();", "public static boolean[] readBooleanVector(DataInputStream input) throws IOException {\n int length = input.readInt();\n\n boolean[] ret = new boolean[length];\n\n for (int i = 0; i < length; i++) {\n boolean value = input.readBoolean();\n ret[i] = value;\n }\n\n return ret;\n }", "public static boolean toBoolean(byte[] value, int startIndex) {\r\n\r\n\t\tif (value[startIndex] == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public Boolean getIsRead() {\n return isRead;\n }", "private boolean tryByteArrayInputStream(){\n return true;\n }", "boolean getBoolean(String key) throws KeyValueStoreException;", "@Test\n public void testReflectionBoolean() {\n Boolean b;\n b = Boolean.TRUE;\n assertEquals(this.toBaseString(b) + \"[value=true]\", ToStringBuilder.reflectionToString(b));\n b = Boolean.FALSE;\n assertEquals(this.toBaseString(b) + \"[value=false]\", ToStringBuilder.reflectionToString(b));\n }", "public boolean getRead() {\n return read_;\n }", "boolean getBoolean();", "boolean getBoolean();", "@Test\n public void booleanInvalidType() throws Exception {\n String retVal = new SynapseHelper().serializeToSynapseType(MOCK_TEMP_DIR, TEST_PROJECT_ID, TEST_RECORD_ID,\n TEST_FIELD_NAME, UploadFieldTypes.BOOLEAN, new TextNode(\"true\"));\n assertNull(retVal);\n }", "private boolean canRead() {\n\t\treturn fileStatus;\n\t}", "@ZenCodeType.Caster\n @ZenCodeType.Method\n default boolean asBool() {\n \n return notSupportedCast(BasicTypeID.BOOL);\n }", "public boolean getBoolean(int index)\r\n/* 131: */ {\r\n/* 132:148 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 133:149 */ return super.getBoolean(index);\r\n/* 134: */ }", "public ByteBuf setBoolean(int index, boolean value)\r\n/* 265: */ {\r\n/* 266:280 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 267:281 */ return super.setBoolean(index, value);\r\n/* 268: */ }", "public boolean getRead() {\n return read_;\n }", "boolean getBoolValue();", "boolean getBoolValue();", "@Test(timeout = 4000)\n public void test032() throws Throwable {\n StringReader stringReader0 = new StringReader(\"boolean\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 77, 17);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(6, javaCharStream0.bufpos);\n assertEquals(\"boolean\", token0.toString());\n }", "public boolean[] readWord(boolean[] address) {\n return readWord(address, true);\n }", "private boolean get_BOOLEAN(int column) {\n // @AGG force Little Endian\n // @AGG In DB2 BOOLEAN columns appear to be encoded as two bytes\n if (metadata.isZos())\n return dataBuffer_.getShort(columnDataPosition_[column - 1]) != 0;\n else\n return dataBuffer_.getShortLE(columnDataPosition_[column - 1]) != 0;\n// if ( SignedBinary.getByte( dataBuffer_, columnDataPosition_[column - 1] ) == 0 )\n// { return false; }\n// else { return true; }\n }", "private CheckBoolean() {\n\t}", "public boolean getRead() {\n\t\treturn read;\n\t}", "public abstract byte[] read() throws IOException, IllegalArgumentException , IllegalStateException;", "@Test\n public void testReadWriteInt() {\n System.out.println(\"readInt\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(1234, 4);\n instance.writeInt(13, instance.compacity());\n \n assertEquals(12, instance.readInt(0));\n assertEquals(1234, instance.readInt(4));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n \n instance.writeInt(14, 4);\n assertEquals(14, instance.readInt(4));\n }", "boolean getBoolean(int index) throws PropertyException {\n Object object = this.get(index);\n if (object.equals(Boolean.FALSE)\n || (object instanceof String && ((String) object).equalsIgnoreCase(\"false\"))) {\n return false;\n } else if (object.equals(Boolean.TRUE)\n || (object instanceof String && ((String) object).equalsIgnoreCase(\"true\"))) {\n return true;\n }\n throw new PropertyException(\"JSONArray[\" + index + \"] is not a boolean.\");\n }", "public boolean hasRead() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "public static _boolean parse(\n javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n _boolean object = new _boolean();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.microsoft.com/2003/10/Serialization/\",\n \"boolean\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.set_boolean(org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(\n content));\n } else {\n reader.getElementText(); // throw away text nodes if any.\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "public boolean hasRead() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "void writeBoolean(boolean v) throws IOException;", "@Override // c.d.a.m.w.n\n public /* bridge */ /* synthetic */ boolean b(byte[] bArr) {\n return true;\n }", "public void setBoolean(int index, boolean value) throws ArrayIndexOutOfBoundsException\n\t{\n\t\tbytes[index] = (byte) (value ? 1 : 0);\n\t}", "static boolean boolFrByte(byte input,int position){\n return boolFrBit(getBit(input,position));\n }", "public boolean getBoolean();", "public boolean readDataFile();", "public static byte[] getBytes(boolean value) {\r\n\t\t\r\n\t\tif (value) {\r\n\t\t\treturn new byte[] { 1 };\r\n\t\t}\r\n\t\treturn new byte[] { 0 };\r\n\t}", "boolean isSetRawOffset();", "@Test\n\tpublic void test_TCM__boolean_getBooleanValue() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"true\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect boolean true value\", attribute.getBooleanValue());\n\n attribute.setValue(\"false\");\n\t\t\tassertTrue(\"incorrect boolean false value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"TRUE\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"FALSE\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"On\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"Yes\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"1\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"OfF\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"No\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n attribute.setValue(\"foo\");\n\t\t\tassertTrue(\"incorrectly returned boolean from non boolean value\", attribute.getBooleanValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// good\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Expected DataConversionException, but got \" + e.getClass().getName());\n\t\t}\n\n\n\t}", "public boolean hasForRead() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }" ]
[ "0.77869034", "0.7525603", "0.75208384", "0.74391276", "0.72857124", "0.7118813", "0.6906351", "0.69012046", "0.6844053", "0.682264", "0.6804094", "0.6690298", "0.6641258", "0.6534401", "0.6516068", "0.6498863", "0.64810115", "0.64265424", "0.6396606", "0.6364722", "0.62951213", "0.6190521", "0.6136247", "0.6120243", "0.6118652", "0.6057769", "0.6052753", "0.598403", "0.5979716", "0.5957388", "0.595618", "0.59473026", "0.5939821", "0.5939706", "0.5877638", "0.5865455", "0.5852107", "0.5813742", "0.5809887", "0.5803606", "0.5783016", "0.5781085", "0.5779237", "0.5775909", "0.5770049", "0.5766394", "0.5757395", "0.57373816", "0.5734051", "0.57333535", "0.57125944", "0.56988275", "0.5697867", "0.56972706", "0.56944317", "0.5683977", "0.56810194", "0.56771535", "0.56708264", "0.563333", "0.56301117", "0.5628796", "0.56273425", "0.562702", "0.5619986", "0.56146353", "0.5613337", "0.56107277", "0.55964345", "0.5592419", "0.5592419", "0.55715877", "0.5560416", "0.5554709", "0.55508554", "0.55498797", "0.55441964", "0.5528268", "0.5528268", "0.5511365", "0.5509923", "0.5499731", "0.5491829", "0.54891735", "0.5480796", "0.54780406", "0.54714966", "0.5464152", "0.54629904", "0.5460498", "0.54601794", "0.54563224", "0.54554737", "0.5449481", "0.54402506", "0.5434511", "0.54327327", "0.542133", "0.5415362", "0.54145426" ]
0.78840196
0
Test of readShort method, of class ByteArray.
@Test public void testReadWriteShort() { System.out.println("readShort"); ByteArray instance = new ByteArray(); instance.writeShort((short) 12, 0); instance.writeShort((short) 15, 2); instance.writeShort((short) 13, instance.compacity()); assertEquals(12, instance.readShort(0)); assertEquals(15, instance.readShort(2)); assertEquals(13, instance.readShort(instance.compacity() - 2)); instance.writeShort((short) 14, 2); assertEquals(14, instance.readShort(2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "short readShort() throws IOException;", "abstract int readShort(int start);", "short readShort();", "public short readShort() throws IOException;", "public abstract short read_short();", "private int getShort() {\n shortBuffer.rewind();\n archive.read(shortBuffer);\n shortBuffer.flip();\n return (int) shortBuffer.getShort();\n }", "String shortRead();", "public abstract short read_ushort();", "public abstract void read_short_array(short[] value, int offset, int\nlength);", "private short readShort(SeekableStream stream)\n throws IOException {\n if (isBigEndian) {\n return stream.readShort();\n } else {\n return stream.readShortLE();\n }\n }", "public short readShort() throws IOException {\n\n\t\tif (read(bb, 0, 2) < 2) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tshort s = (short) (bb[0] << 8 | (bb[1] & 0xFF));\n\t\treturn s;\n\t}", "public short readShort()\r\n/* 399: */ {\r\n/* 400:412 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 401:413 */ return super.readShort();\r\n/* 402: */ }", "protected int readShort(BinaryDataReader dataReader) throws IOException\n\t{\n\t\t// convert tag value to long offset for reading large buffer\n\t\tlong offset = ((long) this.value) & 0xffffffffL;\n\n\t\tlong pos0 = dataReader.getFilePointer();\n\t\tdataReader.seek(offset);\n\t\tint result = dataReader.readShort();\n\t\tdataReader.seek(pos0);\n\t\treturn result;\n\t}", "public void testNIO_short_array() throws Exception {\n short[] shortArray = new short[8];\n ShortBuffer sb = ShortBuffer.wrap(shortArray);\n shortBufferTest(sb);\n }", "public short readUnsignedByte()\r\n/* 393: */ {\r\n/* 394:406 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 395:407 */ return super.readUnsignedByte();\r\n/* 396: */ }", "public int readUnsignedShort() throws IOException {\n\n\t\tif (read(bb, 0, 2) < 2) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\treturn (bb[0] & 0xFF) << 8 | (bb[1] & 0xFF);\n\t}", "public int readUnsignedShort()\r\n/* 405: */ {\r\n/* 406:418 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 407:419 */ return super.readUnsignedShort();\r\n/* 408: */ }", "public short readShort() {\n return ((short) readLong());\n }", "public synchronized void read( int readIndex, short[] array,\n\t\t\tint firstIndex, int numShorts )\n\t{\n\t\tint numShortsLeft = numShorts;\n\t\tint shortsInBuffer = buffer.length >> 1;\n\t\tint shortIndex = firstIndex;\n\t\tint byteReadIndex = readIndex << 1;\n\t\twhile( numShortsLeft > 0 )\n\t\t{\n\t\t\tint numShortsToRead = (numShortsLeft < shortsInBuffer) ? numShortsLeft\n\t\t\t\t\t: shortsInBuffer;\n\n\t\t\t// Shift by one to convert numShorts to numBytes.\n\t\t\tint numBytesToRead = (numShortsToRead << 1);\n\t\t\tbyteArray.read( byteReadIndex, buffer, 0, numBytesToRead );\n\t\t\tbyteReadIndex += numBytesToRead;\n\n\t\t\tint byteIndex = 0;\n\t\t\tfor( int i = 0; i < numShortsToRead; i++ )\n\t\t\t{\n\t\t\t\tint loByte = buffer[byteIndex++];\n\t\t\t\tint hiByte = buffer[byteIndex++];\n\n\t\t\t\tint sample = (hiByte << 8) | (loByte & 0x00FF);\n\t\t\t\tarray[shortIndex++] = (short) sample;\n\t\t\t}\n\t\t\tnumShortsLeft -= numShortsToRead;\n\t\t}\n\t}", "void writeShort(int v) throws IOException;", "protected short _getShort(int index)\r\n/* 334: */ {\r\n/* 335:348 */ return HeapByteBufUtil.getShort(this.array, index);\r\n/* 336: */ }", "public int read(short[] s) throws IOException {\n\t\treturn read(s, 0, s.length);\n\t}", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte)33;\n byte byte0 = (byte)0;\n byteArray0[1] = (byte)0;\n byte byte1 = (byte) (-119);\n byteArray0[2] = (byte) (-119);\n byteArray0[3] = (byte)23;\n byte byte2 = (byte)18;\n byteArray0[4] = (byte)18;\n byteArray0[5] = (byte)121;\n // Undeclared exception!\n try { \n MethodWriter.readShort(byteArray0, (byte)121);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 121\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "public short readShortLE()\r\n/* 817: */ {\r\n/* 818:826 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 819:827 */ return super.readShortLE();\r\n/* 820: */ }", "int readS16BE()\n throws IOException, EOFException;", "short getDQ1( byte[] buffer, short offset );", "short getQ( byte[] buffer, short offset );", "public void onReadShortBegin(ICPU cpu, int addr) {\n\t}", "@Test(timeout = 4000)\n public void test000() throws Throwable {\n byte[] byteArray0 = new byte[4];\n byteArray0[0] = (byte) (-71);\n byteArray0[1] = (byte)38;\n byteArray0[2] = (byte) (-71);\n byteArray0[3] = (byte) (-28);\n MethodWriter.writeShort(byteArray0, 0, (byte)38);\n assertArrayEquals(new byte[] {(byte)0, (byte)38, (byte) (-71), (byte) (-28)}, byteArray0);\n }", "public short readShortNonBlock() {\n return ((short) readLongNonBlock());\n }", "byte readByte();", "short decodeShort();", "public static short getShort(byte bc[], int index) {\n short s, bh, bl;\n bh = (bc[index]);\n bl = (bc[index + 1]);\n s = (short) (((bh << 8) & 0xff00) | (bl & 0xff));\n // s = (short)((int)(bc[index])<<8 + bc[index+1]);\n return s;\n }", "@Override\r\n\tpublic short getShort(int pos) {\n\t\treturn buffer.getShort(pos);\r\n\t}", "@Override\n\tpublic short readScalarShort() throws IOException {\n\t\treturn 0;\n\t}", "int readS16LE()\n throws IOException, EOFException;", "public short readVarShort() throws IOException {\n return readVarShort(7);\n }", "public short getShort(int index)\r\n/* 328: */ {\r\n/* 329:342 */ ensureAccessible();\r\n/* 330:343 */ return _getShort(index);\r\n/* 331: */ }", "public int readUnsignedShortLE()\r\n/* 823: */ {\r\n/* 824:832 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 825:833 */ return super.readUnsignedShortLE();\r\n/* 826: */ }", "short getP( byte[] buffer, short offset );", "public ByteBuf writeShort(int value)\r\n/* 539: */ {\r\n/* 540:550 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 541:551 */ return super.writeShort(value);\r\n/* 542: */ }", "public static final short readShort(InputStream in) throws IOException {\n byte[] buff = new byte[2];\n StreamTool.readFully(in, buff);\n return getShort(buff, 0);\n }", "public short getUnsignedByte(int index)\r\n/* 143: */ {\r\n/* 144:160 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 145:161 */ return super.getUnsignedByte(index);\r\n/* 146: */ }", "public abstract void read_ushort_array(short[] value, int offset, int\nlength);", "boolean hasShort();", "public int read(short[] s, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 2) {\n\t\t\t\t\tfillBuf(2);\n\t\t\t\t}\n\t\t\t\ts[i] = (short) (buf[pos] << 8 | (buf[pos + 1] & 0xFF));\n\t\t\t\tpos += 2;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 2);\n\t\t}\n\t\treturn 2 * len;\n\t}", "void writeShorts(short[] s, int off, int len) throws IOException;", "int readS16BE(String name)\n throws IOException, EOFException;", "public short getElement_data(int index1) {\n return (short)getUIntBEElement(offsetBits_data(index1), 8);\n }", "@Test\n public void testShort() {\n assertEquals(\"32767\", hiveTypeToJson(new MyHiveType(new ShortWritable(Short.MAX_VALUE), shortTypeInfo)));\n }", "protected static final int parseUnsignedShort(ByteArrayInputStream stream) throws EOFException\n {\n return (EASMessage.parseUnsignedByte(stream) << 8) | EASMessage.parseUnsignedByte(stream);\n }", "public short getShort(int index)\r\n/* 149: */ {\r\n/* 150:166 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 151:167 */ return super.getShort(index);\r\n/* 152: */ }", "void writeShort(short value);", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n byte[] byteArray0 = new byte[0];\n int int0 = (-356);\n // Undeclared exception!\n try { \n MethodWriter.readUnsignedShort(byteArray0, (-356));\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -356\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "public void onReadShortEnd(ICPU cpu, int addr) {\n\t}", "void ReadStatusByte(int boardID, short addr, ShortByReference result);", "private int readByte() {\n return src[srcPos++] & 0xFF;\n }", "protected Object getShort(final int vm, final int length, final boolean endianess) throws IOException {\r\n int len = (elementLength == UNDEFINED_LENGTH) ? 0 : elementLength;\r\n int i = 0;\r\n Object readObject = null; // the Object we read in\r\n\r\n if (vm > 1) {\r\n final Short[] array = new Short[length / 2];\r\n\r\n while (len > 0) { // we should validate with VM here too\r\n array[i] = new Short((short) getUnsignedShort(endianess));\r\n len -= 2;\r\n i++;\r\n }\r\n\r\n readObject = array;\r\n } else if ( ( (vm < 1) && (length > 2))) {\r\n\r\n // not a valid VM, but we don't initialise the VM to 1,\r\n // so we will use this fact to guess at valid data.\r\n // we actually do it as above.\r\n final Short[] array = new Short[length / 2];\r\n\r\n while (len > 0) { // we should validate with VM here too\r\n array[i] = new Short((short) getUnsignedShort(endianess));\r\n len -= 2;\r\n i++;\r\n }\r\n\r\n readObject = array;\r\n } else if ( ( (vm == 1) && (length > 2))) {\r\n\r\n // not a valid VM, but we don't initialise the VM to 1,\r\n // so we will use this fact to guess at valid data.\r\n // we actually do it as above.\r\n readObject = new Short((short) getUnsignedShort(endianess));\r\n len -= 2;\r\n\r\n while (len > 0) { // we should validate with VM here too\r\n getUnsignedShort(endianess);\r\n len -= 2;\r\n i++;\r\n }\r\n } else if (length == 2) {\r\n readObject = new Short((short) getUnsignedShort(endianess));\r\n }\r\n\r\n return readObject;\r\n }", "protected void _setShort(int index, int value)\r\n/* 435: */ {\r\n/* 436:449 */ HeapByteBufUtil.setShort(this.array, index, value);\r\n/* 437: */ }", "public static byte[] readFullyByByteShort(InputStream in) throws IOException {\n int oneByte;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n while((oneByte = in.read()) != -1){\n out.write(oneByte);\n }\n return out.toByteArray();\n }", "private int getUnsignedShort(final ByteBuffer byteBuffer) {\n return byteBuffer.getShort() & 0xffff;\n }", "public static short getBytesAsShort(byte[] b) {\n\t\tint i = (b[0] & 0xFF << 8)\n\t\t\t\t| (b[1] & 0xFF);\n\t\t\n\t\treturn (short) i;\n\t}", "public static short getShort(byte[] buffer, int index, int len) {\n switch (len) {\n case 0: return (short) 0xFFFF;\n case 1: return (short) (0xFFFFFF00 | _getByte(buffer, index, 1));\n case 2: return _getShort(buffer, index, 2);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }", "public short readAsShort(int nrBits) {\n return readAsShort(bitPos, nrBits, ByteOrder.BigEndian);\n }", "@Test\n public void testReadWriteInt() {\n System.out.println(\"readInt\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(1234, 4);\n instance.writeInt(13, instance.compacity());\n \n assertEquals(12, instance.readInt(0));\n assertEquals(1234, instance.readInt(4));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n \n instance.writeInt(14, 4);\n assertEquals(14, instance.readInt(4));\n }", "public void readRecordUshort(short[] data, int start, int length,\n\t\tint offset, int pixelStride, int n2, int n3) throws IOException;", "short getDP1( byte[] buffer, short offset );", "public final int getUnsignedShort(final boolean endianess) throws IOException {\r\n b3 = 0;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n b3 = ( (tagBuffer[bPtr] & 0xff) << 8) | (tagBuffer[bPtr + 1] & 0xff); // Big Endian\r\n } else {\r\n b3 = ( (tagBuffer[bPtr + 1] & 0xff) << 8) | (tagBuffer[bPtr] & 0xff); // Little Endian\r\n }\r\n\r\n bPtr += 2;\r\n\r\n return b3;\r\n }", "T print(short data) throws PrintingException;", "@Override\n\tpublic int ReadByte()\n\t{\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: byte[] oneByteBuffer = new byte[1];\n\t\tbyte[] oneByteBuffer = new byte[1];\n\t\tint num = Read(oneByteBuffer, 0, 1);\n\t\tif (num <= 0)\n\t\t{\n\t\t\t// return -1 to indicate that no byte was read.\n\t\t\treturn -1;\n\t\t}\n\t\treturn oneByteBuffer[0];\n\t}", "public static int shortToBytes(short s, byte bc[], int index) {\n bc[index++] = (byte) ((s >> 8) & 0xff);\n bc[index++] = (byte) (s & 0xff);\n return index;\n }", "public static short byteArrayToShort(byte[] ba, int offset) {\n int value = 0;\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n return (short) value;\n }", "protected int[] readShortArray(BinaryDataReader dataReader) throws IOException\n\t{\n\t\tlong offset = ((long) this.value) & 0xffffffffL;\n\n\t\t// allocate memory for result\n\t\tint[] res = new int[this.count];\n\n\t\t// save pointer location\n\t\tlong saveLoc = dataReader.getFilePointer();\n\n\t\t// fill up array\n\t\tdataReader.seek(offset);\n\t\tfor (int c = 0; c < this.count; c++)\n\t\t{\n\t\t\tres[c] = dataReader.readShort();\n\t\t}\n\t\t\n\t\t// restore pointer and return result\n\t\tdataReader.seek(saveLoc);\n\t\treturn res;\n\t}", "public abstract byte read_octet();", "public ByteBuf setShort(int index, int value)\r\n/* 277: */ {\r\n/* 278:292 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 279:293 */ return super.setShort(index, value);\r\n/* 280: */ }", "private short getUnsignedByte(final ByteBuffer byteBuffer) {\n return (short) (byteBuffer.get() & 0xff);\n }", "public short getShortA() {\n\t\tint i = (payload.get() & 0xFF) << 8 | payload.get() - 128 & 0xFF;\n\t\tif (i > 32767) {\n\t\t\ti -= 0x10000;\n\t\t}\n\t\treturn (short) i;\n\t}", "int readS16LE(String name)\n throws IOException, EOFException;", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "@Test\n\tpublic void getByteOf_Test2() {\n\t\tfinal short value = 8930;\n\t\t\n\t\t// Should be 1110 0010 = -30\n\t\tfinal byte value0 = FlagUtils.getByteOf(value, 0);\n\t\tassertThat(value0, is((byte) -30));\n\t\t\n\t\t// Should be 0010 0010 = 34\n\t\tfinal byte value1 = FlagUtils.getByteOf(value, 1);\n\t\tassertThat(value1, is((byte) 34));\n\t}", "public byte read(int param1) {\n }", "@Override\r\n\tpublic short getUnsignedByte(int pos) {\n\t\treturn (short) (getByte(pos) & 0xff);\r\n\t}", "@Test\n\tpublic void getByteOf_Test() {\n\t\tfinal short value = 8738;\n\t\t\n\t\t// Should be 0010 0010 = 34\n\t\tfinal byte value0 = FlagUtils.getByteOf(value, 0);\n\t\tassertThat(value0, is((byte) 34));\n\t\t\n\t\t// The same like above\n\t\tfinal byte value1 = FlagUtils.getByteOf(value, 1);\n\t\tassertThat(value1, is((byte) 34));\n\t}", "public Short _parseShort(JsonParser jVar, DeserializationContext gVar) throws IOException {\n JsonToken l = jVar.mo29328l();\n if (l == JsonToken.VALUE_NUMBER_INT) {\n return Short.valueOf(jVar.mo29336B());\n }\n if (l == JsonToken.VALUE_STRING) {\n String trim = jVar.mo29334t().trim();\n if (trim.length() == 0) {\n return (Short) _coerceEmptyString(gVar, this._primitive);\n }\n if (_hasTextualNull(trim)) {\n return (Short) _coerceTextualNull(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n int a = NumberInput.m23779a(trim);\n if (_shortOverflow(a)) {\n return (Short) gVar.mo31517b(this._valueClass, trim, \"overflow, value cannot be represented as 16-bit value\", new Object[0]);\n }\n return Short.valueOf((short) a);\n } catch (IllegalArgumentException unused) {\n return (Short) gVar.mo31517b(this._valueClass, trim, \"not a valid Short value\", new Object[0]);\n }\n } else if (l == JsonToken.VALUE_NUMBER_FLOAT) {\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Short\");\n }\n return Short.valueOf(jVar.mo29336B());\n } else if (l == JsonToken.VALUE_NULL) {\n return (Short) _coerceNullToken(gVar, this._primitive);\n } else {\n if (l == JsonToken.START_ARRAY) {\n return (Short) _deserializeFromArray(jVar, gVar);\n }\n return (Short) gVar.mo31493a(this._valueClass, jVar);\n }\n }", "public final int getSignedShort(final boolean endianess) throws IOException {\r\n b3 = 0;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n b3 = ( (tagBuffer[bPtr] & 0xff) << 8) | (tagBuffer[bPtr + 1] & 0xff);\r\n } else {\r\n b3 = ( (tagBuffer[bPtr + 1] & 0xff) << 8) | (tagBuffer[bPtr] & 0xff);\r\n }\r\n\r\n if ( (b3 & 0x0080) != 0) {\r\n b3 = b3 | 0xff00;\r\n }\r\n\r\n bPtr += 2;\r\n\r\n return b3;\r\n }", "public static void main(String[] args) {\nshort i = 128;\r\nbyte shortToByte = (byte)i;\r\nSystem.out.println(shortToByte);\r\nbyte t = 127;\r\nt++;\r\nSystem.out.println(t);\r\nt++;\r\nSystem.out.println(t);\r\n\r\n\t}", "public int getUnsignedShort(int index)\r\n/* 155: */ {\r\n/* 156:172 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 157:173 */ return super.getUnsignedShort(index);\r\n/* 158: */ }", "public native short __shortMethod( long __swiftObject, short arg );", "public ByteBuf setShort(int index, int value)\r\n/* 428: */ {\r\n/* 429:442 */ ensureAccessible();\r\n/* 430:443 */ _setShort(index, value);\r\n/* 431:444 */ return this;\r\n/* 432: */ }", "boolean readByte(int c, String streamProvider) throws RawDataEventException ;", "protected short _getShortLE(int index)\r\n/* 345: */ {\r\n/* 346:359 */ return HeapByteBufUtil.getShortLE(this.array, index);\r\n/* 347: */ }", "public static double readShort() {\n return Short.parseShort(readString());\n }", "@Test\n public void testInsertSome() {\n System.out.println(\"insertSome\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(15, 4);\n instance.writeInt(13, instance.compacity());\n \n instance.insertSome(\"hello\".getBytes(), 0, 4);\n \n byte[] dest = new byte[\"hello\".getBytes().length];\n instance.read(dest, 0);\n \n assertEquals(\"hello\", new String(dest));\n assertEquals(15, instance.readInt(5));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n }", "public native short[] __shortArrayMethod( long __swiftObject, short[] arg );", "public static final short getShort(ClassFile cf, short cpiIndex) {\n IntegerInfo ii = (IntegerInfo) cf.getCpInfo(cpiIndex);\n return (short) ii.bytes;\n }", "public static _short parse(javax.xml.stream.XMLStreamReader reader)\n throws java.lang.Exception {\n _short object = new _short();\n\n int event;\n javax.xml.namespace.QName currentQName = null;\n java.lang.String nillableValue = null;\n java.lang.String prefix = \"\";\n java.lang.String namespaceuri = \"\";\n\n try {\n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n currentQName = reader.getName();\n\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (\"true\".equals(nillableValue) ||\n \"1\".equals(nillableValue)) {\n // Skip the element and report the null value. It cannot have subelements.\n while (!reader.isEndElement())\n reader.next();\n\n object.set_short(java.lang.Short.MIN_VALUE);\n\n return object;\n }\n\n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n\n while (!reader.isEndElement()) {\n if (reader.isStartElement()) {\n if (reader.isStartElement() &&\n new javax.xml.namespace.QName(\n \"http://schemas.microsoft.com/2003/10/Serialization/\",\n \"short\").equals(reader.getName())) {\n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"nil\");\n\n if (!\"true\".equals(nillableValue) &&\n !\"1\".equals(nillableValue)) {\n java.lang.String content = reader.getElementText();\n\n object.set_short(org.apache.axis2.databinding.utils.ConverterUtil.convertToShort(\n content));\n } else {\n object.set_short(java.lang.Short.MIN_VALUE);\n\n reader.getElementText(); // throw away text nodes if any.\n }\n } // End of if for expected property start element\n\n else {\n // 3 - A start element we are not expecting indicates an invalid parameter was passed\n throw new org.apache.axis2.databinding.ADBException(\n \"Unexpected subelement \" +\n reader.getName());\n }\n } else {\n reader.next();\n }\n } // end of while loop\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }", "private short toDec(byte[] source, short index){\r\n \treturn (short)(source[index] - (short)48);\r\n }", "public short readVarShort(int optimal) throws IOException {\n int[] varShortDepths = {optimal, 16};\n final int type = (int) this.read(1).toLong();\n return (short) this.read(varShortDepths[type]).toLong();\n }", "public short getLEShort() {\n\t\tint i = payload.get() & 0xFF | (payload.get() & 0xFF) << 8;\n\t\tif (i > 32767) {\n\t\t\ti -= 0x10000;\n\t\t}\n\t\treturn (short) i;\n\t}", "protected final short getShort(int offset)\n {\n final byte[] tableData = tables.getTablesData();\n return Bytes.getShort(tableData, cursor+offset);\n }" ]
[ "0.78828895", "0.7779585", "0.76805747", "0.7659965", "0.7642507", "0.7121425", "0.7105496", "0.70617", "0.7001037", "0.699436", "0.6940048", "0.6906571", "0.68627596", "0.6848715", "0.6794594", "0.66991585", "0.6665139", "0.6554044", "0.65160215", "0.64888084", "0.64775634", "0.6451456", "0.6449798", "0.6448811", "0.6428993", "0.6421933", "0.63825375", "0.6348914", "0.6338956", "0.63335854", "0.6293739", "0.62850356", "0.62838995", "0.62802434", "0.6253998", "0.6241079", "0.6230076", "0.6218694", "0.61998826", "0.6198057", "0.6178854", "0.6172212", "0.61705416", "0.61699265", "0.6160286", "0.6102468", "0.60563827", "0.6047665", "0.60442376", "0.6016394", "0.5998121", "0.59821033", "0.5982067", "0.5977688", "0.5970022", "0.5961009", "0.5950944", "0.594918", "0.5941344", "0.5933805", "0.5932735", "0.5931586", "0.58889276", "0.5876714", "0.58686984", "0.5868008", "0.58574677", "0.5847946", "0.5843037", "0.58429694", "0.5834852", "0.58308583", "0.5802415", "0.57938707", "0.579319", "0.5781719", "0.5780765", "0.57585835", "0.5746782", "0.57379234", "0.5737446", "0.5734659", "0.5724382", "0.5722976", "0.572097", "0.57127476", "0.57119775", "0.56699264", "0.5665546", "0.5651344", "0.5648828", "0.56451476", "0.564337", "0.5638681", "0.5621553", "0.5619559", "0.5606087", "0.5593364", "0.55917907", "0.55886614" ]
0.80293584
0
Test of readInt method, of class ByteArray.
@Test public void testReadWriteInt() { System.out.println("readInt"); ByteArray instance = new ByteArray(); instance.writeInt(12, 0); instance.writeInt(1234, 4); instance.writeInt(13, instance.compacity()); assertEquals(12, instance.readInt(0)); assertEquals(1234, instance.readInt(4)); assertEquals(13, instance.readInt(instance.compacity() - 4)); instance.writeInt(14, 4); assertEquals(14, instance.readInt(4)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int readInt();", "public int readInt() throws IOException;", "int readInt() throws IOException;", "public void testToInt(){\t\t\r\n\t\tassertEquals(fIntToTest, ByteUtil.byteArrayToInt(fIntToTestByteArray));\r\n\t}", "abstract int readInt(int start);", "int readInt();", "private static int readInt(@Nullable byte[] data) {\n if (data == null || data.length == 0) {\n return 0;\n }\n int value = 0;\n for (byte b : data) {\n value <<= 8;\n value += (0xff & b);\n }\n return value;\n }", "@Test\n public void testByteArray2Integer() {\n System.out.println(\"byteArray2Integer\");\n SntParser instance = new SntParser();\n byte[] array = {0x20, 0x00, 0x30, 0x34};\n int start = 0;\n int length = 3;\n int expResult = 0x200030;\n int result = byteArray2Integer(array, start, length);\n assertEquals(expResult, result);\n }", "public int readInt() throws IOException {\n return in.readInt();\n }", "@Test\n void testReadIntPacked() throws IOException {\n byte[] input = new byte[]{(byte) 0x35, (byte) 0x54};\n r = new BitReader(input);\n assertEquals(5402, r.readIntPacked());\n }", "static int readInt() throws Exception {\n\t\treturn Integer.parseInt(readString());\n\t}", "public void testNIO_int_array() throws Exception {\n int[] intArray = new int[8];\n IntBuffer ib = IntBuffer.wrap(intArray);\n intBufferTest(ib);\n }", "public static int readIntFromBytes(byte[] data, int startIndex) {\n return readNumberFromBytes(data, Constants.INTEGER_SIZE, startIndex);\n }", "protected static int getInt(byte[] data, int offset){\n return makeInt(data, offset);\n }", "public int read(int i);", "public static int readInt(byte[] source, int position) {\n return makeInt(source[position], source[position + 1], source[position + 2], source[position + 3]);\n }", "@Test(timeout = 4000)\n public void test08() throws Throwable {\n String string0 = \"\";\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte)77;\n byteArray0[1] = (byte) (-9);\n byteArray0[2] = (byte)76;\n byteArray0[3] = (byte)76;\n byteArray0[4] = (byte) (-64);\n byte byte0 = (byte) (-46);\n byteArray0[5] = (byte) (-46);\n // Undeclared exception!\n try { \n MethodWriter.readInt(byteArray0, (byte) (-9));\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -9\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "public int read() throws IOException;", "public static int readInt() {\n return Integer.parseInt(readString());\n }", "public int readInt()\r\n/* 423: */ {\r\n/* 424:436 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 425:437 */ return super.readInt();\r\n/* 426: */ }", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "byte readByte();", "@Override\n public int read(final byte[] b) throws IOException {\n return input.read(b);\n }", "private int getInt() {\n intBuffer.rewind();\n archive.read(intBuffer);\n intBuffer.flip();\n return intBuffer.getInt();\n }", "public int read(byte[] p_bytes, int p_offset, int p_length);", "@Override\n public int read(byte[] b) throws IOException {\n int len = ((int) Math.ceil((b.length-24) / 32.0))*4+24;\n byte[] comp = new byte[len];\n in.read(comp);\n in.close();\n\n //copy the first 24 cells to b\n for (int i=0; i<24; i++)\n {\n b[i] = comp[i];\n }\n\n //4 cells represents byte --> int --> binary\n byte[] temp = new byte[4];\n int resInt;\n String resStr;\n int dif = b.length-24;\n int index = 0;\n for (int i=24; i<comp.length; i=i+4)\n {\n //byte --> int\n temp[0] = comp[i];\n temp[1] = comp[i+1];\n temp[2] = comp[i+2];\n temp[3] = comp[i+3];\n ByteBuffer byteBuffer = ByteBuffer.wrap(temp);\n resInt = byteBuffer.getInt();\n //int --> binary (string)\n resStr = Integer.toBinaryString(resInt);\n //checks the length of the string\n if (dif >=32 ) {\n dif = dif - 32;\n if (resStr.length()<32)\n resStr = addZero (resStr, 32-resStr.length());\n }\n else\n {\n if (resStr.length()<dif)\n resStr = addZero (resStr, dif-resStr.length());\n }\n //more converts\n for (int j=0; j<resStr.length(); j++)\n {\n String tempStr = \"\"+resStr.charAt(j); //each char --> string\n int digit = Integer.parseInt(tempStr); //string (with one char) --> int\n b[index+24] = (byte) digit; //int --> byte\n index++;\n }\n }\n return 0;\n }", "public int getInt(int index) throws ArrayIndexOutOfBoundsException\n\t{\n\t\treturn bytes[index] & 0xFF;\n\t}", "private static int readInt(InputStream is) throws IOException {\n int a = is.read();\n int b = is.read();\n int c = is.read();\n int d = is.read();\n return a | b << 8 | c << 16 | d << 24;\n }", "public static int readNumberFromBytes(byte[] data, int readSize, int startIndex) {\n int value = 0;\n for (int i = 0; i < readSize; i++)\n value += ((long) data[startIndex + i] & 0xFFL) << (Constants.BITS_PER_BYTE * i);\n return value;\n }", "public abstract byte read_octet();", "int readFrom(byte[] iStream, int pos, ORecordVersion version);", "public final int read() {\r\n \r\n if (cbyte == size) {\r\n return -1;\r\n }\r\n \r\n // Otherwise, the byte under the head at \"cbyte\" can be read.\r\n \r\n if (bytenum == BYTES_IN_ELEMENT) {\r\n // Read next byte\r\n offset++;\r\n elem = data[offset];\r\n bytenum = 0;\r\n }\r\n \r\n int rval = 0;\r\n rval = elem & 0xff;\r\n \r\n // increase byte position\r\n elem = elem >>> 8; // unsigned SHR\r\n bytenum++;\r\n cbyte++;\r\n \r\n return rval;\r\n }", "public void testToByte(){\t\r\n\t\t\r\n\t\tbyte[] lRes = ByteUtil.intToByteArray(fIntToTest);\r\n\t\t\r\n\t\tfor(int lCnt =0; lCnt< lRes.length; lCnt++){\r\n\t\t\tassertEquals(lRes[lCnt], fIntToTestByteArray[lCnt]);\r\n\t\t}\r\n\t\t\r\n\t}", "private int getInt(byte [] buffer, int offset) {\r\n\t\tint result = buffer[offset++] << 24;\r\n\t\tresult |= (buffer[offset++] << 16) & 0x00FF0000;\r\n\t\tresult |= (buffer[offset++] << 8) & 0x0000FF00;\r\n\t\tresult |= buffer[offset] & 0x000000FF;\r\n\r\n\t\treturn result;\r\n\t}", "public int readInt(String prompt);", "@Test\n public void testInsertSome() {\n System.out.println(\"insertSome\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(15, 4);\n instance.writeInt(13, instance.compacity());\n \n instance.insertSome(\"hello\".getBytes(), 0, 4);\n \n byte[] dest = new byte[\"hello\".getBytes().length];\n instance.read(dest, 0);\n \n assertEquals(\"hello\", new String(dest));\n assertEquals(15, instance.readInt(5));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n }", "public int readInt() {\n return ((int) readLong());\n }", "public byte read(int param1) {\n }", "public static int byteArrayToInt(byte[] ba, int offset) {\n int value = 0;\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n return value;\n }", "@Test(timeout = 4000)\n public void test00() throws Throwable {\n byte[] byteArray0 = new byte[6];\n byteArray0[0] = (byte)33;\n byte byte0 = (byte)0;\n byteArray0[1] = (byte)0;\n byte byte1 = (byte) (-119);\n byteArray0[2] = (byte) (-119);\n byteArray0[3] = (byte)23;\n byte byte2 = (byte)18;\n byteArray0[4] = (byte)18;\n byteArray0[5] = (byte)121;\n // Undeclared exception!\n try { \n MethodWriter.readShort(byteArray0, (byte)121);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 121\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "public static int readInt(InputStream source) throws IOException {\n int b1 = source.read();\n int b2 = source.read();\n int b3 = source.read();\n int b4 = source.read();\n if ((b1 | b2 | b3 | b4) < 0) {\n throw new EOFException();\n } else {\n return makeInt(b1, b2, b3, b4);\n }\n }", "public byte[] readRawInt() throws IOException {\n byte[] bytes = new byte[5];\n bytes[0] = (byte) Type.INT.code;\n in.readFully(bytes, 1, 4);\n return bytes;\n }", "@Test\n public void testInsert() {\n System.out.println(\"insert\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(15, 4);\n instance.writeInt(13, instance.compacity());\n \n instance.insert(\"hello\".getBytes(), 4);\n \n byte[] dest = new byte[\"hello\".getBytes().length];\n instance.read(dest, 4);\n \n assertEquals(12, instance.readInt(0));\n assertEquals(\"hello\", new String(dest));\n assertEquals(15, instance.readInt(4 + \"hello\".getBytes().length));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n }", "private int read_int(RandomAccessFile file) throws IOException {\n int number = 0;\n for (int i = 0; i < 4; ++i) {\n number += (file.readByte() & 0xFF) << (8 * i);\n }\n return number;\n }", "private int readByte() {\n return src[srcPos++] & 0xFF;\n }", "@Override\n public int readUnsignedByte() throws IOException\n {\n if (!hasRemaining())\n {\n throw new IOException(\"End off buffer reached\");\n }\n return randomAccessRead.read();\n }", "int read(long pos, byte[] buf)throws IOException;", "public final int read(byte[] b) throws IOException {\r\n\t\treturn f.read( b );\r\n\t}", "@Test(timeout = 4000)\n public void test01() throws Throwable {\n byte[] byteArray0 = new byte[0];\n int int0 = (-356);\n // Undeclared exception!\n try { \n MethodWriter.readUnsignedShort(byteArray0, (-356));\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // -356\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }", "protected final int readBytes()\n throws IOException\n {\n _inputPtr = 0;\n _inputEnd = 0;\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, 0, _inputBuffer.length);\n if (count > 0) {\n _inputEnd = count;\n }\n return count;\n }\n return -1;\n }", "protected final int readBytesAt(int offset)\n throws IOException\n {\n // shouldn't modify mBytePtr, assumed to be 'offset'\n if (_inputSource != null) {\n int count = _inputSource.read(_inputBuffer, offset, _inputBuffer.length - offset);\n if (count > 0) {\n _inputEnd += count;\n }\n return count;\n }\n return -1;\n }", "public int read(byte b[]) throws IOException {\r\n return read(b, 0, b.length);\r\n }", "public int readInt(int length) throws DomainLayerException{\n if(length == 0) return 0;\n boolean positive = readOne();\n int value = positive ? 0x1:0x0;\n int mask = (0x1 << length) - 1;\n --length;\n while (length > 0) {\n value <<= 1;\n if (readOne()) value |= 0x1;\n --length;\n }\n if (positive) return value;\n return value-mask;\n }", "public byte[] read();", "@Override\n\tpublic int read(byte[] array) throws IOException {\n\t\treturn read(array, 0, array.length);\n\t}", "byte[] readBytes();", "public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }", "public static final int readInt(InputStream in) throws IOException {\n byte[] buff = new byte[4];\n StreamTool.readFully(in, buff);\n return getInt(buff, 0);\n }", "public int readInt() throws IOException {\n int token = fTokenizer.nextToken();\n if (token == StreamTokenizer.TT_NUMBER)\n return (int) fTokenizer.nval;\n\n String msg = \"Integer expected in line: \" + fTokenizer.lineno();\n throw new IOException(msg);\n }", "private final int readBytes( int number ) throws IOException {\n byte[] buffer = new byte[ number ];\n int read = dataSource.read( buffer, 0, number );\n\n if ( read != buffer.length ) {\n if ( read < 0 ) throw new IOException( \"End of Stream\" );\n for ( int i = read; i < buffer.length; i++ ) buffer[ i ] = (byte)readByte();\n }\n \n\t/**\n * Create integer\n */\n switch ( number ) {\n case 1: return (buffer[ 0 ] & 0xff);\n\t case 2: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8);\n\t case 3: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16);\n\t case 4: return (buffer[ 0 ] & 0xff) | ((buffer[ 1 ] & 0xff) << 8) | ((buffer[ 2 ] & 0xff) << 16) | ((buffer[ 3 ] & 0xff) << 24);\n\t default: throw new IOException( \"Illegal Read quantity\" );\n\t}\n }", "public int read(byte[] b, int off, int len) throws IOException {\n/* 232 */ if (b == null) {\n/* 233 */ throw new NullPointerException();\n/* */ }\n/* 235 */ if (off < 0 || len < 0 || off + len > b.length) {\n/* 236 */ throw new IndexOutOfBoundsException();\n/* */ }\n/* 238 */ if (len == 0) {\n/* 239 */ return 0;\n/* */ }\n/* */ \n/* 242 */ long pos = readUntil(this.pointer + len);\n/* */ \n/* 244 */ if (pos <= this.pointer) {\n/* 245 */ return -1;\n/* */ }\n/* */ \n/* 248 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* 249 */ int nbytes = Math.min(len, 512 - (int)(this.pointer & 0x1FFL));\n/* 250 */ System.arraycopy(buf, (int)(this.pointer & 0x1FFL), b, off, nbytes);\n/* */ \n/* 252 */ this.pointer += nbytes;\n/* 253 */ return nbytes;\n/* */ }", "protected abstract int readInternal(int index);", "public abstract int read_ulong();", "public int read ()\n {\n return (_buffer.remaining() > 0) ? (_buffer.get() & 0xFF) : -1;\n }", "@Override\n public int read(byte[] byteBuffer) throws IOException {\n return this.read(byteBuffer, 0, byteBuffer.length);\n }", "@Test\n public void testWriteInt() {\n System.out.println(\"writeInt\");\n /** Positive testing. */\n // Positive value\n Long val = 42L;\n String expResult = \"i42e\";\n String result = Bencoder.writeInt(val);\n assertEquals(expResult, result);\n // Zerro value\n val = 0L;\n expResult = \"i0e\";\n result = Bencoder.writeInt(val);\n assertEquals(expResult, result);\n // Negative value\n val = -42L;\n expResult = \"i-42e\";\n result = Bencoder.writeInt(val);\n assertEquals(expResult, result);\n }", "@Override\n public int peekUnsignedByte(int offset) throws IOException\n {\n if (offset < 0)\n {\n throw new IOException(\"offset is negative\");\n }\n if (offset == 0)\n {\n return randomAccessRead.peek();\n }\n long currentPosition = randomAccessRead.getPosition();\n if (currentPosition + offset >= randomAccessRead.length())\n {\n throw new IOException(\"Offset position is out of range \" + (currentPosition + offset)\n + \" >= \" + randomAccessRead.length());\n }\n randomAccessRead.seek(currentPosition + offset);\n int peekValue = randomAccessRead.read();\n randomAccessRead.seek(currentPosition);\n return peekValue;\n }", "public abstract byte[] read() throws IOException, IllegalArgumentException , IllegalStateException;", "String intRead();", "public static int readInt()\n \n {\n int i=0;\n String wort=\"xxxx\";\n try {\n wort=eingabe.readLine();\n i=Integer.parseInt(wort) ;\n } catch(IOException e1) {\n System.out.println(\"Eingabefehler, bitte noch einmal!\");\n i=readInt();\n } catch(NumberFormatException e2) {\n if(wort.equals(\"\"))\n System.out.println(\"Bitte etwas eingeben, noch einmal:\");\n else {\n System.out.print(\"Fehler beim Format, \");\n System.out.println(\"bitte noch einmal!\");}\n i=readInt();\n }\n return i;\n }", "public abstract void read_octet_array(byte[] value, int offset, int\nlength);", "int readS16BE()\n throws IOException, EOFException;", "int getBytesRead() {\n \treturn _read + _o;\n }", "@Override\r\n\tpublic int getInt(int pos) {\n\t\treturn buffer.getInt(pos);\r\n\t}", "protected int _getInt(int index)\r\n/* 378: */ {\r\n/* 379:392 */ return HeapByteBufUtil.getInt(this.array, index);\r\n/* 380: */ }", "public int setBytes(int index, InputStream in, int length)\r\n/* 264: */ throws IOException\r\n/* 265: */ {\r\n/* 266:283 */ ensureAccessible();\r\n/* 267:284 */ return in.read(this.array, index, length);\r\n/* 268: */ }", "public int read() throws java.io.IOException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.conscrypt.OpenSSLBIOSource.ByteBufferInputStream.read():int, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.conscrypt.OpenSSLBIOSource.ByteBufferInputStream.read():int\");\n }", "private static int getIntFromByteArray(byte[] bytes)\r\n {\r\n int val = 0;\r\n for (int i=0; i<4; i++)\r\n {\r\n val = (val << 8) - Byte.MIN_VALUE + bytes[i];\r\n }\r\n return val;\r\n }", "@Override\n public int read() throws IOException {\n int r = -1;\n \n if (encryptedDataBuffer!=null && pos>=encryptedDataBuffer.length && !closed)\n fillBuffer();\n \n if (encryptedDataBuffer!=null && pos<encryptedDataBuffer.length)\n r = (int)encryptedDataBuffer[pos++]; // next element in the buffer\n return r;\n }", "public int fromByteArray(byte [] value, int start, int length)\n {\n int Return = 0;\n for (int i=start; i< start+length; i++)\n {\n Return = (Return << 8) + (value[i] & 0xff);\n }\n return Return;\n }", "public int readByte() {\n waitForData();\n try {\n return m_DataInputStream.readByte();\n }\n catch (IOException e) {\n return 256;\n }\n }", "@Override\n\tpublic int ReadByte()\n\t{\n//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:\n//ORIGINAL LINE: byte[] oneByteBuffer = new byte[1];\n\t\tbyte[] oneByteBuffer = new byte[1];\n\t\tint num = Read(oneByteBuffer, 0, 1);\n\t\tif (num <= 0)\n\t\t{\n\t\t\t// return -1 to indicate that no byte was read.\n\t\t\treturn -1;\n\t\t}\n\t\treturn oneByteBuffer[0];\n\t}", "public int read(byte[] b, int off, int len) throws IOException {\n\n\t\tif( len == 0 ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// look for presence or absence of root XML element \n\t\tif( ! m_lookedForRoot ) {\n\t\t\tlookForRootUsingRegex();\n\t\t}\n\n\t\t// check if unread data is present in the byte array buffer\n\t\tif( m_readIndex < m_numBites ) {\n\t\t\t// unread data in the buffer - read from it\n\t\t\tint xferCount = Math.min(len, (m_numBites-m_readIndex));\n\t\t\tSystem.arraycopy(m_bites, m_readIndex, b, off, xferCount);\n\t\t\t\n//\t\t\tSystem.out.println(\"ashish debug: \" + new String(b, off, xferCount));\n\t\t\t\n\t\t\tm_readIndex += xferCount;\n\t\t\treturn xferCount;\n\t\t}\n\n\t\t// buffer is empty. go ahead and read from stream\n\t\tint numRead2 = super.read(b, off, len);\n\t\tif( numRead2 < 0 ) {\n\n\t\t\t// check if corresponding end of XML root element needs to be added\n\t\t\tif( m_rootElementAdded && m_endCurlyBraceNeeded && ! m_sentRootElementSuffix ) {\n\t\t\t\tm_sentRootElementSuffix = true;\n\t\t\t\tb[off] = '}';\n\n\t\t\t\t//System.out.println(\"ashish debug: \" + new String(b, off, 1));\n\t\t\t\t\n\t\t\t\treturn 1;\n\t\t\t} else {\n\t\t\t\t// EOS\n\t\t\t\treturn numRead2;\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t//System.out.println(\"ashish debug: \" + new String(b, off, numRead2));\n\t\t\t\n\t\t\t// return the number of bytes read\n\t\t\treturn numRead2;\n\t\t}\n\n\t}", "public int readInt() {\n return Integer.parseInt(readNextLine());\n }", "public static int readInt(){\n\t\tSystem.out.println();\n\t\tstringInput = readInput();\n\t\ttry{\n\t\t\tintInput = Integer.parseInt(stringInput);\n\t\t}\n\t\tcatch (NumberFormatException ex) {\n\t\t System.err.println(\"Not a valid number: \" + stringInput);\n\t\t}\n\t\treturn intInput; \t\t\n\t}", "public int readUnsignedByte() throws IOException {\n\t\treturn read() | 0x00ff;\n\t}", "public int readIntLE()\r\n/* 841: */ {\r\n/* 842:850 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 843:851 */ return super.readIntLE();\r\n/* 844: */ }", "public int readInt() {\n\t\tif(!isInit) return 0;\n\t\tint result = 0;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Integer input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Integer.parseInt(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult = 0;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "public static int readNumberFromBytes(byte[] data) {\n return readNumberFromBytes(data, data.length, 0);\n }", "public abstract int parse(byte bc[], int index);", "public void read(int param1, byte[] param2, int param3, int param4) {\n }", "@Override\n\tpublic int read() {\n\t\treturn super.read();\n\t}", "@Override\n\tpublic int read() throws IOException {\n\t\tif (buf.isReadable()) {\n return buf.readByte() & 0xff;\n }\n return -1;\n\t}", "static int fromArray(byte[] payload) {\n return payload[0] << 24 | (payload[1] & 0xFF) << 16 | (payload[2] & 0xFF) << 8 | (payload[3] & 0xFF);\n }", "public static int bytesToInt(byte[] bytes,int offset,int length) {\n ByteBuffer byteBuffer = ByteBuffer.wrap(bytes,offset,length);\n return byteBuffer.getInt();\n\n }", "public interface BSSReaderIntegerSignedType\n{\n /**\n * Read an 8-bit signed integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS8()\n throws IOException, EOFException;\n\n /**\n * Read an 16-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS16LE()\n throws IOException, EOFException;\n\n /**\n * Read an 32-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS32LE()\n throws IOException, EOFException;\n\n /**\n * Read a 64-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS64LE()\n throws IOException, EOFException;\n\n /**\n * Read a 16-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS16BE()\n throws IOException, EOFException;\n\n /**\n * Read a 32-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS32BE()\n throws IOException, EOFException;\n\n /**\n * Read a 64-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS64BE()\n throws IOException, EOFException;\n\n /**\n * Read an 8-bit signed integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS8(String name)\n throws IOException, EOFException;\n\n /**\n * Read an 16-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS16LE(String name)\n throws IOException, EOFException;\n\n /**\n * Read an 32-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS32LE(String name)\n throws IOException, EOFException;\n\n /**\n * Read a 64-bit signed, little-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS64LE(String name)\n throws IOException, EOFException;\n\n /**\n * Read a 16-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n int readS16BE(String name)\n throws IOException, EOFException;\n\n /**\n * Read a 32-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS32BE(String name)\n throws IOException, EOFException;\n\n /**\n * Read a 64-bit signed, big-endian integer.\n *\n * The reader will not be allowed to read beyond the specified limit.\n *\n * @param name The name of the value to be used in diagnostic messages\n *\n * @return The resulting integer value\n *\n * @throws IOException On I/O errors, or if an attempt is made to seek or read beyond the\n * reader's limit\n * @throws EOFException If EOF is reached\n */\n\n long readS64BE(String name)\n throws IOException, EOFException;\n}", "public int readIntNonBlock() {\n return ((int) readLongNonBlock());\n }", "public int read() throws IOException {\n ensureOpen();\n return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]);\n }", "private int byteToInt(byte b) { int i = b & 0xFF; return i; }", "public int read() {\n return (readInt());\n }" ]
[ "0.75508744", "0.7506736", "0.7473555", "0.7360468", "0.73205227", "0.72769195", "0.71859086", "0.67575693", "0.66572624", "0.6574897", "0.6501611", "0.6494305", "0.6483901", "0.6439552", "0.63578975", "0.633947", "0.6315079", "0.6179011", "0.6176423", "0.6172848", "0.6157396", "0.6144243", "0.6143213", "0.61403453", "0.61258465", "0.6116287", "0.6115521", "0.61005557", "0.60913485", "0.6082023", "0.596467", "0.595856", "0.5951504", "0.59424084", "0.5927241", "0.59246355", "0.5923365", "0.5919173", "0.5918978", "0.5916539", "0.5905115", "0.5903109", "0.5893273", "0.58853304", "0.5884171", "0.5883274", "0.58610016", "0.58454895", "0.5839149", "0.5830797", "0.58158207", "0.58123565", "0.5794988", "0.57778734", "0.5776004", "0.5775707", "0.57399863", "0.57184136", "0.57160264", "0.5706384", "0.56925166", "0.56859446", "0.5667018", "0.5658269", "0.56477314", "0.56471574", "0.5635822", "0.5633793", "0.56247467", "0.56199455", "0.561688", "0.55947554", "0.55903167", "0.5581905", "0.55803716", "0.55786175", "0.5557097", "0.55535656", "0.5552557", "0.55382746", "0.5533219", "0.5532229", "0.55268735", "0.5507754", "0.5499876", "0.5493712", "0.54885274", "0.5473167", "0.5462402", "0.5461447", "0.54459536", "0.5442116", "0.5437593", "0.543605", "0.54359853", "0.5429217", "0.5402507", "0.5398386", "0.538752", "0.53837603" ]
0.7506063
2
Test of readLong method, of class ByteArray.
@Test public void testReadWriteLong() { System.out.println("readLong"); ByteArray instance = new ByteArray(); instance.writeLong(12, 0); instance.writeLong(12345678, 8); instance.writeLong(13, instance.compacity()); assertEquals(12, instance.readLong(0)); assertEquals(12345678, instance.readLong(8)); assertEquals(13, instance.readLong(instance.compacity() - 8)); instance.writeLong(14, 8); assertEquals(14, instance.readLong(8)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long readLong() throws IOException;", "public long readLong() throws IOException;", "public abstract int read_long();", "long readLong();", "private synchronized long readLong(int len) throws IOException {\n\t\tread(bytes, len);\n\t\treturn readLong(bytes, 0, len);\n\t}", "public abstract long read_longlong();", "@Test\n\tpublic void testTooLargeValueBinaryReaderStreamPosition() throws IOException {\n\n\t\tbyte[] bytes =\n\t\t\tbytes(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x1, 0x2);\n\t\tInputStream is = is(bytes);\n\n\t\ttry {\n\t\t\tlong value = LEB128.read(is, false);\n\t\t\tAssert.fail(\n\t\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\t\tLong.toUnsignedString(value));\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\t// good\n\t\t}\n\n\t\tAssert.assertEquals(bytes.length - 10, is.available());\n\t}", "public abstract long read_ulonglong();", "String longRead();", "public long readLong() throws IOException {\n return in.readLong();\n }", "private long getLong() {\n longBuffer.rewind();\n archive.read(longBuffer);\n longBuffer.flip();\n return longBuffer.getLong();\n }", "private long read_long(MappedByteBuffer buff) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (buff.get() & 0xFF)) << (8 * i);\n }\n return number;\n }", "int read(long pos, byte[] buf)throws IOException;", "@Test(expected = IOException.class)\n\tpublic void testToolargeUnsigned() throws IOException {\n\t\tInputStream is = is(0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02);\n\n\t\tlong value = LEB128.read(is, false);\n\t\tAssert.fail(\n\t\t\t\"Should not be able to read a LEB128 that is larger than what can fit in java 64bit long int: \" +\n\t\t\t\tvalue);\n\t}", "public long readLong()\r\n/* 435: */ {\r\n/* 436:448 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 437:449 */ return super.readLong();\r\n/* 438: */ }", "public long[] read();", "long readS64BE()\n throws IOException, EOFException;", "public long readLongNonBlock() {\n Timing.throughputLocal(0);\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }", "long readS64LE()\n throws IOException, EOFException;", "private long read_long(RandomAccessFile file) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (file.readByte() & 0xFF)) << (8 * i);\n }\n return number;\n }", "public long readLong() {\n while (isEmpty()) {\n }\n Timing.waitSyncLocal();\n readEnable.setNow(1);\n Timing.waitClockLocal();\n return (readData.getLong());\n }", "public byte[] readRawLong() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.LONG.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }", "public static long readLong(byte[] source, int position) {\n return makeLong(source[position], source[position + 1], source[position + 2], source[position + 3],\n source[position + 4], source[position + 5], source[position + 6], source[position + 7]);\n }", "public static long read(byte[] buffer, long offset, long length) {\n offset =0;\n long result = 0 ;\n int shift_count = 0 ;\n\n while ( length -- > 0 ) {\n int temp = buffer[(int) offset++] & 0xFF;\n result |= temp << shift_count ;\n shift_count += 8;\n }\n return(result);\n }", "public abstract void read_long_array(int[] value, int offset, int\nlength);", "public static long readlong()\n\t{\n\t\treturn sc.nextLong();\n\t}", "public abstract void read_longlong_array(long[] value, int offset, int\nlength);", "public long readLongLE()\r\n/* 853: */ {\r\n/* 854:862 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 855:863 */ return super.readLongLE();\r\n/* 856: */ }", "long fetch64(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readLong(off);\n }", "public int read(long[] l) throws IOException {\n\t\treturn read(l, 0, l.length);\n\t}", "public abstract int read_ulong();", "public void testGetLongLE() {\n byte[] array = new byte[] {\n 0x78, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,\n -0x1, -0x1, -0x1, -0x1, -0x1, -0x1, -0x1, 0x7F\n };\n // end::noformat\n BytesReference ref = new BytesArray(array, 0, array.length);\n assertThat(ref.getLongLE(0), equalTo(888L));\n assertThat(ref.getLongLE(8), equalTo(Long.MAX_VALUE));\n Exception e = expectThrows(ArrayIndexOutOfBoundsException.class, () -> ref.getLongLE(9));\n assertThat(e.getMessage(), equalTo(\"Index 9 out of bounds for length 9\"));\n }", "public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);", "@Override\r\n\tpublic long getLong(int pos) {\n\t\treturn buffer.getLong(pos);\r\n\t}", "public void testValueOfLong()\n {\n // let's test that creating a EthernetAddress from an zero long\n // gives a null EthernetAddress (definition of a null EthernetAddress)\n EthernetAddress ethernet_address =\n EthernetAddress.valueOf(0x0000000000000000L);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // let's test creating an array from a good long\n ethernet_address =\n EthernetAddress.valueOf(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\n \"EthernetAddress.valueOf did not create expected EthernetAddress\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }", "public String getLong(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\tString[] array = dataBase.readLine().split(\"\\\\|\");\n\t\treturn array[8];\n\t}", "public int read(long[] l, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\tl[i] = ((long) i1) << 32 | ((long) i2 & 0x00000000FFFFFFFFL);\n\t\t\t\tpos += 8;\n\t\t\t}\n\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}", "int read(byte[] buffer, int bufferOffset, int length) throws IOException;", "@Override\n\tpublic int decode(byte[] buffer, int offset) throws IOException {\n\t\tlong value = NeuronReader.readRawInt64(buffer, offset);\n\t\tunionCache.setLong(fieldIndex, value);\n\n\t\treturn NeuronReader.LONG_SIZE;\n\t}", "long decodeLong();", "protected long _getLong(int index)\r\n/* 400: */ {\r\n/* 401:414 */ return HeapByteBufUtil.getLong(this.array, index);\r\n/* 402: */ }", "public static long getLong(final byte[] buffer, final int index, final int len) {\n switch (len) {\n case 0: return 0xFFFFFFFF_FFFFFFFFL;\n case 1: return 0xFFFFFFFF_FFFFFF00L | _getByte(buffer, index, 1);\n case 2: return 0xFFFFFFFF_FFFF0000L | _getShort(buffer, index, 2);\n case 3: return 0xFFFFFFFF_FF000000L | _getInt(buffer, index, 3);\n case 4: return 0xFFFFFFFF_00000000L | _getInt(buffer, index, 4);\n case 5: return 0xFFFFFF00_00000000L | _getLong(buffer, index, 5);\n case 6: return 0xFFFF0000_00000000L | _getLong(buffer, index, 6);\n case 7: return 0xFF000000_00000000L | _getLong(buffer, index, 7);\n case 8: return _getLong(buffer, index, 8);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }", "private long getNumberBufAsLong(ByteOrder byteOrder, int nrReadBytes,\n int firstBytePos) {\n\n long result = 0L;\n long bytePortion = 0L;\n for (int i = 0; i < nrReadBytes; i++) {\n bytePortion = 0xFF & (byteBuffer.get(firstBytePos++));\n\n if (byteOrder == ByteOrder.LittleEndian)\n // reshift bytes\n result = result | bytePortion << (i << 3);\n else\n result = bytePortion << ((nrReadBytes - i - 1) << 3) | result;\n }\n\n return result;\n }", "public int read(byte[] b, int off, int len) throws IOException {\n/* 232 */ if (b == null) {\n/* 233 */ throw new NullPointerException();\n/* */ }\n/* 235 */ if (off < 0 || len < 0 || off + len > b.length) {\n/* 236 */ throw new IndexOutOfBoundsException();\n/* */ }\n/* 238 */ if (len == 0) {\n/* 239 */ return 0;\n/* */ }\n/* */ \n/* 242 */ long pos = readUntil(this.pointer + len);\n/* */ \n/* 244 */ if (pos <= this.pointer) {\n/* 245 */ return -1;\n/* */ }\n/* */ \n/* 248 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* 249 */ int nbytes = Math.min(len, 512 - (int)(this.pointer & 0x1FFL));\n/* 250 */ System.arraycopy(buf, (int)(this.pointer & 0x1FFL), b, off, nbytes);\n/* */ \n/* 252 */ this.pointer += nbytes;\n/* 253 */ return nbytes;\n/* */ }", "long readS32LE()\n throws IOException, EOFException;", "public long readAsLong(int nrBits) {\n return readAsLong(bitPos, nrBits, ByteOrder.BigEndian);\n }", "public final long getLong(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (tmpLong);\r\n }", "long readS32BE()\n throws IOException, EOFException;", "public long readRawVarint64() throws java.io.IOException {\n /*\n r9 = this;\n int r0 = r9.bufferPos\n int r1 = r9.bufferSize\n if (r1 != r0) goto L_0x0008\n goto L_0x00b8\n L_0x0008:\n byte[] r2 = r9.buffer\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r9.bufferPos = r3\n long r0 = (long) r0\n return r0\n L_0x0014:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x001b\n goto L_0x00b8\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n long r3 = (long) r0\n r5 = 0\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x002f\n r5 = -128(0xffffffffffffff80, double:NaN)\n L_0x002b:\n long r2 = r3 ^ r5\n goto L_0x00bf\n L_0x002f:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n long r7 = (long) r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0042\n r1 = 16256(0x3f80, double:8.0315E-320)\n L_0x003d:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bf\n L_0x0042:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n int r0 = r0 << 21\n long r7 = (long) r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0052\n r5 = -2080896(0xffffffffffe03f80, double:NaN)\n goto L_0x002b\n L_0x0052:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 28\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0063\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n goto L_0x003d\n L_0x0063:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 35\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0076\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n goto L_0x002b\n L_0x0076:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 42\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0089\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x003d\n L_0x0089:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 49\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x009c\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x002b\n L_0x009c:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 56\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n r7 = 71499008037633920(0xfe03f80fe03f80, double:6.838959413692434E-304)\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 >= 0) goto L_0x00bd\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n int r0 = (r7 > r5 ? 1 : (r7 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x00be\n L_0x00b8:\n long r0 = r9.readRawVarint64SlowPath()\n return r0\n L_0x00bd:\n r1 = r0\n L_0x00be:\n r2 = r3\n L_0x00bf:\n r9.bufferPos = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.jvm.internal.impl.protobuf.CodedInputStream.readRawVarint64():long\");\n }", "long readS64LE(String name)\n throws IOException, EOFException;", "long readS64BE(String name)\n throws IOException, EOFException;", "public long getReadPointer();", "public static long byteArrayToLong(byte[] ba, int offset) {\n long value = 0;\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n value = (value << 8) | (ba[offset++] & 0xFF);\n return value;\n }", "public long readVarLong() throws IOException {\n final int type = (int) this.read(2).toLong();\n return this.read(BitOutputStream.varLongDepths[type]).toLong();\n }", "@Test\n public void test_GetLong() {\n Assert.assertEquals(\"Values werent the same\", 1234567890987654321L, SecureEnvironment.getLong(\"test_key_long\"));\n }", "public long readLong() {\n\t\tif(!isInit) return 0L;\n\t\tlong result = 0L;\n\t\tisListening = true;\n\t\twriteLine(\"Waiting for Long input...\");\n\t\twhile(isListening) {\n\t\t\ttry {\n\t\t\t\tresult = Long.parseLong(inputArea.getText());\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\tresult= 0L;\n\t\t\t}\n\t\t}\n\t\tinputArea.setText(\"\");\n\t\twriteLine(\"Input: \" + result);\n\t\treturn result;\n\t}", "public void testGetUnsignedLong() throws Exception {\n ByteBuffer bb = ByteBuffer.allocate(8);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.position(0);\n bb.limit(8);\n BigInteger bi = Unsigned.getUnsignedLong(bb);\n BigInteger uLongMax = new BigInteger(ULONG_MAX);\n for (int i = 0; i < uLongMax.bitCount(); ++i) {\n Assert.assertTrue(\"Bit: \" + i + \" should be: \" + uLongMax.testBit(i),\n uLongMax.testBit(i) == bi.testBit(i));\n }\n Assert.assertEquals(ULONG_MAX, bi.toString());\n\n bb = ByteBuffer.allocate(10);\n bb.put((byte)0x00);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0x00);\n bb.position(0);\n bb.limit(10);\n bi = Unsigned.getUnsignedLong(bb, 1);\n uLongMax = new BigInteger(ULONG_MAX);\n for (int i = 0; i < uLongMax.bitCount(); ++i) {\n Assert.assertTrue(\"Bit: \" + i + \" should be: \" + uLongMax.testBit(i),\n uLongMax.testBit(i) == bi.testBit(i));\n }\n Assert.assertEquals(ULONG_MAX, bi.toString());\n }", "public int read(byte[] p_bytes, int p_offset, int p_length);", "public static final long readLong(InputStream in) throws IOException {\n byte[] buff = new byte[8];\n StreamTool.readFully(in, buff);\n return getLong(buff, 0);\n }", "@Override\n\tpublic long readScalarLong() throws IOException {\n\t\treturn 0;\n\t}", "public long readRawVarint64SlowPath() throws IOException {\n long j = 0;\n for (int i = 0; i < 64; i += 7) {\n byte readRawByte = readRawByte();\n j |= ((long) (readRawByte & ByteCompanionObject.MAX_VALUE)) << i;\n if ((readRawByte & ByteCompanionObject.MIN_VALUE) == 0) {\n return j;\n }\n }\n throw InvalidProtocolBufferException.malformedVarint();\n }", "@Override // okio.Source\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public long read(okio.Buffer r13, long r14) throws java.io.IOException {\n /*\n // Method dump skipped, instructions count: 124\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.internal.http2.Http2Stream.FramingSource.read(okio.Buffer, long):long\");\n }", "@JRubyMethod(meta = true, required = 1, optional = 2, compat = RUBY1_9)\n public static IRubyObject binread(ThreadContext context, IRubyObject recv, IRubyObject[] args) {\n IRubyObject nil = context.getRuntime().getNil();\n IRubyObject path = args[0];\n IRubyObject length = nil;\n IRubyObject offset = nil;\n Ruby runtime = context.runtime;\n \n if (args.length > 2) {\n offset = args[2];\n length = args[1];\n } else if (args.length > 1) {\n length = args[1];\n }\n RubyIO file = (RubyIO)RuntimeHelpers.invoke(context, runtime.getFile(), \"new\", path, runtime.newString(\"rb:ASCII-8BIT\"));\n \n try {\n if (!offset.isNil()) file.seek(context, offset);\n return !length.isNil() ? file.read(context, length) : file.read(context);\n } finally {\n file.close();\n }\n }", "public static int readNumberFromBytes(byte[] data, int readSize, int startIndex) {\n int value = 0;\n for (int i = 0; i < readSize; i++)\n value += ((long) data[startIndex + i] & 0xFFL) << (Constants.BITS_PER_BYTE * i);\n return value;\n }", "@Override\n public int read(byte[] b, int off, int len) throws IOException\n {\n try\n {\n byte [] buff = fAVMRemote.readInput(fTicketHolder.getTicket(), fHandle, len);\n if (buff.length == 0)\n {\n return -1;\n }\n System.arraycopy(buff, 0, b, off, buff.length);\n return buff.length;\n }\n catch (Exception e)\n {\n throw new IOException(\"Remote I/O Error.\");\n }\n }", "void writeLong(long v) throws IOException;", "protected int read(byte[] buffer, int offset, int length) throws IOException {\n return mTiffStream.read(buffer, offset, length);\n }", "public int read() throws IOException {\n/* 173 */ long next = this.pointer + 1L;\n/* 174 */ long pos = readUntil(next);\n/* 175 */ if (pos >= next) {\n/* 176 */ byte[] buf = this.data.get((int)(this.pointer >> 9L));\n/* */ \n/* 178 */ return buf[(int)(this.pointer++ & 0x1FFL)] & 0xFF;\n/* */ } \n/* 180 */ return -1;\n/* */ }", "public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }", "public long readUnsignedInt()\r\n/* 429: */ {\r\n/* 430:442 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 431:443 */ return super.readUnsignedInt();\r\n/* 432: */ }", "public int read(byte b[], int off, int len) throws IOException {\n int result = super.read(b, off, len);\n if(iMaxSet) {\n if(result >= 0) {\n iRemainder -= result;\n }\n } else {\n iRemainder = available();\n }\n return result;\n }", "@Test\n public void testReadWriteInt() {\n System.out.println(\"readInt\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(1234, 4);\n instance.writeInt(13, instance.compacity());\n \n assertEquals(12, instance.readInt(0));\n assertEquals(1234, instance.readInt(4));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n \n instance.writeInt(14, 4);\n assertEquals(14, instance.readInt(4));\n }", "public int read(byte[] b, int off, int len) {\n int ret = 0;\n int tmp;\n while((tmp = readChunkSize(len-ret)) > 0) {\n data.getFirst().get(b, off+ret, tmp);\n ret += tmp;\n updateBufferList();\n }\n return ret;\n }", "@Override\n protected long read0(long addr, @Positive long length) throws IOException {\n int count = toInt(min(this.delegate.remaining(), length));\n if (count <= 0) {\n return RESULT_EOF;\n }\n\n //we don't have direct access to the array, so we'll have to fall back to copying one byte at a time\n // (JIT might be smart enough to optimize this into a sequential memory copy, but don't bank on it - that's why we have ArrayHeapBufferIn)\n int position = PNioBuffers.skipForRead(this.delegate, count);\n for (int i = 0; i < count; i++) {\n PUnsafe.putByte(addr + i, this.delegate.get(position + i));\n }\n\n return count;\n }", "public void testToLong()\n {\n // test making a couple EthernetAddresss and then check that the toLong\n // gives back the same value in long form that was used to create it\n \n // test the null EthernetAddress\n EthernetAddress ethernet_address = new EthernetAddress(0L);\n assertEquals(\"null EthernetAddress long and toLong did not match\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // test a non-null EthernetAddress\n ethernet_address =\n new EthernetAddress(VALID_ETHERNET_ADDRESS_BYTE_ARRAY);\n assertEquals(\"EthernetAddress long and toLong results did not match\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }", "int getBytesRead() {\n \treturn _read + _o;\n }", "public abstract byte[] readData(int address, int length);", "public void read(long address, ByteBuffer destination)\n {\n tryRead(address, destination);\n }", "static void read(DataInputStream f, byte[] b, int posicion, int longitud) throws Exception {\n while (longitud > 0) {\n int n = f.read(b, posicion, longitud);\n posicion += n;\n longitud -= n;\n }\n }", "public long getLong(int index)\r\n/* 394: */ {\r\n/* 395:408 */ ensureAccessible();\r\n/* 396:409 */ return _getLong(index);\r\n/* 397: */ }", "int readNonBlocking(byte[] buffer, int offset, int length);", "@Override\n\tpublic int read(byte[] b, int off, int len) {\n\t\treturn super.read(b, off, len);\n\t}", "public long readUnsignedIntLE()\r\n/* 847: */ {\r\n/* 848:856 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 849:857 */ return super.readUnsignedIntLE();\r\n/* 850: */ }", "@Test\n public void testmagicNumbersForBigDataset() {\n try (FileInputStream inImage = new FileInputStream(INPUT_IMAGE_PATH);\n FileInputStream inLabel = new FileInputStream(INPUT_LABEL_PATH)) {\n\n //==========================================================================================================\n // it reads the next byte of data (8 bits) then put them to left side of an int\n // so the int is 32 bit is fully filled at the end of logic\n // and it moves the cursor to a position after first 32 bits (4 bytes)\n System.out.println(\"Available bytes before read: \" + inImage.available());//47040016\n int magicNumberImages = (inImage.read() << 24) | (inImage.read() << 16) | (inImage.read() << 8) | (inImage.read());\n int numberOfImages = (inImage.read() << 24) | (inImage.read() << 16) | (inImage.read() << 8) | (inImage.read());\n int numberOfRows = (inImage.read() << 24) | (inImage.read() << 16) | (inImage.read() << 8) | (inImage.read());\n int numberOfColumns = (inImage.read() << 24) | (inImage.read() << 16) | (inImage.read() << 8) | (inImage.read());\n\n assertTrue(magicNumberImages == 2051);\n assertTrue(numberOfImages == 60000);\n assertTrue(numberOfRows == 28);\n assertTrue(numberOfColumns == 28);\n\n //the same as inImage.skip(16);\n System.out.println(\"Available bytes after read: \" + inImage.available());//47040000\n\n //==========================================================================================================\n // it reads the next byte of data (8 bits) then put them to left side of an int\n // so the int is 32 bit is fully filled at the end of logic\n // and it moves the cursor to a position after first 32 bits (4 bytes)\n System.out.println(\"Available bytes before read: \" + inLabel.available()); //60008\n int magicNumberLabels = (inLabel.read() << 24) | (inLabel.read() << 16) | (inLabel.read() << 8) | (inLabel.read());\n int numberOfLabels = (inLabel.read() << 24) | (inLabel.read() << 16) | (inLabel.read() << 8) | (inLabel.read());\n assertTrue(magicNumberLabels == 2049);\n assertTrue(numberOfLabels == 60000);\n\n System.out.println(\"Available bytes after read: \" + inLabel.available()); //60000\n //the same as inLabel.skip(8);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public int read(long addr) {\n\t\treturn findBlock(addr);\n\t}", "private static long getLongLittleEndian(byte[] buf, int offset) {\n return ((long) buf[offset + 7] << 56) | ((buf[offset + 6] & 0xffL) << 48)\n | ((buf[offset + 5] & 0xffL) << 40) | ((buf[offset + 4] & 0xffL) << 32)\n | ((buf[offset + 3] & 0xffL) << 24) | ((buf[offset + 2] & 0xffL) << 16)\n | ((buf[offset + 1] & 0xffL) << 8) | ((buf[offset] & 0xffL));\n }", "public String getSrcLong(long offset) throws IOException {\n\t\tdataBase.seek(offset);\n\t\tString[] array = dataBase.readLine().split(\"\\\\|\");\n\t\treturn array[11];\n\t}", "public int read(byte[] bytes, int offset, int lenght) throws FTD2XXException {\n Memory memory = new Memory(lenght);\n IntByReference read = new IntByReference();\n\n ensureFTStatus(ftd2xx.FT_Read(ftHandle, memory, lenght, read));\n\n memory.read(0, bytes, offset, lenght);\n\n return read.getValue();\n }", "public void testLongEthernetAddressConstructor()\n {\n // let's test that creating a EthernetAddress from an zero long\n // gives us a null EthernetAddress (definition of null EthernetAddress)\n EthernetAddress ethernet_address =\n new EthernetAddress(0x0000000000000000L);\n assertEquals(\n \"EthernetAddress(long) did not create expected EthernetAddress\",\n NULL_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n \n // let's test creating an array from a good long\n ethernet_address = new EthernetAddress(VALID_ETHERNET_ADDRESS_LONG);\n assertEquals(\n \"EthernetAddress(long) did not create expected EthernetAddress\",\n VALID_ETHERNET_ADDRESS_LONG,\n ethernet_address.toLong());\n }", "int readFrom(byte[] iStream, int pos, ORecordVersion version);", "public synchronized int read(byte[] b, int off, int len)\n throws IOException {\n if (in == null) {\n throw new IOException(\"Stream Closed\");\n }\n if (len == 0) {\n return 0;\n }\n if (encoding == null) {\n return castingRead(b, off, len);\n }\n while (slack == null) {\n char[] buf = new char[len]; // might read too much\n int n = in.read(buf);\n if (n == -1) {\n\treturn -1;\n }\n if (n > 0) {\n\tslack = new String(buf, 0, n).getBytes(encoding);\n\tbegin = 0;\n }\n }\n\n if (len > slack.length - begin) {\n len = slack.length - begin;\n }\n\n System.arraycopy(slack, begin, b, off, len);\n\n if ((begin += len) >= slack.length) {\n slack = null;\n }\n\n return len;\n }", "public ByteBuf writeLongLE(long value)\r\n/* 877: */ {\r\n/* 878:886 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 879:887 */ return super.writeLongLE(value);\r\n/* 880: */ }", "protected long _getLongLE(int index)\r\n/* 411: */ {\r\n/* 412:425 */ return HeapByteBufUtil.getLongLE(this.array, index);\r\n/* 413: */ }", "public native long __longMethod( long __swiftObject, long arg );", "private long byteToLong(byte b)\n\t{\n\t\treturn (b & 0xFF);\n\t}", "@Test\n void testReadIntPacked() throws IOException {\n byte[] input = new byte[]{(byte) 0x35, (byte) 0x54};\n r = new BitReader(input);\n assertEquals(5402, r.readIntPacked());\n }", "public static native int nativeAssetRead(long j, byte[] bArr, int i, int i2);", "@Override\n public long applyAsLong(BytesStore bytes) {\n return applyAsLong(bytes, bytes.readRemaining());\n }", "@Test\n public void testFromLong() throws Exception {\n assertEquals(\"1 a\", undertest2.fromLong(0));\n // 0b100 => 0b10->1->\"2\", 0b0->0->\"a\"\n assertEquals(\"2 a\", undertest2.fromLong(1));\n // 0b010 => 0b01->2->\"3\", 0b0->0->\"a\"\n assertEquals(\"3 a\", undertest2.fromLong(2));\n // 0b110 => 0b11->3->\"4\", 0b0->0->\"a\"\n assertEquals(\"4 a\", undertest2.fromLong(3));\n // 0b001 => 0b00->0->\"1\", 0b1->1->\"b\"\n assertEquals(\"1 b\", undertest2.fromLong(4));\n // 0b101 => 0b10->1->\"2\", 0b1->1->\"b\"\n assertEquals(\"2 b\", undertest2.fromLong(5));\n // 0b011 => 0b01->2->\"3\", 0b1->1->\"b\"\n assertEquals(\"3 b\", undertest2.fromLong(6));\n // 0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(7));\n // 255l->0b11111111->0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(255));\n }", "public int readBytes(FileChannel out, long position, int length)\r\n/* 903: */ throws IOException\r\n/* 904: */ {\r\n/* 905:910 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 906:911 */ return super.readBytes(out, position, length);\r\n/* 907: */ }" ]
[ "0.7754086", "0.7552178", "0.7509418", "0.74263453", "0.7249162", "0.7098889", "0.69285816", "0.6925501", "0.6880697", "0.6818726", "0.67910856", "0.67692494", "0.67093015", "0.6643347", "0.6641937", "0.66151553", "0.66042966", "0.6550096", "0.65366", "0.65217805", "0.6516471", "0.6493866", "0.64455634", "0.64454824", "0.63784957", "0.6363557", "0.6325839", "0.62987256", "0.62925243", "0.6288091", "0.62865746", "0.6245866", "0.61805356", "0.6146799", "0.61241895", "0.61170644", "0.61152184", "0.6092293", "0.60649306", "0.6037925", "0.603361", "0.6022755", "0.59638476", "0.5949017", "0.5922791", "0.590076", "0.5884434", "0.58806884", "0.5877825", "0.5865766", "0.5861895", "0.5860821", "0.58442307", "0.58406097", "0.5837145", "0.5803745", "0.579666", "0.57846385", "0.57684475", "0.5721904", "0.572057", "0.5714939", "0.5707369", "0.56953126", "0.5676046", "0.5665715", "0.565891", "0.56527954", "0.56475097", "0.56295896", "0.56238997", "0.56210506", "0.5620598", "0.5614802", "0.5612283", "0.5609289", "0.56016386", "0.5595391", "0.5594013", "0.5580834", "0.5576211", "0.5574944", "0.55705804", "0.5570199", "0.55677325", "0.55674994", "0.5559284", "0.55515", "0.55379015", "0.5536163", "0.55193686", "0.55139095", "0.5513135", "0.55125964", "0.5509834", "0.55074966", "0.55039465", "0.54877335", "0.54830295", "0.54676366" ]
0.7840849
0
Test of insert method, of class ByteArray.
@Test public void testInsert() { System.out.println("insert"); ByteArray instance = new ByteArray(); instance.writeInt(12, 0); instance.writeInt(15, 4); instance.writeInt(13, instance.compacity()); instance.insert("hello".getBytes(), 4); byte[] dest = new byte["hello".getBytes().length]; instance.read(dest, 4); assertEquals(12, instance.readInt(0)); assertEquals("hello", new String(dest)); assertEquals(15, instance.readInt(4 + "hello".getBytes().length)); assertEquals(13, instance.readInt(instance.compacity() - 4)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testInsertSome() {\n System.out.println(\"insertSome\");\n ByteArray instance = new ByteArray();\n \n instance.writeInt(12, 0);\n instance.writeInt(15, 4);\n instance.writeInt(13, instance.compacity());\n \n instance.insertSome(\"hello\".getBytes(), 0, 4);\n \n byte[] dest = new byte[\"hello\".getBytes().length];\n instance.read(dest, 0);\n \n assertEquals(\"hello\", new String(dest));\n assertEquals(15, instance.readInt(5));\n assertEquals(13, instance.readInt(instance.compacity() - 4));\n }", "public void testInsert() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "static boolean testInsert() {\n BinaryTree tree = new BinaryTree();\n int[] profile = new int[1];\n\n // Implement insert method\n boolean insert = tree.insert(\"a\", 0);\n\n // Validates that insert works as expected\n if(!insert)\n return false;\n\n // Validates that insert works with multiple items\n boolean newInsert = tree.insert(\"b\", 1);\n if(!insert || !newInsert)\n return false;\n\n // Validates that values are in binaryTree\n if(tree.search(\"a\", profile) != 0 || tree.search(\"b\", profile) != 1)\n return false;\n\n // Validates that value is overwritten if same key is present\n tree.insert(\"a\", 3);\n if(tree.search(\"a\", profile) != 3)\n return false;\n\n // Validates that profile is as expected\n if(profile[0] <= 0)\n return false;\n\n return true;\n }", "int insert(TDwBzzxBzflb record);", "int insert(ZlnfBiZzdkZzdkWithBLOBs record);", "int insert(DictDoseUnit record);", "void add(byte[] element);", "@Test\n public void testInsert() {\n // Define a HashMap to insert and another one for the comparison operation.\n HashMap<String, String> insertValue = RiakKVClientTest.createExpectedHashMap(RiakKVClientTest.recordsToInsert);\n HashMap<String, ByteIterator> readValue = new HashMap<>();\n // Check whether the insertion transaction was performed or not.\n Assert.assertEquals(\"Insert transaction FAILED.\", OK, RiakKVClientTest.riakClient.insert(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(RiakKVClientTest.recordsToInsert))), StringByteIterator.getByteIteratorMap(insertValue)));\n // Finally, compare the insertion performed with the one expected by reading the key.\n Assert.assertEquals(\"Insert test FAILED. Unable to read inserted value.\", OK, RiakKVClientTest.riakClient.read(RiakKVClientTest.bucket, ((RiakKVClientTest.keyPrefix) + (Integer.toString(RiakKVClientTest.recordsToInsert))), null, readValue));\n Assert.assertEquals(\"Insert test FAILED. Actual read transaction value is NOT MATCHING the inserted one.\", insertValue.toString(), readValue.toString());\n }", "int insert(XxAreaWithBLOBs record);", "@Override\n\tpublic int insert(Object ob) {\n\t\treturn 0;\n\t}", "@Test\n public void testWriteByteArray() {\n System.out.println(\"writeByteArray\");\n /** Positive testing. */\n String bytes = \"spam\";\n String expResult = \"4:spam\";\n String result = Bencoder.writeByteArray(bytes.getBytes(BConst.ASCII));\n assertEquals(expResult, result);\n bytes = \"\";\n expResult = \"0:\";\n result = Bencoder.writeByteArray(bytes.getBytes(BConst.ASCII));\n assertEquals(expResult, result);\n }", "@Override\n\tpublic int insert(TestPoEntity entity) {\n\t\treturn 0;\n\t}", "@Test\n public void oneSize() throws Exception{\n rf.insert(testBlock);\n Assert.assertEquals(1, rf.size());\n }", "int insert(EventWithBLOBs record);", "int insert(Storage record);", "int insert(Storage record);", "@Test\n\tpublic void testInsertObj() {\n\t}", "public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}", "@Test\n public void testInsertAndSize() {\n this.iPQ.insert(1);\n assertEquals(\"Integer PQHeap size is: \",\n 1, this.iPQ.size());\n }", "int insert(Position record);", "int insert(ResPartnerBankEntityWithBLOBs record);", "public long insert();", "public boolean put(byte[] key, byte[] value) throws Exception;", "@Override\n public boolean insert(T o) {\n // Makes sure only the same Object in in the Array\n/*\n if(type == null){\n type = o.getClass();\n }\n if(type != o.getClass()) return false;\n*/\n\n if(o == null) return false;\n if(contains(o)) return false;\n int hcode = hash(o);\n hcode %= array.length;\n array[hcode].add(o);\n return true;\n }", "@Override\n\tpublic boolean add(T insertItem) {\n\t\t// TODO Just add the item to the array\n\t\tif (isFull()) {\n\t\t\treturn false;\n\t\t}\n\t\tdata[size++] = insertItem;\n\t\treturn true;\n\t}", "int insert(Lbm83ChohyokanriPkey record);", "void insert(int insertSize);", "public abstract String insert(Object obj) ;", "void add(byte[] data, int offset, int length);", "int insert(IntegralExchange record);", "int insert(DebtsRecordEntity record);", "public void insertNextBytes( byte[] buffer, int byteOffset, int nBytes )\n throws IndexOutOfBoundsException;", "@Override\n\tpublic int insert(Cell record) {\n\t\treturn 0;\n\t}", "@Test\n\tpublic void testInsert() {\n\t\tHeap heap = new Heap(testArrayList.length + 1);\n\t\tdouble[] expected = new double[] { 1, 3, 24, 5, 15, 48, 32, 7, 36, 27, 38, 70, 53, 33, 93, 47 };\n\t\theap.build(testArrayList);\n\t\theap.insert(1);\n\t\tassertEquals(16, heap.getSize());\n\t\tassertArrayEquals(expected, heap.getKeyArray());\n\t}", "int insert(QuestionWithBLOBs record);", "public void testAppendBytesSuccess() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n String writeString = \"Hello World\";\r\n String fileCreationId = filePersistence.createFile(VALID_FILELOCATION, FILENAME);\r\n filePersistence.appendBytes(fileCreationId, writeString.getBytes());\r\n filePersistence.closeFile(fileCreationId);\r\n File file = new File(VALID_FILELOCATION, FILENAME);\r\n assertTrue(\"the file should exist\", file.exists());\r\n assertEquals(\"the current file size not correct\", file.length(), writeString.getBytes().length);\r\n filePersistence.deleteFile(VALID_FILELOCATION, FILENAME);\r\n }", "int insert(TestEntity record);", "@Override\n\tpublic void insert() {\n\t\t\n\t}", "int insert(Body record);", "int insert(DataSync record);", "int insert(TopicFragmentWithBLOBs record);", "int insert(TagData record);", "int insert(AccountPaymentMethodEntityWithBLOBs record);", "public void testInsert() {\r\n tree.insert(\"apple\");\r\n tree.insert(\"act\");\r\n tree.insert(\"bagel\");\r\n\r\n try {\r\n tree.insert(\"apple\");\r\n }\r\n catch (DuplicateItemException e) {\r\n assertNotNull(e);\r\n }\r\n }", "int insert(ChannelAli record);", "int insert(RecordLike record);", "int insert(IntegralBook record);", "public int insert(Address address) throws Exception;", "public void insertData(byte[] bytes, String tablename) throws IOException{\n String sql = \"INSERT INTO \" + tablename + \" (tree)\";\n sql += \" VALUES ( \" + bytes + \" )\";\n session.execute(sql);\n }", "int insert(Lbt72TesuryoSumDPkey record);", "@Override\n protected boolean shouldCopyOnInsertion(IChunk chunk)\n {\n return chunk.isEncoded();\n }", "int insert(Basicinfo record);", "@Override\n\tpublic int insert(Utente input) throws Exception {\n\t\treturn 0;\n\t}", "int insertSelective(ZlnfBiZzdkZzdkWithBLOBs record);", "public abstract boolean insert(Key key);", "@Override\r\n\tpublic void insert(BbsDto dto) {\n\t}", "int insert(TbSnapshot record);", "int insert(Kmffb record);", "int insert(NjOrderAttachment record);", "int insert(Clazz record);", "@Override\n\tpublic int WriteToByteArray(byte[] data, int pos) {\n\t\treturn 0;\n\t}", "public void testLength() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }", "int insert(MsgContent record);", "int insert(T record);", "int insert(Card record);", "void insert(Object value, int position);", "@Test\n public void writeTest() {\n try (ByteArrayOutputStream baos = new ByteArrayOutputStream();\n ByteArrayOutputStream baos2 = new ByteArrayOutputStream()) {\n // correspond to \"ABCDE\"\n // write a single byte\n baos.write(0x41);\n baos.write(0x42);\n baos.write(0x43);\n baos.write(0x44);\n baos.write(0x45);\n log.info(methodLog(0,\n \"Write \" + baos.size() + \" bytes\",\n \"baos\", String.format(\"%3d bytes:%s\", baos.size(), baos)));\n\n // write a specified size bytes\n baos.write(lettersByteArray, 0, SIZE_BLOCK);\n log.info(methodLog(1,\n \"Write a block of \" + SIZE_BLOCK,\n \"baos\", String.format(\"%3d bytes:%s\", baos.size(), baos)));\n\n // convert to a byte array\n byte[] buf = baos.toByteArray();\n log.info(methodLog(2,\n \"To a byte array\",\n \"buf\", String.format(\"%3d bytes:%s\", buf.length, new String(buf))));\n\n // write to another output stream\n baos.writeTo(baos2);\n log.info(methodLog(3,\n \"Write to another stream\",\n \"baos2\", String.format(\"%3d bytes:%s\", baos2.size(), baos2)));\n } catch (IOException e) {\n log.info(exceptionLog(e));\n }\n }", "<T> int insert(T obj);", "int insert(Yqbd record);", "public void insert()\n\t{\n\t}", "int insert(PrivateMessage record);", "int insert(Goodexistsingle record);", "int insert(AccountAccountTemplateEntityWithBLOBs record);", "int insert(DiaryFile record);", "public void testGetFileBytesIteratorSuccess() throws Exception {\r\n assertNotNull(\"setup fails\", filePersistence);\r\n String writeString = \"Hello World\";\r\n String fileCreationId = filePersistence.createFile(VALID_FILELOCATION, FILENAME);\r\n filePersistence.appendBytes(fileCreationId, writeString.getBytes());\r\n filePersistence.closeFile(fileCreationId);\r\n assertTrue(\"the file should exist\", new File(VALID_FILELOCATION, FILENAME).exists());\r\n BytesIterator bytesIterator = filePersistence.getFileBytesIterator(VALID_FILELOCATION, FILENAME);\r\n assertTrue(\"as already append bytes to it, hasNextBytes method should return true\", bytesIterator\r\n .hasNextBytes());\r\n bytesIterator.dispose();\r\n filePersistence.deleteFile(VALID_FILELOCATION, FILENAME);\r\n\r\n }", "int insert(BaseCountract record);", "int insertSelective(EventWithBLOBs record);", "int insert(Message record);", "int insertSelective(XxAreaWithBLOBs record);", "int insert(TBBearPer record);", "int insert(TbaDeliveryinfo record);", "void insert(VRpMnCellHoBhIbc record);", "BlobInfo putBlob(byte[] data);", "private void insert(int pos, T elem) {\n for (int i = size; i >= pos + 1; i--) {\n arr[i] = arr[i-1];\n }\n arr[pos] = elem;\n }", "@Test(expected = NullPointerException.class)\n public void testNullPointerExceptionInInsert() {\n noFile.insert(null);\n withFile.insert(null);\n }", "@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}", "@Override\n\tpublic int insert2(Object ob) {\n\t\treturn 0;\n\t}", "int insert(Usertype record);", "int insert(Abum record);", "public int insert( byte[] space, int size )\n {\n caller = \"insert\";\n int position = findMemory( size );\n\n // If position = -1, then there is no available freeBlock large enough\n // to\n // Accommodate the space.\n if ( !( position == -1 ) )\n {\n // insert record at position\n for ( int i = 0; i < size; i++ )\n {\n memoryPool[position + i] = space[i];\n }\n\n // update the freeBlockList to match the updated memoryPool.\n updateFreeBlockList( position, size );\n }\n return position;\n }", "int insert(PdfCodeTemporary record);", "void insert(T value, int position);", "int insert(TbSerdeParams record);", "int insert(TCar record);", "int insert(BusnessOrder record);", "int insert(AccessKeyRecordEntity record);", "int insert(AvwFileprocess record);", "@Test\n public void testInsertNew() {\n System.out.println(\"insertNew\");\n Address obj = new Address(\"tregi\",\"333\",\"Porto\");;\n boolean expResult = true;\n boolean result = instance.insertNew(obj);\n assertEquals(expResult, result);\n }", "int insert(PaasCustomAutomationRecord record);", "int insert(ResourceWithBLOBs record);" ]
[ "0.8190232", "0.7174425", "0.62313914", "0.62291163", "0.6174947", "0.6133715", "0.6120054", "0.6084757", "0.60832214", "0.6074259", "0.5988667", "0.5985159", "0.5977033", "0.595825", "0.5945167", "0.5945167", "0.59201974", "0.59150034", "0.59125304", "0.58974266", "0.5869827", "0.58596146", "0.5847901", "0.58386487", "0.5815219", "0.5810585", "0.5805757", "0.57855374", "0.57817066", "0.5779774", "0.57666814", "0.57627773", "0.57578886", "0.5750749", "0.57486624", "0.57472384", "0.57434916", "0.57422197", "0.57397866", "0.5737696", "0.5730673", "0.5730523", "0.57252544", "0.5713505", "0.57119966", "0.5710157", "0.57088214", "0.57055616", "0.570011", "0.5698014", "0.56978655", "0.5686885", "0.56791705", "0.566694", "0.5662464", "0.5657027", "0.5654975", "0.5653001", "0.56525254", "0.56485224", "0.56485", "0.5639512", "0.5620986", "0.5619265", "0.5618728", "0.5608045", "0.5604836", "0.56020033", "0.5596115", "0.5593034", "0.55889386", "0.55881286", "0.5584503", "0.5580253", "0.5578841", "0.557771", "0.5576509", "0.5571408", "0.5567452", "0.556641", "0.5563108", "0.5559733", "0.55588114", "0.5558663", "0.55567276", "0.5543356", "0.5543356", "0.5537577", "0.5534421", "0.5531761", "0.5524428", "0.55244046", "0.55204195", "0.5517365", "0.55168056", "0.55117846", "0.55112666", "0.5510604", "0.55099845", "0.55087274" ]
0.8567876
0